From c0c85ebf0a5f33096e80c78062273eb7a8dfb4fd Mon Sep 17 00:00:00 2001 From: Kempec Halk <80704304+Gozzim@users.noreply.github.com> Date: Thu, 2 Jun 2022 15:11:53 +0200 Subject: [PATCH 001/104] feat(Core/Commands): deserter command offline & using targets & console support (#11921) --- .../rev_1653955272368406700.sql | 10 ++ src/server/scripts/Commands/cs_deserter.cpp | 123 ++++++++++++++---- 2 files changed, 109 insertions(+), 24 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1653955272368406700.sql diff --git a/data/sql/updates/pending_db_world/rev_1653955272368406700.sql b/data/sql/updates/pending_db_world/rev_1653955272368406700.sql new file mode 100644 index 000000000..3f55f3248 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653955272368406700.sql @@ -0,0 +1,10 @@ +-- +DELETE FROM `command` WHERE `name` IN ("deserter instance add", "deserter instance remove", "deserter instance remove all", "deserter bg add", "deserter bg remove", "deserter bg remove all"); + +INSERT INTO `command` (`name`, `security`, `help`) VALUES +("deserter instance add", 3, "Syntax: .deserter instance add $playerName $time \n\n Adds the instance deserter debuff to a player or your target with $time duration."), +("deserter instance remove", 3, "Syntax: .deserter instance remove $playerName \n\n Removes the instance deserter debuff from a player or your target."), +("deserter instance remove all", 3, "Syntax: .deserter instance remove all \n\n Removes the instance deserter debuff from all online and offline players."), +("deserter bg add", 3, "Syntax: .deserter bg add $playerName $time \n\n Adds the bg deserter debuff to a player or your target with $time duration."), +("deserter bg remove", 3, "Syntax: .deserter bg remove $playerName \n\n Removes the bg deserter debuff from a player or your target."), +("deserter bg remove all", 3, "Syntax: .deserter bg remove all \n\n Removes the bg deserter debuff from all online and offline players."); diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp index 6018cee1b..0cc93a62b 100644 --- a/src/server/scripts/Commands/cs_deserter.cpp +++ b/src/server/scripts/Commands/cs_deserter.cpp @@ -49,13 +49,15 @@ public: { static ChatCommandTable deserterInstanceCommandTable = { - { "add", HandleDeserterInstanceAdd, SEC_ADMINISTRATOR, Console::No }, - { "remove", HandleDeserterInstanceRemove, SEC_ADMINISTRATOR, Console::No } + { "add", HandleDeserterInstanceAdd, SEC_ADMINISTRATOR, Console::Yes }, + { "remove all", HandleDeserterInstanceRemoveAll, SEC_ADMINISTRATOR, Console::Yes }, + { "remove", HandleDeserterInstanceRemove, SEC_ADMINISTRATOR, Console::Yes } }; static ChatCommandTable deserterBGCommandTable = { - { "add", HandleDeserterBGAdd, SEC_ADMINISTRATOR, Console::No }, - { "remove", HandleDeserterBGRemove, SEC_ADMINISTRATOR, Console::No } + { "add", HandleDeserterBGAdd, SEC_ADMINISTRATOR, Console::Yes }, + { "remove all", HandleDeserterBGRemoveAll, SEC_ADMINISTRATOR, Console::Yes }, + { "remove", HandleDeserterBGRemove, SEC_ADMINISTRATOR, Console::Yes } }; static ChatCommandTable deserterCommandTable = @@ -90,9 +92,13 @@ public: * .deserter bg add 3600 (one hour) * @endcode */ - static bool HandleDeserterAdd(ChatHandler* handler, uint32 time, bool isInstance) + static bool HandleDeserterAdd(ChatHandler* handler, Optional player, uint32 time, bool isInstance) { - Player* player = handler->getSelectedPlayer(); + if (!player) + { + player = PlayerIdentifier::FromTargetOrSelf(handler); + } + if (!player) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -107,15 +113,42 @@ public: return false; } - Aura* aura = player->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, player); + Player* target = player->GetConnectedPlayer(); - if (!aura) + if (target) { - handler->SendSysMessage(LANG_BAD_VALUE); - handler->SetSentErrorMessage(true); - return false; + Aura* aura = target->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, target); + + if (!aura) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + aura->SetDuration(time * IN_MILLISECONDS); + + return true; } - aura->SetDuration(time * IN_MILLISECONDS); + + uint8 index = 0; + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AURA); + stmt->SetData(index++, player->GetGUID().GetCounter()); + stmt->SetData(index++, player->GetGUID().GetCounter()); + stmt->SetData(index++, 0); + stmt->SetData(index++, isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + stmt->SetData(index++, 1); + stmt->SetData(index++, 1); + stmt->SetData(index++, 1); + stmt->SetData(index++, 0); + stmt->SetData(index++, 0); + stmt->SetData(index++, 0); + stmt->SetData(index++, 0); + stmt->SetData(index++, 0); + stmt->SetData(index++, 0); + stmt->SetData(index++, isInstance ? 1800000 : 900000); + stmt->SetData(index++, time * 1000); + stmt->SetData(index, 0); + CharacterDatabase.Execute(stmt); return true; } @@ -139,9 +172,13 @@ public: * .deserter bg remove * @endcode */ - static bool HandleDeserterRemove(ChatHandler* handler, bool isInstance) + static bool HandleDeserterRemove(ChatHandler* handler, Optional player, bool isInstance) { - Player* player = handler->getSelectedPlayer(); + if (!player) + { + player = PlayerIdentifier::FromTargetOrSelf(handler); + } + if (!player) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -149,33 +186,71 @@ public: return false; } - player->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + Player* target = player->GetConnectedPlayer(); + + if (target) + { + target->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + return true; + } + + CharacterDatabase.Query("DELETE FROM character_aura WHERE guid = {} AND spell = {}", player->GetGUID().GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); return true; } - /// @sa HandleDeserterAdd() - static bool HandleDeserterInstanceAdd(ChatHandler* handler, uint32 time) + static bool HandleDeserterRemoveAll(ChatHandler* handler, bool isInstance) { - return HandleDeserterAdd(handler, time, true); + CharacterDatabase.Query("DELETE FROM character_aura WHERE spell = {} AND remainTime <= 1800000", isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + + std::shared_lock lock(*HashMapHolder::GetLock()); + HashMapHolder::MapType const& onlinePlayerList = ObjectAccessor::GetPlayers(); + for (HashMapHolder::MapType::const_iterator itr = onlinePlayerList.begin(); itr != onlinePlayerList.end(); ++itr) + { + Player* player = itr->second; + Aura* aura = player->GetAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + if (aura && aura->GetDuration() <= 1800000) + { + player->RemoveAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + } + } + + handler->PSendSysMessage("%s Deserter has been removed from all players", isInstance ? "Instance" : "Battleground"); + return true; } /// @sa HandleDeserterAdd() - static bool HandleDeserterBGAdd(ChatHandler* handler, uint32 time) + static bool HandleDeserterInstanceAdd(ChatHandler* handler, Optional player, uint32 time) { - return HandleDeserterAdd(handler, time, false); + return HandleDeserterAdd(handler, player, time, true); + } + + /// @sa HandleDeserterAdd() + static bool HandleDeserterBGAdd(ChatHandler* handler, Optional player, uint32 time) + { + return HandleDeserterAdd(handler, player, time, false); } /// @sa HandleDeserterRemove() - static bool HandleDeserterInstanceRemove(ChatHandler* handler) + static bool HandleDeserterInstanceRemove(ChatHandler* handler, Optional player) { - return HandleDeserterRemove(handler, true); + return HandleDeserterRemove(handler, player, true); } /// @sa HandleDeserterRemove() - static bool HandleDeserterBGRemove(ChatHandler* handler) + static bool HandleDeserterBGRemove(ChatHandler* handler, Optional player) { - return HandleDeserterRemove(handler, false); + return HandleDeserterRemove(handler, player, false); + } + + static bool HandleDeserterInstanceRemoveAll(ChatHandler* handler) + { + return HandleDeserterRemoveAll(handler, true); + } + + static bool HandleDeserterBGRemoveAll(ChatHandler* handler) + { + return HandleDeserterRemoveAll(handler, false); } }; From 2de12c79374bdb77396e60b2c44975ed69d8acec Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 2 Jun 2022 13:13:59 +0000 Subject: [PATCH 002/104] chore(DB): import pending files Referenced commit(s): c0c85ebf0a5f33096e80c78062273eb7a8dfb4fd --- .../rev_1653955272368406700.sql => db_world/2022_06_02_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1653955272368406700.sql => db_world/2022_06_02_00.sql} (96%) diff --git a/data/sql/updates/pending_db_world/rev_1653955272368406700.sql b/data/sql/updates/db_world/2022_06_02_00.sql similarity index 96% rename from data/sql/updates/pending_db_world/rev_1653955272368406700.sql rename to data/sql/updates/db_world/2022_06_02_00.sql index 3f55f3248..b8bfd5339 100644 --- a/data/sql/updates/pending_db_world/rev_1653955272368406700.sql +++ b/data/sql/updates/db_world/2022_06_02_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_05_30_02 -> 2022_06_02_00 -- DELETE FROM `command` WHERE `name` IN ("deserter instance add", "deserter instance remove", "deserter instance remove all", "deserter bg add", "deserter bg remove", "deserter bg remove all"); From cca4b90c93fed721415cb2862f602ca9b35c9519 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Thu, 2 Jun 2022 10:48:35 -0300 Subject: [PATCH 003/104] fix (Conditions): Loh'atu gossip (#11922) --- .../pending_db_world/rev_1653959480980961369.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1653959480980961369.sql diff --git a/data/sql/updates/pending_db_world/rev_1653959480980961369.sql b/data/sql/updates/pending_db_world/rev_1653959480980961369.sql new file mode 100644 index 000000000..8686d2082 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653959480980961369.sql @@ -0,0 +1,13 @@ +-- Condition for Loh'atu gossip +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3481; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15,3481,0,0,0,8,0,5535,0,0,0,0,0,'','Show gossip option 0 if player has quest ''Spiritual Unrest'' rewarded'), +(15,3481,0,0,0,8,0,5536,0,0,0,0,0,'','Show gossip option 0 if player has quest ''A Land Filled with Hatred'' rewarded'), +(15,3481,1,0,0,8,0,5535,0,0,0,0,0,'','Show gossip option 1 if player has quest ''Spiritual Unrest'' rewarded'), +(15,3481,1,0,0,8,0,5536,0,0,0,0,0,'','Show gossip option 1 if player has quest ''A Land Filled with Hatred'' rewarded'), +(15,3481,2,0,0,8,0,5535,0,0,0,0,0,'','Show gossip option 2 if player has quest ''Spiritual Unrest'' rewarded'), +(15,3481,2,0,0,8,0,5536,0,0,0,0,0,'','Show gossip option 2 if player has quest ''A Land Filled with Hatred'' rewarded'), +(15,3481,3,0,0,8,0,5535,0,0,0,0,0,'','Show gossip option 3 if player has quest ''Spiritual Unrest'' rewarded'), +(15,3481,3,0,0,8,0,5536,0,0,0,0,0,'','Show gossip option 3 if player has quest ''A Land Filled with Hatred'' rewarded'), +(15,3481,4,0,0,8,0,5535,0,0,0,0,0,'','Show gossip option 4 if player has quest ''Spiritual Unrest'' rewarded'), +(15,3481,4,0,0,8,0,5536,0,0,0,0,0,'','Show gossip option 4 if player has quest ''A Land Filled with Hatred'' rewarded'); From 24a80a16e6d850b445361cac907f748fa9235c20 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 2 Jun 2022 13:50:54 +0000 Subject: [PATCH 004/104] chore(DB): import pending files Referenced commit(s): cca4b90c93fed721415cb2862f602ca9b35c9519 --- .../rev_1653959480980961369.sql => db_world/2022_06_02_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1653959480980961369.sql => db_world/2022_06_02_01.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1653959480980961369.sql b/data/sql/updates/db_world/2022_06_02_01.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1653959480980961369.sql rename to data/sql/updates/db_world/2022_06_02_01.sql index 8686d2082..c70b7659f 100644 --- a/data/sql/updates/pending_db_world/rev_1653959480980961369.sql +++ b/data/sql/updates/db_world/2022_06_02_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_02_00 -> 2022_06_02_01 -- Condition for Loh'atu gossip DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=3481; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES From c027e907e1f3e00f4775cd91734f21b4dcf390f8 Mon Sep 17 00:00:00 2001 From: Meramaf <76571216+Meramaf@users.noreply.github.com> Date: Fri, 3 Jun 2022 14:24:37 +0200 Subject: [PATCH 005/104] fix(DB/Item): Fix ProcChance of Charred Twillight Scale Trinket (#11487) --- .../pending_db_world/rev_1650656505854517188.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1650656505854517188.sql diff --git a/data/sql/updates/pending_db_world/rev_1650656505854517188.sql b/data/sql/updates/pending_db_world/rev_1650656505854517188.sql new file mode 100644 index 000000000..e93348b43 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1650656505854517188.sql @@ -0,0 +1,16 @@ + +DELETE FROM `spell_proc_event` WHERE `entry` = '71602'; +DELETE FROM `spell_proc_event` WHERE `entry` = '75465'; +DELETE FROM `spell_proc_event` WHERE `entry` = '71845'; +DELETE FROM `spell_proc_event` WHERE `entry` = '71846'; +DELETE FROM `spell_proc_event` WHERE `entry` = '72419'; +DELETE FROM `spell_proc_event` WHERE `entry` = '75474'; + +UPDATE `item_template` SET `spellppmRate_1` = 10 WHERE (`entry` = 50353); +UPDATE `item_template` SET `spellppmRate_1` = 10 WHERE (`entry` = 50348); +UPDATE `item_template` SET `spellppmRate_1` = 2 WHERE (`entry` = 49992); +UPDATE `item_template` SET `spellppmRate_1` = 2 WHERE (`entry` = 50648); +UPDATE `item_template` SET `spellppmRate_1` = 10 WHERE (`entry` = 50400); +UPDATE `item_template` SET `spellppmRate_1` = 10 WHERE (`entry` = 50399); +UPDATE `item_template` SET `spellppmRate_1` = 10 WHERE (`entry` = 54572); +UPDATE `item_template` SET `spellppmRate_1` = 10 WHERE (`entry` = 54588); From 8e0b1ca286e11ccd1474895a5ded3ceae6b01403 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Fri, 3 Jun 2022 09:26:18 -0300 Subject: [PATCH 006/104] fix(Core/ZulGurub): more improvements to High Priestess Jeklik (#11604) * Fix(Core/ZulGurub): more improvements to High Priestess Jeklik * remove old comment * cancel phase one events on phase 2 * Update src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * Update src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> * style * build Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- .../rev_1651544130927167200.sql | 8 + .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 385 +++++++++--------- 2 files changed, 209 insertions(+), 184 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1651544130927167200.sql diff --git a/data/sql/updates/pending_db_world/rev_1651544130927167200.sql b/data/sql/updates/pending_db_world/rev_1651544130927167200.sql new file mode 100644 index 000000000..4e19d94f6 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1651544130927167200.sql @@ -0,0 +1,8 @@ +-- +UPDATE `creature_template` SET `speed_run` = 1.14286, `speed_walk` = 1.32 WHERE `entry` = 14517; + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_batrider_bomb'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(23970, 'spell_batrider_bomb'); + +UPDATE `gameobject_template` SET `Data2` = 6 WHERE `entry` = 180125; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index b6075f954..ebb69ebee 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -15,8 +15,11 @@ * with this program. If not, see . */ +#include "GameObjectAI.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "TaskScheduler.h" #include "zulgurub.h" enum Says @@ -49,7 +52,8 @@ enum Spells SPELL_GREATER_HEAL = 23954, // Batriders Spell - SPELL_BOMB = 40332 // Wrong ID but Magmadars bomb is not working... + SPELL_THROW_LIQUID_FIRE = 23970, + SPELL_SUMMON_LIQUID_FIRE = 23971 }; enum BatIds @@ -93,214 +97,227 @@ Position const SpawnBat[6] = { -12293.6220f, -1380.2640f, 144.8304f, 5.483f } }; -class boss_jeklik : public CreatureScript +struct boss_jeklik : public BossAI { -public: - boss_jeklik() : CreatureScript("boss_jeklik") { } + boss_jeklik(Creature* creature) : BossAI(creature, DATA_JEKLIK) { } - struct boss_jeklikAI : public BossAI + void Reset() override { - boss_jeklikAI(Creature* creature) : BossAI(creature, DATA_JEKLIK) { } + DoCastSelf(SPELL_GREEN_CHANNELING); + me->SetHover(false); + me->SetDisableGravity(false); + _Reset(); + } - void Reset() override + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + Talk(SAY_DEATH); + } + + void EnterEvadeMode(EvadeReason why) override + { + const Position homePos = me->GetHomePosition(); + me->NearTeleportTo(homePos.GetPositionX(), homePos.GetPositionY(), homePos.GetPositionZ(), homePos.GetOrientation()); + BossAI::EnterEvadeMode(why); + } + + void EnterCombat(Unit* /*who*/) override + { + _EnterCombat(); + Talk(SAY_AGGRO); + me->RemoveAurasDueToSpell(SPELL_GREEN_CHANNELING); + me->SetHover(true); + me->SetDisableGravity(true); + me->AddUnitState(UNIT_STATE_IGNORE_PATHFINDING); + DoCastSelf(SPELL_BAT_FORM); + events.SetPhase(PHASE_ONE); + + events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(10000, 20000), PHASE_ONE); + events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(5000, 15000), PHASE_ONE); + events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(5000, 15000), PHASE_ONE); + events.ScheduleEvent(EVENT_SONIC_BURST, urand(5000, 15000), PHASE_ONE); + events.ScheduleEvent(EVENT_SWOOP, 20000, PHASE_ONE); + events.ScheduleEvent(EVENT_SPAWN_BATS, 30000, PHASE_ONE); + } + + void DamageTaken(Unit* /*who*/, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + { + if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(50)) { - DoCastSelf(SPELL_GREEN_CHANNELING); - _Reset(); + me->RemoveAurasDueToSpell(SPELL_BAT_FORM); + me->SetHover(false); + me->SetDisableGravity(false); + DoResetThreat(); + events.SetPhase(PHASE_TWO); + events.CancelEventGroup(PHASE_ONE); + + events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, urand(5000, 15000), PHASE_TWO); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(10000, 15000), PHASE_TWO); + events.ScheduleEvent(EVENT_PSYCHIC_SCREAM, urand(25000, 35000), PHASE_TWO); + events.ScheduleEvent(EVENT_MIND_FLAY, urand(10000, 30000), PHASE_TWO); + events.ScheduleEvent(EVENT_GREATER_HEAL, 25000, PHASE_TWO); + events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, 10000, PHASE_TWO); + + return; } + } - void JustDied(Unit* /*killer*/) override + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - _JustDied(); - Talk(SAY_DEATH); - } - - void EnterCombat(Unit* /*who*/) override - { - _EnterCombat(); - Talk(SAY_AGGRO); - me->RemoveAurasDueToSpell(SPELL_GREEN_CHANNELING); - me->SetDisableGravity(true); - DoCastSelf(SPELL_BAT_FORM); - events.SetPhase(PHASE_ONE); - - events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(10000, 20000), PHASE_ONE); - events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(5000, 15000), PHASE_ONE); - events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(5000, 15000), PHASE_ONE); - events.ScheduleEvent(EVENT_SONIC_BURST, urand(5000, 15000), PHASE_ONE); - events.ScheduleEvent(EVENT_SWOOP, 20000, PHASE_ONE); - events.ScheduleEvent(EVENT_SPAWN_BATS, 30000, PHASE_ONE); - } - - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override - { - if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(50)) + switch (eventId) { - me->RemoveAurasDueToSpell(SPELL_BAT_FORM); - me->SetDisableGravity(false); - DoResetThreat(); - events.SetPhase(PHASE_TWO); - - events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, urand(5000, 15000), PHASE_TWO); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(10000, 15000), PHASE_TWO); - events.ScheduleEvent(EVENT_PSYCHIC_SCREAM, urand(25000, 35000), PHASE_TWO); - events.ScheduleEvent(EVENT_MIND_FLAY, urand(10000, 30000), PHASE_TWO); - events.ScheduleEvent(EVENT_GREATER_HEAL, 25000, PHASE_TWO); - events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, 10000, PHASE_TWO); - - return; - } - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - // Phase one - case EVENT_CHARGE_JEKLIK: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - DoCast(target, SPELL_CHARGE); - AttackStart(target); - } - events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(15000, 30000), PHASE_ONE); - break; - case EVENT_PIERCE_ARMOR: - DoCastVictim(SPELL_PIERCE_ARMOR); - events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(20000, 30000), PHASE_ONE); - break; - case EVENT_BLOOD_LEECH: - DoCastVictim(SPELL_BLOOD_LEECH); - events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(10000, 20000), PHASE_ONE); - break; - case EVENT_SONIC_BURST: - DoCastVictim(SPELL_SONIC_BURST); - events.ScheduleEvent(EVENT_SONIC_BURST, urand(20000, 30000), PHASE_ONE); - break; - case EVENT_SWOOP: - DoCastVictim(SPELL_SWOOP); - events.ScheduleEvent(EVENT_SWOOP, urand(20000, 30000), PHASE_ONE); - break; - case EVENT_SPAWN_BATS: - Talk(EMOTE_SUMMON_BATS); - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - for (uint8 i = 0; i < 6; ++i) - if (Creature* bat = me->SummonCreature(NPC_BLOODSEEKER_BAT, SpawnBat[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - bat->AI()->AttackStart(target); - events.ScheduleEvent(EVENT_SPAWN_BATS, 30000, PHASE_ONE); - break; + // Phase one + case EVENT_CHARGE_JEKLIK: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + { + DoCast(target, SPELL_CHARGE); + AttackStart(target); + } + events.ScheduleEvent(EVENT_CHARGE_JEKLIK, urand(15000, 30000), PHASE_ONE); + break; + case EVENT_PIERCE_ARMOR: + DoCastVictim(SPELL_PIERCE_ARMOR); + events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(20000, 30000), PHASE_ONE); + break; + case EVENT_BLOOD_LEECH: + DoCastVictim(SPELL_BLOOD_LEECH); + events.ScheduleEvent(EVENT_BLOOD_LEECH, urand(10000, 20000), PHASE_ONE); + break; + case EVENT_SONIC_BURST: + DoCastVictim(SPELL_SONIC_BURST); + events.ScheduleEvent(EVENT_SONIC_BURST, urand(20000, 30000), PHASE_ONE); + break; + case EVENT_SWOOP: + DoCastVictim(SPELL_SWOOP); + events.ScheduleEvent(EVENT_SWOOP, urand(20000, 30000), PHASE_ONE); + break; + case EVENT_SPAWN_BATS: + Talk(EMOTE_SUMMON_BATS); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + for (uint8 i = 0; i < 6; ++i) + if (Creature* bat = me->SummonCreature(NPC_BLOODSEEKER_BAT, SpawnBat[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) + bat->AI()->AttackStart(target); + events.ScheduleEvent(EVENT_SPAWN_BATS, 30000, PHASE_ONE); + break; //Phase two - case EVENT_CURSE_OF_BLOOD: - DoCastSelf(SPELL_CURSE_OF_BLOOD); - events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, urand(25000, 30000), PHASE_TWO); - break; - case EVENT_PSYCHIC_SCREAM: - DoCastVictim(SPELL_PSYCHIC_SCREAM); - events.ScheduleEvent(EVENT_PSYCHIC_SCREAM, urand(35000, 45000), PHASE_TWO); - break; - case EVENT_SHADOW_WORD_PAIN: - DoCastRandomTarget(SPELL_SHADOW_WORD_PAIN, 0, true); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(12000, 18000), PHASE_TWO); - break; - case EVENT_MIND_FLAY: - DoCastVictim(SPELL_MIND_FLAY); - events.ScheduleEvent(EVENT_MIND_FLAY, urand(20000, 40000), PHASE_TWO); - break; - case EVENT_GREATER_HEAL: - Talk(EMOTE_GREAT_HEAL); - me->InterruptNonMeleeSpells(false); - DoCastSelf(SPELL_GREATER_HEAL); - events.ScheduleEvent(EVENT_GREATER_HEAL, 25000, PHASE_TWO); - break; - case EVENT_SPAWN_FLYING_BATS: - Talk(SAY_CALL_RIDERS); - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - if (Creature* flyingBat = me->SummonCreature(NPC_FRENZIED_BAT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - flyingBat->AI()->AttackStart(target); - events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, urand(10000, 15000), PHASE_TWO); - break; - default: - break; - } + case EVENT_CURSE_OF_BLOOD: + DoCastSelf(SPELL_CURSE_OF_BLOOD); + events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, urand(25000, 30000), PHASE_TWO); + break; + case EVENT_PSYCHIC_SCREAM: + DoCastVictim(SPELL_PSYCHIC_SCREAM); + events.ScheduleEvent(EVENT_PSYCHIC_SCREAM, urand(35000, 45000), PHASE_TWO); + break; + case EVENT_SHADOW_WORD_PAIN: + DoCastRandomTarget(SPELL_SHADOW_WORD_PAIN, 0, true); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(12000, 18000), PHASE_TWO); + break; + case EVENT_MIND_FLAY: + DoCastVictim(SPELL_MIND_FLAY); + events.ScheduleEvent(EVENT_MIND_FLAY, urand(20000, 40000), PHASE_TWO); + break; + case EVENT_GREATER_HEAL: + Talk(EMOTE_GREAT_HEAL); + me->InterruptNonMeleeSpells(false); + DoCastSelf(SPELL_GREATER_HEAL); + events.ScheduleEvent(EVENT_GREATER_HEAL, 25000, PHASE_TWO); + break; + case EVENT_SPAWN_FLYING_BATS: + Talk(SAY_CALL_RIDERS); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + if (Creature* flyingBat = me->SummonCreature(NPC_FRENZIED_BAT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) + flyingBat->AI()->DoZoneInCombat(); + events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, urand(10000, 15000), PHASE_TWO); + break; + default: + break; } - - DoMeleeAttackIfReady(); } - }; - CreatureAI* GetAI(Creature* creature) const override - { - return GetZulGurubAI(creature); + DoMeleeAttackIfReady(); } }; // Flying Bat -class npc_batrider : public CreatureScript +struct npc_batrider : public ScriptedAI { -public: - npc_batrider() : CreatureScript("npc_batrider") { } - - struct npc_batriderAI : public ScriptedAI + npc_batrider(Creature* creature) : ScriptedAI(creature) { - npc_batriderAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 Bomb_Timer; - - void Reset() override + _scheduler.SetValidator([this] { - Bomb_Timer = 2000; - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->AddUnitState(UNIT_STATE_ROOT); - } + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + } - void EnterCombat(Unit* /*who*/) override { } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (Bomb_Timer <= diff) - { - std::list targets; - SelectTargetList(targets, 1, SelectTargetMethod::Random, 500.0f, true); - if (!targets.empty()) - { - if (targets.size() > 1) - { - targets.resize(1); - } - } - - for (std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) - { - me->CastSpell((*itr), SPELL_BOMB); - } - - Bomb_Timer = 7000; - } - else - Bomb_Timer -= diff; - } - }; - - CreatureAI* GetAI(Creature* creature) const override + void Reset() override { - return GetZulGurubAI(creature); + _scheduler.CancelAll(); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetHover(true); + me->SetDisableGravity(true); + me->AddUnitState(UNIT_STATE_ROOT); + } + + void EnterCombat(Unit* /*who*/) override + { + _scheduler.Schedule(2s, [this](TaskContext context) + { + DoCastRandomTarget(SPELL_THROW_LIQUID_FIRE); + context.Repeat(7s); + }); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _scheduler.Update(diff); + } + +private: + TaskScheduler _scheduler; +}; + +class spell_batrider_bomb : public SpellScript +{ + PrepareSpellScript(spell_batrider_bomb); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_LIQUID_FIRE }); + } + + void HandleScriptEffect(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Unit* target = GetHitUnit()) + { + target->CastSpell(target, SPELL_SUMMON_LIQUID_FIRE, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_batrider_bomb::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); } }; void AddSC_boss_jeklik() { - new boss_jeklik(); - new npc_batrider(); + RegisterCreatureAI(boss_jeklik); + RegisterCreatureAI(npc_batrider); + RegisterSpellScript(spell_batrider_bomb); } From e9e5613f9b946910fb8b2ba07b119f2f2f899aca Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Fri, 3 Jun 2022 12:28:15 +0000 Subject: [PATCH 007/104] chore(DB): import pending files Referenced commit(s): 8e0b1ca286e11ccd1474895a5ded3ceae6b01403 --- .../rev_1650656505854517188.sql => db_world/2022_06_03_00.sql} | 1 + .../rev_1651544130927167200.sql => db_world/2022_06_03_01.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1650656505854517188.sql => db_world/2022_06_03_00.sql} (95%) rename data/sql/updates/{pending_db_world/rev_1651544130927167200.sql => db_world/2022_06_03_01.sql} (88%) diff --git a/data/sql/updates/pending_db_world/rev_1650656505854517188.sql b/data/sql/updates/db_world/2022_06_03_00.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1650656505854517188.sql rename to data/sql/updates/db_world/2022_06_03_00.sql index e93348b43..3f9ba24fa 100644 --- a/data/sql/updates/pending_db_world/rev_1650656505854517188.sql +++ b/data/sql/updates/db_world/2022_06_03_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_02_01 -> 2022_06_03_00 DELETE FROM `spell_proc_event` WHERE `entry` = '71602'; DELETE FROM `spell_proc_event` WHERE `entry` = '75465'; diff --git a/data/sql/updates/pending_db_world/rev_1651544130927167200.sql b/data/sql/updates/db_world/2022_06_03_01.sql similarity index 88% rename from data/sql/updates/pending_db_world/rev_1651544130927167200.sql rename to data/sql/updates/db_world/2022_06_03_01.sql index 4e19d94f6..884fa1b1e 100644 --- a/data/sql/updates/pending_db_world/rev_1651544130927167200.sql +++ b/data/sql/updates/db_world/2022_06_03_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_03_00 -> 2022_06_03_01 -- UPDATE `creature_template` SET `speed_run` = 1.14286, `speed_walk` = 1.32 WHERE `entry` = 14517; From 08118e168fae86aeffcbc8094d5bca277b076b00 Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Fri, 3 Jun 2022 18:24:01 -0600 Subject: [PATCH 008/104] fix(DB/pathing): Badlands Missing Pathing (#11324) * fix(DB/pathing): Badlands Missing Pathing * Add correct movement flag to Badlands Buzzards * Remove old format version line --- .../rev_1647877892045091200.sql | 581 ++++++++++++++++++ 1 file changed, 581 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1647877892045091200.sql diff --git a/data/sql/updates/pending_db_world/rev_1647877892045091200.sql b/data/sql/updates/pending_db_world/rev_1647877892045091200.sql new file mode 100644 index 000000000..63cd49d30 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1647877892045091200.sql @@ -0,0 +1,581 @@ +/* Set correct movement flags for Buzzard creatures */ +UPDATE `creature_template_movement` SET `Ground` = 2 WHERE `CreatureId` IN (2830, 2829); + +/* Buzzard - GUID 7006 */ + + +SET @NPC := 7006; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6811.91, `position_y` = -3616.86, `position_z` = 247.556, `orientation` = 2.74597 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6809.25, -3596.17, 243.167, 100.0, 0, 2), +(@PATH, 2, -6797.86, -3589.94, 241.792, 100.0, 0, 2), +(@PATH, 3, -6758.9, -3579.09, 243.121, 100.0, 0, 2), +(@PATH, 4, -6745.04, -3555.24, 245.206, 100.0, 5000, 2), +(@PATH, 5, -6770.95, -3532.25, 245.837, 100.0, 0, 2), +(@PATH, 6, -6797.96, -3506.01, 242.788, 100.0, 0, 2), +(@PATH, 7, -6799.65, -3463.84, 241.792, 100.0, 0, 2), +(@PATH, 8, -6760.58, -3444.72, 241.988, 100.0, 0, 2), +(@PATH, 9, -6735.39, -3412.09, 241.792, 100.0, 0, 2), +(@PATH, 10, -6720.83, -3385.17, 241.785, 100.0, 0, 2), +(@PATH, 11, -6697.01, -3374.81, 243.211, 100.0, 0, 2), +(@PATH, 12, -6720.83, -3385.17, 241.785, 100.0, 0, 2), +(@PATH, 13, -6735.39, -3412.09, 241.792, 100.0, 0, 2), +(@PATH, 14, -6760.58, -3444.72, 241.988, 100.0, 0, 2), +(@PATH, 15, -6799.65, -3463.84, 241.792, 100.0, 0, 2), +(@PATH, 16, -6797.96, -3506.01, 242.788, 100.0, 0, 2), +(@PATH, 17, -6770.95, -3532.25, 245.837, 100.0, 0, 2), +(@PATH, 18, -6745.04, -3555.24, 245.206, 100.0, 0, 2), +(@PATH, 19, -6758.9, -3579.09, 243.121, 100.0, 0, 2), +(@PATH, 20, -6797.86, -3589.94, 241.792, 100.0, 0, 2), +(@PATH, 21, -6809.25, -3596.17, 243.167, 100.0, 0, 2), +(@PATH, 22, -6814.66, -3615.71, 247.226, 100.0, 0, 2); + +/* Buzzard - GUID 7137 */ + + +SET @NPC := 7137; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -7112.69, `position_y` = -3521.0, `position_z` = 246.566, `orientation` = 5.30948 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -7077.76, -3543.48, 241.898, 100.0, 0, 2), +(@PATH, 2, -7045.7, -3551.22, 243.829, 100.0, 0, 2), +(@PATH, 3, -7015.01, -3551.6, 243.641, 100.0, 0, 2), +(@PATH, 4, -6982.05, -3518.47, 242.542, 100.0, 0, 2), +(@PATH, 5, -6968.26, -3491.34, 241.792, 100.0, 0, 2), +(@PATH, 6, -6940.34, -3458.93, 241.792, 100.0, 0, 2), +(@PATH, 7, -6921.61, -3465.03, 242.421, 100.0, 0, 2), +(@PATH, 8, -6878.95, -3466.98, 244.479, 100.0, 0, 2), +(@PATH, 9, -6851.05, -3453.28, 244.063, 100.0, 0, 2), +(@PATH, 10, -6826.14, -3458.7, 244.067, 100.0, 0, 2), +(@PATH, 11, -6784.65, -3464.25, 241.792, 100.0, 0, 2), +(@PATH, 12, -6754.12, -3479.79, 242.417, 100.0, 0, 2), +(@PATH, 13, -6715.67, -3483.13, 241.924, 100.0, 0, 2), +(@PATH, 14, -6686.95, -3487.32, 252.35699999999997, 100.0, 0, 2), +(@PATH, 15, -6715.67, -3483.13, 241.799, 100.0, 0, 2), +(@PATH, 16, -6754.12, -3479.79, 242.417, 100.0, 0, 2), +(@PATH, 17, -6784.65, -3464.25, 241.792, 100.0, 0, 2), +(@PATH, 18, -6826.14, -3458.7, 244.067, 100.0, 0, 2), +(@PATH, 19, -6851.05, -3453.28, 244.063, 100.0, 0, 2), +(@PATH, 20, -6878.95, -3466.98, 244.479, 100.0, 0, 2), +(@PATH, 21, -6921.61, -3465.03, 242.421, 100.0, 0, 2), +(@PATH, 22, -6940.34, -3458.93, 241.792, 100.0, 0, 2), +(@PATH, 23, -6968.26, -3491.34, 241.792, 100.0, 0, 2), +(@PATH, 24, -6982.05, -3518.47, 242.542, 100.0, 0, 2), +(@PATH, 25, -7015.01, -3551.6, 243.641, 100.0, 0, 2), +(@PATH, 26, -7045.7, -3551.22, 243.829, 100.0, 0, 2), +(@PATH, 27, -7077.76, -3543.48, 241.898, 100.0, 0, 2), +(@PATH, 28, -7107.82, -3528.15, 245.41, 100.0, 0, 2); + +/* Shadowforge Surveyor - GUID 7220 */ + + +SET @NPC := 7220; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -6144.04, -3081.53, 225.98, 100.0, 0), +(@PATH, 2, -6146.38, -3077.72, 225.765, 100.0, 0), +(@PATH, 3, -6149.53, -3071.44, 226.486, 100.0, 0), +(@PATH, 4, -6152.11, -3068.48, 226.113, 100.0, 0), +(@PATH, 5, -6154.74, -3063.19, 225.002, 100.0, 0), +(@PATH, 6, -6155.24, -3055.54, 224.84, 100.0, 0), +(@PATH, 7, -6154.36, -3048.77, 224.491, 100.0, 0), +(@PATH, 8, -6150.64, -3042.61, 224.529, 100.0, 0), +(@PATH, 9, -6144.75, -3037.45, 224.996, 100.0, 0), +(@PATH, 10, -6137.22, -3033.51, 223.743, 100.0, 0), +(@PATH, 11, -6144.75, -3037.45, 224.996, 100.0, 0), +(@PATH, 12, -6150.64, -3042.61, 224.529, 100.0, 0), +(@PATH, 13, -6154.36, -3048.77, 224.491, 100.0, 0), +(@PATH, 14, -6155.24, -3055.54, 224.84, 100.0, 0), +(@PATH, 15, -6154.85, -3062.72, 224.862, 100.0, 0), +(@PATH, 16, -6152.16, -3068.39, 226.126, 100.0, 0), +(@PATH, 17, -6149.53, -3071.44, 226.486, 100.0, 0), +(@PATH, 18, -6146.38, -3077.72, 225.765, 100.0, 0), +(@PATH, 19, -6144.04, -3081.53, 225.98, 100.0, 0), +(@PATH, 20, -6141.79, -3087.05, 225.732, 100.0, 0); + +/* Shadowforge Digger - GUID 7224 */ + + +SET @NPC := 7224; +SET @PATH := @NPC * 10; + +UPDATE `creature_addon` set `path_id` = @PATH WHERE `guid` = @NPC; +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -6154.46, -3053.13, 224.826, 100.0, 0), +(@PATH, 2, -6154.06, -3046.47, 224.652, 100.0, 0), +(@PATH, 3, -6155.4, -3043.88, 224.422, 2.28, 45000), +(@PATH, 4, -6155.82, -3055.49, 224.807, 100.0, 0), +(@PATH, 5, -6153.58, -3059.57, 224.93, 100.0, 0), +(@PATH, 6, -6151.7, -3060.31, 225.245, 0.471239, 45000); + +/* Buzzard - GUID 7251 */ + + +SET @NPC := 7251; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6883.96, `position_y` = -3329.96, `position_z` = 248.58, `orientation` = 0.251015 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6888.0, -3356.21, 243.799, 100.0, 0, 2), +(@PATH, 2, -6901.86, -3377.27, 242.131, 100.0, 0, 2), +(@PATH, 3, -6933.3, -3395.66, 242.587, 100.0, 0, 2), +(@PATH, 4, -6933.27, -3431.34, 242.621, 100.0, 0, 2), +(@PATH, 5, -6924.07, -3460.16, 242.376, 100.0, 0, 2), +(@PATH, 6, -6951.56, -3493.01, 241.917, 100.0, 0, 2), +(@PATH, 7, -6944.84, -3526.17, 241.792, 100.0, 0, 2), +(@PATH, 8, -6926.08, -3562.52, 241.907, 100.0, 0, 2), +(@PATH, 9, -6915.77, -3598.79, 242.975, 100.0, 0, 2), +(@PATH, 10, -6951.36, -3628.01, 241.792, 100.0, 0, 2), +(@PATH, 11, -6934.38, -3651.09, 246.249, 100.0, 0, 2), +(@PATH, 12, -6951.36, -3628.01, 241.792, 100.0, 0, 2), +(@PATH, 13, -6915.77, -3598.79, 242.975, 100.0, 0, 2), +(@PATH, 14, -6926.08, -3562.52, 241.907, 100.0, 0, 2), +(@PATH, 15, -6944.84, -3526.17, 241.792, 100.0, 0, 2), +(@PATH, 16, -6951.56, -3493.01, 241.917, 100.0, 0, 2), +(@PATH, 17, -6924.07, -3460.16, 242.376, 100.0, 0, 2), +(@PATH, 18, -6933.27, -3431.34, 242.621, 100.0, 0, 2), +(@PATH, 19, -6933.3, -3395.66, 242.587, 100.0, 0, 2), +(@PATH, 20, -6901.86, -3377.27, 242.131, 100.0, 0, 2), +(@PATH, 21, -6888.0, -3356.21, 243.799, 100.0, 0, 2), +(@PATH, 22, -6879.02, -3328.7, 247.92, 100.0, 0, 2); + +/* Buzzard - GUID 7252 */ + + +SET @NPC := 7252; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6947.38, `position_y` = -3311.41, `position_z` = 260.875, `orientation` = 4.50295 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6932.46, -3343.0, 243.987, 100.0, 0, 2), +(@PATH, 2, -6936.72, -3372.14, 241.792, 100.0, 0, 2), +(@PATH, 3, -6936.86, -3388.97, 242.167, 100.0, 0, 2), +(@PATH, 4, -6957.8, -3415.2, 241.792, 100.0, 0, 2), +(@PATH, 5, -6981.07, -3437.66, 241.792, 100.0, 0, 2), +(@PATH, 6, -7012.01, -3448.14, 242.167, 100.0, 0, 2), +(@PATH, 7, -7034.03, -3482.56, 241.762, 100.0, 0, 2), +(@PATH, 8, -7041.37, -3520.53, 243.426, 100.0, 0, 2), +(@PATH, 9, -7044.2, -3550.63, 244.01, 100.0, 0, 2), +(@PATH, 10, -7085.11, -3563.21, 241.792, 100.0, 0, 2), +(@PATH, 11, -7098.92, -3597.39, 244.899, 100.0, 0, 2), +(@PATH, 12, -7085.11, -3563.21, 241.792, 100.0, 0, 2), +(@PATH, 13, -7044.2, -3550.63, 244.01, 100.0, 0, 2), +(@PATH, 14, -7041.37, -3520.53, 243.426, 100.0, 0, 2), +(@PATH, 15, -7034.03, -3482.56, 241.762, 100.0, 0, 2), +(@PATH, 16, -7012.01, -3448.14, 242.167, 100.0, 0, 2), +(@PATH, 17, -6981.07, -3437.66, 241.792, 100.0, 0, 2), +(@PATH, 18, -6957.8, -3415.2, 241.792, 100.0, 0, 2), +(@PATH, 19, -6936.86, -3388.97, 242.167, 100.0, 0, 2), +(@PATH, 20, -6936.72, -3372.14, 241.792, 100.0, 0, 2), +(@PATH, 21, -6932.46, -3343.0, 243.987, 100.0, 0, 2), +(@PATH, 22, -6946.19, -3315.67, 258.952, 100.0, 0, 2); + +/* Buzzard - GUID 7253 */ + + +SET @NPC := 7253; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -7181.01, `position_y` = -3326.08, `position_z` = 247.645, `orientation` = 0.822118 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -7147.13, -3335.6, 244.256, 100.0, 0, 2), +(@PATH, 2, -7120.95, -3360.97, 242.911, 100.0, 0, 2), +(@PATH, 3, -7112.48, -3395.7, 241.918, 100.0, 0, 2), +(@PATH, 4, -7093.57, -3428.64, 242.185, 100.0, 0, 2), +(@PATH, 5, -7063.82, -3436.23, 245.298, 100.0, 0, 2), +(@PATH, 6, -7031.27, -3456.35, 243.157, 100.0, 0, 2), +(@PATH, 7, -6998.35, -3486.11, 241.792, 100.0, 0, 2), +(@PATH, 8, -6992.29, -3516.26, 243.167, 100.0, 0, 2), +(@PATH, 9, -6970.74, -3551.4, 241.866, 100.0, 0, 2), +(@PATH, 10, -6947.52, -3554.22, 242.042, 100.0, 0, 2), +(@PATH, 11, -6919.98, -3577.41, 242.47, 100.0, 0, 2), +(@PATH, 12, -6901.67, -3608.33, 242.993, 100.0, 0, 2), +(@PATH, 13, -6891.81, -3634.18, 246.06, 100.0, 0, 2), +(@PATH, 14, -6901.67, -3608.33, 242.993, 100.0, 0, 2), +(@PATH, 15, -6919.98, -3577.41, 242.47, 100.0, 0, 2), +(@PATH, 16, -6947.52, -3554.22, 242.042, 100.0, 0, 2), +(@PATH, 17, -6970.74, -3551.4, 241.866, 100.0, 0, 2), +(@PATH, 18, -6992.29, -3516.26, 243.167, 100.0, 0, 2), +(@PATH, 19, -6998.35, -3486.11, 241.792, 100.0, 0, 2), +(@PATH, 20, -7031.27, -3456.35, 243.157, 100.0, 0, 2), +(@PATH, 21, -7063.82, -3436.23, 245.298, 100.0, 0, 2), +(@PATH, 22, -7093.57, -3428.64, 242.185, 100.0, 0, 2), +(@PATH, 23, -7112.48, -3395.7, 241.918, 100.0, 0, 2), +(@PATH, 24, -7120.95, -3360.97, 242.911, 100.0, 0, 2), +(@PATH, 25, -7147.13, -3335.6, 244.256, 100.0, 0, 2), +(@PATH, 26, -7177.73, -3322.53, 246.539, 100.0, 0, 2); + +/* Starving Buzzard - GUID 7561 */ + + +SET @NPC := 7561; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6388.68, `position_y` = -3576.89, `position_z` = 269.532, `orientation` = 4.08407 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6371.3, -3594.98, 247.97, 100.0, 0, 2), +(@PATH, 2, -6354.91, -3614.21, 242.14, 100.0, 0, 2), +(@PATH, 3, -6362.36, -3647.93, 242.31, 100.0, 0, 2), +(@PATH, 4, -6388.21, -3641.88, 242.295, 100.0, 0, 2), +(@PATH, 5, -6408.34, -3626.71, 250.96, 100.0, 0, 2), +(@PATH, 6, -6429.45, -3627.02, 257.59, 100.0, 0, 2), +(@PATH, 7, -6445.15, -3633.09, 254.014, 100.0, 0, 2), +(@PATH, 8, -6473.49, -3647.55, 244.618, 100.0, 0, 2), +(@PATH, 9, -6480.76, -3664.51, 247.527, 100.0, 0, 2), +(@PATH, 10, -6473.28, -3676.01, 252.08100000000002, 100.0, 0, 2), +(@PATH, 11, -6471.78, -3685.61, 256.946, 100.0, 0, 2), +(@PATH, 12, -6478.87, -3700.13, 265.363, 100.0, 0, 2), +(@PATH, 13, -6488.8, -3703.67, 270.987, 100.0, 0, 2), +(@PATH, 14, -6504.08, -3706.28, 273.873, 100.0, 0, 2), +(@PATH, 15, -6526.79, -3698.45, 272.456, 100.0, 0, 2), +(@PATH, 16, -6504.11, -3706.28, 273.991, 100.0, 0, 2), +(@PATH, 17, -6488.8, -3703.67, 270.987, 100.0, 0, 2), +(@PATH, 18, -6478.87, -3700.13, 265.363, 100.0, 0, 2), +(@PATH, 19, -6471.78, -3685.61, 256.946, 100.0, 0, 2), +(@PATH, 20, -6473.28, -3676.01, 252.08100000000002, 100.0, 0, 2), +(@PATH, 21, -6480.76, -3664.51, 247.527, 100.0, 0, 2), +(@PATH, 22, -6473.49, -3647.55, 244.618, 100.0, 0, 2), +(@PATH, 23, -6445.15, -3633.09, 254.014, 100.0, 0, 2), +(@PATH, 24, -6429.45, -3627.02, 257.59, 100.0, 0, 2), +(@PATH, 25, -6408.34, -3626.71, 250.96, 100.0, 0, 2), +(@PATH, 26, -6388.21, -3641.88, 242.295, 100.0, 0, 2), +(@PATH, 27, -6362.36, -3647.93, 242.31, 100.0, 0, 2), +(@PATH, 28, -6354.91, -3614.21, 242.14, 100.0, 0, 2), +(@PATH, 29, -6371.3, -3594.98, 247.97, 100.0, 0, 2), +(@PATH, 30, -6395.35, -3586.23, 270.905, 100.0, 0, 2); + +/* Starving Buzzard - GUID 7607 */ + + +SET @NPC := 7607; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6547.11, `position_y` = -3590.26, `position_z` = 263.315, `orientation` = 5.2796 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6546.91, -3612.78, 252.546, 100.0, 0, 2), +(@PATH, 2, -6567.01, -3630.33, 242.39, 100.0, 0, 2), +(@PATH, 3, -6596.16, -3615.76, 241.792, 100.0, 0, 2), +(@PATH, 4, -6621.69, -3592.92, 242.001, 100.0, 0, 2), +(@PATH, 5, -6643.48, -3599.43, 241.792, 100.0, 0, 2), +(@PATH, 6, -6653.5, -3629.29, 242.042, 100.0, 0, 2), +(@PATH, 7, -6665.13, -3654.09, 252.755, 100.0, 0, 2), +(@PATH, 8, -6655.26, -3666.55, 258.265, 100.0, 0, 2), +(@PATH, 9, -6648.55, -3671.17, 262.686, 100.0, 0, 2), +(@PATH, 10, -6634.89, -3676.32, 264.832, 100.0, 0, 2), +(@PATH, 11, -6615.17, -3681.26, 265.56, 100.0, 0, 2), +(@PATH, 12, -6593.81, -3698.81, 268.281, 100.0, 0, 2), +(@PATH, 13, -6571.59, -3703.16, 273.226, 100.0, 0, 2), +(@PATH, 14, -6547.1, -3700.65, 272.422, 100.0, 0, 2), +(@PATH, 15, -6571.59, -3703.16, 273.226, 100.0, 0, 2), +(@PATH, 16, -6593.81, -3698.81, 268.281, 100.0, 0, 2), +(@PATH, 17, -6615.17, -3681.26, 265.56, 100.0, 0, 2), +(@PATH, 18, -6634.89, -3676.32, 264.832, 100.0, 0, 2), +(@PATH, 19, -6648.55, -3671.17, 262.686, 100.0, 0, 2), +(@PATH, 20, -6655.26, -3666.55, 258.265, 100.0, 0, 2), +(@PATH, 21, -6665.13, -3654.09, 252.755, 100.0, 0, 2), +(@PATH, 22, -6653.5, -3629.29, 242.042, 100.0, 0, 2), +(@PATH, 23, -6643.48, -3599.43, 241.792, 100.0, 0, 2), +(@PATH, 24, -6621.69, -3592.92, 242.001, 100.0, 0, 2), +(@PATH, 25, -6596.16, -3615.76, 241.792, 100.0, 0, 2), +(@PATH, 26, -6567.01, -3630.33, 242.39, 100.0, 0, 2), +(@PATH, 27, -6546.91, -3612.78, 252.546, 100.0, 0, 2), +(@PATH, 28, -6545.3, -3593.11, 262.506, 100.0, 0, 2); + +/* Buzzard - GUID 7614 */ + + +SET @NPC := 7614; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6787.12, `position_y` = -3653.08, `position_z` = 247.035, `orientation` = 2.40914 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6772.58, -3640.43, 243.189, 100.0, 0, 2), +(@PATH, 2, -6754.54, -3631.1, 241.749, 100.0, 0, 2), +(@PATH, 3, -6755.22, -3618.73, 241.749, 100.0, 0, 2), +(@PATH, 4, -6752.14, -3604.26, 242.05, 100.0, 0, 2), +(@PATH, 5, -6737.61, -3596.97, 242.547, 100.0, 0, 2), +(@PATH, 6, -6721.14, -3587.47, 242.711, 100.0, 0, 2), +(@PATH, 7, -6716.05, -3564.79, 243.176, 100.0, 0, 2), +(@PATH, 8, -6688.82, -3544.26, 242.138, 100.0, 0, 2), +(@PATH, 9, -6661.65, -3516.61, 247.939, 100.0, 0, 2), +(@PATH, 10, -6658.14, -3483.01, 257.019, 100.0, 0, 2), +(@PATH, 11, -6648.16, -3458.14, 261.122, 100.0, 0, 2), +(@PATH, 12, -6658.12, -3412.55, 258.497, 100.0, 0, 2), +(@PATH, 13, -6648.16, -3458.14, 261.122, 100.0, 0, 2), +(@PATH, 14, -6658.14, -3483.01, 257.019, 100.0, 0, 2), +(@PATH, 15, -6661.65, -3516.61, 247.939, 100.0, 0, 2), +(@PATH, 16, -6688.82, -3544.26, 242.138, 100.0, 0, 2), +(@PATH, 17, -6715.98, -3564.71, 243.138, 100.0, 0, 2), +(@PATH, 18, -6721.04, -3587.42, 242.62, 100.0, 0, 2), +(@PATH, 19, -6737.61, -3596.97, 242.547, 100.0, 0, 2), +(@PATH, 20, -6752.14, -3604.26, 242.05, 100.0, 0, 2), +(@PATH, 21, -6755.22, -3618.73, 241.749, 100.0, 0, 2), +(@PATH, 22, -6754.54, -3631.1, 241.749, 100.0, 0, 2), +(@PATH, 23, -6772.58, -3640.43, 243.189, 100.0, 0, 2), +(@PATH, 24, -6787.63, -3652.62, 247.154, 100.0, 0, 2); + +/* Starving Buzzard - GUID 7705 */ + + +SET @NPC := 7705; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6344.17, `position_y` = -3295.69, `position_z` = 262.754, `orientation` = 4.18879 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6337.79, -3317.69, 249.862, 100.0, 0, 2), +(@PATH, 2, -6348.75, -3332.36, 242.44, 100.0, 0, 2), +(@PATH, 3, -6344.74, -3365.74, 241.792, 100.0, 0, 2), +(@PATH, 4, -6317.13, -3396.21, 240.141, 100.0, 0, 2), +(@PATH, 5, -6285.82, -3419.93, 239.051, 100.0, 0, 2), +(@PATH, 6, -6253.66, -3436.98, 237.79, 100.0, 0, 2), +(@PATH, 7, -6237.7, -3458.54, 239.34, 100.0, 0, 2), +(@PATH, 8, -6251.97, -3473.62, 246.596, 100.0, 0, 2), +(@PATH, 9, -6270.89, -3486.68, 252.644, 100.0, 0, 2), +(@PATH, 10, -6294.5, -3496.35, 250.91, 100.0, 0, 2), +(@PATH, 11, -6313.64, -3498.86, 246.061, 100.0, 0, 2), +(@PATH, 12, -6342.42, -3506.43, 241.834, 100.0, 0, 2), +(@PATH, 13, -6357.96, -3521.32, 246.796, 100.0, 0, 2), +(@PATH, 14, -6371.56, -3543.19, 259.244, 100.0, 0, 2), +(@PATH, 15, -6357.96, -3521.32, 246.796, 100.0, 0, 2), +(@PATH, 16, -6342.42, -3506.43, 241.834, 100.0, 0, 2), +(@PATH, 17, -6313.64, -3498.86, 246.061, 100.0, 0, 2), +(@PATH, 18, -6294.5, -3496.35, 250.91, 100.0, 0, 2), +(@PATH, 19, -6270.89, -3486.68, 252.644, 100.0, 0, 2), +(@PATH, 20, -6251.97, -3473.62, 246.596, 100.0, 0, 2), +(@PATH, 21, -6237.7, -3458.54, 239.34, 100.0, 0, 2), +(@PATH, 22, -6253.66, -3436.98, 237.79, 100.0, 0, 2), +(@PATH, 23, -6285.82, -3419.93, 239.051, 100.0, 0, 2), +(@PATH, 24, -6317.13, -3396.21, 240.141, 100.0, 0, 2), +(@PATH, 25, -6344.74, -3365.74, 241.792, 100.0, 0, 2), +(@PATH, 26, -6348.75, -3332.36, 242.44, 100.0, 0, 2), +(@PATH, 27, -6337.79, -3317.69, 249.862, 100.0, 0, 2), +(@PATH, 28, -6348.47, -3296.53, 262.444, 100.0, 0, 2); + +/* Starving Buzzard - GUID 7706 */ + + +SET @NPC := 7706; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6293.02, `position_y` = -3540.83, `position_z` = 255.493, `orientation` = 6.0912 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6309.64, -3551.04, 250.121, 100.0, 0, 2), +(@PATH, 2, -6330.5, -3565.26, 242.258, 100.0, 0, 2), +(@PATH, 3, -6356.39, -3578.34, 244.417, 100.0, 0, 2), +(@PATH, 4, -6360.57, -3601.59, 241.869, 100.0, 0, 2), +(@PATH, 5, -6363.55, -3635.48, 241.792, 100.0, 0, 2), +(@PATH, 6, -6383.01, -3653.02, 243.271, 100.0, 0, 2), +(@PATH, 7, -6400.48, -3665.74, 243.501, 100.0, 0, 2), +(@PATH, 8, -6423.64, -3669.32, 243.821, 100.0, 0, 2), +(@PATH, 9, -6449.26, -3667.73, 243.82, 100.0, 0, 2), +(@PATH, 10, -6473.78, -3659.77, 245.28, 100.0, 0, 2), +(@PATH, 11, -6486.57, -3671.69, 252.15499999999997, 100.0, 0, 2), +(@PATH, 12, -6473.78, -3659.77, 245.28, 100.0, 0, 2), +(@PATH, 13, -6449.26, -3667.73, 243.82, 100.0, 0, 2), +(@PATH, 14, -6423.64, -3669.32, 243.821, 100.0, 0, 2), +(@PATH, 15, -6400.48, -3665.74, 243.501, 100.0, 0, 2), +(@PATH, 16, -6383.01, -3653.02, 243.271, 100.0, 0, 2), +(@PATH, 17, -6363.55, -3635.48, 241.792, 100.0, 0, 2), +(@PATH, 18, -6360.57, -3601.59, 241.869, 100.0, 0, 2), +(@PATH, 19, -6356.46, -3578.38, 244.332, 100.0, 0, 2), +(@PATH, 20, -6330.5, -3565.26, 242.258, 100.0, 0, 2), +(@PATH, 21, -6309.64, -3551.04, 250.121, 100.0, 0, 2), +(@PATH, 22, -6293.6, -3543.78, 254.57100000000003, 100.0, 0, 2); + +/* Starving Buzzard - GUID 7724 */ + + +SET @NPC := 7724; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6118.22, `position_y` = -3446.35, `position_z` = 263.376, `orientation` = 1.68663 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6135.86, -3430.15, 250.7, 100.0, 0, 2), +(@PATH, 2, -6152.67, -3417.56, 244.799, 100.0, 0, 2), +(@PATH, 3, -6165.62, -3391.81, 243.028, 100.0, 0, 2), +(@PATH, 4, -6181.44, -3386.96, 241.163, 100.0, 0, 2), +(@PATH, 5, -6213.01, -3381.29, 239.398, 100.0, 0, 2), +(@PATH, 6, -6245.12, -3387.58, 239.271, 100.0, 0, 2), +(@PATH, 7, -6266.66, -3407.41, 239.168, 100.0, 0, 2), +(@PATH, 8, -6278.52, -3423.51, 238.746, 100.0, 0, 2), +(@PATH, 9, -6314.57, -3442.77, 239.492, 100.0, 0, 2), +(@PATH, 10, -6337.46, -3462.88, 241.753, 100.0, 0, 2), +(@PATH, 11, -6347.84, -3477.28, 241.86, 100.0, 0, 2), +(@PATH, 12, -6338.71, -3515.47, 241.834, 100.0, 0, 2), +(@PATH, 13, -6333.27, -3534.63, 241.685, 100.0, 0, 2), +(@PATH, 14, -6307.21, -3550.54, 250.302, 100.0, 0, 2), +(@PATH, 15, -6286.62, -3543.03, 258.238, 100.0, 0, 2), +(@PATH, 16, -6307.21, -3550.54, 250.302, 100.0, 0, 2), +(@PATH, 17, -6333.27, -3534.63, 241.685, 100.0, 0, 2), +(@PATH, 18, -6338.71, -3515.47, 241.834, 100.0, 0, 2), +(@PATH, 19, -6347.84, -3477.28, 241.86, 100.0, 0, 2), +(@PATH, 20, -6337.46, -3462.88, 241.753, 100.0, 0, 2), +(@PATH, 21, -6314.57, -3442.77, 239.492, 100.0, 0, 2), +(@PATH, 22, -6278.52, -3423.51, 238.746, 100.0, 0, 2), +(@PATH, 23, -6266.66, -3407.41, 239.168, 100.0, 0, 2), +(@PATH, 24, -6245.12, -3387.58, 239.271, 100.0, 0, 2), +(@PATH, 25, -6213.01, -3381.29, 239.398, 100.0, 0, 2), +(@PATH, 26, -6181.51, -3386.97, 241.042, 100.0, 0, 2), +(@PATH, 27, -6165.62, -3391.81, 243.028, 100.0, 0, 2), +(@PATH, 28, -6152.73, -3417.5, 244.855, 100.0, 0, 2), +(@PATH, 29, -6135.91, -3430.1, 250.674, 100.0, 0, 2), +(@PATH, 30, -6118.29, -3445.71, 263.008, 100.0, 0, 2); + +/* Shadowforge Digger - GUID 7736 */ + + +SET @NPC := 7736; +SET @PATH := @NPC * 10; + +UPDATE `creature_addon` set `path_id` = @PATH WHERE `guid` = @NPC; +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -6116.14, -3006.02, 223.452, 100.0, 45000), +(@PATH, 2, -6123.77, -3009.48, 221.833, 2.9947, 45000); + +/* Starving Buzzard - GUID 7796 */ + + +SET @NPC := 7796; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6363.76, `position_y` = -3508.55, `position_z` = 246.23, `orientation` = 5.96903 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`) VALUES +(@PATH, 1, -6368.26, -3466.82, 244.829, 100.0, 0, 2), +(@PATH, 2, -6362.57, -3443.06, 241.753, 100.0, 0, 2), +(@PATH, 3, -6345.93, -3416.62, 241.559, 100.0, 0, 2), +(@PATH, 4, -6313.67, -3401.18, 239.946, 100.0, 0, 2), +(@PATH, 5, -6285.39, -3406.43, 239.255, 100.0, 0, 2), +(@PATH, 6, -6257.33, -3442.1, 237.983, 100.0, 0, 2), +(@PATH, 7, -6238.56, -3451.22, 238.124, 100.0, 0, 2), +(@PATH, 8, -6210.24, -3438.81, 238.298, 100.0, 0, 2), +(@PATH, 9, -6198.03, -3408.55, 239.194, 100.0, 0, 2), +(@PATH, 10, -6192.33, -3386.96, 239.292, 100.0, 0, 2), +(@PATH, 11, -6174.5, -3369.47, 245.401, 100.0, 0, 2), +(@PATH, 12, -6149.01, -3369.75, 244.548, 100.0, 0, 2), +(@PATH, 13, -6174.5, -3369.47, 245.401, 100.0, 0, 2), +(@PATH, 14, -6192.33, -3386.96, 239.292, 100.0, 0, 2), +(@PATH, 15, -6198.03, -3408.55, 239.194, 100.0, 0, 2), +(@PATH, 16, -6210.24, -3438.81, 238.298, 100.0, 0, 2), +(@PATH, 17, -6238.56, -3451.22, 238.124, 100.0, 0, 2), +(@PATH, 18, -6257.33, -3442.1, 237.983, 100.0, 0, 2), +(@PATH, 19, -6285.39, -3406.43, 239.255, 100.0, 0, 2), +(@PATH, 20, -6313.67, -3401.18, 239.946, 100.0, 0, 2), +(@PATH, 21, -6345.93, -3416.62, 241.559, 100.0, 0, 2), +(@PATH, 22, -6362.57, -3443.06, 241.753, 100.0, 0, 2), +(@PATH, 23, -6368.25, -3466.71, 244.777, 100.0, 0, 2), +(@PATH, 24, -6360.65, -3507.1, 244.52, 100.0, 0, 2); + +/* Shadowforge Ruffian - GUID 9230 */ + + +SET @NPC := 9230; +SET @PATH := @NPC * 10; + +UPDATE `creature_addon` set `path_id` = @PATH WHERE `guid` = @NPC; +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -6071.02, -3133.92, 254.006, 100.0, 0), +(@PATH, 2, -6067.03, -3134.64, 253.744, 100.0, 0), +(@PATH, 3, -6069.15, -3137.9, 254.253, 100.0, 0), +(@PATH, 4, -6076.13, -3133.62, 253.989, 100.0, 0), +(@PATH, 5, -6080.28, -3131.97, 253.426, 100.0, 0), +(@PATH, 6, -6084.9, -3130.2, 253.631, 100.0, 0), +(@PATH, 7, -6088.52, -3124.03, 252.514, 100.0, 0), +(@PATH, 8, -6089.38, -3117.48, 251.538, 100.0, 0), +(@PATH, 9, -6089.48, -3111.04, 251.394, 100.0, 0), +(@PATH, 10, -6089.52, -3106.35, 250.837, 100.0, 0), +(@PATH, 11, -6089.07, -3114.42, 251.377, 100.0, 0), +(@PATH, 12, -6088.68, -3121.53, 252.032, 100.0, 0), +(@PATH, 13, -6087.68, -3126.75, 253.098, 100.0, 0), +(@PATH, 14, -6085.5, -3129.51, 253.555, 100.0, 0), +(@PATH, 15, -6080.6, -3130.18, 253.74, 100.0, 0), +(@PATH, 16, -6076.07, -3130.61, 254.185, 100.0, 0); From b004f9883e125440959369a69f873b07b725a5a4 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 4 Jun 2022 00:26:02 +0000 Subject: [PATCH 009/104] chore(DB): import pending files Referenced commit(s): 08118e168fae86aeffcbc8094d5bca277b076b00 --- .../rev_1647877892045091200.sql => db_world/2022_06_04_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1647877892045091200.sql => db_world/2022_06_04_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1647877892045091200.sql b/data/sql/updates/db_world/2022_06_04_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1647877892045091200.sql rename to data/sql/updates/db_world/2022_06_04_00.sql index 63cd49d30..7eafc43ca 100644 --- a/data/sql/updates/pending_db_world/rev_1647877892045091200.sql +++ b/data/sql/updates/db_world/2022_06_04_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_03_01 -> 2022_06_04_00 /* Set correct movement flags for Buzzard creatures */ UPDATE `creature_template_movement` SET `Ground` = 2 WHERE `CreatureId` IN (2830, 2829); From 14d933eddc57ea121e1a01d6d2e0977a8f654253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=B9=BF?= Date: Sat, 4 Jun 2022 20:33:50 +0800 Subject: [PATCH 010/104] fix(Scripts/Paladin): infusion of light proc (#11935) * Update spell_paladin.cpp * Update spell_paladin.cpp * Update spell_paladin.cpp * Update spell_paladin.cpp --- src/server/scripts/Spells/spell_paladin.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 50510a854..a3588b7d1 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -220,7 +220,9 @@ class spell_pal_sacred_shield_base : public AuraScript bool CheckProc(ProcEventInfo& eventInfo) { - return !(eventInfo.GetHitMask() & PROC_EX_INTERNAL_HOT) && eventInfo.GetDamageInfo() && eventInfo.GetDamageInfo()->GetDamage() > 0; + HealInfo* healinfo = eventInfo.GetHealInfo(); + DamageInfo* damageinfo = eventInfo.GetDamageInfo(); + return !(eventInfo.GetHitMask() & PROC_EX_INTERNAL_HOT) && ((healinfo && healinfo->GetHeal() > 0) || (damageinfo && damageinfo->GetDamage() > 0)); } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) @@ -231,14 +233,14 @@ class spell_pal_sacred_shield_base : public AuraScript { Unit* caster = eventInfo.GetActor(); - DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + HealInfo* healinfo = eventInfo.GetHealInfo(); - if (!damageInfo || !damageInfo->GetDamage()) + if (!healinfo || !healinfo->GetHeal()) { return; } - SpellInfo const* procSpell = damageInfo->GetSpellInfo(); + SpellInfo const* procSpell = healinfo->GetSpellInfo(); if (!procSpell) { return; @@ -247,12 +249,12 @@ class spell_pal_sacred_shield_base : public AuraScript if (caster && procSpell->SpellFamilyName == SPELLFAMILY_PALADIN && procSpell->SpellFamilyFlags.HasFlag(0x40000000) && caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_PALADIN, 3021, 0)) // need infusion of light { - int32 basepoints = int32(float(damageInfo->GetDamage()) / 12.0f); + int32 basepoints = int32(float(healinfo->GetHeal()) / 12.0f); // Item - Paladin T9 Holy 4P Bonus (Flash of Light) if (AuraEffect const* aurEffect = caster->GetAuraEffect(67191, EFFECT_0)) AddPct(basepoints, aurEffect->GetAmount()); - caster->CastCustomSpell(eventInfo.GetActionTarget(), 66922, &basepoints, nullptr, nullptr, true, 0, aurEff, caster->GetGUID()); + caster->CastCustomSpell(eventInfo.GetActionTarget(), 66922, &basepoints, nullptr, nullptr, true, nullptr, aurEff, caster->GetGUID()); return; } From 5454c0478f9f4bb5a5529bcbba4e18737292dc37 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 13:58:25 +0200 Subject: [PATCH 011/104] fix(Scripts/ZulGurub): Improvements to Gri'lek encounter: (#11960) * fix(Scripts/ZulGurub): Improvements to Gri'lek encounter: Corrected timers of events. Avatar should wipe all threat for the entire raid. Boss is immuned to taunt. Added missing spells. Fixes #11611 * missing sql. --- .../rev_1654407708502994800.sql | 2 + .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654407708502994800.sql diff --git a/data/sql/updates/pending_db_world/rev_1654407708502994800.sql b/data/sql/updates/pending_db_world/rev_1654407708502994800.sql new file mode 100644 index 000000000..cf1bf636a --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654407708502994800.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|256 WHERE `entry`=15082; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index 74be364eb..0c7fef454 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -29,13 +29,16 @@ EndScriptData */ enum Spells { SPELL_AVATAR = 24646, // Enrage Spell - SPELL_GROUND_TREMOR = 6524 + SPELL_GROUND_TREMOR = 6524, + SPELL_ENTANGLING_ROOTS = 24648 }; enum Events { EVENT_AVATAR = 1, - EVENT_GROUND_TREMOR = 2 + EVENT_GROUND_TREMOR = 2, + EVENT_START_PURSUIT = 3, + EVENT_ENTANGLING_ROOTS = 4 }; class boss_grilek : public CreatureScript // grilek @@ -45,23 +48,16 @@ public: struct boss_grilekAI : public BossAI { - boss_grilekAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { } - - void Reset() override + boss_grilekAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { - _Reset(); - } - - void JustDied(Unit* /*killer*/) override - { - _JustDied(); } void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - events.ScheduleEvent(EVENT_AVATAR, urand(15000, 25000)); - events.ScheduleEvent(EVENT_GROUND_TREMOR, urand(15000, 25000)); + events.ScheduleEvent(EVENT_AVATAR, 20s, 30s); + events.ScheduleEvent(EVENT_GROUND_TREMOR, 15s, 25s); + events.ScheduleEvent(EVENT_ENTANGLING_ROOTS, 5s, 15s); } void UpdateAI(uint32 diff) override @@ -80,19 +76,21 @@ public: { case EVENT_AVATAR: DoCast(me, SPELL_AVATAR); - if (Unit* victim = me->GetVictim()) - { - if (DoGetThreat(victim)) - DoModifyThreatPercent(victim, -50); - } - - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1)) - AttackStart(target); - events.ScheduleEvent(EVENT_AVATAR, urand(25000, 35000)); + DoResetThreat(); + me->SetReactState(REACT_PASSIVE); + events.ScheduleEvent(EVENT_START_PURSUIT, 2s); + events.ScheduleEvent(EVENT_AVATAR, 45s, 50s); break; case EVENT_GROUND_TREMOR: DoCastVictim(SPELL_GROUND_TREMOR, true); - events.ScheduleEvent(EVENT_GROUND_TREMOR, urand(12000, 16000)); + events.ScheduleEvent(EVENT_GROUND_TREMOR, 12s, 16s); + break; + case EVENT_START_PURSUIT: + me->SetReactState(REACT_AGGRESSIVE); + break; + case EVENT_ENTANGLING_ROOTS: + DoCastVictim(SPELL_ENTANGLING_ROOTS); + events.ScheduleEvent(EVENT_ENTANGLING_ROOTS, 10s, 20s); break; default: break; From 7f92871d65f98dbeb7cfc10e2333f1346a9fa64a Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 6 Jun 2022 12:00:23 +0000 Subject: [PATCH 012/104] chore(DB): import pending files Referenced commit(s): 5454c0478f9f4bb5a5529bcbba4e18737292dc37 --- .../rev_1654407708502994800.sql => db_world/2022_06_06_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654407708502994800.sql => db_world/2022_06_06_00.sql} (66%) diff --git a/data/sql/updates/pending_db_world/rev_1654407708502994800.sql b/data/sql/updates/db_world/2022_06_06_00.sql similarity index 66% rename from data/sql/updates/pending_db_world/rev_1654407708502994800.sql rename to data/sql/updates/db_world/2022_06_06_00.sql index cf1bf636a..5c7d7da86 100644 --- a/data/sql/updates/pending_db_world/rev_1654407708502994800.sql +++ b/data/sql/updates/db_world/2022_06_06_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_04_00 -> 2022_06_06_00 -- UPDATE `creature_template` SET `flags_extra`=`flags_extra`|256 WHERE `entry`=15082; From 3f8bf7f994860fbdaa7d87dbd04c8e86c5187701 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:01:32 +0200 Subject: [PATCH 013/104] fix(Core/Spells): Properly handle SPELL_MOD_THREAT flat spell mods. (#11911) * fix(Core/Spells): Properly handle SPELL_MOD_THREAT flat spell mods. Fixes #11570 * buildfix. --- src/server/game/Entities/Player/Player.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index dba7f3cc0..4e8f21599 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2946,7 +2946,15 @@ template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T& bas return; } - totalflat += mod->value; + int32 flatValue = mod->value; + + // SPELL_MOD_THREAT - divide by 100 (in packets we send threat * 100) + if (mod->op == SPELLMOD_THREAT) + { + flatValue /= 100; + } + + totalflat += flatValue; } else if (mod->type == SPELLMOD_PCT) { From 6e36c7cfb426444b5c7d1766e59161ee93ca878b Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:02:08 +0200 Subject: [PATCH 014/104] fix(DB/SAI): Do not summon King Jokkum vehicle if player is mounted. (#11895) Fixed #11799 --- data/sql/updates/pending_db_world/rev_1653724704946000500.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1653724704946000500.sql diff --git a/data/sql/updates/pending_db_world/rev_1653724704946000500.sql b/data/sql/updates/pending_db_world/rev_1653724704946000500.sql new file mode 100644 index 000000000..54dc255e8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653724704946000500.sql @@ -0,0 +1,2 @@ +-- +UPDATE `smart_scripts` SET `action_param2`=0 WHERE `entryorguid`=30105 AND `source_type`=0 AND `id`=1; From 7549eb59be2d23912d2362405b70881b77922047 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:02:55 +0300 Subject: [PATCH 015/104] fix(Script/Creature): Scarlet Commander Mograine - Pull entire cathedral and fix mob fleeing into him (#11766) * Remove CallForHelp, add void PullCathedral * cs --- .../instance_scarlet_monastery.cpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 7e8d14e30..1da9bb2bd 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -244,7 +244,8 @@ public: enum MograineEvents { EVENT_SPELL_CRUSADER_STRIKE = 1, - EVENT_SPELL_HAMMER_OF_JUSTICE = 2 + EVENT_SPELL_HAMMER_OF_JUSTICE = 2, + EVENT_PULL_CATHEDRAL = 3 }; enum WhitemaneEvents @@ -285,6 +286,8 @@ enum Says SAY_WH_RESURRECT = 2, }; +float const CATHEDRAL_PULL_RANGE = 80.0f; // Distance from the Cathedral doors to where Mograine is standing + class npc_mograine : public CreatureScript { public: @@ -357,6 +360,22 @@ public: } } + void PullCathedral() // CallForHelp will ignore any npcs without LOS + { + std::list creatureList; + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_MONK, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_ABBOT, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_CHAMPION, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_CENTURION, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_WIZARD, CATHEDRAL_PULL_RANGE); + GetCreatureListWithEntryInGrid(creatureList, me, NPC_SCARLET_CHAPLAIN, CATHEDRAL_PULL_RANGE); + for (std::list::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) + { + if (Creature* creature = *itr) + creature->AI()->AttackStart(me->GetVictim()); + } + } + void Reset() override { //Incase wipe during phase that mograine fake death @@ -392,8 +411,8 @@ public: void EnterCombat(Unit* /*who*/) override { Talk(SAY_MO_AGGRO); - me->CallForHelp(150.0f); me->CastSpell(me, SPELL_RETRIBUTION_AURA, true); + events.ScheduleEvent(EVENT_PULL_CATHEDRAL, 1000); // Has to be done via event, otherwise mob aggroing Mograine DOES NOT aggro the room events.ScheduleEvent(EVENT_SPELL_CRUSADER_STRIKE, urand(1000, 5000)); events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, urand(6000, 11000)); } @@ -496,6 +515,9 @@ public: me->CastSpell(me->GetVictim(), SPELL_HAMMER_OF_JUSTICE, true); events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 60000); break; + case EVENT_PULL_CATHEDRAL: + PullCathedral(); + break; } } DoMeleeAttackIfReady(); From f28c678c14148b1b69b4f50ae0b6e58df2b883f0 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:03:24 +0200 Subject: [PATCH 016/104] =?UTF-8?q?fix(Core/Spells):=20Hunter=20traps=20sh?= =?UTF-8?q?ould=20not=20be=20activated=20by=20targets=20not=E2=80=A6=20(#1?= =?UTF-8?q?1971)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spells): Hunter traps should not be activated by targets not in LoS. Fixes #11432 --- .../game/Entities/GameObject/GameObject.cpp | 4 +- .../game/Grids/Notifiers/GridNotifiers.h | 41 +++++++++++++++++++ src/server/game/Spells/Spell.cpp | 14 +++---- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index ef224798d..fdf514c78 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -701,8 +701,8 @@ void GameObject::Update(uint32 diff) // search unfriendly creature if (owner && goInfo->trap.autoCloseTime != -1) // hunter trap { - Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius); - Acore::UnitSearcher searcher(this, target, checker); + Acore::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius); + Acore::UnitSearcher searcher(this, target, checker); Cell::VisitAllObjects(this, searcher, radius); } else // environmental trap diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 654f0aa27..c8692a224 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -898,6 +898,47 @@ namespace Acore float i_range; }; + class NearestAttackableNoTotemUnitInObjectRangeCheck + { + public: + NearestAttackableNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* owner, float range) : i_obj(obj), i_owner(owner), i_range(range) {} + + bool operator()(Unit* u) + { + if (!u->IsAlive()) + { + return false; + } + + if (u->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET) + { + return false; + } + + if (u->GetTypeId() == TYPEID_UNIT && u->ToCreature()->IsTotem()) + { + return false; + } + + if (!u->isTargetableForAttack(false, i_owner)) + { + return false; + } + + if (!i_obj->IsWithinDistInMap(u, i_range) || !i_owner->IsValidAttackTarget(u) || !i_obj->IsWithinLOSInMap(u)) + { + return false; + } + + return true; + } + + private: + WorldObject const* i_obj; + Unit const* i_owner; + float i_range; + }; + class AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck { public: diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9758eeebc..44df83ab6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5892,31 +5892,27 @@ SpellCastResult Spell::CheckCast(bool strict) if ((!m_caster->IsTotem() || !m_spellInfo->IsPositive()) && !m_spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT) && !m_spellInfo->HasAttribute(SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT)) { - WorldObject* losCenter = nullptr; + bool castedByGameobject = false; uint32 losChecks = LINEOFSIGHT_ALL_CHECKS; if (m_originalCasterGUID.IsGameObject()) { - losCenter = m_caster->GetMap()->GetGameObject(m_originalCasterGUID); + castedByGameobject = m_caster->GetMap()->GetGameObject(m_originalCasterGUID) != nullptr; } else if (m_caster->GetEntry() == WORLD_TRIGGER) { if (TempSummon* tempSummon = m_caster->ToTempSummon()) { - losCenter = tempSummon->GetSummonerGameObject(); + castedByGameobject = tempSummon->GetSummonerGameObject() != nullptr; } } - if (losCenter) + if (castedByGameobject) { // If spell casted by gameobject then ignore M2 models losChecks &= ~LINEOFSIGHT_CHECK_GOBJECT_M2; } - else - { - losCenter = m_caster; - } - if (!losCenter->IsWithinLOS(x, y, z, VMAP::ModelIgnoreFlags::M2, LineOfSightChecks((losChecks)))) + if (!m_caster->IsWithinLOS(x, y, z, VMAP::ModelIgnoreFlags::M2, LineOfSightChecks((losChecks)))) { return SPELL_FAILED_LINE_OF_SIGHT; } From 05678e05ffa879bc310d701ad6fcb5f783563ead Mon Sep 17 00:00:00 2001 From: temperrr Date: Mon, 6 Jun 2022 14:04:17 +0200 Subject: [PATCH 017/104] fix(DB/Loot): Abyssal Lord should only drop 1 rare/epic (#11953) * Fix(Creature/Loot): Abyssal Lord should only drop 1 rare/epic * remove second ; --- .../updates/pending_db_world/abyssallordloot.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 data/sql/updates/pending_db_world/abyssallordloot.sql diff --git a/data/sql/updates/pending_db_world/abyssallordloot.sql b/data/sql/updates/pending_db_world/abyssallordloot.sql new file mode 100644 index 000000000..69c0833cb --- /dev/null +++ b/data/sql/updates/pending_db_world/abyssallordloot.sql @@ -0,0 +1,14 @@ +DELETE FROM `creature_loot_template` WHERE (`Entry` = 15204) AND (`Item` IN (20689, 20690, 20691)) OR (`Entry` = 15205) AND (`Item` IN (20686, 20687, 20688)) OR (`Entry` = 15305) AND (`Item` IN (20683, 20684, 20685))OR (`Item` IN (20680, 20681, 20682)); +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(15203, 20680, 0, 33.3334, 0, 1, 3, 1, 1, 'Prince Skaldrenox - Abyssal Mail Pauldrons'), +(15203, 20681, 0, 33.3333, 0, 1, 3, 1, 1, 'Prince Skaldrenox - Abyssal Leather Bracers'), +(15203, 20682, 0, 33.3333, 0, 1, 3, 1, 1, 'Prince Skaldrenox - Elemental Focus Band'), +(15204, 20689, 0, 33.3333, 0, 1, 3, 1, 1, 'High Marshal Whirlaxis - Abyssal Leather Shoulders'), +(15204, 20690, 0, 33.3333, 0, 1, 3, 1, 1, 'High Marshal Whirlaxis - Abyssal Cloth Wristbands'), +(15204, 20691, 0, 33.3334, 0, 1, 3, 1, 1, 'High Marshal Whirlaxis - Windshear Cape'), +(15205, 20686, 0, 33.3334, 0, 1, 3, 1, 1, 'Baron Kazum - Abyssal Cloth Amice'), +(15205, 20687, 0, 33.3333, 0, 1, 3, 1, 1, 'Baron Kazum - Abyssal Plate Vambraces'), +(15205, 20688, 0, 33.3333, 0, 1, 3, 1, 1, 'Baron Kazum - Earthen Guard'), +(15305, 20683, 0, 33.3333, 0, 1, 3, 1, 1, 'Lord Skwol - Abyssal Plate Epaulets'), +(15305, 20684, 0, 33.3333, 0, 1, 3, 1, 1, 'Lord Skwol - Abyssal Mail Armguards'), +(15305, 20685, 0, 33.3334, 0, 1, 3, 1, 1, 'Lord Skwol - Wavefront Necklace'); From 156b1eb969bad2dac638add03e213be2d3e7a9f9 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:05:59 +0300 Subject: [PATCH 018/104] fix(Script/Instance): Ulduar - Flame Leviathan Hardcore to DB (#11879) * Hardcore removal and comment out RepairText for Players * codestyle * Remove (now) unused void Say --- .../rev_1653600539752129200.sql | 43 +++ .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 268 ++++++++---------- 2 files changed, 168 insertions(+), 143 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1653600539752129200.sql diff --git a/data/sql/updates/pending_db_world/rev_1653600539752129200.sql b/data/sql/updates/pending_db_world/rev_1653600539752129200.sql new file mode 100644 index 000000000..e23f22dce --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653600539752129200.sql @@ -0,0 +1,43 @@ +-- Flame Leviathan add mising Boss Emote (15 and above) +DELETE FROM `creature_text` WHERE `CreatureID` = 33113; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(33113, 0, 0, 'Hostile entities detected. Threat assessment protocol active. Primary target engaged. Time minus 30 seconds to re-evaluation.', 14, 0, 100, 0, 0, 15506, 33487, 0, 'Flame Leviathan SAY_AGGRO'), +(33113, 1, 0, 'Threat assessment routine modified. Current target threat level: 0. Acquiring new target.', 14, 0, 100, 0, 0, 15521, 33507, 0, 'Flame Leviathan SAY_SLAY'), +(33113, 2, 0, 'Total systems failure. Defense protocols breached. Leviathan unit shutting down.', 14, 0, 100, 0, 0, 15520, 33506, 0, 'Flame Leviathan SAY_DEATH'), +(33113, 3, 0, 'Threat re-evaluated. Target assessment complete. Changing course.', 14, 0, 100, 0, 0, 15507, 33488, 0, 'Flame Leviathan SAY_TARGET_1'), +(33113, 3, 1, 'Pursuit objective modified. Changing course.', 14, 0, 100, 0, 0, 15508, 33489, 0, 'Flame Leviathan SAY_TARGET_2'), +(33113, 3, 2, 'Hostile entity\'s stratagem predicted. Re-routing battle function. Changing course.', 14, 0, 100, 0, 0, 15509, 33490, 0, 'Flame Leviathan SAY_TARGET_3'), +(33113, 4, 0, 'Orbital countermeasures enabled.', 14, 0, 100, 0, 0, 15510, 33491, 0, 'Flame Leviathan SAY_HARDMODE'), +(33113, 5, 0, '*ALERT* Static defense system failure. Orbital countermeasures disabled.', 14, 0, 100, 0, 0, 15511, 33492, 0, 'Flame Leviathan SAY_TOWER_NONE'), +(33113, 6, 0, 'Hodir\'s Fury online. Acquiring target.', 14, 0, 100, 0, 0, 15512, 33493, 0, 'Flame Leviathan SAY_TOWER_FROST'), +(33113, 7, 0, 'Mimiron\'s Inferno online. Acquiring target.', 14, 0, 100, 0, 0, 15513, 33495, 0, 'Flame Leviathan SAY_TOWER_FLAME'), +(33113, 8, 0, 'Freya\'s Ward online. Acquiring target.', 14, 0, 100, 0, 0, 15514, 33497, 0, 'Flame Leviathan SAY_TOWER_NATURE'), +(33113, 9, 0, 'Thorim\'s Hammer online. Acquiring target.', 14, 0, 100, 0, 0, 15515, 33499, 0, 'Flame Leviathan SAY_TOWER_STORM'), +(33113, 10, 0, 'Unauthorized entity attempting circuit overload. Activating anti-personnel countermeasures.', 14, 0, 100, 0, 0, 15516, 33501, 0, 'Flame Leviathan SAY_PLAYER_RIDING'), +(33113, 11, 0, 'System malfunction. Diverting power to support systems.', 14, 0, 100, 0, 0, 15517, 33503, 0, 'Flame Leviathan SAY_OVERLOAD_1'), +(33113, 11, 1, 'Combat matrix overload. Powering doooow...', 14, 0, 100, 0, 0, 15518, 33504, 0, 'Flame Leviathan SAY_OVERLOAD_2'), +(33113, 11, 2, 'System restart required. Deactivating weapons systems.', 14, 0, 100, 0, 0, 15519, 33505, 0, 'Flame Leviathan SAY_OVERLOAD_3'), +(33113, 12, 0, '%s pursues $n.', 41, 0, 100, 0, 0, 0, 33502, 0, 'Flame Leviathan EMOTE_PURSUE'), +(33113, 13, 0, '%s\'s circuits overloaded.', 41, 0, 100, 0, 0, 0, 33304, 0, 'Flame Leviathan EMOTE_OVERLOAD'), +(33113, 14, 0, 'Automatic repair sequence initiated.', 41, 0, 100, 0, 0, 0, 33538, 0, 'Flame Leviathan EMOTE_REPAIR'), +(33113, 15, 0, '%s activates Hodir\'s Fury.', 41, 0, 100, 0, 0, 0, 33494, 0, 'Flame Leviathan EMOTE_FROST'), +(33113, 16, 0, '%s activates Mimiron\'s Inferno.', 41, 0, 100, 0, 0, 0, 33496, 0, 'Flame Leviathan EMOTE_FLAME'), +(33113, 17, 0, '%s activates Freya\'s Ward.', 41, 0, 100, 0, 0, 0, 33498, 0, 'Flame Leviathan EMOTE_NATURE'), +(33113, 18, 0, '%s activates Thorim\'s Hammer.', 41, 0, 100, 0, 0, 0, 33500, 0, 'Flame Leviathan EMOTE_STORM'), +(33113, 19, 0, '%s reactivated. Resuming combat functions.', 41, 0, 100, 0, 0, 0, 33305, 0, 'Flame Leviathan EMOTE_REACTIVATE'); + +-- Bronzebeard Radio remove equipment (floating pickaxe) +DELETE FROM `creature_equip_template` WHERE `CreatureID` = 34054; + +-- Bronzebeard Radio move hardcode to DB (previously empty) +DELETE FROM `creature_text` WHERE `CreatureID` = 34054; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(34054, 0, 0, 'You\'ve done it! You\'ve broken the defenses of Ulduar. In a few moments, we will be dropping in to...', 12, 0, 100, 0, 0, 15804, 34154, 3, 'Bronzebeard Radio SAY_FL_START_0'), +(34054, 1, 0, 'What is that? Be careful! Something\'s headed your way!', 12, 0, 100, 0, 0, 15805, 34155, 3, 'Bronzebeard Radio SAY_FL_START_1'), +(34054, 2, 0, 'Quicly! Evasive action! Evasive act--', 12, 0, 100, 0, 0, 15806, 34156, 3, 'Bronzebeard Radio SAY_FL_START_2'), +(34054, 3, 0, 'There are four generators powering the defense structures. If you sabotage the generators, the missile attacks will stop!', 12, 0, 100, 0, 0, 15796, 34147, 3, 'Bronzebeard Radio SAY_FL_GENERATORS'), +(34054, 4, 0, 'It appears you are near a repair station! Drive your vehicle onto the platform, and it should be automatically repaired.', 12, 0, 100, 0, 0, 15803, 34153, 3, 'Bronzebeard Radio SAY_STATIONS'), +(34054, 5, 0, 'Ah, the tower of Krolmir. It is said that the power of Thorim has been used only once... and that it turned an entire continent to dust.', 12, 0, 100, 0, 0, 15801, 34151, 3, 'Bronzebeard Radio SAY_TOWER_THORIM'), +(34054, 6, 0, 'This tower powers the Hammer of Hodir. It is said to have the power to turn entire armies to ice!', 12, 0, 100, 0, 0, 15797, 34148, 3, 'Bronzebeard Radio SAY_TOWER_HODIR'), +(34054, 7, 0, 'You\'re approaching the tower of Freya. It contains the power to turn barren wastelands into jungles teeming with life overnight.', 12, 0, 100, 0, 0, 15798, 34149, 3, 'Bronzebeard Radio SAY_TOWER_FREYA'), +(34054, 8, 0, 'This generator powers Mimiron\'s Gaze. In moments, it can turn earth to ash, stone to magma--we cannot let it reach full power!', 12, 0, 100, 0, 0, 15799, 34150, 3, 'Bronzebeard Radio SAY_TOWER_MIMIRON'); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 506e84d8c..376c1ec4d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -34,157 +34,155 @@ enum LeviathanSpells { // Leviathan basic - SPELL_PURSUED = 62374, - SPELL_GATHERING_SPEED = 62375, - SPELL_BATTERING_RAM = 62376, - SPELL_FLAME_VENTS = 62396, - SPELL_MISSILE_BARRAGE = 62400, - SPELL_NAPALM_10 = 63666, - SPELL_NAPALM_25 = 65026, - SPELL_INVIS_AND_STEALTH_DETECT = 18950, - SPELL_TRANSITUS_SHIELD_IMPACT = 48387, + SPELL_PURSUED = 62374, + SPELL_GATHERING_SPEED = 62375, + SPELL_BATTERING_RAM = 62376, + SPELL_FLAME_VENTS = 62396, + SPELL_MISSILE_BARRAGE = 62400, + SPELL_NAPALM_10 = 63666, + SPELL_NAPALM_25 = 65026, + SPELL_INVIS_AND_STEALTH_DETECT = 18950, + SPELL_TRANSITUS_SHIELD_IMPACT = 48387, // Shutdown spells - SPELL_SYSTEMS_SHUTDOWN = 62475, - SPELL_OVERLOAD_CIRCUIT = 62399, + SPELL_SYSTEMS_SHUTDOWN = 62475, + SPELL_OVERLOAD_CIRCUIT = 62399, // hard mode - SPELL_TOWER_OF_STORMS = 65076, - SPELL_TOWER_OF_FLAMES = 65075, - SPELL_TOWER_OF_FROST = 65077, - SPELL_TOWER_OF_LIFE = 64482, + SPELL_TOWER_OF_STORMS = 65076, + SPELL_TOWER_OF_FLAMES = 65075, + SPELL_TOWER_OF_FROST = 65077, + SPELL_TOWER_OF_LIFE = 64482, - SPELL_HODIRS_FURY = 62533, - SPELL_FREYA_WARD = 62906, // removed spawn effect - SPELL_MIMIRONS_INFERNO = 62909, - SPELL_THORIMS_HAMMER = 62911, + SPELL_HODIRS_FURY = 62533, + SPELL_FREYA_WARD = 62906, // removed spawn effect + SPELL_MIMIRONS_INFERNO = 62909, + SPELL_THORIMS_HAMMER = 62911, - SPELL_FREYA_DUMMY_BLUE = 63294, - SPELL_FREYA_DUMMY_GREEN = 63295, - SPELL_FREYA_DUMMY_YELLOW = 63292, + SPELL_FREYA_DUMMY_BLUE = 63294, + SPELL_FREYA_DUMMY_GREEN = 63295, + SPELL_FREYA_DUMMY_YELLOW = 63292, // Leviathan turret spell - SPELL_SEARING_FLAME = 62402, + SPELL_SEARING_FLAME = 62402, // On turret Destory - SPELL_SMOKE_TRAIL = 63575, + SPELL_SMOKE_TRAIL = 63575, // Pool of tar blaze - SPELL_BLAZE = 62292, + SPELL_BLAZE = 62292, // Pyrite - SPELL_LIQUID_PYRITE = 62494, - SPELL_DUSTY_EXPLOSION = 63360, - SPELL_DUST_CLOUD_IMPACT = 54740, + SPELL_LIQUID_PYRITE = 62494, + SPELL_DUSTY_EXPLOSION = 63360, + SPELL_DUST_CLOUD_IMPACT = 54740, }; enum GosNpcs { - NPC_FLAME_LEVIATHAN_TURRET = 33139, - NPC_SEAT = 33114, - NPC_MECHANOLIFT = 33214, - NPC_LIQUID = 33189, + NPC_FLAME_LEVIATHAN_TURRET = 33139, + NPC_SEAT = 33114, + NPC_MECHANOLIFT = 33214, + NPC_LIQUID = 33189, // Starting event - NPC_ULDUAR_COLOSSUS = 33237, - NPC_BRANN_RADIO = 34054, - NPC_ULDUAR_GAUNTLET_GENERATOR = 33571, - NPC_DEFENDER_GENERATED = 33572, + NPC_ULDUAR_COLOSSUS = 33237, + NPC_BRANN_RADIO = 34054, + NPC_ULDUAR_GAUNTLET_GENERATOR = 33571, + NPC_DEFENDER_GENERATED = 33572, // Hard Mode - NPC_THORIM_HAMMER_TARGET = 33364, - NPC_THORIM_HAMMER = 33365, - NPC_FREYA_WARD_TARGET = 33366, - NPC_FREYA_WARD = 33367, - NPC_MIMIRONS_INFERNO_TARGET = 33369, - NPC_MIMIRONS_INFERNO = 33370, - NPC_HODIRS_FURY_TARGET = 33108, - NPC_HODIRS_FURY = 33212, + NPC_THORIM_HAMMER_TARGET = 33364, + NPC_THORIM_HAMMER = 33365, + NPC_FREYA_WARD_TARGET = 33366, + NPC_FREYA_WARD = 33367, + NPC_MIMIRONS_INFERNO_TARGET = 33369, + NPC_MIMIRONS_INFERNO = 33370, + NPC_HODIRS_FURY_TARGET = 33108, + NPC_HODIRS_FURY = 33212, }; enum Events { - EVENT_PURSUE = 1, - EVENT_MISSILE, - EVENT_VENT, - EVENT_SPEED, - EVENT_SUMMON, - EVENT_REINSTALL, - EVENT_HODIRS_FURY, - EVENT_FREYA, - EVENT_MIMIRONS_INFERNO, - EVENT_THORIMS_HAMMER, - EVENT_SOUND_BEGINNING, - EVENT_POSITION_CHECK, + EVENT_PURSUE = 1, + EVENT_MISSILE = 2, + EVENT_VENT = 3, + EVENT_SPEED = 4, + EVENT_SUMMON = 5, + EVENT_REINSTALL = 6, + EVENT_HODIRS_FURY = 7, + EVENT_FREYA = 8, + EVENT_MIMIRONS_INFERNO = 9, + EVENT_THORIMS_HAMMER = 10, + EVENT_SOUND_BEGINNING = 11, + EVENT_POSITION_CHECK = 12, }; enum Texts { - FLAME_LEVIATHAN_SAY_AGGRO = 0, - FLAME_LEVIATHAN_SAY_SLAY, - FLAME_LEVIATHAN_SAY_DEATH, - FLAME_LEVIATHAN_SAY_PURSUE, - FLAME_LEVIATHAN_SAY_HARDMODE, - FLAME_LEVIATHAN_SAY_TOWER_NONE, - FLAME_LEVIATHAN_SAY_TOWER_FROST, - FLAME_LEVIATHAN_SAY_TOWER_FLAME, - FLAME_LEVIATHAN_SAY_TOWER_NATURE, - FLAME_LEVIATHAN_SAY_TOWER_STORM, - FLAME_LEVIATHAN_SAY_PLAYER_RIDING, - FLAME_LEVIATHAN_SAY_OVERLOAD, - FLAME_LEVIATHAN_EMOTE_PURSUE, - FLAME_LEVIATHAN_EMOTE_OVERLOAD, - FLAME_LEVIATHAN_EMOTE_REPAIR -}; + FLAME_LEVIATHAN_SAY_AGGRO = 0, + FLAME_LEVIATHAN_SAY_SLAY = 1, + FLAME_LEVIATHAN_SAY_DEATH = 2, + FLAME_LEVIATHAN_SAY_PURSUE = 3, + FLAME_LEVIATHAN_SAY_HARDMODE = 4, + FLAME_LEVIATHAN_SAY_TOWER_NONE = 5, + FLAME_LEVIATHAN_SAY_TOWER_FROST = 6, + FLAME_LEVIATHAN_SAY_TOWER_FLAME = 7, + FLAME_LEVIATHAN_SAY_TOWER_NATURE = 8, + FLAME_LEVIATHAN_SAY_TOWER_STORM = 9, + FLAME_LEVIATHAN_SAY_PLAYER_RIDING = 10, + FLAME_LEVIATHAN_SAY_OVERLOAD = 11, + FLAME_LEVIATHAN_EMOTE_PURSUE = 12, + FLAME_LEVIATHAN_EMOTE_OVERLOAD = 13, + FLAME_LEVIATHAN_EMOTE_REPAIR = 14, + FLAME_LEVIATHAN_EMOTE_FROST = 15, + FLAME_LEVIATHAN_EMOTE_FLAME = 16, + FLAME_LEVIATHAN_EMOTE_NATURE = 17, + FLAME_LEVIATHAN_EMOTE_STORM = 18, + FLAME_LEVIATHAN_EMOTE_REACTIVATE = 19, -enum Sounds -{ - RSOUND_L0 = 15807, - RSOUND_L1 = 15804, - RSOUND_L2 = 15805, - RSOUND_L3 = 15806, - RSOUND_ENGAGE = 15794, - RSOUND_SILOS = 15795, - RSOUND_GENERATORS = 15796, - RSOUND_HODIR = 15797, - RSOUND_FREYA = 15798, - RSOUND_MIMIRON = 15799, - RSOUND_THORIM = 15801, - RSOUND_STATION = 15803, + // NPC_BRANN_RADIO + BRANN_RADIO_SAY_FL_START_0 = 0, + BRANN_RADIO_SAY_FL_START_1 = 1, + BRANN_RADIO_SAY_FL_START_2 = 2, + BRANN_RADIO_SAY_GENERATORS = 3, + BRANN_RADIO_SAY_STATIONS = 4, + BRANN_RADIO_SAY_TOWER_THORIM = 5, + BRANN_RADIO_SAY_TOWER_HODIR = 6, + BRANN_RADIO_SAY_TOWER_FREYA = 7, + BRANN_RADIO_SAY_TOWER_MIMIRON = 8, + + // Vehicle Repair - Said by a spell, BroadcastTextID, same as FLAME_LEVIATHAN_EMOTE_REPAIR + VEHICLE_EMOTE_REPAIR = 33538, }; enum Seats { - SEAT_PLAYER = 0, - SEAT_TURRET = 1, - SEAT_DEVICE = 2, - SEAT_CANNON = 7, + SEAT_PLAYER = 0, + SEAT_TURRET = 1, + SEAT_DEVICE = 2, + SEAT_CANNON = 7, }; enum Misc { - DATA_EVENT_STARTED = 1, - DATA_GET_TOWER_COUNT = 2, - DATA_GET_SHUTDOWN = 3, + DATA_EVENT_STARTED = 1, + DATA_GET_TOWER_COUNT = 2, + DATA_GET_SHUTDOWN = 3, - TOWER_OF_STORMS = 2, - TOWER_OF_FLAMES = 1, - TOWER_OF_FROST = 3, - TOWER_OF_LIFE = 0, + TOWER_OF_STORMS = 2, + TOWER_OF_FLAMES = 1, + TOWER_OF_FROST = 3, + TOWER_OF_LIFE = 0, - ACTION_START_NORGANNON_EVENT = 1, - ACTION_START_NORGANNON_BRANN = 2, - ACTION_START_BRANN_EVENT = 3, - ACTION_DESPAWN_ADDS = 4, - ACTION_DELAY_CANNON = 5, - ACTION_DESTROYED_TURRET = 6, + ACTION_START_NORGANNON_EVENT = 1, + ACTION_START_NORGANNON_BRANN = 2, + ACTION_START_BRANN_EVENT = 3, + ACTION_DESPAWN_ADDS = 4, + ACTION_DELAY_CANNON = 5, + ACTION_DESTROYED_TURRET = 6, }; -const Position homePos = {322.39f, -14.5f, 409.8f, 3.14f}; -/////////////////////////////////////////// -// -// BOSS CODE -// -/////////////////////////////////////////// +const Position homePos = {322.39f, -14.5f, 409.8f, 3.14f}; class boss_flame_leviathan : public CreatureScript { @@ -217,7 +215,7 @@ public: // Custom void BindPlayers(); - void RadioSay(const char* text, uint32 soundId); + void RadioSay(uint8 textid); void ActivateTowers(); void TurnGates(bool _start, bool _death); void TurnHealStations(bool _apply); @@ -357,18 +355,18 @@ public: _speakTimer += diff; if (_speakTimer <= 10000) { - RadioSay("You've done it! You've broken the defenses of Ulduar. In a few moments, we will be dropping in to...", RSOUND_L1); _speakTimer = 10000; + RadioSay(BRANN_RADIO_SAY_FL_START_0); } else if (_speakTimer > 16000 && _speakTimer < 20000) { _speakTimer = 20000; - RadioSay("What is that? Be careful! Something's headed your way!", RSOUND_L2); + RadioSay(BRANN_RADIO_SAY_FL_START_1); } else if (_speakTimer > 24000 && _speakTimer < 40000) { _speakTimer = 40000; - RadioSay("Quicly! Evasive action! Evasive act--", RSOUND_L3); + RadioSay(BRANN_RADIO_SAY_FL_START_2); } else if (_speakTimer > 41000 && _speakTimer < 60000) { @@ -443,27 +441,27 @@ public: if (Unit* seat = vehicle->GetPassenger(i)) if (seat->GetTypeId() == TYPEID_UNIT) seat->ToCreature()->AI()->EnterEvadeMode(); - me->TextEmote("Flame Leviathan reactivated. Resumming combat functions.", nullptr, true); + Talk(FLAME_LEVIATHAN_EMOTE_REACTIVATE); return; case EVENT_THORIMS_HAMMER: SummonTowerHelpers(TOWER_OF_STORMS); events.RepeatEvent(60000 + rand() % 60000); - me->TextEmote("Flame Leviathan activates Thorim's Hammer.", nullptr, true); + Talk(FLAME_LEVIATHAN_EMOTE_STORM); Talk(FLAME_LEVIATHAN_SAY_TOWER_STORM); return; case EVENT_FREYA: SummonTowerHelpers(TOWER_OF_LIFE); - me->TextEmote("Flame Leviathan activates Freya's Ward.", nullptr, true); + Talk(FLAME_LEVIATHAN_EMOTE_NATURE); Talk(FLAME_LEVIATHAN_SAY_TOWER_NATURE); return; case EVENT_MIMIRONS_INFERNO: SummonTowerHelpers(TOWER_OF_FLAMES); - me->TextEmote("Flame Leviathan activates Mimiron's Inferno.", nullptr, true); + Talk(FLAME_LEVIATHAN_EMOTE_FLAME); Talk(FLAME_LEVIATHAN_SAY_TOWER_FLAME); return; case EVENT_HODIRS_FURY: SummonTowerHelpers(TOWER_OF_FROST); - me->TextEmote("Flame Leviathan activates Hodir's Fury.", nullptr, true); + Talk(FLAME_LEVIATHAN_EMOTE_FROST); Talk(FLAME_LEVIATHAN_SAY_TOWER_FROST); return; } @@ -499,14 +497,11 @@ void boss_flame_leviathan::boss_flame_leviathanAI::BindPlayers() me->GetMap()->ToInstanceMap()->PermBindAllPlayers(); } -void boss_flame_leviathan::boss_flame_leviathanAI::RadioSay(const char* text, uint32 soundId) +void boss_flame_leviathan::boss_flame_leviathanAI::RadioSay(uint8 textid) { if (Creature* r = me->SummonCreature(NPC_BRANN_RADIO, me->GetPositionX() - 150, me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 5000)) { - WorldPacket data; - ChatHandler::BuildChatPacket(data, CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, r, nullptr, text); - r->SendMessageToSetInRange(&data, 200, true); - r->PlayDirectSound(soundId); + r->AI()->Talk(textid); } } @@ -1223,13 +1218,6 @@ public: me->SetReactState(REACT_AGGRESSIVE); } - void Say(const char* text) - { - WorldPacket data; - ChatHandler::BuildChatPacket(data, CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, me, nullptr, text); - me->SendMessageToSetInRange(&data, 100.0f, true); - } - void MoveInLineOfSight(Unit* who) override { if (!_lock) @@ -1242,8 +1230,7 @@ public: { if (me->GetDistance2d(who) <= 60.0f && who->GetPositionZ() > 430.0f) { - Say("This generator powers Mimiron's Gaze. In moments, it can turn earth to ash, stone to magma--we cannot let it reach full power!"); - me->PlayDirectSound(RSOUND_MIMIRON); + Talk(BRANN_RADIO_SAY_TOWER_MIMIRON); _lock = true; } } @@ -1252,8 +1239,7 @@ public: { if (me->GetDistance2d(who) <= 60.0f && who->GetPositionZ() < 380.0f) { - Say("You're approaching the tower of Freya. It contains the power to turn barren wastelands into jungles teeming with life overnight"); - me->PlayDirectSound(RSOUND_FREYA); + Talk(BRANN_RADIO_SAY_TOWER_FREYA); _lock = true; } } @@ -1262,8 +1248,7 @@ public: { if (me->GetDistance2d(who) <= 40.0f) { - Say("It appears you are near a repair station. Drive your vehicle on to the platform and it should be automatically repaired."); - me->PlayDirectSound(RSOUND_STATION); + Talk(BRANN_RADIO_SAY_STATIONS); _lock = true; } } @@ -1272,8 +1257,7 @@ public: { if (me->GetDistance2d(who) <= 40.0f) { - Say("This tower powers the hammer of Hodir. It is said to have the power to turn entire armies to ice!"); - me->PlayDirectSound(RSOUND_HODIR); + Talk(BRANN_RADIO_SAY_TOWER_HODIR); _lock = true; } } @@ -1282,8 +1266,7 @@ public: { if (me->GetDistance2d(who) <= 60.0f) { - Say("Aaaah, the tower of Krolmir. It is said that the power of Thorim has been used only once. And that it turned an entire continent to dust..."); - me->PlayDirectSound(RSOUND_THORIM); + Talk(BRANN_RADIO_SAY_TOWER_THORIM); _lock = true; } } @@ -1292,8 +1275,7 @@ public: { if (who->GetPositionX() >= -480.0f) { - Say("There are four generators powering the defense structures. If you sabotage the generators, the missile attacks will stop!"); - me->PlayDirectSound(RSOUND_GENERATORS); + Talk(BRANN_RADIO_SAY_GENERATORS); _lock = true; } } @@ -1533,7 +1515,7 @@ public: if (!driver) return; - driver->TextEmote("Automatic repair sequence initiated.", driver, true); + //driver->TextEmote(VEHICLE_EMOTE_REPAIR, driver, true); // No source // Actually should/could use basepoints (100) for this spell effect as percentage of health, but oh well. vehicle->GetBase()->SetFullHealth(); From 7d100e0b2bd0618f68ebe4bd027762097da2feed Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 6 Jun 2022 12:08:26 +0000 Subject: [PATCH 019/104] chore(DB): import pending files Referenced commit(s): 156b1eb969bad2dac638add03e213be2d3e7a9f9 --- .../abyssallordloot.sql => db_world/2022_06_06_01.sql} | 1 + .../rev_1653600539752129200.sql => db_world/2022_06_06_02.sql} | 1 + .../rev_1653724704946000500.sql => db_world/2022_06_06_03.sql} | 1 + 3 files changed, 3 insertions(+) rename data/sql/updates/{pending_db_world/abyssallordloot.sql => db_world/2022_06_06_01.sql} (97%) rename data/sql/updates/{pending_db_world/rev_1653600539752129200.sql => db_world/2022_06_06_02.sql} (99%) rename data/sql/updates/{pending_db_world/rev_1653724704946000500.sql => db_world/2022_06_06_03.sql} (70%) diff --git a/data/sql/updates/pending_db_world/abyssallordloot.sql b/data/sql/updates/db_world/2022_06_06_01.sql similarity index 97% rename from data/sql/updates/pending_db_world/abyssallordloot.sql rename to data/sql/updates/db_world/2022_06_06_01.sql index 69c0833cb..0df184654 100644 --- a/data/sql/updates/pending_db_world/abyssallordloot.sql +++ b/data/sql/updates/db_world/2022_06_06_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_06_00 -> 2022_06_06_01 DELETE FROM `creature_loot_template` WHERE (`Entry` = 15204) AND (`Item` IN (20689, 20690, 20691)) OR (`Entry` = 15205) AND (`Item` IN (20686, 20687, 20688)) OR (`Entry` = 15305) AND (`Item` IN (20683, 20684, 20685))OR (`Item` IN (20680, 20681, 20682)); INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES (15203, 20680, 0, 33.3334, 0, 1, 3, 1, 1, 'Prince Skaldrenox - Abyssal Mail Pauldrons'), diff --git a/data/sql/updates/pending_db_world/rev_1653600539752129200.sql b/data/sql/updates/db_world/2022_06_06_02.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1653600539752129200.sql rename to data/sql/updates/db_world/2022_06_06_02.sql index e23f22dce..13b1662d2 100644 --- a/data/sql/updates/pending_db_world/rev_1653600539752129200.sql +++ b/data/sql/updates/db_world/2022_06_06_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_06_01 -> 2022_06_06_02 -- Flame Leviathan add mising Boss Emote (15 and above) DELETE FROM `creature_text` WHERE `CreatureID` = 33113; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1653724704946000500.sql b/data/sql/updates/db_world/2022_06_06_03.sql similarity index 70% rename from data/sql/updates/pending_db_world/rev_1653724704946000500.sql rename to data/sql/updates/db_world/2022_06_06_03.sql index 54dc255e8..ca0a03121 100644 --- a/data/sql/updates/pending_db_world/rev_1653724704946000500.sql +++ b/data/sql/updates/db_world/2022_06_06_03.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_06_02 -> 2022_06_06_03 -- UPDATE `smart_scripts` SET `action_param2`=0 WHERE `entryorguid`=30105 AND `source_type`=0 AND `id`=1; From 228b2f6f6b90dbbeffa45eaeacc837ae535872f4 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:19:27 +0200 Subject: [PATCH 020/104] fix(Core/Movement): Improved fleeing movement generator. (#11896) * fix(Core/Movement): Improved fleeing movement generator. Fixes #11850 * Update. --- .../FleeingMovementGenerator.cpp | 27 ++++++++++++++++--- .../FleeingMovementGenerator.h | 3 ++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 5f62e542c..59ea2cd8a 100644 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -26,6 +26,7 @@ #define MIN_QUIET_DISTANCE 28.0f #define MAX_QUIET_DISTANCE 43.0f +#define MIN_PATH_LENGTH 2.0f template void FleeingMovementGenerator::DoInitialize(T* owner) @@ -144,6 +145,20 @@ void FleeingMovementGenerator::SetTargetLocation(T* owner) return; } + // Same position - recheck + if (_path->getPathLength() < MIN_PATH_LENGTH) + { + if (_fleeTargetGUID) + { + ++_shortPathsCount; + } + + _timer.Reset(100); + return; + } + + _shortPathsCount = 0; + Movement::MoveSplineInit init(owner); init.MovebyPath(_path->GetPath()); init.SetWalk(false); @@ -154,8 +169,13 @@ void FleeingMovementGenerator::SetTargetLocation(T* owner) template void FleeingMovementGenerator::GetPoint(T* owner, Position& position) { - float casterDistance, casterAngle; - if (Unit* fleeTarget = ObjectAccessor::GetUnit(*owner, _fleeTargetGUID)) + float casterDistance = 0.f; + float casterAngle = 0.f; + Unit* fleeTarget = nullptr; + if (_shortPathsCount < 5) + fleeTarget = ObjectAccessor::GetUnit(*owner, _fleeTargetGUID); + + if (fleeTarget) { casterDistance = fleeTarget->GetDistance(owner); if (casterDistance > 0.2f) @@ -173,7 +193,8 @@ void FleeingMovementGenerator::GetPoint(T* owner, Position& position) casterAngle = frand(0.0f, 2.0f * float(M_PI)); } - float distance, angle; + float distance = 0.f; + float angle = 0.f; if (casterDistance < MIN_QUIET_DISTANCE) { distance = frand(0.4f, 1.3f) * (MIN_QUIET_DISTANCE - casterDistance); diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index dfd59a255..064597f36 100644 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -24,7 +24,7 @@ template class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovementGenerator > { public: - explicit FleeingMovementGenerator(ObjectGuid fleeTargetGUID) : _path(nullptr), _fleeTargetGUID(fleeTargetGUID), _timer(0), _interrupt(false) {} + explicit FleeingMovementGenerator(ObjectGuid fleeTargetGUID) : _path(nullptr), _fleeTargetGUID(fleeTargetGUID), _timer(0), _interrupt(false), _shortPathsCount(0) { } MovementGeneratorType GetMovementGeneratorType() override { return FLEEING_MOTION_TYPE; } @@ -41,6 +41,7 @@ class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovem ObjectGuid _fleeTargetGUID; TimeTracker _timer; bool _interrupt; + uint8 _shortPathsCount; }; class TimedFleeingMovementGenerator : public FleeingMovementGenerator From 5c7e7afade96ab740602e8923e3819000cc72d3a Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 6 Jun 2022 09:35:48 -0300 Subject: [PATCH 021/104] fix(Scripts/ZulGurub): Rewrite High Priest Thekal (#11784) --- .../rev_1654045846799908700.sql | 9 + src/server/game/Entities/Creature/Creature.h | 2 + .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 748 ++++++++---------- .../ZulGurub/instance_zulgurub.cpp | 51 +- .../EasternKingdoms/ZulGurub/zulgurub.h | 3 +- 5 files changed, 374 insertions(+), 439 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654045846799908700.sql diff --git a/data/sql/updates/pending_db_world/rev_1654045846799908700.sql b/data/sql/updates/pending_db_world/rev_1654045846799908700.sql new file mode 100644 index 000000000..cfe478d94 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654045846799908700.sql @@ -0,0 +1,9 @@ +-- +DELETE FROM `creature_text` WHERE `CreatureID` IN (11347, 11348) AND `GroupId` = 0; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration` ,`Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(11347, 0, 0, '%s dies.', 16, 0, 100, 0, 0, 0, 8251, 3, ''), +(11348, 0, 0, '%s dies.', 16, 0, 100, 0, 0, 0, 8251, 3, ''); + +DELETE FROM `creature_text` WHERE `CreatureID` = 14509 AND `GroupId` = 2; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration` ,`Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(14509, 2, 0, '%s dies.', 16, 0, 100, 0, 0, 0, 8251, 3, ''); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 5ae1f8768..5215bbb05 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -387,6 +387,8 @@ public: void ModifyThreatPercentTemp(Unit* victim, int32 percent, Milliseconds duration); + void ResetFaction() { SetFaction(GetCreatureTemplate()->faction); } + protected: bool CreateFromProto(ObjectGuid::LowType guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = nullptr); bool InitEntry(uint32 entry, const CreatureData* data = nullptr); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 58c0a87fc..e049edcc5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -15,34 +15,32 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Thekal -SD%Complete: 95 -SDComment: Almost finished. -SDCategory: Zul'Gurub -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "TaskScheduler.h" #include "zulgurub.h" enum Says { SAY_AGGRO = 0, - SAY_DEATH = 1 + SAY_DEATH = 1, + + EMOTE_ZEALOT_DIES = 0, + EMOTE_THEKAL_DIES = 2 }; enum Spells { - SPELL_MORTALCLEAVE = 22859, // Phase 1 - SPELL_SILENCE = 22666, // Phase 1 - SPELL_TIGER_FORM = 24169, // Phase 1 - SPELL_RESURRECT = 24173, // Phase 1 // Not used in script. - SPELL_FRENZY = 8269, // Phase 2 - SPELL_FORCEPUNCH = 24189, // Phase 2 - SPELL_CHARGE = 24193, // Phase 2 - SPELL_ENRAGE = 8269, // Phase 2 - SPELL_SUMMONTIGERS = 24183, // Phase 2 + SPELL_MORTALCLEAVE = 22859, + SPELL_SILENCE = 22666, + SPELL_TIGER_FORM = 24169, + SPELL_RESURRECT = 24173, + SPELL_FRENZY = 8269, + SPELL_FORCEPUNCH = 24189, + SPELL_CHARGE = 24193, + SPELL_ENRAGE = 8269, + SPELL_SUMMONTIGERS = 24183, + // Zealot Lor'Khan Spells SPELL_SHIELD = 20545, SPELL_BLOODLUST = 24185, @@ -56,23 +54,9 @@ enum Spells SPELL_BLIND = 21060 }; -enum Events +enum Actions { - EVENT_MORTALCLEAVE = 1, // Phase 1 - EVENT_SILENCE = 2, // Phase 1 - EVENT_CHECK_TIMER = 3, // Phase 1 - EVENT_RESURRECT_TIMER = 4, // Phase 1 - EVENT_FRENZY = 5, // Phase 2 - EVENT_FORCEPUNCH = 6, // Phase 2 - EVENT_SPELL_CHARGE = 7, // Phase 2 - EVENT_ENRAGE = 8, // Phase 2 - EVENT_SUMMONTIGERS = 9 // Phase 2 -}; - -enum Phases -{ - PHASE_ONE = 1, - PHASE_TWO = 2 + ACTION_RESSURRECT = 1 }; class boss_thekal : public CreatureScript @@ -82,170 +66,240 @@ public: struct boss_thekalAI : public BossAI { - boss_thekalAI(Creature* creature) : BossAI(creature, DATA_THEKAL) { } + boss_thekalAI(Creature* creature) : BossAI(creature, DATA_THEKAL) + { + Initialize(); + } bool Enraged; bool WasDead; - void Reset() override + void Initialize() { - if (events.IsInPhase(PHASE_TWO)) - me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack - _Reset(); Enraged = false; WasDead = false; + _lorkhanDied = false; + _zathDied = false; + } + + void Reset() override + { + _Reset(); + Initialize(); + + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (Creature* zealot = instance->GetCreature(DATA_LORKHAN)) + { + zealot->AI()->Reset(); + zealot->ResetFaction(); + } + + if (Creature* zealot = instance->GetCreature(DATA_ZATH)) + { + zealot->AI()->Reset(); + zealot->ResetFaction(); + } + + // TODO: do this in formations, once a flag is added to prevent leaders from respawning as well. + std::list creatureList; + GetCreatureListWithEntryInGrid(creatureList, me, NPC_ZULGURUB_TIGER, 15.0f); + + if (_catGuids.empty()) + { + for (Creature* creature : creatureList) + { + _catGuids.push_back(creature->GetGUID()); + if (!creature->IsAlive()) + { + creature->Respawn(true); + } + } + } + else + { + for (ObjectGuid guid : _catGuids) + { + if (Creature* creature = ObjectAccessor::GetCreature(*me, guid)) + { + if (!creature->IsAlive()) + { + creature->Respawn(true); + } + } + } + } + + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); } void JustDied(Unit* /*killer*/) override { _JustDied(); Talk(SAY_DEATH); + + if (Creature* zealot = instance->GetCreature(DATA_LORKHAN)) + { + zealot->Kill(zealot, zealot); + } + + if (Creature* zealot = instance->GetCreature(DATA_ZATH)) + { + zealot->Kill(zealot, zealot); + } } void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - events.ScheduleEvent(EVENT_MORTALCLEAVE, 4000, 0, PHASE_ONE); // Phase 1 - events.ScheduleEvent(EVENT_SILENCE, 9000, 0, PHASE_ONE); // Phase 1 - events.ScheduleEvent(EVENT_CHECK_TIMER, 10000, 0, PHASE_ONE); // Phase 1 - events.ScheduleEvent(EVENT_RESURRECT_TIMER, 10000, 0, PHASE_ONE); // Phase 1 - Talk(SAY_AGGRO); + + _scheduler.CancelAll(); + _scheduler.Schedule(4s, [this](TaskContext context) { + DoCastVictim(SPELL_MORTALCLEAVE); + context.Repeat(15s, 20s); + }).Schedule(9s, [this](TaskContext context) { + DoCastVictim(SPELL_SILENCE); + context.Repeat(20s, 25s); + }).Schedule(16s, [this](TaskContext context) { + DoCastSelf(SPELL_BLOODLUST); + context.Repeat(20s, 28s); + }); } - void JustReachedHome() override + void SetData(uint32 /*type*/, uint32 data) override { - instance->SetBossState(DATA_THEKAL, NOT_STARTED); + UpdateZealotStatus(data, true); + CheckPhaseTransition(); + + _scheduler.Schedule(10s, [this, data](TaskContext /*context*/) { + if ((!_lorkhanDied || !_zathDied) && !WasDead) + { + ReviveZealot(data); + } + }); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + if (!WasDead && damage >= me->GetHealth()) + { + damage = me->GetHealth() - 1; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_PASSIVE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->AttackStop(); + WasDead = true; + CheckPhaseTransition(); + Talk(EMOTE_THEKAL_DIES); + } + + if (!Enraged && me->HealthBelowPctDamaged(20, damage) && me->GetEntry() != NPC_HIGH_PRIEST_THEKAL) + { + DoCastSelf(SPELL_ENRAGE); + Enraged = true; + } + } + + void DoAction(int32 action) override + { + if (action == ACTION_RESSURRECT) + { + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->ResetFaction(); + me->SetReactState(REACT_AGGRESSIVE); + me->SetFullHealth(); + WasDead = false; + } } void UpdateAI(uint32 diff) override { - if (!UpdateVictim()) + if (me->GetReactState() != REACT_PASSIVE && !UpdateVictim()) return; - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_MORTALCLEAVE: - DoCastVictim(SPELL_MORTALCLEAVE, true); - events.ScheduleEvent(EVENT_MORTALCLEAVE, urand(15000, 20000), 0, PHASE_ONE); - break; - case EVENT_SILENCE: - DoCastVictim(SPELL_SILENCE, true); - events.ScheduleEvent(EVENT_SILENCE, urand(20000, 25000), 0, PHASE_ONE); - break; - case EVENT_RESURRECT_TIMER: - //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. - if (WasDead) - { - DoCast(me, SPELL_TIGER_FORM); // SPELL_AURA_TRANSFORM - me->SetObjectScale(2.00f); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - /* - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); - me->UpdateDamagePhysical(BASE_ATTACK); - */ - me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 40.0f, true); // hack - DoResetThreat(); - events.ScheduleEvent(EVENT_FRENZY, 30000, 0, PHASE_TWO); // Phase 2 - events.ScheduleEvent(EVENT_FORCEPUNCH, 4000, 0, PHASE_TWO); // Phase 2 - events.ScheduleEvent(EVENT_SPELL_CHARGE, 12000, 0, PHASE_TWO); // Phase 2 - events.ScheduleEvent(EVENT_ENRAGE, 32000, 0, PHASE_TWO); // Phase 2 - events.ScheduleEvent(EVENT_SUMMONTIGERS, 25000, 0, PHASE_TWO); // Phase 2 - events.SetPhase(PHASE_TWO); - } - events.ScheduleEvent(EVENT_RESURRECT_TIMER, 10000, 0, PHASE_ONE); - break; - case EVENT_CHECK_TIMER: - //Check_Timer for the death of LorKhan and Zath. - if (!WasDead) - { - if (instance->GetBossState(DATA_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->SetFaction(FACTION_MONSTER); - pLorKhan->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->SetFullHealth(); - instance->SetData(DATA_LORKHAN, DONE); - } - } - - if (instance->GetBossState(DATA_ZATH) == SPECIAL) - { - //Resurrect Zath - if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH))) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->SetFaction(FACTION_MONSTER); - pZath->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - pZath->SetFullHealth(); - instance->SetBossState(DATA_ZATH, DONE); - } - } - } - events.ScheduleEvent(EVENT_CHECK_TIMER, 5000, 0, PHASE_ONE); - break; - case EVENT_FRENZY: - DoCast(me, SPELL_FRENZY); - events.ScheduleEvent(EVENT_FRENZY, 30000, 0, PHASE_TWO); - break; - case EVENT_FORCEPUNCH: - DoCastVictim(SPELL_FORCEPUNCH, true); - events.ScheduleEvent(EVENT_FORCEPUNCH, urand(16000, 21000), 0, PHASE_TWO); - break; - case EVENT_CHARGE: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - DoCast(target, SPELL_CHARGE); - DoResetThreat(); - AttackStart(target); - } - events.ScheduleEvent(EVENT_CHARGE, urand(15000, 22000), 0, PHASE_TWO); - break; - case EVENT_ENRAGE: - if (HealthBelowPct(11) && !Enraged) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - events.ScheduleEvent(EVENT_ENRAGE, 30000); - break; - case EVENT_SUMMONTIGERS: - DoCastVictim(SPELL_SUMMONTIGERS, true); - events.ScheduleEvent(EVENT_SUMMONTIGERS, urand(10000, 14000), 0, PHASE_TWO); - break; - default: - break; - } - - if (me->IsFullHealth() && WasDead) - WasDead = false; - - if ((events.IsInPhase(PHASE_ONE)) && !WasDead && !HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->AttackStop(); - instance->SetBossState(DATA_THEKAL, SPECIAL); - WasDead = true; - } - } - DoMeleeAttackIfReady(); + _scheduler.Update(diff, + std::bind(&BossAI::DoMeleeAttackIfReady, this)); } + + void ReviveZealot(uint32 zealotData) + { + if (Creature* zealot = instance->GetCreature(zealotData)) + { + zealot->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + zealot->ResetFaction(); + zealot->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + zealot->SetReactState(REACT_AGGRESSIVE); + zealot->SetFullHealth(); + UpdateZealotStatus(zealotData, false); + } + } + + void UpdateZealotStatus(uint32 data, bool dead) + { + if (data == DATA_LORKHAN) + { + _lorkhanDied = dead; + } + else if (data == DATA_ZATH) + { + _zathDied = dead; + } + } + + void CheckPhaseTransition() + { + if (WasDead && _lorkhanDied && _zathDied) + { + _scheduler.Schedule(3s, [this](TaskContext /*context*/) { + Talk(SAY_AGGRO); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + + _scheduler.Schedule(6s, [this](TaskContext /*context*/) { + DoCastSelf(SPELL_TIGER_FORM); + me->SetReactState(REACT_AGGRESSIVE); + + _scheduler.Schedule(30s, [this](TaskContext context) { + DoCastSelf(SPELL_FRENZY); + context.Repeat(); + }).Schedule(4s, [this](TaskContext context) { + DoCastVictim(SPELL_FORCEPUNCH); + context.Repeat(16s, 21s); + }).Schedule(12s, [this](TaskContext context) { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + { + DoCast(target, SPELL_CHARGE); + DoResetThreat(); + AttackStart(target); + } + context.Repeat(15s, 22s); + }).Schedule(25s, [this](TaskContext context) { + DoCastVictim(SPELL_SUMMONTIGERS, true); + context.Repeat(10s, 14s); + }); + }); + }); + } + else + { + _scheduler.Schedule(10s, [this](TaskContext /*context*/) { + DoAction(ACTION_RESSURRECT); + }); + } + } + + private: + TaskScheduler _scheduler; + GuidVector _catGuids; + bool _lorkhanDied; + bool _zathDied; }; CreatureAI* GetAI(Creature* creature) const override @@ -254,7 +308,6 @@ public: } }; -//Zealot Lor'Khan class npc_zealot_lorkhan : public CreatureScript { public: @@ -267,138 +320,86 @@ public: instance = creature->GetInstanceScript(); } - uint32 Shield_Timer; - uint32 BloodLust_Timer; - uint32 GreaterHeal_Timer; - uint32 Disarm_Timer; - uint32 Check_Timer; - - bool FakeDeath; - InstanceScript* instance; void Reset() override { - Shield_Timer = 1000; - BloodLust_Timer = 16000; - GreaterHeal_Timer = 32000; - Disarm_Timer = 6000; - Check_Timer = 10000; - - FakeDeath = false; - - instance->SetBossState(DATA_LORKHAN, NOT_STARTED); - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + + _scheduler.CancelAll(); + + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING) && !me->HasReactState(REACT_PASSIVE); + }); } void EnterCombat(Unit* /*who*/) override { + _scheduler.Schedule(1s, [this](TaskContext context) { + DoCastSelf(SPELL_SHIELD); + context.Repeat(1min); + }).Schedule(32s, [this](TaskContext context) { + Unit* thekal = instance->GetCreature(DATA_THEKAL); + Unit* zath = instance->GetCreature(DATA_ZATH); + + if (!thekal || !zath) + return; + + if ((me->GetHealthPct() <= thekal->GetHealthPct()) || (me->GetHealthPct() <= zath->GetHealthPct())) + { + DoCastSelf(SPELL_GREATERHEAL); + } + else if (zath->GetHealthPct() <= thekal->GetHealthPct()) + { + DoCast(zath, SPELL_GREATERHEAL); + } + else + { + DoCast(thekal, SPELL_GREATERHEAL); + } + + context.Repeat(15s, 20s); + }).Schedule(6s, [this](TaskContext context) { + DoCastVictim(SPELL_DISARM); + context.Repeat(15s, 25s); + }); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + if (damage >= me->GetHealth() && me->HasReactState(REACT_AGGRESSIVE)) + { + Talk(EMOTE_ZEALOT_DIES); + me->RemoveAllAuras(); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(false); + me->AttackStop(); + + damage = 0; + + if (Creature* thekal = instance->GetCreature(DATA_THEKAL)) + { + thekal->AI()->SetData(ACTION_RESSURRECT, DATA_LORKHAN); + } + } } void UpdateAI(uint32 diff) override { - if (!UpdateVictim()) + if (me->GetReactState() != REACT_PASSIVE && !UpdateVictim()) return; - //Shield_Timer - if (Shield_Timer <= diff) - { - DoCast(me, SPELL_SHIELD); - Shield_Timer = 61000; - } - else Shield_Timer -= diff; - - //BloodLust_Timer - if (BloodLust_Timer <= diff) - { - DoCast(me, SPELL_BLOODLUST); - BloodLust_Timer = 20000 + rand() % 8000; - } - else BloodLust_Timer -= diff; - - //Casting Greaterheal to Thekal or Zath if they are in meele range. - if (GreaterHeal_Timer <= diff) - { - Unit* pThekal = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THEKAL)); - Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH)); - - if (!pThekal || !pZath) - return; - - switch (urand(0, 1)) - { - case 0: - if (me->IsWithinMeleeRange(pThekal)) - DoCast(pThekal, SPELL_GREATERHEAL); - break; - case 1: - if (me->IsWithinMeleeRange(pZath)) - DoCast(pZath, SPELL_GREATERHEAL); - break; - } - - GreaterHeal_Timer = 15000 + rand() % 5000; - } - else GreaterHeal_Timer -= diff; - - //Disarm_Timer - if (Disarm_Timer <= diff) - { - DoCastVictim(SPELL_DISARM); - Disarm_Timer = 15000 + rand() % 10000; - } - else Disarm_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (instance->GetBossState(DATA_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit* pThekal = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - pThekal->SetFaction(FACTION_MONSTER); - pThekal->SetFullHealth(); - } - } - - if (instance->GetBossState(DATA_ZATH) == SPECIAL) - { - //Resurrect Zath - if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH))) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - pZath->SetFaction(FACTION_MONSTER); - pZath->SetFullHealth(); - } - } - - Check_Timer = 5000; - } - else Check_Timer -= diff; - - if (!HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->SetFaction(FACTION_FRIENDLY); - me->AttackStop(); - - instance->SetBossState(DATA_LORKHAN, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); + _scheduler.Update(diff, + std::bind(&ScriptedAI::DoMeleeAttackIfReady, this)); } + + private: + TaskScheduler _scheduler; }; CreatureAI* GetAI(Creature* creature) const override @@ -407,14 +408,10 @@ public: } }; -//Zealot Zath class npc_zealot_zath : public CreatureScript { public: - npc_zealot_zath() - : CreatureScript("npc_zealot_zath") - { - } + npc_zealot_zath() : CreatureScript("npc_zealot_zath") { } struct npc_zealot_zathAI : public ScriptedAI { @@ -423,135 +420,82 @@ public: instance = creature->GetInstanceScript(); } - uint32 SweepingStrikes_Timer; - uint32 SinisterStrike_Timer; - uint32 Gouge_Timer; - uint32 Kick_Timer; - uint32 Blind_Timer; - uint32 Check_Timer; - - bool FakeDeath; - InstanceScript* instance; void Reset() override { - SweepingStrikes_Timer = 13000; - SinisterStrike_Timer = 8000; - Gouge_Timer = 25000; - Kick_Timer = 18000; - Blind_Timer = 5000; - Check_Timer = 10000; - - FakeDeath = false; - - instance->SetBossState(DATA_ZATH, NOT_STARTED); - me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + + _scheduler.CancelAll(); + + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING) && !me->HasReactState(REACT_PASSIVE); + }); } void EnterCombat(Unit* /*who*/) override { + _scheduler.Schedule(13s, [this](TaskContext context) { + DoCastSelf(SPELL_SWEEPINGSTRIKES); + context.Repeat(1min); + }).Schedule(16s, [this](TaskContext context) { + DoCastSelf(SPELL_BLOODLUST); + context.Repeat(22s, 26s); + }).Schedule(8s, [this](TaskContext context) { + DoCastVictim(SPELL_SINISTERSTRIKE); + context.Repeat(8s, 16s); + }).Schedule(25s, [this](TaskContext context) { + DoCastVictim(SPELL_GOUGE); + + if (DoGetThreat(me->GetVictim())) + { + DoModifyThreatPercent(me->GetVictim(), -100); + } + + context.Repeat(17s, 27s); + }).Schedule(18s, [this](TaskContext context) { + DoCastVictim(SPELL_KICK); + context.Repeat(15s, 25s); + }).Schedule(5s, [this](TaskContext context) { + DoCastVictim(SPELL_BLIND); + context.Repeat(10s, 20s); + }); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + if (damage >= me->GetHealth() && me->HasReactState(REACT_AGGRESSIVE)) + { + Talk(EMOTE_ZEALOT_DIES); + me->RemoveAllAuras(); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + + damage = 0; + + if (Creature* thekal = instance->GetCreature(DATA_THEKAL)) + { + thekal->AI()->SetData(ACTION_RESSURRECT, DATA_ZATH); + } + } } void UpdateAI(uint32 diff) override { - if (!UpdateVictim()) + if (me->GetReactState() != REACT_PASSIVE && !UpdateVictim()) return; - //SweepingStrikes_Timer - if (SweepingStrikes_Timer <= diff) - { - DoCastVictim(SPELL_SWEEPINGSTRIKES); - SweepingStrikes_Timer = 22000 + rand() % 4000; - } - else SweepingStrikes_Timer -= diff; - - //SinisterStrike_Timer - if (SinisterStrike_Timer <= diff) - { - DoCastVictim(SPELL_SINISTERSTRIKE); - SinisterStrike_Timer = 8000 + rand() % 8000; - } - else SinisterStrike_Timer -= diff; - - //Gouge_Timer - if (Gouge_Timer <= diff) - { - DoCastVictim(SPELL_GOUGE); - - if (DoGetThreat(me->GetVictim())) - DoModifyThreatPercent(me->GetVictim(), -100); - - Gouge_Timer = 17000 + rand() % 10000; - } - else Gouge_Timer -= diff; - - //Kick_Timer - if (Kick_Timer <= diff) - { - DoCastVictim(SPELL_KICK); - Kick_Timer = 15000 + rand() % 10000; - } - else Kick_Timer -= diff; - - //Blind_Timer - if (Blind_Timer <= diff) - { - DoCastVictim(SPELL_BLIND); - Blind_Timer = 10000 + rand() % 10000; - } - else Blind_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (instance->GetBossState(DATA_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->SetFaction(FACTION_MONSTER); - pLorKhan->SetFullHealth(); - } - } - - if (instance->GetBossState(DATA_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit* pThekal = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - pThekal->SetFaction(FACTION_MONSTER); - pThekal->SetFullHealth(); - } - } - - Check_Timer = 5000; - } - else Check_Timer -= diff; - - if (!HealthAbovePct(5)) - { - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - me->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->SetFaction(FACTION_FRIENDLY); - me->AttackStop(); - - instance->SetBossState(DATA_ZATH, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); + _scheduler.Update(diff, + std::bind(&ScriptedAI::DoMeleeAttackIfReady, this)); } + + private: + TaskScheduler _scheduler; }; CreatureAI* GetAI(Creature* creature) const override diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 91c7bd67f..eee9e00cb 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -29,7 +29,14 @@ EndScriptData */ DoorData const doorData[] = { { GO_FORCEFIELD, DATA_ARLOKK, DOOR_TYPE_ROOM }, - { 0, 0, DOOR_TYPE_ROOM } // END + { 0, 0, DOOR_TYPE_ROOM } +}; + +ObjectData const creatureData[] = +{ + { NPC_HIGH_PRIEST_THEKAL, DATA_THEKAL }, + { NPC_ZEALOT_LORKHAN, DATA_LORKHAN }, + { NPC_ZEALOT_ZATH, DATA_ZATH } }; class instance_zulgurub : public InstanceMapScript @@ -43,21 +50,15 @@ public: { SetBossNumber(EncounterCount); LoadDoorData(doorData); + LoadObjectData(creatureData, nullptr); } void OnCreatureCreate(Creature* creature) override { + InstanceScript::OnCreatureCreate(creature); + switch (creature->GetEntry()) { - case NPC_ZEALOT_LORKHAN: - _zealotLorkhanGUID = creature->GetGUID(); - break; - case NPC_ZEALOT_ZATH: - _zealotZathGUID = creature->GetGUID(); - break; - case NPC_HIGH_PRIEST_THEKAL: - _highPriestTekalGUID = creature->GetGUID(); - break; case NPC_JINDO_THE_HEXXER: _jindoTheHexxerGUID = creature->GetGUID(); break; @@ -75,11 +76,10 @@ public: void OnGameObjectCreate(GameObject* go) override { + InstanceScript::OnGameObjectCreate(go); + switch (go->GetEntry()) { - case GO_FORCEFIELD: - AddDoor(go, true); - break; case GO_GONG_OF_BETHEKK: _goGongOfBethekkGUID = go->GetGUID(); if (GetBossState(DATA_ARLOKK) == DONE) @@ -92,28 +92,10 @@ public: } } - void OnGameObjectRemove(GameObject* go) override - { - switch (go->GetEntry()) - { - case GO_FORCEFIELD: - AddDoor(go, false); - break; - default: - break; - } - } - ObjectGuid GetGuidData(uint32 uiData) const override { switch (uiData) { - case DATA_LORKHAN: - return _zealotLorkhanGUID; - case DATA_ZATH: - return _zealotZathGUID; - case DATA_THEKAL: - return _highPriestTekalGUID; case DATA_JINDO: return _jindoTheHexxerGUID; case NPC_ARLOKK: @@ -170,12 +152,9 @@ public: OUT_LOAD_INST_DATA_COMPLETE; } private: - //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. - //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too. + // If all High Priest bosses were killed. Ohgan is added too. + // Jindo is needed for healfunction. - ObjectGuid _zealotLorkhanGUID; - ObjectGuid _zealotZathGUID; - ObjectGuid _highPriestTekalGUID; ObjectGuid _jindoTheHexxerGUID; ObjectGuid _vilebranchSpeakerGUID; ObjectGuid _arlokkGUID; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 00a8e20cb..8c44120d1 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -58,7 +58,8 @@ enum CreatureIds NPC_OHGAN = 14988, // Mandokir Event NPC_VILEBRANCH_SPEAKER = 11391, // Mandokir Event NPC_CHAINED_SPIRT = 15117, // Mandokir Event - NPC_HAKKAR = 14834 + NPC_HAKKAR = 14834, + NPC_ZULGURUB_TIGER = 11361 }; enum GameobjectIds From d98585160f48a266bc52948d71d6683a584703ea Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 6 Jun 2022 12:37:54 +0000 Subject: [PATCH 022/104] chore(DB): import pending files Referenced commit(s): 5c7e7afade96ab740602e8923e3819000cc72d3a --- .../rev_1654045846799908700.sql => db_world/2022_06_06_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654045846799908700.sql => db_world/2022_06_06_04.sql} (94%) diff --git a/data/sql/updates/pending_db_world/rev_1654045846799908700.sql b/data/sql/updates/db_world/2022_06_06_04.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1654045846799908700.sql rename to data/sql/updates/db_world/2022_06_06_04.sql index cfe478d94..d389f72cd 100644 --- a/data/sql/updates/pending_db_world/rev_1654045846799908700.sql +++ b/data/sql/updates/db_world/2022_06_06_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_06_03 -> 2022_06_06_04 -- DELETE FROM `creature_text` WHERE `CreatureID` IN (11347, 11348) AND `GroupId` = 0; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration` ,`Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES From ffda31fc23959cc274078aa76ab6fd4d9e2dce5d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:46:54 +0200 Subject: [PATCH 023/104] fix(Scripts/ZulGurub): Fixed Jindo's Healing Ward Totem. (#11841) Fixed #11763 --- .../scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 41fec401c..8bf8986b1 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -34,12 +34,12 @@ enum Say enum Spells { SPELL_BRAINWASHTOTEM = 24262, - SPELL_POWERFULLHEALINGWARD = 24309, // HACKED Totem summoned by script because the spell totems will not cast. + SPELL_POWERFULLHEALINGWARD = 24309, SPELL_HEX = 24053, SPELL_DELUSIONSOFJINDO = 24306, SPELL_SHADEOFJINDO = 24308, // HACKED //Healing Ward Spell - SPELL_HEAL = 38588, // HACKED Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... + SPELL_HEAL = 24311, //Shade of Jindo Spell SPELL_SHADOWSHOCK = 19460, SPELL_INVISIBLE = 24699 @@ -104,9 +104,8 @@ public: DoCast(me, SPELL_BRAINWASHTOTEM); events.ScheduleEvent(EVENT_BRAINWASHTOTEM, urand(18000, 26000)); break; - case EVENT_POWERFULLHEALINGWARD: // HACK - //DoCast(me, SPELL_POWERFULLHEALINGWARD); - me->SummonCreature(14987, me->GetPositionX() + 3, me->GetPositionY() - 2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + case EVENT_POWERFULLHEALINGWARD: + DoCastSelf(SPELL_POWERFULLHEALINGWARD, true); events.ScheduleEvent(EVENT_POWERFULLHEALINGWARD, urand(14000, 20000)); break; case EVENT_HEX: From 75858bd7867e734ef07e6efedd561a86525a78e1 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:47:11 +0300 Subject: [PATCH 024/104] fix(Script/Instance): Ulduar - Fix Keeper's missing gossips and remove hardcode (#11831) * Ulduar-Keepers-Gossip * codestyle --- .../Northrend/Ulduar/Ulduar/ulduar.cpp | 107 +++++++++++++----- 1 file changed, 81 insertions(+), 26 deletions(-) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp index 4667c032d..4eaa6de1d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.cpp @@ -25,6 +25,31 @@ #include "SpellScript.h" #include "Vehicle.h" +enum Texts +{ + // Freya + GOSSIP_MENU_FREYA = 10324, + NPC_TEXT_FREYA = 14332, + + // Hodir + GOSSIP_MENU_HODIR = 10335, + NPC_TEXT_HODIR = 14326, + + // Mimiron + GOSSIP_MENU_MIMIRON = 10336, + NPC_TEXT_MIMIRON = 14334, + + // Thorim + GOSSIP_MENU_THORIM = 10337, + NPC_TEXT_THORIM = 14333, + + // Confirm assistance + GOSSIP_MENU_CONFIRM = 10333, + NPC_TEXT_CONFIRM = 14325, + + SAY_KEEPER_SELECTED = 1, +}; + class npc_ulduar_keeper : public CreatureScript { public: @@ -32,45 +57,75 @@ public: bool OnGossipHello(Player* player, Creature* creature) override { - AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Lend us your aid, keeper. Together we shall defeat Yogg-Saron.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID()); - return true; - } - - bool OnGossipSelect(Player* /*player*/, Creature* creature, uint32 /*uiSender*/, uint32 /*uiAction*/) override - { - creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); - uint8 _keeper = 0; + uint32 gossipMenuId = 0; + uint32 gossipTextId = 0; switch (creature->GetEntry()) { case NPC_FREYA_GOSSIP: - creature->Yell("Eonar, your servant calls for your blessing!", LANG_UNIVERSAL); - creature->PlayDirectSound(15535); - _keeper = KEEPER_FREYA; + gossipMenuId = GOSSIP_MENU_FREYA; + gossipTextId = NPC_TEXT_FREYA; break; case NPC_HODIR_GOSSIP: - creature->Yell("The veil of winter will protect you, champions!", LANG_UNIVERSAL); - creature->PlayDirectSound(15559); - _keeper = KEEPER_HODIR; + gossipMenuId = GOSSIP_MENU_HODIR; + gossipTextId = NPC_TEXT_HODIR; break; case NPC_MIMIRON_GOSSIP: - creature->Yell("Combat matrix enhanced. Behold wonderous rapidity!", LANG_UNIVERSAL); - creature->PlayDirectSound(15630); - _keeper = KEEPER_MIMIRON; + gossipMenuId = GOSSIP_MENU_MIMIRON; + gossipTextId = NPC_TEXT_MIMIRON; break; case NPC_THORIM_GOSSIP: - creature->Yell("Golganneth, lend me your strengh! Grant my mortal allies the power of thunder!", LANG_UNIVERSAL); - creature->PlayDirectSound(15750); - _keeper = KEEPER_THORIM; + gossipMenuId = GOSSIP_MENU_THORIM; + gossipTextId = NPC_TEXT_THORIM; break; } - if (creature->GetInstanceScript()) - { - creature->GetInstanceScript()->SetData(TYPE_WATCHERS, _keeper); - creature->DespawnOrUnsummon(6000); - } + AddGossipItemFor(player, gossipMenuId, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + SendGossipMenuFor(player, gossipTextId, creature->GetGUID()); + return true; + } + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override + { + ClearGossipMenuFor(player); + uint8 _keeper = 0; + switch (action) + { + case GOSSIP_ACTION_INFO_DEF+1: + AddGossipItemFor(player, GOSSIP_MENU_CONFIRM, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + SendGossipMenuFor(player, NPC_TEXT_CONFIRM, creature); + break; + case GOSSIP_ACTION_INFO_DEF+2: + { + switch (creature->GetEntry()) + { + case NPC_FREYA_GOSSIP: + creature->AI()->Talk(SAY_KEEPER_SELECTED); + _keeper = KEEPER_FREYA; + break; + case NPC_HODIR_GOSSIP: + creature->AI()->Talk(SAY_KEEPER_SELECTED); + _keeper = KEEPER_HODIR; + break; + case NPC_MIMIRON_GOSSIP: + creature->AI()->Talk(SAY_KEEPER_SELECTED); + _keeper = KEEPER_MIMIRON; + break; + case NPC_THORIM_GOSSIP: + creature->AI()->Talk(SAY_KEEPER_SELECTED); + _keeper = KEEPER_THORIM; + break; + } + + creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE); + CloseGossipMenuFor(player); + + if (creature->GetInstanceScript()) + { + creature->GetInstanceScript()->SetData(TYPE_WATCHERS, _keeper); + creature->DespawnOrUnsummon(6000); + } + } + } return true; } }; From 41b0fa02f2ea251e876de5dfc03f0be2d4bdc2f0 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 6 Jun 2022 20:20:40 +0200 Subject: [PATCH 025/104] =?UTF-8?q?fix(Scripts/ZulGurub):=20Shade=20of=20J?= =?UTF-8?q?in'do's=20invisibility=20aura=20should=20not=E2=80=A6=20(#11838?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/ZulGurub): Shade of Jin'do's invisibility aura should not be removed on attack. Fixes #11557 * missing stuff. * Update. --- .../pending_db_world/rev_1654335331116726700.sql | 2 ++ src/server/game/Grids/Notifiers/GridNotifiers.h | 15 +++++++++++++-- .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 9 +++++---- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654335331116726700.sql diff --git a/data/sql/updates/pending_db_world/rev_1654335331116726700.sql b/data/sql/updates/pending_db_world/rev_1654335331116726700.sql new file mode 100644 index 000000000..d840f6d76 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654335331116726700.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x00400000 WHERE `entry`=14986; diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index c8692a224..eba4476d7 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -1078,8 +1078,19 @@ namespace Acore bool operator()(Unit* u) { // Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems - if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem()) - return false; + if (Creature* creature = u->ToCreature()) + { + if (creature->IsTotem()) + { + return false; + } + + if (creature->IsAvoidingAOE()) + { + return false; + } + + } if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range)) return true; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 8bf8986b1..2eb62367a 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -37,12 +37,12 @@ enum Spells SPELL_POWERFULLHEALINGWARD = 24309, SPELL_HEX = 24053, SPELL_DELUSIONSOFJINDO = 24306, - SPELL_SHADEOFJINDO = 24308, // HACKED //Healing Ward Spell SPELL_HEAL = 24311, //Shade of Jindo Spell - SPELL_SHADOWSHOCK = 19460, - SPELL_INVISIBLE = 24699 + SPELL_SHADEOFJINDO_PASSIVE = 24307, + SPELL_SHADEOFJINDO_VISUAL = 24313, + SPELL_SHADOWSHOCK = 19460 }; enum Events @@ -250,7 +250,8 @@ public: void Reset() override { ShadowShock_Timer = 1000; - DoCast(me, SPELL_INVISIBLE, true); + DoCastSelf(SPELL_SHADEOFJINDO_PASSIVE, true); + DoCastSelf(SPELL_SHADEOFJINDO_VISUAL, true); } void EnterCombat(Unit* /*who*/) override { } From d8ea95361a360b5f8b5d8da09efab890b946890a Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 6 Jun 2022 18:22:40 +0000 Subject: [PATCH 026/104] chore(DB): import pending files Referenced commit(s): 41b0fa02f2ea251e876de5dfc03f0be2d4bdc2f0 --- .../rev_1654335331116726700.sql => db_world/2022_06_06_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654335331116726700.sql => db_world/2022_06_06_05.sql} (68%) diff --git a/data/sql/updates/pending_db_world/rev_1654335331116726700.sql b/data/sql/updates/db_world/2022_06_06_05.sql similarity index 68% rename from data/sql/updates/pending_db_world/rev_1654335331116726700.sql rename to data/sql/updates/db_world/2022_06_06_05.sql index d840f6d76..ef719ec51 100644 --- a/data/sql/updates/pending_db_world/rev_1654335331116726700.sql +++ b/data/sql/updates/db_world/2022_06_06_05.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_06_04 -> 2022_06_06_05 -- UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x00400000 WHERE `entry`=14986; From 6535c943e62625dd01f3c349c60795cc7a0b9f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Mon, 6 Jun 2022 21:11:22 +0200 Subject: [PATCH 027/104] refactor: remove useless ternary operator (#11907) --- src/server/scripts/Kalimdor/zone_silithus.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 609e3d7b1..13ea19874 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -1045,9 +1045,9 @@ public: if (reportUse) { uint32 gossipId = me->GetGOInfo()->GetGossipMenuId(); - bool _twilightSetAura = (player->HasAura(AURA_TWILIGHT_SET, player->GetGUID()) ? true : false); - bool _medallionAura = (player->HasAura(AURA_MEDALLION, player->GetGUID()) ? true : false); - bool _ringAura = (player->HasAura(AURA_RING, player->GetGUID()) ? true : false); + bool _twilightSetAura = (player->HasAura(AURA_TWILIGHT_SET, player->GetGUID())); + bool _medallionAura = (player->HasAura(AURA_MEDALLION, player->GetGUID())); + bool _ringAura = (player->HasAura(AURA_RING, player->GetGUID())); switch (gossipId) { From 70f3891352744ede66b12c3e1b2e52d3d5794564 Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Mon, 6 Jun 2022 13:12:20 -0600 Subject: [PATCH 028/104] fix(Scripts/ZulGurub): Update Gahzranka's abilities (#11849) --- .../EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 83e25a6c7..b75928c48 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -30,7 +30,8 @@ enum Spells { SPELL_FROSTBREATH = 16099, SPELL_MASSIVEGEYSER = 22421, - SPELL_SLAM = 24326 + SPELL_SLAM = 24326, + SPELL_THRASH = 3417 // Triggers 3391 }; enum Events @@ -40,7 +41,7 @@ enum Events EVENT_SLAM = 3 }; -class boss_gahzranka : public CreatureScript // gahzranka +class boss_gahzranka : public CreatureScript { public: boss_gahzranka() : CreatureScript("boss_gahzranka") { } @@ -62,9 +63,10 @@ public: void EnterCombat(Unit* /*who*/) override { _EnterCombat(); + me->AddAura(SPELL_THRASH, me); events.ScheduleEvent(EVENT_FROSTBREATH, 8000); events.ScheduleEvent(EVENT_MASSIVEGEYSER, 25000); - events.ScheduleEvent(EVENT_SLAM, 17000); + events.ScheduleEvent(EVENT_SLAM, 15000); } void UpdateAI(uint32 diff) override @@ -82,11 +84,11 @@ public: switch (eventId) { case EVENT_FROSTBREATH: - DoCastVictim(SPELL_FROSTBREATH, true); - events.ScheduleEvent(EVENT_FROSTBREATH, urand(7000, 11000)); + DoCastVictim(SPELL_FROSTBREATH); + events.ScheduleEvent(EVENT_FROSTBREATH, urand(8000, 20000)); break; case EVENT_MASSIVEGEYSER: - DoCastVictim(SPELL_MASSIVEGEYSER, true); + DoCastVictim(SPELL_MASSIVEGEYSER); events.ScheduleEvent(EVENT_MASSIVEGEYSER, urand(22000, 32000)); break; case EVENT_SLAM: From f31260051370662ed63a21058e501bf1e4e1459d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Wed, 8 Jun 2022 04:38:33 +0200 Subject: [PATCH 029/104] fix(Core): Crashfix. (#11956) --- src/server/scripts/Northrend/isle_of_conquest.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp index a75615c39..afeba1fc5 100644 --- a/src/server/scripts/Northrend/isle_of_conquest.cpp +++ b/src/server/scripts/Northrend/isle_of_conquest.cpp @@ -127,8 +127,13 @@ public: void JustDied(Unit* killer) override { - if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, me); + if (killer) + { + if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, 1, 0, me); + } + } } }; From 9a475ed47d0334a22c8c05660b81778d304a91ee Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Tue, 7 Jun 2022 20:40:59 -0600 Subject: [PATCH 030/104] fix(DB/pathing): Dun Morogh Missing Pathing (#11923) --- .../rev_1654010021003239500.sql | 833 ++++++++++++++++++ 1 file changed, 833 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1654010021003239500.sql diff --git a/data/sql/updates/pending_db_world/rev_1654010021003239500.sql b/data/sql/updates/pending_db_world/rev_1654010021003239500.sql new file mode 100644 index 000000000..51633cad8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654010021003239500.sql @@ -0,0 +1,833 @@ +-- +/* Frostmane Troll Whelp - GUID 1311 */ + + +SET @NPC := 1311; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -6528.93, `position_y` = 401.96, `position_z` = 382.521, `orientation` = 0.949249 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -6528.93, 401.96, 382.521, 100.0, 0), +(@PATH, 2, -6531.52, 394.46, 381.74, 100.0, 0), +(@PATH, 3, -6537.66, 385.633, 381.193, 100.0, 0), +(@PATH, 4, -6538.54, 377.197, 381.4, 100.0, 0), +(@PATH, 5, -6530.65, 380.315, 382.223, 100.0, 0), +(@PATH, 6, -6524.32, 382.633, 382.528, 100.0, 0), +(@PATH, 7, -6518.64, 384.007, 383.915, 100.0, 0), +(@PATH, 8, -6510.7, 385.93, 384.638, 100.0, 0), +(@PATH, 9, -6498.4, 390.355, 384.936, 100.0, 0), +(@PATH, 10, -6507.72, 386.65, 385.012, 100.0, 0), +(@PATH, 11, -6516.47, 384.167, 384.138, 100.0, 0), +(@PATH, 12, -6523.69, 382.846, 382.742, 100.0, 0), +(@PATH, 13, -6531.98, 379.712, 382.186, 100.0, 0), +(@PATH, 14, -6538.37, 377.715, 381.373, 100.0, 0), +(@PATH, 15, -6539.57, 386.47, 381.676, 100.0, 0), +(@PATH, 16, -6533.17, 392.053, 381.583, 100.0, 0); + +/* Ironforge Guard - GUID 1748 */ + + +SET @NPC := 1748; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -4958.85, `position_y` = -997.529, `position_z` = 501.572, `orientation` = 0.977868 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -4942.37, -973.067, 501.552, 0.0, 0), +(@PATH, 2, -4922.72, -954.752, 501.57, 0.0, 0), +(@PATH, 3, -4896.28, -936.781, 501.492, 0.0, 0), +(@PATH, 4, -4872.0, -926.028, 501.515, 0.0, 0), +(@PATH, 5, -4872.0, -926.028, 501.515, 3.5488, 45000), +(@PATH, 6, -4905.08, -941.83, 501.56, 0.0, 0), +(@PATH, 7, -4929.3, -961.502, 501.57, 0.0, 0), +(@PATH, 8, -4958.95, -997.889, 501.481, 0.0, 0), +(@PATH, 9, -4958.95, -997.889, 501.481, 0.9884, 45000); + +/* High Priest Rohan - GUID 1777 */ + + +SET @NPC := 1777; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -4612.27, `position_y` = -909.098, `position_z` = 501.146, `orientation` = 4.32842 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -4612.25, -909.152, 501.062, 4.32842, 90000), +(@PATH, 2, -4603.22, -905.336, 502.767, 0.0, 0), +(@PATH, 3, -4602.8, -903.233, 502.767, 0.0, 0), +(@PATH, 4, -4607.16, -897.28, 502.767, 0.0, 0), +(@PATH, 5, -4607.16, -897.28, 502.767, 5.35816, 90000), +(@PATH, 6, -4601.63, -904.615, 502.767, 0.0, 0), +(@PATH, 7, -4602.05, -906.355, 502.767, 0.0, 0), +(@PATH, 8, -4608.62, -913.508, 501.061, 0.0, 0), +(@PATH, 9, -4610.18, -921.852, 501.068, 0.0, 0), +(@PATH, 10, -4607.63, -926.901, 501.071, 0.0, 0), +(@PATH, 11, -4607.63, -926.901, 501.071, 2.33874, 180000), +(@PATH, 12, -4612.25, -909.152, 501.062, 0.0, 0); + + +/* Roetten Stonehammer - GUID 1888 */ + + +SET @NPC := 1888; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -4681.39, `position_y` = -1266.61, `position_z` = 503.382, `orientation` = 2.35619 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -4686.15, -1255.14, 501.993, 0.0, 0), +(@PATH, 2, -4675.92, -1244.38, 501.993, 0.0, 0), +(@PATH, 3, -4667.5, -1245.78, 501.993, 0.0, 0), +(@PATH, 4, -4661.6, -1250.52, 503.382, 0.0, 0), +(@PATH, 5, -4661.6, -1250.52, 503.382, 2.03745, 60000), +(@PATH, 6, -4670.11, -1243.08, 501.993, 0.0, 0), +(@PATH, 7, -4681.15, -1244.8, 501.993, 0.0, 0), +(@PATH, 8, -4686.53, -1252.01, 501.993, 0.0, 0), +(@PATH, 9, -4685.42, -1262.68, 501.993, 0.0, 0), +(@PATH, 10, -4681.39, -1266.61, 503.382, 0.0, 0), +(@PATH, 11, -4681.39, -1266.61, 503.382, 2.03745, 60000); + +/* Gnomeregan Evacuee - GUID 2442 */ + + +SET @NPC := 2442; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5165.01, 635.986, 348.279, 100.0, 2000), +(@PATH, 2, -5176.52, 637.508, 348.279, 100.0, 0), +(@PATH, 3, -5180.35, 647.348, 348.279, 100.0, 0), +(@PATH, 4, -5176.56, 656.204, 348.279, 100.0, 0), +(@PATH, 5, -5163.17, 665.239, 348.932, 100.0, 0), +(@PATH, 6, -5159.09, 708.355, 369.766, 100.0, 0), +(@PATH, 7, -5165.51, 714.313, 369.766, 100.0, 0), +(@PATH, 8, -5171.31, 714.859, 369.766, 100.0, 0), +(@PATH, 9, -5175.11, 706.777, 369.766, 100.0, 0), +(@PATH, 10, -5182.93, 606.75, 408.966, 100.0, 0), +(@PATH, 11, -5180.14, 597.714, 408.496, 100.0, 0), +(@PATH, 12, -5174.19, 584.702, 404.797, 100.0, 0), +(@PATH, 13, -5148.45, 587.567, 416.345, 100.0, 3000); + +/* Gibblewilt - GUID 2470 */ + + +SET @NPC := 2470; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5068.52, 456.024, 410.131, 4.30862, 0), +(@PATH, 2, -5074.61, 458.308, 410.396, 3.00879, 0), +(@PATH, 3, -5081.69, 458.405, 408.17, 3.72546, 0), +(@PATH, 4, -5085.15, 449.702, 409.889, 5.68699, 0), +(@PATH, 5, -5074.26, 442.373, 410.967, 5.68503, 10000), +(@PATH, 6, -5085.2, 449.851, 409.845, 5.70859, 0), +(@PATH, 7, -5096.99, 463.844, 404.063, 2.40599, 10000), +(@PATH, 8, -5087.35, 455.114, 407.616, 5.84407, 0), +(@PATH, 9, -5081.69, 458.405, 408.17, 0.100844, 0), +(@PATH, 10, -5074.22, 458.364, 410.452, 0.175457, 0); + +/* Great Father Arctikus - GUID 2938 */ + + +SET @NPC := 2938; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5592.92, 677.581, 384.033, 0.369836, 0), +(@PATH, 2, -5600.41, 673.451, 383.062, 4.13975, 0), +(@PATH, 3, -5603.79, 663.913, 383.343, 4.70523, 0), +(@PATH, 4, -5600.97, 653.118, 384.407, 5.49849, 0), +(@PATH, 5, -5593.76, 645.6, 384.251, 2.21748, 20000), +(@PATH, 6, -5601.55, 654.102, 384.304, 5.37085, 0), +(@PATH, 7, -5603.73, 663.851, 383.358, 1.27893, 0), +(@PATH, 8, -5600.35, 673.342, 383.068, 0.522985, 0), +(@PATH, 9, -5591.76, 678.133, 384.23, 0.37965, 0), +(@PATH, 10, -5583.21, 681.232, 384.784, 0.389467, 0), +(@PATH, 11, -5579.47, 688.612, 383.054, 1.14149, 20000), +(@PATH, 12, -5583.21, 681.232, 384.784, 3.71563, 0); + +/* Frostmane Headhunter - GUID 2942 */ + + +SET @NPC := 2942; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5577.25, `position_y` = 700.46, `position_z` = 381.931, `orientation` = 3.12328 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5577.25, 700.46, 381.931, 100.0, 0), +(@PATH, 2, -5585.01, 708.591, 381.949, 100.0, 0), +(@PATH, 3, -5592.0, 712.784, 381.934, 100.0, 0), +(@PATH, 4, -5602.55, 718.777, 382.803, 100.0, 0), +(@PATH, 5, -5594.0, 713.588, 382.19, 100.0, 0), +(@PATH, 6, -5587.96, 709.834, 382.064, 100.0, 0), +(@PATH, 7, -5583.34, 706.095, 381.943, 100.0, 0), +(@PATH, 8, -5577.5, 700.577, 381.933, 100.0, 0), +(@PATH, 9, -5576.83, 694.027, 382.176, 100.0, 0), +(@PATH, 10, -5579.36, 687.62, 383.216, 100.0, 0), +(@PATH, 11, -5584.23, 681.69, 384.767, 100.0, 0), +(@PATH, 12, -5587.87, 678.992, 384.853, 100.0, 0), +(@PATH, 13, -5590.26, 677.712, 384.489, 100.0, 0), +(@PATH, 14, -5596.81, 675.263, 383.396, 100.0, 0), +(@PATH, 15, -5602.21, 669.229, 383.059, 100.0, 0), +(@PATH, 16, -5603.85, 662.869, 383.443, 100.0, 0), +(@PATH, 17, -5601.49, 654.376, 384.313, 100.0, 0), +(@PATH, 18, -5597.38, 649.613, 384.351, 100.0, 0), +(@PATH, 19, -5594.43, 646.472, 384.272, 100.0, 0), +(@PATH, 20, -5601.32, 653.812, 384.335, 100.0, 0), +(@PATH, 21, -5603.84, 662.74, 383.459, 100.0, 0), +(@PATH, 22, -5601.41, 671.24, 383.043, 100.0, 0), +(@PATH, 23, -5596.83, 674.907, 383.396, 100.0, 0), +(@PATH, 24, -5589.57, 678.627, 384.581, 100.0, 0), +(@PATH, 25, -5582.65, 683.741, 384.33, 100.0, 0), +(@PATH, 26, -5578.19, 692.47, 382.37, 100.0, 0); + +/* Frostmane Snowstrider - GUID 2947 */ + + +SET @NPC := 2947; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5546.03, `position_y` = 738.82, `position_z` = 385.222, `orientation` = 2.41982 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5546.03, 738.82, 385.222, 100.0, 0), +(@PATH, 2, -5539.86, 732.785, 385.999, 100.0, 0), +(@PATH, 3, -5535.38, 729.201, 387.988, 100.0, 0), +(@PATH, 4, -5529.31, 718.23, 390.967, 100.0, 0), +(@PATH, 5, -5528.62, 708.422, 393.078, 100.0, 0), +(@PATH, 6, -5531.43, 700.178, 394.781, 100.0, 0), +(@PATH, 7, -5534.25, 691.043, 396.589, 100.0, 0), +(@PATH, 8, -5537.04, 683.256, 397.741, 100.0, 0), +(@PATH, 9, -5533.79, 692.606, 396.268, 100.0, 0), +(@PATH, 10, -5529.48, 704.271, 394.017, 100.0, 0), +(@PATH, 11, -5527.69, 713.291, 392.18, 100.0, 0), +(@PATH, 12, -5529.17, 721.177, 390.416, 100.0, 0), +(@PATH, 13, -5534.22, 728.566, 388.28, 100.0, 0), +(@PATH, 14, -5540.0, 733.101, 385.949, 100.0, 0), +(@PATH, 15, -5545.22, 737.797, 385.304, 100.0, 0), +(@PATH, 16, -5554.19, 749.018, 384.436, 100.0, 0), +(@PATH, 17, -5561.87, 756.116, 383.703, 100.0, 0), +(@PATH, 18, -5569.84, 758.797, 383.349, 100.0, 0), +(@PATH, 19, -5578.21, 759.201, 383.616, 100.0, 0), +(@PATH, 20, -5585.1, 759.055, 384.322, 100.0, 0), +(@PATH, 21, -5596.88, 756.296, 385.322, 100.0, 0), +(@PATH, 22, -5603.58, 754.268, 385.485, 100.0, 0), +(@PATH, 23, -5610.61, 752.14, 386.286, 100.0, 0), +(@PATH, 24, -5619.16, 751.23, 386.073, 100.0, 0), +(@PATH, 25, -5626.79, 754.23, 386.583, 100.0, 0), +(@PATH, 26, -5619.98, 750.392, 385.832, 100.0, 0), +(@PATH, 27, -5610.77, 752.059, 386.309, 100.0, 0), +(@PATH, 28, -5603.11, 754.536, 385.458, 100.0, 0), +(@PATH, 29, -5598.01, 756.078, 385.329, 100.0, 0), +(@PATH, 30, -5586.29, 758.664, 384.464, 100.0, 0), +(@PATH, 31, -5577.01, 758.995, 383.548, 100.0, 0), +(@PATH, 32, -5566.79, 756.941, 383.457, 100.0, 0), +(@PATH, 33, -5560.0, 754.467, 383.881, 100.0, 0), +(@PATH, 34, -5549.91, 744.429, 384.671, 100.0, 0); + +/* Wendigo - GUID 3122 */ + + +SET @NPC := 3122; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5432.3, `position_y` = -134.6, `position_z` = 350.456, `orientation` = 4.36332 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5432.3, -134.6, 350.456, 100.0, 0), +(@PATH, 2, -5433.38, -143.261, 351.339, 100.0, 0), +(@PATH, 3, -5434.1, -153.954, 351.684, 100.0, 0), +(@PATH, 4, -5433.57, -145.358, 351.426, 100.0, 0), +(@PATH, 5, -5432.38, -134.58, 350.455, 100.0, 0), +(@PATH, 6, -5430.27, -124.66, 348.582, 100.0, 0), +(@PATH, 7, -5426.28, -118.403, 347.057, 100.0, 0), +(@PATH, 8, -5419.41, -114.086, 345.655, 100.0, 0), +(@PATH, 9, -5425.61, -117.898, 346.897, 100.0, 0), +(@PATH, 10, -5429.94, -125.822, 348.842, 100.0, 0), +(@PATH, 11, -5431.77, -131.171, 349.875, 100.0, 0); + +/* Wendigo - GUID 3139 */ + + +SET @NPC := 3139; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5401.76, `position_y` = -128.122, `position_z` = 367.779, `orientation` = 5.28835 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5401.76, -128.122, 367.779, 100.0, 0), +(@PATH, 2, -5397.15, -133.077, 367.889, 100.0, 0), +(@PATH, 3, -5393.43, -140.068, 367.868, 100.0, 0), +(@PATH, 4, -5391.8, -147.003, 367.704, 100.0, 0), +(@PATH, 5, -5390.86, -154.645, 367.061, 100.0, 0), +(@PATH, 6, -5390.79, -160.58, 367.624, 100.0, 0), +(@PATH, 7, -5391.51, -166.008, 368.767, 100.0, 0), +(@PATH, 8, -5392.28, -170.969, 369.525, 100.0, 0), +(@PATH, 9, -5390.91, -164.225, 368.239, 100.0, 0), +(@PATH, 10, -5391.26, -155.732, 367.063, 100.0, 0), +(@PATH, 11, -5392.36, -146.113, 367.866, 100.0, 0), +(@PATH, 12, -5394.55, -139.363, 368.009, 100.0, 0), +(@PATH, 13, -5397.07, -133.981, 367.915, 100.0, 0); + +/* Timber - GUID 3154 */ + + +SET @NPC := 3154; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5248.09, 117.958, 394.268, 1.82279, 0), +(@PATH, 2, -5248.79, 110.069, 393.106, 4.69539, 0), +(@PATH, 3, -5248.93, 99.99, 391.792, 4.97813, 0), +(@PATH, 4, -5244.47, 89.3014, 389.637, 5.15485, 0), +(@PATH, 5, -5233.49, 79.7149, 386.934, 5.64376, 0), +(@PATH, 6, -5215.74, 81.2445, 386.134, 0.348212, 0), +(@PATH, 7, -5201.64, 91.0505, 386.112, 0.707531, 0), +(@PATH, 8, -5196.96, 105.918, 386.112, 3.05587, 0), +(@PATH, 9, -5204.8, 116.565, 387.546, 3.1619, 0), +(@PATH, 10, -5217.0, 120.209, 391.652, 3.12263, 0), +(@PATH, 11, -5232.49, 121.31, 394.311, 3.00678, 0), +(@PATH, 12, -5241.29, 126.827, 394.337, 3.2267, 0), +(@PATH, 13, -5247.15, 123.429, 394.261, 3.93356, 0); + +/* Frostmane Headhunter - GUID 3183 */ + + +SET @NPC := 3183; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5316.35, `position_y` = -214.36, `position_z` = 440.956, `orientation` = 0.401843 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5316.35, -214.36, 440.956, 100.0, 10000), +(@PATH, 2, -5317.84, -227.109, 441.159, 100.0, 0), +(@PATH, 3, -5316.58, -241.649, 440.671, 100.0, 0), +(@PATH, 4, -5313.8, -246.102, 441.356, 100.0, 0), +(@PATH, 5, -5305.87, -249.811, 445.312, 100.0, 10000), +(@PATH, 6, -5315.7, -246.452, 440.862, 100.0, 0), +(@PATH, 7, -5328.45, -244.869, 441.42, 100.0, 0), +(@PATH, 8, -5333.17, -249.242, 441.86, 100.0, 0), +(@PATH, 9, -5336.32, -257.158, 440.763, 100.0, 0), +(@PATH, 10, -5337.47, -261.884, 440.921, 100.0, 0), +(@PATH, 11, -5341.95, -273.199, 447.284, 100.0, 0), +(@PATH, 12, -5342.88, -276.696, 448.13, 100.0, 10000), +(@PATH, 13, -5347.71, -272.985, 447.438, 100.0, 0), +(@PATH, 14, -5358.61, -267.936, 442.177, 100.0, 0), +(@PATH, 15, -5368.57, -261.721, 440.882, 100.0, 0), +(@PATH, 16, -5377.26, -254.669, 447.094, 100.0, 0), +(@PATH, 17, -5380.6, -251.679, 447.381, 100.0, 10000), +(@PATH, 18, -5376.77, -244.195, 445.711, 100.0, 0), +(@PATH, 19, -5373.59, -238.356, 440.872, 100.0, 0), +(@PATH, 20, -5370.4, -233.202, 441.196, 100.0, 0), +(@PATH, 21, -5367.44, -227.769, 443.147, 100.0, 0), +(@PATH, 22, -5363.78, -223.348, 442.605, 100.0, 0), +(@PATH, 23, -5359.4, -218.502, 441.407, 100.0, 0), +(@PATH, 24, -5352.2, -210.538, 445.269, 100.0, 0), +(@PATH, 25, -5346.5, -210.742, 443.416, 100.0, 0), +(@PATH, 26, -5340.82, -213.811, 441.643, 100.0, 0), +(@PATH, 27, -5332.99, -215.503, 440.9, 100.0, 0), +(@PATH, 28, -5322.48, -217.418, 440.77, 100.0, 0); + +/* Wendigo - GUID 3186 */ + + +SET @NPC := 3186; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5396.72, `position_y` = -269.959, `position_z` = 362.808, `orientation` = 0.560124 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5396.72, -269.959, 362.808, 100.0, 0), +(@PATH, 2, -5406.76, -273.025, 362.254, 100.0, 0), +(@PATH, 3, -5416.35, -273.843, 360.902, 100.0, 0), +(@PATH, 4, -5423.34, -273.987, 359.737, 100.0, 0), +(@PATH, 5, -5431.49, -273.724, 358.434, 100.0, 0), +(@PATH, 6, -5438.46, -273.045, 357.218, 100.0, 0), +(@PATH, 7, -5447.92, -271.071, 355.96, 100.0, 0), +(@PATH, 8, -5437.42, -273.181, 357.356, 100.0, 0), +(@PATH, 9, -5431.84, -273.568, 358.359, 100.0, 0), +(@PATH, 10, -5421.35, -273.87, 360.146, 100.0, 0), +(@PATH, 11, -5414.24, -273.794, 361.216, 100.0, 0), +(@PATH, 12, -5406.41, -272.245, 362.341, 100.0, 0), +(@PATH, 13, -5397.06, -270.431, 362.773, 100.0, 0), +(@PATH, 14, -5391.94, -266.715, 363.014, 100.0, 0), +(@PATH, 15, -5380.48, -256.786, 362.554, 100.0, 0), +(@PATH, 16, -5388.0, -263.463, 362.999, 100.0, 0); + +/* Wendigo - GUID 3187 */ + + +SET @NPC := 3187; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5425.7, `position_y` = -223.195, `position_z` = 371.936, `orientation` = 1.8675 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5425.7, -223.195, 371.936, 100.0, 0), +(@PATH, 2, -5425.14, -215.183, 372.811, 100.0, 0), +(@PATH, 3, -5422.18, -207.492, 372.707, 100.0, 0), +(@PATH, 4, -5416.92, -197.329, 371.838, 100.0, 0), +(@PATH, 5, -5411.03, -190.942, 371.379, 100.0, 0), +(@PATH, 6, -5404.22, -186.135, 370.564, 100.0, 0), +(@PATH, 7, -5413.76, -193.226, 371.659, 100.0, 0), +(@PATH, 8, -5419.89, -202.552, 372.247, 100.0, 0), +(@PATH, 9, -5424.82, -211.675, 372.844, 100.0, 0), +(@PATH, 10, -5425.13, -216.157, 372.689, 100.0, 0); + +/* Wendigo - GUID 3240 */ + + +SET @NPC := 3240; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5464.76, `position_y` = -246.758, `position_z` = 354.253, `orientation` = 2.74017 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5464.76, -246.758, 354.253, 100.0, 0), +(@PATH, 2, -5470.49, -242.217, 354.253, 100.0, 0), +(@PATH, 3, -5478.29, -238.068, 354.423, 100.0, 0), +(@PATH, 4, -5484.74, -235.35, 354.509, 100.0, 0), +(@PATH, 5, -5494.42, -231.274, 354.042, 100.0, 0), +(@PATH, 6, -5504.1, -227.198, 353.52, 100.0, 0), +(@PATH, 7, -5510.55, -224.48, 353.356, 100.0, 0), +(@PATH, 8, -5515.95, -222.701, 353.458, 100.0, 0), +(@PATH, 9, -5525.14, -223.195, 354.589, 100.0, 0), +(@PATH, 10, -5514.05, -223.276, 353.323, 100.0, 0), +(@PATH, 11, -5509.24, -224.293, 353.298, 100.0, 0), +(@PATH, 12, -5502.79, -227.016, 353.688, 100.0, 0), +(@PATH, 13, -5492.97, -231.373, 354.199, 100.0, 0), +(@PATH, 14, -5485.22, -234.873, 354.495, 100.0, 0), +(@PATH, 15, -5479.93, -237.388, 354.446, 100.0, 0), +(@PATH, 16, -5473.17, -240.281, 354.309, 100.0, 0), +(@PATH, 17, -5466.21, -245.116, 354.254, 100.0, 0), +(@PATH, 18, -5461.61, -251.304, 354.254, 100.0, 0), +(@PATH, 19, -5455.2, -261.391, 354.198, 100.0, 0), +(@PATH, 20, -5459.61, -254.523, 354.281, 100.0, 0); + +/* Wendigo - GUID 3572 */ + + +SET @NPC := 3572; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5554.56, `position_y` = -235.988, `position_z` = 362.897, `orientation` = 0.511921 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5554.56, -235.988, 362.897, 100.0, 0), +(@PATH, 2, -5549.19, -231.872, 361.206, 100.0, 0), +(@PATH, 3, -5542.18, -227.456, 358.47, 100.0, 0), +(@PATH, 4, -5540.6, -226.723, 357.754, 100.0, 0), +(@PATH, 5, -5546.54, -230.191, 360.312, 100.0, 0), +(@PATH, 6, -5553.38, -235.414, 362.598, 100.0, 0), +(@PATH, 7, -5557.68, -239.184, 364.141, 100.0, 0), +(@PATH, 8, -5562.09, -245.774, 365.837, 100.0, 0), +(@PATH, 9, -5563.85, -249.584, 366.56, 100.0, 0), +(@PATH, 10, -5566.19, -256.791, 367.423, 100.0, 0), +(@PATH, 11, -5567.13, -259.798, 367.933, 100.0, 0), +(@PATH, 12, -5570.49, -267.524, 367.335, 100.0, 0), +(@PATH, 13, -5576.32, -277.889, 366.222, 100.0, 0), +(@PATH, 14, -5570.46, -267.145, 367.366, 100.0, 0), +(@PATH, 15, -5567.09, -260.1, 367.98, 100.0, 0), +(@PATH, 16, -5564.38, -250.211, 366.634, 100.0, 0), +(@PATH, 17, -5560.83, -243.65, 365.272, 100.0, 0), +(@PATH, 18, -5559.09, -240.479, 364.555, 100.0, 0); + +/* Fluffy - GUID 4151 */ + + +SET @NPC := 4151; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5549.0, -1295.66, 400.267, 1.96547, 0), +(@PATH, 2, -5555.14, -1286.75, 400.705, 2.50936, 0), +(@PATH, 3, -5563.65, -1281.34, 401.378, 4.89108, 0), +(@PATH, 4, -5571.76, -1283.92, 401.595, 4.92446, 0), +(@PATH, 5, -5574.1, -1292.32, 401.575, 5.63917, 0), +(@PATH, 6, -5550.61, -1316.42, 398.663, 5.5135, 0), +(@PATH, 7, -5539.53, -1319.2, 399.05, 0.388779, 0), +(@PATH, 8, -5527.46, -1315.68, 401.761, 0.37307, 0), +(@PATH, 9, -5510.42, -1310.07, 402.876, 6.27534, 0), +(@PATH, 10, -5496.35, -1307.78, 404.306, 5.15811, 0), +(@PATH, 11, -5485.81, -1317.02, 403.623, 4.65349, 0), +(@PATH, 12, -5482.9, -1328.74, 403.128, 1.90657, 0), +(@PATH, 13, -5497.13, -1351.01, 403.118, 4.14299, 0), +(@PATH, 14, -5506.29, -1361.86, 401.173, 0.79327, 0), +(@PATH, 15, -5512.5, -1380.78, 401.059, 4.32364, 0), +(@PATH, 16, -5523.74, -1388.3, 400.524, 0.430028, 0), +(@PATH, 17, -5532.06, -1391.59, 401.022, 5.71575, 0), +(@PATH, 18, -5536.64, -1400.22, 402.253, 0.392711, 0), +(@PATH, 19, -5534.24, -1407.77, 402.474, 0.645999, 0), +(@PATH, 20, -5526.26, -1409.96, 402.421, 1.3293, 0), +(@PATH, 21, -5516.35, -1405.69, 402.985, 3.07288, 0), +(@PATH, 22, -5512.02, -1380.34, 401.147, 1.27628, 0), +(@PATH, 23, -5505.66, -1361.61, 401.475, 1.08975, 0), +(@PATH, 24, -5496.98, -1350.89, 403.125, 0.861984, 0), +(@PATH, 25, -5483.01, -1328.78, 403.113, 1.27432, 0), +(@PATH, 26, -5485.76, -1316.7, 403.664, 2.0931, 0), +(@PATH, 27, -5496.2, -1307.95, 404.289, 2.74694, 0), +(@PATH, 28, -5510.93, -1310.19, 402.859, 3.38507, 0), +(@PATH, 29, -5527.54, -1315.5, 401.787, 3.47539, 0), +(@PATH, 30, -5537.08, -1315.39, 399.541, 3.32028, 0), +(@PATH, 31, -5543.39, -1309.22, 398.204, 1.88497, 0); + + +DELETE FROM `creature_formations` WHERE `memberGUID` IN (4151, 4153); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(4151, 4153, 4.80679, 183, 519, 0, 0), +(4151, 4151, 0, 0, 519, 0, 0); + +/* Rockjaw Skullthumper - GUID 4524 */ + + +SET @NPC := 4524; +SET @PATH := @NPC * 10; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5871.25, -1544.41, 372.448, 5.2547, 0), +(@PATH, 2, -5869.8, -1546.8, 372.373, 4.94055, 0), +(@PATH, 3, -5866.37, -1556.3, 366.145, 0.228153, 0), +(@PATH, 4, -5856.7, -1554.05, 358.833, 0.228153, 20000), +(@PATH, 5, -5866.48, -1556.24, 366.228, 1.85785, 0), +(@PATH, 6, -5869.95, -1546.57, 372.54, 1.94739, 0), +(@PATH, 7, -5872.4, -1542.05, 372.521, 2.02672, 0), +(@PATH, 8, -5874.47, -1532.95, 379.59, 1.76518, 0), +(@PATH, 9, -5871.17, -1523.61, 379.248, 4.41983, 30000), +(@PATH, 10, -5874.42, -1532.89, 379.63, 4.76776, 0), +(@PATH, 11, -5872.52, -1541.97, 372.526, 4.93505, 0); + +/* Rockjaw Bonesnapper - GUID 4542 */ + + +SET @NPC := 4542; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5627.38, `position_y` = -1692.46, `position_z` = 399.612, `orientation` = 3.53051 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5627.38, -1692.46, 399.612, 100.0, 0), +(@PATH, 2, -5638.73, -1696.96, 399.131, 100.0, 0), +(@PATH, 3, -5647.65, -1705.31, 399.371, 100.0, 0), +(@PATH, 4, -5657.91, -1717.19, 400.254, 100.0, 0), +(@PATH, 5, -5665.49, -1732.89, 399.89, 100.0, 0), +(@PATH, 6, -5669.03, -1748.15, 400.046, 100.0, 0), +(@PATH, 7, -5666.81, -1767.67, 400.051, 100.0, 0), +(@PATH, 8, -5659.9, -1784.91, 399.696, 100.0, 0), +(@PATH, 9, -5651.59, -1797.52, 400.324, 100.0, 0), +(@PATH, 10, -5639.94, -1807.93, 399.766, 100.0, 0), +(@PATH, 11, -5627.84, -1813.34, 400.785, 100.0, 0), +(@PATH, 12, -5613.26, -1816.92, 400.942, 100.0, 0), +(@PATH, 13, -5597.3, -1820.47, 399.603, 100.0, 0), +(@PATH, 14, -5583.48, -1822.52, 399.955, 100.0, 0), +(@PATH, 15, -5568.99, -1823.99, 400.865, 100.0, 0), +(@PATH, 16, -5556.21, -1825.28, 399.653, 100.0, 0), +(@PATH, 17, -5572.36, -1823.33, 400.954, 100.0, 0), +(@PATH, 18, -5590.66, -1821.89, 399.622, 100.0, 0), +(@PATH, 19, -5608.77, -1817.4, 400.73, 100.0, 0), +(@PATH, 20, -5624.46, -1812.85, 400.957, 100.0, 0), +(@PATH, 21, -5636.85, -1809.99, 399.598, 100.0, 0), +(@PATH, 22, -5646.51, -1801.62, 400.293, 100.0, 0), +(@PATH, 23, -5657.3, -1789.51, 399.926, 100.0, 0), +(@PATH, 24, -5661.29, -1773.99, 400.341, 100.0, 0), +(@PATH, 25, -5661.82, -1757.66, 399.919, 100.0, 0), +(@PATH, 26, -5660.06, -1746.28, 400.097, 100.0, 0), +(@PATH, 27, -5657.01, -1733.84, 399.839, 100.0, 0), +(@PATH, 28, -5653.79, -1722.66, 400.801, 100.0, 0), +(@PATH, 29, -5647.43, -1708.26, 399.427, 100.0, 0), +(@PATH, 30, -5638.97, -1697.98, 399.135, 100.0, 0); + +/* Rockjaw Bonesnapper - GUID 4545 */ + + +SET @NPC := 4545; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5596.2, `position_y` = -1683.52, `position_z` = 347.276, `orientation` = 6.25858 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5596.2, -1683.52, 347.276, 100.0, 0), +(@PATH, 2, -5600.28, -1681.07, 349.036, 100.0, 0), +(@PATH, 3, -5605.89, -1674.86, 350.655, 100.0, 0), +(@PATH, 4, -5611.91, -1679.3, 351.456, 100.0, 0), +(@PATH, 5, -5609.26, -1689.22, 353.038, 100.0, 0), +(@PATH, 6, -5605.37, -1700.32, 356.982, 100.0, 0), +(@PATH, 7, -5604.51, -1705.22, 358.703, 100.0, 0), +(@PATH, 8, -5609.27, -1706.74, 359.171, 100.0, 0), +(@PATH, 9, -5614.53, -1699.49, 360.345, 100.0, 0), +(@PATH, 10, -5618.3, -1691.87, 360.588, 100.0, 0), +(@PATH, 11, -5622.24, -1683.54, 362.224, 100.0, 0), +(@PATH, 12, -5624.64, -1673.57, 362.007, 100.0, 0), +(@PATH, 13, -5621.46, -1684.72, 362.087, 100.0, 0), +(@PATH, 14, -5618.48, -1691.23, 360.625, 100.0, 0), +(@PATH, 15, -5614.23, -1699.5, 360.307, 100.0, 0), +(@PATH, 16, -5609.8, -1705.37, 359.24, 100.0, 0), +(@PATH, 17, -5603.43, -1706.61, 359.209, 100.0, 0), +(@PATH, 18, -5605.95, -1698.77, 356.382, 100.0, 0), +(@PATH, 19, -5609.09, -1689.14, 353.042, 100.0, 0), +(@PATH, 20, -5610.99, -1683.02, 351.756, 100.0, 0), +(@PATH, 21, -5610.22, -1675.92, 350.97, 100.0, 0), +(@PATH, 22, -5606.03, -1675.62, 350.676, 100.0, 0), +(@PATH, 23, -5601.71, -1680.54, 349.575, 100.0, 0); + +/* Rockjaw Bonesnapper - GUID 4561 */ + + +SET @NPC := 4561; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5536.41, `position_y` = -1741.26, `position_z` = 339.58, `orientation` = 5.88313 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5536.41, -1741.26, 339.58, 100.0, 0), +(@PATH, 2, -5526.61, -1743.64, 337.832, 100.0, 0), +(@PATH, 3, -5537.32, -1740.91, 339.711, 100.0, 0), +(@PATH, 4, -5544.39, -1735.85, 340.927, 100.0, 0), +(@PATH, 5, -5549.2, -1731.98, 342.204, 100.0, 0), +(@PATH, 6, -5556.28, -1727.06, 342.399, 100.0, 0), +(@PATH, 7, -5559.88, -1724.29, 342.479, 100.0, 0), +(@PATH, 8, -5567.05, -1719.29, 342.412, 100.0, 0), +(@PATH, 9, -5578.9, -1711.0, 342.412, 100.0, 0), +(@PATH, 10, -5582.96, -1706.39, 343.26, 100.0, 0), +(@PATH, 11, -5587.52, -1700.34, 344.939, 100.0, 0), +(@PATH, 12, -5590.26, -1692.03, 345.397, 100.0, 0), +(@PATH, 13, -5587.14, -1699.73, 345.092, 100.0, 0), +(@PATH, 14, -5583.42, -1705.41, 343.509, 100.0, 0), +(@PATH, 15, -5578.63, -1710.94, 342.412, 100.0, 0), +(@PATH, 16, -5572.14, -1716.08, 342.412, 100.0, 0), +(@PATH, 17, -5565.77, -1720.81, 342.512, 100.0, 0), +(@PATH, 18, -5559.49, -1724.6, 342.479, 100.0, 0), +(@PATH, 19, -5548.53, -1732.52, 342.105, 100.0, 0), +(@PATH, 20, -5543.56, -1736.61, 340.74, 100.0, 0); + +/* Rockjaw Bonesnapper - GUID 4847 */ + + +SET @NPC := 4847; +SET @PATH := @NPC * 10; + +UPDATE `creature` SET `position_x` = -5569.31, `position_y` = -1765.96, `position_z` = 346.369, `orientation` = 3.44248 WHERE `guid` = @NPC; + +DELETE FROM `creature_addon` WHERE `guid` = @NPC; +INSERT INTO `creature_addon` (`guid`, `path_id`) VALUES (@NPC, @PATH); +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5569.31, -1765.96, 346.369, 100.0, 0), +(@PATH, 2, -5580.12, -1768.71, 348.96, 100.0, 0), +(@PATH, 3, -5591.17, -1770.6, 353.343, 100.0, 0), +(@PATH, 4, -5599.2, -1772.08, 356.385, 100.0, 0), +(@PATH, 5, -5587.93, -1770.32, 352.211, 100.0, 0), +(@PATH, 6, -5577.91, -1768.16, 348.083, 100.0, 0), +(@PATH, 7, -5569.47, -1765.65, 346.3, 100.0, 0), +(@PATH, 8, -5560.44, -1760.17, 342.953, 100.0, 0), +(@PATH, 9, -5552.35, -1754.22, 341.378, 100.0, 0), +(@PATH, 10, -5546.19, -1749.04, 340.797, 100.0, 0), +(@PATH, 11, -5540.59, -1742.04, 340.224, 100.0, 0), +(@PATH, 12, -5537.63, -1735.2, 340.318, 100.0, 0), +(@PATH, 13, -5534.81, -1727.29, 340.757, 100.0, 0), +(@PATH, 14, -5531.64, -1717.72, 341.291, 100.0, 0), +(@PATH, 15, -5533.11, -1710.31, 342.644, 100.0, 0), +(@PATH, 16, -5531.35, -1717.38, 341.3, 100.0, 0), +(@PATH, 17, -5533.43, -1726.32, 340.61, 100.0, 0), +(@PATH, 18, -5537.4, -1733.16, 340.365, 100.0, 0), +(@PATH, 19, -5543.9, -1742.4, 340.672, 100.0, 0), +(@PATH, 20, -5548.14, -1748.26, 340.921, 100.0, 0), +(@PATH, 21, -5551.7, -1752.42, 341.271, 100.0, 0), +(@PATH, 22, -5560.48, -1761.27, 343.182, 100.0, 0), +(@PATH, 23, -5563.01, -1763.52, 344.266, 100.0, 0); + +/* Dun Morogh Mountaineer - GUID 6367 */ + + +SET @NPC := 6367; +SET @PATH := @NPC * 10; + +UPDATE `creature_addon` set `path_id` = @PATH WHERE `guid` = @NPC; +UPDATE `creature` SET `MovementType` = 2 WHERE `guid` = @NPC; + +DELETE FROM `waypoint_data` where `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, -5001.43, -2312.58, 405.708, 0.015327, 0), +(@PATH, 2, -4994.43, -2312.47, 406.455, 0.015327, 0), +(@PATH, 3, -4987.0, -2311.8, 407.207, 6.25846, 0), +(@PATH, 4, -4978.09, -2312.61, 408.019, 6.10059, 0), +(@PATH, 5, -4966.22, -2315.96, 408.735, 5.94273, 0), +(@PATH, 6, -4958.98, -2320.9, 408.616, 5.54689, 0), +(@PATH, 7, -4951.2, -2327.95, 408.28, 5.54689, 0), +(@PATH, 8, -4943.42, -2335.0, 408.244, 5.54689, 0), +(@PATH, 9, -4937.18, -2339.43, 408.51, 5.78486, 0), +(@PATH, 10, -4928.8, -2343.15, 408.622, 5.98043, 0), +(@PATH, 11, -4921.01, -2345.13, 408.622, 6.09824, 0), +(@PATH, 12, -4910.69, -2347.06, 408.622, 6.09824, 0), +(@PATH, 13, -4903.19, -2349.92, 408.622, 5.70475, 0), +(@PATH, 14, -4911.04, -2346.58, 408.622, 2.84983, 0), +(@PATH, 15, -4917.76, -2345.17, 408.622, 3.00769, 0), +(@PATH, 16, -4928.5, -2343.13, 408.622, 2.84983, 0), +(@PATH, 17, -4934.95, -2340.75, 408.576, 2.73202, 0), +(@PATH, 18, -4944.53, -2335.04, 408.248, 2.53645, 0), +(@PATH, 19, -4951.1, -2328.78, 408.236, 2.34089, 0), +(@PATH, 20, -4957.91, -2322.43, 408.503, 2.4587, 0), +(@PATH, 21, -4963.34, -2318.01, 408.755, 2.4587, 0), +(@PATH, 22, -4972.36, -2313.44, 408.536, 2.85218, 0), +(@PATH, 23, -4979.42, -2311.96, 407.865, 3.01005, 0), +(@PATH, 24, -4992.02, -2312.32, 406.72, 3.28572, 0), +(@PATH, 25, -5002.32, -2313.53, 405.659, 3.20797, 0), +(@PATH, 26, -5013.18, -2312.1, 403.958, 2.81448, 0), +(@PATH, 27, -5019.8, -2308.56, 402.841, 2.50111, 0), +(@PATH, 28, -5027.78, -2300.47, 402.106, 2.26549, 0), +(@PATH, 29, -5034.5, -2292.4, 401.445, 2.26549, 0), +(@PATH, 30, -5039.68, -2287.59, 400.961, 2.50111, 0), +(@PATH, 31, -5048.81, -2282.12, 400.678, 2.77678, 0), +(@PATH, 32, -5059.3, -2278.6, 400.615, 3.05246, 0), +(@PATH, 33, -5072.53, -2278.86, 400.209, 3.25038, 0), +(@PATH, 34, -5080.73, -2280.5, 400.045, 3.4483, 0), +(@PATH, 35, -5089.7, -2283.8, 400.084, 3.56611, 0), +(@PATH, 36, -5099.56, -2289.5, 400.108, 3.72397, 0), +(@PATH, 37, -5108.33, -2295.28, 399.991, 3.72397, 0), +(@PATH, 38, -5119.27, -2305.02, 399.972, 3.9219, 0), +(@PATH, 39, -5125.72, -2309.44, 400.112, 3.56847, 0), +(@PATH, 40, -5137.37, -2312.98, 400.492, 3.34698, 0), +(@PATH, 41, -5146.26, -2314.14, 400.426, 3.19147, 0), +(@PATH, 42, -5156.74, -2314.67, 400.248, 3.19147, 0), +(@PATH, 43, -5168.25, -2314.5, 399.933, 2.99591, 0), +(@PATH, 44, -5178.92, -2311.86, 399.793, 2.72024, 0), +(@PATH, 45, -5184.51, -2307.65, 400.036, 2.32911, 0), +(@PATH, 46, -5187.81, -2301.88, 400.243, 1.93562, 0), +(@PATH, 47, -5191.47, -2294.36, 400.4, 2.13119, 0), +(@PATH, 48, -5198.22, -2287.34, 400.809, 2.40686, 0), +(@PATH, 49, -5192.27, -2293.99, 400.429, 5.20995, 0), +(@PATH, 50, -5187.26, -2303.21, 400.204, 5.20995, 0), +(@PATH, 51, -5182.48, -2309.11, 399.947, 5.56102, 0), +(@PATH, 52, -5176.64, -2312.85, 399.767, 5.83434, 0), +(@PATH, 53, -5168.76, -2314.9, 399.93, 6.22783, 0), +(@PATH, 54, -5153.5, -2314.91, 400.295, 0.06245, 0), +(@PATH, 55, -5140.6, -2313.82, 400.486, 0.102505, 0), +(@PATH, 56, -5134.87, -2312.79, 400.437, 0.220315, 0), +(@PATH, 57, -5127.18, -2310.48, 400.163, 0.375824, 0), +(@PATH, 58, -5120.43, -2306.3, 399.967, 0.731609, 0), +(@PATH, 59, -5112.62, -2299.29, 400.099, 0.731609, 0), +(@PATH, 60, -5105.76, -2293.91, 399.938, 0.576101, 0), +(@PATH, 61, -5099.89, -2290.1, 400.098, 0.576101, 0), +(@PATH, 62, -5091.38, -2284.57, 400.086, 0.576101, 0), +(@PATH, 63, -5080.73, -2279.57, 400.027, 0.222671, 0), +(@PATH, 64, -5068.14, -2278.18, 400.317, 0.027107, 0), +(@PATH, 65, -5052.9, -2279.86, 400.657, 6.11473, 0), +(@PATH, 66, -5046.31, -2282.43, 400.701, 5.69532, 0), +(@PATH, 67, -5036.54, -2289.96, 401.198, 5.57752, 0), +(@PATH, 68, -5029.26, -2297.66, 402.041, 5.41965, 0), +(@PATH, 69, -5025.51, -2302.71, 402.198, 5.30184, 0), +(@PATH, 70, -5020.02, -2309.3, 402.874, 5.53746, 0), +(@PATH, 71, -5012.95, -2312.65, 404.048, 6.12651, 0); From cadd9d1e653d8bf9488ecf19b867633b41af9780 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 8 Jun 2022 02:43:04 +0000 Subject: [PATCH 031/104] chore(DB): import pending files Referenced commit(s): 9a475ed47d0334a22c8c05660b81778d304a91ee --- .../rev_1654010021003239500.sql => db_world/2022_06_08_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654010021003239500.sql => db_world/2022_06_08_00.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1654010021003239500.sql b/data/sql/updates/db_world/2022_06_08_00.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1654010021003239500.sql rename to data/sql/updates/db_world/2022_06_08_00.sql index 51633cad8..e83d566ab 100644 --- a/data/sql/updates/pending_db_world/rev_1654010021003239500.sql +++ b/data/sql/updates/db_world/2022_06_08_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_06_05 -> 2022_06_08_00 -- /* Frostmane Troll Whelp - GUID 1311 */ From bab2c6291bf48109206630a7f1469de4f107347c Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Wed, 8 Jun 2022 04:43:36 +0200 Subject: [PATCH 032/104] =?UTF-8?q?fix(Core/Spell):=20Fixed=20Divine=20Shi?= =?UTF-8?q?eld=20not=20granting=20immunity=20to=20spell=20s=E2=80=A6=20(#1?= =?UTF-8?q?1954)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...chools. --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1b0ec51ab..7f55ca149 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12404,7 +12404,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) { SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->spellId); if (((itr->type & spellInfo->GetSchoolMask()) == spellInfo->GetSchoolMask()) - && !(immuneSpellInfo && immuneSpellInfo->IsPositive()) && !spellInfo->IsPositive() + && (!immuneSpellInfo || immuneSpellInfo->IsPositive()) && !spellInfo->IsPositive() && !spellInfo->CanPierceImmuneAura(immuneSpellInfo)) return true; } From 97e045beb21fdecaf3593233f2e13d0774b7e651 Mon Sep 17 00:00:00 2001 From: temperrr Date: Wed, 8 Jun 2022 04:49:09 +0200 Subject: [PATCH 033/104] Fix(DB/Loot): Evergreen Herb Casing should not drop random herbs (#11952) --- data/sql/updates/pending_db_world/morrowgrainherbs.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/morrowgrainherbs.sql diff --git a/data/sql/updates/pending_db_world/morrowgrainherbs.sql b/data/sql/updates/pending_db_world/morrowgrainherbs.sql new file mode 100644 index 000000000..3ee9f4f19 --- /dev/null +++ b/data/sql/updates/pending_db_world/morrowgrainherbs.sql @@ -0,0 +1,3 @@ +DELETE FROM `item_loot_template` WHERE (`Entry` = 11024) AND (`Item` IN (785, 2449, 2450, 3356, 3357, 3820, 3821, 4625, 8838, 8839, 8846, 49209)); +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(11024, 49209, 0, 63, 0, 1, 1, 1, 3, 'Evergreen Herb Casing - Mutated Morrowgrain'); From a434ba804ac4599300384ebd8559ca4414fedd25 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 8 Jun 2022 02:51:12 +0000 Subject: [PATCH 034/104] chore(DB): import pending files Referenced commit(s): 97e045beb21fdecaf3593233f2e13d0774b7e651 --- .../morrowgrainherbs.sql => db_world/2022_06_08_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/morrowgrainherbs.sql => db_world/2022_06_08_01.sql} (89%) diff --git a/data/sql/updates/pending_db_world/morrowgrainherbs.sql b/data/sql/updates/db_world/2022_06_08_01.sql similarity index 89% rename from data/sql/updates/pending_db_world/morrowgrainherbs.sql rename to data/sql/updates/db_world/2022_06_08_01.sql index 3ee9f4f19..e5b27668c 100644 --- a/data/sql/updates/pending_db_world/morrowgrainherbs.sql +++ b/data/sql/updates/db_world/2022_06_08_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_08_00 -> 2022_06_08_01 DELETE FROM `item_loot_template` WHERE (`Entry` = 11024) AND (`Item` IN (785, 2449, 2450, 3356, 3357, 3820, 3821, 4625, 8838, 8839, 8846, 49209)); INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES (11024, 49209, 0, 63, 0, 1, 1, 1, 3, 'Evergreen Herb Casing - Mutated Morrowgrain'); From b843a5626af62c070a3b7ea75143f62bc764495f Mon Sep 17 00:00:00 2001 From: temperrr Date: Wed, 8 Jun 2022 13:05:31 +0200 Subject: [PATCH 035/104] fix(Conf): Modules should compile (#11983) --- conf/dist/config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/dist/config.sh b/conf/dist/config.sh index 2b82e919e..d04f474c9 100644 --- a/conf/dist/config.sh +++ b/conf/dist/config.sh @@ -70,8 +70,8 @@ CTYPE=${CTYPE:-Release} # compile scripts CSCRIPTS=${CSCRIPTS:-static} -# compile scripts -CMODULES=${CMODULES:-none} +# compile modules +CMODULES=${CMODULES:-static} # compile unit tests CBUILD_TESTING=OFF From 9aa3fef4a889ad8aff38a330a127a389f4972d6c Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:32:57 +0300 Subject: [PATCH 036/104] fix(Script/Quest): Mystery of the Infinite minor adjustments & zone_dragonblight move to db from hardcode (#11810) * Update zone_dragonblight.cpp * add IsFlying check to Future/past NPC & better randomizer * ocd ( align =) * Add Nozdormu "phasing" * cs --- .../rev_1652973605826504900.sql | 3 + .../scripts/Northrend/zone_dragonblight.cpp | 153 ++++++++++-------- 2 files changed, 92 insertions(+), 64 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1652973605826504900.sql diff --git a/data/sql/updates/pending_db_world/rev_1652973605826504900.sql b/data/sql/updates/pending_db_world/rev_1652973605826504900.sql new file mode 100644 index 000000000..17a28b859 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1652973605826504900.sql @@ -0,0 +1,3 @@ +-- (Quest)Mystery of the Infinite NPC: "Future You", remove SAI (unused) +UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 27899; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 27899 AND `source_type` = 0; diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 63692bec2..4aed88845 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -294,28 +294,52 @@ public: enum hourglass { - NPC_FUTURE_HOURGLASS = 27840, - NPC_FUTURE_YOU = 27899, + NPC_FUTURE_HOURGLASS = 27840, + NPC_FUTURE_YOU = 27899, - NPC_PAST_HOURGLASS = 32327, - NPC_PAST_YOU = 32331, + NPC_PAST_HOURGLASS = 32327, + NPC_PAST_YOU = 32331, - NPC_INFINITE_ASSAILANT = 27896, - NPC_INFINITE_CHRONO_MAGUS = 27898, - NPC_INFINITE_DESTROYER = 27897, - NPC_INFINITE_TIMERENDER = 27900, + NPC_INFINITE_ASSAILANT = 27896, + NPC_INFINITE_CHRONO_MAGUS = 27898, + NPC_INFINITE_DESTROYER = 27897, + NPC_INFINITE_TIMERENDER = 27900, + NPC_NOZDORMU = 27925, - SPELL_CLONE_CASTER = 49889, - SPELL_TELEPORT_EFFECT = 52096, + SPELL_NOZDORMU_INVIS = 50013, + SPELL_CLONE_CASTER = 49889, + SPELL_TELEPORT_EFFECT = 52096, - EVENT_START_EVENT = 1, - EVENT_FIGHT_1 = 2, - EVENT_FIGHT_2 = 3, - EVENT_CHECK_FINISH = 4, - EVENT_FINISH_EVENT = 5, + EVENT_START_EVENT = 1, + EVENT_FIGHT_1 = 2, + EVENT_FIGHT_2 = 3, + EVENT_CHECK_FINISH = 4, + EVENT_FINISH_EVENT = 5, - QUEST_MYSTERY_OF_THE_INFINITE = 12470, - QUEST_MYSTERY_OF_THE_INFINITE_REDUX = 13343, + QUEST_MYSTERY_OF_THE_INFINITE = 12470, + QUEST_MYSTERY_OF_THE_INFINITE_REDUX = 13343, +}; + +enum hourglassText +{ + // (All are whispers) Both NPC_PAST_YOU and NPC_FUTURE_YOU share the same creature_text GroupIDs + // Start + SAY_HOURGLASS_START_1 = 1, + SAY_HOURGLASS_START_2 = 2, + + // Random whispers during the fight + SAY_HOURGLASS_RANDOM_1 = 3, + SAY_HOURGLASS_RANDOM_2 = 4, + SAY_HOURGLASS_RANDOM_3 = 5, + SAY_HOURGLASS_RANDOM_4 = 6, + SAY_HOURGLASS_RANDOM_5 = 7, + SAY_HOURGLASS_RANDOM_6 = 8, + SAY_HOURGLASS_RANDOM_7 = 9, + SAY_HOURGLASS_RANDOM_8 = 10, + + // End + SAY_HOURGLASS_END_1 = 11, + SAY_HOURGLASS_END_2 = 12, }; class npc_hourglass_of_eternity : public CreatureScript @@ -332,24 +356,26 @@ public: { npc_hourglass_of_eternityAI(Creature* c) : ScriptedAI(c) {} - ObjectGuid summonerGUID; - ObjectGuid futureGUID; + ObjectGuid pGUID; + ObjectGuid copyGUID; EventMap events; uint8 count[3]; uint8 phase; + uint8 randomTalk; + uint8 lastRandomTalk; - bool IsFuture() { return me->GetEntry() == NPC_FUTURE_HOURGLASS; } + bool IsFuture() {return me->GetEntry() == NPC_FUTURE_HOURGLASS;} void InitializeAI() override { if (me->ToTempSummon()) if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit()) { - summonerGUID = summoner->GetGUID(); + pGUID = summoner->GetGUID(); float x, y, z; me->GetNearPoint(summoner, x, y, z, me->GetCombatReach(), 0.0f, rand_norm() * 2 * M_PI); if (Creature* cr = summoner->SummonCreature((IsFuture() ? NPC_FUTURE_YOU : NPC_PAST_YOU), x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 210000)) { - futureGUID = cr->GetGUID(); + copyGUID = cr->GetGUID(); summoner->CastSpell(cr, SPELL_CLONE_CASTER, true); cr->SetFaction(summoner->GetFaction()); cr->SetReactState(REACT_AGGRESSIVE); @@ -365,27 +391,39 @@ public: events.ScheduleEvent(EVENT_START_EVENT, 4000); } - Player* getSummoner() { return ObjectAccessor::GetPlayer(*me, summonerGUID); } - Creature* getFuture() { return ObjectAccessor::GetCreature(*me, futureGUID); } + Player* GetPlayer() {return ObjectAccessor::GetPlayer(*me, pGUID);} + Creature* GetCopy() {return ObjectAccessor::GetCreature(*me, copyGUID);} uint32 randEntry() { return NPC_INFINITE_ASSAILANT + urand(0, 2); } + void ShowNozdormu() + { + if (Creature* cr = me->FindNearestCreature(NPC_NOZDORMU, 100.0f, true)) + cr->RemoveAura(SPELL_NOZDORMU_INVIS); + } + + void HideNozdormu() + { + if (Creature* cr = me->FindNearestCreature(NPC_NOZDORMU, 100.0f, true)) + cr->AddAura(SPELL_NOZDORMU_INVIS, cr); + } + void UpdateAI(uint32 diff) override { events.Update(diff); switch (events.ExecuteEvent()) { case EVENT_START_EVENT: - if (Creature* cr = getFuture()) - cr->Whisper(IsFuture() ? "Hey there, $N, don't be alarmed. It's me... you... from the future. I'm here to help." : "Whoa! You're me, but from the future! Hey, my equipment got an upgrade! Cool!", LANG_UNIVERSAL, getSummoner()); + if (Creature* cr = GetCopy()) + cr->AI()->Talk(SAY_HOURGLASS_START_1, GetPlayer()); events.ScheduleEvent(EVENT_FIGHT_1, 7000); break; case EVENT_FIGHT_1: - if (Creature* cr = getFuture()) - cr->Whisper(IsFuture() ? "Heads up... here they come. I'll help as much as I can. Let's just keep them off the hourglass!" : "Here come the Infinites! I've got to keep the hourglass safe. Can you help?", LANG_UNIVERSAL, getSummoner()); + if (Creature* cr = GetCopy()) + cr->AI()->Talk(SAY_HOURGLASS_START_2, GetPlayer()); events.ScheduleEvent(EVENT_FIGHT_2, 6000); break; case EVENT_FIGHT_2: @@ -433,57 +471,44 @@ public: return; } - if (Player* player = getSummoner()) + ShowNozdormu(); + if (Player* player = GetPlayer()) player->GroupEventHappens(IsFuture() ? QUEST_MYSTERY_OF_THE_INFINITE : QUEST_MYSTERY_OF_THE_INFINITE_REDUX, me); - me->Whisper(IsFuture() ? "Look, $N, the hourglass has revealed Nozdormu!" : "What the heck? Nozdormu is up there!", LANG_UNIVERSAL, getSummoner()); + if (Creature* cr = GetCopy()) + { + cr->SetFacingToObject(me->FindNearestCreature(NPC_NOZDORMU, 100.0f, true)); + cr->AI()->Talk(SAY_HOURGLASS_END_1, GetPlayer()); + } events.ScheduleEvent(EVENT_FINISH_EVENT, 6000); break; } case EVENT_FINISH_EVENT: { - me->Whisper(IsFuture() ? "Farewell, $N. Keep us alive and get some better equipment!" : "I feel like I'm being pulled away through time. Thanks for the help....", LANG_UNIVERSAL, getSummoner()); + HideNozdormu(); + if (Creature* cr = GetCopy()) + cr->AI()->Talk(SAY_HOURGLASS_END_2, GetPlayer()); me->DespawnOrUnsummon(500); - if (getFuture()) - getFuture()->DespawnOrUnsummon(500); + if (GetCopy()) + GetCopy()->DespawnOrUnsummon(500); break; } } } - void randomWhisper() + void randomWhisper() // Do not repeat the same line { - std::string text = ""; - switch(urand(0, IsFuture() ? 7 : 5)) + randomTalk = urand(SAY_HOURGLASS_RANDOM_1, SAY_HOURGLASS_RANDOM_8); // 3 to 10 + if (randomTalk == lastRandomTalk) { - case 0: - text = IsFuture() ? "What? Am I here alone. We both have a stake at this, you know!" : "This equipment looks cool and all, but couldn't we have done a little better? Are you even raiding?"; - break; - case 1: - text = IsFuture() ? "No matter what, you can't die, because would mean that I would cease to exist, right? But, I was here before when I was you. I'm so confused!" : "Chromie said that if I don't do this just right, I might wink out of existence. If I go, then you go!"; - break; - case 2: - text = IsFuture() ? "Sorry, but Chromie said that I couldn't reveal anything about your future to you. She said that if I did, I would cease to exist." : "I just want you to know that if we get through this alive, I'm making sure that we turn out better than you. No offense."; - break; - case 3: - text = IsFuture() ? "Look at you fight; no wonder I turned to drinking." : "Looks like I'm an underachiever."; - break; - case 4: - text = IsFuture() ? "Wow, I'd forgotten how inexperienced I used to be." : "Wait a minute! If you're here, then that means that in the not-so-distant future I'm going to be you helping me? Are we stuck in a time loop?!"; - break; - case 5: - text = IsFuture() ? "I can't believe that I used to wear that." : "I think I'm going to turn to drinking after this."; - break; - case 6: - text = "Listen. I'm not supposed to tell you this, but there's going to be this party that you're invited to. Whatever you do, DO NOT DRINK THE PUNCH!"; - break; - case 7: - text = "Wish I could remember how many of the Infinite Dragonflight were going to try to stop you. This fight was so long ago."; - break; + randomWhisper(); + } + else + { + if (Creature* cr = GetCopy()) + cr->AI()->Talk(randomTalk, GetPlayer()); + lastRandomTalk = randomTalk; } - - if (Creature* cr = getFuture()) - cr->Whisper(text, LANG_UNIVERSAL, getSummoner()); } }; }; @@ -516,7 +541,7 @@ public: void MoveInLineOfSight(Unit* who) override { - if (!me->GetVictim() && who->GetEntry() >= NPC_INFINITE_ASSAILANT && who->GetEntry() <= NPC_INFINITE_TIMERENDER) + if (!me->GetVictim() && !who->IsFlying() && who->GetEntry() >= NPC_INFINITE_ASSAILANT && who->GetEntry() <= NPC_INFINITE_TIMERENDER) AttackStart(who); } From c0ab2ab08e001ffce3c688eaf54301608af109a8 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 8 Jun 2022 11:35:10 +0000 Subject: [PATCH 037/104] chore(DB): import pending files Referenced commit(s): 9aa3fef4a889ad8aff38a330a127a389f4972d6c --- .../rev_1652973605826504900.sql => db_world/2022_06_08_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1652973605826504900.sql => db_world/2022_06_08_02.sql} (83%) diff --git a/data/sql/updates/pending_db_world/rev_1652973605826504900.sql b/data/sql/updates/db_world/2022_06_08_02.sql similarity index 83% rename from data/sql/updates/pending_db_world/rev_1652973605826504900.sql rename to data/sql/updates/db_world/2022_06_08_02.sql index 17a28b859..c251eeb06 100644 --- a/data/sql/updates/pending_db_world/rev_1652973605826504900.sql +++ b/data/sql/updates/db_world/2022_06_08_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_08_01 -> 2022_06_08_02 -- (Quest)Mystery of the Infinite NPC: "Future You", remove SAI (unused) UPDATE `creature_template` SET `AIName` = '' WHERE `entry` = 27899; DELETE FROM `smart_scripts` WHERE `entryorguid` = 27899 AND `source_type` = 0; From 94528cd44df22ff1471cbe85074e180c61579647 Mon Sep 17 00:00:00 2001 From: Kargatum Date: Thu, 9 Jun 2022 18:23:38 +0700 Subject: [PATCH 038/104] feat(Tools/DbImport): implement separated app for importing DB (#11614) --- .github/workflows/build_dbimport.yml | 48 ++++ .github/workflows/core_matrix_build.yml | 2 + .github/workflows/core_modules_build.yml | 2 + .github/workflows/tools_build.yml | 46 ++++ .github/workflows/windows_build.yml | 4 +- apps/ci/ci-conf-core.sh | 3 +- apps/ci/ci-conf-db.sh | 39 ++++ apps/ci/ci-conf-tools.sh | 1 - conf/dist/config.cmake | 3 +- deps/CMakeLists.txt | 3 +- modules/CMakeLists.txt | 4 +- src/cmake/macros/ConfigureTools.cmake | 6 +- src/server/CMakeLists.txt | 3 +- src/server/apps/CMakeLists.txt | 5 - src/tools/CMakeLists.txt | 35 +-- src/tools/dbimport/Main.cpp | 151 ++++++++++++ src/tools/dbimport/dbimport.conf.dist | 286 +++++++++++++++++++++++ 17 files changed, 606 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/build_dbimport.yml create mode 100644 .github/workflows/tools_build.yml create mode 100644 apps/ci/ci-conf-db.sh create mode 100644 src/tools/dbimport/Main.cpp create mode 100644 src/tools/dbimport/dbimport.conf.dist diff --git a/.github/workflows/build_dbimport.yml b/.github/workflows/build_dbimport.yml new file mode 100644 index 000000000..c4016339e --- /dev/null +++ b/.github/workflows/build_dbimport.yml @@ -0,0 +1,48 @@ +name: build-db +on: + push: + branches: + - 'master' # only default branch + pull_request: + +concurrency: + group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + # the result of the matrix will be the combination of all attributes, so we get os*compiler*modules builds + os: [ubuntu-latest] + compiler: [clang12] + runs-on: ${{ matrix.os }} + name: ${{ matrix.compiler }} + env: + COMPILER: ${{ matrix.compiler }} + steps: + - uses: actions/checkout@v2 + - name: Cache + uses: actions/cache@v3 + env: + cache-name: cache-db + with: + path: var/ccache + key: ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.ref }}- + ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}- + ${{ env.cache-name }}-${{ matrix.os }}- + - name: Configure OS + run: source ./acore.sh install-deps + env: + CONTINUOUS_INTEGRATION: true + - name: Create conf/config.sh + run: source ./apps/ci/ci-conf-db.sh + - name: Build + run: source ./apps/ci/ci-compile.sh + - name: Process pending sql + run: bash bin/acore-db-pendings + - name: Dry run + run: source ./apps/ci/ci-dry-run.sh dbimport diff --git a/.github/workflows/core_matrix_build.yml b/.github/workflows/core_matrix_build.yml index 5f7f9658f..95732a403 100644 --- a/.github/workflows/core_matrix_build.yml +++ b/.github/workflows/core_matrix_build.yml @@ -50,6 +50,8 @@ jobs: CONTINUOUS_INTEGRATION: true - name: Create conf/config.sh run: source ./apps/ci/ci-conf-core.sh + - name: Process pending sql + run: bash bin/acore-db-pendings - name: Build run: source ./apps/ci/ci-compile.sh - name: Dry run diff --git a/.github/workflows/core_modules_build.yml b/.github/workflows/core_modules_build.yml index 4b932b04f..6db57dcfc 100644 --- a/.github/workflows/core_modules_build.yml +++ b/.github/workflows/core_modules_build.yml @@ -43,6 +43,8 @@ jobs: CONTINUOUS_INTEGRATION: true - name: Create conf/config.sh run: source ./apps/ci/ci-conf-core.sh + - name: Process pending sql + run: bash bin/acore-db-pendings - name: Build run: source ./apps/ci/ci-compile.sh - name: Dry run diff --git a/.github/workflows/tools_build.yml b/.github/workflows/tools_build.yml new file mode 100644 index 000000000..73aecd18b --- /dev/null +++ b/.github/workflows/tools_build.yml @@ -0,0 +1,46 @@ +name: tools +on: + push: + branches: + - 'master' + pull_request: + +concurrency: + group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + # the result of the matrix will be the combination of all attributes, so we get os*compiler builds + os: [ubuntu-20.04] + compiler: [clang] + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }}-${{ matrix.compiler }} + env: + COMPILER: ${{ matrix.compiler }} + if: github.repository == 'azerothcore/azerothcore-wotlk' + steps: + - uses: actions/checkout@v2 + - name: Cache + uses: actions/cache@v3 + env: + cache-name: cache-tools + with: + path: var/ccache + key: ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}-${{ github.ref }}- + ${{ env.cache-name }}-${{ matrix.os }}-${{ matrix.compiler }}- + ${{ env.cache-name }}-${{ matrix.os }}- + - name: Configure OS + run: source ./acore.sh install-deps + env: + CONTINUOUS_INTEGRATION: true + - name: Create conf/config.sh + run: source ./apps/ci/ci-conf-tools.sh + - name: Build + run: source ./apps/ci/ci-compile.sh + diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 44fb89930..43792b754 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -17,7 +17,7 @@ jobs: matrix: os: [windows-latest] runs-on: ${{ matrix.os }} - name: ${{ matrix.os }}-${{ matrix.compiler }} + name: ${{ matrix.os }} env: BOOST_ROOT: C:\local\boost_1_79_0 if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build') @@ -29,7 +29,7 @@ jobs: shell: bash run: | mkdir -p build && cd build - cmake .. -DTOOLS=ON + cmake .. -DTOOLS_BUILD=all cmake --build . --config Release --parallel 4 - name: Copy dll files shell: bash diff --git a/apps/ci/ci-conf-core.sh b/apps/ci/ci-conf-core.sh index 31ed0a4ba..4fd3fa4c2 100644 --- a/apps/ci/ci-conf-core.sh +++ b/apps/ci/ci-conf-core.sh @@ -7,8 +7,9 @@ MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2)) CWARNINGS=ON CDEBUG=OFF CTYPE=Release -CTOOLS_BUILD=all +CTOOLS_BUILD=none CSCRIPTS=static +CMODULES=static CBUILD_TESTING=ON CSCRIPTPCH=OFF CCOREPCH=OFF diff --git a/apps/ci/ci-conf-db.sh b/apps/ci/ci-conf-db.sh new file mode 100644 index 000000000..e0fc17bce --- /dev/null +++ b/apps/ci/ci-conf-db.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -e + +cat >>conf/config.sh <> ./conf/config.sh + echo "CCOMPILERCXX=\"clang++\"" >> ./conf/config.sh + ;; + + "clang12" ) + time sudo apt-get install -y clang-12 + echo "CCOMPILERC=\"clang-12\"" >> ./conf/config.sh + echo "CCOMPILERCXX=\"clang++-12\"" >> ./conf/config.sh + ;; + + * ) + echo "Unknown compiler $COMPILER" + exit 1 + ;; +esac diff --git a/apps/ci/ci-conf-tools.sh b/apps/ci/ci-conf-tools.sh index 8ae787f04..25764cc8a 100644 --- a/apps/ci/ci-conf-tools.sh +++ b/apps/ci/ci-conf-tools.sh @@ -7,7 +7,6 @@ MTHREADS=$(($(grep -c ^processor /proc/cpuinfo) + 2)) CWARNINGS=ON CDEBUG=OFF CTYPE=Release -CSCRIPTS=static CAPPS_BUILD=none CTOOLS_BUILD=maps-only CSCRIPTPCH=OFF diff --git a/conf/dist/config.cmake b/conf/dist/config.cmake index c010deb63..381cce46b 100644 --- a/conf/dist/config.cmake +++ b/conf/dist/config.cmake @@ -14,8 +14,7 @@ set(SCRIPTS_AVAILABLE_OPTIONS none static dynamic minimal-static minimal-dynamic) set(MODULES_AVAILABLE_OPTIONS none static dynamic) set(BUILD_APPS_AVAILABLE_OPTIONS none all auth-only world-only) -# set(BUILD_TOOLS_AVAILABLE_OPTIONS none all db-only maps-only) # DB import PR -set(BUILD_TOOLS_AVAILABLE_OPTIONS none all maps-only) +set(BUILD_TOOLS_AVAILABLE_OPTIONS none all db-only maps-only) set(SCRIPTS "static" CACHE STRING "Build core with scripts") set(MODULES "static" CACHE STRING "Build core with modules") diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 2d5b43505..8364181a9 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -26,8 +26,7 @@ add_subdirectory(stdfs) add_subdirectory(threads) add_subdirectory(utf8cpp) -# if ((APPS_BUILD AND (NOT APPS_BUILD STREQUAL "none")) OR BUILD_TOOLS_DB_IMPORT) #DB import PR -if ((APPS_BUILD AND (NOT APPS_BUILD STREQUAL "none"))) +if ((APPS_BUILD AND (NOT APPS_BUILD STREQUAL "none")) OR BUILD_TOOLS_DB_IMPORT) add_subdirectory(mysql) endif() diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 4b5ceb258..a8d199edf 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -10,8 +10,6 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -message("") - # Make the script module list available in the current scope GetModuleSourceList(MODULES_MODULE_LIST) @@ -290,7 +288,7 @@ target_include_directories(modules ${CMAKE_CURRENT_SOURCE_DIR} ${PUBLIC_INCLUDES}) -set_target_properties(scripts +set_target_properties(modules PROPERTIES FOLDER "modules") diff --git a/src/cmake/macros/ConfigureTools.cmake b/src/cmake/macros/ConfigureTools.cmake index ece49ab48..dbe0da754 100644 --- a/src/cmake/macros/ConfigureTools.cmake +++ b/src/cmake/macros/ConfigureTools.cmake @@ -75,9 +75,9 @@ function(CheckToolsBuildList) list(APPEND BUILD_TOOLS_WHITELIST map_extractor mmaps_generator vmap4_assembler vmap4_extractor) endif() - # if (TOOLS_BUILD STREQUAL "db-only") - # list(APPEND BUILD_TOOLS_WHITELIST dbimport) - # endif() + if (TOOLS_BUILD STREQUAL "db-only") + list(APPEND BUILD_TOOLS_WHITELIST dbimport) + endif() endif() # Set the TOOL_${TOOL_BUILD_NAME} variables from the diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 559745d0a..b5ed464a2 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -12,8 +12,7 @@ add_subdirectory(apps) -# if ((APPS_BUILD AND NOT APPS_BUILD STREQUAL "none") OR BUILD_TOOLS_DB_IMPORT) # DB import PR -if ((APPS_BUILD AND NOT APPS_BUILD STREQUAL "none")) +if ((APPS_BUILD AND NOT APPS_BUILD STREQUAL "none") OR BUILD_TOOLS_DB_IMPORT) add_subdirectory(database) endif() diff --git a/src/server/apps/CMakeLists.txt b/src/server/apps/CMakeLists.txt index 807c89efc..d30ff6dd1 100644 --- a/src/server/apps/CMakeLists.txt +++ b/src/server/apps/CMakeLists.txt @@ -56,11 +56,6 @@ foreach(BUILD_APP ${APPLICATIONS_BUILD_LIST}) set(BUILD_APP_VALUE_DISPLAY_apps apps) list(APPEND BUILD_APP_VALUE_CONTAINS_apps ${BUILD_APP}) - if (${BUILD_APP} MATCHES "authserver") - set (BUILD_APPLICATION_AUTHSERVER 1) - elseif(${BUILD_APP} MATCHES "worldserver") - set (BUILD_APPLICATION_WORLDSERVER 1) - endif() else() list(APPEND BUILD_APP_GRAPH_KEYS disabled) set(BUILD_APP_VALUE_DISPLAY_disabled disabled) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 9ce44a36e..1edce4cbf 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -27,9 +27,9 @@ if (TOOLS_BUILD MATCHES "-only") list(APPEND BUILD_TOOLS_WHITELIST map_extractor mmaps_generator vmap4_assembler vmap4_extractor) endif() - # if (TOOLS_BUILD STREQUAL "db-only") - # list(APPEND BUILD_TOOLS_WHITELIST dbimport) - # endif() + if (TOOLS_BUILD STREQUAL "db-only") + list(APPEND BUILD_TOOLS_WHITELIST dbimport) + endif() endif() # Set the TOOL_${TOOL_BUILD_NAME} variables from the @@ -66,7 +66,7 @@ list(SORT TOOL_BUILD_GRAPH_KEYS) list(REMOVE_DUPLICATES TOOL_BUILD_GRAPH_KEYS) # Display the graphs -# message("") +message("") message("* Tools build list (${TOOLS_BUILD}):") message(" |") @@ -112,19 +112,26 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST}) add_dependencies(${TOOL_PROJECT_NAME} revision.h) - # Need fix errors + # Need fix errors in maps tools # target_link_libraries(${TOOL_PROJECT_NAME} # PRIVATE - # acore-core-interface) + # acore-dependency-interface) - # if (${TOOL_PROJECT_NAME} MATCHES "dbimport") - # target_link_libraries(${TOOL_PROJECT_NAME} - # PUBLIC - # database) + if (${TOOL_PROJECT_NAME} MATCHES "dbimport") + target_link_libraries(${TOOL_PROJECT_NAME} + PUBLIC + database + PRIVATE + acore-core-interface) + + # Install config + CopyToolConfig(${TOOL_PROJECT_NAME} ${TOOL_NAME}) + else() + + target_link_libraries(${TOOL_PROJECT_NAME} + PRIVATE + acore-dependency-interface) - # # Install config - # CopyToolConfig(${TOOL_PROJECT_NAME} ${TOOL_NAME}) - # else() target_link_libraries(${TOOL_PROJECT_NAME} PUBLIC common @@ -132,7 +139,7 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST}) zlib Recast g3dlib) - # endif() + endif() unset(TOOL_PUBLIC_INCLUDES) CollectIncludeDirectories( diff --git a/src/tools/dbimport/Main.cpp b/src/tools/dbimport/Main.cpp new file mode 100644 index 000000000..644e80a29 --- /dev/null +++ b/src/tools/dbimport/Main.cpp @@ -0,0 +1,151 @@ +/* + * This file is part of the AzerothCore Project. See AUTHORS file for Copyright information + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by the + * Free Software Foundation; either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "Banner.h" +#include "Common.h" +#include "Config.h" +#include "DatabaseEnv.h" +#include "DatabaseLoader.h" +#include "IoContext.h" +#include "Log.h" +#include "MySQLThreading.h" +#include "Util.h" +#include +#include +#include +#include +#include +#include +#include + +#ifndef _ACORE_DB_IMPORT_CONFIG +#define _ACORE_DB_IMPORT_CONFIG "dbimport.conf" +#endif + +using namespace boost::program_options; +namespace fs = std::filesystem; + +bool StartDB(); +void StopDB(); +variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile); + +/// Launch the db import server +int main(int argc, char** argv) +{ + signal(SIGABRT, &Acore::AbortHandler); + + // Command line parsing + auto configFile = fs::path(sConfigMgr->GetConfigPath() + std::string(_ACORE_DB_IMPORT_CONFIG)); + auto vm = GetConsoleArguments(argc, argv, configFile); + + // exit if help is enabled + if (vm.count("help")) + return 0; + + // Add file and args in config + sConfigMgr->Configure(configFile.generic_string(), std::vector(argv, argv + argc)); + + if (!sConfigMgr->LoadAppConfigs()) + return 1; + + // Init logging + sLog->Initialize(); + + Acore::Banner::Show("dbimport", + [](std::string_view text) + { + LOG_INFO("dbimport", text); + }, + []() + { + LOG_INFO("dbimport", "> Using configuration file: {}", sConfigMgr->GetFilename()); + LOG_INFO("dbimport", "> Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + LOG_INFO("dbimport", "> Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100); + } + ); + + // Initialize the database connection + if (!StartDB()) + return 1; + + std::shared_ptr dbHandle(nullptr, [](void*) { StopDB(); }); + + LOG_INFO("dbimport", "Halting process..."); + + return 0; +} + +/// Initialize connection to the database +bool StartDB() +{ + MySQL::Library_Init(); + + // Load databases + DatabaseLoader loader("dbimport"); + loader + .AddDatabase(LoginDatabase, "Login") + .AddDatabase(CharacterDatabase, "Character") + .AddDatabase(WorldDatabase, "World"); + + if (!loader.Load()) + return false; + + LOG_INFO("dbimport", "Started database connection pool."); + return true; +} + +/// Close the connection to the database +void StopDB() +{ + CharacterDatabase.Close(); + WorldDatabase.Close(); + LoginDatabase.Close(); + MySQL::Library_End(); +} + +variables_map GetConsoleArguments(int argc, char** argv, fs::path& configFile) +{ + options_description all("Allowed options"); + all.add_options() + ("help,h", "print usage message") + ("version,v", "print version build info") + ("dry-run,d", "Dry run") + ("config,c", value(&configFile)->default_value(fs::path(sConfigMgr->GetConfigPath() + std::string(_ACORE_DB_IMPORT_CONFIG))), "use as configuration file"); + + variables_map variablesMap; + + try + { + store(command_line_parser(argc, argv).options(all).allow_unregistered().run(), variablesMap); + notify(variablesMap); + } + catch (std::exception const& e) + { + std::cerr << e.what() << "\n"; + } + + if (variablesMap.count("help")) + { + std::cout << all << "\n"; + } + else if (variablesMap.count("dry-run")) + { + sConfigMgr->setDryRun(true); + } + + return variablesMap; +} diff --git a/src/tools/dbimport/dbimport.conf.dist b/src/tools/dbimport/dbimport.conf.dist new file mode 100644 index 000000000..b4c1e77a4 --- /dev/null +++ b/src/tools/dbimport/dbimport.conf.dist @@ -0,0 +1,286 @@ +################################################## +# AzerothCore Database Import configuration file # +################################################## + +################################################################################################### +# SECTION INDEX +# +# EXAMPLE CONFIG +# DB IMPORT CONFIG +# MYSQL SETTINGS +# UPDATE SETTINGS +# LOGGING SYSTEM SETTINGS +# +################################################################################################### + +################################################################################################### +# EXAMPLE CONFIG +# +# Variable +# Description: Brief description what the variable is doing. +# Important: Annotation for important things about this variable. +# Example: "Example, i.e. if the value is a string" +# Default: 10 - (Enabled|Comment|Variable name in case of grouped config options) +# 0 - (Disabled|Comment|Variable name in case of grouped config options) +# +# Note to developers: +# - Copy this example to keep the formatting. +# - Line breaks should be at column 100. +################################################################################################### + +################################################################################################### +# DB IMPORT CONFIG +# +# LogsDir +# Description: Logs directory setting. +# Important: LogsDir needs to be quoted, as the string might contain space characters. +# Logs directory must exists, or log file creation will be disabled. +# Example: "/home/youruser/azerothcore/logs" +# Default: "" - (Log files will be stored in the current path) + +LogsDir = "" + +# +# SourceDirectory +# Description: The path to your AzerothCore source directory. +# If the path is left empty, the built-in CMAKE_SOURCE_DIR is used. +# Example: "../AzerothCore" +# Default: "" +# + +SourceDirectory = "" + +# +# MySQLExecutable +# Description: The path to your MySQL CLI binary. +# If the path is left empty, built-in path from cmake is used. +# Example: "C:/Program Files/MariaDB 10.9/bin/mysql.exe" +# "mysql.exe" +# "/usr/bin/mysql" +# Default: "" +# + +MySQLExecutable = "" +################################################################################################### + +################################################################################################### +# MYSQL SETTINGS +# +# LoginDatabaseInfo +# WorldDatabaseInfo +# CharacterDatabaseInfo +# Description: Database connection settings for the world server. +# Example: "hostname;port;username;password;database" +# ".;somenumber;username;password;database" - (Use named pipes on Windows +# "enable-named-pipe" to [mysqld] +# section my.ini) +# ".;/path/to/unix_socket;username;password;database;ssl" - (use Unix sockets on +# Unix/Linux) +# Default: "127.0.0.1;3306;acore;acore;acore_auth" - (LoginDatabaseInfo) +# "127.0.0.1;3306;acore;acore;acore_world" - (WorldDatabaseInfo) +# "127.0.0.1;3306;acore;acore;acore_characters" - (CharacterDatabaseInfo) +# +# The SSL option will enable TLS when connecting to the specified database. If not provided or +# any value other than 'ssl' is set, TLS will not be used. +# + +LoginDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_auth" +WorldDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_world" +CharacterDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_characters" + +# +# Database.Reconnect.Seconds +# Database.Reconnect.Attempts +# +# Description: How many seconds between every reconnection attempt +# and how many attempts will be performed in total +# Default: 20 attempts every 15 seconds +# + +Database.Reconnect.Seconds = 5 +Database.Reconnect.Attempts = 5 + +# +# LoginDatabase.WorkerThreads +# WorldDatabase.WorkerThreads +# CharacterDatabase.WorkerThreads +# Description: The amount of worker threads spawned to handle asynchronous (delayed) MySQL +# statements. Each worker thread is mirrored with its own connection to the +# MySQL server and their own thread on the MySQL server. +# Default: 1 - (LoginDatabase.WorkerThreads) +# 1 - (WorldDatabase.WorkerThreads) +# 1 - (CharacterDatabase.WorkerThreads) +# + +LoginDatabase.WorkerThreads = 1 +WorldDatabase.WorkerThreads = 1 +CharacterDatabase.WorkerThreads = 1 + +# +# LoginDatabase.SynchThreads +# WorldDatabase.SynchThreads +# CharacterDatabase.SynchThreads +# Description: The amount of MySQL connections spawned to handle. +# Default: 1 - (LoginDatabase.WorkerThreads) +# 1 - (WorldDatabase.WorkerThreads) +# 1 - (CharacterDatabase.WorkerThreads) +# + +LoginDatabase.SynchThreads = 1 +WorldDatabase.SynchThreads = 1 +CharacterDatabase.SynchThreads = 1 +################################################################################################### + +################################################################################################### +# UPDATE SETTINGS +# +# Updates.EnableDatabases +# Description: A mask that describes which databases shall be updated. +# +# Following flags are available +# DATABASE_LOGIN = 1, // Auth database +# DATABASE_CHARACTER = 2, // Character database +# DATABASE_WORLD = 4, // World database +# +# Default: 7 - (All enabled) +# 4 - (Enable world only) +# 0 - (All disabled) + +Updates.EnableDatabases = 7 + +# +# Updates.AutoSetup +# Description: Auto populate empty databases. +# Default: 1 - (Enabled) +# 0 - (Disabled) + +Updates.AutoSetup = 1 + +# +# Updates.Redundancy +# Description: Perform data redundancy checks through hashing +# to detect changes on sql updates and reapply it. +# Default: 1 - (Enabled) +# 0 - (Disabled) + +Updates.Redundancy = 1 + +# +# Updates.ArchivedRedundancy +# Description: Check hashes of archived updates (slows down startup). +# Default: 0 - (Disabled) +# 1 - (Enabled) + +Updates.ArchivedRedundancy = 0 + +# +# Updates.AllowRehash +# Description: Inserts the current file hash in the database if it is left empty. +# Useful if you want to mark a file as applied but you don't know its hash. +# Default: 1 - (Enabled) +# 0 - (Disabled) + +Updates.AllowRehash = 1 + +# +# Updates.CleanDeadRefMaxCount +# Description: Cleans dead/ orphaned references that occur if an update was removed or renamed and edited in one step. +# It only starts the clean up if the count of the missing updates is below or equal the Updates.CleanDeadRefMaxCount value. +# This way prevents erasing of the update history due to wrong source directory state (maybe wrong branch or bad revision). +# Disable this if you want to know if the database is in a possible "dirty state". +# Default: 3 - (Enabled) +# 0 - (Disabled) +# -1 - (Enabled - unlimited) + +Updates.CleanDeadRefMaxCount = 3 +################################################################################################### + +################################################################################################### +# +# LOGGING SYSTEM SETTINGS +# +# Appender config values: Given an appender "name" +# Appender.name +# Description: Defines 'where to log' +# Format: Type,LogLevel,Flags,optional1,optional2,optional3 +# +# Type +# 0 - (None) +# 1 - (Console) +# 2 - (File) +# 3 - (DB) +# +# LogLevel +# 0 - (Disabled) +# 1 - (Fatal) +# 2 - (Error) +# 3 - (Warning) +# 4 - (Info) +# 5 - (Debug) +# 6 - (Trace) +# +# Flags: +# 0 - None +# 1 - Prefix Timestamp to the text +# 2 - Prefix Log Level to the text +# 4 - Prefix Log Filter type to the text +# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS (Only used with Type = 2) +# 16 - Make a backup of existing file before overwrite (Only used with Mode = w) +# +# Colors (read as optional1 if Type = Console) +# Format: "fatal error warn info debug trace" +# 0 - BLACK +# 1 - RED +# 2 - GREEN +# 3 - BROWN +# 4 - BLUE +# 5 - MAGENTA +# 6 - CYAN +# 7 - GREY +# 8 - YELLOW +# 9 - LRED +# 10 - LGREEN +# 11 - LBLUE +# 12 - LMAGENTA +# 13 - LCYAN +# 14 - WHITE +# Example: "1 9 3 6 5 8" +# +# File: Name of the file (read as optional1 if Type = File) +# Allows to use one "%s" to create dynamic files +# +# Mode: Mode to open the file (read as optional2 if Type = File) +# a - (Append) +# w - (Overwrite) +# +# MaxFileSize: Maximum file size of the log file before creating a new log file +# (read as optional3 if Type = File) +# Size is measured in bytes expressed in a 64-bit unsigned integer. +# Maximum value is 4294967295 (4 GB). Leave blank for no limit. +# NOTE: Does not work with dynamic filenames. +# Example: 536870912 (512 MB) +# + +Appender.Console=1,5,0,"1 9 3 6 5 8" +Appender.DBImport=2,5,0,DBImport.log,w + +# Logger config values: Given a logger "name" +# Logger.name +# Description: Defines 'What to log' +# Format: LogLevel,AppenderList +# +# LogLevel +# 0 - (Disabled) +# 1 - (Fatal) +# 2 - (Error) +# 3 - (Warning) +# 4 - (Info) +# 5 - (Debug) +# 6 - (Trace) +# +# AppenderList: List of appenders linked to logger +# (Using spaces as separator). +# + +Logger.root=4,Console DBImport +################################################################################################### From e95120861077b1eec3609dad922553d78a9ca55d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 10 Jun 2022 01:28:57 +0200 Subject: [PATCH 039/104] fix(Scripts/ZulGurub): Gah'zranka's Slam should reset threat. (#11910) --- .../rev_1653826897656877600.sql | 4 ++ .../ZulGurub/boss_gahzranka.cpp | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1653826897656877600.sql diff --git a/data/sql/updates/pending_db_world/rev_1653826897656877600.sql b/data/sql/updates/pending_db_world/rev_1653826897656877600.sql new file mode 100644 index 000000000..28f2eb3aa --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653826897656877600.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=24326; +INSERT INTO `spell_script_names` VALUES +(24326,'spell_gahzranka_slam'); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index b75928c48..86e4c473d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -24,6 +24,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "zulgurub.h" enum Spells @@ -110,7 +111,44 @@ public: } }; +class spell_gahzranka_slam : public SpellScript +{ + PrepareSpellScript(spell_gahzranka_slam); + + void FilterTargets(std::list& targets) + { + if (Unit* caster = GetCaster()) + { + _wipeThreat = targets.size() < caster->GetThreatMgr().getThreatList().size(); + } + } + + void HandleWipeThreat(SpellEffIndex /*effIndex*/) + { + if (_wipeThreat) + { + if (Unit* caster = GetCaster()) + { + if (Unit* target = GetHitUnit()) + { + caster->GetThreatMgr().modifyThreatPercent(target, -100); + } + } + } + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gahzranka_slam::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnEffectHitTarget += SpellEffectFn(spell_gahzranka_slam::HandleWipeThreat, EFFECT_1, SPELL_EFFECT_KNOCK_BACK); + } + +private: + bool _wipeThreat = false; +}; + void AddSC_boss_gahzranka() { new boss_gahzranka(); + RegisterSpellScript(spell_gahzranka_slam); } From 9dd4123ff00defb08e0c8b3188ac466445442b92 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Fri, 10 Jun 2022 01:30:07 +0200 Subject: [PATCH 040/104] fix(Scripts/ZulGurub): Fixed Edge of Madness tablets. (#11959) Based on @offl work. Fixes #11610 --- .../rev_1654360244950518900.sql | 47 +++++++++++++++++++ src/server/scripts/World/go_scripts.cpp | 20 -------- 2 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654360244950518900.sql diff --git a/data/sql/updates/pending_db_world/rev_1654360244950518900.sql b/data/sql/updates/pending_db_world/rev_1654360244950518900.sql new file mode 100644 index 000000000..cc872e508 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654360244950518900.sql @@ -0,0 +1,47 @@ +-- +DELETE FROM `npc_text` WHERE `ID` IN (7637,100117,100118,100119); +INSERT INTO `npc_text` (`ID`,`text0_0`,`BroadcastTextID0`,`Probability0`) VALUES +(7637,'The markings of this tablet show ancient diagrams and hold dire words of power.$B$BYou believe it is an alchemical recipe, but it is beyond your skill...',10487,1), +(100117,'Hazza\'rah, the Dreamweaver.$B$BHis is the power of nightmares, and may his foes ever sleep.$B$BHazza\'rah now dwells near the edge of madness...',10540,1), +(100118,'Renataki, of the Thousand Blades.$B$BPain is his lifeblood. Fear, his ally. May he one day return and bring joyous bloodshed with him.$B$BRenataki now dwells far from here. One day, he may return...',10541,1), +(100119,'Wushoolay, the Storm Witch.$B$BHer power is the power of the sky, the rain, and the shattered earth. May she once again reign mother to the Gurubashi. $B$BWushoolay now dwells near the edge of madness...',10544,1); + +DELETE FROM `gossip_menu` WHERE `MenuID`=6443 AND `TextID`=7637; +DELETE FROM `gossip_menu` WHERE `MenuID`=6448 AND `TextID`=7643; +DELETE FROM `gossip_menu` WHERE `MenuID`=6449 AND `TextID`=100117; +DELETE FROM `gossip_menu` WHERE `MenuID`=6450 AND `TextID`=100118; +DELETE FROM `gossip_menu` WHERE `MenuID`=6451 AND `TextID`=100119; +INSERT INTO `gossip_menu` (`MenuID`,`TextID`) VALUES +(6443,7637), +(6448,7643), +(6449,100117), +(6450,100118), +(6451,100119); + +DELETE FROM `gossip_menu_option` WHERE `MenuID`=6443; +INSERT INTO `gossip_menu_option` (`MenuID`,`OptionId`,`OptionIcon`,`OptionText`,`OptionBroadcastTextID`,`OptionType`,`OptionNpcFlag`,`VerifiedBuild`) VALUES +(6443,0,0,"Learn the recipe.",10486,1,1,0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`=6443; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup` IN (6448,6449,6450,6451); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,6443,7635,0,0,25,0,2259,0,0,1,0,0,"","Show gossip text 7635 if spell 'Alchemy' is not learned"), +(14,6443,7636,0,0,7,0,171,300,0,0,0,0,"","Show gossip text 7636 if player has Alchemy with skill level 300"), +(14,6443,7637,0,0,25,0,2259,0,0,0,0,0,"","Show gossip text 7637 if spell 'Alchemy' is learned"), +(14,6443,7637,0,0,7,0,171,300,0,1,0,0,"","Show gossip text 7637 if player has not Alchemy with skill level 300"), +(15,6443,0,0,0,7,0,171,300,0,0,0,0,"","Show Gossip Option 0 if player has Alchemy with skill level 300"), +(15,6443,0,0,0,25,0,24266,0,0,1,0,0,"","Show Gossip Option 0 if spell 'Gurubashi Mojo Madness' is not learned"), +(14,6448,7643,0,0,12,0,27,0,0,1,0,0,"","Show gossip text 7643 if game event 'Edge of Madness: Gri'lek is not active"), +(14,6448,7669,0,0,12,0,27,0,0,0,0,0,"","Show gossip text 7669 if game event 'Edge of Madness: Gri'lek is active"), +(14,6449,7670,0,0,12,0,28,0,0,1,0,0,"","Show gossip text 7670 if game event 'Edge of Madness: Hazza'rah is not active"), +(14,6449,100117,0,0,12,0,28,0,0,0,0,0,"","Show gossip text 100117 if game event 'Edge of Madness: Hazza'rah is active"), +(14,6450,100118,0,0,12,0,29,0,0,1,0,0,"","Show gossip text 100118 if game event 'Edge of Madness: Renataki is not active"), +(14,6450,7673,0,0,12,0,29,0,0,0,0,0,"","Show gossip text 7673 if game event 'Edge of Madness: Renataki is active"), +(14,6451,7674,0,0,12,0,30,0,0,1,0,0,"","Show gossip text 7674 if game event 'Edge of Madness: Wushoolay is not active"), +(14,6451,100119,0,0,12,0,30,0,0,0,0,0,"","Show gossip text 100119 if game event 'Edge of Madness: Wushoolay is active"); + +UPDATE `gameobject_template` SET `AIName` = "SmartGameObjectAI", `ScriptName` = "" WHERE `entry` = 180368; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 180368 AND `source_type` = 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 +(180368,1,0,1,62,0,100,0,6443,0,0,0,0,85,24267,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Tablet of Madness - On Gossip Option 0 Selected - Self Cast 'Gurubashi Mojo Madness'"), +(180368,1,1,0,61,0,100,0,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Tablet of Madness - On Link - Close Gossip"); diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 04187bb0d..2109d7265 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -24,7 +24,6 @@ go_sacred_fire_of_life go_shrine_of_the_birds go_southfury_moonstone go_resonite_cask -go_tablet_of_madness go_tablet_of_the_seven go_tele_to_dalaran_crystal go_tele_to_violet_stand @@ -943,24 +942,6 @@ public: } }; -/*###### -## go_tablet_of_madness -######*/ - -class go_tablet_of_madness : public GameObjectScript -{ -public: - go_tablet_of_madness() : GameObjectScript("go_tablet_of_madness") { } - - bool OnGossipHello(Player* player, GameObject* /*go*/) override - { - if (player->HasSkill(SKILL_ALCHEMY) && player->GetSkillValue(SKILL_ALCHEMY) >= 300 && !player->HasSpell(24266)) - player->CastSpell(player, 24267, false); - - return true; - } -}; - /*###### ## go_tablet_of_the_seven ######*/ @@ -1975,7 +1956,6 @@ void AddSC_go_scripts() new go_gilded_brazier(); //new go_shrine_of_the_birds(); new go_southfury_moonstone(); - new go_tablet_of_madness(); new go_tablet_of_the_seven(); new go_jump_a_tron(); new go_sacred_fire_of_life(); From 8151fcda22c6167211d1c08788791fe1ad9e2c44 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 9 Jun 2022 23:32:05 +0000 Subject: [PATCH 041/104] chore(DB): import pending files Referenced commit(s): 9dd4123ff00defb08e0c8b3188ac466445442b92 --- .../rev_1653826897656877600.sql => db_world/2022_06_09_00.sql} | 1 + .../rev_1654360244950518900.sql => db_world/2022_06_09_01.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1653826897656877600.sql => db_world/2022_06_09_00.sql} (75%) rename data/sql/updates/{pending_db_world/rev_1654360244950518900.sql => db_world/2022_06_09_01.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1653826897656877600.sql b/data/sql/updates/db_world/2022_06_09_00.sql similarity index 75% rename from data/sql/updates/pending_db_world/rev_1653826897656877600.sql rename to data/sql/updates/db_world/2022_06_09_00.sql index 28f2eb3aa..11ca3745d 100644 --- a/data/sql/updates/pending_db_world/rev_1653826897656877600.sql +++ b/data/sql/updates/db_world/2022_06_09_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_08_02 -> 2022_06_09_00 -- DELETE FROM `spell_script_names` WHERE `spell_id`=24326; INSERT INTO `spell_script_names` VALUES diff --git a/data/sql/updates/pending_db_world/rev_1654360244950518900.sql b/data/sql/updates/db_world/2022_06_09_01.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1654360244950518900.sql rename to data/sql/updates/db_world/2022_06_09_01.sql index cc872e508..c93261ed1 100644 --- a/data/sql/updates/pending_db_world/rev_1654360244950518900.sql +++ b/data/sql/updates/db_world/2022_06_09_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_09_00 -> 2022_06_09_01 -- DELETE FROM `npc_text` WHERE `ID` IN (7637,100117,100118,100119); INSERT INTO `npc_text` (`ID`,`text0_0`,`BroadcastTextID0`,`Probability0`) VALUES From 41a04c5ee1775a80012901211c46ac3b5d526af1 Mon Sep 17 00:00:00 2001 From: mpfans Date: Sun, 12 Jun 2022 00:47:57 +0800 Subject: [PATCH 042/104] fix(db/translation): Chinese translation of road signs (#11981) * Fix(DB/translate):Chinese translation of road signs * Boat to Azuremyst * Boat to Teldrassil * Boat to Stormwind --- .../updates/pending_db_world/rev_1654674618622504335.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1654674618622504335.sql diff --git a/data/sql/updates/pending_db_world/rev_1654674618622504335.sql b/data/sql/updates/pending_db_world/rev_1654674618622504335.sql new file mode 100644 index 000000000..fdc15a24e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654674618622504335.sql @@ -0,0 +1,6 @@ +-- Add Chinese translation of road signs +DELETE FROM `gameobject_template_locale` WHERE `entry` IN (184084,176365,176364) AND `locale` = 'zhCN'; +INSERT INTO `gameobject_template_locale` (`entry`, `locale`, `name`, `castBarCaption`, `VerifiedBuild`) VALUES +(184084, 'zhCN', '开往秘蓝岛的船只', '', 18019), +(176365, 'zhCN', '开往泰达希尔的船只', '', 18019), +(176364, 'zhCN', '开往暴风城的船只', '', 18019); From 913bc19aa0162748e9abe8e0178b8de1701c751f Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 11 Jun 2022 16:50:06 +0000 Subject: [PATCH 043/104] chore(DB): import pending files Referenced commit(s): 41a04c5ee1775a80012901211c46ac3b5d526af1 --- .../rev_1654674618622504335.sql => db_world/2022_06_11_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654674618622504335.sql => db_world/2022_06_11_00.sql} (90%) diff --git a/data/sql/updates/pending_db_world/rev_1654674618622504335.sql b/data/sql/updates/db_world/2022_06_11_00.sql similarity index 90% rename from data/sql/updates/pending_db_world/rev_1654674618622504335.sql rename to data/sql/updates/db_world/2022_06_11_00.sql index fdc15a24e..28161c69b 100644 --- a/data/sql/updates/pending_db_world/rev_1654674618622504335.sql +++ b/data/sql/updates/db_world/2022_06_11_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_09_01 -> 2022_06_11_00 -- Add Chinese translation of road signs DELETE FROM `gameobject_template_locale` WHERE `entry` IN (184084,176365,176364) AND `locale` = 'zhCN'; INSERT INTO `gameobject_template_locale` (`entry`, `locale`, `name`, `castBarCaption`, `VerifiedBuild`) VALUES From 491f73382b4620d91fcd0cc47459f6b5f9c2aabc Mon Sep 17 00:00:00 2001 From: temperrr Date: Sun, 12 Jun 2022 21:32:44 +0200 Subject: [PATCH 044/104] =?UTF-8?q?fix(Scripts/EmeraldDragons):=20Emerald?= =?UTF-8?q?=20dragons=20should=20'enrage'=20at=20health=20per=E2=80=A6=20(?= =?UTF-8?q?#12029)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scripts/World/boss_emerald_dragons.cpp | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 7acf32a31..8be574a4d 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -262,9 +262,9 @@ public: } // Summon druid spirits on 75%, 50% and 25% health - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (!HealthAbovePct(100 - 25 * _stage)) + if (me->HealthBelowPctDamaged(100 - (25 * _stage), damage)) { Talk(SAY_YSONDRE_SUMMON_DRUIDS); @@ -349,9 +349,9 @@ public: WorldBossAI::EnterCombat(who); } - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (!HealthAbovePct(100 - 25 * _stage)) + if (me->HealthBelowPctDamaged(100 - (25 * _stage), damage)) { Talk(SAY_LETHON_DRAW_SPIRIT); DoCast(me, SPELL_DRAW_SPIRIT); @@ -481,9 +481,9 @@ public: WorldBossAI::EnterCombat(who); } - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (!HealthAbovePct(100 - 25 * _stage)) + if (me->HealthBelowPctDamaged(100 - (25 * _stage), damage)) { Talk(SAY_EMERISS_CAST_CORRUPTION); DoCast(me, SPELL_CORRUPTION_OF_EARTH, true); @@ -541,7 +541,6 @@ uint32 const TaerarShadeSpells[] = { SPELL_SUMMON_SHADE_1, SPELL_SUMMON_SHADE_2, SPELL_SUMMON_SHADE_3 }; - class boss_taerar : public CreatureScript { public: @@ -578,11 +577,11 @@ public: --_shades; } - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { // At 75, 50 or 25 percent health, we need to activate the shades and go "banished" // Note: _stage holds the amount of times they have been summoned - if (!_banished && !HealthAbovePct(100 - 25 * _stage)) + if (!_banished && me->HealthBelowPctDamaged(100 - (25 * _stage), damage)) { _banished = true; _banishedTimer = 60000; @@ -594,9 +593,8 @@ public: uint32 count = sizeof(TaerarShadeSpells) / sizeof(uint32); for (uint32 i = 0; i < count; ++i) - DoCastVictim(TaerarShadeSpells[i], true); + DoCast(TaerarShadeSpells[i]); _shades += count; - DoCast(SPELL_SHADE); me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); me->SetReactState(REACT_PASSIVE); @@ -604,7 +602,6 @@ public: ++_stage; } } - void ExecuteEvent(uint32 eventId) override { switch (eventId) @@ -648,7 +645,6 @@ public: return; } - emerald_dragonAI::UpdateAI(diff); } From a2bc0ae02827bfc9ca6310022f532497ec2fdeab Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 13 Jun 2022 06:03:06 +0200 Subject: [PATCH 045/104] =?UTF-8?q?fix(Core/Objects):=20Include=20combat?= =?UTF-8?q?=20reach=20instead=20of=20object=20size=20in=20LoS=E2=80=A6=20(?= =?UTF-8?q?#12013)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... calculations. Fixed LoS calculations for dynamic objects. Modified combat reach of Deep Pool Threshfin. Fixes #11886 --- .../pending_db_world/rev_1654964701013345100.sql | 2 ++ src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Spells/Auras/SpellAuras.cpp | 16 ++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654964701013345100.sql diff --git a/data/sql/updates/pending_db_world/rev_1654964701013345100.sql b/data/sql/updates/pending_db_world/rev_1654964701013345100.sql new file mode 100644 index 000000000..17dd3f7d9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654964701013345100.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_model_info` SET `CombatReach`=1.5 WHERE `DisplayID`=2836; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 023632c0f..f894f9355 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1234,7 +1234,7 @@ Position WorldObject::GetHitSpherePointFor(Position const& dest) const { G3D::Vector3 vThis(GetPositionX(), GetPositionY(), GetPositionZ() + GetCollisionHeight()); G3D::Vector3 vObj(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ()); - G3D::Vector3 contactPoint = vThis + (vObj - vThis).directionOrZero() * std::min(dest.GetExactDist(this), GetObjectSize()); + G3D::Vector3 contactPoint = vThis + (vObj - vThis).directionOrZero() * std::min(dest.GetExactDist(this), GetCombatReach()); return Position(contactPoint.x, contactPoint.y, contactPoint.z, GetAngle(contactPoint.x, contactPoint.y)); } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d962deb72..e24899bf2 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2842,9 +2842,10 @@ void DynObjAura::FillTargetMap(std::map& targets, Unit* /*caster*/ { if (!HasEffect(effIndex)) continue; + + SpellInfo const* spellInfo = GetSpellInfo(); UnitList targetList; - if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY - || GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY) + if (spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY || spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY) { Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); Acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); @@ -2852,7 +2853,7 @@ void DynObjAura::FillTargetMap(std::map& targets, Unit* /*caster*/ } // pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit // what about EffectImplicitTargetA? - else if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE) + else if (spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE) { Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); Acore::UnitListSearcher searcher(GetDynobjOwner(), targetList, u_check); @@ -2867,12 +2868,11 @@ void DynObjAura::FillTargetMap(std::map& targets, Unit* /*caster*/ for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr) { - // xinef: check z level and los dependence Unit* target = *itr; - float zLevel = GetDynobjOwner()->GetPositionZ(); - if (target->GetPositionZ() + 3.0f < zLevel || target->GetPositionZ() - 5.0f > zLevel) - if (!target->IsWithinLOSInMap(GetDynobjOwner())) - continue; + if (!spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT) && !spellInfo->HasAttribute(SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT) && !target->IsWithinLOSInMap(GetDynobjOwner())) + { + continue; + } std::map::iterator existing = targets.find(*itr); if (existing != targets.end()) From 30d55ef2faacc4f515ad65aa9422e45a407fec87 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 13 Jun 2022 04:05:17 +0000 Subject: [PATCH 046/104] chore(DB): import pending files Referenced commit(s): a2bc0ae02827bfc9ca6310022f532497ec2fdeab --- .../rev_1654964701013345100.sql => db_world/2022_06_13_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654964701013345100.sql => db_world/2022_06_13_00.sql} (63%) diff --git a/data/sql/updates/pending_db_world/rev_1654964701013345100.sql b/data/sql/updates/db_world/2022_06_13_00.sql similarity index 63% rename from data/sql/updates/pending_db_world/rev_1654964701013345100.sql rename to data/sql/updates/db_world/2022_06_13_00.sql index 17dd3f7d9..a21c8f798 100644 --- a/data/sql/updates/pending_db_world/rev_1654964701013345100.sql +++ b/data/sql/updates/db_world/2022_06_13_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_11_00 -> 2022_06_13_00 -- UPDATE `creature_model_info` SET `CombatReach`=1.5 WHERE `DisplayID`=2836; From b273da1a5938aab4b587e732a8fce620fe0b12f3 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 13 Jun 2022 06:36:26 -0300 Subject: [PATCH 047/104] fix(Scripts/World): Fix Emeriss putrid mushrooms not doing anything (#12035) * fix(Scripts/World): Fix Emeriss putrid mushrooms not doing anything * Update rev_1655056541364669100.sql --- .../updates/pending_db_world/rev_1655056541364669100.sql | 7 +++++++ src/server/scripts/World/boss_emerald_dragons.cpp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1655056541364669100.sql diff --git a/data/sql/updates/pending_db_world/rev_1655056541364669100.sql b/data/sql/updates/pending_db_world/rev_1655056541364669100.sql new file mode 100644 index 000000000..e7179a541 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1655056541364669100.sql @@ -0,0 +1,7 @@ +-- +UPDATE `gameobject_template` SET `AIName` = 'SmartGameObjectAI' WHERE `entry` = 180517; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 180517) AND (`source_type` = 1) 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 +(180517, 1, 0, 0, 63, 0, 100, 0, 0, 0, 0, 0, 0, 11, 24871, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Putrid Mushroom - On Just Created - Cast \'Spore Cloud\''), +(180517, 1, 1, 0, 1, 0, 100, 0, 120000, 120000, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Putrid Mushroom - Out of Combat - Despawn Instant'); diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 8be574a4d..84a9740f6 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -471,7 +471,10 @@ public: void KilledUnit(Unit* who) override { if (who->GetTypeId() == TYPEID_PLAYER) - DoCast(who, SPELL_PUTRID_MUSHROOM, true); + { + who->CastSpell(who, SPELL_PUTRID_MUSHROOM, true); + } + emerald_dragonAI::KilledUnit(who); } From b455206ac3dda9b41c6c348189e40ff7293bc941 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 13 Jun 2022 09:38:25 +0000 Subject: [PATCH 048/104] chore(DB): import pending files Referenced commit(s): b273da1a5938aab4b587e732a8fce620fe0b12f3 --- .../rev_1655056541364669100.sql => db_world/2022_06_13_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1655056541364669100.sql => db_world/2022_06_13_01.sql} (95%) diff --git a/data/sql/updates/pending_db_world/rev_1655056541364669100.sql b/data/sql/updates/db_world/2022_06_13_01.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1655056541364669100.sql rename to data/sql/updates/db_world/2022_06_13_01.sql index e7179a541..2a50534c3 100644 --- a/data/sql/updates/pending_db_world/rev_1655056541364669100.sql +++ b/data/sql/updates/db_world/2022_06_13_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_13_00 -> 2022_06_13_01 -- UPDATE `gameobject_template` SET `AIName` = 'SmartGameObjectAI' WHERE `entry` = 180517; From 3b0cd43d122b05ee77318c8363612c06a94dfa47 Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Mon, 13 Jun 2022 05:52:28 -0600 Subject: [PATCH 049/104] fix(scripts/ZulGurub): Rewrite Broodlord Mandokir and Ohgan (#11854) Co-authored-by: Nefertumm --- .../rev_1653580726731163907.sql | 3 + .../game/Spells/SpellInfoCorrections.cpp | 6 + .../ZulGurub/boss_mandokir.cpp | 319 +++++++++++++++--- .../EasternKingdoms/ZulGurub/zulgurub.h | 4 +- 4 files changed, 278 insertions(+), 54 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1653580726731163907.sql diff --git a/data/sql/updates/pending_db_world/rev_1653580726731163907.sql b/data/sql/updates/pending_db_world/rev_1653580726731163907.sql new file mode 100644 index 000000000..47eda61ab --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653580726731163907.sql @@ -0,0 +1,3 @@ + +UPDATE `creature_template` SET `ScriptName`='npc_chained_spirit', `speed_run`=0.4, `unit_flags`=`unit_flags`|33554432 WHERE `entry`=15117; + diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index f2d8a9de0..9e85278f4 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -1363,6 +1363,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].Amplitude = 15000; }); + // Threatening Gaze + ApplySpellFix({ 24314 }, [](SpellInfo* spellInfo) + { + spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST; + }); + // Isle of Conquest ApplySpellFix({ 66551 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 9e6dd8bc2..4f04748b8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -15,19 +15,14 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Mandokir -SD%Complete: 90 -SDComment: Ohgan function needs improvements. -SDCategory: Zul'Gurub -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "Spell.h" #include "SpellAuras.h" #include "SpellScript.h" #include "zulgurub.h" +#include "Player.h" +#include "TaskScheduler.h" enum Says { @@ -41,15 +36,19 @@ enum Says enum Spells { - SPELL_CHARGE = 24408, // seen - SPELL_OVERPOWER = 24407, // Seen - SPELL_FEAR = 29321, - SPELL_WHIRLWIND = 13736, // Triggers 15589 - SPELL_MORTAL_STRIKE = 16856, // Seen - SPELL_FRENZY = 24318, // seen - SPELL_WATCH = 24314, // seen 24315, 24316 - SPELL_WATCH_CHARGE = 24315, // Triggers 24316 - SPELL_LEVEL_UP = 24312 // + SPELL_CHARGE = 24408, + SPELL_OVERPOWER = 24407, + SPELL_FRIGHTENING_SHOUT = 19134, + SPELL_WHIRLWIND = 13736, // triggers 15589 + SPELL_MORTAL_STRIKE = 16856, + SPELL_FRENZY = 24318, + SPELL_WATCH = 24314, // triggers 24315 and 24316 + SPELL_WATCH_CHARGE = 24315, // triggers 24316 + SPELL_LEVEL_UP = 24312, + SPELL_EXECUTE = 7160, + SPELL_MANDOKIR_CLEAVE = 20691, + + SPELL_REVIVE = 24341 // chained spirit }; enum Events @@ -62,18 +61,29 @@ enum Events EVENT_WHIRLWIND = 6, EVENT_CHECK_OHGAN = 7, EVENT_WATCH_PLAYER = 8, - EVENT_CHARGE_PLAYER = 9 + EVENT_CHARGE_PLAYER = 9, + EVENT_EXECUTE = 10, + EVENT_FRIGHTENING_SHOUT = 11, + EVENT_CLEAVE = 12 +}; + +enum Action +{ + ACTION_START_REVIVE = 1, // broodlord mandokir + ACTION_REVIVE = 2 // chained spirit }; enum Misc { + POINT_START_REVIVE = 1, // chained spirit + MODEL_OHGAN_MOUNT = 15271, PATH_MANDOKIR = 492861, POINT_MANDOKIR_END = 24, - CHAINED_SPIRT_COUNT = 20 + CHAINED_SPIRIT_COUNT = 20 }; -Position const PosSummonChainedSpirits[CHAINED_SPIRT_COUNT] = +Position const PosSummonChainedSpirits[CHAINED_SPIRIT_COUNT] = { { -12167.17f, -1979.330f, 133.0992f, 2.268928f }, { -12262.74f, -1953.394f, 133.5496f, 0.593412f }, @@ -114,28 +124,36 @@ public: void Reset() override { + BossAI::Reset(); + killCount = 0; if (me->GetPositionZ() > 140.0f) { events.ScheduleEvent(EVENT_CHECK_START, 1000); if (Creature* speaker = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_VILEBRANCH_SPEAKER))) + { if (!speaker->IsAlive()) + { speaker->Respawn(true); + } + } } - - killCount = 0; me->RemoveAurasDueToSpell(SPELL_FRENZY); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - summons.DespawnAll(); instance->SetBossState(DATA_OHGAN, NOT_STARTED); me->Mount(MODEL_OHGAN_MOUNT); + reviveGUID.Clear(); } void JustDied(Unit* /*killer*/) override { // Do not want to unsummon Ohgan - for (int i = 0; i < CHAINED_SPIRT_COUNT; ++i) - if (Creature* unsummon = ObjectAccessor::GetCreature(*me, chainedSpirtGUIDs[i])) + for (int i = 0; i < CHAINED_SPIRIT_COUNT; ++i) + { + if (Creature* unsummon = ObjectAccessor::GetCreature(*me, chainedSpiritGUIDs[i])) + { unsummon->DespawnOrUnsummon(); + } + } instance->SetBossState(DATA_MANDOKIR, DONE); instance->SaveToDB(); } @@ -143,22 +161,23 @@ public: void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - events.ScheduleEvent(EVENT_OVERPOWER, urand(7000, 9000)); - events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(12000, 18000)); + events.ScheduleEvent(EVENT_OVERPOWER, urand(6000, 8000)); + events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(14000, 28000)); events.ScheduleEvent(EVENT_WHIRLWIND, urand(24000, 30000)); events.ScheduleEvent(EVENT_CHECK_OHGAN, 1000); - events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(13000, 15000)); - events.ScheduleEvent(EVENT_CHARGE_PLAYER, urand(33000, 38000)); + events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(12000, 24000)); + events.ScheduleEvent(EVENT_CHARGE_PLAYER, urand(30000, 40000)); + events.ScheduleEvent(EVENT_EXECUTE, urand(7000, 14000)); + events.ScheduleEvent(EVENT_CLEAVE, urand(10000, 20000)); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); Talk(SAY_AGGRO); me->Dismount(); // Summon Ohgan (Spell missing) TEMP HACK me->SummonCreature(NPC_OHGAN, me->GetPositionX() - 3, me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); - // Summon Chained Spirits - for (int i = 0; i < CHAINED_SPIRT_COUNT; ++i) + for (int i = 0; i < CHAINED_SPIRIT_COUNT; ++i) { - Creature* chainedSpirt = me->SummonCreature(NPC_CHAINED_SPIRT, PosSummonChainedSpirits[i], TEMPSUMMON_CORPSE_DESPAWN); - chainedSpirtGUIDs[i] = chainedSpirt->GetGUID(); + Creature* chainedSpirit = me->SummonCreature(NPC_CHAINED_SPIRIT, PosSummonChainedSpirits[i], TEMPSUMMON_CORPSE_DESPAWN); + chainedSpiritGUIDs[i] = chainedSpirit->GetGUID(); } DoZoneInCombat(); } @@ -168,17 +187,49 @@ public: if (victim->GetTypeId() != TYPEID_PLAYER) return; + reviveGUID = victim->GetGUID(); + DoAction(ACTION_START_REVIVE); if (++killCount == 3) { Talk(SAY_DING_KILL); if (Creature* jindo = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JINDO))) + { if (jindo->IsAlive()) + { jindo->AI()->Talk(SAY_GRATS_JINDO); + } + } DoCast(me, SPELL_LEVEL_UP, true); killCount = 0; } } + void DoAction(int32 action) override + { + if (action == ACTION_START_REVIVE) + { + std::list creatures; + GetCreatureListWithEntryInGrid(creatures, me, NPC_CHAINED_SPIRIT, 200.0f); + if (creatures.empty()) + return; + + for (std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + if (Creature* chainedSpirit = ObjectAccessor::GetCreature(*me, (*itr)->GetGUID())) + { + chainedSpirit->AI()->SetGUID(reviveGUID); + chainedSpirit->AI()->DoAction(ACTION_REVIVE); + reviveGUID.Clear(); + } + } + } + } + + void SetGUID(ObjectGuid const guid, int32 /*type = 0 */) override + { + reviveGUID = guid; + } + void MovementInform(uint32 type, uint32 id) override { if (type == WAYPOINT_MOTION_TYPE) @@ -211,7 +262,9 @@ public: events.ScheduleEvent(EVENT_STARTED, 6000); } else + { events.ScheduleEvent(EVENT_CHECK_START, 1000); + } break; case EVENT_STARTED: me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); @@ -232,13 +285,12 @@ public: switch (eventId) { case EVENT_OVERPOWER: - DoCastVictim(SPELL_OVERPOWER, true); - events.ScheduleEvent(EVENT_OVERPOWER, urand(6000, 12000)); + DoCastVictim(SPELL_OVERPOWER); + events.ScheduleEvent(EVENT_OVERPOWER, urand(6000, 8000)); break; case EVENT_MORTAL_STRIKE: - if (me->GetVictim() && me->GetVictim()->HealthBelowPct(50)) - DoCastVictim(SPELL_MORTAL_STRIKE, true); - events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(12000, 18000)); + DoCastVictim(SPELL_MORTAL_STRIKE); + events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(14000, 28000)); break; case EVENT_WHIRLWIND: DoCast(me, SPELL_WHIRLWIND); @@ -251,7 +303,9 @@ public: Talk(SAY_OHGAN_DEAD); } else + { events.ScheduleEvent(EVENT_CHECK_OHGAN, 1000); + } break; case EVENT_WATCH_PLAYER: if (Unit* player = SelectTarget(SelectTargetMethod::Random, 0, 100, true)) @@ -259,23 +313,57 @@ public: DoCast(player, SPELL_WATCH); Talk(SAY_WATCH, player); } - events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(12000, 15000)); + events.ScheduleEvent(EVENT_WATCH_PLAYER, urand(12000, 24000)); break; case EVENT_CHARGE_PLAYER: DoCast(SelectTarget(SelectTargetMethod::Random, 0, 40, true), SPELL_CHARGE); - events.ScheduleEvent(EVENT_CHARGE_PLAYER, urand(22000, 30000)); + events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, 1500); + if (Unit* mainTarget = SelectTarget(SelectTargetMethod::MaxThreat, 0, 100.0f)) + { + me->GetThreatMgr().modifyThreatPercent(mainTarget, -100); + } + events.ScheduleEvent(EVENT_CHARGE_PLAYER, urand(30000, 40000)); break; + case EVENT_EXECUTE: + if (me->GetVictim() && me->GetVictim()->HealthBelowPct(20)) + { + DoCastVictim(SPELL_EXECUTE, true); + } + events.ScheduleEvent(EVENT_EXECUTE, urand(7000, 14000)); + break; + case EVENT_FRIGHTENING_SHOUT: + DoCastAOE(SPELL_FRIGHTENING_SHOUT); + break; + case EVENT_CLEAVE: + { + std::list meleeRangeTargets; + auto i = me->GetThreatMgr().getThreatList().begin(); + for (; i != me->GetThreatMgr().getThreatList().end(); ++i) + { + Unit* target = (*i)->getTarget(); + if (me->IsWithinMeleeRange(target)) + { + meleeRangeTargets.push_back(target); + } + } + if (meleeRangeTargets.size() >= 5) + { + DoCastVictim(SPELL_MANDOKIR_CLEAVE); + } + events.ScheduleEvent(EVENT_CLEAVE, urand(10000, 20000)); + break; + } default: break; } } - DoMeleeAttackIfReady(); } private: uint8 killCount; - ObjectGuid chainedSpirtGUIDs[CHAINED_SPIRT_COUNT]; + ObjectGuid chainedSpiritGUIDs[CHAINED_SPIRIT_COUNT]; + ObjectGuid reviveGUID; }; CreatureAI* GetAI(Creature* creature) const override @@ -288,7 +376,8 @@ public: enum OhganSpells { - SPELL_SUNDERARMOR = 24317 + SPELL_SUNDERARMOR = 24317, + SPELL_THRASH = 3417 // Triggers 3391 }; class npc_ohgan : public CreatureScript @@ -302,10 +391,61 @@ public: void Reset() override { - SunderArmor_Timer = 5000; + me->AddAura(SPELL_THRASH, me); + _scheduler.CancelAll(); + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + + reviveGUID.Clear(); } - void EnterCombat(Unit* /*who*/) override { } + void EnterCombat(Unit* victim) override + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + reviveGUID = victim->GetGUID(); + DoAction(ACTION_START_REVIVE); + _scheduler.Schedule(6s, 12s, [this](TaskContext context) + { + DoCastVictim(SPELL_SUNDERARMOR); + context.Repeat(6s, 12s); + }); + } + + void KilledUnit(Unit* victim) override + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + reviveGUID = victim->GetGUID(); + DoAction(ACTION_START_REVIVE); + } + + void DoAction(int32 action) override + { + if (action == ACTION_START_REVIVE) + { + std::list creatures; + GetCreatureListWithEntryInGrid(creatures, me, NPC_CHAINED_SPIRIT, 200.0f); + if (creatures.empty()) + return; + + for (Creature* chainedSpirit : creatures) + { + chainedSpirit->AI()->SetGUID(reviveGUID); + chainedSpirit->AI()->DoAction(ACTION_REVIVE); + reviveGUID.Clear(); + } + } + } + + void SetGUID(ObjectGuid const guid, int32 /*type = 0 */) override + { + reviveGUID = guid; + } void JustDied(Unit* /*killer*/) override { @@ -314,23 +454,20 @@ public: void UpdateAI(uint32 diff) override { - // Return since we have no target - if (!UpdateVictim()) - return; + _scheduler.Update(diff); - if (SunderArmor_Timer <= diff) + if (!UpdateVictim()) { - DoCastVictim(SPELL_SUNDERARMOR, true); - SunderArmor_Timer = urand(10000, 15000); + return; } - else SunderArmor_Timer -= diff; DoMeleeAttackIfReady(); } private: - uint32 SunderArmor_Timer; InstanceScript* instance; + ObjectGuid reviveGUID; + TaskScheduler _scheduler; }; CreatureAI* GetAI(Creature* creature) const override @@ -339,6 +476,75 @@ public: } }; +struct npc_chained_spirit : public ScriptedAI +{ +public: + npc_chained_spirit(Creature* creature) : ScriptedAI(creature) + { + instance = me->GetInstanceScript(); + me->AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + } + + void Reset() override + { + revivePlayerGUID.Clear(); + } + + void SetGUID(ObjectGuid const guid, int32 /*id*/) override + { + revivePlayerGUID = guid; + } + + void DoAction(int32 action) override + { + if (action == ACTION_REVIVE) + { + if (Player* target = ObjectAccessor::GetPlayer(*me, revivePlayerGUID)) + { + Position pos; + target->GetNearPoint(me, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 0.0f, target->GetAbsoluteAngle(me)); + me->GetMotionMaster()->MovePoint(POINT_START_REVIVE, pos); + } + } + } + + void MovementInform(uint32 type, uint32 pointId) override + { + if (type != POINT_MOTION_TYPE || !revivePlayerGUID) + return; + + if (pointId == POINT_START_REVIVE) + { + if (Player* target = ObjectAccessor::GetPlayer(*me, revivePlayerGUID)) + { + DoCast(target, SPELL_REVIVE); + } + me->DespawnOrUnsummon(1000); + } + } + + void JustDied(Unit* /*killer*/) override + { + Player* target = ObjectAccessor::GetPlayer(*me, revivePlayerGUID); + if (!target || target->IsAlive()) + return; + + if (Creature* mandokir = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MANDOKIR))) + { + mandokir->GetAI()->SetGUID(target->GetGUID()); + mandokir->GetAI()->DoAction(ACTION_START_REVIVE); + } + me->DespawnOrUnsummon(); + } + + void UpdateAI(uint32 /*diff*/) override { } + +private: + InstanceScript* instance; + ObjectGuid revivePlayerGUID; + +}; + enum VilebranchSpells { SPELL_DEMORALIZING_SHOUT = 13730, @@ -414,9 +620,15 @@ public: void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) + { if (Unit* target = GetTarget()) + { if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH) - caster->CastSpell(target, SPELL_WATCH_CHARGE); + { + caster->CastSpell(target, SPELL_WATCH_CHARGE, true); + } + } + } } void Register() override @@ -435,6 +647,7 @@ void AddSC_boss_mandokir() { new boss_mandokir(); new npc_ohgan(); + RegisterZulGurubCreatureAI(npc_chained_spirit); new npc_vilebranch_speaker(); new spell_threatening_gaze(); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 8c44120d1..79e40b4c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -57,7 +57,7 @@ enum CreatureIds NPC_MANDOKIR = 11382, // Mandokir Event NPC_OHGAN = 14988, // Mandokir Event NPC_VILEBRANCH_SPEAKER = 11391, // Mandokir Event - NPC_CHAINED_SPIRT = 15117, // Mandokir Event + NPC_CHAINED_SPIRIT = 15117, // Mandokir Event NPC_HAKKAR = 14834, NPC_ZULGURUB_TIGER = 11361 }; @@ -74,4 +74,6 @@ inline AI* GetZulGurubAI(T* obj) return GetInstanceAI(obj, ZGScriptName); } +#define RegisterZulGurubCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetZulGurubAI) + #endif From 94b73fadaa1bafc7cdf3ee15a53c6001acb59e6d Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 13 Jun 2022 11:54:35 +0000 Subject: [PATCH 050/104] chore(DB): import pending files Referenced commit(s): 3b0cd43d122b05ee77318c8363612c06a94dfa47 --- .../rev_1653580726731163907.sql => db_world/2022_06_13_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1653580726731163907.sql => db_world/2022_06_13_02.sql} (76%) diff --git a/data/sql/updates/pending_db_world/rev_1653580726731163907.sql b/data/sql/updates/db_world/2022_06_13_02.sql similarity index 76% rename from data/sql/updates/pending_db_world/rev_1653580726731163907.sql rename to data/sql/updates/db_world/2022_06_13_02.sql index 47eda61ab..c4069397a 100644 --- a/data/sql/updates/pending_db_world/rev_1653580726731163907.sql +++ b/data/sql/updates/db_world/2022_06_13_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_13_01 -> 2022_06_13_02 UPDATE `creature_template` SET `ScriptName`='npc_chained_spirit', `speed_run`=0.4, `unit_flags`=`unit_flags`|33554432 WHERE `entry`=15117; From db41a0132e2f8c1e1ede0e8fdb064daac8140cc9 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:57:35 +0200 Subject: [PATCH 051/104] fix(Core/Misc): Fixed radius of areatriggers in battlegrounds. (#12017) * fix(Core/Misc): Fixed radius of areatriggers in battlegrounds. Fixes #12004 * buildfix. --- src/server/game/Entities/Player/Player.cpp | 4 +--- src/server/game/Entities/Player/Player.h | 2 +- src/server/game/Entities/Player/PlayerUpdates.cpp | 7 ++++--- src/server/game/Handlers/MiscHandler.cpp | 5 +++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b73d8602c..7cd658988 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2139,10 +2139,8 @@ void Player::SetInWater(bool apply) getHostileRefMgr().updateThreatTables(); } -bool Player::IsInAreaTriggerRadius(const AreaTrigger* trigger) const +bool Player::IsInAreaTriggerRadius(AreaTrigger const* trigger, float delta) const { - static const float delta = 5.0f; - if (!trigger || GetMapId() != trigger->map) return false; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 4e8f21599..1ab612d5d 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1095,7 +1095,7 @@ public: [[nodiscard]] bool IsInWater() const override { return m_isInWater; } [[nodiscard]] bool IsFalling() const; - bool IsInAreaTriggerRadius(const AreaTrigger* trigger) const; + bool IsInAreaTriggerRadius(AreaTrigger const* trigger, float delta = 0.f) const; void SendInitialPacketsBeforeAddToMap(); void SendInitialPacketsAfterAddToMap(); diff --git a/src/server/game/Entities/Player/PlayerUpdates.cpp b/src/server/game/Entities/Player/PlayerUpdates.cpp index 86230835b..04f7fd011 100644 --- a/src/server/game/Entities/Player/PlayerUpdates.cpp +++ b/src/server/game/Entities/Player/PlayerUpdates.cpp @@ -277,10 +277,11 @@ void Player::Update(uint32 p_time) // supposed to be in one if (HasRestFlag(REST_FLAG_IN_TAVERN)) { - AreaTrigger const* atEntry = - sObjectMgr->GetAreaTrigger(GetInnTriggerId()); - if (!atEntry || !IsInAreaTriggerRadius(atEntry)) + AreaTrigger const* atEntry = sObjectMgr->GetAreaTrigger(GetInnTriggerId()); + if (!atEntry || !IsInAreaTriggerRadius(atEntry, 5.f)) + { RemoveRestFlag(REST_FLAG_IN_TAVERN); + } } uint32 newzone, newarea; diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 973cee758..dc5b48e68 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -731,7 +731,8 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) return; } - if (!player->IsInAreaTriggerRadius(atEntry)) + bool isTavernAreatrigger = sObjectMgr->IsTavernAreaTrigger(triggerId); + if (!player->IsInAreaTriggerRadius(atEntry, isTavernAreatrigger ? 5.f : 0.f)) { LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player {} ({}) too far (trigger map: {} player map: {}), ignore Area Trigger ID: {}", player->GetName(), player->GetGUID().ToString(), atEntry->map, player->GetMapId(), triggerId); @@ -749,7 +750,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) if (player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE) player->AreaExploredOrEventHappens(questId); - if (sObjectMgr->IsTavernAreaTrigger(triggerId)) + if (isTavernAreatrigger) { // set resting flag we are in the inn player->SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->entry); From 8cbc1b0a5536dbb4155c4b047e69e97aea801cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefano=20Borz=C3=AC?= Date: Mon, 13 Jun 2022 13:58:03 +0200 Subject: [PATCH 052/104] chore: restore googletest main repo reference (#12011) chore: retore googletest main repo reference --- src/cmake/googletest-download.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/googletest-download.cmake b/src/cmake/googletest-download.cmake index 0d7cd6744..1cc4361e5 100644 --- a/src/cmake/googletest-download.cmake +++ b/src/cmake/googletest-download.cmake @@ -22,7 +22,7 @@ ExternalProject_Add( SOURCE_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-src" BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build" GIT_REPOSITORY - https://github.com/Helias/googletest.git + https://github.com/google/googletest.git GIT_TAG main CONFIGURE_COMMAND "" From 8e7c4fa226c2757f73df8d2b9af4af0b388ddb6f Mon Sep 17 00:00:00 2001 From: Kempec Halk <80704304+Gozzim@users.noreply.github.com> Date: Mon, 13 Jun 2022 13:58:49 +0200 Subject: [PATCH 053/104] fix(Core): Deserter overrides from BG and Command (#11961) * fix(Core/Command): Deserter offline add * feat(Core/Command): Deserter online add restriction * fix(Core/Battleground): Deserter overrides longer debuff --- src/server/game/Entities/Player/Player.cpp | 6 +++++- src/server/scripts/Commands/cs_deserter.cpp | 22 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7cd658988..2dadc9023 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1620,7 +1620,11 @@ void Player::ProcessDelayedOperations() SaveToDB(false, false); if (m_DelayedOperations & DELAYED_SPELL_CAST_DESERTER) - CastSpell(this, 26013, true); // Deserter + { + Aura* aura = GetAura(26013); + if (!aura || aura->GetDuration() <= 900000) + CastSpell(this, 26013, true); + } if (m_DelayedOperations & DELAYED_BG_MOUNT_RESTORE) { diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp index 0cc93a62b..648464186 100644 --- a/src/server/scripts/Commands/cs_deserter.cpp +++ b/src/server/scripts/Commands/cs_deserter.cpp @@ -117,8 +117,14 @@ public: if (target) { - Aura* aura = target->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, target); + Aura* aura = target->GetAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + if (aura && aura->GetDuration() >= (int32)time * IN_MILLISECONDS) + { + handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(player->GetName()), isInstance ? "Instance" : "Battleground"); + return true; + } + aura = target->AddAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER, target); if (!aura) { handler->SendSysMessage(LANG_BAD_VALUE); @@ -130,6 +136,20 @@ public: return true; } + int32 duration = 0; + if (QueryResult result = CharacterDatabase.Query("SELECT remainTime FROM character_aura WHERE guid = {} AND spell = {}", player->GetGUID().GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER)) + { + Field* fields = result->Fetch(); + duration = fields[0].Get(); + + if (duration < 0 || duration >= (int32)time * IN_MILLISECONDS) + { + handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(player->GetName()), isInstance ? "Instance" : "Battleground"); + return true; + } + CharacterDatabase.Query("DELETE FROM character_aura WHERE guid = {} AND spell = {}", player->GetGUID().GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + } + uint8 index = 0; CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AURA); stmt->SetData(index++, player->GetGUID().GetCounter()); From d3b381c238914353452317f9f8c9c473861b9ab2 Mon Sep 17 00:00:00 2001 From: temperrr Date: Mon, 13 Jun 2022 14:01:50 +0200 Subject: [PATCH 054/104] fix(Scripts/BRD): Emperor should not yell when dead. (#12046) Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com> --- .../BlackrockDepths/boss_emperor_dagran_thaurissan.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp index f018a9f13..7fd7fa2af 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -80,7 +80,10 @@ public: { if (hasYelled < 5) { - Talk(SenatorYells[hasYelled]); + if (me->IsAlive()) + { + Talk(SenatorYells[hasYelled]); + } } hasYelled++; } From d236dc9d078f301d484623182cdae1f6ef828998 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:02:57 +0200 Subject: [PATCH 055/104] fix(Scripts/ZulGurub): Wushoolay - improvements: (#11968) * fix(Scripts/ZulGurub): Wushoolay - improvements: Added missing spells and events. Removed invalid spells Corrected event timers. Fixes #11627 * Update. --- .../ZulGurub/boss_wushoolay.cpp | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 6f4cbaf78..4e117d9c7 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -28,14 +28,16 @@ EndScriptData */ enum Spells { - SPELL_LIGHTNINGCLOUD = 25033, - SPELL_LIGHTNINGWAVE = 24819 + SPELL_LIGHTNING_CLOUD = 24683, + SPELL_CHAIN_LIGHTNING = 24680, + SPELL_FORKED_LIGHTNING = 24682 }; enum Events { - EVENT_LIGHTNINGCLOUD = 1, - EVENT_LIGHTNINGWAVE = 2 + EVENT_LIGHTNING_CLOUD = 1, + EVENT_CHAIN_LIGHTNING = 2, + EVENT_FORKED_LIGHTNING = 3 }; class boss_wushoolay : public CreatureScript @@ -47,21 +49,12 @@ public: { boss_wushoolayAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { } - void Reset() override - { - _Reset(); - } - - void JustDied(Unit* /*killer*/) override - { - _JustDied(); - } - void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - events.ScheduleEvent(EVENT_LIGHTNINGCLOUD, urand(5000, 10000)); - events.ScheduleEvent(EVENT_LIGHTNINGWAVE, urand(8000, 16000)); + events.ScheduleEvent(EVENT_LIGHTNING_CLOUD, 7s, 15s); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 12s, 16s); + events.ScheduleEvent(EVENT_FORKED_LIGHTNING, 8s, 12s); } void UpdateAI(uint32 diff) override @@ -78,13 +71,23 @@ public: { switch (eventId) { - case EVENT_LIGHTNINGCLOUD: - DoCastVictim(SPELL_LIGHTNINGCLOUD, true); - events.ScheduleEvent(EVENT_LIGHTNINGCLOUD, urand(15000, 20000)); + case EVENT_LIGHTNING_CLOUD: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + { + me->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_LIGHTNING_CLOUD, false); + } + events.ScheduleEvent(EVENT_LIGHTNING_CLOUD, 9s, 20s); break; - case EVENT_LIGHTNINGWAVE: - DoCast(SelectTarget(SelectTargetMethod::Random, 0, 100, true), SPELL_LIGHTNINGWAVE); - events.ScheduleEvent(EVENT_LIGHTNINGWAVE, urand(12000, 16000)); + case EVENT_CHAIN_LIGHTNING: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + { + DoCast(target, SPELL_CHAIN_LIGHTNING); + } + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 12s, 24s); + break; + case EVENT_FORKED_LIGHTNING: + DoCastAOE(SPELL_FORKED_LIGHTNING); + events.ScheduleEvent(EVENT_FORKED_LIGHTNING, 8s, 20s); break; default: break; From 3c434cee12f0cab55071a2580ced81de53233f9d Mon Sep 17 00:00:00 2001 From: Kempec Halk <80704304+Gozzim@users.noreply.github.com> Date: Mon, 13 Jun 2022 19:05:26 +0200 Subject: [PATCH 056/104] feat(Core/Command): Use timestring with all commands (#12050) --- .../rev_1654372051309044400.sql | 18 +++ src/server/scripts/Commands/cs_bf.cpp | 27 +++- src/server/scripts/Commands/cs_deserter.cpp | 97 ++++++++++---- src/server/scripts/Commands/cs_misc.cpp | 41 ++++-- src/server/scripts/Commands/cs_npc.cpp | 29 +++- src/server/scripts/Commands/cs_server.cpp | 124 ++++++++++++++++-- 6 files changed, 285 insertions(+), 51 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654372051309044400.sql diff --git a/data/sql/updates/pending_db_world/rev_1654372051309044400.sql b/data/sql/updates/pending_db_world/rev_1654372051309044400.sql new file mode 100644 index 000000000..e19b8912d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654372051309044400.sql @@ -0,0 +1,18 @@ +-- +DELETE FROM `acore_string` WHERE `entry` IN (283,298,300,301,11003); +INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES +(283, "%s has disabled %s's chat for %s, effective at the player's next login. Reason: %s.", NULL, NULL, "Ihr habt dem Spieler %s das chatten für %s gesperrt, beginnend mit dem nächsten Login des Spielers. Grund: %s.", "你已经被 %s 禁言 %s,将在下一次登陆时生效。原因: %s。", NULL, "%s ha deshabilitado el chat de %s por %s, efectivo en el próximo ingreso del jugador. Razón: %s.", "%s ha deshabilitado el chat de %s por %s, efectivo en el próximo ingreso del jugador. Razón: %s.", NULL), +(298, "Spawn time changed to: %s", NULL, NULL, "Spawnzeit wurde auf: %s abgeändert", "复生时间改变为: %s", NULL, "Tiempo de desove cambiado a: %s", "Tiempo de desove cambiado a: %s", NULL), +(300, "Your chat has been disabled for %s. By: %s, Reason: %s.", NULL, NULL, "Euer Chat wurde für %s abgeschaltet. Von: %s, Grund: %s", "你将被禁言 %s.", NULL, "Tu chat ha sido desactivado durante %u. Por: %s ,Razón: %s.", "Tu chat ha sido desactivado durante %u. Por: %s ,Razón: %s.", NULL), +(301, "%s has disabled %s's chat for %s. Reason: %s.", NULL, NULL, "Ihr hab den Chat von %s für %s abgeschaltet. Von: %s, Grund: %s", NULL, NULL, "%s ha desactivado el chat de %s durante %s. Razón: %s.", "%s ha desactivado el chat de %s durante %s. Razón: %s.", NULL), +(11003, "Server: %s has muted %s for %s, reason: %s", NULL, NULL, NULL, "系统公告: %s has muted %s for %s, 原因: %s", NULL, NULL, NULL, "Server: %s замутил %s на %s, причина: %s"); + +UPDATE `command` SET `help` = "Syntax: .mute [$playerName] $mutetime [$reason]\r\nDisible chat messaging for any character from account of character $playerName (or currently selected) at $mutetime time. Player can be offline.\n$mutetime: use a timestring like \"1d15h33s\"." WHERE `name` = "mute"; +UPDATE `command` SET `help` = "Syntax: .npc set spawntime #time\r\nAdjust spawntime of selected creature to #time.\n#time: use a timestring like \"10m30s\"." WHERE `name` = "npc set spawntime"; +UPDATE `command` SET `help` = "Syntax: .server idlerestart #delay\r\nRestart the server after #delay if no active connections are present (no players). Use #exist_code or 2 as program exist code.\n#delay: use a timestring like \"1h15m30s\"." WHERE `name` = "server idlerestart"; +UPDATE `command` SET `help` = "Syntax: .server idleshutdown #delay [#exist_code]\r\nShut the server down after #delay if no active connections are present (no players). Use #exist_code or 0 as program exist code.\n#delay: use a timestring like \"1h15m30s\"." WHERE `name` = "server idleshutdown"; +UPDATE `command` SET `help` = "Syntax: .server restart #delay\r\nRestart the server after #delay. Use #exist_code or 2 as program exist code.\n#delay: use a timestring like \"1h15m30s\"." WHERE `name` = "server restart"; +UPDATE `command` SET `help` = "Syntax: .server shutdown #delay [#exit_code]\r\nShut the server down after #delay. Use #exit_code or 0 as program exit code.\n#delay: use a timestring like \"1h15m30s\"." WHERE `name` = "server shutdown"; +UPDATE `command` SET `help` = "Syntax: .bf timer #battleid #timer\n#timer: use a timestring like \"1h15m30s\"." WHERE `name` = "bf timer"; +UPDATE `command` SET `help` = "Syntax: .deserter bg add $playerName <$time>\r\nAdds the bg deserter debuff to a player or your target with $time.\nOptional $time: use a timestring like \"1h15m30s\".Default: 15m" WHERE `name` = "deserter bg add"; +UPDATE `command` SET `help` = "Syntax: .deserter instance add $playerName <$time>\r\nAdds the instance deserter debuff to a player or your target with $time.\nOptional $time: use a timestring like \"1h15m30s\". Default: 30m" WHERE `name` = "deserter instance add"; \ No newline at end of file diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp index 06bf77871..2610a2c62 100644 --- a/src/server/scripts/Commands/cs_bf.cpp +++ b/src/server/scripts/Commands/cs_bf.cpp @@ -117,8 +117,33 @@ public: return true; } - static bool HandleBattlefieldTimer(ChatHandler* handler, uint32 battleId, uint32 time) + static bool HandleBattlefieldTimer(ChatHandler* handler, uint32 battleId, std::string timeStr) { + if (timeStr.empty()) + { + return false; + } + + if (Acore::StringTo(timeStr).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + + int32 time = TimeStringToSecs(timeStr); + if (time <= 0) + { + time = Acore::StringTo(timeStr).value_or(0); + } + + if (time <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId); if (!bf) diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp index 648464186..17761aaf6 100644 --- a/src/server/scripts/Commands/cs_deserter.cpp +++ b/src/server/scripts/Commands/cs_deserter.cpp @@ -79,7 +79,8 @@ public: * selected player, with the provided duration in seconds. * * @param handler The ChatHandler, passed by the system. - * @param time The provided duration in seconds. + * @param playerName Player by name. Optional, defaults to selected or self. + * @param time The provided duration as TimeString. Optional, defaults to bg/instance default time. * @param isInstance provided by the relaying functions, so we don't have * to write that much code :) * @@ -87,40 +88,80 @@ public: * * Example Usage: * @code - * .deserter instance add 3600 (one hour) + * .deserter instance add 1h30m * -or- - * .deserter bg add 3600 (one hour) + * .deserter bg add 1h30m * @endcode */ - static bool HandleDeserterAdd(ChatHandler* handler, Optional player, uint32 time, bool isInstance) + static bool HandleDeserterAdd(ChatHandler* handler, Optional playerName, Optional time, bool isInstance) { - if (!player) + Player* target = handler->getSelectedPlayerOrSelf(); + ObjectGuid guid; + + if (playerName) { - player = PlayerIdentifier::FromTargetOrSelf(handler); + if (!normalizePlayerName(*playerName)) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + guid = sCharacterCache->GetCharacterGuidByName(*playerName); + if (guid) + { + target = ObjectAccessor::FindPlayerByName(*playerName); + } + else + { + if (time) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); + handler->SetSentErrorMessage(true); + return false; + } + + time = playerName; + playerName = ""; + } } - if (!player) + if (!playerName || playerName->empty()) { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; + if (!handler->GetSession()) + { + return false; + } + + playerName = target->GetName(); + guid = target->GetGUID(); } if (!time) + { + time = isInstance ? "30m" : "15m"; + } + + int32 duration = TimeStringToSecs(*time); + + if (duration == 0) + { + duration = Acore::StringTo(*time).value_or(0); + } + + if (duration == 0) { handler->SendSysMessage(LANG_BAD_VALUE); handler->SetSentErrorMessage(true); return false; } - Player* target = player->GetConnectedPlayer(); - if (target) { Aura* aura = target->GetAura(isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); - if (aura && aura->GetDuration() >= (int32)time * IN_MILLISECONDS) + if (aura && aura->GetDuration() >= duration * IN_MILLISECONDS) { - handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(player->GetName()), isInstance ? "Instance" : "Battleground"); + handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(*playerName), isInstance ? "Instance" : "Battleground"); return true; } @@ -131,29 +172,29 @@ public: handler->SetSentErrorMessage(true); return false; } - aura->SetDuration(time * IN_MILLISECONDS); + aura->SetDuration(duration * IN_MILLISECONDS); return true; } - int32 duration = 0; - if (QueryResult result = CharacterDatabase.Query("SELECT remainTime FROM character_aura WHERE guid = {} AND spell = {}", player->GetGUID().GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER)) + int32 remainTime = 0; + if (QueryResult result = CharacterDatabase.Query("SELECT remainTime FROM character_aura WHERE guid = {} AND spell = {}", guid.GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER)) { Field* fields = result->Fetch(); - duration = fields[0].Get(); + remainTime = fields[0].Get(); - if (duration < 0 || duration >= (int32)time * IN_MILLISECONDS) + if (remainTime < 0 || remainTime >= duration * IN_MILLISECONDS) { - handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(player->GetName()), isInstance ? "Instance" : "Battleground"); + handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(*playerName), isInstance ? "Instance" : "Battleground"); return true; } - CharacterDatabase.Query("DELETE FROM character_aura WHERE guid = {} AND spell = {}", player->GetGUID().GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); + CharacterDatabase.Query("DELETE FROM character_aura WHERE guid = {} AND spell = {}", guid.GetCounter(), isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); } uint8 index = 0; CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AURA); - stmt->SetData(index++, player->GetGUID().GetCounter()); - stmt->SetData(index++, player->GetGUID().GetCounter()); + stmt->SetData(index++, guid.GetCounter()); + stmt->SetData(index++, guid.GetCounter()); stmt->SetData(index++, 0); stmt->SetData(index++, isInstance ? LFG_SPELL_DUNGEON_DESERTER : BG_SPELL_DESERTER); stmt->SetData(index++, 1); @@ -166,7 +207,7 @@ public: stmt->SetData(index++, 0); stmt->SetData(index++, 0); stmt->SetData(index++, isInstance ? 1800000 : 900000); - stmt->SetData(index++, time * 1000); + stmt->SetData(index++, duration * 1000); stmt->SetData(index, 0); CharacterDatabase.Execute(stmt); @@ -240,15 +281,15 @@ public: } /// @sa HandleDeserterAdd() - static bool HandleDeserterInstanceAdd(ChatHandler* handler, Optional player, uint32 time) + static bool HandleDeserterInstanceAdd(ChatHandler* handler, Optional playerName, Optional time) { - return HandleDeserterAdd(handler, player, time, true); + return HandleDeserterAdd(handler, playerName, time, true); } /// @sa HandleDeserterAdd() - static bool HandleDeserterBGAdd(ChatHandler* handler, Optional player, uint32 time) + static bool HandleDeserterBGAdd(ChatHandler* handler, Optional playerName, Optional time) { - return HandleDeserterAdd(handler, player, time, false); + return HandleDeserterAdd(handler, playerName, time, false); } /// @sa HandleDeserterRemove() diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index d6b9bbd8e..33ed6b6d1 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2374,10 +2374,22 @@ public: } // mute player for some times - static bool HandleMuteCommand(ChatHandler* handler, Optional player, uint32 notSpeakTime, Tail muteReason) + static bool HandleMuteCommand(ChatHandler* handler, Optional player, std::string notSpeakTime, Tail muteReason) { std::string muteReasonStr{ muteReason }; + if (notSpeakTime.empty()) + { + return false; + } + + if (Acore::StringTo(notSpeakTime).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (muteReason.empty()) { muteReasonStr = handler->GetAcoreString(LANG_NO_REASON); @@ -2412,6 +2424,19 @@ public: } LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); + int32 muteDuration = TimeStringToSecs(notSpeakTime); + if (muteDuration <= 0) + { + muteDuration = Acore::StringTo(notSpeakTime).value_or(0); + } + + if (muteDuration <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + std::string muteBy = ""; if (handler->GetSession()) { @@ -2425,22 +2450,22 @@ public: if (target) { // Target is online, mute will be in effect right away. - int64 muteTime = GameTime::GetGameTime().count() + notSpeakTime * MINUTE; + int64 muteTime = GameTime::GetGameTime().count() + muteDuration; target->GetSession()->m_muteTime = muteTime; stmt->SetData(0, muteTime); std::string nameLink = handler->playerLink(player->GetName()); if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD)) { - sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, muteBy.c_str(), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); + sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, muteBy.c_str(), nameLink.c_str(), secsToTimeString(muteDuration, true).c_str(), muteReasonStr.c_str()); } - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, secsToTimeString(muteDuration, true).c_str(), muteBy.c_str(), muteReasonStr.c_str()); } else { // Target is offline, mute will be in effect starting from the next login. - stmt->SetData(0, -int32(notSpeakTime * MINUTE)); + stmt->SetData(0, -int32(muteDuration)); } stmt->SetData(1, muteReasonStr); @@ -2450,7 +2475,7 @@ public: stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_MUTE); stmt->SetData(0, accountId); - stmt->SetData(1, notSpeakTime); + stmt->SetData(1, muteDuration / MINUTE); stmt->SetData(2, muteBy); stmt->SetData(3, muteReasonStr); LoginDatabase.Execute(stmt); @@ -2459,7 +2484,7 @@ public: if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD) && !target) { - sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, muteBy.c_str(), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); + sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, muteBy.c_str(), nameLink.c_str(), secsToTimeString(muteDuration, true).c_str(), muteReasonStr.c_str()); } else { @@ -2469,7 +2494,7 @@ public: for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) if (itr->second->GetSession()->GetSecurity()) ChatHandler(itr->second->GetSession()).PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, - (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : handler->GetAcoreString(LANG_CONSOLE)), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); + (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : handler->GetAcoreString(LANG_CONSOLE)), nameLink.c_str(), secsToTimeString(muteDuration, true).c_str(), muteReasonStr.c_str()); } return true; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 2490c1d40..d722a5478 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -987,19 +987,44 @@ public: } //spawn time handling - static bool HandleNpcSetSpawnTimeCommand(ChatHandler* handler, uint32 spawnTime) + static bool HandleNpcSetSpawnTimeCommand(ChatHandler* handler, std::string spawnTimeStr) { + if (spawnTimeStr.empty()) + { + return false; + } + + if (Acore::StringTo(spawnTimeStr).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + Creature* creature = handler->getSelectedCreature(); if (!creature) return false; + int32 spawnTime = TimeStringToSecs(spawnTimeStr); + if (spawnTime <= 0) + { + spawnTime = Acore::StringTo(spawnTimeStr).value_or(0); + } + + if (spawnTime <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_SPAWN_TIME_SECS); stmt->SetData(0, spawnTime); stmt->SetData(1, creature->GetSpawnId()); WorldDatabase.Execute(stmt); creature->SetRespawnDelay(spawnTime); - handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, spawnTime); + handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, secsToTimeString(spawnTime, true).c_str()); return true; } diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 2e0c47200..2e60148a2 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -269,11 +269,23 @@ public: return true; } - static bool HandleServerShutDownCommand(ChatHandler* /*handler*/, int32 time, Optional exitCode, Tail reason) + static bool HandleServerShutDownCommand(ChatHandler* handler, std::string time, Optional exitCode, Tail reason) { std::wstring wReason = std::wstring(); std::string strReason = std::string(); + if (time.empty()) + { + return false; + } + + if (Acore::StringTo(time).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (!reason.empty()) { if (!Utf8toWStr(reason, wReason)) @@ -287,23 +299,48 @@ public: } } + int32 delay = TimeStringToSecs(time); + if (delay <= 0) + { + delay = Acore::StringTo(time).value_or(0); + } + + if (delay <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (exitCode && *exitCode >= 0 && *exitCode <= 125) { - sWorld->ShutdownServ(time, 0, *exitCode); + sWorld->ShutdownServ(delay, 0, *exitCode); } else { - sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE, strReason); + sWorld->ShutdownServ(delay, 0, SHUTDOWN_EXIT_CODE, strReason); } return true; } - static bool HandleServerRestartCommand(ChatHandler* /*handler*/, int32 time, Optional exitCode, Tail reason) + static bool HandleServerRestartCommand(ChatHandler* handler, std::string time, Optional exitCode, Tail reason) { std::wstring wReason = std::wstring(); std::string strReason = std::string(); + if (time.empty()) + { + return false; + } + + if (Acore::StringTo(time).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (!reason.empty()) { if (!Utf8toWStr(reason, wReason)) @@ -317,23 +354,48 @@ public: } } + int32 delay = TimeStringToSecs(time); + if (delay <= 0) + { + delay = Acore::StringTo(time).value_or(0); + } + + if (delay <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (exitCode && *exitCode >= 0 && *exitCode <= 125) { - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, *exitCode); + sWorld->ShutdownServ(delay, SHUTDOWN_MASK_RESTART, *exitCode); } else { - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE, strReason); + sWorld->ShutdownServ(delay, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE, strReason); } return true; } - static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, int32 time, Optional exitCode, Tail reason) + static bool HandleServerIdleRestartCommand(ChatHandler* handler, std::string time, Optional exitCode, Tail reason) { std::wstring wReason = std::wstring(); std::string strReason = std::string(); + if (time.empty()) + { + return false; + } + + if (Acore::StringTo(time).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (!reason.empty()) { if (!Utf8toWStr(reason, wReason)) @@ -347,23 +409,48 @@ public: } } + int32 delay = TimeStringToSecs(time); + if (delay <= 0) + { + delay = Acore::StringTo(time).value_or(0); + } + + if (delay <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (exitCode && *exitCode >= 0 && *exitCode <= 125) { - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, *exitCode); + sWorld->ShutdownServ(delay, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, *exitCode); } else { - sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE, strReason); + sWorld->ShutdownServ(delay, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE, strReason); } return true; } - static bool HandleServerIdleShutDownCommand(ChatHandler* /*handler*/, int32 time, Optional exitCode, Tail reason) + static bool HandleServerIdleShutDownCommand(ChatHandler* handler, std::string time, Optional exitCode, Tail reason) { std::wstring wReason = std::wstring(); std::string strReason = std::string(); + if (time.empty()) + { + return false; + } + + if (Acore::StringTo(time).value_or(0) < 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (!reason.empty()) { if (!Utf8toWStr(reason, wReason)) @@ -377,13 +464,26 @@ public: } } + int32 delay = TimeStringToSecs(time); + if (delay <= 0) + { + delay = Acore::StringTo(time).value_or(0); + } + + if (delay <= 0) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + if (exitCode && *exitCode >= 0 && *exitCode <= 125) { - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, *exitCode); + sWorld->ShutdownServ(delay, SHUTDOWN_MASK_IDLE, *exitCode); } else { - sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE, strReason); + sWorld->ShutdownServ(delay, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE, strReason); } return true; From 783060f94918163ff9a7bf07329b92dd24355ba3 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 13 Jun 2022 17:07:46 +0000 Subject: [PATCH 057/104] chore(DB): import pending files Referenced commit(s): 3c434cee12f0cab55071a2580ced81de53233f9d --- .../rev_1654372051309044400.sql => db_world/2022_06_13_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654372051309044400.sql => db_world/2022_06_13_03.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1654372051309044400.sql b/data/sql/updates/db_world/2022_06_13_03.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1654372051309044400.sql rename to data/sql/updates/db_world/2022_06_13_03.sql index e19b8912d..9f32541bb 100644 --- a/data/sql/updates/pending_db_world/rev_1654372051309044400.sql +++ b/data/sql/updates/db_world/2022_06_13_03.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_13_02 -> 2022_06_13_03 -- DELETE FROM `acore_string` WHERE `entry` IN (283,298,300,301,11003); INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES From 077068802538094596f13390746b9d3ab1da262d Mon Sep 17 00:00:00 2001 From: temperrr Date: Mon, 13 Jun 2022 19:41:59 +0200 Subject: [PATCH 058/104] fix(DB/factionchange_items): Adding missing 58 pvp faction change items (#12049) * fix(DB/factionchange_items): Adding missing 58 pvp faction change items * refactor --- .../pvp58factionchangeitems.sql | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 data/sql/updates/pending_db_world/pvp58factionchangeitems.sql diff --git a/data/sql/updates/pending_db_world/pvp58factionchangeitems.sql b/data/sql/updates/pending_db_world/pvp58factionchangeitems.sql new file mode 100644 index 000000000..6d808791c --- /dev/null +++ b/data/sql/updates/pending_db_world/pvp58factionchangeitems.sql @@ -0,0 +1,44 @@ +DELETE FROM `player_factionchange_items` WHERE `alliance_id` IN (16393, 16397, 16423, 16422, 16424, 16421, 16401, 16403, 16425, 16426, 16427, 16428, 16369, 16391, 16413, 16414, 16415, 16416, 17594, 17596, 17598, 17599, 17600, 17601) OR `horde_id` IN (16498, 16499, 16505, 16506, 16507, 16508, 17570, 17571, 17572, 17573, 17576, 17577, 16509, 16510, 16513, 16514, 16515, 16516, 16494, 16496, 16501, 16503, 16504); +INSERT INTO `player_factionchange_items` (`alliance_id`, `alliance_comment`, `horde_id`, `horde_comment`) VALUES +(16393, 'Knight-Lieutenant\'s Dragonhide Footwraps', 16494, 'Blood Guard\'s Dragonhide Boots'), +(16397, 'Knight-Lieutenant\'s Dragonhide Gloves', 16496, 'Blood Guard\'s Dragonhide Gauntlets'), +(16423, 'Lieutenant Commander\'s Dragonhide Epaulets', 16501, 'Champion\'s Dragonhide Spaulders'), +(16422, 'Knight-Captain\'s Dragonhide Leggings', 16502, 'Legionnaire\'s Dragonhide Trousers'), +(16424, 'Lieutenant Commander\'s Dragonhide Shroud', 16503, 'Champion\'s Dragonhide Helm'), +(16421, 'Knight-Captain\'s Dragonhide Tunic', 16504, 'Legionnaire\'s Dragonhide Breastplate'), +(16401, 'Knight-Lieutenant\'s Chain Boots', 16531, 'Blood Guard\'s Chain Boots'), +(16403, 'Knight-Lieutenant\'s Chain Gauntlets', 16530, 'Blood Guard\'s Chain Gauntlets'), +(16425, 'Knight-Captain\'s Chain Hauberk', 16525, 'Legionnaire\'s Chain Breastplate'), +(16426, 'Knight-Captain\'s Chain Leggings', 16527, 'Legionnaire\'s Chain Leggings'), +(16427, 'Lieutenant Commander\'s Chain Pauldrons', 16528, 'Champion\'s Chain Pauldrons'), +(16428, 'Lieutenant Commander\'s Chain Helmet', 16526, 'Champion\'s Chain Headguard'), +(16369, 'Knight-Lieutenant\'s Silk Boots', 16485, 'Blood Guard\'s Silk Footwraps'), +(16391, 'Knight-Lieutenant\'s Silk Gloves', 16487, 'Blood Guard\'s Silk Gloves'), +(16413, 'Knight-Captain\'s Silk Raiment', 16491, 'Legionnaire\'s Silk Robes'), +(16414, 'Knight-Captain\'s Silk Leggings', 16490, 'Legionnaire\'s Silk Pants'), +(16415, 'Lieutenant Commander\'s Silk Spaulders', 16492, 'Champion\'s Silk Shoulderpads'), +(16416, 'Lieutenant Commander\'s Crown', 16489, 'Champion\'s Silk Hood'), +(16392, 'Knight-Lieutenant\'s Leather Boots', 16498, 'Blood Guard\'s Leather Treads'), +(16396, 'Knight-Lieutenant\'s Leather Gauntlets', 16499, 'Blood Guard\'s Leather Vices'), +(16417, 'Knight-Captain\'s Leather Armor', 16505, 'Legionnaire\'s Leather Hauberk'), +(16418, 'Lieutenant Commander\'s Leather Veil', 16506, 'Champion\'s Leather Headguard'), +(16419, 'Knight-Captain\'s Leather Legguards', 16508, 'Legionnaire\'s Leather Leggings'), +(16420, 'Lieutenant Commander\'s Leather Spaulders', 16507, 'Champion\'s Leather Mantle'), +(17594, 'Knight-Lieutenant\'s Satin Boots', 17616, 'Blood Guard\'s Satin Boots'), +(17596, 'Knight-Lieutenant\'s Satin Gloves', 17617, 'Blood Guard\'s Satin Gloves'), +(17598, 'Lieutenant Commander\'s Diadem', 17610, 'Champion\'s Satin Cowl'), +(17599, 'Knight-Captain\'s Satin Leggings', 17611, 'Legionnaire\'s Satin Trousers'), +(17600, 'Knight-Captain\'s Satin Robes', 17612, 'Legionnaire\'s Satin Vestments'), +(17601, 'Lieutenant Commander\'s Satin Amice', 17613, 'Champion\'s Satin Shoulderpads'), +(17562, 'Knight-Lieutenant\'s Dreadweave Boots', 17576, 'Blood Guard\'s Dreadweave Boots'), +(17564, 'Knight-Lieutenant\'s Dreadweave Gloves', 17577, 'Blood Guard\'s Dreadweave Gloves'), +(17566, 'Lieutenant Commander\'s Headguard', 17570, 'Champion\'s Dreadweave Hood'), +(17567, 'Knight-Captain\'s Dreadweave Leggings', 17571, 'Legionnaire\'s Dreadweave Leggings'), +(17568, 'Knight-Captain\'s Dreadweave Robe', 17572, 'Legionnaire\'s Dreadweave Robe'), +(17569, 'Lieutenant Commander\'s Dreadweave Mantle', 17573, 'Champion\'s Dreadweave Shoulders'), +(16405, 'Knight-Lieutenant\'s Plate Boots', 16509, 'Blood Guard\'s Plate Boots'), +(16406, 'Knight-Lieutenant\'s Plate Gauntlets', 16510, 'Blood Guard\'s Plate Gloves'), +(16429, 'Lieutenant Commander\'s Plate Helm',16514, 'Champion\'s Plate Headguard'), +(16430, 'Knight-Captain\'s Plate Chestguard', 16513, 'Legionnaire\'s Plate Armor'), +(16431, 'Knight-Captain\'s Plate Leggings', 16515, 'Legionnaire\'s Plate Legguards'), +(16432, 'Lieutenant Commander\'s Plate Pauldrons', 16516, 'Champion\'s Plate Pauldrons'); From bf04f280d21494572552d3fd8f3af0fa5ff85f76 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 13 Jun 2022 17:44:06 +0000 Subject: [PATCH 059/104] chore(DB): import pending files Referenced commit(s): 077068802538094596f13390746b9d3ab1da262d --- .../pvp58factionchangeitems.sql => db_world/2022_06_13_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/pvp58factionchangeitems.sql => db_world/2022_06_13_04.sql} (98%) diff --git a/data/sql/updates/pending_db_world/pvp58factionchangeitems.sql b/data/sql/updates/db_world/2022_06_13_04.sql similarity index 98% rename from data/sql/updates/pending_db_world/pvp58factionchangeitems.sql rename to data/sql/updates/db_world/2022_06_13_04.sql index 6d808791c..72d90fe66 100644 --- a/data/sql/updates/pending_db_world/pvp58factionchangeitems.sql +++ b/data/sql/updates/db_world/2022_06_13_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_13_03 -> 2022_06_13_04 DELETE FROM `player_factionchange_items` WHERE `alliance_id` IN (16393, 16397, 16423, 16422, 16424, 16421, 16401, 16403, 16425, 16426, 16427, 16428, 16369, 16391, 16413, 16414, 16415, 16416, 17594, 17596, 17598, 17599, 17600, 17601) OR `horde_id` IN (16498, 16499, 16505, 16506, 16507, 16508, 17570, 17571, 17572, 17573, 17576, 17577, 16509, 16510, 16513, 16514, 16515, 16516, 16494, 16496, 16501, 16503, 16504); INSERT INTO `player_factionchange_items` (`alliance_id`, `alliance_comment`, `horde_id`, `horde_comment`) VALUES (16393, 'Knight-Lieutenant\'s Dragonhide Footwraps', 16494, 'Blood Guard\'s Dragonhide Boots'), From 32334f5f14b8ffca1357d62953fadcbc7c4b6879 Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Tue, 14 Jun 2022 00:40:29 +0200 Subject: [PATCH 060/104] refactor(Core/Unit): minor changes for the combat system (#11904) Cherry-pick from TC: https://github.com/TrinityCore/TrinityCore/pull/19966 Co-authored-by: Treeston --- src/server/game/AI/CreatureAI.cpp | 16 +++------- src/server/game/AI/CreatureAI.h | 2 +- .../game/AI/ScriptedAI/ScriptedCreature.cpp | 2 +- .../game/AI/SmartScripts/SmartScript.cpp | 32 +++++++++---------- .../game/Entities/Creature/Creature.cpp | 9 +++--- .../game/Entities/Creature/CreatureGroups.cpp | 2 +- .../game/Entities/Creature/CreatureGroups.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Entities/Unit/Unit.h | 10 ++++-- src/server/game/Spells/SpellEffects.cpp | 2 +- .../boss_priestess_delrissa.cpp | 2 +- 11 files changed, 39 insertions(+), 42 deletions(-) diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 78ae7cb46..61ca3c80a 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -134,14 +134,6 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/, float maxRange { creature->AddThreat(player, 0.0f); } - - /* Causes certain things to never leave the threat list (Priest Lightwell, etc): - for (Unit::ControlSet::const_iterator itr = player->m_Controlled.begin(); itr != player->m_Controlled.end(); ++itr) - { - creature->SetInCombatWith(*itr); - (*itr)->SetInCombatWith(creature); - creature->AddThreat(*itr, 0.0f); - }*/ } } } @@ -161,7 +153,7 @@ void CreatureAI::MoveInLineOfSight_Safe(Unit* who) void CreatureAI::MoveInLineOfSight(Unit* who) { - if (me->GetVictim()) + if (me->IsEngaged()) return; // pussywizard: civilian, non-combat pet or any other NOT HOSTILE TO ANYONE (!) @@ -182,7 +174,7 @@ void CreatureAI::TriggerAlert(Unit const* who) const if (!who || who->GetTypeId() != TYPEID_PLAYER) return; // If this unit isn't an NPC, is already distracted, is in combat, is confused, stunned or fleeing, do nothing - if (me->GetTypeId() != TYPEID_UNIT || me->IsInCombat() || me->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING | UNIT_STATE_DISTRACTED)) + if (me->GetTypeId() != TYPEID_UNIT || me->IsEngaged() || me->HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_STUNNED | UNIT_STATE_FLEEING | UNIT_STATE_DISTRACTED)) return; // Only alert for hostiles! if (me->IsCivilian() || me->HasReactState(REACT_PASSIVE) || !me->IsHostileTo(who) || !me->_IsTargetAcceptable(who)) @@ -253,7 +245,7 @@ void CreatureAI::SetGazeOn(Unit* target) bool CreatureAI::UpdateVictimWithGaze() { - if (!me->IsInCombat()) + if (!me->IsEngaged()) return false; if (me->HasReactState(REACT_PASSIVE)) @@ -271,7 +263,7 @@ bool CreatureAI::UpdateVictimWithGaze() bool CreatureAI::UpdateVictim() { - if (!me->IsInCombat()) + if (!me->IsEngaged()) return false; if (!me->HasReactState(REACT_PASSIVE)) diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 6fac18ba3..e74b065a9 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -114,7 +114,7 @@ public: // Called for reaction at stopping attack at no attackers or targets virtual void EnterEvadeMode(EvadeReason why = EVADE_REASON_OTHER); - // Called for reaction at enter to combat if not in combat yet (enemy can be nullptr) + // Called for reaction when initially engaged virtual void EnterCombat(Unit* /*victim*/) {} // Called when the creature is killed diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index a0b29741b..85b3c39f5 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -574,7 +574,7 @@ void BossAI::TeleportCheaters() void BossAI::JustSummoned(Creature* summon) { summons.Summon(summon); - if (me->IsInCombat()) + if (me->IsEngaged()) DoZoneInCombat(summon); } diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index fe49a3479..1f8cb7030 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -4044,18 +4044,18 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); break; case SMART_EVENT_UPDATE_OOC: - if (me && me->IsInCombat()) + if (me && me->IsEngaged()) return; ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); break; case SMART_EVENT_UPDATE_IC: - if (!me || !me->IsInCombat()) + if (!me || !me->IsEngaged()) return; ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); break; case SMART_EVENT_HEALTH_PCT: { - if (!me || !me->IsInCombat() || !me->GetMaxHealth()) + if (!me || !me->IsEngaged() || !me->GetMaxHealth()) return; uint32 perc = (uint32)me->GetHealthPct(); if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) @@ -4065,7 +4065,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_HEALTH_PCT: { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth()) + if (!me || !me->IsEngaged() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth()) return; uint32 perc = (uint32)me->GetVictim()->GetHealthPct(); if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) @@ -4075,7 +4075,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_MANA_PCT: { - if (!me || !me->IsInCombat() || !me->GetMaxPower(POWER_MANA)) + if (!me || !me->IsEngaged() || !me->GetMaxPower(POWER_MANA)) return; uint32 perc = uint32(me->GetPowerPct(POWER_MANA)); if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) @@ -4085,7 +4085,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_MANA_PCT: { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA)) + if (!me || !me->IsEngaged() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA)) return; uint32 perc = uint32(me->GetVictim()->GetPowerPct(POWER_MANA)); if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) @@ -4095,7 +4095,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_RANGE: { - if (!me || !me->IsInCombat() || !me->GetVictim()) + if (!me || !me->IsEngaged() || !me->GetVictim()) return; if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max)) @@ -4106,7 +4106,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_VICTIM_CASTING: { - if (!me || !me->IsInCombat()) + if (!me || !me->IsEngaged()) return; Unit* victim = me->GetVictim(); @@ -4124,7 +4124,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_FRIENDLY_HEALTH: { - if (!me || !me->IsInCombat()) + if (!me || !me->IsEngaged()) return; Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealth.radius, e.event.friendlyHealth.hpDeficit); @@ -4139,7 +4139,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_FRIENDLY_IS_CC: { - if (!me || !me->IsInCombat()) + if (!me || !me->IsEngaged()) return; std::list pList; @@ -4285,7 +4285,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_OOC_LOS: { - if (!me || me->IsInCombat()) + if (!me || me->IsEngaged()) return; //can trigger if closer than fMaxAllowedRange float range = (float)e.event.los.maxDist; @@ -4309,7 +4309,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_IC_LOS: { - if (!me || !me->IsInCombat()) + if (!me || !me->IsEngaged()) return; //can trigger if closer than fMaxAllowedRange float range = (float)e.event.los.maxDist; @@ -4507,7 +4507,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_FRIENDLY_HEALTH_PCT: { - if (!me || !me->IsInCombat()) + if (!me || !me->IsEngaged()) return; Unit* target = nullptr; @@ -4701,10 +4701,10 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) if (e.event.event_phase_mask && !IsInPhase(e.event.event_phase_mask)) return; - if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat())) + if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsEngaged())) return; - if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat()))//can be used with me=nullptr (go script) + if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsEngaged()))//can be used with me=nullptr (go script) return; if (e.timer < diff) @@ -4982,7 +4982,7 @@ void SmartScript::OnMoveInLineOfSight(Unit* who) if (!me) return; - ProcessEventsFor(me->IsInCombat() ? SMART_EVENT_IC_LOS : SMART_EVENT_OOC_LOS, who); + ProcessEventsFor(me->IsEngaged() ? SMART_EVENT_IC_LOS : SMART_EVENT_OOC_LOS, who); } /* diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index ca2da341d..50dc8391d 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -704,7 +704,7 @@ void Creature::Update(uint32 diff) } // periodic check to see if the creature has passed an evade boundary - if (IsAIEnabled && !IsInEvadeMode() && IsInCombat()) + if (IsAIEnabled && !IsInEvadeMode() && IsEngaged()) { if (diff >= m_boundaryCheckTime) { @@ -1838,7 +1838,7 @@ bool Creature::CanStartAttack(Unit const* who) const // pussywizard: at this point we are either hostile to who or friendly to who->getAttackerForHelper() // pussywizard: if who is in combat and has an attacker, help him if the distance is right (help because who is hostile or help because attacker is friendly) bool assist = false; - if (who->IsInCombat() && IsWithinDist(who, ATTACK_DISTANCE)) + if (who->IsEngaged() && IsWithinDist(who, ATTACK_DISTANCE)) if (Unit* victim = who->getAttackerForHelper()) if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))) assist = true; @@ -2357,7 +2357,7 @@ bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction / return false; // skip fighting creature - if (IsInCombat()) + if (IsEngaged()) return false; // only free creature @@ -2408,11 +2408,10 @@ bool Creature::_IsTargetAcceptable(Unit const* target) const return false; } - Unit const* myVictim = getAttackerForHelper(); Unit const* targetVictim = target->getAttackerForHelper(); // if I'm already fighting target, or I'm hostile towards the target, the target is acceptable - if (myVictim == target || targetVictim == this || IsHostileTo(target)) + if (IsEngagedBy(target) || IsHostileTo(target)) return true; // if the target's victim is friendly, and the target is neutral, the target is acceptable diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 6bfcb211f..daaf52be0 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -190,7 +190,7 @@ void CreatureGroup::RemoveMember(Creature* member) member->SetFormation(nullptr); } -void CreatureGroup::MemberAttackStart(Creature* member, Unit* target) +void CreatureGroup::MemberEngagingTarget(Creature* member, Unit* target) { uint8 const groupAI = sFormationMgr->CreatureGroupMap[member->GetSpawnId()].groupAI; if (member == m_leader) diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index 26c4826ef..6cc3157b8 100644 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -106,7 +106,7 @@ public: void FormationReset(bool dismiss, bool initMotionMaster); void LeaderMoveTo(float x, float y, float z, bool run); - void MemberAttackStart(Creature* member, Unit* target); + void MemberEngagingTarget(Creature* member, Unit* target); void MemberEvaded(Creature* member); private: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 7f55ca149..4f972f3b9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13150,7 +13150,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy, uint32 duration) creature->AI()->EnterCombat(enemy); if (creature->GetFormation()) - creature->GetFormation()->MemberAttackStart(creature, enemy); + creature->GetFormation()->MemberEngagingTarget(creature, enemy); } creature->RefreshSwimmingFlag(); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 55b133428..b08456ad7 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1326,6 +1326,7 @@ public: bool IsWithinCombatRange(Unit const* obj, float dist2compare) const; bool IsWithinMeleeRange(Unit const* obj, float dist = 0.f) const; float GetMeleeRange(Unit const* target) const; + [[nodiscard]] virtual SpellSchoolMask GetMeleeDamageSchoolMask() const; bool GetRandomContactPoint(Unit const* target, float& x, float& y, float& z, bool force = false) const; uint32 m_extraAttacks; bool m_canDualWield; @@ -1343,6 +1344,9 @@ public: if (GetVictim() != nullptr) return GetVictim(); + if (!IsEngaged()) + return nullptr; + if (!m_attackers.empty()) return *(m_attackers.begin()); @@ -1643,6 +1647,9 @@ public: [[nodiscard]] bool IsInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); } + bool IsEngaged() const { return IsInCombat(); } + bool IsEngagedBy(Unit const* who) const { return IsInCombatWith(who); } + [[nodiscard]] bool IsInCombat() const { return HasUnitFlag(UNIT_FLAG_IN_COMBAT); } bool IsInCombatWith(Unit const* who) const; @@ -2103,6 +2110,7 @@ public: void TauntApply(Unit* victim); void TauntFadeOut(Unit* taunter); ThreatMgr& GetThreatMgr() { return m_ThreatMgr; } + ThreatMgr const& GetThreatMgr() const { return m_ThreatMgr; } void addHatedBy(HostileReference* pHostileReference) { m_HostileRefMgr.insertFirst(pHostileReference); }; void removeHatedBy(HostileReference* /*pHostileReference*/) { /* nothing to do yet */ } HostileRefMgr& getHostileRefMgr() { return m_HostileRefMgr; } @@ -2473,8 +2481,6 @@ protected: CharmInfo* m_charmInfo; SharedVisionList m_sharedVision; - [[nodiscard]] virtual SpellSchoolMask GetMeleeDamageSchoolMask() const; - MotionMaster* i_motionMaster; uint32 m_reactiveTimer[MAX_REACTIVE]; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 2fb4afd0b..c240f62c5 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2677,7 +2677,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/) return; // Check for possible target - if (!unitTarget || unitTarget->IsInCombat()) + if (!unitTarget || unitTarget->IsEngaged()) return; // target must be OK to do this diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 32b16bb08..43796d624 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -339,7 +339,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI void EnterCombat(Unit* who) override { if (Creature* delrissa = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_DELRISSA))) - if (delrissa->IsAlive() && !delrissa->IsInCombat()) + if (delrissa->IsAlive() && !delrissa->IsEngaged()) delrissa->AI()->AttackStart(who); events.ScheduleEvent(EVENT_SPELL_HELPER_HEALING_POTION, 1000); From 7e703393d2ee94aa35e269fa5e7cca826126fd0d Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 13 Jun 2022 19:44:20 -0300 Subject: [PATCH 061/104] fix(Core/ZG): Multiple improvements to High Priestess Mar'li (#11647) --- .../rev_1651792914774493500.sql | 21 + .../EasternKingdoms/ZulGurub/boss_marli.cpp | 472 +++++++++++------- .../ZulGurub/instance_zulgurub.cpp | 12 +- .../EasternKingdoms/ZulGurub/zulgurub.h | 2 + 4 files changed, 314 insertions(+), 193 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1651792914774493500.sql diff --git a/data/sql/updates/pending_db_world/rev_1651792914774493500.sql b/data/sql/updates/pending_db_world/rev_1651792914774493500.sql new file mode 100644 index 000000000..15c565742 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1651792914774493500.sql @@ -0,0 +1,21 @@ +-- +DELETE FROM `spell_dbc` WHERE `ID` = 24081; +INSERT INTO `spell_dbc` (`ID`, `Category`, `DispelType`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `ShapeshiftMask`, `unk_320_2`, `ShapeshiftExclude`, `unk_320_3`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags`, `ChannelInterruptFlags`, `ProcTypeMask`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `PowerType`, `ManaCost`, `ManaCostPerLevel`, `ManaPerSecond`, `ManaPerSecondPerLevel`, `RangeIndex`, `Speed`, `ModalNextSpell`, `CumulativeAura`, `Totem_1`, `Totem_2`, `Reagent_1`, `Reagent_2`, `Reagent_3`, `Reagent_4`, `Reagent_5`, `Reagent_6`, `Reagent_7`, `Reagent_8`, `ReagentCount_1`, `ReagentCount_2`, `ReagentCount_3`, `ReagentCount_4`, `ReagentCount_5`, `ReagentCount_6`, `ReagentCount_7`, `ReagentCount_8`, `EquippedItemClass`, `EquippedItemSubclass`, `EquippedItemInvTypes`, `Effect_1`, `Effect_2`, `Effect_3`, `EffectDieSides_1`, `EffectDieSides_2`, `EffectDieSides_3`, `EffectRealPointsPerLevel_1`, `EffectRealPointsPerLevel_2`, `EffectRealPointsPerLevel_3`, `EffectBasePoints_1`, `EffectBasePoints_2`, `EffectBasePoints_3`, `EffectMechanic_1`, `EffectMechanic_2`, `EffectMechanic_3`, `ImplicitTargetA_1`, `ImplicitTargetA_2`, `ImplicitTargetA_3`, `ImplicitTargetB_1`, `ImplicitTargetB_2`, `ImplicitTargetB_3`, `EffectRadiusIndex_1`, `EffectRadiusIndex_2`, `EffectRadiusIndex_3`, `EffectAura_1`, `EffectAura_2`, `EffectAura_3`, `EffectAuraPeriod_1`, `EffectAuraPeriod_2`, `EffectAuraPeriod_3`, `EffectMultipleValue_1`, `EffectMultipleValue_2`, `EffectMultipleValue_3`, `EffectChainTargets_1`, `EffectChainTargets_2`, `EffectChainTargets_3`, `EffectItemType_1`, `EffectItemType_2`, `EffectItemType_3`, `EffectMiscValue_1`, `EffectMiscValue_2`, `EffectMiscValue_3`, `EffectMiscValueB_1`, `EffectMiscValueB_2`, `EffectMiscValueB_3`, `EffectTriggerSpell_1`, `EffectTriggerSpell_2`, `EffectTriggerSpell_3`, `EffectPointsPerCombo_1`, `EffectPointsPerCombo_2`, `EffectPointsPerCombo_3`, `EffectSpellClassMaskA_1`, `EffectSpellClassMaskA_2`, `EffectSpellClassMaskA_3`, `EffectSpellClassMaskB_1`, `EffectSpellClassMaskB_2`, `EffectSpellClassMaskB_3`, `EffectSpellClassMaskC_1`, `EffectSpellClassMaskC_2`, `EffectSpellClassMaskC_3`, `SpellVisualID_1`, `SpellVisualID_2`, `SpellIconID`, `ActiveIconID`, `SpellPriority`, `Name_Lang_enUS`, `Name_Lang_enGB`, `Name_Lang_koKR`, `Name_Lang_frFR`, `Name_Lang_deDE`, `Name_Lang_enCN`, `Name_Lang_zhCN`, `Name_Lang_enTW`, `Name_Lang_zhTW`, `Name_Lang_esES`, `Name_Lang_esMX`, `Name_Lang_ruRU`, `Name_Lang_ptPT`, `Name_Lang_ptBR`, `Name_Lang_itIT`, `Name_Lang_Unk`, `Name_Lang_Mask`, `NameSubtext_Lang_enUS`, `NameSubtext_Lang_enGB`, `NameSubtext_Lang_koKR`, `NameSubtext_Lang_frFR`, `NameSubtext_Lang_deDE`, `NameSubtext_Lang_enCN`, `NameSubtext_Lang_zhCN`, `NameSubtext_Lang_enTW`, `NameSubtext_Lang_zhTW`, `NameSubtext_Lang_esES`, `NameSubtext_Lang_esMX`, `NameSubtext_Lang_ruRU`, `NameSubtext_Lang_ptPT`, `NameSubtext_Lang_ptBR`, `NameSubtext_Lang_itIT`, `NameSubtext_Lang_Unk`, `NameSubtext_Lang_Mask`, `Description_Lang_enUS`, `Description_Lang_enGB`, `Description_Lang_koKR`, `Description_Lang_frFR`, `Description_Lang_deDE`, `Description_Lang_enCN`, `Description_Lang_zhCN`, `Description_Lang_enTW`, `Description_Lang_zhTW`, `Description_Lang_esES`, `Description_Lang_esMX`, `Description_Lang_ruRU`, `Description_Lang_ptPT`, `Description_Lang_ptBR`, `Description_Lang_itIT`, `Description_Lang_Unk`, `Description_Lang_Mask`, `AuraDescription_Lang_enUS`, `AuraDescription_Lang_enGB`, `AuraDescription_Lang_koKR`, `AuraDescription_Lang_frFR`, `AuraDescription_Lang_deDE`, `AuraDescription_Lang_enCN`, `AuraDescription_Lang_zhCN`, `AuraDescription_Lang_enTW`, `AuraDescription_Lang_zhTW`, `AuraDescription_Lang_esES`, `AuraDescription_Lang_esMX`, `AuraDescription_Lang_ruRU`, `AuraDescription_Lang_ptPT`, `AuraDescription_Lang_ptBR`, `AuraDescription_Lang_itIT`, `AuraDescription_Lang_Unk`, `AuraDescription_Lang_Mask`, `ManaCostPct`, `StartRecoveryCategory`, `StartRecoveryTime`, `MaxTargetLevel`, `SpellClassSet`, `SpellClassMask_1`, `SpellClassMask_2`, `SpellClassMask_3`, `MaxTargets`, `DefenseType`, `PreventionType`, `StanceBarOrder`, `EffectChainAmplitude_1`, `EffectChainAmplitude_2`, `EffectChainAmplitude_3`, `MinFactionID`, `MinReputation`, `RequiredAuraVision`, `RequiredTotemCategoryID_1`, `RequiredTotemCategoryID_2`, `RequiredAreasID`, `SchoolMask`, `RuneCostID`, `SpellMissileID`, `PowerDisplayID`, `EffectBonusMultiplier_1`, `EffectBonusMultiplier_2`, `EffectBonusMultiplier_3`, `SpellDescriptionVariableID`, `SpellDifficultyID`) VALUES +(24081, 0, 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 28, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 15041, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Summon Spawn of Mar\'li', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_hatch_eggs', 'spell_enveloping_webs', 'spell_marli_transform'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(24083, 'spell_hatch_eggs'), +(24110, 'spell_enveloping_webs'), +(24084, 'spell_marli_transform'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 15041; +DELETE FROM `creature_text` WHERE `CreatureID` = 14510 AND `GroupID` = 4; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(15041, 0, 0, '%s is fully grown!', 16, 0, 100, 0, 0, 0, 10445, 0, 'Spawn of Mar\'li - EMOTE_FULL_GROWN'), +(14510, 4, 0, 'The brood shall not fall!', 14, 0, 100, 0, 0, 0, 10444, 0, 'Mar\'li - SAY_TRANSFORM_BACK'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` IN (24082, 24083); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 24082, 0, 0, 31, 0, 5, 179985, 0, 0, 0, 0, '', 'Hatch Spider Egg targets Spider Egg'), +(13, 1, 24083, 0, 0, 31, 0, 5, 179985, 0, 0, 0, 0, '', 'Hatch Eggs targets Spider Egg'); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 140c99c23..6748979a8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -15,45 +15,72 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Marli -SD%Complete: 80 -SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers. -SDCategory: Zul'Gurub -EndScriptData */ - +#include "GameObjectAI.h" +#include "SpellScript.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "TaskScheduler.h" #include "zulgurub.h" enum Says { + // Mar'li SAY_AGGRO = 0, SAY_TRANSFORM = 1, SAY_SPIDER_SPAWN = 2, - SAY_DEATH = 3 + SAY_DEATH = 3, + SAY_TRANSFORM_BACK = 4, + + // Spawn of Mar'li + EMOTE_FULL_GROWN = 0 }; enum Spells { + // Spider form SPELL_CHARGE = 22911, - SPELL_ASPECT_OF_MARLI = 24686, // A stun spell - SPELL_ENVOLWINGWEB = 24110, + SPELL_ENVELOPING_WEB = 24110, + SPELL_CORROSIVE_POISON = 24111, + SPELL_POISON_SHOCK = 24112, + + //Troll form SPELL_POISON_VOLLEY = 24099, + SPELL_DRAIN_LIFE = 24300, + SPELL_ENLARGE = 24109, + SPELL_SPIDER_EGGS = 24082, + + // All SPELL_SPIDER_FORM = 24084, - // The Spider Spell - SPELL_LEVELUP = 24312 // Not right Spell. + SPELL_TRANSFORM_BACK = 24085, + SPELL_THRASH = 3391, + SPELL_HATCH_SPIDER_EGG = 24082, + SPELL_HATCH_EGGS = 24083, + + // Spawn of Mar'li + SPELL_GROWTH = 24086, + SPELL_FULL_GROWN = 24088 }; enum Events { - EVENT_SPAWN_START_SPIDERS = 1, // Phase 1 - EVENT_POISON_VOLLEY = 2, // Phase All - EVENT_SPAWN_SPIDER = 3, // Phase All - EVENT_CHARGE_PLAYER = 4, // Phase 3 - EVENT_ASPECT_OF_MARLI = 5, // Phase 2 - EVENT_TRANSFORM = 6, // Phase 2 - EVENT_TRANSFORM_BACK = 7 // Phase 3 + // Spider form + EVENT_CHARGE_PLAYER = 7, + EVENT_ENVELOPING_WEB = 8, + EVENT_CORROSIVE_POISON = 9, + EVENT_POISON_SHOCK = 10, + + // Troll form + EVENT_POISON_VOLLEY = 11, + EVENT_DRAIN_LIFE = 12, + EVENT_ENLARGE = 13, + + // All + EVENT_SPAWN_START_SPIDERS = 1, + EVENT_TRANSFORM = 2, + EVENT_TRANSFORM_BACK = 3, + EVENT_HATCH_SPIDER_EGG = 4, + EVENT_THRASH = 5, + EVENT_TALK_FIRST_SPIDERS = 6, }; enum Phases @@ -63,208 +90,269 @@ enum Phases PHASE_THREE = 3 }; -class boss_marli : public CreatureScript +enum Misc { -public: - boss_marli() : CreatureScript("boss_marli") { } + GO_SPIDER_EGGS = 179985, +}; - struct boss_marliAI : public BossAI +struct boss_marli : public BossAI +{ + boss_marli(Creature* creature) : BossAI(creature, DATA_MARLI) { } + + void Reset() override { - boss_marliAI(Creature* creature) : BossAI(creature, DATA_MARLI) { } + if (events.IsInPhase(PHASE_THREE)) + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack - void Reset() override + std::list eggs; + me->GetGameObjectListWithEntryInGrid(eggs, GO_SPIDER_EGGS, DEFAULT_VISIBILITY_INSTANCE); + + for (auto const& egg : eggs) { - if (events.IsInPhase(PHASE_THREE)) - me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack - _Reset(); + egg->Respawn(); + egg->UpdateObjectVisibility(); } - void JustDied(Unit* /*killer*/) override + BossAI::Reset(); + } + + void JustDied(Unit* killer) override + { + BossAI::JustDied(killer); + Talk(SAY_DEATH); + } + + void EnterCombat(Unit* who) override + { + BossAI::EnterCombat(who); + events.ScheduleEvent(EVENT_SPAWN_START_SPIDERS, 1000, 0, PHASE_ONE); + Talk(SAY_AGGRO); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - _JustDied(); - Talk(SAY_DEATH); - } - - void EnterCombat(Unit* /*who*/) override - { - _EnterCombat(); - events.ScheduleEvent(EVENT_SPAWN_START_SPIDERS, 1000, 0, PHASE_ONE); - Talk(SAY_AGGRO); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) + switch (eventId) { - switch (eventId) + case EVENT_SPAWN_START_SPIDERS: + events.ScheduleEvent(EVENT_TALK_FIRST_SPIDERS, 500, 0, PHASE_TWO); + DoCastAOE(SPELL_HATCH_EGGS); + events.ScheduleEvent(EVENT_TRANSFORM, 60000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_POISON_VOLLEY, 15000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_HATCH_SPIDER_EGG, 30000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_DRAIN_LIFE, 30000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_THRASH, urand(4000, 6000)); // all phases + events.ScheduleEvent(EVENT_ENLARGE, urand(10000, 20000), 0, PHASE_TWO); + events.SetPhase(PHASE_TWO); + break; + case EVENT_TALK_FIRST_SPIDERS: + Talk(SAY_SPIDER_SPAWN); + break; + case EVENT_POISON_VOLLEY: + DoCastVictim(SPELL_POISON_VOLLEY, true); + events.ScheduleEvent(EVENT_POISON_VOLLEY, urand(10000, 20000), 0, PHASE_TWO); + break; + case EVENT_HATCH_SPIDER_EGG: + DoCastSelf(SPELL_HATCH_SPIDER_EGG, true); + events.ScheduleEvent(EVENT_HATCH_SPIDER_EGG, 20000, 0, PHASE_TWO); + break; + case EVENT_DRAIN_LIFE: + DoCastRandomTarget(SPELL_DRAIN_LIFE); + events.ScheduleEvent(EVENT_DRAIN_LIFE, urand(20000, 50000), 0, PHASE_TWO); + break; + case EVENT_ENLARGE: { - case EVENT_SPAWN_START_SPIDERS: - - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - Talk(SAY_SPIDER_SPAWN); - Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - } - events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, 12000, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_TRANSFORM, 45000, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_POISON_VOLLEY, 15000); - events.ScheduleEvent(EVENT_SPAWN_SPIDER, 30000); - events.ScheduleEvent(EVENT_TRANSFORM, 45000, 0, PHASE_TWO); - events.SetPhase(PHASE_TWO); - break; - case EVENT_POISON_VOLLEY: - DoCastVictim(SPELL_POISON_VOLLEY, true); - events.ScheduleEvent(EVENT_POISON_VOLLEY, urand(10000, 20000)); - break; - case EVENT_ASPECT_OF_MARLI: - DoCastVictim(SPELL_ASPECT_OF_MARLI, true); - events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, urand(13000, 18000), 0, PHASE_TWO); - break; - case EVENT_SPAWN_SPIDER: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - Creature* Spider = me->SummonCreature(15041, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - } - events.ScheduleEvent(EVENT_SPAWN_SPIDER, urand(12000, 17000)); - break; - case EVENT_TRANSFORM: - { - Talk(SAY_TRANSFORM); - DoCast(me, SPELL_SPIDER_FORM); // SPELL_AURA_TRANSFORM - /* - CreatureTemplate const* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - */ - me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, true); // hack - DoCastVictim(SPELL_ENVOLWINGWEB); - if (DoGetThreat(me->GetVictim())) - DoModifyThreatPercent(me->GetVictim(), -100); - events.ScheduleEvent(EVENT_CHARGE_PLAYER, 1500, 0, PHASE_THREE); - events.ScheduleEvent(EVENT_TRANSFORM_BACK, 25000, 0, PHASE_THREE); - events.SetPhase(PHASE_THREE); - break; - } - case EVENT_CHARGE_PLAYER: - { - Unit* target = nullptr; - int i = 0; - while (i++ < 3) // max 3 tries to get a random target with power_mana - { - target = SelectTarget(SelectTargetMethod::Random, 1, 100, true); // not aggro leader - if (target && target->getPowerType() == POWER_MANA) - break; - } - if (target) - { - DoCast(target, SPELL_CHARGE); - AttackStart(target); - } - events.ScheduleEvent(EVENT_CHARGE_PLAYER, 8000, 0, PHASE_THREE); - break; - } - case EVENT_TRANSFORM_BACK: - { - me->RemoveAura(SPELL_SPIDER_FORM); - /* - CreatureTemplate const* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); - me->UpdateDamagePhysical(BASE_ATTACK); - */ - me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack - events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, 12000, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_TRANSFORM, 45000, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_POISON_VOLLEY, 15000); - events.ScheduleEvent(EVENT_SPAWN_SPIDER, 30000); - events.ScheduleEvent(EVENT_TRANSFORM, urand(35000, 60000), 0, PHASE_TWO); - events.SetPhase(PHASE_TWO); - break; - } - default: - break; + std::list targets = DoFindFriendlyMissingBuff(100.f, SPELL_ENLARGE); + if (targets.size() > 0) + DoCast(*(targets.begin()), SPELL_ENLARGE); + events.ScheduleEvent(EVENT_ENLARGE, urand(20000, 40000), 0, PHASE_TWO); + break; } + case EVENT_TRANSFORM: + Talk(SAY_TRANSFORM); + DoCastSelf(SPELL_SPIDER_FORM, true); + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, true); // hack + events.ScheduleEvent(EVENT_ENVELOPING_WEB, 5000, 0, PHASE_THREE); + events.ScheduleEvent(EVENT_CHARGE_PLAYER, 6000, 0, PHASE_THREE); + events.ScheduleEvent(EVENT_CORROSIVE_POISON, 1000, 0, PHASE_THREE); + events.ScheduleEvent(EVENT_POISON_SHOCK, urand(5000, 10000), 0, PHASE_THREE); + events.ScheduleEvent(EVENT_TRANSFORM_BACK, 60000, 0, PHASE_THREE); + events.SetPhase(PHASE_THREE); + break; + case EVENT_ENVELOPING_WEB: + DoCastAOE(SPELL_ENVELOPING_WEB); + events.ScheduleEvent(EVENT_CHARGE_PLAYER, 500, 0, PHASE_THREE); + events.ScheduleEvent(EVENT_ENVELOPING_WEB, urand(15000, 20000), 0, PHASE_THREE); + break; + case EVENT_CHARGE_PLAYER: + { + Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [this](Unit* target) -> bool + { + if (target->GetTypeId() != TYPEID_PLAYER || target->getPowerType() != Powers::POWER_MANA) + return false; + if (me->IsWithinMeleeRange(target) || me->GetVictim() == target) + return false; + return true; + }); + if (target) + { + DoCast(target, SPELL_CHARGE); + AttackStart(target); + } + break; + } + case EVENT_CORROSIVE_POISON: + DoCastVictim(SPELL_CORROSIVE_POISON); + events.ScheduleEvent(EVENT_CORROSIVE_POISON, urand(25000, 35000), 0, PHASE_THREE); + break; + case EVENT_POISON_SHOCK: + DoCastRandomTarget(SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_POISON_SHOCK, 10000, 0, PHASE_THREE); + break; + case EVENT_TRANSFORM_BACK: + me->RemoveAura(SPELL_SPIDER_FORM); + DoCastSelf(SPELL_TRANSFORM_BACK, true); + Talk(SAY_TRANSFORM_BACK); + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack + events.ScheduleEvent(EVENT_TRANSFORM, 60000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_POISON_VOLLEY, 15000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_HATCH_SPIDER_EGG, 30000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_DRAIN_LIFE, 30000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_ENLARGE, urand(10000, 20000), 0, PHASE_TWO); + events.SetPhase(PHASE_TWO); + break; + case EVENT_THRASH: + DoCastVictim(SPELL_THRASH); + events.ScheduleEvent(EVENT_THRASH, urand(10000, 20000)); + break; + default: + break; } - - DoMeleeAttackIfReady(); } - }; - CreatureAI* GetAI(Creature* creature) const override - { - return GetZulGurubAI(creature); + DoMeleeAttackIfReady(); } }; -// Spawn of Marli -class npc_spawn_of_marli : public CreatureScript +// Spawn of Mar'li +struct npc_spawn_of_marli : public ScriptedAI { -public: - npc_spawn_of_marli() : CreatureScript("npc_spawn_of_marli") { } + npc_spawn_of_marli(Creature* creature) : ScriptedAI(creature) { } - struct npc_spawn_of_marliAI : public ScriptedAI + void Reset() override { - npc_spawn_of_marliAI(Creature* creature) : ScriptedAI(creature) { } + _scheduler.CancelAll(); + } - uint32 LevelUp_Timer; - - void Reset() override + void EnterCombat(Unit* /*who*/) override + { + _scheduler.Schedule(4s, [this](TaskContext context) { - LevelUp_Timer = 3000; - } - - void EnterCombat(Unit* /*who*/) override - { - } - - void UpdateAI(uint32 diff) override - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //LevelUp_Timer - if (LevelUp_Timer <= diff) + if (context.GetRepeatCounter() < 5) { - DoCast(me, SPELL_LEVELUP); - LevelUp_Timer = 3000; + DoCastSelf(SPELL_GROWTH); + context.Repeat(4s); } - else LevelUp_Timer -= diff; + else + { + Talk(EMOTE_FULL_GROWN); + DoCastSelf(SPELL_FULL_GROWN); + } + }); + } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const override + void UpdateAI(uint32 diff) override { - return GetZulGurubAI(creature); + //Return since we have no target + if (!UpdateVictim()) + return; + + _scheduler.Update(diff, [this] + { + DoMeleeAttackIfReady(); + }); + } + +private: + TaskScheduler _scheduler; +}; + +// 24083 - Hatch Eggs +class spell_hatch_eggs : public SpellScript +{ + PrepareSpellScript(spell_hatch_eggs); + + void HandleObjectAreaTargetSelect(std::list& targets) + { + targets.sort(Acore::ObjectDistanceOrderPred(GetCaster())); + targets.resize(GetSpellInfo()->MaxAffectedTargets); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hatch_eggs::HandleObjectAreaTargetSelect, EFFECT_0, TARGET_GAMEOBJECT_DEST_AREA); + } +}; + +// 24110 - Enveloping Webs +class spell_enveloping_webs : public SpellScript +{ + PrepareSpellScript(spell_enveloping_webs); + + void HandleOnHit() + { + Unit* caster = GetCaster(); + Unit* hitUnit = GetHitUnit(); + if (caster && hitUnit && hitUnit->GetTypeId() == TYPEID_PLAYER) + { + caster->GetThreatMgr().modifyThreatPercent(hitUnit, -100); + } + } + + void Register() override + { + OnHit += SpellHitFn(spell_enveloping_webs::HandleOnHit); + } +}; + +// 24084 - Mar'li Transform +class spell_marli_transform : public AuraScript +{ + PrepareAuraScript(spell_marli_transform); + + void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster() && GetCaster()->ToCreature()) + GetCaster()->ToCreature()->LoadEquipment(0, true); + } + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster() && GetCaster()->ToCreature()) + GetCaster()->ToCreature()->LoadEquipment(1, true); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_marli_transform::HandleApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_marli_transform::HandleRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); } }; void AddSC_boss_marli() { - new boss_marli(); - new npc_spawn_of_marli(); + RegisterCreatureAI(boss_marli); + RegisterCreatureAI(npc_spawn_of_marli); + RegisterSpellScript(spell_hatch_eggs); + RegisterSpellScript(spell_enveloping_webs); + RegisterSpellScript(spell_marli_transform); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index eee9e00cb..dcffbd4ff 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -36,7 +36,8 @@ ObjectData const creatureData[] = { { NPC_HIGH_PRIEST_THEKAL, DATA_THEKAL }, { NPC_ZEALOT_LORKHAN, DATA_LORKHAN }, - { NPC_ZEALOT_ZATH, DATA_ZATH } + { NPC_ZEALOT_ZATH, DATA_ZATH }, + { NPC_PRIESTESS_MARLI, DATA_MARLI } }; class instance_zulgurub : public InstanceMapScript @@ -49,6 +50,7 @@ public: instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) { SetBossNumber(EncounterCount); + LoadObjectData(creatureData, nullptr); LoadDoorData(doorData); LoadObjectData(creatureData, nullptr); } @@ -71,7 +73,15 @@ public: case NPC_HAKKAR: _hakkarGUID = creature->GetGUID(); break; + case NPC_SPAWN_OF_MARLI: + if (Creature* marli = GetCreature(DATA_MARLI)) + { + marli->AI()->JustSummoned(creature); + } + break; } + + InstanceScript::OnCreatureCreate(creature); } void OnGameObjectCreate(GameObject* go) override diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 79e40b4c4..4941fe85f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -49,6 +49,8 @@ enum CreatureIds NPC_ZULIAN_PROWLER = 15101, // Arlokk Event NPC_ZEALOT_LORKHAN = 11347, NPC_ZEALOT_ZATH = 11348, + NPC_PRIESTESS_MARLI = 14510, + NPC_SPAWN_OF_MARLI = 15041, NPC_HIGH_PRIEST_THEKAL = 14509, NPC_JINDO_THE_HEXXER = 11380, NPC_NIGHTMARE_ILLUSION = 15163, From 450b8f9157858ddd19cb67d3229956c3e24d8e98 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 13 Jun 2022 22:46:22 +0000 Subject: [PATCH 062/104] chore(DB): import pending files Referenced commit(s): 7e703393d2ee94aa35e269fa5e7cca826126fd0d --- .../rev_1651792914774493500.sql => db_world/2022_06_13_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1651792914774493500.sql => db_world/2022_06_13_05.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1651792914774493500.sql b/data/sql/updates/db_world/2022_06_13_05.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1651792914774493500.sql rename to data/sql/updates/db_world/2022_06_13_05.sql index 15c565742..7b6ea1b06 100644 --- a/data/sql/updates/pending_db_world/rev_1651792914774493500.sql +++ b/data/sql/updates/db_world/2022_06_13_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_13_04 -> 2022_06_13_05 -- DELETE FROM `spell_dbc` WHERE `ID` = 24081; INSERT INTO `spell_dbc` (`ID`, `Category`, `DispelType`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `ShapeshiftMask`, `unk_320_2`, `ShapeshiftExclude`, `unk_320_3`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags`, `ChannelInterruptFlags`, `ProcTypeMask`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `PowerType`, `ManaCost`, `ManaCostPerLevel`, `ManaPerSecond`, `ManaPerSecondPerLevel`, `RangeIndex`, `Speed`, `ModalNextSpell`, `CumulativeAura`, `Totem_1`, `Totem_2`, `Reagent_1`, `Reagent_2`, `Reagent_3`, `Reagent_4`, `Reagent_5`, `Reagent_6`, `Reagent_7`, `Reagent_8`, `ReagentCount_1`, `ReagentCount_2`, `ReagentCount_3`, `ReagentCount_4`, `ReagentCount_5`, `ReagentCount_6`, `ReagentCount_7`, `ReagentCount_8`, `EquippedItemClass`, `EquippedItemSubclass`, `EquippedItemInvTypes`, `Effect_1`, `Effect_2`, `Effect_3`, `EffectDieSides_1`, `EffectDieSides_2`, `EffectDieSides_3`, `EffectRealPointsPerLevel_1`, `EffectRealPointsPerLevel_2`, `EffectRealPointsPerLevel_3`, `EffectBasePoints_1`, `EffectBasePoints_2`, `EffectBasePoints_3`, `EffectMechanic_1`, `EffectMechanic_2`, `EffectMechanic_3`, `ImplicitTargetA_1`, `ImplicitTargetA_2`, `ImplicitTargetA_3`, `ImplicitTargetB_1`, `ImplicitTargetB_2`, `ImplicitTargetB_3`, `EffectRadiusIndex_1`, `EffectRadiusIndex_2`, `EffectRadiusIndex_3`, `EffectAura_1`, `EffectAura_2`, `EffectAura_3`, `EffectAuraPeriod_1`, `EffectAuraPeriod_2`, `EffectAuraPeriod_3`, `EffectMultipleValue_1`, `EffectMultipleValue_2`, `EffectMultipleValue_3`, `EffectChainTargets_1`, `EffectChainTargets_2`, `EffectChainTargets_3`, `EffectItemType_1`, `EffectItemType_2`, `EffectItemType_3`, `EffectMiscValue_1`, `EffectMiscValue_2`, `EffectMiscValue_3`, `EffectMiscValueB_1`, `EffectMiscValueB_2`, `EffectMiscValueB_3`, `EffectTriggerSpell_1`, `EffectTriggerSpell_2`, `EffectTriggerSpell_3`, `EffectPointsPerCombo_1`, `EffectPointsPerCombo_2`, `EffectPointsPerCombo_3`, `EffectSpellClassMaskA_1`, `EffectSpellClassMaskA_2`, `EffectSpellClassMaskA_3`, `EffectSpellClassMaskB_1`, `EffectSpellClassMaskB_2`, `EffectSpellClassMaskB_3`, `EffectSpellClassMaskC_1`, `EffectSpellClassMaskC_2`, `EffectSpellClassMaskC_3`, `SpellVisualID_1`, `SpellVisualID_2`, `SpellIconID`, `ActiveIconID`, `SpellPriority`, `Name_Lang_enUS`, `Name_Lang_enGB`, `Name_Lang_koKR`, `Name_Lang_frFR`, `Name_Lang_deDE`, `Name_Lang_enCN`, `Name_Lang_zhCN`, `Name_Lang_enTW`, `Name_Lang_zhTW`, `Name_Lang_esES`, `Name_Lang_esMX`, `Name_Lang_ruRU`, `Name_Lang_ptPT`, `Name_Lang_ptBR`, `Name_Lang_itIT`, `Name_Lang_Unk`, `Name_Lang_Mask`, `NameSubtext_Lang_enUS`, `NameSubtext_Lang_enGB`, `NameSubtext_Lang_koKR`, `NameSubtext_Lang_frFR`, `NameSubtext_Lang_deDE`, `NameSubtext_Lang_enCN`, `NameSubtext_Lang_zhCN`, `NameSubtext_Lang_enTW`, `NameSubtext_Lang_zhTW`, `NameSubtext_Lang_esES`, `NameSubtext_Lang_esMX`, `NameSubtext_Lang_ruRU`, `NameSubtext_Lang_ptPT`, `NameSubtext_Lang_ptBR`, `NameSubtext_Lang_itIT`, `NameSubtext_Lang_Unk`, `NameSubtext_Lang_Mask`, `Description_Lang_enUS`, `Description_Lang_enGB`, `Description_Lang_koKR`, `Description_Lang_frFR`, `Description_Lang_deDE`, `Description_Lang_enCN`, `Description_Lang_zhCN`, `Description_Lang_enTW`, `Description_Lang_zhTW`, `Description_Lang_esES`, `Description_Lang_esMX`, `Description_Lang_ruRU`, `Description_Lang_ptPT`, `Description_Lang_ptBR`, `Description_Lang_itIT`, `Description_Lang_Unk`, `Description_Lang_Mask`, `AuraDescription_Lang_enUS`, `AuraDescription_Lang_enGB`, `AuraDescription_Lang_koKR`, `AuraDescription_Lang_frFR`, `AuraDescription_Lang_deDE`, `AuraDescription_Lang_enCN`, `AuraDescription_Lang_zhCN`, `AuraDescription_Lang_enTW`, `AuraDescription_Lang_zhTW`, `AuraDescription_Lang_esES`, `AuraDescription_Lang_esMX`, `AuraDescription_Lang_ruRU`, `AuraDescription_Lang_ptPT`, `AuraDescription_Lang_ptBR`, `AuraDescription_Lang_itIT`, `AuraDescription_Lang_Unk`, `AuraDescription_Lang_Mask`, `ManaCostPct`, `StartRecoveryCategory`, `StartRecoveryTime`, `MaxTargetLevel`, `SpellClassSet`, `SpellClassMask_1`, `SpellClassMask_2`, `SpellClassMask_3`, `MaxTargets`, `DefenseType`, `PreventionType`, `StanceBarOrder`, `EffectChainAmplitude_1`, `EffectChainAmplitude_2`, `EffectChainAmplitude_3`, `MinFactionID`, `MinReputation`, `RequiredAuraVision`, `RequiredTotemCategoryID_1`, `RequiredTotemCategoryID_2`, `RequiredAreasID`, `SchoolMask`, `RuneCostID`, `SpellMissileID`, `PowerDisplayID`, `EffectBonusMultiplier_1`, `EffectBonusMultiplier_2`, `EffectBonusMultiplier_3`, `SpellDescriptionVariableID`, `SpellDifficultyID`) VALUES From 21705d76ad952fd6b2aab3664972ab7f3a8b2ae6 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 14 Jun 2022 02:03:56 +0200 Subject: [PATCH 063/104] fix(Scripts/ZulGurub): Improvements to Hazzarah encounter (#11964) Corrected timers of events. Added missing/Removed invalid spells. Fixes #11612 --- .../rev_1654439260971561400.sql | 4 + .../ZulGurub/boss_hazzarah.cpp | 108 +++++++++++++----- 2 files changed, 81 insertions(+), 31 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654439260971561400.sql diff --git a/data/sql/updates/pending_db_world/rev_1654439260971561400.sql b/data/sql/updates/pending_db_world/rev_1654439260971561400.sql new file mode 100644 index 000000000..d9814f281 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654439260971561400.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=24684; +INSERT INTO `spell_script_names` VALUES +(24684,'spell_chain_burn'); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index 136cd18be..d475bd966 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -24,19 +24,25 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "zulgurub.h" enum Spells { - SPELL_MANABURN = 26046, - SPELL_SLEEP = 24664 + SPELL_SLEEP = 24664, + SPELL_EARTH_SHOCK = 24685, + SPELL_CHAIN_BURN = 24684, + SPELL_SUMMON_NIGHTMARE_ILLUSION_LEFT = 24681, + SPELL_SUMMON_NIGHTMARE_ILLUSION_BACK = 24728, + SPELL_SUMMON_NIGHTMARE_ILLUSION_RIGHT = 24729 }; enum Events { - EVENT_MANABURN = 1, - EVENT_SLEEP = 2, - EVENT_ILLUSIONS = 3 + EVENT_SLEEP = 1, + EVENT_EARTH_SHOCK = 2, + EVENT_CHAIN_BURN = 3, + EVENT_ILLUSIONS = 4 }; class boss_hazzarah : public CreatureScript @@ -48,22 +54,42 @@ public: { boss_hazzarahAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { } - void Reset() override + void JustSummoned(Creature* summon) override { - _Reset(); - } + summons.Summon(summon); - void JustDied(Unit* /*killer*/) override - { - _JustDied(); + summon->SetCorpseDelay(10); + summon->SetReactState(REACT_PASSIVE); + summon->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE); + summon->SetVisible(false); + summon->m_Events.AddEventAtOffset([summon]() + { + summon->SetVisible(true); + }, 2s); + + summon->m_Events.AddEventAtOffset([summon]() + { + summon->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE); + summon->SetReactState(REACT_AGGRESSIVE); + summon->SetInCombatWithZone(); + }, 3500ms); } void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - events.ScheduleEvent(EVENT_MANABURN, urand(4000, 10000)); - events.ScheduleEvent(EVENT_SLEEP, urand(10000, 18000)); - events.ScheduleEvent(EVENT_ILLUSIONS, urand(10000, 18000)); + events.ScheduleEvent(EVENT_SLEEP, 12s, 15s); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s); + events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s); + events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s); + } + + bool CanAIAttack(Unit const* target) const override + { + if (me->GetThreatMgr().getThreatList().size() > 1 && me->GetThreatMgr().getOnlineContainer().getMostHated()->getTarget() == target) + return !target->HasAura(SPELL_SLEEP); + + return true; } void UpdateAI(uint32 diff) override @@ -80,27 +106,26 @@ public: { switch (eventId) { - case EVENT_MANABURN: - DoCastVictim(SPELL_MANABURN, true); - events.ScheduleEvent(EVENT_MANABURN, urand(8000, 16000)); - break; case EVENT_SLEEP: DoCastVictim(SPELL_SLEEP, true); - events.ScheduleEvent(EVENT_SLEEP, urand(12000, 20000)); + events.ScheduleEvent(EVENT_SLEEP, 24s, 32s); + return; + case EVENT_EARTH_SHOCK: + DoCastVictim(SPELL_EARTH_SHOCK); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 8s, 18s); + break; + case EVENT_CHAIN_BURN: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) { return u && !u->IsPet() && u->getPowerType() == POWER_MANA; })) + { + DoCast(target, SPELL_CHAIN_BURN, false); + } + events.ScheduleEvent(EVENT_CHAIN_BURN, 12s, 28s); break; case EVENT_ILLUSIONS: - // We will summon 3 illusions that will spawn on a random gamer and attack this gamer - // We will just use one model for the beginning - for (uint8 i = 0; i < 3; ++i) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - { - Creature* Illusion = me->SummonCreature(NPC_NIGHTMARE_ILLUSION, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Illusion) - Illusion->AI()->AttackStart(target); - } - } - events.ScheduleEvent(EVENT_ILLUSIONS, urand(15000, 25000)); + DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_LEFT, true); + DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_BACK, true); + DoCastSelf(SPELL_SUMMON_NIGHTMARE_ILLUSION_RIGHT, true); + events.ScheduleEvent(EVENT_ILLUSIONS, 16s, 24s); break; default: break; @@ -117,7 +142,28 @@ public: } }; +class spell_chain_burn : public SpellScript +{ + PrepareSpellScript(spell_chain_burn); + + void FilterTargets(std::list& targets) + { + Unit* caster = GetCaster(); + targets.remove_if([caster](WorldObject* target) -> bool + { + Unit* unit = target->ToUnit(); + return !unit || unit->getPowerType() != POWER_MANA || caster->GetVictim() == unit; + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_chain_burn::FilterTargets, EFFECT_0, TARGET_UNIT_TARGET_ENEMY); + } +}; + void AddSC_boss_hazzarah() { new boss_hazzarah(); + RegisterSpellScript(spell_chain_burn); } From d5221ae4236e21a5132999fe8fc2fcda0da9eb6c Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 14 Jun 2022 02:04:58 +0200 Subject: [PATCH 064/104] fix(Scripts/ZulGurub): Fixed Jindo's Brain Wash Totem. (#11839) --- src/server/game/Entities/Totem/Totem.cpp | 2 ++ .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 17 +++++++++++++++++ .../scripts/EasternKingdoms/ZulGurub/zulgurub.h | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index b41974cc5..d38619932 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -85,6 +85,8 @@ void Totem::InitStats(uint32 duration) void Totem::InitSummon() { + Minion::InitSummon(); + if (m_type == TOTEM_PASSIVE && GetSpell()) CastSpell(this, GetSpell(), true); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 2eb62367a..0b912aef1 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -86,6 +86,23 @@ public: Talk(SAY_AGGRO); } + void JustSummoned(Creature* summon) override + { + BossAI::JustSummoned(summon); + + switch (summon->GetEntry()) + { + case NPC_BRAIN_WASH_TOTEM: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1)) + { + summon->CastSpell(target, summon->m_spells[0], true); + } + break; + default: + break; + } + } + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 4941fe85f..6b290f3c4 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -61,7 +61,8 @@ enum CreatureIds NPC_VILEBRANCH_SPEAKER = 11391, // Mandokir Event NPC_CHAINED_SPIRIT = 15117, // Mandokir Event NPC_HAKKAR = 14834, - NPC_ZULGURUB_TIGER = 11361 + NPC_ZULGURUB_TIGER = 11361, + NPC_BRAIN_WASH_TOTEM = 15112 }; enum GameobjectIds From 16d27f3449e408beaf60d10d9e43c823fd9305a1 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 00:07:00 +0000 Subject: [PATCH 065/104] chore(DB): import pending files Referenced commit(s): d5221ae4236e21a5132999fe8fc2fcda0da9eb6c --- .../rev_1654439260971561400.sql => db_world/2022_06_14_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654439260971561400.sql => db_world/2022_06_14_00.sql} (74%) diff --git a/data/sql/updates/pending_db_world/rev_1654439260971561400.sql b/data/sql/updates/db_world/2022_06_14_00.sql similarity index 74% rename from data/sql/updates/pending_db_world/rev_1654439260971561400.sql rename to data/sql/updates/db_world/2022_06_14_00.sql index d9814f281..87f068047 100644 --- a/data/sql/updates/pending_db_world/rev_1654439260971561400.sql +++ b/data/sql/updates/db_world/2022_06_14_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_13_05 -> 2022_06_14_00 -- DELETE FROM `spell_script_names` WHERE `spell_id`=24684; INSERT INTO `spell_script_names` VALUES From 396fd35ed59ad05d188bfa9f27a509ceba32a3f5 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 13 Jun 2022 21:10:31 -0300 Subject: [PATCH 066/104] fix(Core/Spells): Implement SPELL_EFFECT_ACTIVATE_OBJECT (#11648) Co-authored-by: jackpoz --- .../rev_1651816895816737900.sql | 56 ++++++++++++++ src/server/game/DataStores/DBCStores.cpp | 3 + src/server/game/DataStores/DBCStores.h | 1 + .../game/Entities/GameObject/GameObject.h | 31 ++++++++ src/server/game/Globals/ObjectMgr.cpp | 19 ++++- src/server/game/Spells/SpellEffects.cpp | 75 ++++++++++++++++--- .../EasternKingdoms/ZulAman/zulaman.cpp | 28 ------- src/server/shared/DataStores/DBCStructure.h | 7 ++ src/server/shared/DataStores/DBCfmt.h | 1 + 9 files changed, 182 insertions(+), 39 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1651816895816737900.sql diff --git a/data/sql/updates/pending_db_world/rev_1651816895816737900.sql b/data/sql/updates/pending_db_world/rev_1651816895816737900.sql new file mode 100644 index 000000000..0c5aa3292 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1651816895816737900.sql @@ -0,0 +1,56 @@ +-- +ALTER TABLE `gameobject_template_addon` + ADD COLUMN `artkit0` INT NOT NULL DEFAULT 0 AFTER `maxgold`, + ADD COLUMN `artkit1` INT NOT NULL DEFAULT 0 AFTER `artkit0`, + ADD COLUMN `artkit2` INT NOT NULL DEFAULT 0 AFTER `artkit1`, + ADD COLUMN `artkit3` INT NOT NULL DEFAULT 0 AFTER `artkit2`; + +DROP TABLE IF EXISTS `gameobjectartkit_dbc`; + +CREATE TABLE `gameobjectartkit_dbc` +( + `ID` INT NOT NULL DEFAULT 0, + `Texture_1` INT NOT NULL DEFAULT 0, + `Texture_2` INT NOT NULL DEFAULT 0, + `Texture_3` INT NOT NULL DEFAULT 0, + `Attach_Model_1` INT NOT NULL DEFAULT 0, + `Attach_Model_2` INT NOT NULL DEFAULT 0, + `Attach_Model_3` INT NOT NULL DEFAULT 0, + `Attach_Model_4` INT NOT NULL DEFAULT 0, + PRIMARY KEY (`ID`) +) ENGINE=MYISAM DEFAULT CHARSET=utf8mb4; + +-- Note: All of these should be targetable by spells 46904 and 46903, but conditions are only set for Stormwind (damn Horde fanatics) +UPDATE `gameobject_template_addon` SET `artkit0` = 121, `artkit1` = 122 WHERE `entry` IN ( + 188352, -- Flame of Shattrath + 188129, -- Flame of Silvermoon + 188128, -- Flame of the Exodar + 181567, -- Flame of the Wetlands + 181566, -- Flame of Hillsbrad + 181565, -- Flame of Westfall + 181564, -- Flame of Silverpine + 181563, -- Flame of Darkshore + 181562, -- Flame of Stonetalon + 181561, -- Flame of Ashenvale + 181560, -- Flame of the Barrens + 181349, -- Flame of the Scholomance + 181348, -- Flame of Stratholme + 181347, -- Flame of Blackrock Spire + 181346, -- Flame of Dire Maul + 181345, -- Flame of the Hinterlands + 181344, -- Flame of the Blasted Lands + 181343, -- Flame of Un'Goro + 181342, -- Flame of Azshara + 181341, -- Flame of Searing Gorge + 181340, -- Flame of Winterspring + 181339, -- Flame of Silithus + 181338, -- Flame of the Plaguelands + 181337, -- Flame of Thunder Bluff + 181336, -- Flame of Orgrimmar + 181335, -- Flame of the Undercity + 181334, -- Flame of Darnassus + 181333, -- Flame of Ironforge + 181332 -- Flame of Stormwind +); + +DELETE FROM `spell_script_names` WHERE `ScriptName`= "spell_banging_the_gong"; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index c396c3c1e..8952741db 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -76,6 +76,8 @@ static FactionTeamMap sFactionTeamMap; DBCStorage sFactionStore(FactionEntryfmt); DBCStorage sFactionTemplateStore(FactionTemplateEntryfmt); +DBCStorage sGameObjectArtKitStore(GameObjectArtKitfmt); + DBCStorage sGameObjectDisplayInfoStore(GameObjectDisplayInfofmt); DBCStorage sGemPropertiesStore(GemPropertiesEntryfmt); DBCStorage sGlyphPropertiesStore(GlyphPropertiesfmt); @@ -294,6 +296,7 @@ void LoadDBCStores(const std::string& dataPath) LOAD_DBC(sEmotesTextStore, "EmotesText.dbc", "emotestext_dbc"); LOAD_DBC(sFactionStore, "Faction.dbc", "faction_dbc"); LOAD_DBC(sFactionTemplateStore, "FactionTemplate.dbc", "factiontemplate_dbc"); + LOAD_DBC(sGameObjectArtKitStore, "GameObjectArtKit.dbc", "gameobjectartkit_dbc"); LOAD_DBC(sGameObjectDisplayInfoStore, "GameObjectDisplayInfo.dbc", "gameobjectdisplayinfo_dbc"); LOAD_DBC(sGemPropertiesStore, "GemProperties.dbc", "gemproperties_dbc"); LOAD_DBC(sGlyphPropertiesStore, "GlyphProperties.dbc", "glyphproperties_dbc"); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index cd122c788..c9e70faee 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -104,6 +104,7 @@ extern DBCStorage sEmotesStore; extern DBCStorage sEmotesTextStore; extern DBCStorage sFactionStore; extern DBCStorage sFactionTemplateStore; +extern DBCStorage sGameObjectArtKitStore; extern DBCStorage sGameObjectDisplayInfoStore; extern DBCStorage sGemPropertiesStore; extern DBCStorage sGlyphPropertiesStore; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index db8d05e08..bd8500f97 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -25,6 +25,7 @@ #include "Object.h" #include "SharedDefines.h" #include "Unit.h" +#include class GameObjectAI; class Transport; @@ -676,6 +677,7 @@ struct GameObjectTemplateAddon uint32 flags; uint32 mingold; uint32 maxgold; + std::array artKits = {}; }; // Benchmarked: Faster than std::map (insert/find) @@ -736,6 +738,35 @@ enum GOState #define MAX_GO_STATE 3 +enum class GameObjectActions : uint32 +{ + // Name from client executable // Comments + None, // -NONE- + AnimateCustom0, // Animate Custom0 + AnimateCustom1, // Animate Custom1 + AnimateCustom2, // Animate Custom2 + AnimateCustom3, // Animate Custom3 + Disturb, // Disturb // Triggers trap + Unlock, // Unlock // Resets GO_FLAG_LOCKED + Lock, // Lock // Sets GO_FLAG_LOCKED + Open, // Open // Sets GO_STATE_ACTIVE + OpenAndUnlock, // Open + Unlock // Sets GO_STATE_ACTIVE and resets GO_FLAG_LOCKED + Close, // Close // Sets GO_STATE_READY + ToggleOpen, // Toggle Open + Destroy, // Destroy // Sets GO_STATE_DESTROYED + Rebuild, // Rebuild // Resets from GO_STATE_DESTROYED + Creation, // Creation + Despawn, // Despawn + MakeInert, // Make Inert // Disables interactions + MakeActive, // Make Active // Enables interactions + CloseAndLock, // Close + Lock // Sets GO_STATE_READY and sets GO_FLAG_LOCKED + UseArtKit0, // Use ArtKit0 // 46904: 121 + UseArtKit1, // Use ArtKit1 // 36639: 81, 46903: 122 + UseArtKit2, // Use ArtKit2 + UseArtKit3, // Use ArtKit3 + SetTapList, // Set Tap List +}; + // from `gameobject` struct GameObjectData { diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 32eda9fe7..81161064b 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -7183,8 +7183,8 @@ void ObjectMgr::LoadGameObjectTemplateAddons() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 - QueryResult result = WorldDatabase.Query("SELECT entry, faction, flags, mingold, maxgold FROM gameobject_template_addon"); + // 0 1 2 3 4 5 6 7 8 + QueryResult result = WorldDatabase.Query("SELECT entry, faction, flags, mingold, maxgold, artkit0, artkit1, artkit2, artkit3 FROM gameobject_template_addon"); if (!result) { @@ -7215,6 +7215,21 @@ void ObjectMgr::LoadGameObjectTemplateAddons() gameObjectAddon.mingold = fields[3].Get(); gameObjectAddon.maxgold = fields[4].Get(); + for (uint32 i = 0; i < gameObjectAddon.artKits.size(); i++) + { + uint32 artKitID = fields[5 + i].Get(); + if (!artKitID) + continue; + + if (!sGameObjectArtKitStore.LookupEntry(artKitID)) + { + LOG_ERROR("sql.sql", "GameObject (Entry: {}) has invalid `artkit{}` {} defined, set to zero instead.", entry, i, artKitID); + continue; + } + + gameObjectAddon.artKits[i] = artKitID; + } + // checks if (gameObjectAddon.faction && !sFactionTemplateStore.LookupEntry(gameObjectAddon.faction)) LOG_ERROR("sql.sql", diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index c240f62c5..c329395ec 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -4263,7 +4263,7 @@ void Spell::EffectSummonPlayer(SpellEffIndex /*effIndex*/) player->GetSession()->SendPacket(&data); } -void Spell::EffectActivateObject(SpellEffIndex /*effIndex*/) +void Spell::EffectActivateObject(SpellEffIndex effIndex) { if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; @@ -4271,17 +4271,74 @@ void Spell::EffectActivateObject(SpellEffIndex /*effIndex*/) if (!gameObjTarget) return; - Player* player = m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : m_caster->GetCharmerOrOwnerPlayerOrPlayerItself(); - gameObjTarget->Use(player ? player : m_caster); + GameObjectActions action = GameObjectActions(m_spellInfo->Effects[effIndex].MiscValue); + switch (action) + { + case GameObjectActions::AnimateCustom0: + case GameObjectActions::AnimateCustom1: + case GameObjectActions::AnimateCustom2: + case GameObjectActions::AnimateCustom3: + gameObjTarget->SendCustomAnim(uint32(action) - uint32(GameObjectActions::AnimateCustom0)); + break; + case GameObjectActions::Disturb: // What's the difference with Open? + case GameObjectActions::Open: + if (Unit* unitCaster = m_caster->ToUnit()) + gameObjTarget->Use(unitCaster); + break; + case GameObjectActions::OpenAndUnlock: + if (Unit* unitCaster = m_caster->ToUnit()) + gameObjTarget->UseDoorOrButton(0, false, unitCaster); + [[fallthrough]]; + case GameObjectActions::Unlock: + case GameObjectActions::Lock: + gameObjTarget->ApplyModFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED, action == GameObjectActions::Lock); + break; + case GameObjectActions::Close: + case GameObjectActions::Rebuild: + gameObjTarget->ResetDoorOrButton(); + break; + case GameObjectActions::Despawn: + gameObjTarget->DespawnOrUnsummon(); + break; + case GameObjectActions::MakeInert: + case GameObjectActions::MakeActive: + gameObjTarget->ApplyModFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE, action == GameObjectActions::MakeInert); + break; + case GameObjectActions::CloseAndLock: + gameObjTarget->ResetDoorOrButton(); + gameObjTarget->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + break; + case GameObjectActions::Destroy: + if (Unit* unitCaster = m_caster->ToUnit()) + gameObjTarget->UseDoorOrButton(0, true, unitCaster); + break; + case GameObjectActions::UseArtKit0: + case GameObjectActions::UseArtKit1: + case GameObjectActions::UseArtKit2: + case GameObjectActions::UseArtKit3: + { + GameObjectTemplateAddon const* templateAddon = gameObjTarget->GetTemplateAddon(); - //ScriptInfo activateCommand; - //activateCommand.command = SCRIPT_COMMAND_ACTIVATE_OBJECT; + uint32 artKitIndex = uint32(action) - uint32(GameObjectActions::UseArtKit0); - // int32 unk = m_spellInfo->Effects[effIndex].MiscValue; // This is set for EffectActivateObject spells; needs research + uint32 artKitValue = 0; + if (templateAddon) + artKitValue = templateAddon->artKits[artKitIndex]; - // xinef: pass player to allow gossip scripts to work - // - //gameObjTarget->GetMap()->ScriptCommandStart(activateCommand, 0, player ? player : m_caster, gameObjTarget); + if (artKitValue == 0) + LOG_ERROR("sql.sql", "GameObject {} hit by spell {} needs `artkit{}` in `gameobject_template_addon`", gameObjTarget->GetEntry(), m_spellInfo->Id, artKitIndex); + else + gameObjTarget->SetGoArtKit(artKitValue); + + break; + } + case GameObjectActions::None: + LOG_FATAL("spell", "Spell {} has action type NONE in effect {}", m_spellInfo->Id, int32(effIndex)); + break; + default: + LOG_ERROR("spell", "Spell {} has unhandled action {} in effect {}", m_spellInfo->Id, int32(action), int32(effIndex)); + break; + } } void Spell::EffectApplyGlyph(SpellEffIndex effIndex) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index aa883bb10..bd02ff14a 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -783,37 +783,9 @@ public: } }; -class spell_banging_the_gong : public SpellScriptLoader -{ -public: - spell_banging_the_gong() : SpellScriptLoader("spell_banging_the_gong") { } - - class spell_banging_the_gong_SpellScript : public SpellScript - { - PrepareSpellScript(spell_banging_the_gong_SpellScript); - - void Activate(SpellEffIndex index) - { - PreventHitDefaultEffect(index); - GetHitGObj()->SendCustomAnim(0); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_banging_the_gong_SpellScript(); - } -}; - void AddSC_zulaman() { new npc_forest_frog(); new npc_zulaman_hostage(); new npc_harrison_jones(); - new spell_banging_the_gong(); } diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h index 7ee64900e..6b36051f7 100644 --- a/src/server/shared/DataStores/DBCStructure.h +++ b/src/server/shared/DataStores/DBCStructure.h @@ -979,6 +979,13 @@ struct FactionTemplateEntry [[nodiscard]] bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS) != 0; } }; +struct GameObjectArtKitEntry +{ + uint32 ID; // 0 + //char* TextureVariation[3] // 1-3 m_textureVariations[3] + //char* AttachModel[4] // 4-8 m_attachModels[4] +}; + struct GameObjectDisplayInfoEntry { uint32 Displayid; // 0 m_ID diff --git a/src/server/shared/DataStores/DBCfmt.h b/src/server/shared/DataStores/DBCfmt.h index 7dc5867da..abd37d1e3 100644 --- a/src/server/shared/DataStores/DBCfmt.h +++ b/src/server/shared/DataStores/DBCfmt.h @@ -50,6 +50,7 @@ char constexpr EmotesEntryfmt[] = "nxxiiix"; char constexpr EmotesTextEntryfmt[] = "nxixxxxxxxxxxxxxxxx"; char constexpr FactionEntryfmt[] = "niiiiiiiiiiiiiiiiiiffixssssssssssssssssxxxxxxxxxxxxxxxxxx"; char constexpr FactionTemplateEntryfmt[] = "niiiiiiiiiiiii"; +char constexpr GameObjectArtKitfmt[] = "nxxxxxxx"; char constexpr GameObjectDisplayInfofmt[] = "nsxxxxxxxxxxffffffx"; char constexpr GemPropertiesEntryfmt[] = "nixxi"; char constexpr GlyphPropertiesfmt[] = "niii"; From f0eb0647f4ec1dc272d35a65fe08c1b270c81985 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 00:13:00 +0000 Subject: [PATCH 067/104] chore(DB): import pending files Referenced commit(s): 396fd35ed59ad05d188bfa9f27a509ceba32a3f5 --- .../rev_1651816895816737900.sql => db_world/2022_06_14_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1651816895816737900.sql => db_world/2022_06_14_01.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1651816895816737900.sql b/data/sql/updates/db_world/2022_06_14_01.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1651816895816737900.sql rename to data/sql/updates/db_world/2022_06_14_01.sql index 0c5aa3292..4e6b9fc9a 100644 --- a/data/sql/updates/pending_db_world/rev_1651816895816737900.sql +++ b/data/sql/updates/db_world/2022_06_14_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_00 -> 2022_06_14_01 -- ALTER TABLE `gameobject_template_addon` ADD COLUMN `artkit0` INT NOT NULL DEFAULT 0 AFTER `maxgold`, From f9368ed00db080f809ebb103266352c424d58aae Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 14 Jun 2022 04:33:35 +0200 Subject: [PATCH 068/104] fix(Scripts/ZulGurub): Improvements to Gah'zranka: (#11908) Summoned Mudskunk Lure object and added visual splash. Added pathing to Gahzranka Corrected visual coordinates. Gahzranka can be summoned only once per instance. Fixes #11560 --- .../rev_1653819851783034500.sql | 12 +++++ .../ZulGurub/boss_gahzranka.cpp | 50 ++++++++++++++++++- .../ZulGurub/instance_zulgurub.cpp | 16 ++++++ .../EasternKingdoms/ZulGurub/zulgurub.h | 3 +- 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1653819851783034500.sql diff --git a/data/sql/updates/pending_db_world/rev_1653819851783034500.sql b/data/sql/updates/pending_db_world/rev_1653819851783034500.sql new file mode 100644 index 000000000..c4371af57 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653819851783034500.sql @@ -0,0 +1,12 @@ +-- +UPDATE `spell_target_position` SET `PositionX`=-11688.5, `PositionY`=-1737.74, `PositionZ`=8.409842 WHERE `id` IN (24325, 24593); +DELETE FROM `event_scripts` WHERE `id`=9104; + +DELETE FROM `spell_script_names` WHERE `spell_id`=24325; +INSERT INTO `spell_script_names` VALUES +(24325, 'spell_pagles_point_cast'); + +DELETE FROM `waypoint_data` WHERE `id`=151140; +INSERT INTO `waypoint_data` VALUES +(151140,1,-11697.263,-1759.001,10.364448,0,0,0,0,100,0), +(151140,2,-11689.899,-1776.087,12.593142,6.098,0,0,0,100,0); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 86e4c473d..4cf8348d0 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -32,7 +32,8 @@ enum Spells SPELL_FROSTBREATH = 16099, SPELL_MASSIVEGEYSER = 22421, SPELL_SLAM = 24326, - SPELL_THRASH = 3417 // Triggers 3391 + SPELL_THRASH = 3417, // Triggers 3391 + SPELL_SPLASH = 24593 }; enum Events @@ -42,6 +43,11 @@ enum Events EVENT_SLAM = 3 }; +enum Misc +{ + GAMEOBJECT_MUDSKUNK_LURE = 180346 +}; + class boss_gahzranka : public CreatureScript { public: @@ -51,6 +57,11 @@ public: { boss_gahzrankaAI(Creature* creature) : BossAI(creature, DATA_GAHZRANKA) { } + void IsSummonedBy(Unit* /*summoner*/) override + { + me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + } + void Reset() override { _Reset(); @@ -147,8 +158,45 @@ private: bool _wipeThreat = false; }; +class spell_pagles_point_cast : public SpellScript +{ + PrepareSpellScript(spell_pagles_point_cast); + + void OnEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + { + if (InstanceScript* instanceScript = caster->GetInstanceScript()) + { + if (!instanceScript->GetData(DATA_GAHZRANKA)) + { + caster->m_Events.AddEventAtOffset([caster]() + { + if (GameObject* lure = caster->SummonGameObject(GAMEOBJECT_MUDSKUNK_LURE, -11688.5f, -1737.74f, 10.409842f, 1.f, 0.f, 0.f, 0.f, 0.f, 30 * IN_MILLISECONDS)) + { + caster->m_Events.AddEventAtOffset([caster, lure]() + { + if (lure) + lure->DespawnOrUnsummon(); + caster->CastSpell(caster, SPELL_SPLASH, true); + caster->SummonCreature(NPC_GAHZRANKA, -11688.5f, -1723.74f, -5.78f, 0.f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5 * DAY * IN_MILLISECONDS); + }, 5s); + } + }, 2s); + } + } + } + } + + void Register() override + { + OnEffectLaunch += SpellEffectFn(spell_pagles_point_cast::OnEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } +}; + void AddSC_boss_gahzranka() { new boss_gahzranka(); RegisterSpellScript(spell_gahzranka_slam); + RegisterSpellScript(spell_pagles_point_cast); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index dcffbd4ff..6e99c2fb6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -79,6 +79,11 @@ public: marli->AI()->JustSummoned(creature); } break; + case NPC_GAHZRANKA: + _gahzrankaGUID = creature->GetGUID(); + break; + default: + break; } InstanceScript::OnCreatureCreate(creature); @@ -119,6 +124,16 @@ public: return ObjectGuid::Empty; } + uint32 GetData(uint32 type) const override + { + if (type == DATA_GAHZRANKA) + { + return _gahzrankaGUID || GetBossState(DATA_GAHZRANKA) == DONE; + } + + return 0; + } + std::string GetSaveData() override { OUT_SAVE_INST_DATA; @@ -170,6 +185,7 @@ public: ObjectGuid _arlokkGUID; ObjectGuid _goGongOfBethekkGUID; ObjectGuid _hakkarGUID; + ObjectGuid _gahzrankaGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const override diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 6b290f3c4..8736e5d4d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -62,7 +62,8 @@ enum CreatureIds NPC_CHAINED_SPIRIT = 15117, // Mandokir Event NPC_HAKKAR = 14834, NPC_ZULGURUB_TIGER = 11361, - NPC_BRAIN_WASH_TOTEM = 15112 + NPC_BRAIN_WASH_TOTEM = 15112, + NPC_GAHZRANKA = 15114 }; enum GameobjectIds From 5174189e1fc133ec287b7b2e104755e3fb6de6ac Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 02:35:38 +0000 Subject: [PATCH 069/104] chore(DB): import pending files Referenced commit(s): f9368ed00db080f809ebb103266352c424d58aae --- .../rev_1653819851783034500.sql => db_world/2022_06_14_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1653819851783034500.sql => db_world/2022_06_14_02.sql} (92%) diff --git a/data/sql/updates/pending_db_world/rev_1653819851783034500.sql b/data/sql/updates/db_world/2022_06_14_02.sql similarity index 92% rename from data/sql/updates/pending_db_world/rev_1653819851783034500.sql rename to data/sql/updates/db_world/2022_06_14_02.sql index c4371af57..0211373bf 100644 --- a/data/sql/updates/pending_db_world/rev_1653819851783034500.sql +++ b/data/sql/updates/db_world/2022_06_14_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_01 -> 2022_06_14_02 -- UPDATE `spell_target_position` SET `PositionX`=-11688.5, `PositionY`=-1737.74, `PositionZ`=8.409842 WHERE `id` IN (24325, 24593); DELETE FROM `event_scripts` WHERE `id`=9104; From 67c1b5cbc029c40c7a26789253560141a7b77c7b Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Tue, 14 Jun 2022 04:53:40 +0200 Subject: [PATCH 070/104] fix(DB/Creature) Tarindrella movement type (#11802) --- data/sql/updates/pending_db_world/rev_1652901134913931900.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1652901134913931900.sql diff --git a/data/sql/updates/pending_db_world/rev_1652901134913931900.sql b/data/sql/updates/pending_db_world/rev_1652901134913931900.sql new file mode 100644 index 000000000..39f83dd36 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1652901134913931900.sql @@ -0,0 +1,2 @@ +-- Update movement for Tarindralla +UPDATE `creature` SET `wander_distance` = 7, `MovementType` = 1 WHERE `guid` = 47347 AND `id1` = 1992; From 638144c32540d24df3fd22304ae9e2cf7dadf11f Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 02:55:47 +0000 Subject: [PATCH 071/104] chore(DB): import pending files Referenced commit(s): 67c1b5cbc029c40c7a26789253560141a7b77c7b --- .../rev_1652901134913931900.sql => db_world/2022_06_14_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1652901134913931900.sql => db_world/2022_06_14_03.sql} (75%) diff --git a/data/sql/updates/pending_db_world/rev_1652901134913931900.sql b/data/sql/updates/db_world/2022_06_14_03.sql similarity index 75% rename from data/sql/updates/pending_db_world/rev_1652901134913931900.sql rename to data/sql/updates/db_world/2022_06_14_03.sql index 39f83dd36..5b7195035 100644 --- a/data/sql/updates/pending_db_world/rev_1652901134913931900.sql +++ b/data/sql/updates/db_world/2022_06_14_03.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_14_02 -> 2022_06_14_03 -- Update movement for Tarindralla UPDATE `creature` SET `wander_distance` = 7, `MovementType` = 1 WHERE `guid` = 47347 AND `id1` = 1992; From a50b13bd8d1bb9360805baa1fba18597452d5d58 Mon Sep 17 00:00:00 2001 From: temperrr Date: Tue, 14 Jun 2022 05:08:27 +0200 Subject: [PATCH 072/104] =?UTF-8?q?Fix(Creature/AI):=20Mirveda's=20summone?= =?UTF-8?q?d=20creatures=20should=20despawn=20out=20of=20=E2=80=A6=20(#119?= =?UTF-8?q?51)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...combat --- data/sql/updates/pending_db_world/mirvedasmartai.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/mirvedasmartai.sql diff --git a/data/sql/updates/pending_db_world/mirvedasmartai.sql b/data/sql/updates/pending_db_world/mirvedasmartai.sql new file mode 100644 index 000000000..7d93d98c3 --- /dev/null +++ b/data/sql/updates/pending_db_world/mirvedasmartai.sql @@ -0,0 +1,5 @@ +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1540201) AND (`source_type` = 9) AND (`id` IN (4, 5, 6)); +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 +(1540201, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 15958, 4, 15000, 0, 0, 0, 8, 0, 0, 0, 0, 8750.1, -7129.7, 35.2976, 3.8041, 'Apprentice Mirveda - Actionlist - Summon Creature \'Gharsul the Remorseless\''), +(1540201, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 15656, 4, 15000, 0, 0, 0, 8, 0, 0, 0, 0, 8753.61, -7133.15, 35, 3.8576, 'Apprentice Mirveda - Actionlist - Summon Creature \'Angershade\''), +(1540201, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 15656, 4, 15000, 0, 0, 0, 8, 0, 0, 0, 0, 8747.14, -7125.71, 35.848, 3.8576, 'Apprentice Mirveda - Actionlist - Summon Creature \'Angershade\''); From d3bd763dc596a022ce7147ebcdf329500d12a20a Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 03:10:33 +0000 Subject: [PATCH 073/104] chore(DB): import pending files Referenced commit(s): a50b13bd8d1bb9360805baa1fba18597452d5d58 --- .../mirvedasmartai.sql => db_world/2022_06_14_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/mirvedasmartai.sql => db_world/2022_06_14_04.sql} (96%) diff --git a/data/sql/updates/pending_db_world/mirvedasmartai.sql b/data/sql/updates/db_world/2022_06_14_04.sql similarity index 96% rename from data/sql/updates/pending_db_world/mirvedasmartai.sql rename to data/sql/updates/db_world/2022_06_14_04.sql index 7d93d98c3..e94883e49 100644 --- a/data/sql/updates/pending_db_world/mirvedasmartai.sql +++ b/data/sql/updates/db_world/2022_06_14_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_03 -> 2022_06_14_04 DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1540201) AND (`source_type` = 9) AND (`id` IN (4, 5, 6)); 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 (1540201, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 12, 15958, 4, 15000, 0, 0, 0, 8, 0, 0, 0, 0, 8750.1, -7129.7, 35.2976, 3.8041, 'Apprentice Mirveda - Actionlist - Summon Creature \'Gharsul the Remorseless\''), From 987d49f9ba59a2670c23c1f98176a50991070474 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 14 Jun 2022 09:24:14 -0300 Subject: [PATCH 074/104] fix(Scripts/TempleOfAhnQiraj): Rewrite C'thun tentacles (#12047) --- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 410 ++++++++---------- 1 file changed, 186 insertions(+), 224 deletions(-) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 0380ded3e..8001bfd63 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -25,38 +25,9 @@ EndScriptData */ #include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "TaskScheduler.h" #include "temple_of_ahnqiraj.h" -/* - * This is a 2 phases events. Here follows an explanation of the main events and transition between phases and sub-phases. - * - * The first phase is the EYE phase: the Eye of C'Thun is active and C'thun is not active. - * During this phase, the "Eye of C'Thun" alternates between 2 sub-phases: - * - PHASE_EYE_GREEN_BEAM: - * 50 sec phase during which the Eye mainly casts its Green Beam every 3 sec. - * - PHASE_EYE_RED_BEAM: - * 35 sec phase during which the Eye casts its red beam every sec. - * This EYE phase ends when the "Eye of C'Thun" is killed. Then starts the CTHUN phase. - * - * The second phase is the CTHUN phase. The Eye of C'Thun is not active and C'Thun is active. - * This phase starts with the transformation of the Eye into C'Thun (PHASE_CTHUN_TRANSITION). - * After the transformation, C'Thun alternates between 2 sub-phases: - * - PHASE_CTHUN_STOMACH: - * - C'Thun is almost insensible to all damage (99% damage reduction). - * - It spawns 2 tentacles in its stomach. - * - C'Thun swallows players. - * - This sub-phase ends when the 2 tentacles are killed. Swallowed players are regurgitate. - * - * - PHASE_CTHUN_WEAK: - * - weakened C'Thun takes normal damage. - * - This sub-phase ends after 45 secs. - * - * This CTHUN phase ends when C'Thun is killed - * - * Note: - * - the current phase is stored in the instance data to be easily shared between the eye and cthun. - */ - enum Phases { PHASE_NOT_STARTED = 0, @@ -99,7 +70,7 @@ enum Spells //SAME AS PHASE1 //Giant Claw Tentacles - SPELL_MASSIVE_GROUND_RUPTURE = 26100, + SPELL_MASSIVE_GROUND_RUPTURE = 26478, //Also casts Hamstring SPELL_THRASH = 3391, @@ -111,6 +82,10 @@ enum Spells SPELL_MOUTH_TENTACLE = 26332, SPELL_EXIT_STOMACH_KNOCKBACK = 25383, SPELL_DIGESTIVE_ACID = 26476, + + // Tentacles + SPELL_SUBMERGE_VISUAL = 26234, + SPELL_BIRTH = 26262 }; enum Actions @@ -142,6 +117,20 @@ const Position FleshTentaclePos[2] = { -8525.0f, 1994.0f, -98.0f, 2.12f}, }; +class NotInStomachSelector +{ +public: + NotInStomachSelector() { } + + bool operator()(Unit* unit) const + { + if (unit->GetTypeId() != TYPEID_PLAYER || unit->HasAura(SPELL_DIGESTIVE_ACID)) + return false; + + return true; + } +}; + //Kick out position const Position KickPos = { -8545.0f, 1984.0f, -96.0f, 0.0f}; @@ -917,32 +906,40 @@ public: { eye_tentacleAI(Creature* creature) : ScriptedAI(creature) { - if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { - pPortal->SetReactState(REACT_PASSIVE); - Portal = pPortal->GetGUID(); + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } SetCombatMovement(false); } - uint32 MindflayTimer; - uint32 KillSelfTimer; - ObjectGuid Portal; - void JustDied(Unit* /*killer*/) override { - if (Unit* p = ObjectAccessor::GetUnit(*me, Portal)) + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) + { Unit::Kill(p, p); + } } void Reset() override { - //Mind flay half a second after we spawn - MindflayTimer = 500; + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + { + DoCastAOE(SPELL_GROUND_RUPTURE); + }).Schedule(5min, [this](TaskContext /*task*/) + { + me->DespawnOrUnsummon(); + }).Schedule(1s, 5s, [this](TaskContext context) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, [&](Unit* u) { return u && u->GetTypeId() == TYPEID_PLAYER && !u->HasAura(SPELL_DIGESTIVE_ACID) && !u->HasAura(SPELL_MIND_FLAY); })) + { + DoCast(target, SPELL_MIND_FLAY); + } - //This prevents eyes from overlapping - KillSelfTimer = 35000; + context.Repeat(10s, 15s); + }); } void EnterCombat(Unit* /*who*/) override @@ -956,26 +953,12 @@ public: if (!UpdateVictim()) return; - //KillSelfTimer - if (KillSelfTimer <= diff) - { - Unit::Kill(me, me); - return; - } - else KillSelfTimer -= diff; - - //MindflayTimer - if (MindflayTimer <= diff) - { - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) - DoCast(target, SPELL_MIND_FLAY); - - //Mindflay every 10 seconds - MindflayTimer = 10000; - } - else MindflayTimer -= diff; + _scheduler.Update(diff); } + + private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; }; }; @@ -995,35 +978,41 @@ public: { SetCombatMovement(false); - if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { - pPortal->SetReactState(REACT_PASSIVE); - Portal = pPortal->GetGUID(); + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } } - uint32 GroundRuptureTimer; - uint32 HamstringTimer; - uint32 EvadeTimer; - ObjectGuid Portal; - void JustDied(Unit* /*killer*/) override { - if (Unit* p = ObjectAccessor::GetUnit(*me, Portal)) + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) + { Unit::Kill(p, p); + } } void Reset() override { - //First rupture should happen half a second after we spawn - GroundRuptureTimer = 500; - HamstringTimer = 2000; - EvadeTimer = 5000; + _scheduler.Schedule(Milliseconds(500), [this](TaskContext /*task*/) + { + DoCastAOE(SPELL_GROUND_RUPTURE); + }).Schedule(Minutes(5), [this](TaskContext /*task*/) + { + me->DespawnOrUnsummon(); + }); } void EnterCombat(Unit* /*who*/) override { DoZoneInCombat(); + + _scheduler.Schedule(2s, [this](TaskContext context) + { + DoCastVictim(SPELL_HAMSTRING); + context.Repeat(5s); + }); } void UpdateAI(uint32 diff) override @@ -1032,62 +1021,14 @@ public: if (!UpdateVictim()) return; - //EvadeTimer - if (!me->IsWithinMeleeRange(me->GetVictim())) - { - if (EvadeTimer <= diff) - { - if (Unit* p = ObjectAccessor::GetUnit(*me, Portal)) - Unit::Kill(p, p); - - //Dissapear and reappear at new position - me->SetVisible(false); - - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - if (!target) - { - Unit::Kill(me, me); - return; - } - - if (!target->HasAura(SPELL_DIGESTIVE_ACID)) - { - me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) - { - pPortal->SetReactState(REACT_PASSIVE); - Portal = pPortal->GetGUID(); - } - - GroundRuptureTimer = 500; - HamstringTimer = 2000; - EvadeTimer = 5000; - AttackStart(target); - } - - me->SetVisible(true); - } - else EvadeTimer -= diff; - } - - //GroundRuptureTimer - if (GroundRuptureTimer <= diff) - { - DoCastVictim(SPELL_GROUND_RUPTURE); - GroundRuptureTimer = 30000; - } - else GroundRuptureTimer -= diff; - - //HamstringTimer - if (HamstringTimer <= diff) - { - DoCastVictim(SPELL_HAMSTRING); - HamstringTimer = 5000; - } - else HamstringTimer -= diff; + _scheduler.Update(diff); DoMeleeAttackIfReady(); } + + private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; }; }; @@ -1107,37 +1048,112 @@ public: { SetCombatMovement(false); - if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { - pPortal->SetReactState(REACT_PASSIVE); - Portal = pPortal->GetGUID(); + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } } - uint32 GroundRuptureTimer; - uint32 ThrashTimer; - uint32 HamstringTimer; - uint32 EvadeTimer; - ObjectGuid Portal; - void JustDied(Unit* /*killer*/) override { - if (Unit* p = ObjectAccessor::GetUnit(*me, Portal)) + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) + { Unit::Kill(p, p); + } } void Reset() override { - //First rupture should happen half a second after we spawn - GroundRuptureTimer = 500; - HamstringTimer = 2000; - ThrashTimer = 5000; - EvadeTimer = 5000; + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + { + DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE); + }); } void EnterCombat(Unit* /*who*/) override { DoZoneInCombat(); + + _scheduler.Schedule(2s, [this](TaskContext context) + { + DoCastVictim(SPELL_HAMSTRING); + context.Repeat(10s); + }).Schedule(5s, [this](TaskContext context) { + DoCastSelf(SPELL_THRASH); + context.Repeat(10s); + }); + } + + void ScheduleMeleeCheck() + { + // Check if a target is in melee range + _scheduler.Schedule(10s, [this](TaskContext task) + { + if (Unit* target = me->GetVictim()) + { + if (!target->IsWithinMeleeRange(me)) + { + // Main target not found within melee range, try to select a new one + if (Player* newTarget = me->SelectNearestPlayer(5.0f)) + { + AttackStart(newTarget); + } + else // Main target not found, and failed to acquire a new target... Submerge + { + Submerge(); + } + } + } + + task.Repeat(); + }); + } + + void Submerge() + { + if (me->SelectNearestPlayer(5.0f)) + { + return; + } + + // Despawn portal + if (Creature* p = ObjectAccessor::GetCreature(*me, _portalGUID)) + { + p->DespawnOrUnsummon(); + } + + DoCastSelf(SPELL_SUBMERGE_VISUAL); + me->SetHealth(me->GetMaxHealth()); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + _scheduler.CancelAll(); + + _scheduler.Schedule(5s, [this](TaskContext /*task*/) + { + Emerge(); + }); + } + + void Emerge() + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) + { + Position pos = target->GetPosition(); + me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), 0); + if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, pos, TEMPSUMMON_CORPSE_DESPAWN)) + { + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); + } + + me->RemoveAurasDueToSpell(SPELL_SUBMERGE_VISUAL); + DoCastSelf(SPELL_BIRTH); + DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE, true); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + ScheduleMeleeCheck(); + } } void UpdateAI(uint32 diff) override @@ -1146,70 +1162,14 @@ public: if (!UpdateVictim()) return; - //EvadeTimer - if (!me->IsWithinMeleeRange(me->GetVictim())) - { - if (EvadeTimer <= diff) - { - if (Unit* p = ObjectAccessor::GetUnit(*me, Portal)) - Unit::Kill(p, p); - - //Dissapear and reappear at new position - me->SetVisible(false); - - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - if (!target) - { - Unit::Kill(me, me); - return; - } - - if (!target->HasAura(SPELL_DIGESTIVE_ACID)) - { - me->SetPosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) - { - pPortal->SetReactState(REACT_PASSIVE); - Portal = pPortal->GetGUID(); - } - - GroundRuptureTimer = 500; - HamstringTimer = 2000; - ThrashTimer = 5000; - EvadeTimer = 5000; - AttackStart(target); - } - me->SetVisible(true); - } - else EvadeTimer -= diff; - } - - //GroundRuptureTimer - if (GroundRuptureTimer <= diff) - { - DoCastVictim(SPELL_GROUND_RUPTURE); - GroundRuptureTimer = 30000; - } - else GroundRuptureTimer -= diff; - - //ThrashTimer - if (ThrashTimer <= diff) - { - DoCastVictim(SPELL_THRASH); - ThrashTimer = 10000; - } - else ThrashTimer -= diff; - - //HamstringTimer - if (HamstringTimer <= diff) - { - DoCastVictim(SPELL_HAMSTRING); - HamstringTimer = 10000; - } - else HamstringTimer -= diff; + _scheduler.Update(diff); DoMeleeAttackIfReady(); } + + private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; }; }; @@ -1229,26 +1189,34 @@ public: { SetCombatMovement(false); - if (Creature* pPortal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { - pPortal->SetReactState(REACT_PASSIVE); - Portal = pPortal->GetGUID(); + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } } - uint32 BeamTimer; - ObjectGuid Portal; - void JustDied(Unit* /*killer*/) override { - if (Unit* p = ObjectAccessor::GetUnit(*me, Portal)) + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) + { Unit::Kill(p, p); + } } void Reset() override { - //Green Beam half a second after we spawn - BeamTimer = 500; + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + { + DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE); + }).Schedule(1s, 5s, [this](TaskContext context) { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID)) + { + DoCast(target, SPELL_GREEN_BEAM); + } + + context.Repeat(2100ms); + }); } void EnterCombat(Unit* /*who*/) override @@ -1262,18 +1230,12 @@ public: if (!UpdateVictim()) return; - //BeamTimer - if (BeamTimer <= diff) - { - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) - DoCast(target, SPELL_GREEN_BEAM); - - //Beam every 2 seconds - BeamTimer = 2100; - } - else BeamTimer -= diff; + _scheduler.Update(diff); } + + private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; }; }; From 830fd3f6e517a4b42940a4db66ff0d37ce3b2687 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Tue, 14 Jun 2022 17:01:07 -0300 Subject: [PATCH 075/104] fix(DB/Creature): ZulGurub - Mad Servant (15111) (#12034) --- data/sql/updates/pending_db_world/mad_servant.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 data/sql/updates/pending_db_world/mad_servant.sql diff --git a/data/sql/updates/pending_db_world/mad_servant.sql b/data/sql/updates/pending_db_world/mad_servant.sql new file mode 100644 index 000000000..f598203cf --- /dev/null +++ b/data/sql/updates/pending_db_world/mad_servant.sql @@ -0,0 +1,15 @@ +-- +DELETE FROM `creature_text` WHERE `CreatureID`=15111 AND `GroupID` IN (0,1); +INSERT INTO `creature_text` (`CreatureID`, `ID`, `Text`, `Type`, `Probability`, `BroadcastTextId`) VALUES +(15111, 0, 'I gonna make you into mojo!', 12, 100, 10435), +(15111, 1, 'Troll mojo da strongest mojo!', 12, 100, 10437); + +DELETE FROM `creature_template_spell` WHERE (`CreatureID` = 15111) AND (`Index` IN (0, 1)); +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(15111, 0, 24611, 0), +(15111, 1, 24612, 0); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15111; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15111) AND (`source_type` = 0) AND (`id` IN (3)); +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 +(15111, 0, 3, 0, 4, 0, 15, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mad Servant - On Aggro - Say Line GroupID 0'); From a7f768c1c8f8dc1242d7907ce528c6b5c120ddfe Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 20:03:14 +0000 Subject: [PATCH 076/104] chore(DB): import pending files Referenced commit(s): 830fd3f6e517a4b42940a4db66ff0d37ce3b2687 --- .../mad_servant.sql => db_world/2022_06_14_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/mad_servant.sql => db_world/2022_06_14_05.sql} (96%) diff --git a/data/sql/updates/pending_db_world/mad_servant.sql b/data/sql/updates/db_world/2022_06_14_05.sql similarity index 96% rename from data/sql/updates/pending_db_world/mad_servant.sql rename to data/sql/updates/db_world/2022_06_14_05.sql index f598203cf..1190456d7 100644 --- a/data/sql/updates/pending_db_world/mad_servant.sql +++ b/data/sql/updates/db_world/2022_06_14_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_04 -> 2022_06_14_05 -- DELETE FROM `creature_text` WHERE `CreatureID`=15111 AND `GroupID` IN (0,1); INSERT INTO `creature_text` (`CreatureID`, `ID`, `Text`, `Type`, `Probability`, `BroadcastTextId`) VALUES From 90c6459b744cfa8282a73678e335fdd5de5eb269 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 14 Jun 2022 22:17:12 +0200 Subject: [PATCH 077/104] =?UTF-8?q?fix(DB/Spells):=20Added=20Earth=20Shock?= =?UTF-8?q?/Icy=20Chill=20enchantment=20to=20spell=20stac=E2=80=A6=20(#120?= =?UTF-8?q?31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...king groups. --- .../sql/updates/pending_db_world/rev_1655035716184036300.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1655035716184036300.sql diff --git a/data/sql/updates/pending_db_world/rev_1655035716184036300.sql b/data/sql/updates/pending_db_world/rev_1655035716184036300.sql new file mode 100644 index 000000000..eb37bae40 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1655035716184036300.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_group` WHERE `spell_id` IN (8042,20005); +INSERT INTO `spell_group` VALUES +(1014,8042,0), +(1014,20005,0); From f3435c6e1c37a516677b2885e90d7ce7248cbdca Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 20:19:31 +0000 Subject: [PATCH 078/104] chore(DB): import pending files Referenced commit(s): 90c6459b744cfa8282a73678e335fdd5de5eb269 --- .../rev_1655035716184036300.sql => db_world/2022_06_14_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1655035716184036300.sql => db_world/2022_06_14_06.sql} (74%) diff --git a/data/sql/updates/pending_db_world/rev_1655035716184036300.sql b/data/sql/updates/db_world/2022_06_14_06.sql similarity index 74% rename from data/sql/updates/pending_db_world/rev_1655035716184036300.sql rename to data/sql/updates/db_world/2022_06_14_06.sql index eb37bae40..9852273b7 100644 --- a/data/sql/updates/pending_db_world/rev_1655035716184036300.sql +++ b/data/sql/updates/db_world/2022_06_14_06.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_05 -> 2022_06_14_06 -- DELETE FROM `spell_group` WHERE `spell_id` IN (8042,20005); INSERT INTO `spell_group` VALUES From c40fa6509d1e19c5d1fb3e51e45d08520070216d Mon Sep 17 00:00:00 2001 From: temperrr Date: Tue, 14 Jun 2022 22:39:28 +0200 Subject: [PATCH 079/104] fix(Scripts/Azuregos): mark of frost should be removed on reset (#12053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Azuregos): Mark of Frost should not be removed on reset Co-authored-by: temperrr <¨speudoniem@outlook.com> --- src/server/scripts/Kalimdor/boss_azuregos.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index cc8423194..13c6ee445 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -69,8 +69,6 @@ public: { if (p->GetZoneId() == me->GetZoneId()) { - - p->RemoveAurasDueToSpell(SPELL_AURA_OF_FROST); p->RemoveAurasDueToSpell(SPELL_CHILL); p->RemoveAurasDueToSpell(SPELL_FROST_BREATH); } From fed8d510444b356a486957c7051895bdfaf663ca Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Wed, 15 Jun 2022 00:42:55 +0200 Subject: [PATCH 080/104] =?UTF-8?q?fix(Scripts/Spells):=20Shadowburn=20sho?= =?UTF-8?q?uld=20give=20Sould=20Shard=20only=20if=20targe=E2=80=A6=20(#120?= =?UTF-8?q?30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...t yields experience/honor to the player. Fixes #12021 --- .../rev_1655034493544919400.sql | 4 ++++ src/server/scripts/Spells/spell_warlock.cpp | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1655034493544919400.sql diff --git a/data/sql/updates/pending_db_world/rev_1655034493544919400.sql b/data/sql/updates/pending_db_world/rev_1655034493544919400.sql new file mode 100644 index 000000000..082287602 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1655034493544919400.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`=29341; +INSERT INTO `spell_script_names` VALUES +(29341,'spell_warl_shadowburn'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index cd8d9233e..cfa787420 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1208,6 +1208,27 @@ class spell_warl_drain_soul : public AuraScript } }; +// 29341 - Shadowburn +class spell_warl_shadowburn : public AuraScript +{ + PrepareAuraScript(spell_warl_shadowburn); + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* caster = GetCaster(); + Unit* target = GetTarget(); + if (!(GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH && caster && target && caster->IsPlayer() && caster->ToPlayer()->isHonorOrXPTarget(target))) + { + PreventDefaultAction(); + } + } + + void Register() override + { + OnEffectRemove += AuraEffectRemoveFn(spell_warl_shadowburn::RemoveEffect, EFFECT_0, SPELL_AURA_CHANNEL_DEATH_ITEM, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_warlock_spell_scripts() { RegisterSpellScript(spell_warl_eye_of_kilrogg); @@ -1238,4 +1259,5 @@ void AddSC_warlock_spell_scripts() RegisterSpellScript(spell_warl_soulshatter); RegisterSpellScript(spell_warl_unstable_affliction); RegisterSpellScript(spell_warl_drain_soul); + RegisterSpellScript(spell_warl_shadowburn); } From bfc8e58467d7b0b637a1badd33f6c56cd74f644c Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 22:44:52 +0000 Subject: [PATCH 081/104] chore(DB): import pending files Referenced commit(s): fed8d510444b356a486957c7051895bdfaf663ca --- .../rev_1655034493544919400.sql => db_world/2022_06_14_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1655034493544919400.sql => db_world/2022_06_14_07.sql} (75%) diff --git a/data/sql/updates/pending_db_world/rev_1655034493544919400.sql b/data/sql/updates/db_world/2022_06_14_07.sql similarity index 75% rename from data/sql/updates/pending_db_world/rev_1655034493544919400.sql rename to data/sql/updates/db_world/2022_06_14_07.sql index 082287602..1de0d55cd 100644 --- a/data/sql/updates/pending_db_world/rev_1655034493544919400.sql +++ b/data/sql/updates/db_world/2022_06_14_07.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_06 -> 2022_06_14_07 -- DELETE FROM `spell_script_names` WHERE `spell_id`=29341; INSERT INTO `spell_script_names` VALUES From ddd6556681fbe38bddb0c07eb1157de3c3b4e1f1 Mon Sep 17 00:00:00 2001 From: temperrr Date: Wed, 15 Jun 2022 00:55:06 +0200 Subject: [PATCH 082/104] fix(DB/SAI): Private Hendel should despawn on player dead/reset (#12051) --- .../pending_db_world/privatehendel.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 data/sql/updates/pending_db_world/privatehendel.sql diff --git a/data/sql/updates/pending_db_world/privatehendel.sql b/data/sql/updates/pending_db_world/privatehendel.sql new file mode 100644 index 000000000..3be210bbf --- /dev/null +++ b/data/sql/updates/pending_db_world/privatehendel.sql @@ -0,0 +1,23 @@ +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4966; +DELETE FROM `smart_scripts` WHERE ((`entryorguid` = 496603) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3))) OR ((`entryorguid` = 496600) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3, 4, 5, 6))) OR ((`entryorguid` = 5184) AND (`source_type` = 0)) OR (`source_type` = 0 AND `entryorguid` = 4966 AND (`id` IN (0, 1, 2, 3, 4, 5, 6, 7))); +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 +(4966, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - On Respawn - Set Emote State 0'), +(4966, 0, 1, 2, 61, 0, 100, 512, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - On Respawn - Add Npc Flags Questgiver'), +(4966, 0, 2, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - On Respawn - Reset Invincibility Hp'), +(4966, 0, 3, 0, 19, 0, 100, 512, 1324, 0, 0, 0, 0, 80, 496600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - On Quest \'The Missing Diplomat\' Taken - Run Script'), +(4966, 0, 4, 0, 7, 1, 100, 513, 0, 0, 0, 0, 0, 80, 496603, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - On Evade - Run Script (Phase 1) (No Repeat)'), +(4966, 0, 6, 0, 2, 1, 100, 512, 0, 20, 300, 500, 0, 80, 496601, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Between 0-20% Health - Run Script (Phase 1)'), +(4966, 0, 7, 0, 40, 2, 100, 512, 1, 496600, 0, 0, 0, 80, 496602, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - On Waypoint 1 Reached - Run Script (Phase 2)'), +(496600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Remove Npc Flags Questgiver'), +(496600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 42, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Set Invincibility Hp 1'), +(496600, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 2, 168, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Set Faction 168'), +(496600, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 11, 5184, 50, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Set Data 1 1'), +(496600, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Store Targetlist'), +(496600, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Start Attacking'), +(496600, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Set Event Phase 1'), +(5184, 0, 0, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 11, 7165, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Theramore Sentry - On Aggro - Cast \'Battle Stance\''), +(5184, 0, 1, 0, 38, 0, 100, 513, 3, 3, 1, 2, 0, 41, 60000, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Theramore Sentry - On Data Set 3 3 - Despawn In 60000 ms (No Repeat)'), +(496603, 9, 0, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 41, 1, 300, 0, 0, 0, 0, 19, 5184, 50, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Despawn In 1000 ms'), +(496603, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 6, 1324, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Fail Quest \'The Missing Diplomat\''), +(496603, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 41, 1, 300, 0, 0, 0, 0, 19, 5184, 50, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Despawn Instant'), +(496603, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 41, 1, 300, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Private Hendel - Actionlist - Despawn Instant'); From b2a3df0ced9a5eecc6e8a05d6f60406684a6b15b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 14 Jun 2022 22:57:12 +0000 Subject: [PATCH 083/104] chore(DB): import pending files Referenced commit(s): ddd6556681fbe38bddb0c07eb1157de3c3b4e1f1 --- .../privatehendel.sql => db_world/2022_06_14_08.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/privatehendel.sql => db_world/2022_06_14_08.sql} (98%) diff --git a/data/sql/updates/pending_db_world/privatehendel.sql b/data/sql/updates/db_world/2022_06_14_08.sql similarity index 98% rename from data/sql/updates/pending_db_world/privatehendel.sql rename to data/sql/updates/db_world/2022_06_14_08.sql index 3be210bbf..f31e8fec2 100644 --- a/data/sql/updates/pending_db_world/privatehendel.sql +++ b/data/sql/updates/db_world/2022_06_14_08.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_14_07 -> 2022_06_14_08 UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4966; DELETE FROM `smart_scripts` WHERE ((`entryorguid` = 496603) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3))) OR ((`entryorguid` = 496600) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3, 4, 5, 6))) OR ((`entryorguid` = 5184) AND (`source_type` = 0)) OR (`source_type` = 0 AND `entryorguid` = 4966 AND (`id` IN (0, 1, 2, 3, 4, 5, 6, 7))); 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 From e09622b19125f19089dda8051cfadf766b33bda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=B9=BF?= Date: Wed, 15 Jun 2022 10:15:00 +0800 Subject: [PATCH 084/104] fix(Core/Item): Fix TrinketUpdate (#11571) * Update spell_generic.cpp * Add files via upload * Update and rename rev_1650656505854517188.sql to rev_1651226361653358110.sql * Update and rename rev_1651226361653358110.sql to rev_1651231168158458211.sql * Update rev_1651231168158458211.sql --- .../rev_1651231168158458211.sql | 2 + src/server/scripts/Spells/spell_generic.cpp | 43 ------------------- 2 files changed, 2 insertions(+), 43 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1651231168158458211.sql diff --git a/data/sql/updates/pending_db_world/rev_1651231168158458211.sql b/data/sql/updates/pending_db_world/rev_1651231168158458211.sql new file mode 100644 index 000000000..859644875 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1651231168158458211.sql @@ -0,0 +1,2 @@ + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_proc_once_per_cast'; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2a1c06441..7daaa10d4 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -738,48 +738,6 @@ class spell_gen_no_offhand_proc : public AuraScript } }; -/* 71602 - Item - Icecrown 25 Normal Caster Trinket 1 Base - 71645 - Item - Icecrown 25 Heroic Caster Trinket 1 Base - 71845 - Item - Icecrown 25 Normal Caster Weapon Proc - 71846 - Item - Icecrown 25 Heroic Caster Weapon Proc - 72419 - Item - Icecrown Reputation Ring Healer Trigger - 75465 - Item - Chamber of Aspects 25 Nuker Trinket - 75474 - Item - Chamber of Aspects 25 Heroic Nuker Trinket */ -class spell_gen_proc_once_per_cast : public AuraScript -{ - PrepareAuraScript(spell_gen_proc_once_per_cast); - - bool Load() override - { - _spellPointer = nullptr; - return true; - } - - bool CheckProc(ProcEventInfo& eventInfo) - { - if (eventInfo.GetActor()) - { - if (Player* player = eventInfo.GetActor()->ToPlayer()) - { - if (player->m_spellModTakingSpell == _spellPointer) - { - return false; - } - _spellPointer = player->m_spellModTakingSpell; - } - } - return true; - } - - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_gen_proc_once_per_cast::CheckProc); - } - -private: - Spell* _spellPointer; -}; - // 70805 - Item - Rogue T10 2P Bonus class spell_gen_proc_on_self : public AuraScript { @@ -4545,7 +4503,6 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_use_spell_base_level_check); RegisterSpellScript(spell_gen_proc_from_direct_damage); RegisterSpellScript(spell_gen_no_offhand_proc); - RegisterSpellScript(spell_gen_proc_once_per_cast); RegisterSpellScript(spell_gen_proc_on_self); RegisterSpellScript(spell_gen_proc_not_self); RegisterSpellScript(spell_gen_baby_murloc_passive); From f40520cfa0fc7d0de3d63e0c7e0a3085ed0c1b1b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 15 Jun 2022 02:17:06 +0000 Subject: [PATCH 085/104] chore(DB): import pending files Referenced commit(s): e09622b19125f19089dda8051cfadf766b33bda6 --- .../rev_1651231168158458211.sql => db_world/2022_06_15_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1651231168158458211.sql => db_world/2022_06_15_00.sql} (66%) diff --git a/data/sql/updates/pending_db_world/rev_1651231168158458211.sql b/data/sql/updates/db_world/2022_06_15_00.sql similarity index 66% rename from data/sql/updates/pending_db_world/rev_1651231168158458211.sql rename to data/sql/updates/db_world/2022_06_15_00.sql index 859644875..a241ea2c0 100644 --- a/data/sql/updates/pending_db_world/rev_1651231168158458211.sql +++ b/data/sql/updates/db_world/2022_06_15_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_14_08 -> 2022_06_15_00 DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_proc_once_per_cast'; From ae2e11237c937e4c344f5a53727afe3986e544ff Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Wed, 15 Jun 2022 04:18:22 +0200 Subject: [PATCH 086/104] fix(DB/Loot): Increase the drop rate of Ritual Salve (#11906) --- data/sql/updates/pending_db_world/rev_1653810747543320600.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1653810747543320600.sql diff --git a/data/sql/updates/pending_db_world/rev_1653810747543320600.sql b/data/sql/updates/pending_db_world/rev_1653810747543320600.sql new file mode 100644 index 000000000..f3a0782c7 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1653810747543320600.sql @@ -0,0 +1,2 @@ +-- Adjust drop rate of Ritual salve to 72% (based by a sniffer with 325 kills) +UPDATE `creature_loot_template` SET `Chance` = 72 WHERE `Entry` = 2953 AND `Item` = 6634; From 6ffb8aae6eaf46b7b9124564dfb8226baad61342 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 15 Jun 2022 02:20:22 +0000 Subject: [PATCH 087/104] chore(DB): import pending files Referenced commit(s): ae2e11237c937e4c344f5a53727afe3986e544ff --- .../rev_1653810747543320600.sql => db_world/2022_06_15_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1653810747543320600.sql => db_world/2022_06_15_01.sql} (79%) diff --git a/data/sql/updates/pending_db_world/rev_1653810747543320600.sql b/data/sql/updates/db_world/2022_06_15_01.sql similarity index 79% rename from data/sql/updates/pending_db_world/rev_1653810747543320600.sql rename to data/sql/updates/db_world/2022_06_15_01.sql index f3a0782c7..7b5773553 100644 --- a/data/sql/updates/pending_db_world/rev_1653810747543320600.sql +++ b/data/sql/updates/db_world/2022_06_15_01.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_15_00 -> 2022_06_15_01 -- Adjust drop rate of Ritual salve to 72% (based by a sniffer with 325 kills) UPDATE `creature_loot_template` SET `Chance` = 72 WHERE `Entry` = 2953 AND `Item` = 6634; From b5122ab0462e0ccff5db100e751757e542d445e5 Mon Sep 17 00:00:00 2001 From: temperrr Date: Wed, 15 Jun 2022 12:24:45 +0200 Subject: [PATCH 088/104] fix(Scripts/EmeraldDragons): Lethon should use shadow bolt whirl (#12045) Co-authored-by: Nefertumm --- .../pending_db_world/shadowboltwhirl.sql | 3 + .../scripts/World/boss_emerald_dragons.cpp | 64 +++++++++++++------ 2 files changed, 49 insertions(+), 18 deletions(-) create mode 100644 data/sql/updates/pending_db_world/shadowboltwhirl.sql diff --git a/data/sql/updates/pending_db_world/shadowboltwhirl.sql b/data/sql/updates/pending_db_world/shadowboltwhirl.sql new file mode 100644 index 000000000..1b6f3d548 --- /dev/null +++ b/data/sql/updates/pending_db_world/shadowboltwhirl.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` = 24834; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(24834, 'spell_shadow_bolt_whirl'); diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 84a9740f6..b667c468d 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -302,9 +302,6 @@ public: * --- * --- Dragonspecific scripts and handling: LETHON * --- - * - * @todo - * - Spell: Shadow bolt whirl casts needs custom handling (spellscript) */ enum LethonTexts @@ -318,6 +315,14 @@ enum LethonSpells SPELL_DRAW_SPIRIT = 24811, SPELL_SHADOW_BOLT_WHIRL = 24834, SPELL_DARK_OFFERING = 24804, + SPELL_SHADOW_BOLT_WHIRL1 = 24820, + SPELL_SHADOW_BOLT_WHIRL2 = 24821, + SPELL_SHADOW_BOLT_WHIRL3 = 24822, + SPELL_SHADOW_BOLT_WHIRL4 = 24823, + SPELL_SHADOW_BOLT_WHIRL5 = 24835, + SPELL_SHADOW_BOLT_WHIRL6 = 24836, + SPELL_SHADOW_BOLT_WHIRL7 = 24837, + SPELL_SHADOW_BOLT_WHIRL8 = 24838, }; enum LethonCreatures @@ -340,13 +345,14 @@ public: { _stage = 1; emerald_dragonAI::Reset(); - events.ScheduleEvent(EVENT_SHADOW_BOLT_WHIRL, 10000); + me->RemoveAurasDueToSpell(SPELL_SHADOW_BOLT_WHIRL); } void EnterCombat(Unit* who) override { Talk(SAY_LETHON_AGGRO); WorldBossAI::EnterCombat(who); + DoCastSelf(SPELL_SHADOW_BOLT_WHIRL, true); } void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override @@ -368,20 +374,6 @@ public: } } - void ExecuteEvent(uint32 eventId) override - { - switch (eventId) - { - case EVENT_SHADOW_BOLT_WHIRL: - me->CastSpell((Unit*)nullptr, SPELL_SHADOW_BOLT_WHIRL, false); - events.ScheduleEvent(EVENT_SHADOW_BOLT_WHIRL, urand(15000, 30000)); - break; - default: - emerald_dragonAI::ExecuteEvent(eventId); - break; - } - } - private: uint8 _stage; }; @@ -712,6 +704,41 @@ public: } }; +class spell_shadow_bolt_whirl : public AuraScript +{ + PrepareAuraScript(spell_shadow_bolt_whirl); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SHADOW_BOLT_WHIRL1, SPELL_SHADOW_BOLT_WHIRL2, SPELL_SHADOW_BOLT_WHIRL3, SPELL_SHADOW_BOLT_WHIRL4, SPELL_SHADOW_BOLT_WHIRL5, SPELL_SHADOW_BOLT_WHIRL6, SPELL_SHADOW_BOLT_WHIRL7, SPELL_SHADOW_BOLT_WHIRL8 }); + } + + void HandlePeriodic(AuraEffect const* aurEff) + { + Unit* caster = GetCaster(); + Unit* target = GetTarget(); + + if (!caster || !target) + return; + std::array spellForTick = { SPELL_SHADOW_BOLT_WHIRL1, SPELL_SHADOW_BOLT_WHIRL2, SPELL_SHADOW_BOLT_WHIRL3, SPELL_SHADOW_BOLT_WHIRL4, SPELL_SHADOW_BOLT_WHIRL5, SPELL_SHADOW_BOLT_WHIRL6, SPELL_SHADOW_BOLT_WHIRL7, SPELL_SHADOW_BOLT_WHIRL8 }; + uint32 tick = (aurEff->GetTickNumber() + 7/*-1*/) % 8; + + // casted in left/right (but triggered spell have wide forward cone) + float forward = target->GetOrientation(); + if (tick <= 3) + target->SetOrientation(forward + 0.75f * M_PI - tick * M_PI / 8); // Left + else + target->SetOrientation(forward - 0.75f * M_PI + (8 - tick) * M_PI / 8); // Right + + target->CastSpell(target, spellForTick[tick], true); + target->SetOrientation(forward); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadow_bolt_whirl::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; class spell_mark_of_nature : public SpellScriptLoader { public: @@ -765,4 +792,5 @@ void AddSC_emerald_dragons() // dragon spellscripts new spell_dream_fog_sleep(); new spell_mark_of_nature(); + RegisterSpellScript(spell_shadow_bolt_whirl); }; From 36f0a7757bde9573262f298aa1eaf6765af8295e Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 15 Jun 2022 10:26:57 +0000 Subject: [PATCH 089/104] chore(DB): import pending files Referenced commit(s): b5122ab0462e0ccff5db100e751757e542d445e5 --- .../shadowboltwhirl.sql => db_world/2022_06_15_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/shadowboltwhirl.sql => db_world/2022_06_15_02.sql} (78%) diff --git a/data/sql/updates/pending_db_world/shadowboltwhirl.sql b/data/sql/updates/db_world/2022_06_15_02.sql similarity index 78% rename from data/sql/updates/pending_db_world/shadowboltwhirl.sql rename to data/sql/updates/db_world/2022_06_15_02.sql index 1b6f3d548..ca8cb88b0 100644 --- a/data/sql/updates/pending_db_world/shadowboltwhirl.sql +++ b/data/sql/updates/db_world/2022_06_15_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_15_01 -> 2022_06_15_02 DELETE FROM `spell_script_names` WHERE `spell_id` = 24834; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (24834, 'spell_shadow_bolt_whirl'); From 46bc0696f81ae1dff04daf60bf99a7121750322d Mon Sep 17 00:00:00 2001 From: temperrr Date: Thu, 16 Jun 2022 13:43:48 +0200 Subject: [PATCH 090/104] fix(DB/Smartscripts): Darnassian hunter should melee when closed range (#12056) * fix(DB/Smartscripts): Darnassian hunter should melee when closed range and fixed smart script errors * Update huntress.sql --- data/sql/updates/pending_db_world/huntress.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 data/sql/updates/pending_db_world/huntress.sql diff --git a/data/sql/updates/pending_db_world/huntress.sql b/data/sql/updates/pending_db_world/huntress.sql new file mode 100644 index 000000000..158b1b069 --- /dev/null +++ b/data/sql/updates/pending_db_world/huntress.sql @@ -0,0 +1,18 @@ +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 16332; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16332); +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 +(16332, 0, 0, 1, 1, 0, 100, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Out of Combat - Disable Combat Movement'), +(16332, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Out of Combat - Stop Attacking'), +(16332, 0, 2, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 11, 6660, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - On Aggro - Cast \'Shoot\''), +(16332, 0, 3, 4, 9, 0, 100, 0, 5, 30, 2300, 3900, 0, 11, 6660, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 5-30 Range - Cast \'Shoot\''), +(16332, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 40, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 5-30 Range - Set Sheath Ranged'), +(16332, 0, 5, 6, 9, 0, 100, 0, 25, 80, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 25-80 Range - Enable Combat Movement'), +(16332, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 25-80 Range - Start Attacking'), +(16332, 0, 7, 8, 9, 0, 100, 0, 0, 5, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 0-5 Range - Enable Combat Movement'), +(16332, 0, 8, 9, 61, 0, 100, 0, 0, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 0-5 Range - Set Sheath Melee'), +(16332, 0, 9, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 20, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 0-5 Range - Start Attacking'), +(16332, 0, 10, 0, 9, 0, 100, 0, 5, 15, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 5-15 Range - Disable Combat Movement'), +(16332, 0, 11, 0, 9, 0, 100, 0, 0, 5, 5000, 9000, 0, 11, 11976, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Within 0-5 Range - Cast \'Strike\''), +(16332, 0, 12, 13, 2, 0, 100, 0, 0, 15, 0, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Between 0-15% Health - Enable Combat Movement'), +(16332, 0, 13, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - Between 0-15% Health - Flee For Assist'), +(16332, 0, 14, 0, 7, 0, 100, 0, 0, 0, 0, 0, 0, 40, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Huntress - On Evade - Set Sheath Melee'); From 17b84ffabc84c6e2c28c820a9ab40bcf995c1ab3 Mon Sep 17 00:00:00 2001 From: temperrr Date: Thu, 16 Jun 2022 13:44:09 +0200 Subject: [PATCH 091/104] fix(DB/QuestTemplate): Mission Accomplished! sent correct mail to player (#12055) * fix(DB/QuestTemplate): Mission Accomplished! sent correct mail to player * Update derrington.sql --- data/sql/updates/pending_db_world/derrington.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/derrington.sql diff --git a/data/sql/updates/pending_db_world/derrington.sql b/data/sql/updates/pending_db_world/derrington.sql new file mode 100644 index 000000000..f32651187 --- /dev/null +++ b/data/sql/updates/pending_db_world/derrington.sql @@ -0,0 +1,2 @@ +UPDATE `quest_template_addon` SET `RewardMailTemplateID` = 107 WHERE (`ID` = 5237); +UPDATE `quest_template_addon` SET `RewardMailTemplateID` = 101 WHERE (`ID` = 5238); From ee6ad8d755f5c1fae56407ed7c05edc7553e6ae2 Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Thu, 16 Jun 2022 05:44:41 -0600 Subject: [PATCH 092/104] fix(DB/creature_template): Hide 'Flame of Ragnaros' (#12040) init Co-authored-by: Si1ker --- data/sql/updates/pending_db_world/rev_1655079819870509800.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1655079819870509800.sql diff --git a/data/sql/updates/pending_db_world/rev_1655079819870509800.sql b/data/sql/updates/pending_db_world/rev_1655079819870509800.sql new file mode 100644 index 000000000..0184584fe --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1655079819870509800.sql @@ -0,0 +1,3 @@ +-- +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432,`flags_extra`=`flags_extra`|2 WHERE `entry`=13148; + From daff1239d316854126b6c1ad8951e8a20df6d939 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Thu, 16 Jun 2022 13:45:46 +0200 Subject: [PATCH 093/104] fix(Core/Units): Fixed restoring running movement flag after charm. Source: TrinityCore (#12019) fix(Core/Units): Fixed restoring running movement flag after charm. Fixes #12018 --- src/server/game/Entities/Unit/Unit.cpp | 14 +++++++++++++- src/server/game/Entities/Unit/Unit.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4f972f3b9..d6c8c4747 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -315,6 +315,8 @@ Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject), _oldFactionId = 0; + _isWalkingBeforeCharm = false; + _lastExtraAttackSpell = 0; } @@ -10464,8 +10466,12 @@ void Unit::SetCharm(Unit* charm, bool apply) if (!charm->AddGuidValue(UNIT_FIELD_CHARMEDBY, GetGUID())) LOG_FATAL("entities.unit", "Unit {} is being charmed, but it already has a charmer {}", charm->GetEntry(), charm->GetCharmerGUID().ToString()); - if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) + _isWalkingBeforeCharm = charm->IsWalking(); + if (_isWalkingBeforeCharm) + { charm->SetWalk(false); + charm->SendMovementFlagUpdate(); + } m_Controlled.insert(charm); } @@ -10503,6 +10509,12 @@ void Unit::SetCharm(Unit* charm, bool apply) charm->SetByteValue(UNIT_FIELD_BYTES_2, 1, 0); } + if (charm->IsWalking() != _isWalkingBeforeCharm) + { + charm->SetWalk(_isWalkingBeforeCharm); + charm->SendMovementFlagUpdate(true); // send packet to self, to update movement state on player. + } + m_Controlled.erase(charm); } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index b08456ad7..7229ef068 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2548,6 +2548,7 @@ private: bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world uint32 _oldFactionId; ///< faction before charm + bool _isWalkingBeforeCharm; ///< Are we walking before we were charmed? [[nodiscard]] float processDummyAuras(float TakenTotalMod) const; From 1ad475bc64cbb21cd89be0d05129bfbb0ca72ee0 Mon Sep 17 00:00:00 2001 From: temperrr Date: Thu, 16 Jun 2022 13:46:08 +0200 Subject: [PATCH 094/104] Fix(DB/Creature): Kroshius should be targetable. (#12043) --- data/sql/updates/pending_db_world/kroshius.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/kroshius.sql diff --git a/data/sql/updates/pending_db_world/kroshius.sql b/data/sql/updates/pending_db_world/kroshius.sql new file mode 100644 index 000000000..dedc574d7 --- /dev/null +++ b/data/sql/updates/pending_db_world/kroshius.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `unit_flags` = `unit_flags`&~33554432 WHERE `entry` = 14467; From 97511abe1e4e5daffdf1e097ddef2a159d41dc1b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 16 Jun 2022 11:48:16 +0000 Subject: [PATCH 095/104] chore(DB): import pending files Referenced commit(s): 1ad475bc64cbb21cd89be0d05129bfbb0ca72ee0 --- .../derrington.sql => db_world/2022_06_16_00.sql} | 1 + .../huntress.sql => db_world/2022_06_16_01.sql} | 1 + .../kroshius.sql => db_world/2022_06_16_02.sql} | 1 + .../rev_1655079819870509800.sql => db_world/2022_06_16_03.sql} | 1 + 4 files changed, 4 insertions(+) rename data/sql/updates/{pending_db_world/derrington.sql => db_world/2022_06_16_00.sql} (79%) rename data/sql/updates/{pending_db_world/huntress.sql => db_world/2022_06_16_01.sql} (98%) rename data/sql/updates/{pending_db_world/kroshius.sql => db_world/2022_06_16_02.sql} (67%) rename data/sql/updates/{pending_db_world/rev_1655079819870509800.sql => db_world/2022_06_16_03.sql} (73%) diff --git a/data/sql/updates/pending_db_world/derrington.sql b/data/sql/updates/db_world/2022_06_16_00.sql similarity index 79% rename from data/sql/updates/pending_db_world/derrington.sql rename to data/sql/updates/db_world/2022_06_16_00.sql index f32651187..18a97b91c 100644 --- a/data/sql/updates/pending_db_world/derrington.sql +++ b/data/sql/updates/db_world/2022_06_16_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_06_15_02 -> 2022_06_16_00 UPDATE `quest_template_addon` SET `RewardMailTemplateID` = 107 WHERE (`ID` = 5237); UPDATE `quest_template_addon` SET `RewardMailTemplateID` = 101 WHERE (`ID` = 5238); diff --git a/data/sql/updates/pending_db_world/huntress.sql b/data/sql/updates/db_world/2022_06_16_01.sql similarity index 98% rename from data/sql/updates/pending_db_world/huntress.sql rename to data/sql/updates/db_world/2022_06_16_01.sql index 158b1b069..c62e4fe55 100644 --- a/data/sql/updates/pending_db_world/huntress.sql +++ b/data/sql/updates/db_world/2022_06_16_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_16_00 -> 2022_06_16_01 UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 16332; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 16332); 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 diff --git a/data/sql/updates/pending_db_world/kroshius.sql b/data/sql/updates/db_world/2022_06_16_02.sql similarity index 67% rename from data/sql/updates/pending_db_world/kroshius.sql rename to data/sql/updates/db_world/2022_06_16_02.sql index dedc574d7..bfb747fc4 100644 --- a/data/sql/updates/pending_db_world/kroshius.sql +++ b/data/sql/updates/db_world/2022_06_16_02.sql @@ -1 +1,2 @@ +-- DB update 2022_06_16_01 -> 2022_06_16_02 UPDATE `creature_template` SET `unit_flags` = `unit_flags`&~33554432 WHERE `entry` = 14467; diff --git a/data/sql/updates/pending_db_world/rev_1655079819870509800.sql b/data/sql/updates/db_world/2022_06_16_03.sql similarity index 73% rename from data/sql/updates/pending_db_world/rev_1655079819870509800.sql rename to data/sql/updates/db_world/2022_06_16_03.sql index 0184584fe..ba16a6b88 100644 --- a/data/sql/updates/pending_db_world/rev_1655079819870509800.sql +++ b/data/sql/updates/db_world/2022_06_16_03.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_16_02 -> 2022_06_16_03 -- UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432,`flags_extra`=`flags_extra`|2 WHERE `entry`=13148; From 117a18c9617de898488bb7f2d2d9515410a6bea5 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Thu, 16 Jun 2022 16:39:09 +0200 Subject: [PATCH 096/104] fix(Scripts/ZulGurub): Renataki - improvements: (#11967) Added missing spells and events. Removed invalid spells Corrected event timers Fixes #11620 Fixes #11621 --- src/server/game/AI/CreatureAI.h | 1 + .../game/Entities/Creature/Creature.cpp | 15 + src/server/game/Entities/Creature/Creature.h | 1 + .../ZulGurub/boss_renataki.cpp | 270 +++++++++++------- 4 files changed, 189 insertions(+), 98 deletions(-) diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index e74b065a9..f08e5eaf8 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -196,6 +196,7 @@ public: virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; } virtual bool CanBeSeen(Player const* /*seer*/) { return true; } + virtual bool CanAlwaysBeDetectable(WorldObject const* /*seer*/) { return false; } virtual void PetStopAttack() { } diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 50dc8391d..dec39c8c3 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1809,6 +1809,21 @@ bool Creature::CanAlwaysSee(WorldObject const* obj) const return false; } +bool Creature::IsAlwaysDetectableFor(WorldObject const* seer) const +{ + if (Unit::IsAlwaysDetectableFor(seer)) + { + return true; + } + + if (IsAIEnabled && AI()->CanAlwaysBeDetectable(seer)) + { + return true; + } + + return false; +} + bool Creature::CanStartAttack(Unit const* who) const { if (IsCivilian()) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 5215bbb05..8355ce428 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -444,6 +444,7 @@ protected: [[nodiscard]] bool IsInvisibleDueToDespawn() const override; bool CanAlwaysSee(WorldObject const* obj) const override; + bool IsAlwaysDetectableFor(WorldObject const* seer) const override; private: void ForcedDespawn(uint32 timeMSToDespawn = 0, Seconds forcedRespawnTimer = 0s); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index 7bcbf01b7..51c05e37c 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -28,13 +28,20 @@ EndScriptData */ enum Spells { - SPELL_AMBUSH = 34794, - SPELL_THOUSANDBLADES = 34799 + SPELL_VANISH = 24699, + SPELL_AMBUSH = 24337, + SPELL_GOUGE = 24698, + SPELL_THOUSAND_BLADES = 24649, + SPELL_THRASH = 3417, + SPELL_ENRAGE = 8269 }; -enum Misc +enum Events { - EQUIP_ID_MAIN_HAND = 0 //was item display id 31818, but this id does not exist + EVENT_VANISH = 1, + EVENT_AMBUSH = 2, + EVENT_GOUGE = 3, + EVENT_THOUSAND_BLADES = 4 }; class boss_renataki : public CreatureScript @@ -46,36 +53,67 @@ public: { boss_renatakiAI(Creature* creature) : BossAI(creature, DATA_EDGE_OF_MADNESS) { } - uint32 Invisible_Timer; - uint32 Ambush_Timer; - uint32 Visible_Timer; - uint32 Aggro_Timer; - uint32 ThousandBlades_Timer; - - bool Invisible; - bool Ambushed; - void Reset() override { _Reset(); - Invisible_Timer = urand(8000, 18000); - Ambush_Timer = 3000; - Visible_Timer = 4000; - Aggro_Timer = urand(15000, 25000); - ThousandBlades_Timer = urand(4000, 8000); - - Invisible = false; - Ambushed = false; - } - - void JustDied(Unit* /*killer*/) override - { - _JustDied(); + me->SetReactState(REACT_AGGRESSIVE); + _enraged = false; + _thousandBladesCount = urand(2, 5); + _thousandBladesTargets.clear(); + _dynamicFlags = me->GetDynamicFlags(); } void EnterCombat(Unit* /*who*/) override { _EnterCombat(); + events.ScheduleEvent(EVENT_VANISH, 23s, 25s); + events.ScheduleEvent(EVENT_GOUGE, 5s, 10s); + events.ScheduleEvent(EVENT_THOUSAND_BLADES, 15s, 20s); + + DoCastSelf(SPELL_THRASH, true); + } + + void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + { + if (!_enraged && HealthBelowPct(30)) + { + me->TextEmote("%s becomes enraged", me, false); + DoCast(me, SPELL_ENRAGE); + _enraged = true; + } + } + + bool CanAIAttack(Unit const* target) const override + { + if (me->GetThreatMgr().getThreatList().size() > 1 && me->GetThreatMgr().getOnlineContainer().getMostHated()->getTarget() == target) + return !target->HasAura(SPELL_GOUGE); + + return true; + } + + bool CanBeSeen(Player const* /*player*/) override + { + return me->GetReactState() == REACT_AGGRESSIVE; + } + + bool CanSeeAlways(WorldObject const* obj) override + { + if (me->GetReactState() == REACT_PASSIVE) + { + return obj->ToCreature() && obj->ToCreature()->IsPet(); + } + + return false; + } + + bool CanAlwaysBeDetectable(WorldObject const* seer) override + { + if (me->GetReactState() == REACT_PASSIVE) + { + return seer->ToCreature() && seer->ToCreature()->IsPet(); + } + + return false; } void UpdateAI(uint32 diff) override @@ -83,86 +121,122 @@ public: if (!UpdateVictim()) return; - //Invisible_Timer - if (Invisible_Timer <= diff) + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - me->SetDisplayId(11686); - - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - Invisible = true; - - Invisible_Timer = urand(15000, 30000); - } - else Invisible_Timer -= diff; - - if (Invisible) - { - if (Ambush_Timer <= diff) + switch (eventId) { - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - if (target) + case EVENT_VANISH: + me->SetReactState(REACT_PASSIVE); + _dynamicFlags = me->GetDynamicFlags(); + me->RemoveDynamicFlag(UNIT_DYNFLAG_TRACK_UNIT); + DoCastSelf(SPELL_VANISH); + events.DelayEvents(5s); + events.ScheduleEvent(EVENT_AMBUSH, 5s); + events.ScheduleEvent(EVENT_VANISH, 38s, 45s); + return; + case EVENT_AMBUSH: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1)) + { + me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation()); + DoCast(target, SPELL_AMBUSH, true); + } + me->SetDynamicFlag(_dynamicFlags); + me->RemoveAurasDueToSpell(SPELL_VANISH); + me->SetReactState(REACT_AGGRESSIVE); + break; + case EVENT_GOUGE: + DoCastAOE(SPELL_GOUGE); + events.ScheduleEvent(EVENT_GOUGE, 10s, 15s); + return; + case EVENT_THOUSAND_BLADES: { - me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation()); - DoCast(target, SPELL_AMBUSH); - } + if (_thousandBladesTargets.empty()) + { + std::vector targetList; + ThreatContainer::StorageType const& threatlist = me->GetThreatMgr().getThreatList(); + for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) + { + if (Unit* target = (*itr)->getTarget()) + { + if (target->IsAlive() && target->IsWithinDist2d(me, 100.f)) + { + targetList.push_back(target); + } + } + } - Ambushed = true; - Ambush_Timer = 3000; + if (!targetList.empty()) + { + Acore::Containers::RandomShuffle(targetList); + + // First get ranged targets + for (Unit* target : targetList) + { + if (!target->IsWithinMeleeRange(me)) + { + _thousandBladesTargets.push_back(target); + } + } + + if (_thousandBladesTargets.size() < _thousandBladesCount) + { + // if still not enough, get melee targets + for (Unit* target : targetList) + { + if (target->IsWithinMeleeRange(me)) + { + _thousandBladesTargets.push_back(target); + } + } + } + + if (!_thousandBladesTargets.empty()) + { + Acore::Containers::RandomResize(_thousandBladesTargets, _thousandBladesCount); + } + } + } + + if (!_thousandBladesTargets.empty()) + { + std::vector::iterator itr = _thousandBladesTargets.begin(); + std::advance(itr, urand(0, _thousandBladesTargets.size() - 1)); + + if (Unit* target = *itr) + { + DoCast(target, SPELL_THOUSAND_BLADES, false); + } + + _thousandBladesTargets.erase(itr); + + events.ScheduleEvent(EVENT_THOUSAND_BLADES, 500ms); + } + else + { + _thousandBladesCount = urand(2, 5); + events.ScheduleEvent(EVENT_THOUSAND_BLADES, 15s, 22s); + } + break; + } + default: + break; } - else Ambush_Timer -= diff; } - if (Ambushed) - { - if (Visible_Timer <= diff) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - - me->SetDisplayId(15268); - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - Invisible = false; - - Visible_Timer = 4000; - } - else Visible_Timer -= diff; - } - - //Resetting some aggro so he attacks other gamers - if (!Invisible) - { - if (Aggro_Timer <= diff) - { - Unit* target = SelectTarget(SelectTargetMethod::Random, 1); - - if (DoGetThreat(me->GetVictim())) - { - DoModifyThreatPercent(me->GetVictim(), -50); - } - - if (target) - { - AttackStart(target); - } - - Aggro_Timer = urand(7000, 20000); - } - else Aggro_Timer -= diff; - - if (ThousandBlades_Timer <= diff) - { - DoCastVictim(SPELL_THOUSANDBLADES); - ThousandBlades_Timer = urand(7000, 12000); - } - else ThousandBlades_Timer -= diff; - } - - DoMeleeAttackIfReady(); + if (me->GetReactState() == REACT_AGGRESSIVE) + DoMeleeAttackIfReady(); } + + private: + bool _enraged; + uint32 _dynamicFlags; + uint8 _thousandBladesCount; + std::vector _thousandBladesTargets; }; CreatureAI* GetAI(Creature* creature) const override From 59eab6aae150582f0ea93ecc57afe27a5103ce3c Mon Sep 17 00:00:00 2001 From: temperrr Date: Thu, 16 Jun 2022 16:47:31 +0200 Subject: [PATCH 097/104] Fix(DB/Creature): Zul'Gurub boss damage (#11977) --- data/sql/updates/pending_db_world/zgbossdamage.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 data/sql/updates/pending_db_world/zgbossdamage.sql diff --git a/data/sql/updates/pending_db_world/zgbossdamage.sql b/data/sql/updates/pending_db_world/zgbossdamage.sql new file mode 100644 index 000000000..13bc6b974 --- /dev/null +++ b/data/sql/updates/pending_db_world/zgbossdamage.sql @@ -0,0 +1,10 @@ +UPDATE `creature_template` SET `DamageModifier` = 29, `BaseAttackTime` = 1100 WHERE (`entry` = 15114); +UPDATE `creature_template` SET `DamageModifier` = 27, `BaseAttackTime` = 1300 WHERE (`entry` = 15083); +UPDATE `creature_template` SET `DamageModifier` = 24, `BaseAttackTime` = 2000 WHERE (`entry` = 15085); +UPDATE `creature_template` SET `DamageModifier` = 23, `BaseAttackTime` = 1108 WHERE (`entry` = 15084); +UPDATE `creature_template` SET `DamageModifier` = 20 WHERE `entry` IN (14834, 15082); +UPDATE `creature_template` SET `DamageModifier` = 17 WHERE `entry` IN (11382, 11380); +UPDATE `creature_template` SET `DamageModifier` = 15 WHERE `entry` IN (14517, 14515); +UPDATE `creature_template` SET `DamageModifier` = 14 WHERE `entry` IN (14510, 14507); +UPDATE `creature_template` SET `DamageModifier` = 13 WHERE (`entry` = 14509); +UPDATE `creature_template` SET `BaseAttackTime` = 1108 WHERE (`entry` = 15084); From b75c67aad185991ecd802d732e5c620b7ea6512b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 16 Jun 2022 14:49:31 +0000 Subject: [PATCH 098/104] chore(DB): import pending files Referenced commit(s): 59eab6aae150582f0ea93ecc57afe27a5103ce3c --- .../zgbossdamage.sql => db_world/2022_06_16_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/zgbossdamage.sql => db_world/2022_06_16_04.sql} (95%) diff --git a/data/sql/updates/pending_db_world/zgbossdamage.sql b/data/sql/updates/db_world/2022_06_16_04.sql similarity index 95% rename from data/sql/updates/pending_db_world/zgbossdamage.sql rename to data/sql/updates/db_world/2022_06_16_04.sql index 13bc6b974..3ab4502ef 100644 --- a/data/sql/updates/pending_db_world/zgbossdamage.sql +++ b/data/sql/updates/db_world/2022_06_16_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_16_03 -> 2022_06_16_04 UPDATE `creature_template` SET `DamageModifier` = 29, `BaseAttackTime` = 1100 WHERE (`entry` = 15114); UPDATE `creature_template` SET `DamageModifier` = 27, `BaseAttackTime` = 1300 WHERE (`entry` = 15083); UPDATE `creature_template` SET `DamageModifier` = 24, `BaseAttackTime` = 2000 WHERE (`entry` = 15085); From 235d2b6cf49df109d7ab05d5c54ed9551f1b7e02 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Thu, 16 Jun 2022 17:07:48 +0200 Subject: [PATCH 099/104] fix(Scripts/ZulGurub): Fixed spawning Edge of Madness bosses. (#11957) Fixes #11609 --- .../rev_1654355427387277800.sql | 9 ++++ .../ZulGurub/instance_zulgurub.cpp | 50 +++++++++++++++++++ .../EasternKingdoms/ZulGurub/zulgurub.h | 6 ++- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1654355427387277800.sql diff --git a/data/sql/updates/pending_db_world/rev_1654355427387277800.sql b/data/sql/updates/pending_db_world/rev_1654355427387277800.sql new file mode 100644 index 000000000..e583502b1 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1654355427387277800.sql @@ -0,0 +1,9 @@ +-- +DELETE FROM `game_event_gameobject` WHERE `guid`=28704; +INSERT INTO `game_event_gameobject` VALUES +(27,28704), +(28,28704), +(29,28704), +(30,28704); + +UPDATE `gameobject_template` SET `ScriptName`='go_brazier_of_madness' WHERE `entry`=180327; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 6e99c2fb6..2cab32c31 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -22,6 +22,7 @@ SDComment: Missing reset function after killing a boss for Ohgan, Thekal. SDCategory: Zul'Gurub EndScriptData */ +#include "GameObjectAI.h" #include "InstanceScript.h" #include "ScriptMgr.h" #include "zulgurub.h" @@ -194,7 +195,56 @@ public: } }; +enum EdgeOfMadnessEnum +{ + EVENT_EDGE_OF_MADNESS_GRILEK = 27, + EVENT_EDGE_OF_MADNESS_HAZZARAH = 28, + EVENT_EDGE_OF_MADNESS_RENATAKI = 29, + EVENT_EDGE_OF_MADNESS_WUSHOOLAY = 30 +}; + +std::vector> BrazierOfMadnessContainer = +{ + { EVENT_EDGE_OF_MADNESS_GRILEK, NPC_GRILEK }, + { EVENT_EDGE_OF_MADNESS_HAZZARAH, NPC_HAZZARAH }, + { EVENT_EDGE_OF_MADNESS_RENATAKI, NPC_RENATAKI }, + { EVENT_EDGE_OF_MADNESS_WUSHOOLAY, NPC_WUSHOOLAY } +}; + +Position const edgeOfMagnessSummonPos = { -11901.229f, -1906.366f, 65.358f, 0.942f }; + +struct go_brazier_of_madness : public GameObjectAI +{ + go_brazier_of_madness(GameObject* go) : GameObjectAI(go) { } + + bool GossipHello(Player* /*player*/, bool reportUse) override + { + if (reportUse) + { + return true; + } + + uint32 bossEntry = 0; + for (uint8 i = 0; i < 4; ++i) + { + if (sGameEventMgr->IsActiveEvent(BrazierOfMadnessContainer[i].first)) + { + bossEntry = BrazierOfMadnessContainer[i].second; + break; + } + } + + if (bossEntry) + { + me->SummonCreature(bossEntry, edgeOfMagnessSummonPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2 * HOUR * IN_MILLISECONDS); + } + + return false; + } +}; + void AddSC_instance_zulgurub() { new instance_zulgurub(); + RegisterGameObjectAI(go_brazier_of_madness); } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 8736e5d4d..232328acf 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -63,7 +63,11 @@ enum CreatureIds NPC_HAKKAR = 14834, NPC_ZULGURUB_TIGER = 11361, NPC_BRAIN_WASH_TOTEM = 15112, - NPC_GAHZRANKA = 15114 + NPC_GAHZRANKA = 15114, + NPC_GRILEK = 15082, + NPC_HAZZARAH = 15083, + NPC_RENATAKI = 15084, + NPC_WUSHOOLAY = 15085 }; enum GameobjectIds From 26e5b4230812192020e5118a610b39a21d2528c3 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 16 Jun 2022 15:09:58 +0000 Subject: [PATCH 100/104] chore(DB): import pending files Referenced commit(s): 235d2b6cf49df109d7ab05d5c54ed9551f1b7e02 --- .../rev_1654355427387277800.sql => db_world/2022_06_16_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1654355427387277800.sql => db_world/2022_06_16_05.sql} (84%) diff --git a/data/sql/updates/pending_db_world/rev_1654355427387277800.sql b/data/sql/updates/db_world/2022_06_16_05.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1654355427387277800.sql rename to data/sql/updates/db_world/2022_06_16_05.sql index e583502b1..f6ddd8606 100644 --- a/data/sql/updates/pending_db_world/rev_1654355427387277800.sql +++ b/data/sql/updates/db_world/2022_06_16_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_16_04 -> 2022_06_16_05 -- DELETE FROM `game_event_gameobject` WHERE `guid`=28704; INSERT INTO `game_event_gameobject` VALUES From 386bade2a5c5f7d7f9877fd5e0332fcdcf59a0fb Mon Sep 17 00:00:00 2001 From: temperrr Date: Thu, 16 Jun 2022 17:10:38 +0200 Subject: [PATCH 101/104] Fix(DB/Creature): Spirit Shade should be immune to AOE (#12044) --- data/sql/updates/pending_db_world/spiritshade.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/spiritshade.sql diff --git a/data/sql/updates/pending_db_world/spiritshade.sql b/data/sql/updates/pending_db_world/spiritshade.sql new file mode 100644 index 000000000..ce565bc50 --- /dev/null +++ b/data/sql/updates/pending_db_world/spiritshade.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `flags_extra` = `flags_extra`|4194304 WHERE `entry` = 15261; From 677bfb48ed3620b4b5939aa0e0f244fc94bdf60b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 16 Jun 2022 15:12:40 +0000 Subject: [PATCH 102/104] chore(DB): import pending files Referenced commit(s): 386bade2a5c5f7d7f9877fd5e0332fcdcf59a0fb --- .../spiritshade.sql => db_world/2022_06_16_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/spiritshade.sql => db_world/2022_06_16_06.sql} (67%) diff --git a/data/sql/updates/pending_db_world/spiritshade.sql b/data/sql/updates/db_world/2022_06_16_06.sql similarity index 67% rename from data/sql/updates/pending_db_world/spiritshade.sql rename to data/sql/updates/db_world/2022_06_16_06.sql index ce565bc50..c000d7d3f 100644 --- a/data/sql/updates/pending_db_world/spiritshade.sql +++ b/data/sql/updates/db_world/2022_06_16_06.sql @@ -1 +1,2 @@ +-- DB update 2022_06_16_05 -> 2022_06_16_06 UPDATE `creature_template` SET `flags_extra` = `flags_extra`|4194304 WHERE `entry` = 15261; From 84295280c3fe16e337276c17511b2d1db1df3962 Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Thu, 16 Jun 2022 09:13:11 -0600 Subject: [PATCH 103/104] fix(DB/SAI): Son of Hakkar - Poison cloud (#12036) --- .../pending_db_world/rev_1655057474773403000.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1655057474773403000.sql diff --git a/data/sql/updates/pending_db_world/rev_1655057474773403000.sql b/data/sql/updates/pending_db_world/rev_1655057474773403000.sql new file mode 100644 index 000000000..4df62e01f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1655057474773403000.sql @@ -0,0 +1,10 @@ + +UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=2 WHERE `entry`=14989; +DELETE FROM `smart_scripts` WHERE `entryorguid`= 14989 AND `source_type`= 0 AND `id`= 0; +INSERT INTO `smart_scripts` (`entryorguid`, `event_type`, `event_flags`, `action_type`, `action_param1`, `target_type`, `comment`) VALUES +(14989, 54, 1, 11, 26744, 1, 'Poisonous Cloud - OOC - Cast \'Serverside - Poisonous Blood\''); + +DELETE FROM `smart_scripts` WHERE `entryorguid`= 11357 AND `source_type`= 0 AND `id`= 2; +INSERT INTO `smart_scripts` (`entryorguid`, `id`, `event_type`, `event_flags`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `target_type`, `comment`) VALUES +(11357, 2, 6, 512, 12, 14989, 3, 10000, 1, 'Son of Hakkar - On Just Died - Summon \'Poisonous Cloud\''); + From 4bc99f8070cf8f38452e18585a0ff668478a8510 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 16 Jun 2022 15:15:19 +0000 Subject: [PATCH 104/104] chore(DB): import pending files Referenced commit(s): 84295280c3fe16e337276c17511b2d1db1df3962 --- .../rev_1655057474773403000.sql => db_world/2022_06_16_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1655057474773403000.sql => db_world/2022_06_16_07.sql} (94%) diff --git a/data/sql/updates/pending_db_world/rev_1655057474773403000.sql b/data/sql/updates/db_world/2022_06_16_07.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1655057474773403000.sql rename to data/sql/updates/db_world/2022_06_16_07.sql index 4df62e01f..bc5b08313 100644 --- a/data/sql/updates/pending_db_world/rev_1655057474773403000.sql +++ b/data/sql/updates/db_world/2022_06_16_07.sql @@ -1,3 +1,4 @@ +-- DB update 2022_06_16_06 -> 2022_06_16_07 UPDATE `creature_template` SET `AIName`='SmartAI',`flags_extra`=2 WHERE `entry`=14989; DELETE FROM `smart_scripts` WHERE `entryorguid`= 14989 AND `source_type`= 0 AND `id`= 0;