Compare commits
14 Commits
0a3d6d8c4f
...
d1fcca82a0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1fcca82a0 | ||
|
|
b80da06152 | ||
|
|
86ee1a994c | ||
|
|
fca4ee32cd | ||
|
|
854ebc8025 | ||
|
|
2596661866 | ||
|
|
732474219c | ||
|
|
874a124588 | ||
|
|
5de2bb0a11 | ||
|
|
9ce4b511a5 | ||
|
|
f0d81a0cca | ||
|
|
4d8c43de29 | ||
|
|
004672ce4b | ||
|
|
3768f198be |
21
data/sql/updates/db_world/2025_02_18_00.sql
Normal file
21
data/sql/updates/db_world/2025_02_18_00.sql
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
-- DB update 2025_02_16_03 -> 2025_02_18_00
|
||||||
|
|
||||||
|
-- Remove Wrong Spawns
|
||||||
|
DELETE FROM `creature` WHERE `id1` = 28745;
|
||||||
|
|
||||||
|
-- Blight Cauldron Bunny 00 SmartAI
|
||||||
|
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28739;
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28739);
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(28739, 0, 0, 1, 8, 0, 100, 0, 52227, 0, 0, 0, 0, 0, 11, 52228, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Kill Credit\''),
|
||||||
|
(28739, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Cast \'Cauldron Diluted Effect\''),
|
||||||
|
(28739, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 12, 28745, 4, 30000, 0, 0, 0, 202, 20, 3, 1, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - On Spellhit \'Dilute Blight Cauldron\' - Summon Creature \'Alarmed Blightguard\''),
|
||||||
|
(28739, 0, 3, 0, 1, 0, 100, 512, 30000, 30000, 30000, 30000, 0, 0, 28, 52231, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blight Cauldron Bunny 00 - Out of Combat - Remove Aura \'Cauldron Diluted Effect\'');
|
||||||
|
|
||||||
|
-- Set Random Movement for Alarmed Blightguard
|
||||||
|
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28745;
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28745);
|
||||||
|
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||||
|
(28745, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 89, 10, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Alarmed Blightguard - On Reset - Start Random Movement');
|
||||||
@ -26,7 +26,12 @@ void WorldSession::SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos)
|
|||||||
packet << uint32(0); // BillingTimeRemaining
|
packet << uint32(0); // BillingTimeRemaining
|
||||||
packet << uint8(0); // BillingPlanFlags
|
packet << uint8(0); // BillingPlanFlags
|
||||||
packet << uint32(0); // BillingTimeRested
|
packet << uint32(0); // BillingTimeRested
|
||||||
packet << uint8(Expansion()); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account
|
uint8 exp = Expansion(); // 0 - normal, 1 - TBC, 2 - WOTLK, must be set in database manually for each account
|
||||||
|
|
||||||
|
if (exp >= MAX_EXPANSIONS)
|
||||||
|
exp = MAX_EXPANSIONS - 1;
|
||||||
|
|
||||||
|
packet << uint8(exp);
|
||||||
|
|
||||||
if (!shortForm)
|
if (!shortForm)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,17 +84,17 @@ void WorldSession::HandleTrainerListOpcode(WorldPacket& recvData)
|
|||||||
SendTrainerList(guid);
|
SendTrainerList(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendTrainerList(ObjectGuid guid)
|
void WorldSession::SendTrainerList(ObjectGuid guid, uint32 trainerEntry)
|
||||||
{
|
{
|
||||||
std::string str = GetAcoreString(LANG_NPC_TAINER_HELLO);
|
std::string str = GetAcoreString(LANG_NPC_TAINER_HELLO);
|
||||||
SendTrainerList(guid, str);
|
SendTrainerList(guid, str, trainerEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
|
void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle, uint32 trainerEntry)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("network", "WORLD: SendTrainerList");
|
LOG_DEBUG("network", "WORLD: SendTrainerList");
|
||||||
|
|
||||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
Creature* unit = trainerEntry ? GetPlayer()->GetMap()->GetCreature(guid) : GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
||||||
if (!unit)
|
if (!unit)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("network", "WORLD: SendTrainerList - Unit ({}) not found or you can not interact with him.", guid.ToString());
|
LOG_DEBUG("network", "WORLD: SendTrainerList - Unit ({}) not found or you can not interact with him.", guid.ToString());
|
||||||
@ -113,7 +113,8 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrainerSpellData const* trainer_spells = unit->GetTrainerSpells();
|
SetCurrentTrainer(trainerEntry);
|
||||||
|
TrainerSpellData const* trainer_spells = GetCurrentTrainer() ? sObjectMgr->GetNpcTrainerSpells(GetCurrentTrainer()) : unit->GetTrainerSpells();
|
||||||
if (!trainer_spells)
|
if (!trainer_spells)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("network", "WORLD: SendTrainerList - Training spells not found for creature ({})", guid.ToString());
|
LOG_DEBUG("network", "WORLD: SendTrainerList - Training spells not found for creature ({})", guid.ToString());
|
||||||
@ -216,7 +217,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
|||||||
|
|
||||||
recvData >> guid >> spellId;
|
recvData >> guid >> spellId;
|
||||||
|
|
||||||
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
Creature* unit = GetCurrentTrainer() ? sObjectMgr->GetNpcTrainerSpells(GetCurrentTrainer()) : GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
|
||||||
if (!unit)
|
if (!unit)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("network", "WORLD: HandleTrainerBuySpellOpcode - Unit ({}) not found or you can not interact with him.", guid.ToString());
|
LOG_DEBUG("network", "WORLD: HandleTrainerBuySpellOpcode - Unit ({}) not found or you can not interact with him.", guid.ToString());
|
||||||
@ -228,7 +229,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recvData)
|
|||||||
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
|
||||||
|
|
||||||
// check present spell in trainer spell list
|
// check present spell in trainer spell list
|
||||||
TrainerSpellData const* trainer_spells = unit->GetTrainerSpells();
|
TrainerSpellData const* trainer_spells = GetCurrentTrainer() ? sObjectMgr->GetNpcTrainerSpells(GetCurrentTrainer()) : unit->GetTrainerSpells();
|
||||||
if (!trainer_spells)
|
if (!trainer_spells)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -130,6 +130,7 @@ WorldSession::WorldSession(uint32 id, std::string&& name, std::shared_ptr<WorldS
|
|||||||
recruiterId(recruiter),
|
recruiterId(recruiter),
|
||||||
isRecruiter(isARecruiter),
|
isRecruiter(isARecruiter),
|
||||||
m_currentVendorEntry(0),
|
m_currentVendorEntry(0),
|
||||||
|
m_currentTrainerEntry(0),
|
||||||
_calendarEventCreationCooldown(0),
|
_calendarEventCreationCooldown(0),
|
||||||
_addonMessageReceiveCount(0),
|
_addonMessageReceiveCount(0),
|
||||||
_timeSyncClockDeltaQueue(6),
|
_timeSyncClockDeltaQueue(6),
|
||||||
@ -1147,57 +1148,64 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
|
|||||||
|
|
||||||
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
|
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
|
||||||
{
|
{
|
||||||
uint32 addonsCount;
|
try
|
||||||
addonInfo >> addonsCount; // addons count
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < addonsCount; ++i)
|
|
||||||
{
|
{
|
||||||
std::string addonName;
|
uint32 addonsCount;
|
||||||
uint8 enabled;
|
addonInfo >> addonsCount; // addons count
|
||||||
uint32 crc, unk1;
|
|
||||||
|
|
||||||
// check next addon data format correctness
|
for (uint32 i = 0; i < addonsCount; ++i)
|
||||||
if (addonInfo.rpos() + 1 > addonInfo.size())
|
|
||||||
return;
|
|
||||||
|
|
||||||
addonInfo >> addonName;
|
|
||||||
|
|
||||||
addonInfo >> enabled >> crc >> unk1;
|
|
||||||
|
|
||||||
LOG_DEBUG("network", "ADDON: Name: {}, Enabled: 0x{:x}, CRC: 0x{:x}, Unknown2: 0x{:x}", addonName, enabled, crc, unk1);
|
|
||||||
|
|
||||||
AddonInfo addon(addonName, enabled, crc, 2, true);
|
|
||||||
|
|
||||||
SavedAddon const* savedAddon = AddonMgr::GetAddonInfo(addonName);
|
|
||||||
if (savedAddon)
|
|
||||||
{
|
{
|
||||||
bool match = true;
|
std::string addonName;
|
||||||
|
uint8 enabled;
|
||||||
|
uint32 crc, unk1;
|
||||||
|
|
||||||
if (addon.CRC != savedAddon->CRC)
|
// check next addon data format correctness
|
||||||
match = false;
|
if (addonInfo.rpos() + 1 > addonInfo.size())
|
||||||
|
return;
|
||||||
|
|
||||||
if (!match)
|
addonInfo >> addonName;
|
||||||
LOG_DEBUG("network", "ADDON: {} was known, but didn't match known CRC (0x{:x})!", addon.Name, savedAddon->CRC);
|
|
||||||
|
addonInfo >> enabled >> crc >> unk1;
|
||||||
|
|
||||||
|
LOG_DEBUG("network", "ADDON: Name: {}, Enabled: 0x{:x}, CRC: 0x{:x}, Unknown2: 0x{:x}", addonName, enabled, crc, unk1);
|
||||||
|
|
||||||
|
AddonInfo addon(addonName, enabled, crc, 2, true);
|
||||||
|
|
||||||
|
SavedAddon const* savedAddon = AddonMgr::GetAddonInfo(addonName);
|
||||||
|
if (savedAddon)
|
||||||
|
{
|
||||||
|
bool match = true;
|
||||||
|
|
||||||
|
if (addon.CRC != savedAddon->CRC)
|
||||||
|
match = false;
|
||||||
|
|
||||||
|
if (!match)
|
||||||
|
LOG_DEBUG("network", "ADDON: {} was known, but didn't match known CRC (0x{:x})!", addon.Name, savedAddon->CRC);
|
||||||
|
else
|
||||||
|
LOG_DEBUG("network", "ADDON: {} was known, CRC is correct (0x{:x})", addon.Name, savedAddon->CRC);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
LOG_DEBUG("network", "ADDON: {} was known, CRC is correct (0x{:x})", addon.Name, savedAddon->CRC);
|
{
|
||||||
}
|
AddonMgr::SaveAddon(addon);
|
||||||
else
|
|
||||||
{
|
|
||||||
AddonMgr::SaveAddon(addon);
|
|
||||||
|
|
||||||
LOG_DEBUG("network", "ADDON: {} (0x{:x}) was not known, saving...", addon.Name, addon.CRC);
|
LOG_DEBUG("network", "ADDON: {} (0x{:x}) was not known, saving...", addon.Name, addon.CRC);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @todo: Find out when to not use CRC/pubkey, and other possible states.
|
||||||
|
m_addonsList.push_back(addon);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @todo: Find out when to not use CRC/pubkey, and other possible states.
|
uint32 currentTime;
|
||||||
m_addonsList.push_back(addon);
|
addonInfo >> currentTime;
|
||||||
|
LOG_DEBUG("network", "ADDON: CurrentTime: {}", currentTime);
|
||||||
|
|
||||||
|
if (addonInfo.rpos() != addonInfo.size())
|
||||||
|
LOG_DEBUG("network", "packet under-read!");
|
||||||
|
}
|
||||||
|
catch (ByteBufferException const& e)
|
||||||
|
{
|
||||||
|
LOG_ERROR("network", "Addon packet read error! {}", e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 currentTime;
|
|
||||||
addonInfo >> currentTime;
|
|
||||||
LOG_DEBUG("network", "ADDON: CurrentTime: {}", currentTime);
|
|
||||||
|
|
||||||
if (addonInfo.rpos() != addonInfo.size())
|
|
||||||
LOG_DEBUG("network", "packet under-read!");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LOG_ERROR("network", "Addon packet uncompress error!");
|
LOG_ERROR("network", "Addon packet uncompress error!");
|
||||||
|
|||||||
@ -380,6 +380,9 @@ public:
|
|||||||
uint32 GetCurrentVendor() const { return m_currentVendorEntry; }
|
uint32 GetCurrentVendor() const { return m_currentVendorEntry; }
|
||||||
void SetCurrentVendor(uint32 vendorEntry) { m_currentVendorEntry = vendorEntry; }
|
void SetCurrentVendor(uint32 vendorEntry) { m_currentVendorEntry = vendorEntry; }
|
||||||
|
|
||||||
|
[[nodiscard]] uint32 GetCurrentTrainer() const { return m_currentTrainerEntry; }
|
||||||
|
void SetCurrentTrainer(uint32 trainerEntry) { m_currentTrainerEntry = trainerEntry; }
|
||||||
|
|
||||||
ObjectGuid::LowType GetGuidLow() const;
|
ObjectGuid::LowType GetGuidLow() const;
|
||||||
void SetSecurity(AccountTypes security) { _security = security; }
|
void SetSecurity(AccountTypes security) { _security = security; }
|
||||||
std::string const& GetRemoteAddress() { return m_Address; }
|
std::string const& GetRemoteAddress() { return m_Address; }
|
||||||
@ -430,8 +433,8 @@ public:
|
|||||||
//void SendTestCreatureQueryOpcode(uint32 entry, ObjectGuid guid, uint32 testvalue);
|
//void SendTestCreatureQueryOpcode(uint32 entry, ObjectGuid guid, uint32 testvalue);
|
||||||
void SendNameQueryOpcode(ObjectGuid guid);
|
void SendNameQueryOpcode(ObjectGuid guid);
|
||||||
|
|
||||||
void SendTrainerList(ObjectGuid guid);
|
void SendTrainerList(ObjectGuid guid, uint32 trainerEntry = 0);
|
||||||
void SendTrainerList(ObjectGuid guid, std::string const& strTitle);
|
void SendTrainerList(ObjectGuid guid, std::string const& strTitle, uint32 trainerEntry = 0);
|
||||||
void SendListInventory(ObjectGuid guid, uint32 vendorEntry = 0);
|
void SendListInventory(ObjectGuid guid, uint32 vendorEntry = 0);
|
||||||
void SendShowBank(ObjectGuid guid);
|
void SendShowBank(ObjectGuid guid);
|
||||||
bool CanOpenMailBox(ObjectGuid guid);
|
bool CanOpenMailBox(ObjectGuid guid);
|
||||||
@ -1184,6 +1187,7 @@ private:
|
|||||||
bool isRecruiter;
|
bool isRecruiter;
|
||||||
LockedQueue<WorldPacket*> _recvQueue;
|
LockedQueue<WorldPacket*> _recvQueue;
|
||||||
uint32 m_currentVendorEntry;
|
uint32 m_currentVendorEntry;
|
||||||
|
uint32 m_currentTrainerEntry;
|
||||||
ObjectGuid m_currentBankerGUID;
|
ObjectGuid m_currentBankerGUID;
|
||||||
uint32 _offlineTime;
|
uint32 _offlineTime;
|
||||||
bool _kicked;
|
bool _kicked;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user