diff --git a/data/sql/updates/db_world/2022_12_28_00.sql b/data/sql/updates/db_world/2022_12_28_00.sql new file mode 100644 index 000000000..204c826f4 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_28_00.sql @@ -0,0 +1,24 @@ +-- DB update 2022_12_27_01 -> 2022_12_28_00 +-- +SET @OGUID := 50675; + +DELETE FROM `gameobject` WHERE `id` IN (178764, 178765) AND `ZoneId`=3703 AND `guid` BETWEEN @OGUID+0 AND @OGUID+47; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0 , 178764, 530, 3703, 3703, 1, 1, -2271.068603515625, 5565.81103515625, 67.00568389892578125, 2.792518377304077148, 0, 0, 0.984807014465332031, 0.173652306199073791, 120, 255, 1, 46902), +(@OGUID+1 , 178764, 530, 3703, 3703, 1, 1, -2267.534912109375, 5573.65673828125, 67.00290679931640625, 2.740161895751953125, 0, 0, 0.979924201965332031, 0.199370384216308593, 120, 255, 1, 46902), +(@OGUID+2 , 178765, 530, 3703, 3703, 1, 1, -2269.834228515625, 5568.56982421875, 67.004913330078125, 0, 0, 0, 0, 1, 120, 255, 1, 46902), +(@OGUID+3 , 178764, 530, 3703, 3703, 1, 1, -2272.033203125, 5563.20556640625, 67.00420379638671875, 2.827429771423339843, 0, 0, 0.987688064575195312, 0.156436234712600708, 120, 255, 1, 46902), +(@OGUID+4 , 178764, 530, 3703, 3703, 1, 1, -2264.985107421875, 5572.4501953125, 67.0045166015625, 1.169368624687194824, 0, 0, 0.551936149597167968, 0.833886384963989257, 120, 255, 1, 46902), +(@OGUID+5 , 178764, 530, 3703, 3703, 1, 1, -2268.71142578125, 5571.01953125, 67.00385284423828125, 2.740161895751953125, 0, 0, 0.979924201965332031, 0.199370384216308593, 120, 255, 1, 46902), +(@OGUID+6 , 178764, 530, 3703, 3703, 1, 1, -2272.909423828125, 5560.52978515625, 67.00284576416015625, 4.310965538024902343, 0, 0, -0.83388519287109375, 0.55193793773651123, 120, 255, 1, 46902), +(@OGUID+7 , 178764, 530, 3703, 3703, 1, 1, -2270.34814453125, 5559.4482421875, 67.005462646484375, 4.310965538024902343, 0, 0, -0.83388519287109375, 0.55193793773651123, 120, 255, 1, 46902), +(@OGUID+8 , 178764, 530, 3703, 3703, 1, 1, -2262.407470703125, 5571.27783203125, 67.0049285888671875, 1.169368624687194824, 0, 0, 0.551936149597167968, 0.833886384963989257, 120, 255, 1, 46902), +(@OGUID+9 , 178765, 530, 3703, 3703, 1, 1, -2260.2587890625, 5561.38916015625, 67.01305389404296875, 0, 0, 0, 0, 1, 120, 255, 1, 46902), +(@OGUID+10, 178764, 530, 3703, 3703, 1, 1, -2265.07421875, 5557.19189453125, 67.00565338134765625, 4.310965538024902343, 0, 0, -0.83388519287109375, 0.55193793773651123, 120, 255, 1, 46902), +(@OGUID+11, 178764, 530, 3703, 3703, 1, 1, -2257.212158203125, 5569.00244140625, 67.00687408447265625, 1.169368624687194824, 0, 0, 0.551936149597167968, 0.833886384963989257, 120, 255, 1, 46902), +(@OGUID+12, 178764, 530, 3703, 3703, 1, 1, -2259.40283203125, 5563.6630859375, 67.01308441162109375, 5.89921426773071289, 0, 0, -0.19080829620361328, 0.981627285480499267, 120, 255, 1, 46902), +(@OGUID+13, 178764, 530, 3703, 3703, 1, 1, -2259.855712890625, 5570.13671875, 67.0053253173828125, 1.169368624687194824, 0, 0, 0.551936149597167968, 0.833886384963989257, 120, 255, 1, 46902), +(@OGUID+14, 178764, 530, 3703, 3703, 1, 1, -2261.313720703125, 5558.73876953125, 67.00978851318359375, 5.89921426773071289, 0, 0, -0.19080829620361328, 0.981627285480499267, 120, 255, 1, 46902), +(@OGUID+15, 178764, 530, 3703, 3703, 1, 1, -2267.728271484375, 5558.32666015625, 67.00565338134765625, 4.310965538024902343, 0, 0, -0.83388519287109375, 0.55193793773651123, 120, 255, 1, 46902), +(@OGUID+16, 178764, 530, 3703, 3703, 1, 1, -2262.440673828125, 5556.1025390625, 67.0064697265625, 5.89921426773071289, 0, 0, -0.19080829620361328, 0.981627285480499267, 120, 255, 1, 46902), +(@OGUID+17, 178764, 530, 3703, 3703, 1, 1, -2258.307861328125, 5566.337890625, 67.00997161865234375, 5.89921426773071289, 0, 0, -0.19080829620361328, 0.981627285480499267, 120, 255, 1, 46902); diff --git a/data/sql/updates/db_world/2022_12_28_01.sql b/data/sql/updates/db_world/2022_12_28_01.sql new file mode 100644 index 000000000..30358c176 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_28_01.sql @@ -0,0 +1,5 @@ +-- DB update 2022_12_28_00 -> 2022_12_28_01 +-- Sniffed +UPDATE `creature_template` SET `type_flags`=`type_flags`|134217856 WHERE (`entry` = 18240); +UPDATE `creature_template_addon` SET `bytes1` = 0, `bytes2` = 1, `auras` = '31261' WHERE (`entry` = 18240); +DELETE FROM `creature_addon` WHERE `guid` IN (84446,84447,84448,84449,84450,84451,84452,84453,84454,84455,84456,84457,84458,84460,84461,84462,84463,84464,84465,84466,84467,84468,84469,84470,84471,84472,84473,84474,84475,84476,84477,84478,84479,84480,84481); diff --git a/data/sql/updates/db_world/2022_12_28_02.sql b/data/sql/updates/db_world/2022_12_28_02.sql new file mode 100644 index 000000000..705f1c4dc --- /dev/null +++ b/data/sql/updates/db_world/2022_12_28_02.sql @@ -0,0 +1,5 @@ +-- DB update 2022_12_28_01 -> 2022_12_28_02 +-- Fix translations of quest 456 to say 4 kills instead of 3 +UPDATE `quest_template_locale` SET `Objectives`='Mata a 4 sables de la noche y 4 jabalíes cardo jóvenes.' WHERE `ID`=456 AND `locale` IN ('esES', 'esMX'); +UPDATE `quest_template_locale` SET `Objectives`='Tuez 4 Jeunes sabres-de-nuit et 4 Jeunes sangliers des chardons.' WHERE `ID`=456 AND `locale`='frFR'; +UPDATE `quest_template_locale` SET `Objectives`='Tötet 4 junge Nachtsäbler sowie 4 junge Disteleber.' WHERE `ID`=456 AND `locale`='deDE'; diff --git a/data/sql/updates/db_world/2022_12_29_00.sql b/data/sql/updates/db_world/2022_12_29_00.sql new file mode 100644 index 000000000..e3f1919d9 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_00.sql @@ -0,0 +1,2 @@ +-- DB update 2022_12_28_02 -> 2022_12_29_00 +UPDATE `creature_equip_template` SET `ItemID2`=0 WHERE `CreatureID`=4217 AND `ID`=1; diff --git a/data/sql/updates/db_world/2022_12_29_01.sql b/data/sql/updates/db_world/2022_12_29_01.sql new file mode 100644 index 000000000..55510e4d3 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_01.sql @@ -0,0 +1,12 @@ +-- DB update 2022_12_29_00 -> 2022_12_29_01 +DELETE FROM `gossip_menu` WHERE `MenuID` = 5501; +INSERT INTO `gossip_menu` (`MenuID`, `TextID`) VALUES (5501, 6554); + +UPDATE `gossip_menu_option` SET `ActionMenuID` = 5501 WHERE `MenuID` = 5502; + +UPDATE `conditions` SET `ConditionValue1` = 1030, `Comment` = 'Only show gossip option if player has completed quest 1030' WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 5502 AND `ConditionTypeOrReference` = 8; + +UPDATE `npc_text` SET `ID` = 6554 WHERE `ID` = 50001; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 3691 AND `id`= 7; +UPDATE `smart_scripts` SET `link` = 0 WHERE `entryorguid` = 3691 AND `id` = 6; diff --git a/data/sql/updates/db_world/2022_12_29_02.sql b/data/sql/updates/db_world/2022_12_29_02.sql new file mode 100644 index 000000000..cbfd623b6 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_02.sql @@ -0,0 +1,2 @@ +-- DB update 2022_12_29_01 -> 2022_12_29_02 +DELETE FROM `creature_loot_template` WHERE `Entry` = 18681 AND `Item` = 31245; diff --git a/data/sql/updates/db_world/2022_12_29_03.sql b/data/sql/updates/db_world/2022_12_29_03.sql new file mode 100644 index 000000000..4102d3001 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_03.sql @@ -0,0 +1,8 @@ +-- DB update 2022_12_29_02 -> 2022_12_29_03 +-- +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|2 WHERE (`entry` IN (19310, 19409, 21133)); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 21133; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 21133) AND (`source_type` = 0) AND (`id` IN (0)); +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`, `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 +(21133, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 3, 0, 16387, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Corporal Ironridge - On Respawn - Morph To Model 16387 - Woraround for modelid - Gender'); diff --git a/data/sql/updates/db_world/2022_12_29_04.sql b/data/sql/updates/db_world/2022_12_29_04.sql new file mode 100644 index 000000000..68757cc59 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_04.sql @@ -0,0 +1,3 @@ +-- DB update 2022_12_29_03 -> 2022_12_29_04 +-- +UPDATE `creature` SET `id1`=18453, `equipment_id`=0 WHERE `id1`=18454 AND `guid`=65943; diff --git a/data/sql/updates/db_world/2022_12_29_05.sql b/data/sql/updates/db_world/2022_12_29_05.sql new file mode 100644 index 000000000..e2385c0b7 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_05.sql @@ -0,0 +1,3 @@ +-- DB update 2022_12_29_04 -> 2022_12_29_05 + +UPDATE `creature_template` SET `skinloot` = 0 WHERE (`entry` = 15316); diff --git a/data/sql/updates/db_world/2022_12_29_06.sql b/data/sql/updates/db_world/2022_12_29_06.sql new file mode 100644 index 000000000..80858f16d --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_06.sql @@ -0,0 +1,3 @@ +-- DB update 2022_12_29_05 -> 2022_12_29_06 +-- +UPDATE `smart_scripts` SET `event_flags`=`event_flags`&~512 WHERE `entryorguid`=4962 AND `source_type`=0; diff --git a/data/sql/updates/db_world/2022_12_29_07.sql b/data/sql/updates/db_world/2022_12_29_07.sql new file mode 100644 index 000000000..da24b9fcf --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_07.sql @@ -0,0 +1,2 @@ +-- DB update 2022_12_29_06 -> 2022_12_29_07 +UPDATE `smart_scripts` SET `target_type`=2 WHERE (`entryorguid` = 20713) AND (`source_type` = 0) AND (`id` IN (1)); diff --git a/data/sql/updates/db_world/2022_12_29_08.sql b/data/sql/updates/db_world/2022_12_29_08.sql new file mode 100644 index 000000000..bcef6db7c --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_08.sql @@ -0,0 +1,14 @@ +-- DB update 2022_12_29_07 -> 2022_12_29_08 +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17136; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 17136) AND (`source_type` = 0) AND (`id` IN (0, 1)); +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`, `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 +(17136, 0, 0, 0, 11, 0, 100, 1, 0, 0, 0, 0, 0, 11, 30798, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Boulderfist Warrior - On Respawn - Cast \'Dual Wield\' (No Repeat)'), +(17136, 0, 1, 0, 9, 0, 100, 0, 8, 25, 18000, 24000, 0, 11, 31994, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Boulderfist Warrior - Within 8-25 Range - Cast \'Shoulder Charge\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17137; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 17137) AND (`source_type` = 0) AND (`id` IN (0, 1, 2)); +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`, `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 +(17137, 0, 0, 0, 16, 0, 100, 0, 6742, 30, 15000, 45000, 0, 11, 6742, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Boulderfist Mage - On Friendly Unit Missing Buff \'Bloodlust\' - Cast \'Bloodlust\''), +(17137, 0, 1, 0, 0, 0, 100, 0, 5000, 9000, 9000, 12000, 0, 11, 20795, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Boulderfist Mage - In Combat - Cast \'Fire Blast\''), +(17137, 0, 2, 0, 0, 0, 100, 0, 5000, 9000, 3800, 5200, 0, 11, 9672, 0, 256, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Boulderfist Mage - In Combat - Cast \'Frostbolt\''); diff --git a/data/sql/updates/db_world/2022_12_29_09.sql b/data/sql/updates/db_world/2022_12_29_09.sql new file mode 100644 index 000000000..108d02e22 --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_09.sql @@ -0,0 +1,2 @@ +-- DB update 2022_12_29_08 -> 2022_12_29_09 +UPDATE `quest_template` SET `RewardChoiceItemID1` = 25574, `RewardChoiceItemQuantity1` = 1, `RewardChoiceItemID2` = 25575, `RewardChoiceItemQuantity2` = 1, `RewardChoiceItemID3` = 25576, `RewardChoiceItemQuantity3` = 1 WHERE (`ID` = 9866); diff --git a/data/sql/updates/db_world/2022_12_29_10.sql b/data/sql/updates/db_world/2022_12_29_10.sql new file mode 100644 index 000000000..4854374ae --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_10.sql @@ -0,0 +1,5 @@ +-- DB update 2022_12_29_09 -> 2022_12_29_10 +-- +DELETE FROM `creature_loot_template` WHERE (`Entry` = 18134) AND (`Item` IN (24427)); +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(18134, 24427, 0, 20, 1, 1, 0, 1, 1, 'Fen Strider - Fen Strider Tentacle'); diff --git a/data/sql/updates/db_world/2022_12_29_11.sql b/data/sql/updates/db_world/2022_12_29_11.sql new file mode 100644 index 000000000..db353ec9c --- /dev/null +++ b/data/sql/updates/db_world/2022_12_29_11.sql @@ -0,0 +1,2 @@ +-- DB update 2022_12_29_10 -> 2022_12_29_11 +DELETE FROM `creature` WHERE `id1` = 19461; diff --git a/src/server/apps/worldserver/worldserver.conf.dist b/src/server/apps/worldserver/worldserver.conf.dist index 74889c9e6..b18e57f72 100644 --- a/src/server/apps/worldserver/worldserver.conf.dist +++ b/src/server/apps/worldserver/worldserver.conf.dist @@ -1691,13 +1691,13 @@ WorldBossLevelDiff = 3 # Corpse.Decay.RAREELITE # Corpse.Decay.WORLDBOSS # Description: Time (in seconds) until creature corpse will decay if not looted or skinned. -# Default: 60 - (1 Minute, Corpse.Decay.NORMAL) +# Default: 300 - (5 Minutes, Corpse.Decay.NORMAL) # 300 - (5 Minutes, Corpse.Decay.RARE) # 300 - (5 Minutes, Corpse.Decay.ELITE) # 300 - (5 Minutes, Corpse.Decay.RAREELITE) # 3600 - (1 Hour, Corpse.Decay.WORLDBOSS) -Corpse.Decay.NORMAL = 60 +Corpse.Decay.NORMAL = 300 Corpse.Decay.RARE = 300 Corpse.Decay.ELITE = 300 Corpse.Decay.RAREELITE = 300 @@ -1707,9 +1707,9 @@ Corpse.Decay.WORLDBOSS = 3600 # Rate.Corpse.Decay.Looted # Description: Multiplier for Corpse.Decay.* to configure how long creature corpses stay # after they have been looted. -# Default: 0.5 +# Default: 1.0 -Rate.Corpse.Decay.Looted = 0.5 +Rate.Corpse.Decay.Looted = 1.0 # # Rate.Creature.Normal.Damage diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index d5288c4e4..0d9cc7c66 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -52,7 +52,7 @@ struct DefaultTargetSelector : public Acore::unary_function // playerOnly: self explaining // withMainTank: allow current tank to be selected // aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura - DefaultTargetSelector(Unit const* unit, float dist, bool playerOnly, bool withMainTank, int32 aura) : me(unit), m_dist(dist), except(withMainTank ? me->GetThreatMgr().GetCurrentVictim() : nullptr), m_playerOnly(playerOnly), m_aura(aura) {} + DefaultTargetSelector(Unit const* unit, float dist, bool playerOnly, bool withMainTank, int32 aura) : me(unit), m_dist(dist), except(!withMainTank ? me->GetThreatMgr().GetCurrentVictim() : nullptr), m_playerOnly(playerOnly), m_aura(aura) {} bool operator()(Unit const* target) const { diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index bc9c0c7dd..39e2dd6a9 100644 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -299,11 +299,12 @@ public: void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); // used for quest and scripted timed achievements void RemoveCriteriaProgress(AchievementCriteriaEntry const* entry); + CriteriaProgress* GetCriteriaProgress(AchievementCriteriaEntry const* entry); + private: enum ProgressType { PROGRESS_SET, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST, PROGRESS_RESET }; void SendAchievementEarned(AchievementEntry const* achievement) const; void SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const; - CriteriaProgress* GetCriteriaProgress(AchievementCriteriaEntry const* entry); void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET); void CompletedCriteriaFor(AchievementEntry const* achievement); bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index eae058aa2..a6a238d69 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4242,8 +4242,16 @@ void Player::DeleteFromDB(ObjectGuid::LowType lowGuid, uint32 accountId, bool up return; } + if (CharacterCacheEntry const* cache = sCharacterCache->GetCharacterCacheByGuid(playerGuid)) + { + std::string name = cache->Name; + sCharacterCache->DeleteCharacterCacheEntry(playerGuid, name); + } + if (updateRealmChars) + { sWorld->UpdateRealmCharCount(accountId); + } } /** @@ -13252,18 +13260,19 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons } } -void Player::StoreLootItem(uint8 lootSlot, Loot* loot) +LootItem* Player::StoreLootItem(uint8 lootSlot, Loot* loot, InventoryResult& msg) { QuestItem* qitem = nullptr; QuestItem* ffaitem = nullptr; QuestItem* conditem = nullptr; - LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem); + msg = EQUIP_ERR_OK; + LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem); if (!item || item->is_looted) { SendEquipError(EQUIP_ERR_ALREADY_LOOTED, nullptr, nullptr); - return; + return nullptr; } // Xinef: exploit protection, dont allow to loot normal items if player is not master loot and not below loot threshold @@ -13272,31 +13281,31 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) if (!qitem && !ffaitem && !conditem) { SendLootRelease(GetLootGUID()); - return; + return nullptr; } if (!item->AllowedForPlayer(this, loot->sourceWorldObjectGUID)) { SendLootRelease(GetLootGUID()); - return; + return nullptr; } // questitems use the blocked field for other purposes if (!qitem && item->is_blocked) { SendLootRelease(GetLootGUID()); - return; + return nullptr; } // xinef: dont allow protected item to be looted by someone else if (item->rollWinnerGUID && item->rollWinnerGUID != GetGUID()) { SendLootRelease(GetLootGUID()); - return; + return nullptr; } ItemPosCountVec dest; - InventoryResult msg = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item->itemid, item->count); + msg = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item->itemid, item->count); if (msg == EQUIP_ERR_OK) { AllowedLooterSet looters = item->GetAllowedLooters(); @@ -13344,7 +13353,11 @@ void Player::StoreLootItem(uint8 lootSlot, Loot* loot) sScriptMgr->OnLootItem(this, newitem, item->count, this->GetLootGUID()); } else + { SendEquipError(msg, nullptr, nullptr, item->itemid); + } + + return item; } uint32 Player::CalculateTalentsPoints() const diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index d18810527..e59645e9c 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1280,7 +1280,7 @@ public: bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count); void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false); void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } - void StoreLootItem(uint8 lootSlot, Loot* loot); + LootItem* StoreLootItem(uint8 lootSlot, Loot* loot, InventoryResult& msg); void UpdateLootAchievements(LootItem* item, Loot* loot); void UpdateTitansGrip(); @@ -2482,6 +2482,7 @@ public: void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0); void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); void CompletedAchievement(AchievementEntry const* entry); + [[nodiscard]] AchievementMgr* GetAchievementMgr() const { return m_achievementMgr; } [[nodiscard]] bool HasTitle(uint32 bitIndex) const; bool HasTitle(CharTitlesEntry const* title) const { return HasTitle(title->bit_index); } @@ -2854,8 +2855,6 @@ public: bool m_needZoneUpdate; - [[nodiscard]] AchievementMgr* GetAchievementMgr() const { return m_achievementMgr; } - private: // internal common parts for CanStore/StoreItem functions InventoryResult CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const; diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 172cf5fd6..76bac1473 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -82,14 +82,28 @@ void Totem::InitSummon() Minion::InitSummon(); if (m_type == TOTEM_PASSIVE && GetSpell()) - CastSpell(this, GetSpell(), true); + { + if (TotemSpellIds(GetUInt32Value(UNIT_CREATED_BY_SPELL)) == TotemSpellIds::FireTotemSpell) + { + m_Events.AddEventAtOffset([this]() + { + CastSpell(this, GetSpell(), true); + }, 4s); + } + else + { + CastSpell(this, GetSpell(), true); + } + } // Some totems can have both instant effect and passive spell - if(GetSpell(1)) + if (GetSpell(1)) + { CastSpell(this, GetSpell(1), true); + } // xinef: this is better than the script, 100% sure to work - if(GetEntry() == SENTRY_TOTEM_ENTRY) + if (GetEntry() == SENTRY_TOTEM_ENTRY) { SetReactState(REACT_AGGRESSIVE); GetOwner()->CastSpell(this, 6277, true); @@ -132,7 +146,7 @@ void Totem::UnSummon(uint32 msTime) // Remove Sentry Totem Aura if (GetEntry() == SENTRY_TOTEM_ENTRY) - owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); + owner->RemoveAurasDueToSpell(static_cast(TotemSpellIds::SentryTotemSpell)); //remove aura all party members too if (Player* player = owner->ToPlayer()) diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index cbfa6f3f0..fcaabf91d 100644 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -27,7 +27,12 @@ enum TotemType TOTEM_STATUE = 2 // copied straight from moongose, may need more implementation to work }; // Some Totems cast spells that are not in creature DB -#define SENTRY_TOTEM_SPELLID 6495 + +enum class TotemSpellIds : uint32 +{ + SentryTotemSpell = 6495, + FireTotemSpell = 32062 +}; #define SENTRY_TOTEM_ENTRY 3968 #define EARTHBIND_TOTEM_ENTRY 2630 diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a9ea53401..f580e292e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -20110,7 +20110,10 @@ void Unit::SendTeleportPacket(Position& pos) Position oldPos = { GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation() }; if (GetTypeId() == TYPEID_UNIT) Relocate(&pos); - + if (GetTypeId() == TYPEID_PLAYER) + { + ToPlayer()->SetCanTeleport(true); + } WorldPacket data2(MSG_MOVE_TELEPORT, 38); data2 << GetPackGUID(); BuildMovementPacket(&data2); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 7014c1506..5e7a1e7c8 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -2228,6 +2228,11 @@ bool Group::IsCreated() const return GetMembersCount() > 0; } +GroupType Group::GetGroupType() const +{ + return m_groupType; +} + ObjectGuid Group::GetLeaderGUID() const { return m_leaderGuid; diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index b838f9a64..cd949d3f5 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -214,6 +214,7 @@ public: bool isBFGroup() const; bool isBGGroup() const; bool IsCreated() const; + GroupType GetGroupType() const; ObjectGuid GetLeaderGUID() const; Player* GetLeader(); ObjectGuid GetGUID() const; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index bd1773b55..2c8c9f99a 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -653,7 +653,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData) sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid); Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false); - sCharacterCache->DeleteCharacterCacheEntry(guid, name); SendCharDelete(CHAR_DELETE_SUCCESS); } diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 41044a07c..d28613080 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -93,7 +93,16 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) loot = &creature->loot; } - player->StoreLootItem(lootSlot, loot); + InventoryResult msg; + LootItem* lootItem = player->StoreLootItem(lootSlot, loot, msg); + if (msg != EQUIP_ERR_OK && lguid.IsItem() && loot->loot_type != LOOT_CORPSE) + { + lootItem->is_looted = true; + loot->NotifyItemRemoved(lootItem->itemIndex); + loot->unlootedCount--; + + player->SendItemRetrievalMail(lootItem->itemid, lootItem->count); + } // If player is removing the last LootItem, delete the empty container. if (loot->isLooted() && lguid.IsItem()) diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 33d6a5b85..a1275b3d1 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -851,7 +851,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data) LOG_DEBUG("network", "UAD: type {}, time {}, decompressedSize {}", type, timestamp, decompressedSize); - if (type > NUM_ACCOUNT_DATA_TYPES) + if (type >= NUM_ACCOUNT_DATA_TYPES) return; if (decompressedSize == 0) // erase diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 6e5d25669..c01d46c98 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -627,7 +627,10 @@ void Loot::FillNotNormalLootFor(Player* player) if (!item->is_looted && item->freeforall && item->AllowedForPlayer(player, sourceWorldObjectGUID)) if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item->itemid)) if (proto->IsCurrencyToken()) - player->StoreLootItem(i, this); + { + InventoryResult msg; + player->StoreLootItem(i, this, msg); + } } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index c05b6c57c..e0870cfb9 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -583,7 +583,7 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_MOVESPEED] = 1.0f; } for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED]; - rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfigMgr->GetOption("Rate.Corpse.Decay.Looted", 0.5f); + rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfigMgr->GetOption("Rate.Corpse.Decay.Looted", 1.0f); rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfigMgr->GetOption("TargetPosRecalculateRange", 1.5f); if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE) @@ -1096,7 +1096,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfigMgr->GetOption("ChatStrictLinkChecking.Severity", 0); m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfigMgr->GetOption("ChatStrictLinkChecking.Kick", 0); - m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfigMgr->GetOption("Corpse.Decay.NORMAL", 60); + m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfigMgr->GetOption("Corpse.Decay.NORMAL", 300); m_int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfigMgr->GetOption("Corpse.Decay.RARE", 300); m_int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfigMgr->GetOption("Corpse.Decay.ELITE", 300); m_int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfigMgr->GetOption("Corpse.Decay.RAREELITE", 300);