From 18b7b6c273e732db59695ba50b972ed058187b4d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 28 Jul 2022 01:03:45 -0300 Subject: [PATCH 001/161] fix(Scripts/RuinsOfAhnQiraj): Limit Moan's mana drain to 6 targets (#12551) * fix(Scripts/RuinsOfAhnQiraj): Limit Moan's mana drain to 6 targets * fix copy paste failure --- src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index a4f70a104..31ca81096 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -148,6 +148,11 @@ class spell_moam_mana_drain_filter : public SpellScript { return !target->IsPlayer() || target->ToPlayer()->getPowerType() != POWER_MANA; }); + + if (!targets.empty()) + { + Acore::Containers::RandomResize(targets, 6); + } } void HandleScript(SpellEffIndex /*effIndex*/) @@ -160,7 +165,7 @@ class spell_moam_mana_drain_filter : public SpellScript void Register() override { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_moam_mana_drain_filter::FilterTargets, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_moam_mana_drain_filter::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY); OnEffectHitTarget += SpellEffectFn(spell_moam_mana_drain_filter::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; From 62ffa75765de9f904959239a268331b727de8148 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Fri, 29 Jul 2022 09:39:47 -0300 Subject: [PATCH 002/161] fix(Scripts/EmeraldDragons): fix summon player spam (#12573) --- src/server/scripts/World/boss_emerald_dragons.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 5d0a3d35e..6331f16fb 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -64,6 +64,7 @@ enum Events EVENT_SEEPING_FOG = 1, EVENT_NOXIOUS_BREATH, EVENT_TAIL_SWEEP, + EVENT_SUMMON_PLAYER, // Ysondre EVENT_LIGHTNING_WAVE, @@ -102,6 +103,7 @@ struct emerald_dragonAI : public WorldBossAI events.ScheduleEvent(EVENT_TAIL_SWEEP, 4000); events.ScheduleEvent(EVENT_NOXIOUS_BREATH, urand(7500, 15000)); events.ScheduleEvent(EVENT_SEEPING_FOG, urand(12500, 20000)); + events.ScheduleEvent(EVENT_SUMMON_PLAYER, 1s); } // Target killed during encounter, mark them as suspectible for Aura Of Nature @@ -133,6 +135,12 @@ struct emerald_dragonAI : public WorldBossAI DoCast(me, SPELL_TAIL_SWEEP); events.ScheduleEvent(EVENT_TAIL_SWEEP, 2000); break; + case EVENT_SUMMON_PLAYER: + if (Unit* target = me->GetVictim()) + if (!target->IsWithinRange(me, 50.f)) + DoCast(target, SPELL_SUMMON_PLAYER); + events.ScheduleEvent(EVENT_SUMMON_PLAYER, 500ms); + break; } } @@ -149,9 +157,6 @@ struct emerald_dragonAI : public WorldBossAI while (uint32 eventId = events.ExecuteEvent()) ExecuteEvent(eventId); - if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, -50.0f, true)) - DoCast(target, SPELL_SUMMON_PLAYER); - DoMeleeAttackIfReady(); } }; From 609f98fd9bb325fcbff516450ba37c5a2f79ae88 Mon Sep 17 00:00:00 2001 From: temperrr Date: Fri, 29 Jul 2022 14:41:30 +0200 Subject: [PATCH 003/161] fix(DB/Loot): emerald dragons should skin dreamscale (#12569) * fix(DB/SkinningLootTemplate): emerald dragons should skin dreamscale * initial commit --- .../updates/pending_db_world/emeralddragonsskinloot.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/sql/updates/pending_db_world/emeralddragonsskinloot.sql diff --git a/data/sql/updates/pending_db_world/emeralddragonsskinloot.sql b/data/sql/updates/pending_db_world/emeralddragonsskinloot.sql new file mode 100644 index 000000000..ced308115 --- /dev/null +++ b/data/sql/updates/pending_db_world/emeralddragonsskinloot.sql @@ -0,0 +1,7 @@ +-- +UPDATE `creature_template` SET `skinloot` = 14887 WHERE (`entry` IN (14887, 14888, 14889, 14890)); + +DELETE FROM `skinning_loot_template` WHERE (`Entry` = 14887) AND (`Item` IN (15412, 20381)); +INSERT INTO `skinning_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(14887, 15412, 0, 60, 0, 1, 1, 5, 8, ''), +(14887, 20381, 0, 40, 0, 1, 1, 3, 5, ''); From d580ca4f316c66893ec76282c8dd3e0762d3f662 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Fri, 29 Jul 2022 12:43:42 +0000 Subject: [PATCH 004/161] chore(DB): import pending files Referenced commit(s): 609f98fd9bb325fcbff516450ba37c5a2f79ae88 --- .../emeralddragonsskinloot.sql => db_world/2022_07_29_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/emeralddragonsskinloot.sql => db_world/2022_07_29_00.sql} (90%) diff --git a/data/sql/updates/pending_db_world/emeralddragonsskinloot.sql b/data/sql/updates/db_world/2022_07_29_00.sql similarity index 90% rename from data/sql/updates/pending_db_world/emeralddragonsskinloot.sql rename to data/sql/updates/db_world/2022_07_29_00.sql index ced308115..bf158f6a4 100644 --- a/data/sql/updates/pending_db_world/emeralddragonsskinloot.sql +++ b/data/sql/updates/db_world/2022_07_29_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_07_27_04 -> 2022_07_29_00 -- UPDATE `creature_template` SET `skinloot` = 14887 WHERE (`entry` IN (14887, 14888, 14889, 14890)); From bba9b9ce79f49532fd7e217423649f657e267ad0 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 30 Jul 2022 16:59:30 +0200 Subject: [PATCH 005/161] fix(Core): Crashfix. (#12581) --- src/server/game/Entities/Totem/Totem.cpp | 60 ++++++++++++------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/src/server/game/Entities/Totem/Totem.cpp b/src/server/game/Entities/Totem/Totem.cpp index 73486f979..172cf5fd6 100644 --- a/src/server/game/Entities/Totem/Totem.cpp +++ b/src/server/game/Entities/Totem/Totem.cpp @@ -116,38 +116,40 @@ void Totem::UnSummon(uint32 msTime) CombatStop(); RemoveAurasDueToSpell(GetSpell(), GetGUID()); - Unit* owner = GetOwner(); - // clear owner's totem slot - for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) + if (Unit* owner = GetOwner()) { - if (owner->m_SummonSlot[i] == GetGUID()) + // clear owner's totem slot + for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i) { - owner->m_SummonSlot[i].Clear(); - break; - } - } - - owner->RemoveAurasDueToSpell(GetSpell(), GetGUID()); - - // Remove Sentry Totem Aura - if (GetEntry() == SENTRY_TOTEM_ENTRY) - owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); - - //remove aura all party members too - if (Player* player = owner->ToPlayer()) - { - player->SendAutoRepeatCancel(this); - - if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL))) - player->SendCooldownEvent(spell, 0, nullptr, false); - - if (Group* group = player->GetGroup()) - { - for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) + if (owner->m_SummonSlot[i] == GetGUID()) { - Player* target = itr->GetSource(); - if (target && target->IsInMap(player) && group->SameSubGroup(player, target)) - target->RemoveAurasDueToSpell(GetSpell(), GetGUID()); + owner->m_SummonSlot[i].Clear(); + break; + } + } + + owner->RemoveAurasDueToSpell(GetSpell(), GetGUID()); + + // Remove Sentry Totem Aura + if (GetEntry() == SENTRY_TOTEM_ENTRY) + owner->RemoveAurasDueToSpell(SENTRY_TOTEM_SPELLID); + + //remove aura all party members too + if (Player* player = owner->ToPlayer()) + { + player->SendAutoRepeatCancel(this); + + if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetUInt32Value(UNIT_CREATED_BY_SPELL))) + player->SendCooldownEvent(spell, 0, nullptr, false); + + if (Group* group = player->GetGroup()) + { + for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) + { + Player* target = itr->GetSource(); + if (target && target->IsInMap(player) && group->SameSubGroup(player, target)) + target->RemoveAurasDueToSpell(GetSpell(), GetGUID()); + } } } } From fc2433cf9ec5d132c7e63f60a5cb847e148ca154 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Sun, 31 Jul 2022 09:43:40 -0400 Subject: [PATCH 006/161] fix(Scripts/Mail) Fix faction server mail rewards. (#12593) * Create blackrock-drakes.sql * Switch some things around. * DELETE IT AGAIN --- src/server/game/Globals/ObjectMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index c82efc403..025ec9a0b 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9875,8 +9875,8 @@ void ObjectMgr::SendServerMail(Player* player, uint32 id, uint32 reqLevel, uint3 MailSender sender(MAIL_NORMAL, player->GetGUID().GetCounter(), MAIL_STATIONERY_GM); MailDraft draft(subject, body); - draft.AddMoney(player->GetTeamId() == TEAM_ALLIANCE ? rewardMoneyH : rewardMoneyA); - if (Item* mailItem = Item::CreateItem(player->GetTeamId() == TEAM_ALLIANCE ? rewardItemH : rewardItemA, player->GetTeamId() == TEAM_ALLIANCE ? rewardItemCountH : rewardItemCountA)) + draft.AddMoney(player->GetTeamId() == TEAM_ALLIANCE ? rewardMoneyA : rewardMoneyH); + if (Item* mailItem = Item::CreateItem(player->GetTeamId() == TEAM_ALLIANCE ? rewardItemA : rewardItemH, player->GetTeamId() == TEAM_ALLIANCE ? rewardItemCountA : rewardItemCountH)) { mailItem->SaveToDB(trans); draft.AddItem(mailItem); From 775172c5dcba183593d6d5f66fc74708a839a408 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 31 Jul 2022 17:26:38 +0200 Subject: [PATCH 007/161] fix(Core): Crashfix. (#12594) --- .../scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 4cf8348d0..f977c9591 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -174,10 +174,9 @@ class spell_pagles_point_cast : public SpellScript { 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]() + lure->DespawnOrUnsummon(5s); + caster->m_Events.AddEventAtOffset([caster]() { - 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); From 351ef2b77f62d1f2284e3765ac20cbac72aee7e8 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 31 Jul 2022 12:31:32 -0300 Subject: [PATCH 008/161] fix(Scripts/RuinsOfAhnQiraj): Despawn Ayamiss summons on death/reset (#12550) --- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 10 ++++++++++ .../RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp | 7 +------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index d1198e820..d4e481701 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -102,6 +102,8 @@ public: } break; } + + summons.Summon(who); } void MovementInform(uint32 type, uint32 id) override @@ -257,6 +259,14 @@ public: } } + void JustSummoned(Creature* summon) override + { + if (Creature* ayamiss = _instance->GetCreature(DATA_AYAMISS)) + { + ayamiss->AI()->JustSummoned(summon); + } + } + void MoveInLineOfSight(Unit* who) override { diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp index aa088d091..0bbde8ae5 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp @@ -26,6 +26,7 @@ ObjectData const creatureData[] = { NPC_BURU, DATA_BURU }, { NPC_KURINNAXX, DATA_KURINNAXX }, { NPC_RAJAXX, DATA_RAJAXX }, + { NPC_AYAMISS, DATA_AYAMISS }, { NPC_OSSIRIAN, DATA_OSSIRIAN }, { NPC_QUUEZ, DATA_QUUEZ }, { NPC_TUUBID, DATA_TUUBID }, @@ -90,9 +91,6 @@ public: case NPC_BURU: _buruGUID = creature->GetGUID(); break; - case NPC_AYAMISS: - _ayamissGUID = creature->GetGUID(); - break; case NPC_OSSIRIAN: _ossirianGUID = creature->GetGUID(); break; @@ -186,8 +184,6 @@ public: return _moamGUID; case DATA_BURU: return _buruGUID; - case DATA_AYAMISS: - return _ayamissGUID; case DATA_OSSIRIAN: return _ossirianGUID; case DATA_PARALYZED: @@ -285,7 +281,6 @@ public: ObjectGuid _rajaxxGUID; ObjectGuid _moamGUID; ObjectGuid _buruGUID; - ObjectGuid _ayamissGUID; ObjectGuid _ossirianGUID; ObjectGuid _paralyzedGUID; uint32 _rajaxWaveCounter; From 92e8f4b855ed65bbc4c532291312c95238b0c298 Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Sun, 31 Jul 2022 14:33:36 -0600 Subject: [PATCH 009/161] fix(DB/quest_greeting): Fix Chief Hawkwind quest_greeting (#12377) --- .../updates/pending_db_world/rev_1657755590733012200.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1657755590733012200.sql diff --git a/data/sql/updates/pending_db_world/rev_1657755590733012200.sql b/data/sql/updates/pending_db_world/rev_1657755590733012200.sql new file mode 100644 index 000000000..e750b294d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1657755590733012200.sql @@ -0,0 +1,6 @@ +-- Chief Hawkwind +UPDATE `creature_template` SET `gossip_menu_id`=0, `npcflag`=`npcflag`&~1 WHERE `entry`=2981; + +DELETE FROM `quest_greeting` WHERE `ID`=2981; +INSERT INTO `quest_greeting` (`ID`, `Type`, `GreetEmoteType`, `GreetEmoteDelay`, `Greeting`, `VerifiedBuild`) VALUES +(2981,0,0,0,"Hail, $c. In my years I have seen many eager tauren who wish to prove their worth to the tribe. It should not be forgotten that eagerness is no substitute for wisdom and experience.",0); From 120fd0fc9698be16feae08cd60fe2dc9ff20faf3 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 31 Jul 2022 20:35:33 +0000 Subject: [PATCH 010/161] chore(DB): import pending files Referenced commit(s): 92e8f4b855ed65bbc4c532291312c95238b0c298 --- .../rev_1657755590733012200.sql => db_world/2022_07_31_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1657755590733012200.sql => db_world/2022_07_31_00.sql} (91%) diff --git a/data/sql/updates/pending_db_world/rev_1657755590733012200.sql b/data/sql/updates/db_world/2022_07_31_00.sql similarity index 91% rename from data/sql/updates/pending_db_world/rev_1657755590733012200.sql rename to data/sql/updates/db_world/2022_07_31_00.sql index e750b294d..dc9d0ed5d 100644 --- a/data/sql/updates/pending_db_world/rev_1657755590733012200.sql +++ b/data/sql/updates/db_world/2022_07_31_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_07_29_00 -> 2022_07_31_00 -- Chief Hawkwind UPDATE `creature_template` SET `gossip_menu_id`=0, `npcflag`=`npcflag`&~1 WHERE `entry`=2981; From c4900f9b2c075ad0e8f7878f654b79a4a9e28f25 Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Sun, 31 Jul 2022 15:35:47 -0500 Subject: [PATCH 011/161] fix(DB/creature): correct movement type on a couple snakes (ZG Entrance 3) (#12441) * fix(DB/creature): correct movement type on a couple snakes * nitpicks one day I won't put quotes around integers --- data/sql/updates/pending_db_world/rev_1658273838607986200.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658273838607986200.sql diff --git a/data/sql/updates/pending_db_world/rev_1658273838607986200.sql b/data/sql/updates/pending_db_world/rev_1658273838607986200.sql new file mode 100644 index 000000000..e5e3ed3fe --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658273838607986200.sql @@ -0,0 +1,3 @@ +-- +/* Movetype and wander distance corrections for Entranceway */ +UPDATE `creature` SET `wander_distance`=2, `MovementType`=1 WHERE `guid` IN (49739, 49740); From 56cce71cda058f6ff719cbebaad80b4bdab669c7 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 31 Jul 2022 20:37:47 +0000 Subject: [PATCH 012/161] chore(DB): import pending files Referenced commit(s): c4900f9b2c075ad0e8f7878f654b79a4a9e28f25 --- .../rev_1658273838607986200.sql => db_world/2022_07_31_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658273838607986200.sql => db_world/2022_07_31_01.sql} (78%) diff --git a/data/sql/updates/pending_db_world/rev_1658273838607986200.sql b/data/sql/updates/db_world/2022_07_31_01.sql similarity index 78% rename from data/sql/updates/pending_db_world/rev_1658273838607986200.sql rename to data/sql/updates/db_world/2022_07_31_01.sql index e5e3ed3fe..bb4e25120 100644 --- a/data/sql/updates/pending_db_world/rev_1658273838607986200.sql +++ b/data/sql/updates/db_world/2022_07_31_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_07_31_00 -> 2022_07_31_01 -- /* Movetype and wander distance corrections for Entranceway */ UPDATE `creature` SET `wander_distance`=2, `MovementType`=1 WHERE `guid` IN (49739, 49740); From 4444410f70498ef59a2390a5090302537347ad12 Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Sun, 31 Jul 2022 14:38:54 -0600 Subject: [PATCH 013/161] fix(DB): Script To Serve Kum'isha End Event (#12480) fix(DB): Script To Serve Kum'isha --- .../rev_1658502499846467300.sql | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658502499846467300.sql diff --git a/data/sql/updates/pending_db_world/rev_1658502499846467300.sql b/data/sql/updates/pending_db_world/rev_1658502499846467300.sql new file mode 100644 index 000000000..44a08e8c8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658502499846467300.sql @@ -0,0 +1,59 @@ +-- +-- Kum'isha the Collector +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=7363; +DELETE FROM `smart_scripts` WHERE `entryorguid`=7363 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=736300 AND `source_type`=9; +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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(7363,0,0,0,20,0,100,0,2521,0,0,0,80,736300,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Quest 'To Serve Kum'isha' Finished - Run Script"), +(736300,9,0,0,0,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Remove Npc Flag Questgiver+Gossip"), +(736300,9,1,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.03552,"Kum'isha the Collector - On Script - Set Orientation"), +(736300,9,2,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Say Line 0"), +(736300,9,3,0,0,0,100,0,0,0,0,0,12,7364,8,0,0,0,0,8,0,0,0,-11359.4,-2977.5,-0.447796,4.13626,"Kum'isha the Collector - On Script - Summon Creature 'Flawless Draenethyst Sphere'"), +(736300,9,4,0,0,0,100,0,4000,4000,0,0,11,65633,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Cast 'Arcane Cast Visual'"), +(736300,9,5,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Say Line 1"), +(736300,9,6,0,0,0,100,0,3000,3000,0,0,50,137167,26,0,0,0,0,8,0,0,0,-11359.4,-2977.5,-0.447796,0.185707,"Kum'isha the Collector - On Script - Summon Gameobject 'Nether Rift'"), +(736300,9,7,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Say Line 2"), +(736300,9,8,0,0,0,100,0,0,0,0,0,107,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Summon Group"), +(736300,9,9,0,0,0,100,0,10000,10000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Say Line 3"), +(736300,9,10,0,0,0,100,0,15000,15000,0,0,86,58538,0,19,7364,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Cross Cast 'Arcane Explosion Visual'"), +(736300,9,11,0,0,0,100,0,500,500,0,0,41,0,0,0,0,0,0,19,7364,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Despawn Creature 'Flawless Draenethyst Sphere'"), +(736300,9,12,0,0,0,100,0,3000,3000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Say Line 4"), +(736300,9,13,0,0,0,100,0,0,0,0,0,82,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Kum'isha the Collector - On Script - Add Npc Flag Questgiver+Gossip"), +(736300,9,14,0,0,0,100,0,5000,5000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.79076,"Kum'isha the Collector - On Script - Set Orientation"); + +DELETE FROM `creature_summon_groups` WHERE `summonerId`=7363; +INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`) VALUES +(7363,0,1,7401,-11303.2,-2989.65,5.53587,2.83237,8,300000), +(7363,0,1,7401,-11309.1,-2972.41,8.33972,3.24362,8,300000), +(7363,0,1,7401,-11317.0,-2978.34,5.48171,3.21221,8,300000), +(7363,0,1,7401,-11328.8,-2979.58,6.07384,3.19257,8,300000), +(7363,0,1,7401,-11321.9,-2974.86,7.56403,3.30645,8,300000); + +DELETE FROM `creature_text` WHERE `CreatureID`=7363; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(7363,0,0,"%s releases the flawless draenethyst sphere, allowing it to hover before him.",16,0,100,0,0,0,3441,0,"Kum'isha the Collector"), +(7363,1,0,"%s chants in an unknown tongue.",16,0,100,0,0,0,3442,0,"Kum'isha the Collector"), +(7363,2,0,"Success, the rift is open!! My brethren, rise and return home! The Outland awaits!",14,0,100,0,0,0,3475,0,"Kum'isha the Collector"), +(7363,3,0,"Hurry brothers! You must go now! I do not know how much longer the rift will remain open!",12,0,100,0,0,0,3476,0,"Kum'isha the Collector"), +(7363,4,0,"And now you know why I live in a crater.",12,0,100,0,0,0,3477,0,"Kum'isha the Collector"); + +DELETE FROM `gossip_menu` WHERE `MenuID`=752 AND `TextID`=1303; +INSERT INTO `gossip_menu` (`MenuID`, `TextID`) VALUES +(752,1303); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=752; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14,752,1303,0,0,8,0,2521,0,0,0,0,0,"","Show gossip text 1303 if quest 'To Serve Kum'isha' is rewarded"); + +-- Draenei Refugee +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=7401; +DELETE FROM `smart_scripts` WHERE `entryorguid`=7401 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(7401,0,0,0,54,0,100,0,0,0,0,0,53,0,7401,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Refugee - Just Summoned - Start Waypoint"), +(7401,0,1,0,58,0,100,0,0,0,0,0,11,51347,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Refugee - On Waypoint Ended - Cast 'Teleport Visual Only'"), +(7401,0,2,0,58,0,100,0,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Draenei Refugee - On Waypoint Ended - Despawn after 1 second"); + +DELETE FROM `waypoints` WHERE `entry`=7401; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(7401,1,-11336.5,-2981.66,2.98413,""), +(7401,2,-11359.4,-2977.5,-0.447796,""); From 639dcec71fa6a299f3e3306a568e6b0a59da9038 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 31 Jul 2022 20:40:52 +0000 Subject: [PATCH 014/161] chore(DB): import pending files Referenced commit(s): 4444410f70498ef59a2390a5090302537347ad12 --- .../rev_1658502499846467300.sql => db_world/2022_07_31_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658502499846467300.sql => db_world/2022_07_31_02.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1658502499846467300.sql b/data/sql/updates/db_world/2022_07_31_02.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1658502499846467300.sql rename to data/sql/updates/db_world/2022_07_31_02.sql index 44a08e8c8..d008e7c48 100644 --- a/data/sql/updates/pending_db_world/rev_1658502499846467300.sql +++ b/data/sql/updates/db_world/2022_07_31_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_07_31_01 -> 2022_07_31_02 -- -- Kum'isha the Collector UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=7363; From 63f52ab7517e7430d7a2c1a144288ee95266dde6 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 1 Aug 2022 16:06:45 -0300 Subject: [PATCH 015/161] fix(Core): Crashfix on loot roll (#12605) --- src/server/game/Groups/Group.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index ab72656b9..4623f8ca7 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1449,7 +1449,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) roll->getLoot()->unlootedCount--; AllowedLooterSet looters = item->GetAllowedLooters(); Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters); - sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll); + if (_item) + sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll); player->UpdateLootAchievements(item, roll->getLoot()); } else @@ -1518,7 +1519,8 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) roll->getLoot()->unlootedCount--; AllowedLooterSet looters = item->GetAllowedLooters(); Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters); - sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll); + if (_item) + sScriptMgr->OnGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll); player->UpdateLootAchievements(item, roll->getLoot()); } else From 529eebb1072c25e2e22446e181877fc393176275 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 1 Aug 2022 21:20:07 +0200 Subject: [PATCH 016/161] =?UTF-8?q?fix(Core/Services):=20Re-check=20all=20?= =?UTF-8?q?achievement=20criterias=20on=20faction=20cha=E2=80=A6=20(#12582?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...nge. --- src/server/game/Handlers/CharacterHandler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 718dfce06..949524ce2 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2541,6 +2541,12 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptrSetData(0, uint16(AT_LOGIN_CHECK_ACHIEVS)); + stmt->SetData(1, lowGuid); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); LOG_DEBUG("entities.player", "{} (IP: {}) changed race from {} to {}", GetPlayerInfo(), GetRemoteAddress(), oldRace, factionChangeInfo->Race); From 5e63a9db91e50453afb995096664d6ba93f86e16 Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:22:35 -0600 Subject: [PATCH 017/161] fix(DB/Creature): Update Z position for Ghostpaw Runner (GUID: 34977) (#12555) --- data/sql/updates/pending_db_world/rev_1658886173744516000.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658886173744516000.sql diff --git a/data/sql/updates/pending_db_world/rev_1658886173744516000.sql b/data/sql/updates/pending_db_world/rev_1658886173744516000.sql new file mode 100644 index 000000000..0a775603a --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658886173744516000.sql @@ -0,0 +1,4 @@ +-- + +UPDATE `creature` SET `position_z`=94.3 WHERE `guid`=34977; + From 2f6eefcecafc35d4ad057e6b1112dc02b67aaaec Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:24:47 +0000 Subject: [PATCH 018/161] chore(DB): import pending files Referenced commit(s): 5e63a9db91e50453afb995096664d6ba93f86e16 --- .../rev_1658886173744516000.sql => db_world/2022_08_01_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658886173744516000.sql => db_world/2022_08_01_00.sql} (59%) diff --git a/data/sql/updates/pending_db_world/rev_1658886173744516000.sql b/data/sql/updates/db_world/2022_08_01_00.sql similarity index 59% rename from data/sql/updates/pending_db_world/rev_1658886173744516000.sql rename to data/sql/updates/db_world/2022_08_01_00.sql index 0a775603a..df3cd6dd4 100644 --- a/data/sql/updates/pending_db_world/rev_1658886173744516000.sql +++ b/data/sql/updates/db_world/2022_08_01_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_07_31_02 -> 2022_08_01_00 -- UPDATE `creature` SET `position_z`=94.3 WHERE `guid`=34977; From d28f42c8dadcefff3e7b5270c30616667e067663 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 1 Aug 2022 16:26:26 -0300 Subject: [PATCH 019/161] fix(DB/Creature): Deliana and other npcs spawn time (#12600) --- data/sql/updates/pending_db_world/rev_1659289474965390600.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659289474965390600.sql diff --git a/data/sql/updates/pending_db_world/rev_1659289474965390600.sql b/data/sql/updates/pending_db_world/rev_1659289474965390600.sql new file mode 100644 index 000000000..bfde98705 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659289474965390600.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature` SET `spawntimesecs` = 300 WHERE `id1` IN (11406, 14724, 16013, 22026); From 3df377d19844b340072ebecdc3e438fb6659a430 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:28:35 +0000 Subject: [PATCH 020/161] chore(DB): import pending files Referenced commit(s): d28f42c8dadcefff3e7b5270c30616667e067663 --- .../rev_1659289474965390600.sql => db_world/2022_08_01_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659289474965390600.sql => db_world/2022_08_01_01.sql} (67%) diff --git a/data/sql/updates/pending_db_world/rev_1659289474965390600.sql b/data/sql/updates/db_world/2022_08_01_01.sql similarity index 67% rename from data/sql/updates/pending_db_world/rev_1659289474965390600.sql rename to data/sql/updates/db_world/2022_08_01_01.sql index bfde98705..32fd72b92 100644 --- a/data/sql/updates/pending_db_world/rev_1659289474965390600.sql +++ b/data/sql/updates/db_world/2022_08_01_01.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_01_00 -> 2022_08_01_01 -- UPDATE `creature` SET `spawntimesecs` = 300 WHERE `id1` IN (11406, 14724, 16013, 22026); From 891d87e1ae8b1aa095207e9278f7c1c46262bb82 Mon Sep 17 00:00:00 2001 From: mpfans Date: Tue, 2 Aug 2022 03:33:01 +0800 Subject: [PATCH 021/161] fix(DB/creature): Felannia, Zebig and Brumman should have a gossip (#12360) --- data/sql/updates/pending_db_world/rev_1657532017676037163.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1657532017676037163.sql diff --git a/data/sql/updates/pending_db_world/rev_1657532017676037163.sql b/data/sql/updates/pending_db_world/rev_1657532017676037163.sql new file mode 100644 index 000000000..33acd3ddf --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1657532017676037163.sql @@ -0,0 +1,2 @@ +-- trainer can learn skills +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry` IN (18753,18752,18771); From 2d010b5d035fd6c1f2c29c373232829a93703997 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:35:09 +0000 Subject: [PATCH 022/161] chore(DB): import pending files Referenced commit(s): 891d87e1ae8b1aa095207e9278f7c1c46262bb82 --- .../rev_1657532017676037163.sql => db_world/2022_08_01_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1657532017676037163.sql => db_world/2022_08_01_02.sql} (73%) diff --git a/data/sql/updates/pending_db_world/rev_1657532017676037163.sql b/data/sql/updates/db_world/2022_08_01_02.sql similarity index 73% rename from data/sql/updates/pending_db_world/rev_1657532017676037163.sql rename to data/sql/updates/db_world/2022_08_01_02.sql index 33acd3ddf..7db25b8a9 100644 --- a/data/sql/updates/pending_db_world/rev_1657532017676037163.sql +++ b/data/sql/updates/db_world/2022_08_01_02.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_01_01 -> 2022_08_01_02 -- trainer can learn skills UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry` IN (18753,18752,18771); From 92b6d3b739ce2a61d3f54a1e0366c4991589e2f6 Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:39:33 -0600 Subject: [PATCH 023/161] fix(DB/Gameobject): Ghost Mushroom Position (#12382) --- data/sql/updates/pending_db_world/rev_1657898491936446500.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1657898491936446500.sql diff --git a/data/sql/updates/pending_db_world/rev_1657898491936446500.sql b/data/sql/updates/pending_db_world/rev_1657898491936446500.sql new file mode 100644 index 000000000..932238166 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1657898491936446500.sql @@ -0,0 +1,2 @@ +-- Ghost Mushroom Position +UPDATE `gameobject` SET `position_x` = 328.167, `position_y` = -3705.581, `position_z` = 107.007 WHERE `guid` = 16425; From fbe430821566130b9122d6301731a55356090f73 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:41:42 +0000 Subject: [PATCH 024/161] chore(DB): import pending files Referenced commit(s): 92b6d3b739ce2a61d3f54a1e0366c4991589e2f6 --- .../rev_1657898491936446500.sql => db_world/2022_08_01_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1657898491936446500.sql => db_world/2022_08_01_03.sql} (76%) diff --git a/data/sql/updates/pending_db_world/rev_1657898491936446500.sql b/data/sql/updates/db_world/2022_08_01_03.sql similarity index 76% rename from data/sql/updates/pending_db_world/rev_1657898491936446500.sql rename to data/sql/updates/db_world/2022_08_01_03.sql index 932238166..2956174fe 100644 --- a/data/sql/updates/pending_db_world/rev_1657898491936446500.sql +++ b/data/sql/updates/db_world/2022_08_01_03.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_01_02 -> 2022_08_01_03 -- Ghost Mushroom Position UPDATE `gameobject` SET `position_x` = 328.167, `position_y` = -3705.581, `position_z` = 107.007 WHERE `guid` = 16425; From 338c061059adfd154b18d782ae808ea65fcf54b7 Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:42:55 -0600 Subject: [PATCH 025/161] fix(DB/gossip_menu_option): Correct Marin Noggenfogger text (#12490) Co-authored-by: XenoX92 --- data/sql/updates/pending_db_world/rev_1658514767872316300.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658514767872316300.sql diff --git a/data/sql/updates/pending_db_world/rev_1658514767872316300.sql b/data/sql/updates/pending_db_world/rev_1658514767872316300.sql new file mode 100644 index 000000000..1dbbef48d --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658514767872316300.sql @@ -0,0 +1,2 @@ +-- Marin Noggenfogger +UPDATE `gossip_menu_option` SET `OptionText`="Yes! I want more of that fabulous Noggenfogger Elixir!", `OptionBroadcastTextID`=3793 WHERE `MenuID`=922 AND `OptionID`=0; From 5bee3ed2481f9d155805e60c581cc0bc3c97c9f9 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:44:56 +0000 Subject: [PATCH 026/161] chore(DB): import pending files Referenced commit(s): 338c061059adfd154b18d782ae808ea65fcf54b7 --- .../rev_1658514767872316300.sql => db_world/2022_08_01_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658514767872316300.sql => db_world/2022_08_01_04.sql} (81%) diff --git a/data/sql/updates/pending_db_world/rev_1658514767872316300.sql b/data/sql/updates/db_world/2022_08_01_04.sql similarity index 81% rename from data/sql/updates/pending_db_world/rev_1658514767872316300.sql rename to data/sql/updates/db_world/2022_08_01_04.sql index 1dbbef48d..7d8c32ac5 100644 --- a/data/sql/updates/pending_db_world/rev_1658514767872316300.sql +++ b/data/sql/updates/db_world/2022_08_01_04.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_01_03 -> 2022_08_01_04 -- Marin Noggenfogger UPDATE `gossip_menu_option` SET `OptionText`="Yes! I want more of that fabulous Noggenfogger Elixir!", `OptionBroadcastTextID`=3793 WHERE `MenuID`=922 AND `OptionID`=0; From 728f02165d60c3bb1fec3da44d2540b8ffc0b72a Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:46:27 -0600 Subject: [PATCH 027/161] fix(DB): Sprinkle's Secret Ingredient Outro Event (#12491) Co-authored-by: XenoX92 --- .../pending_db_world/rev_1658515102793478000.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658515102793478000.sql diff --git a/data/sql/updates/pending_db_world/rev_1658515102793478000.sql b/data/sql/updates/pending_db_world/rev_1658515102793478000.sql new file mode 100644 index 000000000..a8434b618 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658515102793478000.sql @@ -0,0 +1,14 @@ +-- Sprinkle +DELETE FROM `creature_text` WHERE `CreatureID`=7583 AND `GroupID`=3; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(7583,3,0,"Just sit tight while I get this prepared for you!",12,0,100,0,0,0,3661,0,"Sprinkle"); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=7583 AND `source_type`=0 AND `id`=2; +DELETE FROM `smart_scripts` WHERE `entryorguid`=758302 AND `source_type`=9; +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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(7583,0,2,0,20,0,100,0,2641,0,0,0,80,758302,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Quest 'Sprinkle's Secret Ingredient' Finished - Run Script"), +(758302,9,0,0,0,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Remove Npc Flag Questgiver"), +(758302,9,1,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Say Line 3"), +(758302,9,2,0,0,0,100,0,1000,1000,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Set Emote State 'Usestanding'"), +(758302,9,3,0,0,0,100,0,6000,6000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Set Emote State 'None'"), +(758302,9,4,0,0,0,100,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sprinkle - On Script - Add Npc Flag Questgiver"); From 1beeb067538793c4f9677c21b3bb1581aa8eff27 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:48:34 +0000 Subject: [PATCH 028/161] chore(DB): import pending files Referenced commit(s): 728f02165d60c3bb1fec3da44d2540b8ffc0b72a --- .../rev_1658515102793478000.sql => db_world/2022_08_01_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658515102793478000.sql => db_world/2022_08_01_05.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1658515102793478000.sql b/data/sql/updates/db_world/2022_08_01_05.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1658515102793478000.sql rename to data/sql/updates/db_world/2022_08_01_05.sql index a8434b618..cbfea8e89 100644 --- a/data/sql/updates/pending_db_world/rev_1658515102793478000.sql +++ b/data/sql/updates/db_world/2022_08_01_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_04 -> 2022_08_01_05 -- Sprinkle DELETE FROM `creature_text` WHERE `CreatureID`=7583 AND `GroupID`=3; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES From 4549a77089fac5389712ef8507d176aed1facbca Mon Sep 17 00:00:00 2001 From: ZhengPeiRu21 <98835050+ZhengPeiRu21@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:49:28 -0600 Subject: [PATCH 029/161] fix(DB): Restore Goodsteel Ledger (#12492) Co-authored-by: XenoX92 --- .../pending_db_world/rev_1658519096000543100.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658519096000543100.sql diff --git a/data/sql/updates/pending_db_world/rev_1658519096000543100.sql b/data/sql/updates/pending_db_world/rev_1658519096000543100.sql new file mode 100644 index 000000000..32e5a2e99 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658519096000543100.sql @@ -0,0 +1,13 @@ +-- Wooden Outhouse +DELETE FROM `smart_scripts` WHERE `entryorguid`=173265 AND `source_type`=1 AND `id`=4; +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_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(173265,1,4,0,62,0,100,0,2387,0,0,0,0,70,60,0,0,0,0,0,14,47578,173266,0,0,0,0,0,"Wooden Outhouse - On Gossip Option Selected - Respawn Gameobject 'Goodsteel Ledger'"); + +DELETE FROM `gossip_menu_option` WHERE `MenuID`=2387; +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `VerifiedBuild`) VALUES +(2387,0,0,"Um... sorry to bother you, but could I see Goodsteel's ledger again... if you're not using it.",5410,1,1,2386,0,0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=2387; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15,2387,0,0,0,9,0,4450,0,0,0,0,0,"","Show gossip option if quest 'Ledger from Tanaris' is taken"), +(15,2387,0,0,0,2,0,11727,1,1,1,0,0,"","Show gossip option if player does not have item 'Goodsteel Ledger'"); From 2e34dd6920d5018276dfceea0b3cb646505e4d5d Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 19:51:41 +0000 Subject: [PATCH 030/161] chore(DB): import pending files Referenced commit(s): 4549a77089fac5389712ef8507d176aed1facbca --- .../rev_1658519096000543100.sql => db_world/2022_08_01_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658519096000543100.sql => db_world/2022_08_01_06.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1658519096000543100.sql b/data/sql/updates/db_world/2022_08_01_06.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1658519096000543100.sql rename to data/sql/updates/db_world/2022_08_01_06.sql index 32e5a2e99..0f8b595c8 100644 --- a/data/sql/updates/pending_db_world/rev_1658519096000543100.sql +++ b/data/sql/updates/db_world/2022_08_01_06.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_05 -> 2022_08_01_06 -- Wooden Outhouse DELETE FROM `smart_scripts` WHERE `entryorguid`=173265 AND `source_type`=1 AND `id`=4; 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_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES From 66521eebeec4ff3302136ba6b59a974459580f78 Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:05:29 -0500 Subject: [PATCH 031/161] fix(DB/Creature): Continued ZG Before Bats work (Pools - Formations) (#12493) --- .../rev_1658532736609953400.sql | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658532736609953400.sql diff --git a/data/sql/updates/pending_db_world/rev_1658532736609953400.sql b/data/sql/updates/pending_db_world/rev_1658532736609953400.sql new file mode 100644 index 000000000..184987abd --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658532736609953400.sql @@ -0,0 +1,138 @@ +-- +/* Maintenance on ZG Before Bats Part 2: Pooling Part 1 */ +DELETE FROM `creature` WHERE `guid` BETWEEN 91480 AND 91484; + +/* Crocolisk Packs: This method can be exported into all Crocolisk Packs, it requires 25 creature entries and 6 pools. +50% Chance to spawn 5, 10% chance for each location to spawn empty creating a 4 pack + +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@GUID+, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903.1, -1490.94, 12.5739, 1.91973, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11895.3, -1503.19, 15.1803, 5.42918, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11892.8, -1498.98, 13.7794, 4.75143, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11912.7, -1494.4, 12.0913, 3.05153, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903, -1502.04, 14.7285, 0.400987, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +*/ + +SET @GUID :=61271; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+24; +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +-- 5 Pack +(@GUID+0, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903.1, -1490.94, 12.5739, 1.91973, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+1, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11895.3, -1503.19, 15.1803, 5.42918, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+2, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11892.8, -1498.98, 13.7794, 4.75143, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+3, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11912.7, -1494.4, 12.0913, 3.05153, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+4, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903, -1502.04, 14.7285, 0.400987, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +-- 4 Pack Missing First +(@GUID+5, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11895.3, -1503.19, 15.1803, 5.42918, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+6, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11892.8, -1498.98, 13.7794, 4.75143, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+7, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11912.7, -1494.4, 12.0913, 3.05153, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+8, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903, -1502.04, 14.7285, 0.400987, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +-- 4 Pack Missing Second +(@GUID+9, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903.1, -1490.94, 12.5739, 1.91973, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+10, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11892.8, -1498.98, 13.7794, 4.75143, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+11, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11912.7, -1494.4, 12.0913, 3.05153, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+12, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903, -1502.04, 14.7285, 0.400987, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +-- 4 Pack Missing Third +(@GUID+13, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903.1, -1490.94, 12.5739, 1.91973, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+14, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11895.3, -1503.19, 15.1803, 5.42918, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+15, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11912.7, -1494.4, 12.0913, 3.05153, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+16, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903, -1502.04, 14.7285, 0.400987, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +-- 4 Pack Missing Fourth +(@GUID+17, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903.1, -1490.94, 12.5739, 1.91973, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+18, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11895.3, -1503.19, 15.1803, 5.42918, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+19, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11892.8, -1498.98, 13.7794, 4.75143, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+20, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903, -1502.04, 14.7285, 0.400987, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +-- 4 Pack Missing Final +(@GUID+21, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11903.1, -1490.94, 12.5739, 1.91973, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+22, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11895.3, -1503.19, 15.1803, 5.42918, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+23, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11892.8, -1498.98, 13.7794, 4.75143, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0), +(@GUID+24, 15043, 0, 0, 309, 0, 0, 1, 1, 0, -11912.7, -1494.4, 12.0913, 3.05153, 7200, 0, 0, 9156, 0, 0, 0, 0, 0, '', 0); + +SET @POOL :=469; +DELETE FROM `pool_template` WHERE `entry` BETWEEN @POOL+0 AND @POOL+6; +DELETE FROM `pool_creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+24; + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(@POOL+0, 1, 'ZG Before Bats 4-5 Pack Pool of Zulian Crocs Pool of Pools'), +(@POOL+1, 5, 'ZG Before Bats 5 Pack of Zulian Crocs 15043 50% 1/6'), +(@POOL+2, 4, 'ZG Before Bats 4 Pack of Zulian Crocs 15043 10% 2/6'), +(@POOL+3, 4, 'ZG Before Bats 4 Pack of Zulian Crocs 15043 10% 3/6'), +(@POOL+4, 4, 'ZG Before Bats 4 Pack of Zulian Crocs 15043 10% 4/6'), +(@POOL+5, 4, 'ZG Before Bats 4 Pack of Zulian Crocs 15043 10% 5/6'), +(@POOL+6, 4, 'ZG Before Bats 4 Pack of Zulian Crocs 15043 10% 6/6'); + +DELETE FROM `pool_pool` WHERE `pool_id` BETWEEN @POOL+0 AND @POOL+6; +DELETE FROM `pool_pool` WHERE `mother_pool` BETWEEN @POOL+0 AND @POOL+6; +INSERT INTO `pool_pool` (`pool_id`, `mother_pool`, `chance`, `description`) VALUES +(@POOL+1, @POOL+0, 50, 'ZG Before Bats 5 Pack of Zulian Crocs 1/1'), +(@POOL+2, @POOL+0, 10, 'ZG Before Bats 4 Pack of Zulian Crocs 1/5'), +(@POOL+3, @POOL+0, 10, 'ZG Before Bats 4 Pack of Zulian Crocs 2/5'), +(@POOL+4, @POOL+0, 10, 'ZG Before Bats 4 Pack of Zulian Crocs 3/5'), +(@POOL+5, @POOL+0, 10, 'ZG Before Bats 4 Pack of Zulian Crocs 4/5'), +(@POOL+6, @POOL+0, 10, 'ZG Before Bats 4 Pack of Zulian Crocs 5/5'); + +INSERT INTO `pool_creature` (`guid`, `pool_entry`, `description`) VALUES +-- +(@GUID+0, @POOL+1, 'ZG Before Bats 5 Pack of Zulian Crocs 1/1 Croc 1'), +(@GUID+1, @POOL+1, 'ZG Before Bats 5 Pack of Zulian Crocs 1/1 Croc 2'), +(@GUID+2, @POOL+1, 'ZG Before Bats 5 Pack of Zulian Crocs 1/1 Croc 3'), +(@GUID+3, @POOL+1, 'ZG Before Bats 5 Pack of Zulian Crocs 1/1 Croc 4'), +(@GUID+4, @POOL+1, 'ZG Before Bats 5 Pack of Zulian Crocs 1/1 Croc 5'), +-- +(@GUID+5, @POOL+2, 'ZG Before Bats 4 Pack of Zulian Crocs 1/5 Croc 1'), +(@GUID+6, @POOL+2, 'ZG Before Bats 4 Pack of Zulian Crocs 1/5 Croc 2'), +(@GUID+7, @POOL+2, 'ZG Before Bats 4 Pack of Zulian Crocs 1/5 Croc 3'), +(@GUID+8, @POOL+2, 'ZG Before Bats 4 Pack of Zulian Crocs 1/5 Croc 4'), +-- +(@GUID+9, @POOL+3, 'ZG Before Bats 4 Pack of Zulian Crocs 2/5 Croc 1'), +(@GUID+10, @POOL+3, 'ZG Before Bats 4 Pack of Zulian Crocs 2/5 Croc 2'), +(@GUID+11, @POOL+3, 'ZG Before Bats 4 Pack of Zulian Crocs 2/5 Croc 3'), +(@GUID+12, @POOL+3, 'ZG Before Bats 4 Pack of Zulian Crocs 2/5 Croc 4'), +-- +(@GUID+13, @POOL+4, 'ZG Before Bats 4 Pack of Zulian Crocs 3/5 Croc 1'), +(@GUID+14, @POOL+4, 'ZG Before Bats 4 Pack of Zulian Crocs 3/5 Croc 2'), +(@GUID+15, @POOL+4, 'ZG Before Bats 4 Pack of Zulian Crocs 3/5 Croc 3'), +(@GUID+16, @POOL+4, 'ZG Before Bats 4 Pack of Zulian Crocs 3/5 Croc 4'), +-- +(@GUID+17, @POOL+5, 'ZG Before Bats 4 Pack of Zulian Crocs 4/5 Croc 1'), +(@GUID+18, @POOL+5, 'ZG Before Bats 4 Pack of Zulian Crocs 4/5 Croc 2'), +(@GUID+19, @POOL+5, 'ZG Before Bats 4 Pack of Zulian Crocs 4/5 Croc 3'), +(@GUID+20, @POOL+5, 'ZG Before Bats 4 Pack of Zulian Crocs 4/5 Croc 4'), +-- +(@GUID+21, @POOL+6, 'ZG Before Bats 4 Pack of Zulian Crocs 5/5 Croc 1'), +(@GUID+22, @POOL+6, 'ZG Before Bats 4 Pack of Zulian Crocs 5/5 Croc 2'), +(@GUID+23, @POOL+6, 'ZG Before Bats 4 Pack of Zulian Crocs 5/5 Croc 3'), +(@GUID+24, @POOL+6, 'ZG Before Bats 4 Pack of Zulian Crocs 5/5 Croc 4'); + +DELETE FROM `creature_formations` WHERE `memberGUID` BETWEEN @GUID+0 AND @GUID+24; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(@GUID+0, @GUID+0, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+1, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+2, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+3, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+4, 0, 0, 3, 0, 0), +-- +(@GUID+5, @GUID+5, 0, 0, 3, 0, 0), +(@GUID+5, @GUID+6, 0, 0, 3, 0, 0), +(@GUID+5, @GUID+7, 0, 0, 3, 0, 0), +(@GUID+5, @GUID+8, 0, 0, 3, 0, 0), +-- +(@GUID+9, @GUID+9, 0, 0, 3, 0, 0), +(@GUID+9, @GUID+10, 0, 0, 3, 0, 0), +(@GUID+9, @GUID+11, 0, 0, 3, 0, 0), +(@GUID+9, @GUID+12, 0, 0, 3, 0, 0), +-- +(@GUID+13, @GUID+13, 0, 0, 3, 0, 0), +(@GUID+13, @GUID+14, 0, 0, 3, 0, 0), +(@GUID+13, @GUID+15, 0, 0, 3, 0, 0), +(@GUID+13, @GUID+16, 0, 0, 3, 0, 0), +-- +(@GUID+17, @GUID+17, 0, 0, 3, 0, 0), +(@GUID+17, @GUID+18, 0, 0, 3, 0, 0), +(@GUID+17, @GUID+19, 0, 0, 3, 0, 0), +(@GUID+17, @GUID+20, 0, 0, 3, 0, 0), +-- +(@GUID+21, @GUID+21, 0, 0, 3, 0, 0), +(@GUID+21, @GUID+22, 0, 0, 3, 0, 0), +(@GUID+21, @GUID+23, 0, 0, 3, 0, 0), +(@GUID+21, @GUID+24, 0, 0, 3, 0, 0); From a8816d25a3c37e1002880acc220e98e399f33009 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:07:45 +0000 Subject: [PATCH 032/161] chore(DB): import pending files Referenced commit(s): 66521eebeec4ff3302136ba6b59a974459580f78 --- .../rev_1658532736609953400.sql => db_world/2022_08_01_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658532736609953400.sql => db_world/2022_08_01_07.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1658532736609953400.sql b/data/sql/updates/db_world/2022_08_01_07.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1658532736609953400.sql rename to data/sql/updates/db_world/2022_08_01_07.sql index 184987abd..62644b4ae 100644 --- a/data/sql/updates/pending_db_world/rev_1658532736609953400.sql +++ b/data/sql/updates/db_world/2022_08_01_07.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_06 -> 2022_08_01_07 -- /* Maintenance on ZG Before Bats Part 2: Pooling Part 1 */ DELETE FROM `creature` WHERE `guid` BETWEEN 91480 AND 91484; From b535136b2b93e203bbfc5c0a640fa2f26623cf04 Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:09:27 -0500 Subject: [PATCH 033/161] fix(DB/Creature): ZG Formations: Aggro on pack (#12494) --- .../rev_1658535848721793000.sql | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658535848721793000.sql diff --git a/data/sql/updates/pending_db_world/rev_1658535848721793000.sql b/data/sql/updates/pending_db_world/rev_1658535848721793000.sql new file mode 100644 index 000000000..1d68e387a --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658535848721793000.sql @@ -0,0 +1,96 @@ + +SET @GUID :=86939; +DELETE FROM `creature_formations` WHERE `memberGUID` BETWEEN @GUID+0 AND @GUID+71; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(@GUID+0, @GUID+0, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+1, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+2, 0, 0, 3, 0, 0), + +(@GUID+3, @GUID+3, 0, 0, 3, 0, 0), +(@GUID+3, @GUID+4, 0, 0, 3, 0, 0), +(@GUID+3, @GUID+5, 0, 0, 3, 0, 0), + +(@GUID+6, @GUID+6, 0, 0, 3, 0, 0), +(@GUID+6, @GUID+7, 0, 0, 3, 0, 0), +(@GUID+6, @GUID+8, 0, 0, 3, 0, 0), + +(@GUID+9, @GUID+9, 0, 0, 3, 0, 0), +(@GUID+9, @GUID+10, 0, 0, 3, 0, 0), +(@GUID+9, @GUID+11, 0, 0, 3, 0, 0), + +(@GUID+12, @GUID+12, 0, 0, 3, 0, 0), +(@GUID+12, @GUID+13, 0, 0, 3, 0, 0), +(@GUID+12, @GUID+14, 0, 0, 3, 0, 0), + +(@GUID+15, @GUID+15, 0, 0, 3, 0, 0), +(@GUID+15, @GUID+16, 0, 0, 3, 0, 0), +(@GUID+15, @GUID+17, 0, 0, 3, 0, 0), + +(@GUID+18, @GUID+18, 0, 0, 3, 0, 0), +(@GUID+18, @GUID+19, 0, 0, 3, 0, 0), +(@GUID+18, @GUID+20, 0, 0, 3, 0, 0), + +(@GUID+21, @GUID+21, 0, 0, 3, 0, 0), +(@GUID+21, @GUID+22, 0, 0, 3, 0, 0), +(@GUID+21, @GUID+23, 0, 0, 3, 0, 0), + +(@GUID+24, @GUID+24, 0, 0, 3, 0, 0), +(@GUID+24, @GUID+25, 0, 0, 3, 0, 0), +(@GUID+24, @GUID+26, 0, 0, 3, 0, 0), +(@GUID+24, @GUID+27, 0, 0, 3, 0, 0), + +(@GUID+28, @GUID+28, 0, 0, 3, 0, 0), +(@GUID+28, @GUID+29, 0, 0, 3, 0, 0), +(@GUID+28, @GUID+30, 0, 0, 3, 0, 0), +(@GUID+28, @GUID+31, 0, 0, 3, 0, 0), + +(@GUID+32, @GUID+32, 0, 0, 3, 0, 0), +(@GUID+32, @GUID+33, 0, 0, 3, 0, 0), +(@GUID+32, @GUID+34, 0, 0, 3, 0, 0), +(@GUID+32, @GUID+35, 0, 0, 3, 0, 0), + +(@GUID+36, @GUID+36, 0, 0, 3, 0, 0), +(@GUID+36, @GUID+37, 0, 0, 3, 0, 0), +(@GUID+36, @GUID+38, 0, 0, 3, 0, 0), +(@GUID+36, @GUID+39, 0, 0, 3, 0, 0), + +(@GUID+40, @GUID+40, 0, 0, 3, 0, 0), +(@GUID+40, @GUID+41, 0, 0, 3, 0, 0), +(@GUID+40, @GUID+42, 0, 0, 3, 0, 0), +(@GUID+40, @GUID+43, 0, 0, 3, 0, 0), + +(@GUID+44, @GUID+44, 0, 0, 3, 0, 0), +(@GUID+44, @GUID+45, 0, 0, 3, 0, 0), +(@GUID+44, @GUID+46, 0, 0, 3, 0, 0), +(@GUID+44, @GUID+47, 0, 0, 3, 0, 0), + +(@GUID+48, @GUID+48, 0, 0, 3, 0, 0), +(@GUID+48, @GUID+49, 0, 0, 3, 0, 0), +(@GUID+48, @GUID+50, 0, 0, 3, 0, 0), +(@GUID+48, @GUID+51, 0, 0, 3, 0, 0), + +(@GUID+52, @GUID+52, 0, 0, 3, 0, 0), +(@GUID+52, @GUID+53, 0, 0, 3, 0, 0), +(@GUID+52, @GUID+54, 0, 0, 3, 0, 0), +(@GUID+52, @GUID+55, 0, 0, 3, 0, 0), + +(@GUID+56, @GUID+56, 0, 0, 3, 0, 0), +(@GUID+56, @GUID+57, 0, 0, 3, 0, 0), +(@GUID+56, @GUID+58, 0, 0, 3, 0, 0), +(@GUID+56, @GUID+59, 0, 0, 3, 0, 0), + +(@GUID+60, @GUID+60, 0, 0, 3, 0, 0), +(@GUID+60, @GUID+61, 0, 0, 3, 0, 0), +(@GUID+60, @GUID+62, 0, 0, 3, 0, 0), +(@GUID+60, @GUID+63, 0, 0, 3, 0, 0), + +(@GUID+64, @GUID+64, 0, 0, 3, 0, 0), +(@GUID+64, @GUID+65, 0, 0, 3, 0, 0), +(@GUID+64, @GUID+66, 0, 0, 3, 0, 0), +(@GUID+64, @GUID+67, 0, 0, 3, 0, 0), + +(@GUID+68, @GUID+68, 0, 0, 3, 0, 0), +(@GUID+68, @GUID+69, 0, 0, 3, 0, 0), +(@GUID+68, @GUID+70, 0, 0, 3, 0, 0), +(@GUID+68, @GUID+71, 0, 0, 3, 0, 0); + From 2809d68b1da2809bb02dc69618b7f334713a470b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:11:37 +0000 Subject: [PATCH 034/161] chore(DB): import pending files Referenced commit(s): b535136b2b93e203bbfc5c0a640fa2f26623cf04 --- .../rev_1658535848721793000.sql => db_world/2022_08_01_08.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658535848721793000.sql => db_world/2022_08_01_08.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1658535848721793000.sql b/data/sql/updates/db_world/2022_08_01_08.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1658535848721793000.sql rename to data/sql/updates/db_world/2022_08_01_08.sql index 1d68e387a..8e5a967e0 100644 --- a/data/sql/updates/pending_db_world/rev_1658535848721793000.sql +++ b/data/sql/updates/db_world/2022_08_01_08.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_07 -> 2022_08_01_08 SET @GUID :=86939; DELETE FROM `creature_formations` WHERE `memberGUID` BETWEEN @GUID+0 AND @GUID+71; From 7327a55b05f5b9277d3b01ead16ee495b3d67520 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 1 Aug 2022 22:13:27 +0200 Subject: [PATCH 035/161] fix(Scripts/Spells): Properly handle spellclick flag for Lightwell. (#12505) --- src/server/scripts/Spells/spell_priest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 384bee7da..89624091b 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -428,9 +428,26 @@ class spell_pri_lightwell_renew : public AuraScript } } + void HandleUpdateSpellclick(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + if (Player* player = GetTarget()->ToPlayer()) + { + UpdateData data; + WorldPacket packet; + caster->BuildValuesUpdateBlockForPlayer(&data, player); + data.BuildPacket(&packet); + player->SendDirectMessage(&packet); + } + } + } + void Register() override { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_lightwell_renew::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + AfterEffectApply += AuraEffectApplyFn(spell_pri_lightwell_renew::HandleUpdateSpellclick, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_pri_lightwell_renew::HandleUpdateSpellclick, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); } }; From 9f030e098a1956b22c6c55a579991067d0b87492 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Mon, 1 Aug 2022 17:15:44 -0300 Subject: [PATCH 036/161] fix(DB/Creature): Set wander_distance for creatures 21773, 21774, 21775 (#12514) --- data/sql/updates/pending_db_world/rev_1658622609596209300.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658622609596209300.sql diff --git a/data/sql/updates/pending_db_world/rev_1658622609596209300.sql b/data/sql/updates/pending_db_world/rev_1658622609596209300.sql new file mode 100644 index 000000000..b1a72caa9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658622609596209300.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature` SET `wander_distance`=16, `MovementType`=1 WHERE `guid`=21773; +UPDATE `creature` SET `wander_distance`=18, `MovementType`=1 WHERE `guid`=21774; +UPDATE `creature` SET `wander_distance`=15, `MovementType`=1 WHERE `guid`=21775; From 7d0161d26ece2f47b5961ba97744062b14f3f2a4 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:17:58 +0000 Subject: [PATCH 037/161] chore(DB): import pending files Referenced commit(s): 9f030e098a1956b22c6c55a579991067d0b87492 --- .../rev_1658622609596209300.sql => db_world/2022_08_01_09.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658622609596209300.sql => db_world/2022_08_01_09.sql} (84%) diff --git a/data/sql/updates/pending_db_world/rev_1658622609596209300.sql b/data/sql/updates/db_world/2022_08_01_09.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1658622609596209300.sql rename to data/sql/updates/db_world/2022_08_01_09.sql index b1a72caa9..e59e3359c 100644 --- a/data/sql/updates/pending_db_world/rev_1658622609596209300.sql +++ b/data/sql/updates/db_world/2022_08_01_09.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_08 -> 2022_08_01_09 -- UPDATE `creature` SET `wander_distance`=16, `MovementType`=1 WHERE `guid`=21773; UPDATE `creature` SET `wander_distance`=18, `MovementType`=1 WHERE `guid`=21774; From f0df7edee05248b54884aa527b9bde3a3980774e Mon Sep 17 00:00:00 2001 From: schell244 Date: Mon, 1 Aug 2022 22:19:17 +0200 Subject: [PATCH 038/161] fix(DB/Creature): Npc 1568 spawn position (#12519) --- data/sql/updates/pending_db_world/rev_1658058502913230900.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658058502913230900.sql diff --git a/data/sql/updates/pending_db_world/rev_1658058502913230900.sql b/data/sql/updates/pending_db_world/rev_1658058502913230900.sql new file mode 100644 index 000000000..da689d702 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658058502913230900.sql @@ -0,0 +1,2 @@ +-- Undertaker Mordo https://classic.wowhead.com/npc=1568/undertaker-mordo +UPDATE `creature` SET `position_x` = 1671.89,`position_y` = 1678.29,`position_z` = 120.802, `orientation` = 0.0349066 WHERE `id1` = 1568; From 8c7417bd0114294ad9cef5e7657c422cc8861f36 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:21:19 +0000 Subject: [PATCH 039/161] chore(DB): import pending files Referenced commit(s): f0df7edee05248b54884aa527b9bde3a3980774e --- .../rev_1658058502913230900.sql => db_world/2022_08_01_10.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658058502913230900.sql => db_world/2022_08_01_10.sql} (82%) diff --git a/data/sql/updates/pending_db_world/rev_1658058502913230900.sql b/data/sql/updates/db_world/2022_08_01_10.sql similarity index 82% rename from data/sql/updates/pending_db_world/rev_1658058502913230900.sql rename to data/sql/updates/db_world/2022_08_01_10.sql index da689d702..e27a8b215 100644 --- a/data/sql/updates/pending_db_world/rev_1658058502913230900.sql +++ b/data/sql/updates/db_world/2022_08_01_10.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_01_09 -> 2022_08_01_10 -- Undertaker Mordo https://classic.wowhead.com/npc=1568/undertaker-mordo UPDATE `creature` SET `position_x` = 1671.89,`position_y` = 1678.29,`position_z` = 120.802, `orientation` = 0.0349066 WHERE `id1` = 1568; From 40ce270661f4dec617b4dccac5fbf8a91db3d9bf Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:22:32 -0500 Subject: [PATCH 040/161] fix(DB/Formations): ZG: Creature formations before bat area (#12523) Fixes Bat Pack aggro and adds pooling possibilities Adds formations to fix Troll/Snake pack aggro behavior --- .../rev_1658700301267875700.sql | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658700301267875700.sql diff --git a/data/sql/updates/pending_db_world/rev_1658700301267875700.sql b/data/sql/updates/pending_db_world/rev_1658700301267875700.sql new file mode 100644 index 000000000..49383ad2f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658700301267875700.sql @@ -0,0 +1,120 @@ +-- +-- Maintenance on ZG Before Bats Part 4: Pooling Part 3 Standing Bats Pack +-- Old Locations Pre-work +DELETE FROM `creature` WHERE `guid` IN (49190, 49191, 49192, 49193); +DELETE FROM `creature_addon` WHERE `guid` IN (49190, 49191, 49192, 49193); + +/* Bat Pack in ZG Bat Rider (14750) should shift spawn positions with 11368 and they agro together as one + +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@GUID+, , 0, 0, 309, 0, 0, 1, 1, 0, -11985.9, -1475.85, 79.7788, 1.59486, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+, , 0, 0, 309, 0, 0, 1, 1, 0, -11978.2, -1464.7, 80.1628, 1.46608, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+, , 0, 0, 309, 0, 0, 1, 1, 0, -11988.6, -1467.06, 80.3768, 1.98968, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+, , 0, 0, 309, 0, 0, 1, 1, 0, -11981.1, -1475.36, 79.7364, 0.874606, 7200, 2, 0, 31440, 0, 1, 0, 0, 0, '', 0); + +This ZG Bat Rider had a row in creautre_addon--I could not find it anywhere in the sniff so it is not included, however noting it here for historical purposes: + +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(XRIDERX, 0, 0, 0, 4097, 0, 0, NULL); + +*/ + +-- Setup and auto-cleanup for pooling, creatures, and formations +SET @GUID :=56934; +SET @POOL :=479; +DELETE FROM `pool_template` WHERE `entry` BETWEEN @POOL+0 AND @POOL+4; +DELETE FROM `pool_creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+15; +DELETE FROM `pool_pool` WHERE `pool_id` BETWEEN @POOL+0 AND @POOL+4; +DELETE FROM `pool_pool` WHERE `mother_pool` BETWEEN @POOL+0 AND @POOL+4; +DELETE FROM `creature_formations` WHERE `memberGUID` BETWEEN @GUID+0 AND @GUID+15; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+15; + +-- Insert Creatures +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@GUID+0, 14750, 0, 0, 309, 0, 0, 1, 1, 0, -11985.9, -1475.85, 79.7788, 1.59486, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+1, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11978.2, -1464.7, 80.1628, 1.46608, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+2, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11988.6, -1467.06, 80.3768, 1.98968, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+3, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11981.1, -1475.36, 79.7364, 0.874606, 7200, 2, 0, 31440, 0, 1, 0, 0, 0, '', 0), + +(@GUID+4, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11985.9, -1475.85, 79.7788, 1.59486, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+5, 14750, 0, 0, 309, 0, 0, 1, 1, 0, -11978.2, -1464.7, 80.1628, 1.46608, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+6, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11988.6, -1467.06, 80.3768, 1.98968, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+7, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11981.1, -1475.36, 79.7364, 0.874606, 7200, 2, 0, 31440, 0, 1, 0, 0, 0, '', 0), + +(@GUID+8, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11985.9, -1475.85, 79.7788, 1.59486, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+9, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11978.2, -1464.7, 80.1628, 1.46608, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+10, 14750, 0, 0, 309, 0, 0, 1, 1, 0, -11988.6, -1467.06, 80.3768, 1.98968, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+11, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11981.1, -1475.36, 79.7364, 0.874606, 7200, 2, 0, 31440, 0, 1, 0, 0, 0, '', 0), + +(@GUID+12, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11985.9, -1475.85, 79.7788, 1.59486, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+13, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11978.2, -1464.7, 80.1628, 1.46608, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+14, 11368, 0, 0, 309, 0, 0, 1, 1, 0, -11988.6, -1467.06, 80.3768, 1.98968, 7200, 2, 0, 5341, 0, 1, 0, 0, 0, '', 0), +(@GUID+15, 14750, 0, 0, 309, 0, 0, 1, 1, 0, -11981.1, -1475.36, 79.7364, 0.874606, 7200, 2, 0, 31440, 0, 1, 0, 0, 0, '', 0); + +-- Insert Pooling + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(@POOL+0, 1, 'ZG Before Bats Bat Pack Rider Location Shuffle'), +(@POOL+1, 4, 'ZG Before Bats Bat Pack Loc 1/4'), +(@POOL+2, 4, 'ZG Before Bats Bat Pack Loc 2/4'), +(@POOL+3, 4, 'ZG Before Bats Bat Pack Loc 3/4'), +(@POOL+4, 4, 'ZG Before Bats Bat Pack Loc 4/4'); + +INSERT INTO `pool_pool` (`pool_id`, `mother_pool`, `chance`, `description`) VALUES +(@POOL+1, @POOL+0, 25, 'ZG Before Bats Bat Pack Loc 1'), +(@POOL+2, @POOL+0, 25, 'ZG Before Bats Bat Pack Loc 2'), +(@POOL+3, @POOL+0, 25, 'ZG Before Bats Bat Pack Loc 3'), +(@POOL+4, @POOL+0, 25, 'ZG Before Bats Bat Pack Loc 4'); + +INSERT INTO `pool_creature` (`guid`, `pool_entry`, `description`) VALUES + +(@GUID+0, @POOL+1, 'ZG Before Bats Bat Pack Loc 1 Rider'), +(@GUID+1, @POOL+1, 'ZG Before Bats Bat Pack Loc 1 Bat'), +(@GUID+2, @POOL+1, 'ZG Before Bats Bat Pack Loc 1 Bat'), +(@GUID+3, @POOL+1, 'ZG Before Bats Bat Pack Loc 1 Bat'), + +(@GUID+4, @POOL+2, 'ZG Before Bats Bat Pack Loc 2 Bat'), +(@GUID+5, @POOL+2, 'ZG Before Bats Bat Pack Loc 2 Rider'), +(@GUID+6, @POOL+2, 'ZG Before Bats Bat Pack Loc 2 Bat'), +(@GUID+7, @POOL+2, 'ZG Before Bats Bat Pack Loc 2 Bat'), + +(@GUID+8, @POOL+3, 'ZG Before Bats Bat Pack Loc 3 Bat'), +(@GUID+9, @POOL+3, 'ZG Before Bats Bat Pack Loc 3 Bat'), +(@GUID+10, @POOL+3, 'ZG Before Bats Bat Pack Loc 3 Rider'), +(@GUID+11, @POOL+3, 'ZG Before Bats Bat Pack Loc 3 Bat'), + +(@GUID+12, @POOL+4, 'ZG Before Bats Bat Pack Loc 4 Bat'), +(@GUID+13, @POOL+4, 'ZG Before Bats Bat Pack Loc 4 Bat'), +(@GUID+14, @POOL+4, 'ZG Before Bats Bat Pack Loc 4 Bat'), +(@GUID+15, @POOL+4, 'ZG Before Bats Bat Pack Loc 4 Rider'); + +-- Insert Formations + +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(@GUID+0, @GUID+0, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+1, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+2, 0, 0, 3, 0, 0), +(@GUID+0, @GUID+3, 0, 0, 3, 0, 0), + +(@GUID+4, @GUID+4, 0, 0, 3, 0, 0), +(@GUID+4, @GUID+5, 0, 0, 3, 0, 0), +(@GUID+4, @GUID+6, 0, 0, 3, 0, 0), +(@GUID+4, @GUID+7, 0, 0, 3, 0, 0), + +(@GUID+8, @GUID+8, 0, 0, 3, 0, 0), +(@GUID+8, @GUID+9, 0, 0, 3, 0, 0), +(@GUID+8, @GUID+10, 0, 0, 3, 0, 0), +(@GUID+8, @GUID+11, 0, 0, 3, 0, 0), + +(@GUID+12, @GUID+12, 0, 0, 3, 0, 0), +(@GUID+12, @GUID+13, 0, 0, 3, 0, 0), +(@GUID+12, @GUID+14, 0, 0, 3, 0, 0), +(@GUID+12, @GUID+15, 0, 0, 3, 0, 0); + +-- Maintenance on ZG Before Bats Part 5: Agro linking via creature_formations +DELETE FROM `creature_formations` WHERE `memberGUID` IN (49753, 49754, 49096, 49097); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(49753, 49753, 0, 0, 3, 0, 0), +(49753, 49754, 0, 0, 3, 0, 0), +(49753, 49096, 0, 0, 3, 0, 0), +(49753, 49097, 0, 0, 3, 0, 0); From d98549362f0aa9723e0331b9f325f4d2707b911a Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:24:45 +0000 Subject: [PATCH 041/161] chore(DB): import pending files Referenced commit(s): 40ce270661f4dec617b4dccac5fbf8a91db3d9bf --- .../rev_1658700301267875700.sql => db_world/2022_08_01_11.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658700301267875700.sql => db_world/2022_08_01_11.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1658700301267875700.sql b/data/sql/updates/db_world/2022_08_01_11.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1658700301267875700.sql rename to data/sql/updates/db_world/2022_08_01_11.sql index 49383ad2f..3664b560b 100644 --- a/data/sql/updates/pending_db_world/rev_1658700301267875700.sql +++ b/data/sql/updates/db_world/2022_08_01_11.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_10 -> 2022_08_01_11 -- -- Maintenance on ZG Before Bats Part 4: Pooling Part 3 Standing Bats Pack -- Old Locations Pre-work From 232f5ae8286be8ab5a981c932ebb03dd71fcf1da Mon Sep 17 00:00:00 2001 From: temperrr Date: Mon, 1 Aug 2022 22:25:35 +0200 Subject: [PATCH 042/161] fix(DB/ZulGurub): Hakkari Witchdoctor SAI (#12529) --- .../updates/pending_db_world/hakkariwitchdoctor.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 data/sql/updates/pending_db_world/hakkariwitchdoctor.sql diff --git a/data/sql/updates/pending_db_world/hakkariwitchdoctor.sql b/data/sql/updates/pending_db_world/hakkariwitchdoctor.sql new file mode 100644 index 000000000..00d4620ef --- /dev/null +++ b/data/sql/updates/pending_db_world/hakkariwitchdoctor.sql @@ -0,0 +1,10 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11831; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 11831); +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 +(11831, 0, 0, 0, 4, 0, 30, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hakkari Witch Doctor - On Aggro - Say Line 0'), +(11831, 0, 1, 0, 0, 0, 100, 0, 3000, 8000, 5000, 8000, 0, 11, 24053, 4, 32, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Hakkari Witch Doctor - In Combat - Cast \'Hex\''), +(11831, 0, 2, 0, 0, 0, 100, 0, 1000, 3000, 3000, 5000, 0, 11, 17289, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Hakkari Witch Doctor - In Combat - Cast \'Shadow Shock\''), +(11831, 0, 3, 0, 0, 0, 100, 0, 5000, 15000, 5000, 10000, 0, 11, 24054, 1, 32, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Hakkari Witch Doctor - In Combat - Cast \'Shrink\''), +(11831, 0, 4, 0, 0, 0, 100, 1, 7500, 125000, 0, 0, 0, 11, 24052, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hakkari Witch Doctor - In Combat - Cast \'Summon Voodoo Spirit\' (No Repeat)'); From 519a5d2c0474a622228c73270783275ea4c5dfcc Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:27:49 +0000 Subject: [PATCH 043/161] chore(DB): import pending files Referenced commit(s): 232f5ae8286be8ab5a981c932ebb03dd71fcf1da --- .../hakkariwitchdoctor.sql => db_world/2022_08_01_12.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/hakkariwitchdoctor.sql => db_world/2022_08_01_12.sql} (97%) diff --git a/data/sql/updates/pending_db_world/hakkariwitchdoctor.sql b/data/sql/updates/db_world/2022_08_01_12.sql similarity index 97% rename from data/sql/updates/pending_db_world/hakkariwitchdoctor.sql rename to data/sql/updates/db_world/2022_08_01_12.sql index 00d4620ef..a07f650b6 100644 --- a/data/sql/updates/pending_db_world/hakkariwitchdoctor.sql +++ b/data/sql/updates/db_world/2022_08_01_12.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_11 -> 2022_08_01_12 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 11831; From a4cd022c48abbedaf90b32c0f30c0939ef310bdd Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Mon, 1 Aug 2022 16:40:38 -0400 Subject: [PATCH 044/161] fix(DB/Creature): Add Black Bear Pack northwest of the Ironforge Airfield. (#12564) --- data/sql/updates/pending_db_world/black-bear-pack.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 data/sql/updates/pending_db_world/black-bear-pack.sql diff --git a/data/sql/updates/pending_db_world/black-bear-pack.sql b/data/sql/updates/pending_db_world/black-bear-pack.sql new file mode 100644 index 000000000..173343c95 --- /dev/null +++ b/data/sql/updates/pending_db_world/black-bear-pack.sql @@ -0,0 +1,8 @@ +DELETE FROM `creature` WHERE `guid` IN (161044, 161045, 161046); +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(161044, 1128, 0, 0, 0, 0, 0, 1, 1, 0, -4310.01, -1447.54, 400.56363, 3.93681, 120, 19, 0, 122, 0, 1, 0, 0, 0, '', 0), +(161045, 1128, 0, 0, 0, 0, 0, 1, 1, 0, -4293.55, -1431.15, 390.08798, 2.1588, 120, 13, 0, 144, 0, 1, 0, 0, 0, '', 0), +(161046, 1129, 0, 0, 0, 0, 0, 1, 1, 0, -4300.36, -1420.53, 391.496, 5.16617, 120, 0, 0, 144, 0, 0, 0, 0, 0, '', 0); + +DELETE FROM `creature_addon` WHERE `guid` = 161046; +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES (161046, 0, 0, 1, 0, 0, 0, NULL); From 62fbef83c457e53e67044fea44ae42a85eb79319 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:42:46 +0000 Subject: [PATCH 045/161] chore(DB): import pending files Referenced commit(s): a4cd022c48abbedaf90b32c0f30c0939ef310bdd --- .../black-bear-pack.sql => db_world/2022_08_01_13.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/black-bear-pack.sql => db_world/2022_08_01_13.sql} (95%) diff --git a/data/sql/updates/pending_db_world/black-bear-pack.sql b/data/sql/updates/db_world/2022_08_01_13.sql similarity index 95% rename from data/sql/updates/pending_db_world/black-bear-pack.sql rename to data/sql/updates/db_world/2022_08_01_13.sql index 173343c95..fe6baf573 100644 --- a/data/sql/updates/pending_db_world/black-bear-pack.sql +++ b/data/sql/updates/db_world/2022_08_01_13.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_12 -> 2022_08_01_13 DELETE FROM `creature` WHERE `guid` IN (161044, 161045, 161046); INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES (161044, 1128, 0, 0, 0, 0, 0, 1, 1, 0, -4310.01, -1447.54, 400.56363, 3.93681, 120, 19, 0, 122, 0, 1, 0, 0, 0, '', 0), From 56d8899bd167f85b62c42b8e8fcd6d7d483e7849 Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Mon, 1 Aug 2022 14:43:20 -0600 Subject: [PATCH 046/161] fix(DB/Creature): Make Nefarian's Troops invisible (#12572) --- data/sql/updates/pending_db_world/rev_1659015925728207500.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659015925728207500.sql diff --git a/data/sql/updates/pending_db_world/rev_1659015925728207500.sql b/data/sql/updates/pending_db_world/rev_1659015925728207500.sql new file mode 100644 index 000000000..42a332459 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659015925728207500.sql @@ -0,0 +1,3 @@ +-- +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432 WHERE `entry`=14459; + From 841e2d81c26661448952af3be6075001d207eeb2 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 20:45:25 +0000 Subject: [PATCH 047/161] chore(DB): import pending files Referenced commit(s): 56d8899bd167f85b62c42b8e8fcd6d7d483e7849 --- .../rev_1659015925728207500.sql => db_world/2022_08_01_14.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659015925728207500.sql => db_world/2022_08_01_14.sql} (67%) diff --git a/data/sql/updates/pending_db_world/rev_1659015925728207500.sql b/data/sql/updates/db_world/2022_08_01_14.sql similarity index 67% rename from data/sql/updates/pending_db_world/rev_1659015925728207500.sql rename to data/sql/updates/db_world/2022_08_01_14.sql index 42a332459..140dd97e4 100644 --- a/data/sql/updates/pending_db_world/rev_1659015925728207500.sql +++ b/data/sql/updates/db_world/2022_08_01_14.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_13 -> 2022_08_01_14 -- UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33554432 WHERE `entry`=14459; From f13854cd5e6002b6a04de45af183c5347e3b45c5 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 1 Aug 2022 22:53:03 +0200 Subject: [PATCH 048/161] =?UTF-8?q?fix(Core/SmartScripts):=20Fixed=20`SMAR?= =?UTF-8?q?T=5FACTION=5FSTART=5FFOLLOW`=20not=20complet=E2=80=A6=20(#12580?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ing quests. --- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- src/server/game/Spells/SpellInfoCorrections.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 29cda5530..09fbc1d6d 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -917,7 +917,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(target)) { float angle = e.action.follow.angle > 6 ? (e.action.follow.angle * M_PI / 180.0f) : e.action.follow.angle; - CAST_AI(SmartAI, me->AI())->SetFollow(target->ToUnit(), float(e.action.follow.dist) + 0.1f, angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType); + CAST_AI(SmartAI, me->AI())->SetFollow(target->ToUnit(), float(e.action.follow.dist) + 0.1f, angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType, e.action.follow.aliveState); LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature {} following target {}", me->GetGUID().ToString(), target->GetGUID().ToString()); break; diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 30ca46693..529933a06 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4329,6 +4329,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000003, 0x00001000); }); + // Find the Ancient Hero: Kill Credit + ApplySpellFix({ 25729 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].TargetA = TARGET_UNIT_SUMMONER; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; From 314e6a84f7d7b0f376dbe9eae1ecf612d1252ad5 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 1 Aug 2022 22:53:53 +0200 Subject: [PATCH 049/161] fix(Scripts/Spells): Fixed T3 4P Frostfire Regalia bonus not proccing. (#12583) --- src/server/scripts/Spells/spell_generic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 8204f55b4..6036ab00d 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1199,7 +1199,7 @@ class spell_gen_adaptive_warding : public AuraScript bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetSpellInfo()) + if (!eventInfo.GetSpellInfo()) return false; // find Mage Armor From 8a3e43c65653cd9ca31e10771f13cbd289578a26 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 1 Aug 2022 17:58:13 -0300 Subject: [PATCH 050/161] fix(DB/Spells): Hive'Zara Tail Lasher's Tail Lash (#12601) Co-authored-by: Gultask --- .../updates/pending_db_world/rev_1659291517838965500.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659291517838965500.sql diff --git a/data/sql/updates/pending_db_world/rev_1659291517838965500.sql b/data/sql/updates/pending_db_world/rev_1659291517838965500.sql new file mode 100644 index 000000000..5605be819 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659291517838965500.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 25654 AND `spell_effect` = 6608; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(25654, 6608, 1, 'Hive\'Zara Tail Lasher: On Tail Lash - Apply Dropped Weapon'); + +UPDATE `smart_scripts` SET `event_param3`=10900, `event_param4`=23100 WHERE `entryorguid`=15336 AND `source_type`=0 AND `id`=4 AND `link`=0; From d9f9c4f0d8ca7eadf8ca9878273034e0f7c9194f Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 21:00:24 +0000 Subject: [PATCH 051/161] chore(DB): import pending files Referenced commit(s): 8a3e43c65653cd9ca31e10771f13cbd289578a26 --- .../rev_1659291517838965500.sql => db_world/2022_08_01_15.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659291517838965500.sql => db_world/2022_08_01_15.sql} (90%) diff --git a/data/sql/updates/pending_db_world/rev_1659291517838965500.sql b/data/sql/updates/db_world/2022_08_01_15.sql similarity index 90% rename from data/sql/updates/pending_db_world/rev_1659291517838965500.sql rename to data/sql/updates/db_world/2022_08_01_15.sql index 5605be819..612ae20ee 100644 --- a/data/sql/updates/pending_db_world/rev_1659291517838965500.sql +++ b/data/sql/updates/db_world/2022_08_01_15.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_14 -> 2022_08_01_15 -- DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 25654 AND `spell_effect` = 6608; INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES From ec35f99107e71d5d90cbef7ca52954a78b975ccd Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Mon, 1 Aug 2022 16:03:35 -0500 Subject: [PATCH 052/161] fix(DB/Creature): ZG Formations: Before Bats cont. Troll 3-pack (#12511) --- .../rev_1658607158126098600.sql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658607158126098600.sql diff --git a/data/sql/updates/pending_db_world/rev_1658607158126098600.sql b/data/sql/updates/pending_db_world/rev_1658607158126098600.sql new file mode 100644 index 000000000..cc9ef7f52 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658607158126098600.sql @@ -0,0 +1,35 @@ +-- +-- Maintenance on ZG Before Bats Part 3: Pooling Part 2 Troll Pack before Bat Area +-- Formations shouldn't be needed on this pack (they agro properly without) + +-- Pool Troll pack before Bat area (49120, 49121, 49122) with it's counterpart, (created as 12814, 12815, 12816) +DELETE FROM `creature` WHERE `guid` BETWEEN 12814 AND 12816; +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(12814, 11831, 0, 0, 309, 0, 0, 1, 1, 1, -12007.2, -1492.45, 82.0241, 1.39626, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 0), +(12815, 11831, 0, 0, 309, 0, 0, 1, 1, 1, -12008.5, -1484.79, 79.1498, 4.87654, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 0), +(12816, 11351, 0, 0, 309, 0, 0, 1, 1, 1, -12004.5, -1483.46, 79.5746, 4.71553, 7200, 0, 0, 0, 0, 0, 0, 0, 0, '', 0); + +DELETE FROM `pool_template` WHERE `entry` BETWEEN 476 AND 478; +DELETE FROM `pool_pool` WHERE `pool_id` BETWEEN 476 AND 478; +DELETE FROM `pool_pool` WHERE `mother_pool` BETWEEN 476 AND 478; +DELETE FROM `pool_creature` WHERE `pool_entry` BETWEEN 476 AND 478; +DELETE FROM `pool_creature` WHERE `guid` IN (49120, 49121, 49122, 12814, 12815, 12816); + + +INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES +(476, 1, 'ZG Before Bats Troll 3-Pack'), +(477, 3, 'ZG Before Bats Troll 3-Pack with 2x entry 11831 50% 1/2'), +(478, 3, 'ZG Before Bats Troll 3-Pack with 2x entry 11351 50% 2/2'); + +INSERT INTO `pool_pool` (`pool_id`, `mother_pool`, `chance`, `description`) VALUES +(477, 476, 50, 'ZG Before Bats Troll 3-Pack with 2x entry 11831'), +(478, 476, 50, 'ZG Before Bats Troll 3-Pack with 2x entry 11351'); + +INSERT INTO `pool_creature` (`guid`, `pool_entry`, `description`) VALUES +(12814, 477, 'ZG Before Bats Troll 3-Pack entry 11831'), +(12815, 477, 'ZG Before Bats Troll 3-Pack entry 11831'), +(12816, 477, 'ZG Before Bats Troll 3-Pack entry 11351'), + +(49120, 478, 'ZG Before Bats Troll 3-Pack entry 11351'), +(49121, 478, 'ZG Before Bats Troll 3-Pack entry 11351'), +(49122, 478, 'ZG Before Bats Troll 3-Pack entry 11831'); From ad7928ff9c370638727d96be3e3e9aa89a7a6372 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 21:05:45 +0000 Subject: [PATCH 053/161] chore(DB): import pending files Referenced commit(s): ec35f99107e71d5d90cbef7ca52954a78b975ccd --- .../rev_1658607158126098600.sql => db_world/2022_08_01_16.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658607158126098600.sql => db_world/2022_08_01_16.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1658607158126098600.sql b/data/sql/updates/db_world/2022_08_01_16.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1658607158126098600.sql rename to data/sql/updates/db_world/2022_08_01_16.sql index cc9ef7f52..05ad28c8d 100644 --- a/data/sql/updates/pending_db_world/rev_1658607158126098600.sql +++ b/data/sql/updates/db_world/2022_08_01_16.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_15 -> 2022_08_01_16 -- -- Maintenance on ZG Before Bats Part 3: Pooling Part 2 Troll Pack before Bat Area -- Formations shouldn't be needed on this pack (they agro properly without) From a5346d78112d188051eb8d6678f144925bbe5b7a Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 1 Aug 2022 23:09:01 +0200 Subject: [PATCH 054/161] fix(Scripts/Spells): Fixed T3 6P Frostfire Regalia bonus not proccing. (#12585) --- src/server/game/Spells/SpellInfoCorrections.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 529933a06..c667daac3 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4329,6 +4329,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x00000003, 0x00001000); }); + // Elemental Vulnerability + ApplySpellFix({ 28772 }, [](SpellInfo* spellInfo) + { + spellInfo->Speed = 1; + }); + // Find the Ancient Hero: Kill Credit ApplySpellFix({ 25729 }, [](SpellInfo* spellInfo) { From da4bb947e45a66fd2fa935366b16141a878bc191 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 1 Aug 2022 18:10:08 -0300 Subject: [PATCH 055/161] fix(DB/RuinsOfAhnQiraj): add missing SAI for some creatures (#12602) --- .../rev_1659293964039098600.sql | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659293964039098600.sql diff --git a/data/sql/updates/pending_db_world/rev_1659293964039098600.sql b/data/sql/updates/pending_db_world/rev_1659293964039098600.sql new file mode 100644 index 000000000..792408f22 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659293964039098600.sql @@ -0,0 +1,21 @@ +-- +DELETE FROM `creature_text` WHERE `CreatureID` = 15320 AND `GroupID` = 0; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration` ,`Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(15320, 0, 0, '%s counterattacks with retaliation.', 16, 0, 100, 0, 0, 0, 11018, 0, 'Hive\'Zara Soldier - On Retaliation'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15320) AND (`source_type` = 0) AND (`id` IN (0, 1, 2)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(15320, 0, 0, 2, 2, 0, 100, 1, 0, 30, 0, 0, 0, 11, 22857, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hive\'Zara Soldier - Between 0-30% Health - Cast \'Retaliation\' (No Repeat)'), +(15320, 0, 1, 0, 9, 0, 100, 0, 0, 30, 10000, 18200, 0, 11, 25497, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Hive\'Zara Soldier - Within 0-30 Range - Cast \'Venom Spit\''), +(15320, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hive\'Zara Soldier - Between 0-30% Health - Say Line 0 (No Repeat)'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15344; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15344) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(15344, 0, 0, 0, 0, 0, 100, 0, 4850, 18250, 4850, 18250, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Swarmguard Needler - In Combat - Cast \'Cleave\''); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15387) AND (`source_type` = 0) AND (`id` IN (2,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 +(15387, 0, 2, 0, 0, 0, 100, 0, 3600, 14600, 3600, 14600, 0, 11, 10966, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Qiraji Warrior - In Combat - Cast \'Uppercut\''), +(15387, 0, 3, 0, 0, 0, 100, 0, 40000, 70000, 40000, 70000, 0, 11, 15588, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Qiraji Warrior - In Combat - Cast \'Thunderclap\''); From 1d6c54e07dc79feba50d1435d22c9b5669868a63 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 21:12:08 +0000 Subject: [PATCH 056/161] chore(DB): import pending files Referenced commit(s): da4bb947e45a66fd2fa935366b16141a878bc191 --- .../rev_1659293964039098600.sql => db_world/2022_08_01_17.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659293964039098600.sql => db_world/2022_08_01_17.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1659293964039098600.sql b/data/sql/updates/db_world/2022_08_01_17.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1659293964039098600.sql rename to data/sql/updates/db_world/2022_08_01_17.sql index 792408f22..5546977e4 100644 --- a/data/sql/updates/pending_db_world/rev_1659293964039098600.sql +++ b/data/sql/updates/db_world/2022_08_01_17.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_16 -> 2022_08_01_17 -- DELETE FROM `creature_text` WHERE `CreatureID` = 15320 AND `GroupID` = 0; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration` ,`Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES From 3a4459eeebbd3bc7a59e70b50c435bc7e518a8b7 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Mon, 1 Aug 2022 18:55:47 -0300 Subject: [PATCH 057/161] fix(Core/RuinsOfAhnQiraj): Ossirian Crystals: Weakness spells (#12547) --- .../rev_1658855914422981600.sql | 8 +++++ .../RuinsOfAhnQiraj/boss_ossirian.cpp | 36 ++++++++++++++++--- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1658855914422981600.sql diff --git a/data/sql/updates/pending_db_world/rev_1658855914422981600.sql b/data/sql/updates/pending_db_world/rev_1658855914422981600.sql new file mode 100644 index 000000000..16915e909 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658855914422981600.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_crystal_weakness'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(25177, 'spell_crystal_weakness'), +(25178, 'spell_crystal_weakness'), +(25180, 'spell_crystal_weakness'), +(25181, 'spell_crystal_weakness'), +(25183, 'spell_crystal_weakness'); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index bfa85bc52..f6ae0b579 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -21,6 +21,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellInfo.h" +#include "SpellScript.h" #include "ruins_of_ahnqiraj.h" #include "TaskScheduler.h" @@ -40,7 +41,14 @@ enum Spells SPELL_WAR_STOMP = 25188, SPELL_STRENGHT_OF_OSSIRIAN = 25176, SPELL_SAND_STORM = 25160, - SPELL_SUMMON_CRYSTAL = 25192 + SPELL_SUMMON_CRYSTAL = 25192, + + // Crystal + SPELL_FIRE_WEAKNESS = 25177, + SPELL_FROST_WEAKNESS = 25178, + SPELL_NATURE_WEAKNESS = 25180, + SPELL_ARCANE_WEAKNESS = 25181, + SPELL_SHADOW_WEAKNESS = 25183 }; enum Actions @@ -72,7 +80,8 @@ Position CrystalCoordinates[NUM_CRYSTALS] = float roomRadius = 165.0f; uint8 const NUM_TORNADOS = 2; uint8 const NUM_WEAKNESS = 5; -uint32 const spellWeakness[NUM_WEAKNESS] = { 25177, 25178, 25180, 25181, 25183 }; +uint32 const spellWeakness[NUM_WEAKNESS] = +{ SPELL_FIRE_WEAKNESS, SPELL_FROST_WEAKNESS, SPELL_NATURE_WEAKNESS, SPELL_ARCANE_WEAKNESS, SPELL_SHADOW_WEAKNESS }; Position const RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 }; struct boss_ossirian : public BossAI @@ -92,7 +101,7 @@ struct boss_ossirian : public BossAI void SpellHit(Unit* caster, SpellInfo const* spell) override { - for (uint8 weakness : spellWeakness) + for (uint32 weakness : spellWeakness) { if (spell->Id == weakness) { @@ -220,7 +229,7 @@ struct boss_ossirian : public BossAI } else { - for (uint8 weakness : spellWeakness) + for (uint32 weakness : spellWeakness) { if (me->HasAura(weakness)) { @@ -363,9 +372,28 @@ private: TaskScheduler _scheduler; }; +class spell_crystal_weakness : public SpellScript +{ + PrepareSpellScript(spell_crystal_weakness); + + void FilterTargets(std::list& targets) + { + targets.remove_if([&](WorldObject const* target) -> bool + { + return target->GetEntry() != NPC_OSSIRIAN; + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_crystal_weakness::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENTRY); + } +}; + void AddSC_boss_ossirian() { RegisterRuinsOfAhnQirajCreatureAI(boss_ossirian); new go_ossirian_crystal(); RegisterCreatureAI(npc_anubisath_guardian); + RegisterSpellScript(spell_crystal_weakness); } From 7f9ea035deb930b2cf8457a414162471469983c1 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 1 Aug 2022 21:58:10 +0000 Subject: [PATCH 058/161] chore(DB): import pending files Referenced commit(s): 3a4459eeebbd3bc7a59e70b50c435bc7e518a8b7 --- .../rev_1658855914422981600.sql => db_world/2022_08_01_18.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658855914422981600.sql => db_world/2022_08_01_18.sql} (88%) diff --git a/data/sql/updates/pending_db_world/rev_1658855914422981600.sql b/data/sql/updates/db_world/2022_08_01_18.sql similarity index 88% rename from data/sql/updates/pending_db_world/rev_1658855914422981600.sql rename to data/sql/updates/db_world/2022_08_01_18.sql index 16915e909..43752e8b2 100644 --- a/data/sql/updates/pending_db_world/rev_1658855914422981600.sql +++ b/data/sql/updates/db_world/2022_08_01_18.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_01_17 -> 2022_08_01_18 -- DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_crystal_weakness'; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES From 572a680c16c75e136fdfc593affa7cc3beaa0e2a Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Tue, 2 Aug 2022 04:21:11 +0200 Subject: [PATCH 059/161] fix(Core/Movement): Improvements to taxi flight movement generator: (#12347) Changed multi-segment taxi paths to fly nearby flight masters along the way, not directly through them. Taxi cost on multi-segment paths is now charged per segment when it is started. Properly send taxi node status on login, as well as if the taxi master is out of range. Apply reputation discount to all points in multi-segment paths. Properly clean up list of taxi destinations upon arrival at final node. Teleport players to the destination taxi node location instead of their current ground position. Don't start a spline with just 1 point in FlightPathMovementGenerator Source: TrinityCore. --- .../rev_1657451078722098300.sql | 2 + src/server/game/DataStores/DBCStores.cpp | 10 +- src/server/game/Entities/Player/Player.cpp | 105 +++++++---- src/server/game/Entities/Player/Player.h | 4 +- .../game/Entities/Player/PlayerStorage.cpp | 6 +- .../game/Entities/Player/PlayerTaxi.cpp | 65 +++++-- src/server/game/Entities/Player/PlayerTaxi.h | 23 ++- src/server/game/Handlers/CharacterHandler.cpp | 2 +- src/server/game/Handlers/MovementHandler.cpp | 16 ++ src/server/game/Handlers/TaxiHandler.cpp | 64 +++++-- .../WaypointMovementGenerator.cpp | 163 ++++++++++-------- .../WaypointMovementGenerator.h | 70 ++++---- src/server/shared/DataStores/DBCStructure.h | 6 +- 13 files changed, 347 insertions(+), 189 deletions(-) create mode 100644 data/sql/updates/pending_db_characters/rev_1657451078722098300.sql diff --git a/data/sql/updates/pending_db_characters/rev_1657451078722098300.sql b/data/sql/updates/pending_db_characters/rev_1657451078722098300.sql new file mode 100644 index 000000000..158dc00aa --- /dev/null +++ b/data/sql/updates/pending_db_characters/rev_1657451078722098300.sql @@ -0,0 +1,2 @@ +-- +UPDATE `characters` SET `taxi_path`=CONCAT('0 ', `taxi_path`) WHERE LENGTH(`taxi_path`) > 0; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 8952741db..1d6192e2b 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -546,11 +546,11 @@ void LoadDBCStores(const std::string& dataPath) if (sInfo->Effect[j] == SPELL_EFFECT_SEND_TAXI) spellPaths.insert(sInfo->EffectMiscValue[j]); - memset(sTaxiNodesMask, 0, sizeof(sTaxiNodesMask)); - memset(sOldContinentsNodesMask, 0, sizeof(sOldContinentsNodesMask)); - memset(sHordeTaxiNodesMask, 0, sizeof(sHordeTaxiNodesMask)); - memset(sAllianceTaxiNodesMask, 0, sizeof(sAllianceTaxiNodesMask)); - memset(sDeathKnightTaxiNodesMask, 0, sizeof(sDeathKnightTaxiNodesMask)); + sTaxiNodesMask.fill(0); + sOldContinentsNodesMask.fill(0); + sHordeTaxiNodesMask.fill(0); + sAllianceTaxiNodesMask.fill(0); + sDeathKnightTaxiNodesMask.fill(0); for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i) { diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2abdf6374..575f410fe 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1644,10 +1644,8 @@ void Player::ProcessDelayedOperations() { if (m_entryPointData.HasTaxiPath()) { - for (size_t i = 0; i < m_entryPointData.taxiPath.size() - 1; ++i) - m_taxi.AddTaxiDestination(m_entryPointData.taxiPath[i]); - m_taxi.SetTaxiSegment(m_entryPointData.taxiPath[m_entryPointData.taxiPath.size() - 1]); - + m_taxi.AddTaxiDestination(m_entryPointData.taxiPath[0]); + m_taxi.AddTaxiDestination(m_entryPointData.taxiPath[1]); m_entryPointData.ClearTaxiPath(); ContinueTaxiFlight(); } @@ -10002,26 +10000,6 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc return false; } - // check node starting pos data set case if provided - if (node->x != 0.0f || node->y != 0.0f || node->z != 0.0f) - { - if (node->map_id != GetMapId() || - (node->x - GetPositionX()) * (node->x - GetPositionX()) + - (node->y - GetPositionY()) * (node->y - GetPositionY()) + - (node->z - GetPositionZ()) * (node->z - GetPositionZ()) > - (2 * INTERACTION_DISTANCE) * (2 * INTERACTION_DISTANCE) * (2 * INTERACTION_DISTANCE)) - { - GetSession()->SendActivateTaxiReply(ERR_TAXITOOFARAWAY); - return false; - } - } - // node must have pos if taxi master case (npc != nullptr) - else if (npc) - { - GetSession()->SendActivateTaxiReply(ERR_TAXIUNSPECIFIEDSERVERERROR); - return false; - } - // Prepare to flight start now // stop combat at start taxi flight if any @@ -10043,6 +10021,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc // fill destinations path tail uint32 sourcepath = 0; uint32 totalcost = 0; + uint32 firstcost = 0; uint32 prevnode = sourcenode; uint32 lastnode = 0; @@ -10061,6 +10040,8 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc } totalcost += cost; + if (i == 1) + firstcost = cost; if (prevnode == sourcenode) sourcepath = path; @@ -10089,7 +10070,16 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc uint32 money = GetMoney(); if (npc) - totalcost = (uint32)ceil(totalcost * GetReputationPriceDiscount(npc)); + { + float discount = GetReputationPriceDiscount(npc); + totalcost = uint32(ceil(totalcost * discount)); + firstcost = uint32(ceil(firstcost * discount)); + m_taxi.SetFlightMasterFactionTemplateId(npc->GetFaction()); + } + else + { + m_taxi.SetFlightMasterFactionTemplateId(0); + } if (money < totalcost) { @@ -10100,8 +10090,6 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc //Checks and preparations done, DO FLIGHT UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1); - ModifyMoney(-(int32)totalcost); - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); // prevent stealth flight //RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK); @@ -10111,12 +10099,16 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc { TaxiNodesEntry const* lastPathNode = sTaxiNodesStore.LookupEntry(nodes[nodes.size() - 1]); m_taxi.ClearTaxiDestinations(); + ModifyMoney(-(int32)totalcost); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); TeleportTo(lastPathNode->map_id, lastPathNode->x, lastPathNode->y, lastPathNode->z, GetOrientation()); return false; } else { m_flightSpellActivated = spellid; + ModifyMoney(-(int32)firstcost); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, firstcost); GetSession()->SendActivateTaxiReply(ERR_TAXIOK); GetSession()->SendDoFlight(mount_display_id, sourcepath); } @@ -10212,6 +10204,39 @@ void Player::ContinueTaxiFlight() GetSession()->SendDoFlight(mountDisplayId, path, startNode); } +void Player::SendTaxiNodeStatusMultiple() +{ + for (auto itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr) + { + if (!itr->IsCreature()) + { + continue; + } + + Creature* creature = ObjectAccessor::GetCreature(*this, *itr); + if (!creature || creature->IsHostileTo(this)) + { + continue; + } + + if (!creature->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER)) + { + continue; + } + + uint32 nearestNode = sObjectMgr->GetNearestTaxiNode(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetMapId(), GetTeamId()); + if (!nearestNode) + { + continue; + } + + WorldPacket data(SMSG_TAXINODE_STATUS, 9); + data << *itr; + data << uint8(m_taxi.IsTaximaskNodeKnown(nearestNode) ? 1 : 0); + SendDirectMessage(&data); + } +} + void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) { PacketCooldowns cooldowns; @@ -10982,11 +11007,8 @@ void Player::SetEntryPoint() m_entryPointData.mountSpell = 0; m_entryPointData.joinPos = WorldLocation(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); - std::vector const& taxi = m_taxi.GetPath(); - for (std::vector::const_iterator itr = taxi.begin(); itr != taxi.end(); ++itr) - m_entryPointData.taxiPath.push_back(*itr); - - m_entryPointData.taxiPath.push_back(m_taxi.GetTaxiSegment()); + m_entryPointData.taxiPath[0] = m_taxi.GetTaxiSource(); + m_entryPointData.taxiPath[1] = m_taxi.GetTaxiDestination(); } else { @@ -11351,6 +11373,7 @@ void Player::SendInitialPacketsAfterAddToMap() SendEnchantmentDurations(); // must be after add to map SendItemDurations(); // must be after add to map SendQuestGiverStatusMultiple(); + SendTaxiNodeStatusMultiple(); // raid downscaling - send difficulty to player if (GetMap()->IsRaid()) @@ -12005,13 +12028,21 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const float Player::GetReputationPriceDiscount(Creature const* creature) const { - FactionTemplateEntry const* vendor_faction = creature->GetFactionTemplateEntry(); - if (!vendor_faction || !vendor_faction->faction) - return 1.0f; + return GetReputationPriceDiscount(creature->GetFactionTemplateEntry()); +} - ReputationRank rank = GetReputationRank(vendor_faction->faction); - if (rank <= REP_NEUTRAL) +float Player::GetReputationPriceDiscount(FactionTemplateEntry const* factionTemplate) const +{ + if (!factionTemplate || !factionTemplate->faction) + { return 1.0f; + } + + ReputationRank rank = GetReputationRank(factionTemplate->faction); + if (rank <= REP_NEUTRAL) + { + return 1.0f; + } return 1.0f - 0.05f * (rank - REP_NEUTRAL); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 7a5b10271..ddc3c1b68 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1126,6 +1126,7 @@ public: bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 1); void CleanupAfterTaxiFlight(); void ContinueTaxiFlight(); + void SendTaxiNodeStatusMultiple(); // mount_id can be used in scripting calls [[nodiscard]] bool IsDeveloper() const { return HasPlayerFlag(PLAYER_FLAGS_DEVELOPER); } @@ -1336,7 +1337,8 @@ public: bool BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot); bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore); - float GetReputationPriceDiscount(Creature const* creature) const; + [[nodiscard]] float GetReputationPriceDiscount(Creature const* creature) const; + [[nodiscard]] float GetReputationPriceDiscount(FactionTemplateEntry const* factionTemplate) const; [[nodiscard]] Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : nullptr; } [[nodiscard]] TradeData* GetTradeData() const { return m_trade; } diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 7e275bd1d..7cf8c69df 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -5190,10 +5190,8 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons // xinef: restore taxi flight from entry point data if (m_entryPointData.HasTaxiPath()) { - for (size_t i = 0; i < m_entryPointData.taxiPath.size() - 1; ++i) - m_taxi.AddTaxiDestination(m_entryPointData.taxiPath[i]); - m_taxi.SetTaxiSegment(m_entryPointData.taxiPath[m_entryPointData.taxiPath.size() - 1]); - + m_taxi.AddTaxiDestination(m_entryPointData.taxiPath[0]); + m_taxi.AddTaxiDestination(m_entryPointData.taxiPath[1]); m_entryPointData.ClearTaxiPath(); } } diff --git a/src/server/game/Entities/Player/PlayerTaxi.cpp b/src/server/game/Entities/Player/PlayerTaxi.cpp index a4bff7aa6..680af2e28 100644 --- a/src/server/game/Entities/Player/PlayerTaxi.cpp +++ b/src/server/game/Entities/Player/PlayerTaxi.cpp @@ -20,11 +20,6 @@ #include "Tokenize.h" #include "StringConvert.h" -PlayerTaxi::PlayerTaxi() : _taxiSegment(0) -{ - memset(m_taximask, 0, sizeof(m_taximask)); -} - void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level) { // class specific initial known nodes @@ -136,9 +131,25 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, TeamI { ClearTaxiDestinations(); - for (auto const& itr : Acore::Tokenize(values, ' ', false)) + std::vector tokens = Acore::Tokenize(values, ' ', false); + auto itr = tokens.begin(); + if (itr != tokens.end()) { - if (Optional node = Acore::StringTo(itr)) + if (Optional faction = Acore::StringTo(*itr)) + { + m_flightMasterFactionId = *faction; + } + else + { + return false; + } + } + else + return false; + + while ((++itr) != tokens.end()) + { + if (Optional node = Acore::StringTo(*itr)) { AddTaxiDestination(*node); } @@ -148,26 +159,33 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, TeamI } } + if (m_TaxiDestinations.empty()) + { + return true; + } + // Check integrity - if (m_TaxiDestinations.size() < 3) + if (m_TaxiDestinations.size() < 2) + { return false; + } - // xinef: current segment is saved as last destination in db - _taxiSegment = m_TaxiDestinations[m_TaxiDestinations.size() - 1]; - m_TaxiDestinations.pop_back(); - - for (size_t i = 0; i < m_TaxiDestinations.size() - 1; ++i) + for (size_t i = 1; i < m_TaxiDestinations.size(); ++i) { uint32 cost; uint32 path; - sObjectMgr->GetTaxiPath(m_TaxiDestinations[i], m_TaxiDestinations[i + 1], path, cost); + sObjectMgr->GetTaxiPath(m_TaxiDestinations[i - 1], m_TaxiDestinations[i], path, cost); if (!path) + { return false; + } } // can't load taxi path without mount set (quest taxi path?) if (!sObjectMgr->GetTaxiMountDisplayId(GetTaxiSource(), teamId, true)) + { return false; + } return true; } @@ -175,26 +193,34 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, TeamI std::string PlayerTaxi::SaveTaxiDestinationsToString() { if (m_TaxiDestinations.empty()) + { return ""; + } + + ASSERT(m_TaxiDestinations.size() >= 2); std::ostringstream ss; + ss << m_flightMasterFactionId << ' '; for (size_t i = 0; i < m_TaxiDestinations.size(); ++i) + { ss << m_TaxiDestinations[i] << ' '; + } - ss << _taxiSegment << ' '; return ss.str(); } uint32 PlayerTaxi::GetCurrentTaxiPath() const { - if (m_TaxiDestinations.size() < 2 || m_TaxiDestinations.size() <= _taxiSegment + 1) + if (m_TaxiDestinations.size() < 2) + { return 0; + } uint32 path; uint32 cost; - sObjectMgr->GetTaxiPath(m_TaxiDestinations[_taxiSegment], m_TaxiDestinations[_taxiSegment + 1], path, cost); + sObjectMgr->GetTaxiPath(m_TaxiDestinations[0], m_TaxiDestinations[1], path, cost); return path; } @@ -205,3 +231,8 @@ std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi) ss << taxi.m_taximask[i] << ' '; return ss; } + +FactionTemplateEntry const* PlayerTaxi::GetFlightMasterFactionTemplate() const +{ + return sFactionTemplateStore.LookupEntry(m_flightMasterFactionId); +} diff --git a/src/server/game/Entities/Player/PlayerTaxi.h b/src/server/game/Entities/Player/PlayerTaxi.h index 774b8499b..3923a8c54 100644 --- a/src/server/game/Entities/Player/PlayerTaxi.h +++ b/src/server/game/Entities/Player/PlayerTaxi.h @@ -26,7 +26,7 @@ class ByteBuffer; class AC_GAME_API PlayerTaxi { public: - PlayerTaxi(); + PlayerTaxi() : m_flightMasterFactionId(0) { m_taximask.fill(0); } ~PlayerTaxi() = default; // Nodes @@ -59,29 +59,28 @@ public: bool LoadTaxiDestinationsFromString(std::string const& values, TeamId teamId); std::string SaveTaxiDestinationsToString(); - void ClearTaxiDestinations() { m_TaxiDestinations.clear(); _taxiSegment = 0; } + void ClearTaxiDestinations() { m_TaxiDestinations.clear(); } void AddTaxiDestination(uint32 dest) { m_TaxiDestinations.push_back(dest); } - [[nodiscard]] uint32 GetTaxiSource() const { return m_TaxiDestinations.size() <= _taxiSegment + 1 ? 0 : m_TaxiDestinations[_taxiSegment]; } - [[nodiscard]] uint32 GetTaxiDestination() const { return m_TaxiDestinations.size() <= _taxiSegment + 1 ? 0 : m_TaxiDestinations[_taxiSegment + 1]; } + [[nodiscard]] uint32 GetTaxiSource() const { return m_TaxiDestinations.empty() ? 0 : m_TaxiDestinations.front(); } + [[nodiscard]] uint32 GetTaxiDestination() const { return m_TaxiDestinations.size() < 2 ? 0 : m_TaxiDestinations[1]; } [[nodiscard]] uint32 GetCurrentTaxiPath() const; uint32 NextTaxiDestination() { - ++_taxiSegment; + m_TaxiDestinations.pop_front(); return GetTaxiDestination(); } - // xinef: - void SetTaxiSegment(uint32 segment) { _taxiSegment = segment; } - [[nodiscard]] uint32 GetTaxiSegment() const { return _taxiSegment; } - - [[nodiscard]] std::vector const& GetPath() const { return m_TaxiDestinations; } + [[nodiscard]] std::deque const& GetPath() const { return m_TaxiDestinations; } [[nodiscard]] bool empty() const { return m_TaxiDestinations.empty(); } + [[nodiscard]] FactionTemplateEntry const* GetFlightMasterFactionTemplate() const; + void SetFlightMasterFactionTemplateId(uint32 factionTemplateId) { m_flightMasterFactionId = factionTemplateId; } friend std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi); + private: TaxiMask m_taximask; - std::vector m_TaxiDestinations; - uint32 _taxiSegment; + std::deque m_TaxiDestinations; + uint32 m_flightMasterFactionId; }; #endif diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 949524ce2..e159441c8 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2195,7 +2195,7 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptrSendInitialPacketsAfterAddToMap(); + // flight fast teleport case + if (GetPlayer()->IsInFlight()) + { + if (!GetPlayer()->InBattleground()) + { + // short preparations to continue flight + MovementGenerator* movementGenerator = GetPlayer()->GetMotionMaster()->top(); + movementGenerator->Initialize(GetPlayer()); + return; + } + + // battleground state prepare, stop flight + GetPlayer()->GetMotionMaster()->MovementExpired(); + GetPlayer()->CleanupAfterTaxiFlight(); + } + // resurrect character at enter into instance where his corpse exist after add to map Corpse* corpse = GetPlayer()->GetMap()->GetCorpseByPlayer(GetPlayer()->GetGUID()); if (corpse && corpse->GetType() != CORPSE_BONES) diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 466285a24..e3678168a 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -15,6 +15,7 @@ * with this program. If not, see . */ +#include "GameTime.h" #include "ObjectMgr.h" #include "Opcodes.h" #include "Player.h" @@ -36,25 +37,24 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket& recvData) void WorldSession::SendTaxiStatus(ObjectGuid guid) { - // cheating checks - Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); - if (!unit) + Player* const player = GetPlayer(); + Creature* unit = ObjectAccessor::GetCreature(*player, guid); + if (!unit || unit->IsHostileTo(player) || !unit->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER)) { LOG_DEBUG("network", "WorldSession::SendTaxiStatus - Unit ({}) not found.", guid.ToString()); return; } - uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeamId()); - - // not found nearest - if (curloc == 0) + // find taxi node + uint32 nearest = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), player->GetTeamId()); + if (!nearest) + { return; - - LOG_DEBUG("network", "WORLD: current location {} ", curloc); + } WorldPacket data(SMSG_TAXINODE_STATUS, 9); data << guid; - data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0); + data << uint8(player->m_taxi.IsTaximaskNodeKnown(nearest) ? 1 : 0); SendPacket(&data); LOG_DEBUG("network", "WORLD: Sent SMSG_TAXINODE_STATUS"); } @@ -166,7 +166,7 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid) } } -void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket& recvData) +void WorldSession::HandleActivateTaxiExpressOpcode(WorldPacket& recvData) { LOG_DEBUG("network", "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); @@ -179,6 +179,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket& recvData) if (!npc) { LOG_DEBUG("network", "WORLD: HandleActivateTaxiExpressOpcode - Unit ({}) not found or you can't interact with it.", guid.ToString()); + SendActivateTaxiReply(ERR_TAXITOOFARAWAY); return; } std::vector nodes; @@ -218,6 +219,46 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) ReadMovementInfo(recvData, &movementInfo); recvData.read_skip(); // spline id + + // in taxi flight packet received in 2 case: + // 1) end taxi path in far (multi-node) flight + // 2) switch from one map to other in case multim-map taxi path + // we need process only (1) + + uint32 curDest = GetPlayer()->m_taxi.GetTaxiDestination(); + if (curDest) + { + TaxiNodesEntry const* curDestNode = sTaxiNodesStore.LookupEntry(curDest); + + // far teleport case + if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId() && GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) + { + if (FlightPathMovementGenerator* flight = dynamic_cast(GetPlayer()->GetMotionMaster()->top())) + { + // short preparations to continue flight + flight->SetCurrentNodeAfterTeleport(); + TaxiPathNodeEntry const* node = flight->GetPath()[flight->GetCurrentNode()]; + flight->SkipCurrentNode(); + + GetPlayer()->TeleportTo(curDestNode->map_id, node->x, node->y, node->z, GetPlayer()->GetOrientation(), TELE_TO_NOT_LEAVE_TAXI); + } + } + + return; + } + + // at this point only 1 node is expected (final destination) + if (GetPlayer()->m_taxi.GetPath().size() != 1) + { + return; + } + + GetPlayer()->CleanupAfterTaxiFlight(); + GetPlayer()->SetFallInformation(GameTime::GetGameTime().count(), GetPlayer()->GetPositionZ()); + if (GetPlayer()->pvpInfo.IsHostile) + { + GetPlayer()->CastSpell(GetPlayer(), 2479, true); + } } void WorldSession::HandleActivateTaxiOpcode(WorldPacket& recvData) @@ -234,6 +275,7 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket& recvData) if (!npc) { LOG_DEBUG("network", "WORLD: HandleActivateTaxiOpcode - Unit ({}) not found or you can't interact with it.", guid.ToString()); + SendActivateTaxiReply(ERR_TAXITOOFARAWAY); return; } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 10c9563df..28bb2d426 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -270,35 +270,71 @@ void WaypointMovementGenerator::MovementInform(Creature* creature) uint32 FlightPathMovementGenerator::GetPathAtMapEnd() const { if (i_currentNode >= i_path.size()) + { return i_path.size(); + } uint32 curMapId = i_path[i_currentNode]->mapid; for (uint32 i = i_currentNode; i < i_path.size(); ++i) + { if (i_path[i]->mapid != curMapId) + { return i; + } + } return i_path.size(); } +#define SKIP_SPLINE_POINT_DISTANCE_SQ (40.0f * 40.0f) + +bool IsNodeIncludedInShortenedPath(TaxiPathNodeEntry const* p1, TaxiPathNodeEntry const* p2) +{ + return p1->mapid != p2->mapid || std::pow(p1->x - p2->x, 2) + std::pow(p1->y - p2->y, 2) > SKIP_SPLINE_POINT_DISTANCE_SQ; +} + void FlightPathMovementGenerator::LoadPath(Player* player) { _pointsForPathSwitch.clear(); - std::vector const& taxi = player->m_taxi.GetPath(); - for (uint32 src = player->m_taxi.GetTaxiSegment(), dst = player->m_taxi.GetTaxiSegment() + 1; dst < taxi.size(); src = dst++) + std::deque const& taxi = player->m_taxi.GetPath(); + float discount = player->GetReputationPriceDiscount(player->m_taxi.GetFlightMasterFactionTemplate()); + for (uint32 src = 0, dst = 1; dst < taxi.size(); src = dst++) { uint32 path, cost; sObjectMgr->GetTaxiPath(taxi[src], taxi[dst], path, cost); if (path > sTaxiPathNodesByPath.size()) + { return; + } TaxiPathNodeList const& nodes = sTaxiPathNodesByPath[path]; if (!nodes.empty()) { + TaxiPathNodeEntry const* start = nodes[0]; + TaxiPathNodeEntry const* end = nodes[nodes.size() - 1]; + bool passedPreviousSegmentProximityCheck = false; for (uint32 i = 0; i < nodes.size(); ++i) - i_path.push_back(nodes[i]); + { + sMapMgr->CreateMap(nodes[i]->mapid, player)->SummonCreature(1, { nodes[i]->x, nodes[i]->y, nodes[i]->z, 0.0f })->SetLevel(i ? i : 1); + + if (passedPreviousSegmentProximityCheck || !src || i_path.empty() || IsNodeIncludedInShortenedPath(i_path[i_path.size() - 1], nodes[i])) + { + if ((!src || (IsNodeIncludedInShortenedPath(start, nodes[i]) && i >= 2)) && + (dst == taxi.size() - 1 || (IsNodeIncludedInShortenedPath(end, nodes[i]) && i < nodes.size() - 1))) + { + passedPreviousSegmentProximityCheck = true; + i_path.push_back(nodes[i]); + } + } + else + { + i_path.pop_back(); + --_pointsForPathSwitch.back().PathIndex; + } + } } - _pointsForPathSwitch.push_back(uint32(i_path.size() - 1)); + _pointsForPathSwitch.push_back({ uint32(i_path.size() - 1), int32(ceil(cost * discount)) }); } } @@ -313,7 +349,8 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack) player->ClearUnitState(UNIT_STATE_IN_FLIGHT); - // xinef: this should be cleaned by CleanupAfterTaxiFlight(); function! + uint32 taxiNodeId = player->m_taxi.GetTaxiDestination(); + player->m_taxi.ClearTaxiDestinations(); player->Dismount(); player->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); @@ -324,7 +361,13 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) // this prevent cheating with landing point at lags // when client side flight end early in comparison server side player->StopMoving(); - player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ()); + + // When the player reaches the last flight point, teleport to destination taxi node location + if (TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(taxiNodeId)) + { + player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ()); + player->TeleportTo(node->map_id, node->x, node->y, node->z, player->GetOrientation()); + } } player->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK); @@ -334,13 +377,23 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) void FlightPathMovementGenerator::DoReset(Player* player) { + uint32 end = GetPathAtMapEnd(); + uint32 currentNodeId = GetCurrentNode(); + + if (currentNodeId == end) + { + LOG_DEBUG("movement.flightpath", "FlightPathMovementGenerator::DoReset: trying to start a flypath from the end point. {}", player->GetGUID().ToString().c_str()); + return; + } + player->getHostileRefMgr().setOnlineOfflineState(false); player->AddUnitState(UNIT_STATE_IN_FLIGHT); player->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); Movement::MoveSplineInit init(player); - uint32 end = GetPathAtMapEnd(); - for (uint32 i = GetCurrentNode(); i < end; ++i) + // Providing a starting vertex since the taxi paths do not provide such + init.Path().push_back(G3D::Vector3(player->GetPositionX(), player->GetPositionY(), player->GetPositionZ())); + for (uint32 i = currentNodeId; i != end; ++i) { G3D::Vector3 vertice(i_path[i]->x, i_path[i]->y, i_path[i]->z); init.Path().push_back(vertice); @@ -353,77 +406,40 @@ void FlightPathMovementGenerator::DoReset(Player* player) bool FlightPathMovementGenerator::DoUpdate(Player* player, uint32 /*diff*/) { - if (!player) - return false; - - // xinef: map was switched - if (_mapSwitch) - { - DoInitialize(player); - _mapSwitch = false; - return true; - } - - uint32 pointId = (uint32)player->movespline->currentPathIdx(); - if (pointId > i_currentNode) + // skipping the first spline path point because it's our starting point and not a taxi path point + uint32 pointId = player->movespline->currentPathIdx() <= 0 ? 0 : player->movespline->currentPathIdx() - 1; + if (pointId > i_currentNode && i_currentNode < i_path.size() - 1) { bool departureEvent = true; do { - if (i_currentNode >= i_path.size()) - { - LOG_INFO("misc", "TAXI NODE WAS GREATER THAN PATH SIZE, {}, POINTID: {}, NODESIZE: {}, CURRENT: {}", - player->GetGUID().ToString(), pointId, i_path.size(), i_currentNode); - player->CleanupAfterTaxiFlight(); - return false; - } - - if (i_path[i_currentNode]->mapid != player->GetMapId()) - { - LOG_INFO("misc", "Player on different map, curmap: {}, pointmap: {}, nodesize: {}, currentnode: {}", player->GetMapId(), i_path[i_currentNode]->mapid, i_path.size(), i_currentNode); - player->CleanupAfterTaxiFlight(); - return false; - } + ASSERT(i_currentNode < i_path.size(), "Point Id: {}\n{}", pointId, player->GetGUID().ToString().c_str()); DoEventIfAny(player, i_path[i_currentNode], departureEvent); - - // xinef: erase any previous points - uint32 curSize = _pointsForPathSwitch.size(); - while (!_pointsForPathSwitch.empty() && _pointsForPathSwitch.front() <= i_currentNode) + while (!_pointsForPathSwitch.empty() && _pointsForPathSwitch.front().PathIndex <= i_currentNode) + { _pointsForPathSwitch.pop_front(); - - // xinef: switch destination only once - if (curSize != _pointsForPathSwitch.size()) player->m_taxi.NextTaxiDestination(); + if (!_pointsForPathSwitch.empty()) + { + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, _pointsForPathSwitch.front().Cost); + player->ModifyMoney(-_pointsForPathSwitch.front().Cost); + } + } if (pointId == i_currentNode) + { break; + } - if (i_currentNode == _preloadTargetNode && player->GetMapId() == _endMapId) + if (i_currentNode == _preloadTargetNode) + { PreloadEndGrid(); - i_currentNode += (uint32)departureEvent; + } + + i_currentNode += departureEvent ? 1 : 0; departureEvent = !departureEvent; - - // xinef: map should be switched, do not rely on client packets QQ - if (i_currentNode + 1 < i_path.size() && i_path[i_currentNode + 1]->mapid != player->GetMapId()) - { - ++i_currentNode; - _mapSwitch = true; - player->TeleportTo(i_path[i_currentNode]->mapid, i_path[i_currentNode]->x, i_path[i_currentNode]->y, i_path[i_currentNode]->z, player->GetOrientation(), TELE_TO_NOT_LEAVE_TAXI); - return true; - } - - // xinef: reached the end - if (i_currentNode >= i_path.size() - 1) - { - player->CleanupAfterTaxiFlight(); - player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ()); - if (player->pvpInfo.IsHostile) - player->CastSpell(player, 2479, true); - - return false; - } - } while (true); + } while (i_currentNode < i_path.size() - 1); } return i_currentNode < (i_path.size() - 1); @@ -432,7 +448,9 @@ bool FlightPathMovementGenerator::DoUpdate(Player* player, uint32 /*diff*/) void FlightPathMovementGenerator::SetCurrentNodeAfterTeleport() { if (i_path.empty() || i_currentNode >= i_path.size()) + { return; + } uint32 map0 = i_path[i_currentNode]->mapid; for (size_t i = i_currentNode + 1; i < i_path.size(); ++i) @@ -449,11 +467,20 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry { if (uint32 eventid = departure ? node->departureEventID : node->arrivalEventID) { - LOG_DEBUG("maps.script", "Taxi {} event {} of node {} of path {} for player {}", departure ? "departure" : "arrival", eventid, node->index, node->path, player->GetName()); + LOG_DEBUG("maps.script", "Taxi {} event {} of node {} of path {} for player {}", departure ? "departure" : "arrival", eventid, node->index, node->path, player->GetName().c_str()); player->GetMap()->ScriptsStart(sEventScripts, eventid, player, player); } } +bool FlightPathMovementGenerator::GetResetPos(Player*, float& x, float& y, float& z) +{ + TaxiPathNodeEntry const* node = i_path[i_currentNode]; + x = node->x; + y = node->y; + z = node->z; + return true; +} + void FlightPathMovementGenerator::InitEndGridInfo() { /*! Storage to preload flightmaster grid at end of flight. For multi-stop flights, this will @@ -485,11 +512,11 @@ void FlightPathMovementGenerator::PreloadEndGrid() // Load the grid if (endMap) { - LOG_DEBUG("movement", "Preloading rid ({}, {}) for map {} at node index {}/{}", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path.size() - 1)); + LOG_DEBUG("misc", "Preloading grid ({}, {}) for map %u at node index {}/{}", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path.size() - 1)); endMap->LoadGrid(_endGridX, _endGridY); } else { - LOG_DEBUG("movement", "Unable to determine map to preload flightmaster grid"); + LOG_DEBUG("misc", "Unable to determine map to preload flightmaster grid"); } } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 35eaa932a..1699a71a6 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -101,40 +101,48 @@ private: class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, public PathMovementBase { -public: - explicit FlightPathMovementGenerator(uint32 startNode = 0) - { - i_currentNode = startNode; - _endGridX = 0.0f; - _endGridY = 0.0f; - _endMapId = 0; - _preloadTargetNode = 0; - _mapSwitch = false; - } - void LoadPath(Player* player); - void DoInitialize(Player*); - void DoReset(Player*); - void DoFinalize(Player*); - bool DoUpdate(Player*, uint32); - MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; } + public: + explicit FlightPathMovementGenerator(uint32 startNode = 0) + { + i_currentNode = startNode; + _endGridX = 0.0f; + _endGridY = 0.0f; + _endMapId = 0; + _preloadTargetNode = 0; + } + void LoadPath(Player* player); + void DoInitialize(Player*); + void DoReset(Player*); + void DoFinalize(Player*); + bool DoUpdate(Player*, uint32); + MovementGeneratorType GetMovementGeneratorType() override { return FLIGHT_MOTION_TYPE; } - TaxiPathNodeList const& GetPath() { return i_path; } - uint32 GetPathAtMapEnd() const; - bool HasArrived() const { return (i_currentNode >= i_path.size()); } - void SetCurrentNodeAfterTeleport(); - void SkipCurrentNode() { ++i_currentNode; } - void DoEventIfAny(Player* player, TaxiPathNodeEntry const* node, bool departure); + TaxiPathNodeList const& GetPath() { return i_path; } + uint32 GetPathAtMapEnd() const; + bool HasArrived() const { return (i_currentNode >= i_path.size()); } + void SetCurrentNodeAfterTeleport(); + void SkipCurrentNode() { ++i_currentNode; } + void DoEventIfAny(Player* player, TaxiPathNodeEntry const* node, bool departure); - void InitEndGridInfo(); - void PreloadEndGrid(); + bool GetResetPos(Player*, float& x, float& y, float& z); -private: - float _endGridX; //! X coord of last node location - float _endGridY; //! Y coord of last node location - uint32 _endMapId; //! map Id of last node location - uint32 _preloadTargetNode; //! node index where preloading starts - bool _mapSwitch; + void InitEndGridInfo(); + void PreloadEndGrid(); - std::deque _pointsForPathSwitch; //! node indexes and costs where TaxiPath changes + private: + + float _endGridX; //! X coord of last node location + float _endGridY; //! Y coord of last node location + uint32 _endMapId; //! map Id of last node location + uint32 _preloadTargetNode; //! node index where preloading starts + + struct TaxiNodeChangeInfo + { + uint32 PathIndex; + int32 Cost; + }; + + std::deque _pointsForPathSwitch; //! node indexes and costs where TaxiPath changes }; + #endif diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h index 6b36051f7..38f0d6405 100644 --- a/src/server/shared/DataStores/DBCStructure.h +++ b/src/server/shared/DataStores/DBCStructure.h @@ -22,6 +22,7 @@ #include "Define.h" #include "SharedDefines.h" #include "Util.h" +#include #include #include #include @@ -2203,6 +2204,7 @@ typedef std::map TaxiPathSetBySource; typedef std::vector TaxiPathNodeList; typedef std::vector TaxiPathNodesByPath; -#define TaxiMaskSize 14 -typedef uint32 TaxiMask[TaxiMaskSize]; +static constexpr size_t TaxiMaskSize = 14; +typedef std::array TaxiMask; + #endif From 4378493acc8a78b5d4d47ca15441a476c57b16d2 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 2 Aug 2022 02:23:19 +0000 Subject: [PATCH 060/161] chore(DB): import pending files Referenced commit(s): 572a680c16c75e136fdfc593affa7cc3beaa0e2a --- .../2022_08_02_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_characters/rev_1657451078722098300.sql => db_characters/2022_08_02_00.sql} (68%) diff --git a/data/sql/updates/pending_db_characters/rev_1657451078722098300.sql b/data/sql/updates/db_characters/2022_08_02_00.sql similarity index 68% rename from data/sql/updates/pending_db_characters/rev_1657451078722098300.sql rename to data/sql/updates/db_characters/2022_08_02_00.sql index 158dc00aa..177cfe81f 100644 --- a/data/sql/updates/pending_db_characters/rev_1657451078722098300.sql +++ b/data/sql/updates/db_characters/2022_08_02_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_05_24_00 -> 2022_08_02_00 -- UPDATE `characters` SET `taxi_path`=CONCAT('0 ', `taxi_path`) WHERE LENGTH(`taxi_path`) > 0; From c806c62c62fd1a426504a8cf50d45f2e4fd6ed38 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Wed, 3 Aug 2022 09:05:24 -0300 Subject: [PATCH 061/161] fix(Core/Spells): Crashfix (#12609) --- src/server/game/Entities/Unit/Unit.cpp | 16 ++++++++-------- src/server/game/Entities/Unit/Unit.h | 2 +- .../game/Spells/Auras/SpellAuraEffects.cpp | 13 ++++++------- src/server/game/Spells/Spell.cpp | 12 ++++++------ 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1de73ca27..71962e1ed 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2414,7 +2414,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BASE_A DealMeleeDamage(&damageInfo, true); DamageInfo dmgInfo(damageInfo); - ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, + Unit::ProcDamageAndSpell(damageInfo.attacker, damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType, nullptr, nullptr, -1, nullptr, &dmgInfo); if (GetTypeId() == TYPEID_PLAYER) @@ -5960,15 +5960,15 @@ void Unit::SendSpellNonMeleeDamageLog(Unit* target, SpellInfo const* spellInfo, SendSpellNonMeleeDamageLog(&log); } -void Unit::ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellInfo const* procSpellInfo, SpellInfo const* procAura, int8 procAuraEffectIndex, Spell const* procSpell, DamageInfo* damageInfo, HealInfo* healInfo, uint32 procPhase) +void Unit::ProcDamageAndSpell(Unit* actor, Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procExtra, uint32 amount, WeaponAttackType attType, SpellInfo const* procSpellInfo, SpellInfo const* procAura, int8 procAuraEffectIndex, Spell const* procSpell, DamageInfo* damageInfo, HealInfo* healInfo, uint32 procPhase) { // Not much to do if no flags are set. - if (procAttacker) - ProcDamageAndSpellFor(false, victim, procAttacker, procExtra, attType, procSpellInfo, amount, procAura, procAuraEffectIndex, procSpell, damageInfo, healInfo, procPhase); + if (procAttacker && actor) + actor->ProcDamageAndSpellFor(false, victim, procAttacker, procExtra, attType, procSpellInfo, amount, procAura, procAuraEffectIndex, procSpell, damageInfo, healInfo, procPhase); // Now go on with a victim's events'n'auras // Not much to do if no flags are set or there is no victim if (victim && victim->IsAlive() && procVictim) - victim->ProcDamageAndSpellFor(true, this, procVictim, procExtra, attType, procSpellInfo, amount, procAura, procAuraEffectIndex, procSpell, damageInfo, healInfo, procPhase); + victim->ProcDamageAndSpellFor(true, actor, procVictim, procExtra, attType, procSpellInfo, amount, procAura, procAuraEffectIndex, procSpell, damageInfo, healInfo, procPhase); } void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo) @@ -17388,15 +17388,15 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp if (killer && (killer->IsPet() || killer->IsTotem())) if (Unit* owner = killer->GetOwner()) { - owner->ProcDamageAndSpell(victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); + Unit::ProcDamageAndSpell(owner, victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); sScriptMgr->OnCreatureKilledByPet( killer->GetCharmerOrOwnerPlayerOrPlayerItself(), victim->ToCreature()); } if (killer != victim && !victim->IsCritter()) - killer->ProcDamageAndSpell(victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); + Unit::ProcDamageAndSpell(killer, victim, killer ? PROC_FLAG_KILL : 0, PROC_FLAG_KILLED, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); // Proc auras on death - must be before aura/combat remove - victim->ProcDamageAndSpell(nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); + Unit::ProcDamageAndSpell(victim, nullptr, PROC_FLAG_DEATH, PROC_FLAG_NONE, PROC_EX_NONE, 0, attackType, spellProto, nullptr, -1, spell); // update get killing blow achievements, must be done before setDeathState to be able to require auras on target // and before Spirit of Redemption as it also removes auras diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 39983f0d0..d4e5190f9 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1524,7 +1524,7 @@ public: static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr, Spell const* spell = nullptr); static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth); - void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpellInfo = nullptr, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/); + static void ProcDamageAndSpell(Unit* actor, Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpellInfo = nullptr, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/); void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpellInfo, uint32 damage, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/); void GetProcAurasTriggeredOnEvent(std::list& aurasTriggeringProc, std::list* procAuras, ProcEventInfo eventInfo); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 4d9e89169..904d051f9 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6396,8 +6396,8 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const target->SendPeriodicAuraLog(&pInfo); Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true); - // allow null caster to call this function - caster->ProcDamageAndSpell(target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo); + + Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo); } void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const @@ -6485,8 +6485,8 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c int32 new_damage; new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); - // allow null caster to call this function - caster->ProcDamageAndSpell(target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo); + + Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo); if (!caster || !caster->IsAlive()) return; @@ -6668,8 +6668,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const // ignore item heals if (!haveCastItem && GetAuraType() != SPELL_AURA_OBS_MOD_HEALTH) // xinef: dont allow obs_mod_health to proc spells, this is passive regeneration and not hot - // xinef: allow null caster to proc - caster->ProcDamageAndSpell(target, caster ? procAttacker : 0, procVictim, procEx, heal, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, nullptr, &healInfo); + Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, heal, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, nullptr, &healInfo); } void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const @@ -6857,7 +6856,7 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con caster->DealSpellDamage(&damageInfo, true); DamageInfo dmgInfo(damageInfo, DOT); - caster->ProcDamageAndSpell(damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage, BASE_ATTACK, spellProto, nullptr, GetEffIndex(), nullptr, &dmgInfo); + Unit::ProcDamageAndSpell(caster, damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage, BASE_ATTACK, spellProto, nullptr, GetEffIndex(), nullptr, &dmgInfo); } void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 75b252b20..9abd5bbe1 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2792,7 +2792,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) if (canEffectTrigger) - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell.spellInfo, + Unit::ProcDamageAndSpell(caster, unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo, m_triggeredByAuraSpell.spellInfo, m_triggeredByAuraSpell.effectIndex, this, nullptr, &healInfo); } // Do damage and triggers @@ -2871,7 +2871,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) if (canEffectTrigger) { DamageInfo dmgInfo(damageInfo, SPELL_DIRECT_DAMAGE); - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell.spellInfo, + Unit::ProcDamageAndSpell(caster, unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell.spellInfo, m_triggeredByAuraSpell.effectIndex, this, &dmgInfo); if (caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->HasAttribute(SPELL_ATTR0_CANCELS_AUTO_ATTACK_COMBAT) == 0 && @@ -2891,7 +2891,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target) if (canEffectTrigger) { DamageInfo dmgInfo(damageInfo, NODAMAGE); - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell.spellInfo, + Unit::ProcDamageAndSpell(caster, unitTarget, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo, m_triggeredByAuraSpell.spellInfo, m_triggeredByAuraSpell.effectIndex, this, &dmgInfo); // Xinef: eg. rogue poisons can proc off cheap shot, etc. so this block should be here also @@ -3972,7 +3972,7 @@ void Spell::_cast(bool skipCheck) break; } - m_originalCaster->ProcDamageAndSpell(m_originalCaster, procAttacker, PROC_FLAG_NONE, procEx, 1, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell.spellInfo, + Unit::ProcDamageAndSpell(m_originalCaster, m_originalCaster, procAttacker, PROC_FLAG_NONE, procEx, 1, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell.spellInfo, m_triggeredByAuraSpell.effectIndex, this, nullptr, nullptr, PROC_SPELL_PHASE_CAST); } @@ -4312,7 +4312,7 @@ void Spell::_handle_finish_phase() break; } - m_originalCaster->ProcDamageAndSpell(m_originalCaster, procAttacker, PROC_FLAG_NONE, procEx, 1, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell.spellInfo, + Unit::ProcDamageAndSpell(m_originalCaster, m_originalCaster, procAttacker, PROC_FLAG_NONE, procEx, 1, BASE_ATTACK, m_spellInfo, m_triggeredByAuraSpell.spellInfo, m_triggeredByAuraSpell.effectIndex, this, nullptr, nullptr, PROC_SPELL_PHASE_FINISH); } } @@ -8155,7 +8155,7 @@ bool ReflectEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) { Unit* target = ObjectAccessor::GetUnit(*_caster, _targetGUID); if (target && _caster->IsInMap(target)) - _caster->ProcDamageAndSpell(target, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_EX_REFLECT, 1, BASE_ATTACK, _spellInfo); + Unit::ProcDamageAndSpell(_caster, target, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_EX_REFLECT, 1, BASE_ATTACK, _spellInfo); return true; } From cee21c022a319dbccd7b152327cc1b0c37755d75 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Wed, 3 Aug 2022 09:06:28 -0300 Subject: [PATCH 062/161] fix(Core): Crash on Mandokir gaze (#12611) --- .../scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index cf9d16c47..a9d8414a6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -719,11 +719,14 @@ public: { if (Unit* target = GetTarget()) { - if (Creature* caster = GetCaster()->ToCreature()) + if (Unit* caster = GetCaster()) { - if (caster->IsAIEnabled) + if (Creature* cCaster = caster->ToCreature()) { - caster->AI()->SetGUID(target->GetGUID(), ACTION_CHARGE); + if (cCaster->IsAIEnabled) + { + cCaster->AI()->SetGUID(target->GetGUID(), ACTION_CHARGE); + } } } } From e6dd5d3e22d92dddc841079f9108275fd0359be1 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Wed, 3 Aug 2022 09:06:51 -0300 Subject: [PATCH 063/161] fix(Core/Scripts): Ayamiss crashfix (#12610) --- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index d4e481701..f2856ab51 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -141,7 +141,7 @@ public: me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos); } - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override { if (_phase == PHASE_AIR && me->GetHealthPct() < 70.0f) { @@ -150,8 +150,11 @@ public: me->ClearUnitState(UNIT_STATE_ROOT); me->SetCanFly(false); me->SetDisableGravity(false); - Position VictimPos = me->GetVictim()->GetPosition(); - me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos); + if (Unit* victim = me->GetVictim()) + { + Position victimPos = victim->GetPosition(); + me->GetMotionMaster()->MovePoint(POINT_GROUND, victimPos); + } events.ScheduleEvent(EVENT_LASH, urand(5000, 8000)); events.CancelEvent(EVENT_POISON_STINGER); DoResetThreat(); From 0f36736d422ecd0e90b21f74c83604642df2de46 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Wed, 3 Aug 2022 12:25:21 -0300 Subject: [PATCH 064/161] fix(Core): Freeze on Lord Jaraxxus (#12616) --- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 7daf57746..ebf54535a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -118,11 +118,11 @@ public: if( pInstance ) pInstance->SetData(TYPE_JARAXXUS, NOT_STARTED); - // checked for safety - while( Creature* c = me->FindNearestCreature(NPC_INFERNAL_VOLCANO, 500.0f, true) ) - c->DespawnOrUnsummon(); - while( Creature* c = me->FindNearestCreature(NPC_NETHER_PORTAL, 500.0f, true) ) - c->DespawnOrUnsummon(); + std::list creatures; + me->GetCreatureListWithEntryInGrid(creatures, NPC_INFERNAL_VOLCANO, 500.f); + me->GetCreatureListWithEntryInGrid(creatures, NPC_NETHER_PORTAL, 500.f); + for (Creature* creature : creatures) + creature->DespawnOrUnsummon(); } void EnterCombat(Unit* /*who*/) override From a4c809f13c818d1d7e078ed49cd67afbebebd900 Mon Sep 17 00:00:00 2001 From: M'Dic Date: Wed, 3 Aug 2022 16:54:21 -0400 Subject: [PATCH 065/161] update (source): Establish chapter 3 dk script (#12549) * update (source): Establish chapter 3 dk scripts Per source notes Xinef: Should be in chapter III We establish chapter 3 script for scarelet enclaved and to make the easy of future development in terms of organization * Update: (script) Spell Script Loader to Register Spell Script * update: (script): typo --- .../ScarletEnclave/chapter2.cpp | 30 ------------- .../ScarletEnclave/chapter3.cpp | 42 +++++++++++++++++++ .../eastern_kingdoms_script_loader.cpp | 2 + 3 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/chapter3.cpp diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index dc6a899d0..e376e3fd1 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -1220,33 +1220,6 @@ public: }; }; -class spell_q12779_an_end_to_all_things : public SpellScriptLoader -{ -public: - spell_q12779_an_end_to_all_things() : SpellScriptLoader("spell_q12779_an_end_to_all_things") { } - - class spell_q12779_an_end_to_all_things_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12779_an_end_to_all_things_SpellScript); - - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - if (GetHitUnit()) - GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12779_an_end_to_all_things_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_q12779_an_end_to_all_things_SpellScript(); - } -}; - void AddSC_the_scarlet_enclave_c2() { new npc_crusade_persuaded(); @@ -1254,7 +1227,4 @@ void AddSC_the_scarlet_enclave_c2() new npc_koltira_deathweaver(); new npc_high_inquisitor_valroth(); new npc_a_special_surprise(); - - // Xinef: Should be in chapter III - new spell_q12779_an_end_to_all_things(); } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter3.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter3.cpp new file mode 100644 index 000000000..7504b35cf --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter3.cpp @@ -0,0 +1,42 @@ +/* + * 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 "Player.h" +#include "ScriptMgr.h" +#include "SpellInfo.h" +#include "SpellScript.h" + +class spell_q12779_an_end_to_all_things : public SpellScript +{ + PrepareSpellScript(spell_q12779_an_end_to_all_things); + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (GetHitUnit()) + GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12779_an_end_to_all_things::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +void AddSC_the_scarlet_enclave_c3() +{ + RegisterSpellScript(spell_q12779_an_end_to_all_things); +} diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index cfe1b9ec3..e8cf955c9 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -97,6 +97,7 @@ void AddSC_instance_molten_core(); void AddSC_the_scarlet_enclave(); //Scarlet Enclave void AddSC_the_scarlet_enclave_c1(); void AddSC_the_scarlet_enclave_c2(); +void AddSC_the_scarlet_enclave_c3(); void AddSC_the_scarlet_enclave_c5(); void AddSC_instance_scarlet_monastery(); //Scarlet Monastery void AddSC_boss_kirtonos_the_herald(); @@ -247,6 +248,7 @@ void AddEasternKingdomsScripts() AddSC_the_scarlet_enclave(); //Scarlet Enclave AddSC_the_scarlet_enclave_c1(); AddSC_the_scarlet_enclave_c2(); + AddSC_the_scarlet_enclave_c3(); AddSC_the_scarlet_enclave_c5(); AddSC_instance_scarlet_monastery(); //Scarlet Monastery AddSC_boss_kirtonos_the_herald(); From 9aed486eeb95b38b18ad47e3c8634b5832943ad8 Mon Sep 17 00:00:00 2001 From: Axel Cocat Date: Fri, 5 Aug 2022 15:09:26 +0200 Subject: [PATCH 066/161] feat(Core/Utilities): add event emitter class (#12632) --- src/common/Utilities/EventEmitter.h | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/common/Utilities/EventEmitter.h diff --git a/src/common/Utilities/EventEmitter.h b/src/common/Utilities/EventEmitter.h new file mode 100644 index 000000000..77755935b --- /dev/null +++ b/src/common/Utilities/EventEmitter.h @@ -0,0 +1,44 @@ +/* + * 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 . + */ + +#ifndef __EVENT_EMITTER_H +#define __EVENT_EMITTER_H + +template +class EventEmitter +{ +public: + template + void operator+=(Functor&& f) + { + functions.emplace_back(std::forward(f)); + } + + template + void operator()(Args&&... args) const + { + for (auto& f : functions) + { + f(args...); + } + } + +private: + std::vector> functions; +}; + +#endif From bd7ee56abe6c888574f026ca7b0f50adc7d565c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=B9=BF?= Date: Sat, 6 Aug 2022 00:33:17 +0800 Subject: [PATCH 067/161] fix(Core/AI): correct Permit level for trigger flagged creatures (#12614) partially picked from https://github.com/TrinityCore/TrinityCore/commit/1de89579c75f7b5d5028b162334fa496832a093c --- src/server/game/AI/CoreAI/PassiveAI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/AI/CoreAI/PassiveAI.cpp b/src/server/game/AI/CoreAI/PassiveAI.cpp index d1ac8350f..f8b8973d7 100644 --- a/src/server/game/AI/CoreAI/PassiveAI.cpp +++ b/src/server/game/AI/CoreAI/PassiveAI.cpp @@ -29,7 +29,7 @@ int32 NullCreatureAI::Permissible(Creature const* creature) return PERMIT_BASE_PROACTIVE + 50; if (creature->IsTrigger()) - return PERMIT_BASE_REACTIVE; + return PERMIT_BASE_PROACTIVE; return PERMIT_BASE_IDLE; } From f0c881f09f502f92774639c329065f7982bf5ba6 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Fri, 5 Aug 2022 14:43:35 -0300 Subject: [PATCH 068/161] fix(Core/TempleOfAhnQiraj): Bug Trio (#12599) --- .../Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index cf765b460..7eefcd5b9 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -137,9 +137,9 @@ public: me->SetReactState(REACT_PASSIVE); } - void MovementInform(uint32 type, uint32 /*id*/) override + void MovementInform(uint32 type, uint32 id) override { - if (type != POINT_MOTION_TYPE) + if (type != POINT_MOTION_TYPE || id != POINT_CONSUME) return; me->GetMotionMaster()->MoveIdle(); @@ -153,6 +153,7 @@ public: me->SetReactState(REACT_AGGRESSIVE); if (Unit* target = me->GetVictim()) { + me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveChase(target); AttackStart(target); } @@ -195,7 +196,7 @@ public: void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (me->HealthBelowPctDamaged(1, damage) && instance->GetData(DATA_BUG_TRIO_DEATH) < 2 && who->GetGUID() != me->GetGUID()) + if (me->HealthBelowPctDamaged(1, damage) && instance->GetData(DATA_BUG_TRIO_DEATH) < 2 && who->GetGUID() != me->GetGUID() && !dying) { damage = 0; if (isEating) @@ -205,6 +206,7 @@ public: me->SetStandState(UNIT_STAND_STATE_DEAD); me->SetReactState(REACT_PASSIVE); me->SetControlled(true, UNIT_STATE_ROOT); + dying = true; DoFinalSpell(); @@ -236,7 +238,7 @@ public: _scheduler.Schedule(4s, [this](TaskContext /*context*/) { - if (!me->IsInEvadeMode()) + if (!me->IsInEvadeMode() && instance->GetData(DATA_BUG_TRIO_DEATH) < 2) { DoCastSelf(SPELL_BLOODY_DEATH, true); Talk(EMOTE_DEVOURED); From 1e77b9575f3c4fff514fa23347bcf15e22ebd618 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Fri, 5 Aug 2022 14:45:03 -0300 Subject: [PATCH 069/161] fix(Core/SAI): Unused parameters warnings (#12620) --- .../rev_1659574137813657500.sql | 2 + .../game/AI/SmartScripts/SmartScriptMgr.cpp | 43 +++++++++++++------ 2 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659574137813657500.sql diff --git a/data/sql/updates/pending_db_world/rev_1659574137813657500.sql b/data/sql/updates/pending_db_world/rev_1659574137813657500.sql new file mode 100644 index 000000000..aaa3cf6a2 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659574137813657500.sql @@ -0,0 +1,2 @@ +-- +UPDATE `smart_scripts` SET `action_param1` = 0 WHERE `entryorguid` = 2700300 AND `source_type` = 9 AND `id` = 1; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 92c24beaa..80c2eb221 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -492,7 +492,7 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e) case SMART_EVENT_IC_LOS: return sizeof(SmartEvent::los); case SMART_EVENT_PASSENGER_BOARDED: return sizeof(SmartEvent::minMax); case SMART_EVENT_PASSENGER_REMOVED: return sizeof(SmartEvent::minMax); - // case SMART_EVENT_CHARMED: return sizeof(SmartEvent::charm); + case SMART_EVENT_CHARMED: return sizeof(SmartEvent::charm); case SMART_EVENT_CHARMED_TARGET: return NO_PARAMS; case SMART_EVENT_SPELLHIT_TARGET: return sizeof(SmartEvent::spellHit); case SMART_EVENT_DAMAGED: return sizeof(SmartEvent::minMaxRepeat); @@ -533,7 +533,7 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e) case SMART_EVENT_IS_BEHIND_TARGET: return sizeof(SmartEvent::behindTarget); case SMART_EVENT_GAME_EVENT_START: return sizeof(SmartEvent::gameEvent); case SMART_EVENT_GAME_EVENT_END: return sizeof(SmartEvent::gameEvent); - // case SMART_EVENT_GO_LOOT_STATE_CHANGED: return sizeof(SmartEvent::goLootStateChanged); + case SMART_EVENT_GO_STATE_CHANGED: return sizeof(SmartEvent::goStateChanged); case SMART_EVENT_GO_EVENT_INFORM: return sizeof(SmartEvent::eventInform); case SMART_EVENT_ACTION_DONE: return sizeof(SmartEvent::doAction); case SMART_EVENT_ON_SPELLCLICK: return NO_PARAMS; @@ -546,9 +546,11 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e) //case SMART_EVENT_SCENE_CANCEL: return sizeof(SmartEvent::raw); //case SMART_EVENT_SCENE_COMPLETE: return sizeof(SmartEvent::raw); case SMART_EVENT_SUMMONED_UNIT_DIES: return sizeof(SmartEvent::summoned); + case SMART_EVENT_NEAR_PLAYERS: return sizeof(SmartEvent::nearPlayer); + case SMART_EVENT_NEAR_PLAYERS_NEGATION: return sizeof(SmartEvent::nearPlayerNegation); default: - LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an event with no unused params specified in SmartAIMgr::CheckUnusedEventParams(), please report this.", - e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an event {} with no unused params specified in SmartAIMgr::CheckUnusedEventParams(), please report this.", + e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetEventType()); return sizeof(SmartEvent::raw); } }(); @@ -602,8 +604,8 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_ALLOW_COMBAT_MOVEMENT: return sizeof(SmartAction::combatMove); case SMART_ACTION_SET_EVENT_PHASE: return sizeof(SmartAction::setEventPhase); case SMART_ACTION_INC_EVENT_PHASE: return sizeof(SmartAction::incEventPhase); - // case SMART_ACTION_EVADE: return sizeof(SmartAction::evade); - // case SMART_ACTION_FLEE_FOR_ASSIST: return sizeof(SmartAction::fleeAssist); + case SMART_ACTION_EVADE: return NO_PARAMS; + case SMART_ACTION_FLEE_FOR_ASSIST: return sizeof(SmartAction::flee); case SMART_ACTION_CALL_GROUPEVENTHAPPENS: return sizeof(SmartAction::quest); case SMART_ACTION_COMBAT_STOP: return NO_PARAMS; case SMART_ACTION_REMOVEAURASFROMSPELL: return sizeof(SmartAction::removeAura); @@ -624,9 +626,10 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL: return sizeof(SmartAction::morphOrMount); case SMART_ACTION_SET_INGAME_PHASE_MASK: return sizeof(SmartAction::ingamePhaseMask); case SMART_ACTION_SET_DATA: return sizeof(SmartAction::setData); + case SMART_ACTION_MOVE_FORWARD: return sizeof(SmartAction::moveRandom); case SMART_ACTION_ATTACK_STOP: return NO_PARAMS; case SMART_ACTION_SET_VISIBILITY: return sizeof(SmartAction::visibility); - // case SMART_ACTION_SET_ACTIVE: return sizeof(SmartAction::active); + case SMART_ACTION_SET_ACTIVE: return sizeof(SmartAction::setActive); case SMART_ACTION_ATTACK_START: return NO_PARAMS; case SMART_ACTION_SUMMON_GO: return sizeof(SmartAction::summonGO); case SMART_ACTION_KILL_UNIT: return NO_PARAMS; @@ -638,7 +641,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_REMOVE_ITEM: return sizeof(SmartAction::item); case SMART_ACTION_INSTALL_AI_TEMPLATE: return sizeof(SmartAction::installTtemplate); case SMART_ACTION_SET_RUN: return sizeof(SmartAction::setRun); - // case SMART_ACTION_SET_DISABLE_GRAVITY: return sizeof(SmartAction::setDisableGravity); + case SMART_ACTION_SET_FLY: return sizeof(SmartAction::setFly); case SMART_ACTION_SET_SWIM: return sizeof(SmartAction::setSwim); case SMART_ACTION_TELEPORT: return sizeof(SmartAction::teleport); case SMART_ACTION_SET_COUNTER: return sizeof(SmartAction::setCounter); @@ -648,7 +651,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_CREATE_TIMED_EVENT: return sizeof(SmartAction::timeEvent); case SMART_ACTION_PLAYMOVIE: return sizeof(SmartAction::movie); case SMART_ACTION_MOVE_TO_POS: return sizeof(SmartAction::moveToPos); - // case SMART_ACTION_ENABLE_TEMP_GOBJ: return sizeof(SmartAction::enableTempGO); + case SMART_ACTION_RESPAWN_TARGET: return sizeof(SmartAction::RespawnTarget); case SMART_ACTION_EQUIP: return sizeof(SmartAction::equip); case SMART_ACTION_CLOSE_GOSSIP: return NO_PARAMS; case SMART_ACTION_TRIGGER_TIMED_EVENT: return sizeof(SmartAction::timeEvent); @@ -663,7 +666,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_ADD_NPC_FLAG: return sizeof(SmartAction::flag); case SMART_ACTION_REMOVE_NPC_FLAG: return sizeof(SmartAction::flag); case SMART_ACTION_SIMPLE_TALK: return sizeof(SmartAction::simpleTalk); - // case SMART_ACTION_SELF_CAST: return sizeof(SmartAction::cast); + case SMART_ACTION_INVOKER_CAST: return sizeof(SmartAction::cast); case SMART_ACTION_CROSS_CAST: return sizeof(SmartAction::crossCast); case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST: return sizeof(SmartAction::randTimedActionList); case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST: return sizeof(SmartAction::randRangeTimedActionList); @@ -692,7 +695,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_GAME_EVENT_STOP: return sizeof(SmartAction::gameEventStop); case SMART_ACTION_GAME_EVENT_START: return sizeof(SmartAction::gameEventStart); case SMART_ACTION_START_CLOSEST_WAYPOINT: return sizeof(SmartAction::closestWaypointFromList); - // case SMART_ACTION_MOVE_OFFSET: return NO_PARAMS; + case SMART_ACTION_RISE_UP: return sizeof(SmartAction::moveRandom); case SMART_ACTION_RANDOM_SOUND: return sizeof(SmartAction::randomSound); case SMART_ACTION_SET_CORPSE_DELAY: return sizeof(SmartAction::corpseDelay); case SMART_ACTION_DISABLE_EVADE: return sizeof(SmartAction::disableEvade); @@ -722,6 +725,19 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_SET_HOVER: return sizeof(SmartAction::setHover); case SMART_ACTION_SET_HEALTH_PCT: return sizeof(SmartAction::setHealthPct); //case SMART_ACTION_CREATE_CONVERSATION: return sizeof(SmartAction::raw); + case SMART_ACTION_MOVE_TO_POS_TARGET: return sizeof(SmartAction::moveToPos); + case SMART_ACTION_SET_GO_STATE: return sizeof(SmartAction::goState); + case SMART_ACTION_EXIT_VEHICLE: return NO_PARAMS; + case SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS: return sizeof(SmartAction::movementFlag); + case SMART_ACTION_SET_COMBAT_DISTANCE: return sizeof(SmartAction::combatDistance); + case SMART_ACTION_SET_CASTER_COMBAT_DIST: return sizeof(SmartAction::casterDistance); + case SMART_ACTION_FALL: return NO_PARAMS; + case SMART_ACTION_SET_EVENT_FLAG_RESET: return sizeof(SmartAction::setActive); + case SMART_ACTION_STOP_MOTION: return sizeof(SmartAction::stopMotion); + case SMART_ACTION_NO_ENVIRONMENT_UPDATE: return NO_PARAMS; + case SMART_ACTION_ZONE_UNDER_ATTACK: return NO_PARAMS; + case SMART_ACTION_LOAD_GRID: return NO_PARAMS; + case SMART_ACTION_MUSIC: return sizeof(SmartAction::music); default: LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an action with no unused params specified in SmartAIMgr::CheckUnusedActionParams(), please report this.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); @@ -785,9 +801,10 @@ bool SmartAIMgr::CheckUnusedTargetParams(SmartScriptHolder const& e) case SMART_TARGET_FARTHEST: return sizeof(SmartTarget::farthest); case SMART_TARGET_VEHICLE_PASSENGER: return sizeof(SmartTarget::vehicle); // case SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT: return sizeof(SmartTarget::goClosest); + case SMART_TARGET_PLAYER_WITH_AURA: return sizeof(SmartTarget::playerWithAura); default: - LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using a target with no unused params specified in SmartAIMgr::CheckUnusedTargetParams(), please report this.", - e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using a target {} with no unused params specified in SmartAIMgr::CheckUnusedTargetParams(), please report this.", + e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType()); return sizeof(SmartTarget::raw); } }(); From b9cfb303fee0011f0fdcecd7f1d1cd897b6989d0 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Fri, 5 Aug 2022 17:47:15 +0000 Subject: [PATCH 070/161] chore(DB): import pending files Referenced commit(s): 1e77b9575f3c4fff514fa23347bcf15e22ebd618 --- .../rev_1659574137813657500.sql => db_world/2022_08_05_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659574137813657500.sql => db_world/2022_08_05_00.sql} (72%) diff --git a/data/sql/updates/pending_db_world/rev_1659574137813657500.sql b/data/sql/updates/db_world/2022_08_05_00.sql similarity index 72% rename from data/sql/updates/pending_db_world/rev_1659574137813657500.sql rename to data/sql/updates/db_world/2022_08_05_00.sql index aaa3cf6a2..f68faea28 100644 --- a/data/sql/updates/pending_db_world/rev_1659574137813657500.sql +++ b/data/sql/updates/db_world/2022_08_05_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_01_18 -> 2022_08_05_00 -- UPDATE `smart_scripts` SET `action_param1` = 0 WHERE `entryorguid` = 2700300 AND `source_type` = 9 AND `id` = 1; From 757f0476817e2c5c9d9ae5e9497756370edce6c3 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Fri, 5 Aug 2022 15:49:12 -0300 Subject: [PATCH 071/161] refactor(Core/Scripts): Move AQ scripts to new scripting system (#12623) --- .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 418 +++-- .../Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 16 +- .../Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp | 113 +- .../TempleOfAhnQiraj/boss_bug_trio.cpp | 6 +- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 1456 ++++++++--------- .../TempleOfAhnQiraj/boss_fankriss.cpp | 131 +- .../TempleOfAhnQiraj/boss_huhuran.cpp | 183 +-- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 238 ++- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 282 ++-- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 322 ++-- .../TempleOfAhnQiraj/boss_viscidus.cpp | 340 ++-- .../TempleOfAhnQiraj/temple_of_ahnqiraj.h | 2 + 13 files changed, 1658 insertions(+), 1851 deletions(-) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index f2856ab51..65022e721 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -68,244 +68,222 @@ const Position LarvaPos[2] = { -9701.6005f, 1566.9993f, 24.118f, 0.0f } }; -class boss_ayamiss : public CreatureScript +struct boss_ayamiss : public BossAI { -public: - boss_ayamiss() : CreatureScript("boss_ayamiss") { } + boss_ayamiss(Creature* creature) : BossAI(creature, DATA_AYAMISS) {} - struct boss_ayamissAI : public BossAI + void Reset() override { - boss_ayamissAI(Creature* creature) : BossAI(creature, DATA_AYAMISS) {} - - void Reset() override - { - _Reset(); - _phase = PHASE_AIR; - _enraged = false; - SetCombatMovement(false); - } - - void JustSummoned(Creature* who) override - { - switch (who->GetEntry()) - { - case NPC_SWARMER: - _swarmers.push_back(who->GetGUID()); - break; - case NPC_LARVA: - who->GetMotionMaster()->MovePoint(POINT_PARALYZE, AltarPos); - break; - case NPC_HORNET: - if (Unit* target = SelectTarget(SelectTargetMethod::Random)) - { - who->AI()->AttackStart(target); - } - break; - } - - summons.Summon(who); - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type == POINT_MOTION_TYPE) - { - switch (id) - { - case POINT_AIR: - me->AddUnitState(UNIT_STATE_ROOT); - break; - case POINT_GROUND: - me->GetMotionMaster()->MoveChase(me->GetVictim()); - break; - } - } - } - - void EnterEvadeMode(EvadeReason why) override - { - me->ClearUnitState(UNIT_STATE_ROOT); - BossAI::EnterEvadeMode(why); - } - - void EnterCombat(Unit* attacker) override - { - BossAI::EnterCombat(attacker); - events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(20000, 30000)); - events.ScheduleEvent(EVENT_POISON_STINGER, 5000); - events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000); - events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000); - events.ScheduleEvent(EVENT_PARALYZE, 15000); - me->SetCanFly(true); - me->SetDisableGravity(true); - me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos); - } - - void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override - { - if (_phase == PHASE_AIR && me->GetHealthPct() < 70.0f) - { - _phase = PHASE_GROUND; - SetCombatMovement(true); - me->ClearUnitState(UNIT_STATE_ROOT); - me->SetCanFly(false); - me->SetDisableGravity(false); - if (Unit* victim = me->GetVictim()) - { - Position victimPos = victim->GetPosition(); - me->GetMotionMaster()->MovePoint(POINT_GROUND, victimPos); - } - events.ScheduleEvent(EVENT_LASH, urand(5000, 8000)); - events.CancelEvent(EVENT_POISON_STINGER); - DoResetThreat(); - } - if (!_enraged && me->GetHealthPct() < 20.0f) - { - DoCastSelf(SPELL_FRENZY); - Talk(EMOTE_FRENZY); - _enraged = true; - } - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_STINGER_SPRAY: - DoCastSelf(SPELL_STINGER_SPRAY); - events.ScheduleEvent(EVENT_STINGER_SPRAY, urand(15000, 20000)); - break; - case EVENT_POISON_STINGER: - DoCastVictim(SPELL_POISON_STINGER); - events.ScheduleEvent(EVENT_POISON_STINGER, urand(2000, 3000)); - break; - case EVENT_PARALYZE: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true)) - { - DoCast(target, SPELL_PARALYZE); - instance->SetGuidData(DATA_PARALYZED, target->GetGUID()); - uint8 Index = urand(0, 1); - me->SummonCreature(NPC_LARVA, LarvaPos[Index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - } - events.ScheduleEvent(EVENT_PARALYZE, 15000); - break; - case EVENT_SWARMER_ATTACK: - for (ObjectGuid const& guid : _swarmers) - { - if (Creature* swarmer = me->GetMap()->GetCreature(guid)) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random)) - { - swarmer->AI()->AttackStart(target); - } - } - } - _swarmers.clear(); - events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60000); - break; - case EVENT_SUMMON_SWARMER: - { - Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f); - me->SummonCreature(NPC_SWARMER, Pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5000); - break; - } - case EVENT_LASH: - DoCastVictim(SPELL_LASH); - events.ScheduleEvent(EVENT_LASH, urand(8000, 15000)); - break; - } - } - DoMeleeAttackIfReady(); - } - private: - GuidList _swarmers; - uint8 _phase; - bool _enraged; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetRuinsOfAhnQirajAI(creature); + BossAI::Reset(); + _phase = PHASE_AIR; + _enraged = false; + SetCombatMovement(false); } + + void JustSummoned(Creature* who) override + { + switch (who->GetEntry()) + { + case NPC_SWARMER: + _swarmers.push_back(who->GetGUID()); + break; + case NPC_LARVA: + who->GetMotionMaster()->MovePoint(POINT_PARALYZE, AltarPos); + break; + case NPC_HORNET: + if (Unit* target = SelectTarget(SelectTargetMethod::Random)) + { + who->AI()->AttackStart(target); + } + break; + } + + summons.Summon(who); + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type == POINT_MOTION_TYPE) + { + switch (id) + { + case POINT_AIR: + me->AddUnitState(UNIT_STATE_ROOT); + break; + case POINT_GROUND: + me->GetMotionMaster()->MoveChase(me->GetVictim()); + break; + } + } + } + + void EnterEvadeMode(EvadeReason why) override + { + me->ClearUnitState(UNIT_STATE_ROOT); + BossAI::EnterEvadeMode(why); + } + + void EnterCombat(Unit* attacker) override + { + BossAI::EnterCombat(attacker); + events.ScheduleEvent(EVENT_STINGER_SPRAY, 20s, 30s); + events.ScheduleEvent(EVENT_POISON_STINGER, 5s); + events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s); + events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60s); + events.ScheduleEvent(EVENT_PARALYZE, 15s); + me->SetCanFly(true); + me->SetDisableGravity(true); + me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos); + } + + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + { + if (_phase == PHASE_AIR && me->GetHealthPct() < 70.0f) + { + _phase = PHASE_GROUND; + SetCombatMovement(true); + me->ClearUnitState(UNIT_STATE_ROOT); + me->SetCanFly(false); + me->SetDisableGravity(false); + if (Unit* victim = me->GetVictim()) + { + Position victimPos = victim->GetPosition(); + me->GetMotionMaster()->MovePoint(POINT_GROUND, victimPos); + } + events.ScheduleEvent(EVENT_LASH, 5s, 8s); + events.CancelEvent(EVENT_POISON_STINGER); + DoResetThreat(); + } + if (!_enraged && me->GetHealthPct() < 20.0f) + { + DoCastSelf(SPELL_FRENZY); + Talk(EMOTE_FRENZY); + _enraged = true; + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_STINGER_SPRAY: + DoCastSelf(SPELL_STINGER_SPRAY); + events.ScheduleEvent(EVENT_STINGER_SPRAY, 15s, 20s); + break; + case EVENT_POISON_STINGER: + DoCastVictim(SPELL_POISON_STINGER); + events.ScheduleEvent(EVENT_POISON_STINGER, 2s, 3s); + break; + case EVENT_PARALYZE: + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true)) + { + DoCast(target, SPELL_PARALYZE); + instance->SetGuidData(DATA_PARALYZED, target->GetGUID()); + uint8 index = urand(0, 1); + me->SummonCreature(NPC_LARVA, LarvaPos[index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + } + events.ScheduleEvent(EVENT_PARALYZE, 15s); + break; + case EVENT_SWARMER_ATTACK: + for (ObjectGuid const& guid : _swarmers) + { + if (Creature* swarmer = me->GetMap()->GetCreature(guid)) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random)) + { + swarmer->AI()->AttackStart(target); + } + } + } + _swarmers.clear(); + events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60s); + break; + case EVENT_SUMMON_SWARMER: + { + Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f); + me->SummonCreature(NPC_SWARMER, Pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s); + break; + } + case EVENT_LASH: + DoCastVictim(SPELL_LASH); + events.ScheduleEvent(EVENT_LASH, 8s, 15s); + break; + } + } + DoMeleeAttackIfReady(); + } +private: + GuidList _swarmers; + uint8 _phase; + bool _enraged; }; -class npc_hive_zara_larva : public CreatureScript +struct npc_hive_zara_larva : public ScriptedAI { -public: - npc_hive_zara_larva() : CreatureScript("npc_hive_zara_larva") { } - - struct npc_hive_zara_larvaAI : public ScriptedAI + npc_hive_zara_larva(Creature* creature) : ScriptedAI(creature) { - npc_hive_zara_larvaAI(Creature* creature) : ScriptedAI(creature) - { - _instance = me->GetInstanceScript(); - } + _instance = me->GetInstanceScript(); + } - void MovementInform(uint32 type, uint32 id) override + void MovementInform(uint32 type, uint32 id) override + { + if (type == POINT_MOTION_TYPE) { - if (type == POINT_MOTION_TYPE) + if (id == POINT_PARALYZE) { - if (id == POINT_PARALYZE) + if (Player* target = ObjectAccessor::GetPlayer(*me, _instance->GetGuidData(DATA_PARALYZED))) { - if (Player* target = ObjectAccessor::GetPlayer(*me, _instance->GetGuidData(DATA_PARALYZED))) - { - DoCast(target, SPELL_FEED); - } + DoCast(target, SPELL_FEED); } } } - - void JustSummoned(Creature* summon) override - { - if (Creature* ayamiss = _instance->GetCreature(DATA_AYAMISS)) - { - ayamiss->AI()->JustSummoned(summon); - } - } - - void MoveInLineOfSight(Unit* who) override - - { - if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void AttackStart(Unit* victim) override - { - if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) - return; - - ScriptedAI::AttackStart(victim); - } - - void UpdateAI(uint32 diff) override - { - if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) - return; - - ScriptedAI::UpdateAI(diff); - } - private: - InstanceScript* _instance; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetRuinsOfAhnQirajAI(creature); } + + void JustSummoned(Creature* summon) override + { + if (Creature* ayamiss = _instance->GetCreature(DATA_AYAMISS)) + { + ayamiss->AI()->JustSummoned(summon); + } + } + + void MoveInLineOfSight(Unit* who) override + + { + if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* victim) override + { + if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) + return; + + ScriptedAI::AttackStart(victim); + } + + void UpdateAI(uint32 diff) override + { + if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) + return; + + ScriptedAI::UpdateAI(diff); + } +private: + InstanceScript* _instance; }; void AddSC_boss_ayamiss() { - new boss_ayamiss(); - new npc_hive_zara_larva(); + RegisterRuinsOfAhnQirajCreatureAI(boss_ayamiss); + RegisterRuinsOfAhnQirajCreatureAI(npc_hive_zara_larva); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index 97a419af7..90744df9a 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -80,7 +80,7 @@ struct boss_buru : public BossAI void EnterCombat(Unit* who) override { - _EnterCombat(); + BossAI::EnterCombat(who); Talk(EMOTE_TARGET, who); DoCastSelf(SPELL_THORNS); ManipulateEggs(true); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 31ca81096..d5b7269b1 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -66,9 +66,9 @@ struct boss_moam : public BossAI { BossAI::EnterCombat(who); Talk(EMOTE_AGGRO); - events.ScheduleEvent(EVENT_STONE_PHASE, 90000); - events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 9000); - events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 3000); + events.ScheduleEvent(EVENT_STONE_PHASE, 90s); + events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 9s); + events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 3s); } void JustDied(Unit* /*killer*/) override @@ -113,20 +113,20 @@ struct boss_moam : public BossAI DoCastAOE(SPELL_SUMMON_MANA_FIENDS); DoCastSelf(SPELL_ENERGIZE); events.CancelEvent(EVENT_SPELL_DRAIN_MANA); - events.ScheduleEvent(EVENT_STONE_PHASE_END, 90000); + events.ScheduleEvent(EVENT_STONE_PHASE_END, 90s); break; case EVENT_STONE_PHASE_END: me->RemoveAurasDueToSpell(SPELL_ENERGIZE); - events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, urand(2000, 6000)); - events.ScheduleEvent(EVENT_STONE_PHASE, 90000); + events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 2s, 6s); + events.ScheduleEvent(EVENT_STONE_PHASE, 90s); break; case EVENT_SPELL_DRAIN_MANA: DoCastAOE(SPELL_DRAIN_MANA_SERVERSIDE); - events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, urand(2000, 6000)); + events.ScheduleEvent(EVENT_SPELL_DRAIN_MANA, 2s, 6s); break; case EVENT_SPELL_TRAMPLE: DoCastAOE(SPELL_TRAMPLE); - events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 15000); + events.ScheduleEvent(EVENT_SPELL_TRAMPLE, 15s); break; default: break; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 2c648dfb0..6b543c55b 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -46,71 +46,60 @@ enum Events EVENT_CHANGE_AGGRO = 3, }; -class boss_rajaxx : public CreatureScript +struct boss_rajaxx : public BossAI { -public: - boss_rajaxx() : CreatureScript("boss_rajaxx") { } + boss_rajaxx(Creature* creature) : BossAI(creature, DATA_RAJAXX) { } - struct boss_rajaxxAI : public BossAI + void Reset() override { - boss_rajaxxAI(Creature* creature) : BossAI(creature, DATA_RAJAXX) { } - - void Reset() override - { - _Reset(); - enraged = false; - } - - void JustDied(Unit* /*killer*/) override - { - Talk(SAY_DEATH); - _JustDied(); - } - - void EnterCombat(Unit* /*victim*/) override - { - _EnterCombat(); - events.ScheduleEvent(EVENT_DISARM, 10000); - events.ScheduleEvent(EVENT_THUNDERCRASH, 12000); - } - - 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) - { - case EVENT_DISARM: - DoCastVictim(SPELL_DISARM); - events.ScheduleEvent(EVENT_DISARM, 22000); - break; - case EVENT_THUNDERCRASH: - DoCast(me, SPELL_THUNDERCRASH); - events.ScheduleEvent(EVENT_THUNDERCRASH, 21000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - private: - bool enraged; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetRuinsOfAhnQirajAI(creature); + BossAI::Reset(); + enraged = false; } + + void JustDied(Unit* /*killer*/) override + { + Talk(SAY_DEATH); + _JustDied(); + } + + void EnterCombat(Unit* /*victim*/) override + { + _EnterCombat(); + events.ScheduleEvent(EVENT_DISARM, 10s); + events.ScheduleEvent(EVENT_THUNDERCRASH, 12s); + } + + 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) + { + case EVENT_DISARM: + DoCastVictim(SPELL_DISARM); + events.ScheduleEvent(EVENT_DISARM, 22s); + break; + case EVENT_THUNDERCRASH: + DoCastSelf(SPELL_THUNDERCRASH); + events.ScheduleEvent(EVENT_THUNDERCRASH, 21s); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } +private: + bool enraged; }; class spell_rajaxx_thundercrash : public SpellScript @@ -136,6 +125,6 @@ class spell_rajaxx_thundercrash : public SpellScript void AddSC_boss_rajaxx() { - new boss_rajaxx(); + RegisterRuinsOfAhnQirajCreatureAI(boss_rajaxx); RegisterSpellScript(spell_rajaxx_thundercrash); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 7eefcd5b9..c57a95144 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -454,9 +454,9 @@ class spell_vem_vengeance : public SpellScript void AddSC_bug_trio() { - RegisterCreatureAI(boss_kri); - RegisterCreatureAI(boss_vem); - RegisterCreatureAI(boss_yauj); + RegisterTempleOfAhnQirajCreatureAI(boss_kri); + RegisterTempleOfAhnQirajCreatureAI(boss_vem); + RegisterTempleOfAhnQirajCreatureAI(boss_yauj); RegisterSpellScript(spell_vem_knockback); RegisterSpellScript(spell_vem_vengeance); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 66211a1b0..778daca97 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -142,93 +142,85 @@ public: //Kick out position const Position KickPos = { -8545.0f, 1984.0f, -96.0f, 0.0f}; -class boss_eye_of_cthun : public CreatureScript +struct boss_eye_of_cthun : public ScriptedAI { -public: - boss_eye_of_cthun() : CreatureScript("boss_eye_of_cthun") { } - - CreatureAI* GetAI(Creature* creature) const override + boss_eye_of_cthun(Creature* creature) : ScriptedAI(creature), _summons(creature) { - return GetTempleOfAhnQirajAI(creature); + instance = creature->GetInstanceScript(); + + SetCombatMovement(false); } - struct eye_of_cthunAI : public ScriptedAI + void Reset() override { - eye_of_cthunAI(Creature* creature) : ScriptedAI(creature), _summons(creature) + //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) + DarkGlareTick = 0; + DarkGlareAngle = 0; + ClockWise = false; + + _eyeTentacleCounter = 0; + + //Reset flags + me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + me->SetVisible(true); + + //Reset Phase + instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED); + + //to avoid having a following void zone + Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10); + if (pPortal) + pPortal->SetReactState(REACT_PASSIVE); + + _summons.DespawnAll(); + _scheduler.CancelAll(); + } + + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); + ScheduleTasks(); + instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM); + } + + void MoveInLineOfSight(Unit* who) override + { + if (who->GetTypeId() == TYPEID_PLAYER && !me->IsInCombat()) { - instance = creature->GetInstanceScript(); - - SetCombatMovement(false); - } - - void Reset() override - { - //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) - DarkGlareTick = 0; - DarkGlareAngle = 0; - ClockWise = false; - - _eyeTentacleCounter = 0; - - //Reset flags - me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - me->SetVisible(true); - - //Reset Phase - instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED); - - //to avoid having a following void zone - Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10); - if (pPortal) - pPortal->SetReactState(REACT_PASSIVE); - - _summons.DespawnAll(); - _scheduler.CancelAll(); - } - - void EnterCombat(Unit* /*who*/) override - { - DoZoneInCombat(); - ScheduleTasks(); - instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM); - } - - void MoveInLineOfSight(Unit* who) override - { - if (who->GetTypeId() == TYPEID_PLAYER && !me->IsInCombat()) + // Z checks are necessary here because AQ maps do funky stuff. + if (me->IsWithinLOSInMap(who) && me->IsWithinDist2d(who, 50.0f) && who->GetPositionZ() > 100.0f) { - // Z checks are necessary here because AQ maps do funky stuff. - if (me->IsWithinLOSInMap(who) && me->IsWithinDist2d(who, 50.0f) && who->GetPositionZ() > 100.0f) - { - AttackStart(who); - } + AttackStart(who); } } + } - void DoAction(int32 action) override + void DoAction(int32 action) override + { + if (action == ACTION_SPAWN_EYE_TENTACLES) { - if (action == ACTION_SPAWN_EYE_TENTACLES) - { - me->SummonCreatureGroup(_eyeTentacleCounter); - _eyeTentacleCounter++; + me->SummonCreatureGroup(_eyeTentacleCounter); + _eyeTentacleCounter++; - if (_eyeTentacleCounter >= MAX_TENTACLE_GROUPS) - { - _eyeTentacleCounter = 0; - } + if (_eyeTentacleCounter >= MAX_TENTACLE_GROUPS) + { + _eyeTentacleCounter = 0; } } + } - void ScheduleTasks() - { - _scheduler.Schedule(3s, [this](TaskContext task) + void ScheduleTasks() + { + _scheduler. + Schedule(3s, [this](TaskContext task) { DoCastRandomTarget(SPELL_GREEN_BEAM); task.SetGroup(GROUP_BEAM_PHASE); task.Repeat(); - }).Schedule(12s, [this](TaskContext task) + }) + .Schedule(12s, [this](TaskContext task) { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) { @@ -240,12 +232,14 @@ public: task.SetGroup(GROUP_BEAM_PHASE); task.Repeat(); - }).Schedule(45s, [this](TaskContext task) + }) + .Schedule(45s, [this](TaskContext task) { DoAction(ACTION_SPAWN_EYE_TENTACLES); task.SetGroup(GROUP_BEAM_PHASE); task.Repeat(); - }).Schedule(50s, [this](TaskContext /*task*/) + }) + .Schedule(50s, [this](TaskContext /*task*/) { _scheduler.CancelGroup(GROUP_BEAM_PHASE); @@ -311,340 +305,366 @@ public: }); }); }); - } - - void JustSummoned(Creature* summon) override - { - _summons.Summon(summon); - summon->SetInCombatWithZone(); - } - - void UpdateAI(uint32 diff) override - { - //Check if we have a target - if (!UpdateVictim()) - return; - - switch (instance->GetData(DATA_CTHUN_PHASE)) - { - //Transition phase - case PHASE_CTHUN_TRANSITION: - //Remove any target - me->SetTarget(); - me->SetHealth(0); - me->SetVisible(false); - break; - - //Dead phase - case PHASE_CTHUN_DONE: - if (Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10)) - { - pPortal->DespawnOrUnsummon(); - } - - me->DespawnOrUnsummon(); - break; - } - - _scheduler.Update(diff); - } - - void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - switch (instance->GetData(DATA_CTHUN_PHASE)) - { - case PHASE_EYE_GREEN_BEAM: - case PHASE_EYE_RED_BEAM: - //Only if it will kill - if (damage < me->GetHealth()) - return; - - //Fake death in phase 0 or 1 (green beam or dark glare phase) - me->InterruptNonMeleeSpells(false); - - //Remove Red coloration from c'thun - me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Reset to normal emote state and prevent select and attack - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Remove Target field - me->SetTarget(); - - //Death animation/respawning; - instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION); - - me->SetHealth(0); - damage = 0; - - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - _scheduler.CancelAll(); - break; - - case PHASE_CTHUN_DONE: - //Allow death here - return; - - default: - //Prevent death in these phases - damage = 0; - return; - } - } - - private: - InstanceScript* instance; - - //Dark Glare phase - uint32 DarkGlareTick; - float DarkGlareAngle; - bool ClockWise; - - uint32 _eyeTentacleCounter; - TaskScheduler _scheduler; - SummonList _summons; - }; -}; - -class boss_cthun : public CreatureScript -{ -public: - boss_cthun() : CreatureScript("boss_cthun") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return GetTempleOfAhnQirajAI(creature); } - struct cthunAI : public ScriptedAI + void JustSummoned(Creature* summon) override { - cthunAI(Creature* creature) : ScriptedAI(creature) - { - SetCombatMovement(false); + _summons.Summon(summon); + summon->SetInCombatWithZone(); + } - instance = creature->GetInstanceScript(); + void UpdateAI(uint32 diff) override + { + //Check if we have a target + if (!UpdateVictim()) + return; + + switch (instance->GetData(DATA_CTHUN_PHASE)) + { + //Transition phase + case PHASE_CTHUN_TRANSITION: + //Remove any target + me->SetTarget(); + me->SetHealth(0); + me->SetVisible(false); + break; + + //Dead phase + case PHASE_CTHUN_DONE: + if (Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10)) + { + pPortal->DespawnOrUnsummon(); + } + + me->DespawnOrUnsummon(); + break; } - InstanceScript* instance; + _scheduler.Update(diff); + } - //Out of combat whisper timer - uint32 WisperTimer; + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + switch (instance->GetData(DATA_CTHUN_PHASE)) + { + case PHASE_EYE_GREEN_BEAM: + case PHASE_EYE_RED_BEAM: + //Only if it will kill + if (damage < me->GetHealth()) + return; - //Global variables - uint32 PhaseTimer; + //Fake death in phase 0 or 1 (green beam or dark glare phase) + me->InterruptNonMeleeSpells(false); - //------------------- + //Remove Red coloration from c'thun + me->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - //Phase transition - ObjectGuid HoldPlayer; + //Reset to normal emote state and prevent select and attack + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Remove Target field + me->SetTarget(); + + //Death animation/respawning; + instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION); + + me->SetHealth(0); + damage = 0; + + me->InterruptNonMeleeSpells(true); + me->RemoveAllAuras(); + _scheduler.CancelAll(); + break; + + case PHASE_CTHUN_DONE: + //Allow death here + return; + + default: + //Prevent death in these phases + damage = 0; + return; + } + } + +private: + InstanceScript* instance; + + //Dark Glare phase + uint32 DarkGlareTick; + float DarkGlareAngle; + bool ClockWise; + + uint32 _eyeTentacleCounter; + TaskScheduler _scheduler; + SummonList _summons; +}; + +struct boss_cthun : public ScriptedAI +{ + boss_cthun(Creature* creature) : ScriptedAI(creature) + { + SetCombatMovement(false); + + instance = creature->GetInstanceScript(); + } + + InstanceScript* instance; + + //Out of combat whisper timer + uint32 WisperTimer; + + //Global variables + uint32 PhaseTimer; + + //------------------- + + //Phase transition + ObjectGuid HoldPlayer; + + //Body Phase + uint32 EyeTentacleTimer; + uint8 FleshTentaclesKilled; + uint32 GiantClawTentacleTimer; + uint32 GiantEyeTentacleTimer; + uint32 StomachAcidTimer; + uint32 StomachEnterTimer; + uint32 StomachEnterVisTimer; + ObjectGuid StomachEnterTarget; + + //Stomach map, bool = true then in stomach + std::unordered_map Stomach_Map; + + void Reset() override + { + //One random wisper every 90 - 300 seconds + WisperTimer = 90000; + + //Phase information + PhaseTimer = 10000; //Emerge in 10 seconds + + //No hold player for transition + HoldPlayer.Clear(); //Body Phase - uint32 EyeTentacleTimer; - uint8 FleshTentaclesKilled; - uint32 GiantClawTentacleTimer; - uint32 GiantEyeTentacleTimer; - uint32 StomachAcidTimer; - uint32 StomachEnterTimer; - uint32 StomachEnterVisTimer; - ObjectGuid StomachEnterTarget; + EyeTentacleTimer = 30000; + FleshTentaclesKilled = 0; + GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) + GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) + StomachAcidTimer = 4000; //Every 4 seconds + StomachEnterTimer = 10000; //Every 10 seconds + StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer + StomachEnterTarget.Clear(); //Target to be teleported to stomach - //Stomach map, bool = true then in stomach - std::unordered_map Stomach_Map; + //Clear players in stomach and outside + Stomach_Map.clear(); - void Reset() override + //Reset flags + me->RemoveAurasDueToSpell(SPELL_TRANSFORM); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + me->SetVisible(false); + + instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED); + } + + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); + } + + Unit* SelectRandomNotStomach() + { + if (Stomach_Map.empty()) + return nullptr; + + std::unordered_map::const_iterator i = Stomach_Map.begin(); + + std::list temp; + std::list::const_iterator j; + + //Get all players in map + while (i != Stomach_Map.end()) { - //One random wisper every 90 - 300 seconds - WisperTimer = 90000; + //Check for valid player + Unit* unit = ObjectAccessor::GetUnit(*me, i->first); - //Phase information - PhaseTimer = 10000; //Emerge in 10 seconds + //Only units out of stomach + if (unit && !i->second) + temp.push_back(unit); - //No hold player for transition - HoldPlayer.Clear(); - - //Body Phase - EyeTentacleTimer = 30000; - FleshTentaclesKilled = 0; - GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) - GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) - StomachAcidTimer = 4000; //Every 4 seconds - StomachEnterTimer = 10000; //Every 10 seconds - StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer - StomachEnterTarget.Clear(); //Target to be teleported to stomach - - //Clear players in stomach and outside - Stomach_Map.clear(); - - //Reset flags - me->RemoveAurasDueToSpell(SPELL_TRANSFORM); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - me->SetVisible(false); - - instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED); + ++i; } - void EnterCombat(Unit* /*who*/) override + if (temp.empty()) + return nullptr; + + j = temp.begin(); + + //Get random but only if we have more than one unit on threat list + if (temp.size() > 1) + advance(j, rand() % (temp.size() - 1)); + + return (*j); + } + + void UpdateAI(uint32 diff) override + { + //Check if we have a target + if (!UpdateVictim()) { - DoZoneInCombat(); - } - - Unit* SelectRandomNotStomach() - { - if (Stomach_Map.empty()) - return nullptr; - - std::unordered_map::const_iterator i = Stomach_Map.begin(); - - std::list temp; - std::list::const_iterator j; - - //Get all players in map - while (i != Stomach_Map.end()) + //No target so we'll use this section to do our random wispers instance wide + //WisperTimer + if (WisperTimer <= diff) { - //Check for valid player - Unit* unit = ObjectAccessor::GetUnit(*me, i->first); + Map* map = me->GetMap(); + if (!map->IsDungeon()) + return; - //Only units out of stomach - if (unit && !i->second) - temp.push_back(unit); + //Play random sound to the zone + Map::PlayerList const& PlayerList = map->GetPlayers(); - ++i; - } - - if (temp.empty()) - return nullptr; - - j = temp.begin(); - - //Get random but only if we have more than one unit on threat list - if (temp.size() > 1) - advance (j, rand() % (temp.size() - 1)); - - return (*j); - } - - void UpdateAI(uint32 diff) override - { - //Check if we have a target - if (!UpdateVictim()) - { - //No target so we'll use this section to do our random wispers instance wide - //WisperTimer - if (WisperTimer <= diff) + if (!PlayerList.IsEmpty()) { - Map* map = me->GetMap(); - if (!map->IsDungeon()) - return; - - //Play random sound to the zone - Map::PlayerList const& PlayerList = map->GetPlayers(); - - if (!PlayerList.IsEmpty()) + for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) { - for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) - { - if (Player* pPlr = itr->GetSource()) - pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER, pPlr); - } + if (Player* pPlr = itr->GetSource()) + pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER, pPlr); } - - //One random wisper every 90 - 300 seconds - WisperTimer = urand(90000, 300000); } - else WisperTimer -= diff; - return; + //One random wisper every 90 - 300 seconds + WisperTimer = urand(90000, 300000); } + else WisperTimer -= diff; - me->SetTarget(); + return; + } - uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE); - if (currentPhase == PHASE_CTHUN_STOMACH || currentPhase == PHASE_CTHUN_WEAK) + me->SetTarget(); + + uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE); + if (currentPhase == PHASE_CTHUN_STOMACH || currentPhase == PHASE_CTHUN_WEAK) + { + // EyeTentacleTimer + if (EyeTentacleTimer <= diff) { - // EyeTentacleTimer - if (EyeTentacleTimer <= diff) + if (Creature* eye = instance->GetCreature(DATA_EYE_OF_CTHUN)) { - if (Creature* eye = instance->GetCreature(DATA_EYE_OF_CTHUN)) - { - eye->AI()->DoAction(ACTION_SPAWN_EYE_TENTACLES); - } - - EyeTentacleTimer = 30000; // every 30sec in phase 2 + eye->AI()->DoAction(ACTION_SPAWN_EYE_TENTACLES); } - else EyeTentacleTimer -= diff; - } - switch (currentPhase) - { + EyeTentacleTimer = 30000; // every 30sec in phase 2 + } + else EyeTentacleTimer -= diff; + } + + switch (currentPhase) + { //Transition phase - case PHASE_CTHUN_TRANSITION: - //PhaseTimer - if (PhaseTimer <= diff) + case PHASE_CTHUN_TRANSITION: + //PhaseTimer + if (PhaseTimer <= diff) + { + //Switch + instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH); + + //Switch to c'thun model + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_TRANSFORM, false); + me->SetFullHealth(); + + me->SetVisible(true); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Emerging phase + //AttackStart(ObjectAccessor::GetUnit(*me, HoldpPlayer)); + DoZoneInCombat(); + + //Place all units in threat list on outside of stomach + Stomach_Map.clear(); + + for (std::list::const_iterator i = me->GetThreatMgr().getThreatList().begin(); i != me->GetThreatMgr().getThreatList().end(); ++i) + Stomach_Map[(*i)->getUnitGuid()] = false; //Outside stomach + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + //Spawn flesh tentacle + for (uint8 i = 0; i < 2; i++) { - //Switch - instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH); - - //Switch to c'thun model - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_TRANSFORM, false); - me->SetFullHealth(); - - me->SetVisible(true); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Emerging phase - //AttackStart(ObjectAccessor::GetUnit(*me, HoldpPlayer)); - DoZoneInCombat(); - - //Place all units in threat list on outside of stomach - Stomach_Map.clear(); - - for (std::list::const_iterator i = me->GetThreatMgr().getThreatList().begin(); i != me->GetThreatMgr().getThreatList().end(); ++i) - Stomach_Map[(*i)->getUnitGuid()] = false; //Outside stomach - - //Spawn 2 flesh tentacles - FleshTentaclesKilled = 0; - - //Spawn flesh tentacle - for (uint8 i = 0; i < 2; i++) - { - Creature* spawned = me->SummonCreature(NPC_FLESH_TENTACLE, FleshTentaclePos[i], TEMPSUMMON_CORPSE_DESPAWN); - if (!spawned) - ++FleshTentaclesKilled; - } - - PhaseTimer = 0; + Creature* spawned = me->SummonCreature(NPC_FLESH_TENTACLE, FleshTentaclePos[i], TEMPSUMMON_CORPSE_DESPAWN); + if (!spawned) + ++FleshTentaclesKilled; } - else PhaseTimer -= diff; - break; + PhaseTimer = 0; + } + else PhaseTimer -= diff; + + break; //Body Phase - case PHASE_CTHUN_STOMACH: - //Remove Target field - me->SetTarget(); + case PHASE_CTHUN_STOMACH: + //Remove Target field + me->SetTarget(); - //Weaken - if (FleshTentaclesKilled > 1) + //Weaken + if (FleshTentaclesKilled > 1) + { + instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_WEAK); + + Talk(EMOTE_WEAKENED); + PhaseTimer = 45000; + + DoCast(me, SPELL_PURPLE_COLORATION, true); + + std::unordered_map::iterator i = Stomach_Map.begin(); + + //Kick all players out of stomach + while (i != Stomach_Map.end()) { - instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_WEAK); + //Check for valid player + Unit* unit = ObjectAccessor::GetUnit(*me, i->first); - Talk(EMOTE_WEAKENED); - PhaseTimer = 45000; - - DoCast(me, SPELL_PURPLE_COLORATION, true); - - std::unordered_map::iterator i = Stomach_Map.begin(); - - //Kick all players out of stomach - while (i != Stomach_Map.end()) + //Only move units in stomach + if (unit && i->second) { - //Check for valid player - Unit* unit = ObjectAccessor::GetUnit(*me, i->first); + //Teleport each player out + DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand() % 6)); - //Only move units in stomach - if (unit && i->second) + //Cast knockback on them + DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + + //Remove the acid debuff + unit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + ++i; + } + + return; + } + + //Stomach acid + if (StomachAcidTimer <= diff) + { + //Apply aura to all players in stomach + std::unordered_map::iterator i = Stomach_Map.begin(); + + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* unit = ObjectAccessor::GetUnit(*me, i->first); + + //Only apply to units in stomach + if (unit && i->second) + { + //Cast digestive acid on them + DoCast(unit, SPELL_DIGESTIVE_ACID, true); + + //Check if player should be kicked from stomach + if (unit->IsWithinDist3d(&KickPos, 15.0f)) { //Teleport each player out DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand() % 6)); @@ -657,388 +677,321 @@ public: i->second = false; } - ++i; } - - return; + ++i; } - //Stomach acid - if (StomachAcidTimer <= diff) + StomachAcidTimer = 4000; + } + else StomachAcidTimer -= diff; + + //Stomach Enter Timer + if (StomachEnterTimer <= diff) + { + if (Unit* target = SelectRandomNotStomach()) { - //Apply aura to all players in stomach - std::unordered_map::iterator i = Stomach_Map.begin(); - - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* unit = ObjectAccessor::GetUnit(*me, i->first); - - //Only apply to units in stomach - if (unit && i->second) - { - //Cast digestive acid on them - DoCast(unit, SPELL_DIGESTIVE_ACID, true); - - //Check if player should be kicked from stomach - if (unit->IsWithinDist3d(&KickPos, 15.0f)) - { - //Teleport each player out - DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand() % 6)); - - //Cast knockback on them - DoCast(unit, SPELL_EXIT_STOMACH_KNOCKBACK, true); - - //Remove the acid debuff - unit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); - - i->second = false; - } - } - ++i; - } - - StomachAcidTimer = 4000; + //Set target in stomach + Stomach_Map[target->GetGUID()] = true; + target->InterruptNonMeleeSpells(false); + target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, nullptr, nullptr, me->GetGUID()); + StomachEnterTarget = target->GetGUID(); + StomachEnterVisTimer = 3800; } - else StomachAcidTimer -= diff; - //Stomach Enter Timer - if (StomachEnterTimer <= diff) + StomachEnterTimer = 13800; + } + else StomachEnterTimer -= diff; + + if (StomachEnterVisTimer && StomachEnterTarget) + { + if (StomachEnterVisTimer <= diff) { - if (Unit* target = SelectRandomNotStomach()) + //Check for valid player + Unit* unit = ObjectAccessor::GetUnit(*me, StomachEnterTarget); + + if (unit) { - //Set target in stomach - Stomach_Map[target->GetGUID()] = true; - target->InterruptNonMeleeSpells(false); - target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, nullptr, nullptr, me->GetGUID()); - StomachEnterTarget = target->GetGUID(); - StomachEnterVisTimer = 3800; + DoTeleportPlayer(unit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); } - StomachEnterTimer = 13800; + StomachEnterTarget.Clear(); + StomachEnterVisTimer = 0; } - else StomachEnterTimer -= diff; + else StomachEnterVisTimer -= diff; + } - if (StomachEnterVisTimer && StomachEnterTarget) + //GientClawTentacleTimer + if (GiantClawTentacleTimer <= diff) + { + if (Unit* target = SelectRandomNotStomach()) { - if (StomachEnterVisTimer <= diff) - { - //Check for valid player - Unit* unit = ObjectAccessor::GetUnit(*me, StomachEnterTarget); - - if (unit) - { - DoTeleportPlayer(unit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); - } - - StomachEnterTarget.Clear(); - StomachEnterVisTimer = 0; - } - else StomachEnterVisTimer -= diff; + //Spawn claw tentacle on the random target + if (Creature* spawned = me->SummonCreature(NPC_GIANT_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500)) + if (spawned->AI()) + spawned->AI()->AttackStart(target); } - //GientClawTentacleTimer - if (GiantClawTentacleTimer <= diff) + //One giant claw tentacle every minute + GiantClawTentacleTimer = 60000; + } + else GiantClawTentacleTimer -= diff; + + //GiantEyeTentacleTimer + if (GiantEyeTentacleTimer <= diff) + { + if (Unit* target = SelectRandomNotStomach()) { - if (Unit* target = SelectRandomNotStomach()) - { - //Spawn claw tentacle on the random target - if (Creature* spawned = me->SummonCreature(NPC_GIANT_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500)) - if (spawned->AI()) - spawned->AI()->AttackStart(target); - } - - //One giant claw tentacle every minute - GiantClawTentacleTimer = 60000; + //Spawn claw tentacle on the random target + if (Creature* spawned = me->SummonCreature(NPC_GIANT_EYE_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500)) + if (spawned->AI()) + spawned->AI()->AttackStart(target); } - else GiantClawTentacleTimer -= diff; - //GiantEyeTentacleTimer - if (GiantEyeTentacleTimer <= diff) - { - if (Unit* target = SelectRandomNotStomach()) - { - //Spawn claw tentacle on the random target - if (Creature* spawned = me->SummonCreature(NPC_GIANT_EYE_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500)) - if (spawned->AI()) - spawned->AI()->AttackStart(target); - } + //One giant eye tentacle every minute + GiantEyeTentacleTimer = 60000; + } + else GiantEyeTentacleTimer -= diff; - //One giant eye tentacle every minute - GiantEyeTentacleTimer = 60000; - } - else GiantEyeTentacleTimer -= diff; - - break; + break; //Weakened state - case PHASE_CTHUN_WEAK: - //PhaseTimer - if (PhaseTimer <= diff) + case PHASE_CTHUN_WEAK: + //PhaseTimer + if (PhaseTimer <= diff) + { + //Switch + instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH); + + //Remove purple coloration + me->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION); + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + //Spawn flesh tentacle + for (uint8 i = 0; i < 2; i++) { - //Switch - instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH); - - //Remove purple coloration - me->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION); - - //Spawn 2 flesh tentacles - FleshTentaclesKilled = 0; - - //Spawn flesh tentacle - for (uint8 i = 0; i < 2; i++) - { - Creature* spawned = me->SummonCreature(NPC_FLESH_TENTACLE, FleshTentaclePos[i], TEMPSUMMON_CORPSE_DESPAWN); - if (!spawned) - ++FleshTentaclesKilled; - } - - PhaseTimer = 0; + Creature* spawned = me->SummonCreature(NPC_FLESH_TENTACLE, FleshTentaclePos[i], TEMPSUMMON_CORPSE_DESPAWN); + if (!spawned) + ++FleshTentaclesKilled; } - else PhaseTimer -= diff; - break; - } + PhaseTimer = 0; + } + else PhaseTimer -= diff; + + break; } - - void JustDied(Unit* /*killer*/) override - { - instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE); - } - - void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override - { - switch (instance->GetData(DATA_CTHUN_PHASE)) - { - case PHASE_CTHUN_STOMACH: - //Not weakened so reduce damage by 99% - damage /= 100; - if (damage == 0) - damage = 1; - - //Prevent death in non-weakened state - if (damage >= me->GetHealth()) - damage = 0; - - return; - - case PHASE_CTHUN_WEAK: - //Weakened - takes normal damage - return; - - default: - damage = 0; - break; - } - } - - void SummonedCreatureDies(Creature* creature, Unit* /*killer*/) override - { - if (creature->GetEntry() == NPC_FLESH_TENTACLE) - { - ++FleshTentaclesKilled; - } - } - }; -}; - -class npc_eye_tentacle : public CreatureScript -{ -public: - npc_eye_tentacle() : CreatureScript("npc_eye_tentacle") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new eye_tentacleAI(creature); } - struct eye_tentacleAI : public ScriptedAI + void JustDied(Unit* /*killer*/) override { - eye_tentacleAI(Creature* creature) : ScriptedAI(creature) - { - if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) - { - portal->SetReactState(REACT_PASSIVE); - _portalGUID = portal->GetGUID(); - } + instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE); + } - SetCombatMovement(false); + void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + switch (instance->GetData(DATA_CTHUN_PHASE)) + { + case PHASE_CTHUN_STOMACH: + //Not weakened so reduce damage by 99% + damage /= 100; + if (damage == 0) + damage = 1; + + //Prevent death in non-weakened state + if (damage >= me->GetHealth()) + damage = 0; + + return; + + case PHASE_CTHUN_WEAK: + //Weakened - takes normal damage + return; + + default: + damage = 0; + break; + } + } + + void SummonedCreatureDies(Creature* creature, Unit* /*killer*/) override + { + if (creature->GetEntry() == NPC_FLESH_TENTACLE) + { + ++FleshTentaclesKilled; + } + } +}; + +struct npc_eye_tentacle : public ScriptedAI +{ + npc_eye_tentacle(Creature* creature) : ScriptedAI(creature) + { + if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + { + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } - void JustDied(Unit* /*killer*/) override - { - if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) - { - Unit::Kill(p, p); - } - } + SetCombatMovement(false); + } - void Reset() override + void JustDied(Unit* /*killer*/) override + { + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) { - _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + Unit::Kill(p, p); + } + } + + void Reset() override + { + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) { DoCastAOE(SPELL_GROUND_RUPTURE); - }).Schedule(5min, [this](TaskContext /*task*/) + }) + .Schedule(5min, [this](TaskContext /*task*/) { me->DespawnOrUnsummon(); - }).Schedule(1s, 5s, [this](TaskContext context) + }) + .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); + DoCast(target, SPELL_MIND_FLAY); } context.Repeat(10s, 15s); }); - } - - void EnterCombat(Unit* /*who*/) override - { - DoZoneInCombat(); - } - - void UpdateAI(uint32 diff) override - { - //Check if we have a target - if (!UpdateVictim()) - return; - - _scheduler.Update(diff); - } - - private: - TaskScheduler _scheduler; - ObjectGuid _portalGUID; - }; -}; - -class npc_claw_tentacle : public CreatureScript -{ -public: - npc_claw_tentacle() : CreatureScript("npc_claw_tentacle") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new claw_tentacleAI(creature); } - struct claw_tentacleAI : public ScriptedAI + void EnterCombat(Unit* /*who*/) override { - claw_tentacleAI(Creature* creature) : ScriptedAI(creature) - { - SetCombatMovement(false); + DoZoneInCombat(); + } - if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) - { - portal->SetReactState(REACT_PASSIVE); - _portalGUID = portal->GetGUID(); - } + void UpdateAI(uint32 diff) override + { + //Check if we have a target + if (!UpdateVictim()) + return; + + _scheduler.Update(diff); + } + +private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; +}; + +struct npc_claw_tentacle : public ScriptedAI +{ + npc_claw_tentacle(Creature* creature) : ScriptedAI(creature) + { + SetCombatMovement(false); + + if (Creature* portal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + { + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } + } - void JustDied(Unit* /*killer*/) override + void JustDied(Unit* /*killer*/) override + { + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) { - if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) - { - Unit::Kill(p, p); - } + Unit::Kill(p, p); } + } - void Reset() override - { - _scheduler.Schedule(Milliseconds(500), [this](TaskContext /*task*/) + void Reset() override + { + _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(); + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); - _scheduler.Schedule(2s, [this](TaskContext context) + _scheduler.Schedule(2s, [this](TaskContext context) { DoCastVictim(SPELL_HAMSTRING); context.Repeat(5s); }); - } - - void UpdateAI(uint32 diff) override - { - //Check if we have a target - if (!UpdateVictim()) - return; - - _scheduler.Update(diff); - - DoMeleeAttackIfReady(); - } - - private: - TaskScheduler _scheduler; - ObjectGuid _portalGUID; - }; -}; - -class npc_giant_claw_tentacle : public CreatureScript -{ -public: - npc_giant_claw_tentacle() : CreatureScript("npc_giant_claw_tentacle") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new giant_claw_tentacleAI(creature); } - struct giant_claw_tentacleAI : public ScriptedAI + void UpdateAI(uint32 diff) override { - giant_claw_tentacleAI(Creature* creature) : ScriptedAI(creature) - { - SetCombatMovement(false); + //Check if we have a target + if (!UpdateVictim()) + return; - if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) - { - portal->SetReactState(REACT_PASSIVE); - _portalGUID = portal->GetGUID(); - } + _scheduler.Update(diff); + + DoMeleeAttackIfReady(); + } + +private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; +}; + +struct npc_giant_claw_tentacle : public ScriptedAI +{ + npc_giant_claw_tentacle(Creature* creature) : ScriptedAI(creature) + { + SetCombatMovement(false); + + if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + { + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); } + } - void JustDied(Unit* /*killer*/) override + void JustDied(Unit* /*killer*/) override + { + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) { - if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) - { - Unit::Kill(p, p); - } + Unit::Kill(p, p); } + } - void Reset() override - { - _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + void Reset() override + { + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) { DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE); }); - } + } - void EnterCombat(Unit* /*who*/) override - { - DoZoneInCombat(); + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); - _scheduler.Schedule(2s, [this](TaskContext context) + _scheduler.Schedule(2s, [this](TaskContext context) { DoCastVictim(SPELL_HAMSTRING); context.Repeat(10s); - }).Schedule(5s, [this](TaskContext context) { + }).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) + void ScheduleMeleeCheck() + { + // Check if a target is in melee range + _scheduler.Schedule(10s, [this](TaskContext task) { if (Unit* target = me->GetVictim()) { @@ -1058,108 +1011,98 @@ public: task.Repeat(); }); + } + + void Submerge() + { + if (me->SelectNearestPlayer(5.0f)) + { + return; } - void Submerge() + // Despawn portal + if (Creature* p = ObjectAccessor::GetCreature(*me, _portalGUID)) { - if (me->SelectNearestPlayer(5.0f)) - { - return; - } + p->DespawnOrUnsummon(); + } - // 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); - DoCastSelf(SPELL_SUBMERGE_VISUAL); - me->SetHealth(me->GetMaxHealth()); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + _scheduler.CancelAll(); - _scheduler.CancelAll(); - - _scheduler.Schedule(5s, [this](TaskContext /*task*/) + _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 - { - //Check if we have a target - if (!UpdateVictim()) - return; - - _scheduler.Update(diff); - - DoMeleeAttackIfReady(); - } - - private: - TaskScheduler _scheduler; - ObjectGuid _portalGUID; - }; -}; - -class npc_giant_eye_tentacle : public CreatureScript -{ -public: - npc_giant_eye_tentacle() : CreatureScript("npc_giant_eye_tentacle") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new giant_eye_tentacleAI(creature); } - struct giant_eye_tentacleAI : public ScriptedAI + void Emerge() { - giant_eye_tentacleAI(Creature* creature) : ScriptedAI(creature) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, NotInStomachSelector())) { - SetCombatMovement(false); - - if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) + 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(); } - } - void JustDied(Unit* /*killer*/) override - { - if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) - { - Unit::Kill(p, p); - } - } + me->RemoveAurasDueToSpell(SPELL_SUBMERGE_VISUAL); + DoCastSelf(SPELL_BIRTH); + DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE, true); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - void Reset() override + ScheduleMeleeCheck(); + } + } + + void UpdateAI(uint32 diff) override + { + //Check if we have a target + if (!UpdateVictim()) + return; + + _scheduler.Update(diff); + + DoMeleeAttackIfReady(); + } + +private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; +}; + +struct npc_giant_eye_tentacle : public ScriptedAI +{ + npc_giant_eye_tentacle(Creature* creature) : ScriptedAI(creature) + { + SetCombatMovement(false); + + if (Creature* portal = me->SummonCreature(NPC_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { - _scheduler.Schedule(500ms, [this](TaskContext /*task*/) + portal->SetReactState(REACT_PASSIVE); + _portalGUID = portal->GetGUID(); + } + } + + void JustDied(Unit* /*killer*/) override + { + if (Unit* p = ObjectAccessor::GetUnit(*me, _portalGUID)) + { + Unit::Kill(p, p); + } + } + + void Reset() override + { + _scheduler.Schedule(500ms, [this](TaskContext /*task*/) { DoCastAOE(SPELL_MASSIVE_GROUND_RUPTURE); - }).Schedule(1s, 5s, [this](TaskContext context) { + }).Schedule(1s, 5s, [this](TaskContext context) + { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true, -SPELL_DIGESTIVE_ACID)) { DoCast(target, SPELL_GREEN_BEAM); @@ -1167,36 +1110,33 @@ public: context.Repeat(2100ms); }); - } + } - void EnterCombat(Unit* /*who*/) override - { - DoZoneInCombat(); - } + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); + } - void UpdateAI(uint32 diff) override - { - //Check if we have a target - if (!UpdateVictim()) - return; + void UpdateAI(uint32 diff) override + { + //Check if we have a target + if (!UpdateVictim()) + return; - _scheduler.Update(diff); - } + _scheduler.Update(diff); + } - private: - TaskScheduler _scheduler; - ObjectGuid _portalGUID; - }; +private: + TaskScheduler _scheduler; + ObjectGuid _portalGUID; }; -//GetAIs - void AddSC_boss_cthun() { - new boss_eye_of_cthun(); - new boss_cthun(); - new npc_eye_tentacle(); - new npc_claw_tentacle(); - new npc_giant_claw_tentacle(); - new npc_giant_eye_tentacle(); + RegisterTempleOfAhnQirajCreatureAI(boss_eye_of_cthun); + RegisterTempleOfAhnQirajCreatureAI(boss_cthun); + RegisterTempleOfAhnQirajCreatureAI(npc_eye_tentacle); + RegisterTempleOfAhnQirajCreatureAI(npc_claw_tentacle); + RegisterTempleOfAhnQirajCreatureAI(npc_giant_claw_tentacle); + RegisterTempleOfAhnQirajCreatureAI(npc_giant_eye_tentacle); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index fdd08243b..c35ddb6ea 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -42,72 +42,68 @@ enum Spells SPELL_ENRAGE = 28798 }; -class boss_fankriss : public CreatureScript +struct boss_fankriss : public ScriptedAI { -public: - boss_fankriss() : CreatureScript("boss_fankriss") { } + boss_fankriss(Creature* creature) : ScriptedAI(creature) { } - CreatureAI* GetAI(Creature* creature) const override + void SummonSpawn() { - return GetTempleOfAhnQirajAI(creature); - } - - struct boss_fankrissAI : public ScriptedAI - { - boss_fankrissAI(Creature* creature) : ScriptedAI(creature) { } - - void SummonSpawn() + Rand = 10 + (rand() % 10); + switch (rand() % 2) { - Rand = 10 + (rand() % 10); - switch (rand() % 2) - { - case 0: - RandX = 0.0f - Rand; - break; - case 1: - RandX = 0.0f + Rand; - break; - } - - Rand = 10 + (rand() % 10); - switch (rand() % 2) - { - case 0: - RandY = 0.0f - Rand; - break; - case 1: - RandY = 0.0f + Rand; - break; - } - Rand = 0; - DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + case 0: + RandX = 0.0f - Rand; + break; + case 1: + RandX = 0.0f + Rand; + break; } - void EnterCombat(Unit* /*who*/) override + Rand = 10 + (rand() % 10); + switch (rand() % 2) { - _scheduler.CancelAll(); + case 0: + RandY = 0.0f - Rand; + break; + case 1: + RandY = 0.0f + Rand; + break; + } + Rand = 0; + DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + } - _scheduler.Schedule(4s, 8s, [this](TaskContext context) { + void EnterCombat(Unit* /*who*/) override + { + _scheduler.CancelAll(); + + _scheduler + .Schedule(4s, 8s, [this](TaskContext context) + { DoCastVictim(SPELL_MORTAL_WOUND); context.Repeat(); - }).Schedule(15s, 45s, [this](TaskContext context) { + }) + .Schedule(15s, 45s, [this](TaskContext context) + { switch (urand(0, 2)) { - case 0: - SummonSpawn(); - break; - case 1: - SummonSpawn(); - SummonSpawn(); - break; - case 2: - SummonSpawn(); - SummonSpawn(); - SummonSpawn(); - break; + case 0: + SummonSpawn(); + break; + case 1: + SummonSpawn(); + SummonSpawn(); + break; + case 2: + SummonSpawn(); + SummonSpawn(); + SummonSpawn(); + break; } context.Repeat(30s, 60s); - }).Schedule(15s, 45s, [this](TaskContext context) { + }) + .Schedule(15s, 45s, [this](TaskContext context) + { if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) { DoCast(target, SPELL_ROOT); @@ -142,27 +138,26 @@ public: } context.Repeat(45s, 60s); }); - } + } - void UpdateAI(uint32 diff) override - { - //Return since we have no target - if (!UpdateVictim()) - return; + void UpdateAI(uint32 diff) override + { + //Return since we have no target + if (!UpdateVictim()) + return; - _scheduler.Update(diff, - std::bind(&ScriptedAI::DoMeleeAttackIfReady, this)); - } + _scheduler.Update(diff, + std::bind(&ScriptedAI::DoMeleeAttackIfReady, this)); + } - private: - TaskScheduler _scheduler; - int Rand; - float RandX; - float RandY; - }; +private: + TaskScheduler _scheduler; + int Rand; + float RandX; + float RandY; }; void AddSC_boss_fankriss() { - new boss_fankriss(); + RegisterTempleOfAhnQirajCreatureAI(boss_fankriss); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index bdd58744e..5a2d7255b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -41,115 +41,104 @@ enum Huhuran SPELL_WYVERN_STING_DAMAGE = 26233 }; -class boss_huhuran : public CreatureScript +struct boss_huhuran : public ScriptedAI { -public: - boss_huhuran() : CreatureScript("boss_huhuran") { } + boss_huhuran(Creature* creature) : ScriptedAI(creature) { } - CreatureAI* GetAI(Creature* creature) const override + uint32 Frenzy_Timer; + uint32 Wyvern_Timer; + uint32 Spit_Timer; + uint32 PoisonBolt_Timer; + uint32 NoxiousPoison_Timer; + uint32 FrenzyBack_Timer; + + bool Frenzy; + bool Berserk; + + void Reset() override { - return GetTempleOfAhnQirajAI(creature); + Frenzy_Timer = urand(25000, 35000); + Wyvern_Timer = urand(18000, 28000); + Spit_Timer = 8000; + PoisonBolt_Timer = 4000; + NoxiousPoison_Timer = urand(10000, 20000); + FrenzyBack_Timer = 15000; + + Frenzy = false; + Berserk = false; } - struct boss_huhuranAI : public ScriptedAI + void UpdateAI(uint32 diff) override { - boss_huhuranAI(Creature* creature) : ScriptedAI(creature) { } + //Return since we have no target + if (!UpdateVictim()) + return; - uint32 Frenzy_Timer; - uint32 Wyvern_Timer; - uint32 Spit_Timer; - uint32 PoisonBolt_Timer; - uint32 NoxiousPoison_Timer; - uint32 FrenzyBack_Timer; - - bool Frenzy; - bool Berserk; - - void Reset() override + //Frenzy_Timer + if (!Frenzy && Frenzy_Timer <= diff) { + DoCast(me, SPELL_FRENZY); + Talk(EMOTE_FRENZY_KILL); + Frenzy = true; + PoisonBolt_Timer = 3000; Frenzy_Timer = urand(25000, 35000); - Wyvern_Timer = urand(18000, 28000); - Spit_Timer = 8000; - PoisonBolt_Timer = 4000; - NoxiousPoison_Timer = urand(10000, 20000); - FrenzyBack_Timer = 15000; - - Frenzy = false; - Berserk = false; } + else Frenzy_Timer -= diff; - void UpdateAI(uint32 diff) override + // Wyvern Timer + if (Wyvern_Timer <= diff) { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frenzy_Timer - if (!Frenzy && Frenzy_Timer <= diff) - { - DoCast(me, SPELL_FRENZY); - Talk(EMOTE_FRENZY_KILL); - Frenzy = true; - PoisonBolt_Timer = 3000; - Frenzy_Timer = urand(25000, 35000); - } - else Frenzy_Timer -= diff; - - // Wyvern Timer - if (Wyvern_Timer <= diff) - { - DoCastAOE(SPELL_WYVERNSTING); - Wyvern_Timer = urand(15000, 32000); - } - else Wyvern_Timer -= diff; - - //Spit Timer - if (Spit_Timer <= diff) - { - DoCastVictim(SPELL_ACIDSPIT); - Spit_Timer = urand(5000, 10000); - } - else Spit_Timer -= diff; - - //NoxiousPoison_Timer - if (NoxiousPoison_Timer <= diff) - { - DoCastVictim(SPELL_NOXIOUSPOISON); - NoxiousPoison_Timer = urand(12000, 24000); - } - else NoxiousPoison_Timer -= diff; - - //PoisonBolt only if frenzy or berserk - if (Frenzy || Berserk) - { - if (PoisonBolt_Timer <= diff) - { - DoCastVictim(SPELL_POISONBOLT); - PoisonBolt_Timer = 3000; - } - else PoisonBolt_Timer -= diff; - } - - //FrenzyBack_Timer - if (Frenzy && FrenzyBack_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - Frenzy = false; - FrenzyBack_Timer = 15000; - } - else FrenzyBack_Timer -= diff; - - if (!Berserk && HealthBelowPct(31)) - { - me->InterruptNonMeleeSpells(false); - Talk(EMOTE_BERSERK); - DoCast(me, SPELL_BERSERK); - Berserk = true; - } - - DoMeleeAttackIfReady(); + DoCastAOE(SPELL_WYVERNSTING); + Wyvern_Timer = urand(15000, 32000); } - }; + else Wyvern_Timer -= diff; + + //Spit Timer + if (Spit_Timer <= diff) + { + DoCastVictim(SPELL_ACIDSPIT); + Spit_Timer = urand(5000, 10000); + } + else Spit_Timer -= diff; + + //NoxiousPoison_Timer + if (NoxiousPoison_Timer <= diff) + { + DoCastVictim(SPELL_NOXIOUSPOISON); + NoxiousPoison_Timer = urand(12000, 24000); + } + else NoxiousPoison_Timer -= diff; + + //PoisonBolt only if frenzy or berserk + if (Frenzy || Berserk) + { + if (PoisonBolt_Timer <= diff) + { + DoCastVictim(SPELL_POISONBOLT); + PoisonBolt_Timer = 3000; + } + else PoisonBolt_Timer -= diff; + } + + //FrenzyBack_Timer + if (Frenzy && FrenzyBack_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + Frenzy = false; + FrenzyBack_Timer = 15000; + } + else FrenzyBack_Timer -= diff; + + if (!Berserk && HealthBelowPct(31)) + { + me->InterruptNonMeleeSpells(false); + Talk(EMOTE_BERSERK); + DoCast(me, SPELL_BERSERK); + Berserk = true; + } + + DoMeleeAttackIfReady(); + } }; // 26180 - Wyvern Sting @@ -173,6 +162,6 @@ class spell_huhuran_wyvern_sting : public AuraScript void AddSC_boss_huhuran() { - new boss_huhuran(); + RegisterTempleOfAhnQirajCreatureAI(boss_huhuran); RegisterSpellScript(spell_huhuran_wyvern_sting); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 0969f3e53..59f655c92 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -36,167 +36,145 @@ enum Spells SPELL_SUMMON_OURO = 26061 }; -class npc_ouro_spawner : public CreatureScript +struct npc_ouro_spawner : public ScriptedAI { -public: - npc_ouro_spawner() : CreatureScript("npc_ouro_spawner") {} - - CreatureAI* GetAI(Creature* creature) const + npc_ouro_spawner(Creature* creature) : ScriptedAI(creature) { - return new npc_ouro_spawnerAI(creature); + Reset(); } - struct npc_ouro_spawnerAI : public ScriptedAI + bool hasSummoned; + + void Reset() override { - npc_ouro_spawnerAI(Creature* creature) : ScriptedAI(creature) + hasSummoned = false; + DoCast(me, SPELL_DIRTMOUND_PASSIVE); + } + + void MoveInLineOfSight(Unit* who) override + { + // Spawn Ouro on LoS check + if (!hasSummoned && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 40.0f)) { - Reset(); + DoCast(me, SPELL_SUMMON_OURO); + hasSummoned = true; } - bool hasSummoned; + ScriptedAI::MoveInLineOfSight(who); + } - void Reset() override + void JustSummoned(Creature* creature) override + { + // Despawn when Ouro is spawned + if (creature->GetEntry() == NPC_OURO) { - hasSummoned = false; - DoCast(me, SPELL_DIRTMOUND_PASSIVE); + creature->SetInCombatWithZone(); + creature->CastSpell(creature, SPELL_BIRTH, false); + me->DespawnOrUnsummon(); } + } - void MoveInLineOfSight(Unit* who) override - { - // Spawn Ouro on LoS check - if (!hasSummoned && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 40.0f)) - { - DoCast(me, SPELL_SUMMON_OURO); - hasSummoned = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustSummoned(Creature* creature) override - { - // Despawn when Ouro is spawned - if (creature->GetEntry() == NPC_OURO) - { - creature->SetInCombatWithZone(); - creature->CastSpell(creature, SPELL_BIRTH, false); - me->DespawnOrUnsummon(); - } - } - - }; }; -class boss_ouro : public CreatureScript +struct boss_ouro : public ScriptedAI { -public: - boss_ouro() : CreatureScript("boss_ouro") { } + boss_ouro(Creature* creature) : ScriptedAI(creature) { } - CreatureAI* GetAI(Creature* creature) const override + uint32 Sweep_Timer; + uint32 SandBlast_Timer; + uint32 Submerge_Timer; + uint32 Back_Timer; + uint32 ChangeTarget_Timer; + uint32 Spawn_Timer; + + bool Enrage; + bool Submerged; + + void Reset() override { - return GetTempleOfAhnQirajAI(creature); + Sweep_Timer = urand(5000, 10000); + SandBlast_Timer = urand(20000, 35000); + Submerge_Timer = urand(90000, 150000); + Back_Timer = urand(30000, 45000); + ChangeTarget_Timer = urand(5000, 8000); + Spawn_Timer = urand(10000, 20000); + + Enrage = false; + Submerged = false; } - struct boss_ouroAI : public ScriptedAI + void EnterCombat(Unit* /*who*/) override { - boss_ouroAI(Creature* creature) : ScriptedAI(creature) { } + DoCastVictim(SPELL_BIRTH); + } - uint32 Sweep_Timer; - uint32 SandBlast_Timer; - uint32 Submerge_Timer; - uint32 Back_Timer; - uint32 ChangeTarget_Timer; - uint32 Spawn_Timer; + void UpdateAI(uint32 diff) override + { + //Return since we have no target + if (!UpdateVictim()) + return; - bool Enrage; - bool Submerged; - - void Reset() override + //Sweep_Timer + if (!Submerged && Sweep_Timer <= diff) { - Sweep_Timer = urand(5000, 10000); + DoCastVictim(SPELL_SWEEP); + Sweep_Timer = urand(15000, 30000); + } + else Sweep_Timer -= diff; + + //SandBlast_Timer + if (!Submerged && SandBlast_Timer <= diff) + { + DoCastVictim(SPELL_SANDBLAST); SandBlast_Timer = urand(20000, 35000); - Submerge_Timer = urand(90000, 150000); + } + else SandBlast_Timer -= diff; + + //Submerge_Timer + if (!Submerged && Submerge_Timer <= diff) + { + //Cast + me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetFaction(FACTION_FRIENDLY); + DoCast(me, SPELL_DIRTMOUND_PASSIVE); + + Submerged = true; Back_Timer = urand(30000, 45000); - ChangeTarget_Timer = urand(5000, 8000); - Spawn_Timer = urand(10000, 20000); + } + else Submerge_Timer -= diff; + + //ChangeTarget_Timer + if (Submerged && ChangeTarget_Timer <= diff) + { + Unit* target = SelectTarget(SelectTargetMethod::Random, 0); + + if (target) + me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation()); + + ChangeTarget_Timer = urand(10000, 20000); + } + else ChangeTarget_Timer -= diff; + + //Back_Timer + if (Submerged && Back_Timer <= diff) + { + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetFaction(FACTION_MONSTER); + + DoCastVictim(SPELL_GROUND_RUPTURE); - Enrage = false; Submerged = false; + Submerge_Timer = urand(60000, 120000); } + else Back_Timer -= diff; - void EnterCombat(Unit* /*who*/) override - { - DoCastVictim(SPELL_BIRTH); - } - - void UpdateAI(uint32 diff) override - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sweep_Timer - if (!Submerged && Sweep_Timer <= diff) - { - DoCastVictim(SPELL_SWEEP); - Sweep_Timer = urand(15000, 30000); - } - else Sweep_Timer -= diff; - - //SandBlast_Timer - if (!Submerged && SandBlast_Timer <= diff) - { - DoCastVictim(SPELL_SANDBLAST); - SandBlast_Timer = urand(20000, 35000); - } - else SandBlast_Timer -= diff; - - //Submerge_Timer - if (!Submerged && Submerge_Timer <= diff) - { - //Cast - me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetFaction(FACTION_FRIENDLY); - DoCast(me, SPELL_DIRTMOUND_PASSIVE); - - Submerged = true; - Back_Timer = urand(30000, 45000); - } - else Submerge_Timer -= diff; - - //ChangeTarget_Timer - if (Submerged && ChangeTarget_Timer <= diff) - { - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - - if (target) - me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation()); - - ChangeTarget_Timer = urand(10000, 20000); - } - else ChangeTarget_Timer -= diff; - - //Back_Timer - if (Submerged && Back_Timer <= diff) - { - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetFaction(FACTION_MONSTER); - - DoCastVictim(SPELL_GROUND_RUPTURE); - - Submerged = false; - Submerge_Timer = urand(60000, 120000); - } - else Back_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; + DoMeleeAttackIfReady(); + } }; void AddSC_boss_ouro() { - new npc_ouro_spawner(); - new boss_ouro(); + RegisterTempleOfAhnQirajCreatureAI(npc_ouro_spawner); + RegisterTempleOfAhnQirajCreatureAI(boss_ouro); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 5944c9e95..4a9fc1ac3 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -47,183 +47,161 @@ enum Events uint32 const BlinkSpells[3] = { 4801, 8195, 20449 }; -class boss_skeram : public CreatureScript +struct boss_skeram : public BossAI { -public: - boss_skeram() : CreatureScript("boss_skeram") { } + boss_skeram(Creature* creature) : BossAI(creature, DATA_SKERAM) { } - struct boss_skeramAI : public BossAI + void Reset() override { - boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { } + _Reset(); + _flag = 0; + _hpct = 75.0f; + me->SetVisible(true); + } - void Reset() override + void KilledUnit(Unit* /*victim*/) override + { + Talk(SAY_SLAY); + } + + void EnterEvadeMode(EvadeReason why) override + { + ScriptedAI::EnterEvadeMode(why); + if (me->IsSummon()) + ((TempSummon*)me)->UnSummon(); + } + + void JustSummoned(Creature* creature) override + { + // Shift the boss and images (Get it? *Shift*?) + uint8 rand = 0; + if (_flag != 0) { - _Reset(); - _flag = 0; - _hpct = 75.0f; - me->SetVisible(true); - } - - void KilledUnit(Unit* /*victim*/) override - { - Talk(SAY_SLAY); - } - - void EnterEvadeMode(EvadeReason why) override - { - ScriptedAI::EnterEvadeMode(why); - if (me->IsSummon()) - ((TempSummon*)me)->UnSummon(); - } - - void JustSummoned(Creature* creature) override - { - // Shift the boss and images (Get it? *Shift*?) - uint8 rand = 0; - if (_flag != 0) - { - while (_flag & (1 << rand)) - rand = urand(0, 2); - DoCast(me, BlinkSpells[rand]); - _flag |= (1 << rand); - _flag |= (1 << 7); - } - while (_flag & (1 << rand)) rand = urand(0, 2); - creature->CastSpell(creature, BlinkSpells[rand]); + DoCast(me, BlinkSpells[rand]); _flag |= (1 << rand); - - if (_flag & (1 << 7)) - _flag = 0; - - float ImageHealthPct; - - if (me->GetHealthPct() < 25.0f) - ImageHealthPct = 0.50f; - else if (me->GetHealthPct() < 50.0f) - ImageHealthPct = 0.20f; - else - ImageHealthPct = 0.10f; - - creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct); - creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f)); - BossAI::JustSummoned(creature); + _flag |= (1 << 7); } - void JustDied(Unit* /*killer*/) override - { - if (!me->IsSummon()) - { - _JustDied(); - Talk(SAY_DEATH); - } - else - me->RemoveCorpse(); - } + while (_flag & (1 << rand)) + rand = urand(0, 2); + creature->CastSpell(creature, BlinkSpells[rand]); + _flag |= (1 << rand); - void EnterCombat(Unit* /*who*/) override - { - _EnterCombat(); - events.Reset(); + if (_flag & (1 << 7)) + _flag = 0; - events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000)); - events.ScheduleEvent(EVENT_FULLFILMENT, 15000); - events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000)); - events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); + float ImageHealthPct; - Talk(SAY_AGGRO); - } + if (me->GetHealthPct() < 25.0f) + ImageHealthPct = 0.50f; + else if (me->GetHealthPct() < 50.0f) + ImageHealthPct = 0.20f; + else + ImageHealthPct = 0.10f; - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_ARCANE_EXPLOSION: - DoCastAOE(SPELL_ARCANE_EXPLOSION, true); - events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000)); - break; - case EVENT_FULLFILMENT: - /// @todo For some weird reason boss does not cast this - // Spell actually works, tested in duel - DoCast(SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true); - events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000)); - break; - case EVENT_BLINK: - DoCast(me, BlinkSpells[urand(0, 2)]); - DoResetThreat(); - me->SetVisible(true); - events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000)); - break; - case EVENT_EARTH_SHOCK: - DoCastVictim(SPELL_EARTH_SHOCK); - events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); - break; - } - } - - if (!me->IsSummon() && me->GetHealthPct() < _hpct) - { - DoCast(me, SPELL_SUMMON_IMAGES, true); - Talk(SAY_SPLIT); - _hpct -= 25.0f; - me->SetVisible(false); - events.RescheduleEvent(EVENT_BLINK, 2000); - } - - if (me->IsWithinMeleeRange(me->GetVictim())) - { - events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000); - DoMeleeAttackIfReady(); - } - } - - private: - float _hpct; - uint8 _flag; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return GetTempleOfAhnQirajAI(creature); + creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct); + creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f)); + BossAI::JustSummoned(creature); } + + void JustDied(Unit* /*killer*/) override + { + if (!me->IsSummon()) + { + _JustDied(); + Talk(SAY_DEATH); + } + else + me->RemoveCorpse(); + } + + void EnterCombat(Unit* /*who*/) override + { + _EnterCombat(); + events.Reset(); + + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 6s, 12s); + events.ScheduleEvent(EVENT_FULLFILMENT, 15s); + events.ScheduleEvent(EVENT_BLINK, 30s, 45s); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2s); + + Talk(SAY_AGGRO); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANE_EXPLOSION: + DoCastAOE(SPELL_ARCANE_EXPLOSION, true); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 8s, 18s); + break; + case EVENT_FULLFILMENT: + /// @todo For some weird reason boss does not cast this + // Spell actually works, tested in duel + DoCast(SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true); + events.ScheduleEvent(EVENT_FULLFILMENT, 20s, 30s); + break; + case EVENT_BLINK: + DoCast(me, BlinkSpells[urand(0, 2)]); + DoResetThreat(); + me->SetVisible(true); + events.ScheduleEvent(EVENT_BLINK, 10s, 30s); + break; + case EVENT_EARTH_SHOCK: + DoCastVictim(SPELL_EARTH_SHOCK); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2s); + break; + } + } + + if (!me->IsSummon() && me->GetHealthPct() < _hpct) + { + DoCast(me, SPELL_SUMMON_IMAGES, true); + Talk(SAY_SPLIT); + _hpct -= 25.0f; + me->SetVisible(false); + events.RescheduleEvent(EVENT_BLINK, 2s); + } + + if (me->IsWithinMeleeRange(me->GetVictim())) + { + events.RescheduleEvent(EVENT_EARTH_SHOCK, 2s); + DoMeleeAttackIfReady(); + } + } + +private: + float _hpct; + uint8 _flag; }; -class spell_skeram_arcane_explosion : public SpellScriptLoader +class spell_skeram_arcane_explosion : public SpellScript { -public: - spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { } + PrepareSpellScript(spell_skeram_arcane_explosion); - class spell_skeram_arcane_explosion_SpellScript : public SpellScript + void FilterTargets(std::list& targets) { - PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript); + targets.remove_if(PlayerOrPetCheck()); + } - void FilterTargets(std::list& targets) - { - targets.remove_if(PlayerOrPetCheck()); - } - - void Register() override - { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); - } - }; - - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_skeram_arcane_explosion_SpellScript(); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; void AddSC_boss_skeram() { - new boss_skeram(); - new spell_skeram_arcane_explosion(); + RegisterTempleOfAhnQirajCreatureAI(boss_skeram); + RegisterSpellScript(spell_skeram_arcane_explosion); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 841280dcf..33b32fa44 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -377,223 +377,203 @@ struct boss_twinemperorsAI : public ScriptedAI } }; -class boss_veknilash : public CreatureScript +struct boss_veknilash : public boss_twinemperorsAI { -public: - boss_veknilash() : CreatureScript("boss_veknilash") { } + boss_veknilash(Creature* creature) : boss_twinemperorsAI(creature) { } - CreatureAI* GetAI(Creature* creature) const override + bool IAmVeklor() override { return false; } + + uint32 UpperCut_Timer; + uint32 UnbalancingStrike_Timer; + uint32 Scarabs_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() override { - return GetTempleOfAhnQirajAI(creature); + TwinReset(); + UpperCut_Timer = urand(14000, 29000); + UnbalancingStrike_Timer = urand(8000, 18000); + Scarabs_Timer = urand(7000, 14000); + + //Added. Can be removed if its included in DB. + me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); } - struct boss_veknilashAI : public boss_twinemperorsAI + void CastSpellOnBug(Creature* target) override { - bool IAmVeklor() override {return false;} - boss_veknilashAI(Creature* creature) : boss_twinemperorsAI(creature) { } + target->SetFaction(FACTION_MONSTER); + target->AI()->AttackStart(me->GetThreatMgr().getHostileTarget()); + target->AddAura(SPELL_MUTATE_BUG, target); + target->SetFullHealth(); + } - uint32 UpperCut_Timer; - uint32 UnbalancingStrike_Timer; - uint32 Scarabs_Timer; - int Rand; - int RandX; - int RandY; + void UpdateAI(uint32 diff) override + { + //Return since we have no target + if (!UpdateVictim()) + return; - Creature* Summoned; + if (!TryActivateAfterTTelep(diff)) + return; - void Reset() override + //UnbalancingStrike_Timer + if (UnbalancingStrike_Timer <= diff) { - TwinReset(); - UpperCut_Timer = urand(14000, 29000); - UnbalancingStrike_Timer = urand(8000, 18000); - Scarabs_Timer = urand(7000, 14000); - - //Added. Can be removed if its included in DB. - me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + DoCastVictim(SPELL_UNBALANCING_STRIKE); + UnbalancingStrike_Timer = 8000 + rand() % 12000; } + else UnbalancingStrike_Timer -= diff; - void CastSpellOnBug(Creature* target) override + if (UpperCut_Timer <= diff) { - target->SetFaction(FACTION_MONSTER); - target->AI()->AttackStart(me->GetThreatMgr().getHostileTarget()); - target->AddAura(SPELL_MUTATE_BUG, target); - target->SetFullHealth(); + Unit* randomMelee = SelectTarget(SelectTargetMethod::Random, 0, NOMINAL_MELEE_RANGE, true); + if (randomMelee) + DoCast(randomMelee, SPELL_UPPERCUT); + UpperCut_Timer = 15000 + rand() % 15000; } + else UpperCut_Timer -= diff; - void UpdateAI(uint32 diff) override + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer <= diff) { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!TryActivateAfterTTelep(diff)) - return; - - //UnbalancingStrike_Timer - if (UnbalancingStrike_Timer <= diff) - { - DoCastVictim(SPELL_UNBALANCING_STRIKE); - UnbalancingStrike_Timer = 8000 + rand() % 12000; - } - else UnbalancingStrike_Timer -= diff; - - if (UpperCut_Timer <= diff) - { - Unit* randomMelee = SelectTarget(SelectTargetMethod::Random, 0, NOMINAL_MELEE_RANGE, true); - if (randomMelee) - DoCast(randomMelee, SPELL_UPPERCUT); - UpperCut_Timer = 15000 + rand() % 15000; - } - else UpperCut_Timer -= diff; - - HandleBugs(diff); - - //Heal brother when 60yrds close - TryHealBrother(diff); - - //Teleporting to brother - if (Teleport_Timer <= diff) - { - TeleportToMyBrother(); - } - else Teleport_Timer -= diff; - - CheckEnrage(diff); - - DoMeleeAttackIfReady(); + TeleportToMyBrother(); } - }; + else Teleport_Timer -= diff; + + CheckEnrage(diff); + + DoMeleeAttackIfReady(); + } }; -class boss_veklor : public CreatureScript +struct boss_veklor : public boss_twinemperorsAI { -public: - boss_veklor() : CreatureScript("boss_veklor") { } + boss_veklor(Creature* creature) : boss_twinemperorsAI(creature) { } - CreatureAI* GetAI(Creature* creature) const override + bool IAmVeklor() override { return true; } + + uint32 ShadowBolt_Timer; + uint32 Blizzard_Timer; + uint32 ArcaneBurst_Timer; + uint32 Scorpions_Timer; + int Rand; + int RandX; + + Creature* Summoned; + + void Reset() override { - return GetTempleOfAhnQirajAI(creature); + TwinReset(); + ShadowBolt_Timer = 0; + Blizzard_Timer = urand(15000, 20000); + ArcaneBurst_Timer = 1000; + Scorpions_Timer = urand(7000, 14000); + + //Added. Can be removed if its included in DB. + me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); } - struct boss_veklorAI : public boss_twinemperorsAI + void CastSpellOnBug(Creature* target) override { - bool IAmVeklor() override {return true;} - boss_veklorAI(Creature* creature) : boss_twinemperorsAI(creature) { } + target->SetFaction(FACTION_MONSTER); + target->AddAura(SPELL_EXPLODEBUG, target); + target->SetFullHealth(); + } - uint32 ShadowBolt_Timer; - uint32 Blizzard_Timer; - uint32 ArcaneBurst_Timer; - uint32 Scorpions_Timer; - int Rand; - int RandX; + void UpdateAI(uint32 diff) override + { + //Return since we have no target + if (!UpdateVictim()) + return; - Creature* Summoned; + // reset arcane burst after teleport - we need to do this because + // when VL jumps to VN's location there will be a warrior who will get only 2s to run away + // which is almost impossible + if (AfterTeleport) + ArcaneBurst_Timer = 5000; + if (!TryActivateAfterTTelep(diff)) + return; - void Reset() override + //ShadowBolt_Timer + if (ShadowBolt_Timer <= diff) { - TwinReset(); - ShadowBolt_Timer = 0; - Blizzard_Timer = urand(15000, 20000); - ArcaneBurst_Timer = 1000; - Scorpions_Timer = urand(7000, 14000); - - //Added. Can be removed if its included in DB. - me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + if (!me->IsWithinDist(me->GetVictim(), 45.0f)) + me->GetMotionMaster()->MoveChase(me->GetVictim(), VEKLOR_DIST, 0); + else + DoCastVictim(SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; } + else ShadowBolt_Timer -= diff; - void CastSpellOnBug(Creature* target) override + //Blizzard_Timer + if (Blizzard_Timer <= diff) { - target->SetFaction(FACTION_MONSTER); - target->AddAura(SPELL_EXPLODEBUG, target); - target->SetFullHealth(); + Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45, true); + if (target) + { + DoCast(target, SPELL_BLIZZARD); + } + Blizzard_Timer = 15000 + rand() % 15000; } + else Blizzard_Timer -= diff; - void UpdateAI(uint32 diff) override + if (ArcaneBurst_Timer <= diff) { - //Return since we have no target - if (!UpdateVictim()) - return; - - // reset arcane burst after teleport - we need to do this because - // when VL jumps to VN's location there will be a warrior who will get only 2s to run away - // which is almost impossible - if (AfterTeleport) + Unit* mvic; + if ((mvic = SelectTarget(SelectTargetMethod::MaxDistance, 0, NOMINAL_MELEE_RANGE, true)) != nullptr) + { + DoCast(mvic, SPELL_ARCANEBURST); ArcaneBurst_Timer = 5000; - if (!TryActivateAfterTTelep(diff)) - return; - - //ShadowBolt_Timer - if (ShadowBolt_Timer <= diff) - { - if (!me->IsWithinDist(me->GetVictim(), 45.0f)) - me->GetMotionMaster()->MoveChase(me->GetVictim(), VEKLOR_DIST, 0); - else - DoCastVictim(SPELL_SHADOWBOLT); - ShadowBolt_Timer = 2000; } - else ShadowBolt_Timer -= diff; - - //Blizzard_Timer - if (Blizzard_Timer <= diff) - { - Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 45, true); - if (target) - { - DoCast(target, SPELL_BLIZZARD); - } - Blizzard_Timer = 15000 + rand() % 15000; - } - else Blizzard_Timer -= diff; - - if (ArcaneBurst_Timer <= diff) - { - Unit* mvic; - if ((mvic = SelectTarget(SelectTargetMethod::MaxDistance, 0, NOMINAL_MELEE_RANGE, true)) != nullptr) - { - DoCast(mvic, SPELL_ARCANEBURST); - ArcaneBurst_Timer = 5000; - } - } - else ArcaneBurst_Timer -= diff; - - HandleBugs(diff); - - //Heal brother when 60yrds close - TryHealBrother(diff); - - //Teleporting to brother - if (Teleport_Timer <= diff) - { - TeleportToMyBrother(); - } - else Teleport_Timer -= diff; - - CheckEnrage(diff); - - //VL doesn't melee - //DoMeleeAttackIfReady(); } + else ArcaneBurst_Timer -= diff; - void AttackStart(Unit* who) override + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer <= diff) { - if (!who) - return; + TeleportToMyBrother(); + } + else Teleport_Timer -= diff; - if (who->isTargetableForAttack()) + CheckEnrage(diff); + + //VL doesn't melee + //DoMeleeAttackIfReady(); + } + + void AttackStart(Unit* who) override + { + if (!who) + return; + + if (who->isTargetableForAttack()) + { + // VL doesn't melee + if (me->Attack(who, false)) { - // VL doesn't melee - if (me->Attack(who, false)) - { - me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); - me->AddThreat(who, 0.0f); - } + me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); + me->AddThreat(who, 0.0f); } } - }; + } }; void AddSC_boss_twinemperors() { - new boss_veknilash(); - new boss_veklor(); + RegisterTempleOfAhnQirajCreatureAI(boss_veknilash); + RegisterTempleOfAhnQirajCreatureAI(boss_veklor); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index a993aa06e..e5e0834d1 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -84,223 +84,201 @@ enum MovePoints Position const ViscidusCoord = { -7992.36f, 908.19f, -52.62f, 1.68f }; /// @todo Visci isn't in room middle float const RoomRadius = 40.0f; /// @todo Not sure if its correct -class boss_viscidus : public CreatureScript +struct boss_viscidus : public BossAI { -public: - boss_viscidus() : CreatureScript("boss_viscidus") { } + boss_viscidus(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { } - struct boss_viscidusAI : public BossAI + void Reset() override { - boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { } + _Reset(); + _hitcounter = 0; + _phase = PHASE_FROST; + } - void Reset() override + void DamageTaken(Unit* attacker, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + { + if (!attacker || _phase != PHASE_MELEE) + return; + + ++_hitcounter; + + if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE) { - _Reset(); - _hitcounter = 0; - _phase = PHASE_FROST; + Talk(EMOTE_EXPLODE); + events.Reset(); + _phase = PHASE_GLOB; + DoCast(me, SPELL_VISCIDUS_EXPLODE); + me->SetVisible(false); + me->RemoveAura(SPELL_TOXIN); + me->RemoveAura(SPELL_VISCIDUS_FREEZE); + + uint8 NumGlobes = me->GetHealthPct() / 5.0f; + for (uint8 i = 0; i < NumGlobes; ++i) + { + float Angle = i * 2 * M_PI / NumGlobes; + float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius; + float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius; + float Z = -35.0f; + + if (TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z)) + { + Glob->UpdateAllowedPositionZ(X, Y, Z); + Glob->NearTeleportTo(X, Y, Z, 0.0f); + Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord); + } + } } + else if (_hitcounter == HITCOUNTER_SHATTER) + Talk(EMOTE_SHATTER); + else if (_hitcounter == HITCOUNTER_CRACK) + Talk(EMOTE_CRACK); + } - void DamageTaken(Unit* attacker, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + { + if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f) { - if (!attacker || _phase != PHASE_MELEE) - return; - ++_hitcounter; - if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE) + if (_hitcounter >= HITCOUNTER_FREEZE) { - Talk(EMOTE_EXPLODE); - events.Reset(); - _phase = PHASE_GLOB; - DoCast(me, SPELL_VISCIDUS_EXPLODE); - me->SetVisible(false); - me->RemoveAura(SPELL_TOXIN); - me->RemoveAura(SPELL_VISCIDUS_FREEZE); - - uint8 NumGlobes = me->GetHealthPct() / 5.0f; - for (uint8 i = 0; i < NumGlobes; ++i) - { - float Angle = i * 2 * M_PI / NumGlobes; - float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius; - float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius; - float Z = -35.0f; - - if (TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z)) - { - Glob->UpdateAllowedPositionZ(X, Y, Z); - Glob->NearTeleportTo(X, Y, Z, 0.0f); - Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord); - } - } - } - else if (_hitcounter == HITCOUNTER_SHATTER) - Talk(EMOTE_SHATTER); - else if (_hitcounter == HITCOUNTER_CRACK) - Talk(EMOTE_CRACK); - } - - void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override - { - if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f) - { - ++_hitcounter; - - if (_hitcounter >= HITCOUNTER_FREEZE) - { - _hitcounter = 0; - Talk(EMOTE_FROZEN); - _phase = PHASE_MELEE; - DoCast(me, SPELL_VISCIDUS_FREEZE); - me->RemoveAura(SPELL_VISCIDUS_SLOWED_MORE); - events.ScheduleEvent(EVENT_RESET_PHASE, 15000); - } - else if (_hitcounter >= HITCOUNTER_SLOW_MORE) - { - Talk(EMOTE_FREEZE); - me->RemoveAura(SPELL_VISCIDUS_SLOWED); - DoCast(me, SPELL_VISCIDUS_SLOWED_MORE); - } - else if (_hitcounter >= HITCOUNTER_SLOW) - { - Talk(EMOTE_SLOW); - DoCast(me, SPELL_VISCIDUS_SLOWED); - } - } - } - - void EnterCombat(Unit* /*who*/) override - { - _EnterCombat(); - events.Reset(); - InitSpells(); - } - - void InitSpells() - { - DoCast(me, SPELL_TOXIN); - events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000)); - events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000)); - } - - void EnterEvadeMode(EvadeReason why) override - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(why); - } - - void JustDied(Unit* /*killer*/) override - { - DoCast(me, SPELL_VISCIDUS_SUICIDE); - summons.DespawnAll(); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (_phase == PHASE_GLOB && summons.empty()) - { - DoResetThreat(); - me->NearTeleportTo(ViscidusCoord.GetPositionX(), - ViscidusCoord.GetPositionY(), - ViscidusCoord.GetPositionZ(), - ViscidusCoord.GetOrientation()); - _hitcounter = 0; - _phase = PHASE_FROST; - InitSpells(); - me->SetVisible(true); + Talk(EMOTE_FROZEN); + _phase = PHASE_MELEE; + DoCast(me, SPELL_VISCIDUS_FREEZE); + me->RemoveAura(SPELL_VISCIDUS_SLOWED_MORE); + events.ScheduleEvent(EVENT_RESET_PHASE, 15000); } - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) + else if (_hitcounter >= HITCOUNTER_SLOW_MORE) { - switch (eventId) - { - case EVENT_POISONBOLT_VOLLEY: - DoCast(me, SPELL_POISONBOLT_VOLLEY); - events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000)); - break; - case EVENT_POISON_SHOCK: - DoCast(me, SPELL_POISON_SHOCK); - events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000)); - break; - case EVENT_RESET_PHASE: - _hitcounter = 0; - _phase = PHASE_FROST; - break; - default: - break; - } + Talk(EMOTE_FREEZE); + me->RemoveAura(SPELL_VISCIDUS_SLOWED); + DoCast(me, SPELL_VISCIDUS_SLOWED_MORE); } + else if (_hitcounter >= HITCOUNTER_SLOW) + { + Talk(EMOTE_SLOW); + DoCast(me, SPELL_VISCIDUS_SLOWED); + } + } + } - if (_phase != PHASE_GLOB) - DoMeleeAttackIfReady(); + void EnterCombat(Unit* /*who*/) override + { + _EnterCombat(); + events.Reset(); + InitSpells(); + } + + void InitSpells() + { + DoCast(me, SPELL_TOXIN); + events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, 10s, 15s); + events.ScheduleEvent(EVENT_POISON_SHOCK, 7s, 12s); + } + + void EnterEvadeMode(EvadeReason why) override + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(why); + } + + void JustDied(Unit* /*killer*/) override + { + DoCast(me, SPELL_VISCIDUS_SUICIDE); + summons.DespawnAll(); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + if (_phase == PHASE_GLOB && summons.empty()) + { + DoResetThreat(); + me->NearTeleportTo(ViscidusCoord.GetPositionX(), + ViscidusCoord.GetPositionY(), + ViscidusCoord.GetPositionZ(), + ViscidusCoord.GetOrientation()); + + _hitcounter = 0; + _phase = PHASE_FROST; + InitSpells(); + me->SetVisible(true); } - private: - uint8 _hitcounter; - Phases _phase; - }; + events.Update(diff); - CreatureAI* GetAI(Creature* creature) const override - { - return GetTempleOfAhnQirajAI(creature); + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_POISONBOLT_VOLLEY: + DoCast(me, SPELL_POISONBOLT_VOLLEY); + events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, 10s, 15s); + break; + case EVENT_POISON_SHOCK: + DoCast(me, SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_POISON_SHOCK, 7s, 12s); + break; + case EVENT_RESET_PHASE: + _hitcounter = 0; + _phase = PHASE_FROST; + break; + default: + break; + } + } + + if (_phase != PHASE_GLOB) + DoMeleeAttackIfReady(); } + +private: + uint8 _hitcounter; + Phases _phase; }; -class npc_glob_of_viscidus : public CreatureScript +struct boss_glob_of_viscidus : public ScriptedAI { -public: - npc_glob_of_viscidus() : CreatureScript("boss_glob_of_viscidus") { } + boss_glob_of_viscidus(Creature* creature) : ScriptedAI(creature) { } - struct npc_glob_of_viscidusAI : public ScriptedAI + void JustDied(Unit* /*killer*/) override { - npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) { } + InstanceScript* instance = me->GetInstanceScript(); - void JustDied(Unit* /*killer*/) override + if (Creature* viscidus = me->GetMap()->GetCreature(instance->GetGuidData(DATA_VISCIDUS))) { - InstanceScript* Instance = me->GetInstanceScript(); + if (BossAI* viscidusAI = dynamic_cast(viscidus->GetAI())) + viscidusAI->SummonedCreatureDespawn(me); - if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetGuidData(DATA_VISCIDUS))) + if (viscidus->IsAlive() && viscidus->GetHealthPct() < 5.0f) { - if (BossAI* ViscidusAI = dynamic_cast(Viscidus->GetAI())) - ViscidusAI->SummonedCreatureDespawn(me); - - if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f) - { - Viscidus->SetVisible(true); - Unit::Kill(Viscidus->GetVictim(), Viscidus); - } - else - { - Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20); - Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS); - } + viscidus->SetVisible(true); + Unit::Kill(viscidus->GetVictim(), viscidus); + } + else + { + viscidus->SetHealth(viscidus->GetHealth() - viscidus->GetMaxHealth() / 20); + viscidus->CastSpell(viscidus, SPELL_VISCIDUS_SHRINKS); } } + } - void MovementInform(uint32 /*type*/, uint32 id) override - { - if (id == ROOM_CENTER) - { - DoCast(me, SPELL_REJOIN_VISCIDUS); - if (TempSummon* summon = me->ToTempSummon()) - summon->UnSummon(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override + void MovementInform(uint32 /*type*/, uint32 id) override { - return GetTempleOfAhnQirajAI(creature); + if (id == ROOM_CENTER) + { + DoCast(me, SPELL_REJOIN_VISCIDUS); + if (TempSummon* summon = me->ToTempSummon()) + summon->UnSummon(); + } } }; void AddSC_boss_viscidus() { - new boss_viscidus(); - new npc_glob_of_viscidus(); + RegisterTempleOfAhnQirajCreatureAI(boss_viscidus); + RegisterTempleOfAhnQirajCreatureAI(boss_glob_of_viscidus); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index d32f6dbd9..70215f2b1 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -75,4 +75,6 @@ inline AI* GetTempleOfAhnQirajAI(T* obj) return GetInstanceAI(obj, TempleOfAhnQirajScriptName); } +#define RegisterTempleOfAhnQirajCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetTempleOfAhnQirajAI) + #endif From 1288539b5894b0a4517c52714d4eb1207957c6d2 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 6 Aug 2022 01:58:54 +0200 Subject: [PATCH 072/161] =?UTF-8?q?fix(Scripts/Spells):=20Readiness=20shou?= =?UTF-8?q?ld=20remove=20all=20spell=20category=20coold=E2=80=A6=20(#12595?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …owns. --- src/server/scripts/Spells/spell_hunter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 0e715bf55..759141d94 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -666,10 +666,13 @@ class spell_hun_readiness : public SpellScript && spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && spellInfo->Id != SPELL_HUNTER_READINESS && spellInfo->Id != SPELL_HUNTER_BESTIAL_WRATH - && spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU - && spellInfo->GetRecoveryTime() > 0) + && spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU) { - caster->RemoveSpellCooldown(spellInfo->Id, itr->second.needSendToClient); + if (spellInfo->RecoveryTime > 0) + caster->RemoveSpellCooldown(spellInfo->Id, itr->second.needSendToClient); + + if (spellInfo->CategoryRecoveryTime > 0) + caster->RemoveCategoryCooldown(spellInfo->GetCategory()); } } } From e2c4c5a5dcf72fbe095752e430bf6e8727e97c24 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 6 Aug 2022 02:07:03 +0200 Subject: [PATCH 073/161] fix(Core/Spells): Volley should suspend auto-shot. (#12596) --- src/server/game/Entities/Unit/Unit.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 71962e1ed..2c28c9a7b 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -464,6 +464,7 @@ void Unit::Update(uint32 p_time) // xinef: if attack time > 0, reduce by diff // if on next update, attack time < 0 assume player didnt attack - set to 0 bool suspendAttackTimer = false; + bool suspendRangedAttackTimer = false; if (IsPlayer() && HasUnitState(UNIT_STATE_CASTING)) { for (Spell* spell : m_currentSpells) @@ -472,6 +473,11 @@ void Unit::Update(uint32 p_time) { if (spell->GetSpellInfo()->HasAttribute(SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS)) { + if (spell->IsChannelActive()) + { + suspendRangedAttackTimer = true; + } + suspendAttackTimer = true; break; } @@ -492,9 +498,12 @@ void Unit::Update(uint32 p_time) } } - if (int32 ranged_attack = getAttackTimer(RANGED_ATTACK)) + if (!suspendRangedAttackTimer) { - setAttackTimer(RANGED_ATTACK, ranged_attack > 0 ? ranged_attack - (int32) p_time : 0); + if (int32 ranged_attack = getAttackTimer(RANGED_ATTACK)) + { + setAttackTimer(RANGED_ATTACK, ranged_attack > 0 ? ranged_attack - (int32)p_time : 0); + } } // update abilities available only for fraction of time From c28f3342ab9409838313ec38b14f87288781f6ec Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 6 Aug 2022 02:07:35 +0200 Subject: [PATCH 074/161] fix(DB/Spells): Fixed Hunter T3 4P bonus. (#12597) --- data/sql/updates/pending_db_world/rev_1659261841085305300.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659261841085305300.sql diff --git a/data/sql/updates/pending_db_world/rev_1659261841085305300.sql b/data/sql/updates/pending_db_world/rev_1659261841085305300.sql new file mode 100644 index 000000000..b0f4c7802 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659261841085305300.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=28757; +INSERT INTO `spell_linked_spell` VALUES +(28757,28758,0,'Stalker\'s Ally'); From 9c7a21110655871bb0fa34775efc52c0336aa8c8 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 6 Aug 2022 00:09:43 +0000 Subject: [PATCH 075/161] chore(DB): import pending files Referenced commit(s): c28f3342ab9409838313ec38b14f87288781f6ec --- .../rev_1659261841085305300.sql => db_world/2022_08_06_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659261841085305300.sql => db_world/2022_08_06_00.sql} (76%) diff --git a/data/sql/updates/pending_db_world/rev_1659261841085305300.sql b/data/sql/updates/db_world/2022_08_06_00.sql similarity index 76% rename from data/sql/updates/pending_db_world/rev_1659261841085305300.sql rename to data/sql/updates/db_world/2022_08_06_00.sql index b0f4c7802..281f834fe 100644 --- a/data/sql/updates/pending_db_world/rev_1659261841085305300.sql +++ b/data/sql/updates/db_world/2022_08_06_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_05_00 -> 2022_08_06_00 -- DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=28757; INSERT INTO `spell_linked_spell` VALUES From 825db0f8c1fb6d938d0cec88df0447fe7ee5b3b2 Mon Sep 17 00:00:00 2001 From: M'Dic Date: Fri, 5 Aug 2022 20:15:58 -0400 Subject: [PATCH 076/161] update (core): Knock Back Helpers (#12639) Adds knock back helpers to the core for future core and module use. --- src/server/game/Entities/Player/Player.cpp | 1 + src/server/game/Entities/Player/Player.h | 3 +++ src/server/game/Entities/Unit/Unit.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 575f410fe..674e543e1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -222,6 +222,7 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this) m_bHasDelayedTeleport = false; teleportStore_options = 0; m_canTeleport = false; + m_canKnockback = false; m_trade = nullptr; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index ddc3c1b68..6ff76d89c 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2430,6 +2430,8 @@ public: bool CanTeleport() { return m_canTeleport; } void SetCanTeleport(bool value) { m_canTeleport = value; } + bool CanKnockback() { return m_canKnockback; } + void SetCanKnockback(bool value) { m_canKnockback = value; } bool isAllowedToLoot(Creature const* creature); @@ -2883,6 +2885,7 @@ private: bool m_bMustDelayTeleport; bool m_bHasDelayedTeleport; bool m_canTeleport; + bool m_canKnockback; std::unique_ptr m_petStable; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2c28c9a7b..5cf798604 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -18727,6 +18727,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) player->SetCanFly(true, true); sScriptMgr->AnticheatSetSkipOnePacketForASH(player, true); + player->SetCanKnockback(true); } } From 22494532ce67fb9903d11b3bba7f038e7a124e3c Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sat, 6 Aug 2022 02:33:59 +0200 Subject: [PATCH 077/161] fix(Core/Spells): Fixed Druid T3 8P bonus. (#12598) --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- src/server/game/Entities/Unit/Unit.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5cf798604..2eda1f171 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6159,7 +6159,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType } //victim may be nullptr -bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) +bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, Spell const* spellProc /*= nullptr*/) { SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); uint32 effIndex = triggeredByAura->GetEffIndex(); @@ -7085,7 +7085,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere case 28719: { // mana back - basepoints0 = int32(CalculatePct(procSpell->ManaCost, 30)); + basepoints0 = int32(CalculatePct(spellProc->GetPowerCost(), 30)); target = this; triggered_spell_id = 28742; break; @@ -16000,7 +16000,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_DUMMY: { LOG_DEBUG("spells.aura", "ProcDamageAndSpell: casting spell id {} (triggered by {} dummy aura of spell {})", spellInfo->Id, (isVictim ? "a victim's" : "an attacker's"), triggeredByAura->GetId()); - if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown)) + if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpellInfo, procFlag, procExtra, cooldown, procSpell)) takeCharges = true; break; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d4e5190f9..d5372a15f 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2508,7 +2508,7 @@ protected: private: bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent, ProcEventInfo const& eventInfo); - bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); + bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, Spell const* spellProc = nullptr); bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool* handled); bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, uint32 procPhase, ProcEventInfo& eventInfo); bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); From 134568158c2d8d5e5c1ef157864dca248bc5d27a Mon Sep 17 00:00:00 2001 From: Patrick Lewis Date: Fri, 5 Aug 2022 20:04:52 -0700 Subject: [PATCH 078/161] chore(CI): remove macos-10.15 (#12642) --- .github/workflows/macos_build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 92ebfbf6a..7ff8341cf 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -16,7 +16,6 @@ jobs: fail-fast: false matrix: os: - - macos-10.15 - macos-11 - macos-12 runs-on: ${{ matrix.os }} From 440865e365d38f944c3c6e84ac7d6a8cf6688383 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 6 Aug 2022 15:23:00 -0300 Subject: [PATCH 079/161] fix(Scripts/RuinsOfAhnQiraj): Implement Rajaxx waves gear check (#12552) * fix(Scripts/RuinsOfAhnQiraj): Implement Rajaxx waves gear check * Cancel timer on wipe * Update rev_1658867303864464100.sql * Update instance_ruins_of_ahnqiraj.cpp * set it to 2 mins --- .../rev_1658867303864464100.sql | 84 +++++++++++++++++++ .../instance_ruins_of_ahnqiraj.cpp | 35 ++++++-- 2 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1658867303864464100.sql diff --git a/data/sql/updates/pending_db_world/rev_1658867303864464100.sql b/data/sql/updates/pending_db_world/rev_1658867303864464100.sql new file mode 100644 index 000000000..51e84677e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658867303864464100.sql @@ -0,0 +1,84 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15391; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15391) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15391, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15391, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 14000, 15000, 0, 11, 19134, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - In Combat - Cast \'Frightening Shout\' (Normal Dungeon)'), +(15391, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - In Combat - Increment Phase (Normal Dungeon)'), +(15391, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15391, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15391, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15391, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Qeez - On Aggro - Set Instance Data 1 to 8'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15392; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15392) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15392, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15392, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 14000, 15000, 0, 11, 25471, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - In Combat - Cast \'Attack Order\' (Normal Dungeon)'), +(15392, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - In Combat - Increment Phase (Normal Dungeon)'), +(15392, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15392, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15392, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15392, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Tuubid - On Aggro - Set Instance Data 1 to 9'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15389; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15389) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15389, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15389, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 14000, 15000, 0, 11, 26550, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - In Combat - Cast \'Lightning Cloud\' (Normal Dungeon)'), +(15389, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - In Combat - Increment Phase (Normal Dungeon)'), +(15389, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15389, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15389, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15389, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Drenn - On Aggro - Set Instance Data 1 to 10'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15390; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15390) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15390, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15390, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 14000, 15000, 0, 11, 25425, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - In Combat - Cast \'Shockwave\' (Normal Dungeon)'), +(15390, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - In Combat - Increment Phase (Normal Dungeon)'), +(15390, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15390, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15390, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15390, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Captain Xurrem - On Aggro - Set Instance Data 1 to 11'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15386; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15386) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15386, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15386, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 8000, 9000, 0, 11, 25282, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - In Combat - Cast \'Shield of Rajaxx\' (Normal Dungeon)'), +(15386, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - In Combat - Increment Phase (Normal Dungeon)'), +(15386, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15386, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15386, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15386, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Yeggeth - On Aggro - Set Instance Data 1 to 12'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15388; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15388) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15388, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15388, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 14000, 15000, 0, 11, 25322, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - In Combat - Cast \'Sweeping Slam\' (Normal Dungeon)'), +(15388, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - In Combat - Increment Phase (Normal Dungeon)'), +(15388, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15388, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15388, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15388, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Major Pakkon - On Aggro - Set Instance Data 1 to 13'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15385; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15385) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 3, 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 +(15385, 0, 0, 0, 0, 0, 100, 2, 10000, 11000, 8000, 9000, 0, 11, 24317, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Cast \'Sunder Armor\' (Normal Dungeon)'), +(15385, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 8000, 9000, 0, 11, 25462, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Cast \'Enlarge\' (Normal Dungeon)'), +(15385, 0, 2, 0, 0, 0, 100, 514, 13000, 17000, 14000, 18000, 0, 23, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Increment Phase (Normal Dungeon)'), +(15385, 0, 3, 0, 0, 1, 100, 2, 1000, 1000, 1000, 1000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15385, 0, 4, 0, 0, 1, 100, 2, 2000, 2000, 2000, 2000, 0, 11, 40504, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Cast \'Cleave\' (Phase 1) (Normal Dungeon)'), +(15385, 0, 5, 0, 0, 1, 100, 514, 3000, 3000, 3000, 3000, 0, 23, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Decrement Phase (Phase 1) (Normal Dungeon)'), +(15385, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 0, 34, 1, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - On Aggro - Set Instance Data 1 to 14'); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp index 0bbde8ae5..535194429 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp @@ -37,14 +37,17 @@ ObjectData const creatureData[] = { NPC_ZERRAN, DATA_ZERRAN }, }; -enum RajaxxText +enum RajaxxWaveEvent { SAY_WAVE3 = 0, SAY_WAVE4 = 1, SAY_WAVE5 = 2, SAY_WAVE6 = 3, SAY_WAVE7 = 4, - SAY_ENGAGE = 5 + SAY_ENGAGE = 5, + + DATA_RAJAXX_WAVE_ENGAGED = 1, + GROUP_RAJAXX_WAVE_TIMER = 1 }; std::array RajaxxWavesData[] = @@ -128,6 +131,20 @@ public: } } + void SetData(uint32 type, uint32 /*data*/) override + { + if (type == DATA_RAJAXX_WAVE_ENGAGED) + { + _scheduler.CancelGroup(GROUP_RAJAXX_WAVE_TIMER); + _scheduler.Schedule(2min, [this](TaskContext context) + { + CallNextRajaxxLeader(); + context.SetGroup(GROUP_RAJAXX_WAVE_TIMER); + context.Repeat(); + }); + } + } + void OnUnitDeath(Unit* unit) override { if (Creature* creature = unit->ToCreature()) @@ -149,7 +166,7 @@ public: _scheduler.Schedule(1s, [this, formation](TaskContext /*context*/) { if (!formation->IsAnyMemberAlive()) { - CallNextRajaxxLeader(); + CallNextRajaxxLeader(true); } }); break; @@ -236,17 +253,20 @@ public: OUT_LOAD_INST_DATA_COMPLETE; } - void CallNextRajaxxLeader() + void CallNextRajaxxLeader(bool announce = false) { ++_rajaxWaveCounter; if (Creature* nextLeader = GetCreature(RajaxxWavesData[_rajaxWaveCounter].at(0))) { - if (_rajaxWaveCounter >= 2) + if (announce) { - if (Creature* rajaxx = GetCreature(DATA_RAJAXX)) + if (_rajaxWaveCounter >= 2) { - rajaxx->AI()->Talk(RajaxxWavesData[_rajaxWaveCounter].at(1)); + if (Creature* rajaxx = GetCreature(DATA_RAJAXX)) + { + rajaxx->AI()->Talk(RajaxxWavesData[_rajaxWaveCounter].at(1)); + } } } @@ -264,6 +284,7 @@ public: void ResetRajaxxWaves() { _rajaxWaveCounter = 0; + _scheduler.CancelAll(); for (auto const& data : RajaxxWavesData) { if (Creature* creature = GetCreature(data.at(0))) From 286347417a90840bc558bd3b9d8c9f344e4bd6bd Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sat, 6 Aug 2022 18:25:12 +0000 Subject: [PATCH 080/161] chore(DB): import pending files Referenced commit(s): 440865e365d38f944c3c6e84ac7d6a8cf6688383 --- .../rev_1658867303864464100.sql => db_world/2022_08_06_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658867303864464100.sql => db_world/2022_08_06_01.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1658867303864464100.sql b/data/sql/updates/db_world/2022_08_06_01.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1658867303864464100.sql rename to data/sql/updates/db_world/2022_08_06_01.sql index 51e84677e..f5375864f 100644 --- a/data/sql/updates/pending_db_world/rev_1658867303864464100.sql +++ b/data/sql/updates/db_world/2022_08_06_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_06_00 -> 2022_08_06_01 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 15391; From 6ad764c520c29772690eb4a319cf043f1af33744 Mon Sep 17 00:00:00 2001 From: Patrick Lewis Date: Sun, 7 Aug 2022 01:05:05 -0700 Subject: [PATCH 081/161] chore(CI): remove ubuntu-18.04 (#12650) * chore(CI): remove ubuntu-18.04 and add ubuntu-22.04 * update ubuntu.sh * update * update * openssl workaround * update * update * update --- .github/SECURITY.md | 12 ++++++------ .github/workflows/core_matrix_build.yml | 6 +----- .github/workflows/core_modules_build.yml | 2 +- .github/workflows/docker_build.yml | 2 +- .github/workflows/macos_build.yml | 2 +- .github/workflows/windows_build.yml | 2 +- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index b55b3cc60..13faf3a07 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -55,15 +55,15 @@ Versions of Ubuntu: | Ubuntu version | Supported | | -------------- | ------------------ | | 20.04 | :white_check_mark: | -| 18.04 | :white_check_mark: | +| 18.04 and lower| :red_circle: | Versions of macOS: -| macOS Version | Supported | -| ------------- | ------------------ | -| 12 | :white_check_mark: | -| 11 | :white_check_mark: | -| 10.15 | :white_check_mark: | +| macOS Version | Supported | +| -------------- | ------------------ | +| 12 | :white_check_mark: | +| 11 | :white_check_mark: | +| 10.15 and lower| :red_circle: | **Note**: We do NOT support any repacks that may or may not have been made based on AzerothCore. Nor do we support any of the releases that are made under AzerothCore. diff --git a/.github/workflows/core_matrix_build.yml b/.github/workflows/core_matrix_build.yml index 95732a403..5852c6c17 100644 --- a/.github/workflows/core_matrix_build.yml +++ b/.github/workflows/core_matrix_build.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'labeled', 'opened', 'synchronize', 'reopened'] + types: ['labeled', 'opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) @@ -21,10 +21,6 @@ jobs: compiler: clang12 - os: ubuntu-20.04 compiler: clang11 - - os: ubuntu-18.04 - compiler: clang10 - - os: ubuntu-18.04 - compiler: gcc8 - os: ubuntu-20.04 compiler: gcc # default in 20.04 is gcc 9 - os: ubuntu-20.04 diff --git a/.github/workflows/core_modules_build.yml b/.github/workflows/core_modules_build.yml index 6db57dcfc..7003d96f9 100644 --- a/.github/workflows/core_modules_build.yml +++ b/.github/workflows/core_modules_build.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'labeled', 'opened', 'synchronize', 'reopened'] + types: ['labeled', 'opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 872f6c36f..7ccbf23f9 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'labeled', 'opened', 'synchronize', 'reopened'] + types: ['labeled', 'opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 7ff8341cf..5d58a15e6 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'labeled', 'opened', 'synchronize', 'reopened'] + types: ['labeled', 'opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 43792b754..6fb55ccc3 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -4,7 +4,7 @@ on: branches: - 'master' pull_request: - types: ['labeled', 'labeled', 'opened', 'synchronize', 'reopened'] + types: ['labeled', 'opened', 'synchronize', 'reopened'] concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) From 750f7ee8e9a7e2efdfc337a5bcfb939aeb93e25b Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 7 Aug 2022 18:39:58 +0200 Subject: [PATCH 082/161] fix(Scripts/RuinsOfAhnQiraj): Fixed crystal activation animation. (#12647) --- .../updates/pending_db_world/rev_1659805188255061100.sql | 2 ++ .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659805188255061100.sql diff --git a/data/sql/updates/pending_db_world/rev_1659805188255061100.sql b/data/sql/updates/pending_db_world/rev_1659805188255061100.sql new file mode 100644 index 000000000..86c2f1782 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659805188255061100.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject_template` SET `data3`=8000 WHERE `entry`=180619; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index f6ae0b579..418b5c782 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -284,14 +284,14 @@ public: { InstanceScript* instance = player->GetInstanceScript(); if (!instance) - return false; + return true; Creature* ossirian = instance->GetCreature(DATA_OSSIRIAN); if (!ossirian || instance->GetBossState(DATA_OSSIRIAN) != IN_PROGRESS) - return false; + return true; ossirian->AI()->DoAction(ACTION_TRIGGER_WEAKNESS); - return true; + return false; } }; From f073f87d0739dd5e73de2a9e457b6b256fc9ef2c Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 16:41:57 +0000 Subject: [PATCH 083/161] chore(DB): import pending files Referenced commit(s): 750f7ee8e9a7e2efdfc337a5bcfb939aeb93e25b --- .../rev_1659805188255061100.sql => db_world/2022_08_07_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659805188255061100.sql => db_world/2022_08_07_00.sql} (61%) diff --git a/data/sql/updates/pending_db_world/rev_1659805188255061100.sql b/data/sql/updates/db_world/2022_08_07_00.sql similarity index 61% rename from data/sql/updates/pending_db_world/rev_1659805188255061100.sql rename to data/sql/updates/db_world/2022_08_07_00.sql index 86c2f1782..2259de526 100644 --- a/data/sql/updates/pending_db_world/rev_1659805188255061100.sql +++ b/data/sql/updates/db_world/2022_08_07_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_06_01 -> 2022_08_07_00 -- UPDATE `gameobject_template` SET `data3`=8000 WHERE `entry`=180619; From 2820b7ef5fa45efc2dd7995fa7734bd10eb28949 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Sun, 7 Aug 2022 13:43:24 -0300 Subject: [PATCH 084/161] fix(DB/SAI): Spell timers for Hive'Zara Tail Lasher and Hive'Zara Collectors (#12631) --- data/sql/updates/pending_db_world/rev_1659650326495942600.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659650326495942600.sql diff --git a/data/sql/updates/pending_db_world/rev_1659650326495942600.sql b/data/sql/updates/pending_db_world/rev_1659650326495942600.sql new file mode 100644 index 000000000..5b21ae441 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659650326495942600.sql @@ -0,0 +1,4 @@ +-- +UPDATE `smart_scripts` SET `event_type`=0, `event_param1`=7000, `event_param2`=10000 WHERE `entryorguid`=15336 AND `source_type`=0 AND `id`=4 AND `link`=0; +UPDATE `smart_scripts` SET `event_type`=0, `event_param1`=10000, `event_param2`=16000, `event_param3`=21800, `event_param4`=34400 WHERE `entryorguid`=15319 AND `source_type`=0 AND `id`=0 AND `link`=0; +UPDATE `smart_scripts` SET `event_param1`=12000, `event_param2`=15000, `event_param3`=26700, `event_param4`=36500 WHERE `entryorguid`=15319 AND `source_type`=0 AND `id`=1 AND `link`=0; From b7c89e66999cf9ff2e3f87e6073253f0e5992922 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 16:45:30 +0000 Subject: [PATCH 085/161] chore(DB): import pending files Referenced commit(s): 2820b7ef5fa45efc2dd7995fa7734bd10eb28949 --- .../rev_1659650326495942600.sql => db_world/2022_08_07_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659650326495942600.sql => db_world/2022_08_07_01.sql} (92%) diff --git a/data/sql/updates/pending_db_world/rev_1659650326495942600.sql b/data/sql/updates/db_world/2022_08_07_01.sql similarity index 92% rename from data/sql/updates/pending_db_world/rev_1659650326495942600.sql rename to data/sql/updates/db_world/2022_08_07_01.sql index 5b21ae441..c8d0469dc 100644 --- a/data/sql/updates/pending_db_world/rev_1659650326495942600.sql +++ b/data/sql/updates/db_world/2022_08_07_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_00 -> 2022_08_07_01 -- UPDATE `smart_scripts` SET `event_type`=0, `event_param1`=7000, `event_param2`=10000 WHERE `entryorguid`=15336 AND `source_type`=0 AND `id`=4 AND `link`=0; UPDATE `smart_scripts` SET `event_type`=0, `event_param1`=10000, `event_param2`=16000, `event_param3`=21800, `event_param4`=34400 WHERE `entryorguid`=15319 AND `source_type`=0 AND `id`=0 AND `link`=0; From 71d2adf566a2f63e54f3af6b5625af6fa8c6e46e Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Sun, 7 Aug 2022 13:47:12 -0300 Subject: [PATCH 086/161] fix(DB/formations): Add formations to AQ20 zone The Hatchery (#12635) --- .../rev_1659661174617366100.sql | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659661174617366100.sql diff --git a/data/sql/updates/pending_db_world/rev_1659661174617366100.sql b/data/sql/updates/pending_db_world/rev_1659661174617366100.sql new file mode 100644 index 000000000..185a893cb --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659661174617366100.sql @@ -0,0 +1,39 @@ +-- +DELETE FROM `creature_formations` WHERE `leaderguid` IN (144466, 144476, 144473, 144469, 144481, 144470, 144452, 144456, 144454); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(144466, 144466, 0, 0, 3, 0, 0), +(144466, 144474, 0, 0, 3, 0, 0), +(144466, 144475, 0, 0, 3, 0, 0), +(144476, 144476, 0, 0, 3, 0, 0), +(144476, 144467, 0, 0, 3, 0, 0), +(144476, 144468, 0, 0, 3, 0, 0), +(144473, 144473, 0, 0, 3, 0, 0), +(144473, 144464, 0, 0, 3, 0, 0), +(144473, 144465, 0, 0, 3, 0, 0), +(144469, 144469, 0, 0, 3, 0, 0), +(144469, 144477, 0, 0, 3, 0, 0), +(144469, 144478, 0, 0, 3, 0, 0), +(144481, 144481, 0, 0, 3, 0, 0), +(144481, 144471, 0, 0, 3, 0, 0), +(144481, 144472, 0, 0, 3, 0, 0), +(144470, 144470, 0, 0, 3, 0, 0), +(144470, 144479, 0, 0, 3, 0, 0), +(144470, 144480, 0, 0, 3, 0, 0), +(144452, 144452, 0, 0, 3, 0, 0), +(144452, 144453, 0, 0, 3, 0, 0), +(144452, 144458, 0, 0, 3, 0, 0), +(144452, 144459, 0, 0, 3, 0, 0), +(144452, 144586, 0, 0, 3, 0, 0), +(144452, 144587, 0, 0, 3, 0, 0), +(144456, 144456, 0, 0, 3, 0, 0), +(144456, 144457, 0, 0, 3, 0, 0), +(144456, 144462, 0, 0, 3, 0, 0), +(144456, 144463, 0, 0, 3, 0, 0), +(144456, 144590, 0, 0, 3, 0, 0), +(144456, 144591, 0, 0, 3, 0, 0), +(144454, 144454, 0, 0, 3, 0, 0), +(144454, 144455, 0, 0, 3, 0, 0), +(144454, 144460, 0, 0, 3, 0, 0), +(144454, 144461, 0, 0, 3, 0, 0), +(144454, 144588, 0, 0, 3, 0, 0), +(144454, 144589, 0, 0, 3, 0, 0); From aab02602c17bfab42dd74c9fd8112a416fab27eb Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 16:49:14 +0000 Subject: [PATCH 087/161] chore(DB): import pending files Referenced commit(s): 71d2adf566a2f63e54f3af6b5625af6fa8c6e46e --- .../rev_1659661174617366100.sql => db_world/2022_08_07_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659661174617366100.sql => db_world/2022_08_07_02.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1659661174617366100.sql b/data/sql/updates/db_world/2022_08_07_02.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1659661174617366100.sql rename to data/sql/updates/db_world/2022_08_07_02.sql index 185a893cb..d507e5ee6 100644 --- a/data/sql/updates/pending_db_world/rev_1659661174617366100.sql +++ b/data/sql/updates/db_world/2022_08_07_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_01 -> 2022_08_07_02 -- DELETE FROM `creature_formations` WHERE `leaderguid` IN (144466, 144476, 144473, 144469, 144481, 144470, 144452, 144456, 144454); INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES From 337800fc4ca152e05b0b037e5f13304e79027aa6 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Sun, 7 Aug 2022 13:51:46 -0300 Subject: [PATCH 088/161] fix(DB/SAI): Colonel Zerran (15385) Enlarge spell mechanics (#12636) --- .../updates/pending_db_world/rev_1659661586230960300.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659661586230960300.sql diff --git a/data/sql/updates/pending_db_world/rev_1659661586230960300.sql b/data/sql/updates/pending_db_world/rev_1659661586230960300.sql new file mode 100644 index 000000000..c1605e6f4 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659661586230960300.sql @@ -0,0 +1,6 @@ +-- +UPDATE `creature_template_addon` SET `auras` = '' WHERE (`entry` = 15385); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15385) AND (`source_type` = 0) AND (`id` IN (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 +(15385, 0, 1, 0, 0, 0, 100, 2, 12000, 13000, 20000, 26000, 0, 11, 25462, 32, 0, 0, 0, 0, 26, 20, 0, 0, 0, 0, 0, 0, 0, 'Colonel Zerran - In Combat - Cast \'Enlarge\''); From 9a024e0b6407adb55f3d4f4ca4bd14fb24fdfec6 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 16:53:47 +0000 Subject: [PATCH 089/161] chore(DB): import pending files Referenced commit(s): 337800fc4ca152e05b0b037e5f13304e79027aa6 --- .../rev_1659661586230960300.sql => db_world/2022_08_07_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659661586230960300.sql => db_world/2022_08_07_03.sql} (94%) diff --git a/data/sql/updates/pending_db_world/rev_1659661586230960300.sql b/data/sql/updates/db_world/2022_08_07_03.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1659661586230960300.sql rename to data/sql/updates/db_world/2022_08_07_03.sql index c1605e6f4..bedff5b58 100644 --- a/data/sql/updates/pending_db_world/rev_1659661586230960300.sql +++ b/data/sql/updates/db_world/2022_08_07_03.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_02 -> 2022_08_07_03 -- UPDATE `creature_template_addon` SET `auras` = '' WHERE (`entry` = 15385); From dda3177d3db26d87713fb8094fe8f2b5e3b7d804 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 7 Aug 2022 18:58:13 +0200 Subject: [PATCH 090/161] fix(Scripts/RuinsOfAhnQiraj): Increased aggro range for Kurinnaxx. (#12646) --- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index 34619337a..199ab9b9a 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -47,6 +47,12 @@ struct boss_kurinnaxx : public BossAI { boss_kurinnaxx(Creature* creature) : BossAI(creature, DATA_KURINNAXX) {} + void InitializeAI() override + { + me->m_CombatDistance = 50.0f; + Reset(); + } + void Reset() override { BossAI::Reset(); From 2a0737b5571c6412e03f7f73a32335e9524f9e44 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 7 Aug 2022 19:00:00 +0200 Subject: [PATCH 091/161] fix(Core/SmartScripts): Fixed `SMART_TARGET_OWNER_OR_SUMMONER` target. (#12644) --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 09fbc1d6d..61db4f067 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3187,6 +3187,10 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e, { targets.push_back(owner); } + else if (me->IsSummon() && me->ToTempSummon()->GetSummonerUnit()) + { + targets.push_back(me->ToTempSummon()->GetSummonerUnit()); + } } else if (go) { From 1ffa0f6bdcd1e6a19b2a444007a43ca92df8724f Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Sun, 7 Aug 2022 13:43:11 -0400 Subject: [PATCH 092/161] chore(Core/DBCEnums): Define SummonPropGroup/Flags enums (#12648) --- src/server/shared/DataStores/DBCEnums.h | 44 ++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/server/shared/DataStores/DBCEnums.h b/src/server/shared/DataStores/DBCEnums.h index e5a1c7008..4b6e31204 100644 --- a/src/server/shared/DataStores/DBCEnums.h +++ b/src/server/shared/DataStores/DBCEnums.h @@ -415,33 +415,33 @@ enum TotemCategoryType // SummonProperties.dbc, col 1 enum SummonPropGroup { - SUMMON_PROP_GROUP_UNKNOWN1 = 0, // 1160 spells in 3.0.3 - SUMMON_PROP_GROUP_UNKNOWN2 = 1, // 861 spells in 3.0.3 - SUMMON_PROP_GROUP_PETS = 2, // 52 spells in 3.0.3, pets mostly - SUMMON_PROP_GROUP_CONTROLLABLE = 3, // 13 spells in 3.0.3, mostly controllable - SUMMON_PROP_GROUP_UNKNOWN3 = 4 // 86 spells in 3.0.3, taxi/mounts + SUMMON_PROP_GROUP_NONE = 0, // 1160 spells in 3.0.3 + SUMMON_PROP_GROUP_GUARDIAN = 1, // 861 spells in 3.0.3 TODO: Needs implementation + SUMMON_PROP_GROUP_PETS = 2, // 52 spells in 3.0.3, pets mostly TODO: Needs implementation + SUMMON_PROP_GROUP_CONTROLLABLE = 3, // 13 spells in 3.0.3, mostly controllable TODO: Needs implementation + SUMMON_PROP_GROUP_VEHICLE = 4 // 86 spells in 3.0.3, taxi/mounts TODO: Needs implementation }; // SummonProperties.dbc, col 5 enum SummonPropFlags { - SUMMON_PROP_FLAG_NONE = 0x00000000, // 1342 spells in 3.0.3 - SUMMON_PROP_FLAG_UNK1 = 0x00000001, // 75 spells in 3.0.3, something unfriendly - SUMMON_PROP_FLAG_UNK2 = 0x00000002, // 616 spells in 3.0.3, something friendly - SUMMON_PROP_FLAG_UNK3 = 0x00000004, // 22 spells in 3.0.3, no idea... - SUMMON_PROP_FLAG_DESPAWN_ON_SUMMONER_DEATH = 0x00000008, // 49 spells in 3.0.3, some mounts - SUMMON_PROP_FLAG_PERSONAL_SPAWN = 0x00000010, // 25 spells in 3.0.3, quest related? - SUMMON_PROP_FLAG_UNK6 = 0x00000020, // 0 spells in 3.3.5, unused - SUMMON_PROP_FLAG_UNK7 = 0x00000040, // 12 spells in 3.0.3, no idea - SUMMON_PROP_FLAG_UNK8 = 0x00000080, // 4 spells in 3.0.3, no idea - SUMMON_PROP_FLAG_UNK9 = 0x00000100, // 51 spells in 3.0.3, no idea, many quest related - SUMMON_PROP_FLAG_UNK10 = 0x00000200, // 51 spells in 3.0.3, something defensive - SUMMON_PROP_FLAG_UNK11 = 0x00000400, // 3 spells, requires something near? - SUMMON_PROP_FLAG_UNK12 = 0x00000800, // 30 spells in 3.0.3, no idea - SUMMON_PROP_FLAG_UNK13 = 0x00001000, // Lightwell, Jeeves, Gnomish Alarm-o-bot, Build vehicles(wintergrasp) - SUMMON_PROP_FLAG_UNK14 = 0x00002000, // Guides, player follows - SUMMON_PROP_FLAG_UNK15 = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental - SUMMON_PROP_FLAG_UNK16 = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? + SUMMON_PROP_FLAG_NONE = 0x00000000, // 1342 spells in 3.0.3 + SUMMON_PROP_FLAG_ATTACK_SUMMONER = 0x00000001, // 75 spells in 3.0.3, something unfriendly TODO: Needs implementation + SUMMON_PROP_FLAG_ASSIST_COMBAT_SUMMON = 0x00000002, // 616 spells in 3.0.3, something friendly TODO: Needs implementation + SUMMON_PROP_FLAG_USE_LEVEL_OFFSET = 0x00000004, // 22 spells in 3.0.3, no idea... TODO: Needs implementation + SUMMON_PROP_FLAG_DESPAWN_ON_SUMMONER_DEATH = 0x00000008, // 49 spells in 3.0.3, some mounts TODO: Needs implementation + SUMMON_PROP_FLAG_ONLY_VISIBLE_TO_SUMMONER = 0x00000010, // 25 spells in 3.0.3, quest related? TODO: Needs implementation + SUMMON_PROP_FLAG_CANNOT_DISMISS_PET = 0x00000020, // 0 spells in 3.3.5, unused TODO: Needs implementation + SUMMON_PROP_FLAG_USE_DEMON_TIMEOUT = 0x00000040, // 12 spells in 3.0.3, no idea TODO: Needs implementation + SUMMON_PROP_FLAG_UNLIMITED_SUMMONS = 0x00000080, // 4 spells in 3.0.3, no idea TODO: Needs implementation + SUMMON_PROP_FLAG_USE_CREATURE_LEVEL = 0x00000100, // 51 spells in 3.0.3, no idea, many quest related TODO: Needs implementation + SUMMON_PROP_FLAG_JOIN_SUMMONER_SPAWN_GROUP = 0x00000200, // 51 spells in 3.0.3, something defensive TODO: Needs implementation + SUMMON_PROP_FLAG_DO_NOT_TOGGLE = 0x00000400, // 3 spells, requires something near? TODO: Needs implementation + SUMMON_PROP_FLAG_DESPAWN_WHEN_EXPIRED = 0x00000800, // 30 spells in 3.0.3, no idea TODO: Needs implementation + SUMMON_PROP_FLAG_USE_SUMMONER_FACTION = 0x00001000, // Lightwell, Jeeves, Gnomish Alarm-o-bot, Build vehicles(wintergrasp) TODO: Needs implementation + SUMMON_PROP_FLAG_DO_NOT_FOLLOW_MOUNTED_SUMMONER = 0x00002000, // Guides, player follows TODO: Needs implementation + SUMMON_PROP_FLAG_SAVE_PET_AUTOCAST = 0x00004000, // Force of Nature, Shadowfiend, Feral Spirit, Summon Water Elemental TODO: Needs implementation + SUMMON_PROP_FLAG_IGNORE_SUMMONER_PHASE = 0x00008000, // Light/Dark Bullet, Soul/Fiery Consumption, Twisted Visage, Twilight Whelp. Phase related? TODO: Needs implementation }; enum VehicleSeatFlags From e321d7766916edeca45021da8392c1beec709e82 Mon Sep 17 00:00:00 2001 From: Walter Pagani Date: Sun, 7 Aug 2022 14:44:55 -0300 Subject: [PATCH 093/161] fix(DB/Translations): City guard gossips (#12436) --- .../pending_db_world/rev_1658221960996682200.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1658221960996682200.sql diff --git a/data/sql/updates/pending_db_world/rev_1658221960996682200.sql b/data/sql/updates/pending_db_world/rev_1658221960996682200.sql new file mode 100644 index 000000000..3d281a989 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1658221960996682200.sql @@ -0,0 +1,13 @@ +-- +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5316 WHERE `MenuID`=435 AND `OptionID`=0; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3428 WHERE `MenuID`=435 AND `OptionID`=6; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=9756 WHERE `MenuID`=435 AND `OptionID`=10; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10359 WHERE `MenuID`=435 AND `OptionID`=11; + +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `MenuID`=1951 AND `OptionID`=2; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=4895 WHERE `MenuID`=1951 AND `OptionID`=4; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5316 WHERE `MenuID`=1951 AND `OptionID`=5; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5518 WHERE `MenuID`=1951 AND `OptionID`=6; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7253 WHERE `MenuID`=1951 AND `OptionID`=7; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=9756 WHERE `MenuID`=1951 AND `OptionID`=9; +UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10359 WHERE `MenuID`=1951 AND `OptionID`=10; From 8a2629376420b5f47addea8cdf62866920ac707b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 17:46:52 +0000 Subject: [PATCH 094/161] chore(DB): import pending files Referenced commit(s): e321d7766916edeca45021da8392c1beec709e82 --- .../rev_1658221960996682200.sql => db_world/2022_08_07_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1658221960996682200.sql => db_world/2022_08_07_04.sql} (96%) diff --git a/data/sql/updates/pending_db_world/rev_1658221960996682200.sql b/data/sql/updates/db_world/2022_08_07_04.sql similarity index 96% rename from data/sql/updates/pending_db_world/rev_1658221960996682200.sql rename to data/sql/updates/db_world/2022_08_07_04.sql index 3d281a989..f1f84b3a0 100644 --- a/data/sql/updates/pending_db_world/rev_1658221960996682200.sql +++ b/data/sql/updates/db_world/2022_08_07_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_03 -> 2022_08_07_04 -- UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5316 WHERE `MenuID`=435 AND `OptionID`=0; UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3428 WHERE `MenuID`=435 AND `OptionID`=6; From d627e196492bda78a83601f35dc6830a17633738 Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Sun, 7 Aug 2022 19:52:01 +0200 Subject: [PATCH 095/161] fix(Core/BlackwingLair): add missing Nefarian Gate (#12608) --- .../pending_db_world/rev_1659484347526582712.sql | 8 ++++++++ .../BlackrockMountain/BlackwingLair/blackwing_lair.h | 6 ++++-- .../BlackwingLair/instance_blackwing_lair.cpp | 11 +++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659484347526582712.sql diff --git a/data/sql/updates/pending_db_world/rev_1659484347526582712.sql b/data/sql/updates/pending_db_world/rev_1659484347526582712.sql new file mode 100644 index 000000000..4c41267e2 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659484347526582712.sql @@ -0,0 +1,8 @@ +DELETE FROM `gameobject` WHERE `id` = 176966; +INSERT INTO `gameobject` (`id`, `map`, `zoneId`, `areaId`, + `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, + `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, + `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) +VALUES (176966, 469, 0, 0, 1, 1, -7488.1, -1150.7, 476.535, 3.73064, -0.0, + -0.0, -0.95694, 0.290285, 300, 0, 1, 'Nefarian\'s Gate', 0); +UPDATE `gameobject_template_addon` SET `flags` = `flags`|16 WHERE `entry` = 176966; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h index a0adcf52b..1313f4f3a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/blackwing_lair.h @@ -43,7 +43,8 @@ enum BWLEncounter DATA_NEFARIAN_TROOPS = 10, // Doors - DATA_GO_CHROMAGGUS_DOOR = 11 + DATA_GO_CHROMAGGUS_DOOR = 11, + DATA_GO_CHROMAGGUS_DOOR_EXIT= 12 }; enum BWLCreatureIds @@ -92,7 +93,8 @@ enum BWLGameObjectIds GO_PORTCULLIS_THREEDRAGONS = 179115, GO_CHROMAGGUS_LEVER = 179148, GO_PORTCULLIS_CHROMAGGUS = 179116, - GO_PORTCULLIS_NEFARIAN = 179117, + GO_PORTCULLIS_CHROMAGGUS_EXIT = 179117, + GO_PORTCULLIS_NEFARIAN = 176966, GO_SUPPRESSION_DEVICE = 179784 }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index a9d1299e6..586952047 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -35,8 +35,10 @@ DoorData const doorData[] = { GO_PORTCULLIS_RAZORGORE_ROOM, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_ROOM, }, // ID 176964 || GUID 75158 { GO_PORTCULLIS_VAELASTRASZ, DATA_VAELASTRAZ_THE_CORRUPT, DOOR_TYPE_PASSAGE }, // ID 175185 || GUID 7229 { GO_PORTCULLIS_BROODLORD, DATA_BROODLORD_LASHLAYER, DOOR_TYPE_PASSAGE }, // ID 179365 || GUID 75159 - { GO_PORTCULLIS_NEFARIAN, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179116 || GUID 75161 - { GO_PORTCULLIS_NEFARIAN, DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 179117 || GUID 75164 + { GO_PORTCULLIS_CHROMAGGUS, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179116 || GUID 75161 + { GO_PORTCULLIS_CHROMAGGUS_EXIT,DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179117 || GUID 75164 + { GO_PORTCULLIS_CHROMAGGUS_EXIT,DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 179117 || GUID 75164 + { GO_PORTCULLIS_NEFARIAN, DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 176966 { 0, 0, DOOR_TYPE_ROOM } // END }; @@ -45,12 +47,13 @@ ObjectData const creatureData[] = { NPC_GRETHOK, DATA_GRETHOK }, { NPC_NEFARIAN_TROOPS, DATA_NEFARIAN_TROOPS }, { NPC_VICTOR_NEFARIUS, DATA_LORD_VICTOR_NEFARIUS }, - { NPC_CHROMAGGUS, DATA_CHROMAGGUS } + { NPC_CHROMAGGUS, DATA_CHROMAGGUS }, }; ObjectData const objectData[] = { - { GO_PORTCULLIS_CHROMAGGUS, DATA_GO_CHROMAGGUS_DOOR } + { GO_PORTCULLIS_CHROMAGGUS, DATA_GO_CHROMAGGUS_DOOR }, + { GO_PORTCULLIS_CHROMAGGUS_EXIT, DATA_GO_CHROMAGGUS_DOOR_EXIT } }; Position const SummonPosition[8] = From a9b71f22af5591d1f6d3eace55359d4c828c8ab4 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 17:53:58 +0000 Subject: [PATCH 096/161] chore(DB): import pending files Referenced commit(s): d627e196492bda78a83601f35dc6830a17633738 --- .../rev_1659484347526582712.sql => db_world/2022_08_07_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659484347526582712.sql => db_world/2022_08_07_05.sql} (92%) diff --git a/data/sql/updates/pending_db_world/rev_1659484347526582712.sql b/data/sql/updates/db_world/2022_08_07_05.sql similarity index 92% rename from data/sql/updates/pending_db_world/rev_1659484347526582712.sql rename to data/sql/updates/db_world/2022_08_07_05.sql index 4c41267e2..31e045afa 100644 --- a/data/sql/updates/pending_db_world/rev_1659484347526582712.sql +++ b/data/sql/updates/db_world/2022_08_07_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_04 -> 2022_08_07_05 DELETE FROM `gameobject` WHERE `id` = 176966; INSERT INTO `gameobject` (`id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, From 8841d3a0df9195256120dd6657d8fbd5214dd042 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Sun, 7 Aug 2022 16:48:17 -0300 Subject: [PATCH 097/161] fix(DB): Remove scriptname wrongly assigned (#12660) --- data/sql/updates/db_world/2022_08_07_05.sql | 5 +++-- .../sql/updates/pending_db_world/rev_1659895072162193400.sql | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659895072162193400.sql diff --git a/data/sql/updates/db_world/2022_08_07_05.sql b/data/sql/updates/db_world/2022_08_07_05.sql index 31e045afa..b4f866e56 100644 --- a/data/sql/updates/db_world/2022_08_07_05.sql +++ b/data/sql/updates/db_world/2022_08_07_05.sql @@ -1,9 +1,10 @@ -- DB update 2022_08_07_04 -> 2022_08_07_05 DELETE FROM `gameobject` WHERE `id` = 176966; -INSERT INTO `gameobject` (`id`, `map`, `zoneId`, `areaId`, +DELETE FROM `gameobject` WHERE `guid` = 75160; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) -VALUES (176966, 469, 0, 0, 1, 1, -7488.1, -1150.7, 476.535, 3.73064, -0.0, +VALUES (75160, 176966, 469, 0, 0, 1, 1, -7488.1, -1150.7, 476.535, 3.73064, -0.0, -0.0, -0.95694, 0.290285, 300, 0, 1, 'Nefarian\'s Gate', 0); UPDATE `gameobject_template_addon` SET `flags` = `flags`|16 WHERE `entry` = 176966; diff --git a/data/sql/updates/pending_db_world/rev_1659895072162193400.sql b/data/sql/updates/pending_db_world/rev_1659895072162193400.sql new file mode 100644 index 000000000..c94bef57b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659895072162193400.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject` SET `ScriptName` = '' WHERE `id` = 176966; From 1470ba4658c920741e6e5dd1a798f94d24623ab6 Mon Sep 17 00:00:00 2001 From: Gultask <100873791+Gultask@users.noreply.github.com> Date: Sun, 7 Aug 2022 16:50:07 -0300 Subject: [PATCH 098/161] fix(DB/Creature): remove skinning loot from several creatures (#12627) --- .../pending_db_world/rev_1659629437144429900.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659629437144429900.sql diff --git a/data/sql/updates/pending_db_world/rev_1659629437144429900.sql b/data/sql/updates/pending_db_world/rev_1659629437144429900.sql new file mode 100644 index 000000000..b035ec9f2 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659629437144429900.sql @@ -0,0 +1,11 @@ +-- +UPDATE `creature_template` SET `lootid` = 0, `skinloot` = 0, `mingold` = 0, `maxgold` = 0 WHERE (`entry` = 11374); +DELETE FROM `creature_loot_template` WHERE `entry` = 11374; + +UPDATE `creature_template` SET `skinloot` = 0 WHERE (`entry` = 10596); + +UPDATE `creature_template` SET `lootid` = 0, `skinloot` = 0 WHERE (`entry` = 15101); +DELETE FROM `creature_loot_template` WHERE `entry` = 15101; + +UPDATE `creature_template` SET `lootid` = 0, `skinloot` = 0 WHERE (`entry` = 15068); +DELETE FROM `creature_loot_template` WHERE `entry` = 15068; From 49eb94c93d1126a57fb9d2922bdf8dba98675f01 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 19:52:12 +0000 Subject: [PATCH 099/161] chore(DB): import pending files Referenced commit(s): 1470ba4658c920741e6e5dd1a798f94d24623ab6 --- .../rev_1659629437144429900.sql => db_world/2022_08_07_06.sql} | 1 + .../rev_1659895072162193400.sql => db_world/2022_08_07_07.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1659629437144429900.sql => db_world/2022_08_07_06.sql} (92%) rename data/sql/updates/{pending_db_world/rev_1659895072162193400.sql => db_world/2022_08_07_07.sql} (60%) diff --git a/data/sql/updates/pending_db_world/rev_1659629437144429900.sql b/data/sql/updates/db_world/2022_08_07_06.sql similarity index 92% rename from data/sql/updates/pending_db_world/rev_1659629437144429900.sql rename to data/sql/updates/db_world/2022_08_07_06.sql index b035ec9f2..6b01fd86c 100644 --- a/data/sql/updates/pending_db_world/rev_1659629437144429900.sql +++ b/data/sql/updates/db_world/2022_08_07_06.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_05 -> 2022_08_07_06 -- UPDATE `creature_template` SET `lootid` = 0, `skinloot` = 0, `mingold` = 0, `maxgold` = 0 WHERE (`entry` = 11374); DELETE FROM `creature_loot_template` WHERE `entry` = 11374; diff --git a/data/sql/updates/pending_db_world/rev_1659895072162193400.sql b/data/sql/updates/db_world/2022_08_07_07.sql similarity index 60% rename from data/sql/updates/pending_db_world/rev_1659895072162193400.sql rename to data/sql/updates/db_world/2022_08_07_07.sql index c94bef57b..b3928f67a 100644 --- a/data/sql/updates/pending_db_world/rev_1659895072162193400.sql +++ b/data/sql/updates/db_world/2022_08_07_07.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_07_06 -> 2022_08_07_07 -- UPDATE `gameobject` SET `ScriptName` = '' WHERE `id` = 176966; From 1c6eab5856418d7461f9124cbde407fba4adc235 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 7 Aug 2022 23:22:12 +0200 Subject: [PATCH 100/161] fix(Core): Crashfix. (#12643) --- .../rev_1659776114435282400.sql | 5 +++++ .../Implementation/CharacterDatabase.cpp | 4 ++-- src/server/game/Entities/Player/Player.cpp | 13 +++---------- src/server/game/Entities/Player/Player.h | 6 +++--- .../game/Entities/Player/PlayerStorage.cpp | 18 +++--------------- .../WaypointMovementGenerator.cpp | 9 +-------- 6 files changed, 17 insertions(+), 38 deletions(-) create mode 100644 data/sql/updates/pending_db_characters/rev_1659776114435282400.sql diff --git a/data/sql/updates/pending_db_characters/rev_1659776114435282400.sql b/data/sql/updates/pending_db_characters/rev_1659776114435282400.sql new file mode 100644 index 000000000..0deb4ee8d --- /dev/null +++ b/data/sql/updates/pending_db_characters/rev_1659776114435282400.sql @@ -0,0 +1,5 @@ +-- +ALTER TABLE `character_entry_point` +ADD COLUMN `taxiPath0` INT UNSIGNED DEFAULT 0 NOT NULL AFTER `joinMapId`, +ADD COLUMN `taxiPath1` INT UNSIGNED DEFAULT 0 NOT NULL AFTER `taxiPath0`, +DROP COLUMN `taxiPath`; diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp index 314c37b17..dd44d437a 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp @@ -102,7 +102,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, " "item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC); - PrepareStatement(CHAR_SEL_CHARACTER_ENTRY_POINT, "SELECT joinX, joinY, joinZ, joinO, joinMapId, taxiPath, mountSpell FROM character_entry_point WHERE guid = ?", CONNECTION_ASYNC); + PrepareStatement(CHAR_SEL_CHARACTER_ENTRY_POINT, "SELECT joinX, joinY, joinZ, joinO, joinMapId, taxiPath0, taxiPath1, mountSpell FROM character_entry_point WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_GLYPHS, "SELECT talentGroup, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_TALENTS, "SELECT spell, specMask FROM character_talent WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC); @@ -286,7 +286,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_UPD_ARENA_TEAM_NAME, "UPDATE arena_team SET name = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC); // Character battleground data - PrepareStatement(CHAR_INS_PLAYER_ENTRY_POINT, "INSERT INTO character_entry_point (guid, joinX, joinY, joinZ, joinO, joinMapId, taxiPath, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(CHAR_INS_PLAYER_ENTRY_POINT, "INSERT INTO character_entry_point (guid, joinX, joinY, joinZ, joinO, joinMapId, taxiPath0, taxiPath1, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(CHAR_DEL_PLAYER_ENTRY_POINT, "DELETE FROM character_entry_point WHERE guid = ?", CONNECTION_ASYNC); // Character homebind diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 674e543e1..e6528091c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14248,16 +14248,9 @@ void Player::_SaveEntryPoint(CharacterDatabaseTransaction trans) stmt->SetData (3, m_entryPointData.joinPos.GetPositionZ()); stmt->SetData (4, m_entryPointData.joinPos.GetOrientation()); stmt->SetData(5, m_entryPointData.joinPos.GetMapId()); - - std::ostringstream ss(""); - if (m_entryPointData.HasTaxiPath()) - { - for (size_t i = 0; i < m_entryPointData.taxiPath.size(); ++i) - ss << m_entryPointData.taxiPath[i] << ' '; // xinef: segment is stored as last point - } - - stmt->SetData(6, ss.str()); - stmt->SetData(7, m_entryPointData.mountSpell); + stmt->SetData(6, m_entryPointData.taxiPath[0]); + stmt->SetData(7, m_entryPointData.taxiPath[1]); + stmt->SetData(8, m_entryPointData.mountSpell); trans->Append(stmt); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 6ff76d89c..8744b409e 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1035,11 +1035,11 @@ struct EntryPointData } uint32 mountSpell{0}; - std::vector taxiPath; + std::array taxiPath; WorldLocation joinPos; - void ClearTaxiPath() { taxiPath.clear(); } - [[nodiscard]] bool HasTaxiPath() const { return !taxiPath.empty(); } + void ClearTaxiPath() { taxiPath.fill(0); } + [[nodiscard]] bool HasTaxiPath() const { return taxiPath[0] && taxiPath[1]; } }; class Player : public Unit, public GridObject diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 7cf8c69df..1b615fe65 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -4894,21 +4894,9 @@ void Player::_LoadEntryPointData(PreparedQueryResult result) fields[2].Get(), // Z fields[3].Get()); // Orientation - std::string_view taxi = fields[5].Get(); - if (!taxi.empty()) - { - for (auto const& itr : Acore::Tokenize(taxi, ' ', false)) - { - uint32 node = Acore::StringTo(itr).value_or(0); - m_entryPointData.taxiPath.emplace_back(node); - } - - // Check integrity - if (m_entryPointData.taxiPath.size() < 3) - m_entryPointData.ClearTaxiPath(); - } - - m_entryPointData.mountSpell = fields[6].Get(); + m_entryPointData.taxiPath[0] = fields[5].Get(); + m_entryPointData.taxiPath[1] = fields[6].Get(); + m_entryPointData.mountSpell = fields[7].Get(); } bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, ObjectGuid::LowType guid) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 28bb2d426..bd57f449f 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -315,8 +315,6 @@ void FlightPathMovementGenerator::LoadPath(Player* player) bool passedPreviousSegmentProximityCheck = false; for (uint32 i = 0; i < nodes.size(); ++i) { - sMapMgr->CreateMap(nodes[i]->mapid, player)->SummonCreature(1, { nodes[i]->x, nodes[i]->y, nodes[i]->z, 0.0f })->SetLevel(i ? i : 1); - if (passedPreviousSegmentProximityCheck || !src || i_path.empty() || IsNodeIncludedInShortenedPath(i_path[i_path.size() - 1], nodes[i])) { if ((!src || (IsNodeIncludedInShortenedPath(start, nodes[i]) && i >= 2)) && @@ -349,7 +347,6 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) // remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack) player->ClearUnitState(UNIT_STATE_IN_FLIGHT); - uint32 taxiNodeId = player->m_taxi.GetTaxiDestination(); player->m_taxi.ClearTaxiDestinations(); player->Dismount(); player->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT); @@ -363,11 +360,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player) player->StopMoving(); // When the player reaches the last flight point, teleport to destination taxi node location - if (TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(taxiNodeId)) - { - player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ()); - player->TeleportTo(node->map_id, node->x, node->y, node->z, player->GetOrientation()); - } + player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ()); } player->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK); From 8987b8f0352c9594a23e795a0a24ea4509475c51 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 7 Aug 2022 21:24:09 +0000 Subject: [PATCH 101/161] chore(DB): import pending files Referenced commit(s): 1c6eab5856418d7461f9124cbde407fba4adc235 --- .../2022_08_07_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_characters/rev_1659776114435282400.sql => db_characters/2022_08_07_00.sql} (82%) diff --git a/data/sql/updates/pending_db_characters/rev_1659776114435282400.sql b/data/sql/updates/db_characters/2022_08_07_00.sql similarity index 82% rename from data/sql/updates/pending_db_characters/rev_1659776114435282400.sql rename to data/sql/updates/db_characters/2022_08_07_00.sql index 0deb4ee8d..343f886f9 100644 --- a/data/sql/updates/pending_db_characters/rev_1659776114435282400.sql +++ b/data/sql/updates/db_characters/2022_08_07_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_02_00 -> 2022_08_07_00 -- ALTER TABLE `character_entry_point` ADD COLUMN `taxiPath0` INT UNSIGNED DEFAULT 0 NOT NULL AFTER `joinMapId`, From c1257b362803c6ed15cef04ad05df93ce887393b Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 8 Aug 2022 14:12:02 -0300 Subject: [PATCH 102/161] fix(Scripts/Zul'Gurub): Prevent multiple spawns of Gazhranka (#12663) --- .../scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index f977c9591..d05d1696f 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -168,7 +168,7 @@ class spell_pagles_point_cast : public SpellScript { if (InstanceScript* instanceScript = caster->GetInstanceScript()) { - if (!instanceScript->GetData(DATA_GAHZRANKA)) + if (!instanceScript->GetData(DATA_GAHZRANKA) && !caster->FindNearestCreature(NPC_GAHZRANKA, 50.0f)) { caster->m_Events.AddEventAtOffset([caster]() { @@ -177,8 +177,11 @@ class spell_pagles_point_cast : public SpellScript lure->DespawnOrUnsummon(5s); caster->m_Events.AddEventAtOffset([caster]() { - 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); + if (!caster->FindNearestCreature(NPC_GAHZRANKA, 50.0f)) + { + 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); From 4165dc4195d0fe82717de444881294e18a9bf81d Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 8 Aug 2022 20:05:38 +0200 Subject: [PATCH 103/161] fix(Scripts/RuinsOfAhnQiraj): Sand Vortexes should move (#12655) Co-authored-by: Gultask --- .../rev_1659876286945722800.sql | 62 +++++++++++++++++++ .../RuinsOfAhnQiraj/boss_ossirian.cpp | 12 +--- .../instance_ruins_of_ahnqiraj.cpp | 30 +++++++++ 3 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659876286945722800.sql diff --git a/data/sql/updates/pending_db_world/rev_1659876286945722800.sql b/data/sql/updates/pending_db_world/rev_1659876286945722800.sql new file mode 100644 index 000000000..d49ccd290 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659876286945722800.sql @@ -0,0 +1,62 @@ +-- +-- Pathing for Sand Vortex Entry: 15428 +SET @NPC := 144680; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `wander_distance`=0,`MovementType`=2,`position_x`=-9524.06,`position_y`=1881.9224,`position_z`=85.64029 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`visibilityDistanceType`,`auras`) VALUES (@NPC,@PATH,0,0,1,0,0,25160); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-9467.716,1801.2075,85.68075,0,0,0,0,100,0), +(@PATH,2,-9433.638,1767.3511,85.68072,0,0,0,0,100,0), +(@PATH,3,-9400.586,1733.8876,85.68073,0,0,0,0,100,0), +(@PATH,4,-9366.376,1733.2712,85.65805,0,0,0,0,100,0), +(@PATH,5,-9333.135,1732.013,85.61758,0,0,0,0,100,0), +(@PATH,6,-9300.71,1733.3823,85.68074,0,0,0,0,100,0), +(@PATH,7,-9266.841,1766.4036,85.68074,0,0,0,0,100,0), +(@PATH,8,-9234.005,1800.0885,85.68074,0,0,0,0,100,0), +(@PATH,9,-9200.683,1833.4056,85.68073,0,0,0,0,100,0), +(@PATH,10,-9168.018,1866.673,86.23005,0,0,0,0,100,0), +(@PATH,11,-9171.645,1901.1793,85.68071,0,0,0,0,100,0), +(@PATH,12,-9173.781,1933.2633,85.68071,0,0,0,0,100,0), +(@PATH,13,-9195.187,1966.727,86.19511,0,0,0,0,100,0), +(@PATH,14,-9220.778,1999.9199,85.68075,0,0,0,0,100,0), +(@PATH,15,-9256.546,2032.9481,86.04485,0,0,0,0,100,0), +(@PATH,16,-9289.013,2066.2517,87.10255,0,0,0,0,100,0), +(@PATH,17,-9333.082,2071.4539,85.99686,0,0,0,0,100,0), +(@PATH,18,-9366.466,2075.198,86.651405,0,0,0,0,100,0), +(@PATH,19,-9399.833,2040.6716,86.5944,0,0,0,0,100,0), +(@PATH,20,-9432.466,2006.033,85.930725,0,0,0,0,100,0), +(@PATH,21,-9466.139,1975.4115,85.92978,0,0,0,0,100,0), +(@PATH,22,-9499.492,1940.9631,85.67978,0,0,0,0,100,0), +(@PATH,23,-9525.446,1900.1099,85.680725,0,0,0,0,100,0), +(@PATH,24,-9519.793,1870.9224,85.68071,0,0,0,0,100,0), +(@PATH,25,-9499.598,1833.6816,85.68074,0,0,0,0,100,0); + +-- Pathing for Sand Vortex Entry: 15428 +SET @NPC := 144679; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `wander_distance`=0,`MovementType`=2,`position_x`=-9228.479,`position_y`=1925.3331,`position_z`=85.64147 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`visibilityDistanceType`,`auras`) VALUES (@NPC,@PATH,0,0,1,0,0,25160); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-9267.194,1866.0243,85.597404,0,0,0,0,100,0), +(@PATH,2,-9299.206,1833.0114,85.52548,0,0,0,0,100,0), +(@PATH,3,-9333.244,1799.9004,83.67978,0,0,0,0,100,0), +(@PATH,4,-9366.875,1774.673,85.68073,0,0,0,0,100,0), +(@PATH,5,-9393.9375,1800.2031,85.642654,0,0,0,0,100,0), +(@PATH,6,-9399.323,1833.3334,85.68074,0,0,0,0,100,0), +(@PATH,7,-9425.436,1859.5237,85.63606,0,0,0,0,100,0), +(@PATH,8,-9461.292,1861.6554,85.68074,0,0,0,0,100,0), +(@PATH,9,-9466.752,1899.8247,85.68074,0,0,0,0,100,0), +(@PATH,10,-9432.557,1932.738,84.57658,0,0,0,0,100,0), +(@PATH,11,-9400.856,1965.8516,86.60922,0,0,0,0,100,0), +(@PATH,12,-9369.419,2000.3989,85.680725,0,0,0,0,100,0), +(@PATH,13,-9332.606,2018.017,85.68073,0,0,0,0,100,0), +(@PATH,14,-9311.325,1999.8208,85.68074,0,0,0,0,100,0), +(@PATH,15,-9310.085,1969.1917,85.68074,0,0,0,0,100,0), +(@PATH,16,-9285.372,1947.293,85.68074,0,0,0,0,100,0), +(@PATH,17,-9255.054,1952.4874,85.68074,0,0,0,0,100,0), +(@PATH,18,-9225.013,1923.3672,85.68074,0,0,0,0,100,0), +(@PATH,19,-9233.319,1899.1927,85.68073,0,0,0,0,100,0); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 418b5c782..f77bfcabb 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -77,12 +77,9 @@ Position CrystalCoordinates[NUM_CRYSTALS] = { -9406.73f, 1863.13f, 85.5558f, 0.0f } }; -float roomRadius = 165.0f; -uint8 const NUM_TORNADOS = 2; uint8 const NUM_WEAKNESS = 5; uint32 const spellWeakness[NUM_WEAKNESS] = { SPELL_FIRE_WEAKNESS, SPELL_FROST_WEAKNESS, SPELL_NATURE_WEAKNESS, SPELL_ARCANE_WEAKNESS, SPELL_SHADOW_WEAKNESS }; -Position const RoomCenter = { -9343.041992f, 1923.278198f, 85.555984f, 0.0 }; struct boss_ossirian : public BossAI { @@ -142,14 +139,7 @@ struct boss_ossirian : public BossAI WorldPackets::Misc::Weather weather(WEATHER_STATE_HEAVY_SANDSTORM, 1.0f); map->SendToPlayers(weather.Write()); - for (uint8 i = 0; i < NUM_TORNADOS; ++i) - { - Position Point = me->GetRandomPoint(RoomCenter, roomRadius); - if (Creature* Tornado = me->GetMap()->SummonCreature(NPC_SAND_VORTEX, Point)) - { - Tornado->CastSpell(Tornado, SPELL_SAND_STORM, true); - } - } + SpawnNextCrystal(); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp index 535194429..c5ac1d205 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp @@ -97,6 +97,10 @@ public: case NPC_OSSIRIAN: _ossirianGUID = creature->GetGUID(); break; + case NPC_SAND_VORTEX: + _sandVortexes.push_back(creature->GetGUID()); + creature->SetVisible(false); + break; } } @@ -189,6 +193,31 @@ public: _paralyzedGUID = data; } + bool SetBossState(uint32 type, EncounterState state) override + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_OSSIRIAN: + { + for (ObjectGuid const& guid : _sandVortexes) + { + if (Creature* sandVortex = instance->GetCreature(guid)) + { + sandVortex->SetVisible(state == IN_PROGRESS); + } + } + break; + default: + break; + } + } + + return true; + } + ObjectGuid GetGuidData(uint32 type) const override { switch (type) @@ -304,6 +333,7 @@ public: ObjectGuid _buruGUID; ObjectGuid _ossirianGUID; ObjectGuid _paralyzedGUID; + GuidVector _sandVortexes; uint32 _rajaxWaveCounter; TaskScheduler _scheduler; }; From 5734630e7e3004d98b0c1a9165986ebe629238b8 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 8 Aug 2022 18:07:47 +0000 Subject: [PATCH 104/161] chore(DB): import pending files Referenced commit(s): 4165dc4195d0fe82717de444881294e18a9bf81d --- .../rev_1659876286945722800.sql => db_world/2022_08_08_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659876286945722800.sql => db_world/2022_08_08_00.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1659876286945722800.sql b/data/sql/updates/db_world/2022_08_08_00.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1659876286945722800.sql rename to data/sql/updates/db_world/2022_08_08_00.sql index d49ccd290..ee547efc9 100644 --- a/data/sql/updates/pending_db_world/rev_1659876286945722800.sql +++ b/data/sql/updates/db_world/2022_08_08_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_07_07 -> 2022_08_08_00 -- -- Pathing for Sand Vortex Entry: 15428 SET @NPC := 144680; From 031dfc4c5baec027157a99deeab4dc4ff078cb52 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Tue, 9 Aug 2022 08:25:57 -0300 Subject: [PATCH 105/161] fix(Core/Commands): Achievement checkall (#12649) --- .../scripts/Commands/cs_achievement.cpp | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp index 1fb43b2db..070ae2d4f 100644 --- a/src/server/scripts/Commands/cs_achievement.cpp +++ b/src/server/scripts/Commands/cs_achievement.cpp @@ -40,7 +40,7 @@ public: static ChatCommandTable achievementCommandTable = { { "add", HandleAchievementAddCommand, SEC_GAMEMASTER, Console::No }, - { "checkall", HandleAchievementCheckAllCommand, SEC_ADMINISTRATOR, Console::No } + { "checkall", HandleAchievementCheckAllCommand, SEC_ADMINISTRATOR, Console::Yes } }; static ChatCommandTable commandTable = { @@ -63,17 +63,33 @@ public: return true; } - static bool HandleAchievementCheckAllCommand(ChatHandler* handler) + static bool HandleAchievementCheckAllCommand(ChatHandler* handler, Optional player) { - Player* target = handler->getSelectedPlayer(); - if (!target) + if (!player) { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + player = PlayerIdentifier::FromTarget(handler); + } + + if (!player) + { + handler->SendSysMessage(LANG_PLAYER_NOT_FOUND); handler->SetSentErrorMessage(true); return false; } - target->CheckAllAchievementCriteria(); + if (player->IsConnected()) + { + if (Player* target = player->GetConnectedPlayer()) + target->CheckAllAchievementCriteria(); + } + else + { + auto* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); + stmt->SetData(0, uint16(AT_LOGIN_CHECK_ACHIEVS)); + stmt->SetData(1, player->GetGUID().GetCounter()); + CharacterDatabase.Execute(stmt); + } + return true; } }; From e476533e6eb2347924940d8347f0edc2db81832f Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 9 Aug 2022 12:57:49 -0300 Subject: [PATCH 106/161] chore(Core/GameObject): Clear an error that often doesn't mean anything (#12689) * chore(Core/GameObject): Clear an error that often doesn't mean anything * drop it to debug --- src/server/game/Entities/GameObject/GameObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 2a75ff688..65dbaadd1 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -131,7 +131,7 @@ void GameObject::RemoveFromOwner() return; } - LOG_FATAL("entities.gameobject", "Delete GameObject ({} Entry: {} SpellId {} LinkedGO {}) that lost references to owner {} GO list. Crash possible later.", + LOG_DEBUG("entities.gameobject", "Delete GameObject ({} Entry: {} SpellId {} LinkedGO {}) that lost references to owner {} GO list.", GetGUID().ToString(), GetGOInfo()->entry, m_spellId, GetGOInfo()->GetLinkedGameObjectEntry(), ownerGUID.ToString()); SetOwnerGUID(ObjectGuid::Empty); From 5fe01e2d19916f87f957a77b1ee68c2074e5807f Mon Sep 17 00:00:00 2001 From: M'Dic Date: Tue, 9 Aug 2022 14:27:09 -0400 Subject: [PATCH 107/161] update (core): Additional anticheat helper (#12692) update (core): Addition anticheat helper --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 904d051f9..0717511cc 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1913,6 +1913,10 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo case FORM_FLIGHT: case FORM_MOONKIN: { + if (Player* player = target->ToPlayer()) + { + player->SetCanTeleport(true); + } // remove movement affects target->RemoveAurasByShapeShift(); From 32c68abf26c1f472d066bf57847c4a77e1dbbf86 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 9 Aug 2022 17:26:27 -0300 Subject: [PATCH 108/161] =?UTF-8?q?fix(Scripts/RuinsOfAhnQiraj):=20Use=20p?= =?UTF-8?q?roper=20spells=20to=20spawn=20Ayamiss=20larv=E2=80=A6=20(#12665?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/RuinsOfAhnQiraj): Use proper spells to spawn Ayamiss larvaes and correct landing behavior * fix ayamiss landing and evade * larvae spells * Update boss_ayamiss.cpp * Update boss_ayamiss.cpp * fix: spawn wasps up in the air * ctm --- .../rev_1659979597195874200.sql | 20 ++++ .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 99 ++++++++++--------- 2 files changed, 73 insertions(+), 46 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659979597195874200.sql diff --git a/data/sql/updates/pending_db_world/rev_1659979597195874200.sql b/data/sql/updates/pending_db_world/rev_1659979597195874200.sql new file mode 100644 index 000000000..1a22cdd9b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659979597195874200.sql @@ -0,0 +1,20 @@ +-- +SET @NPC := 15369; +SET @PATH := @NPC * 10; +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-9689.981,1548.2961,33.27733,0,0,0,0,100,0), +(@PATH,2,-9682.716,1554.252,31.416214,0,0,0,0,100,0), +(@PATH,3,-9677.917,1558.839,27.249535,0,0,0,0,100,0); + +-- Summon HiveZara larvae +UPDATE `spell_dbc` SET `Effect_1` = 28, `EffectMiscValueB_1` = 64, `EffectBasePoints_1` = 1, `EffectDieSides_1` = 0 WHERE `ID` IN (26538, 26539); + +DELETE FROM `spell_target_position` WHERE `ID` IN (26538, 26539); +INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES +(26538, 0, 509, -9678.29, 1526.39, 24.403833,0,0), +(26539, 0, 509, -9709, 1551.2, 23.988834, 0, 0); + +DELETE FROM `creature_template_movement` WHERE `CreatureId` = 15546; +INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES +(15546, 1, 0, 1, 0, 0, NULL); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 65022e721..37ed998c6 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -22,55 +22,56 @@ enum Spells { - SPELL_STINGER_SPRAY = 25749, - SPELL_POISON_STINGER = 25748, - SPELL_PARALYZE = 25725, - SPELL_FRENZY = 8269, - SPELL_LASH = 25852, - SPELL_FEED = 25721 + SPELL_STINGER_SPRAY = 25749, + SPELL_POISON_STINGER = 25748, + SPELL_PARALYZE = 25725, + SPELL_FRENZY = 8269, + SPELL_LASH = 25852, + SPELL_FEED = 25721, + + // Server-side spells + SPELL_SUMMON_LARVA_A = 26538, + SPELL_SUMMON_LARVA_B = 26539, + SPELL_LARVA_AGGRO_EFFECT = 25724, // Unknown purpose + SPELL_LARVA_FEAR_EFFECT = 25726, // Unknown purpose }; enum Events { - EVENT_STINGER_SPRAY = 1, - EVENT_POISON_STINGER = 2, - EVENT_SUMMON_SWARMER = 3, - EVENT_SWARMER_ATTACK = 4, - EVENT_PARALYZE = 5, - EVENT_LASH = 6 + EVENT_STINGER_SPRAY = 1, + EVENT_POISON_STINGER = 2, + EVENT_SUMMON_SWARMER = 3, + EVENT_SWARMER_ATTACK = 4, + EVENT_PARALYZE = 5, + EVENT_LASH = 6 }; enum Emotes { - EMOTE_FRENZY = 0 + EMOTE_FRENZY = 0 }; enum Phases { - PHASE_AIR = 0, - PHASE_GROUND = 1 + PHASE_AIR = 0, + PHASE_GROUND = 1 }; enum Points { - POINT_AIR = 0, - POINT_GROUND = 1, - POINT_PARALYZE = 2 + POINT_AIR = 0, + POINT_GROUND = 2, + POINT_PARALYZE = 2 }; const Position AyamissAirPos = { -9689.292f, 1547.912f, 48.02729f, 0.0f }; const Position AltarPos = { -9717.18f, 1517.72f, 27.4677f, 0.0f }; /// @todo These below are probably incorrect, taken from SD2 const Position SwarmerPos = { -9647.352f, 1578.062f, 55.32f, 0.0f }; -const Position LarvaPos[2] = -{ - { -9674.4707f, 1528.4133f, 22.457f, 0.0f }, - { -9701.6005f, 1566.9993f, 24.118f, 0.0f } -}; struct boss_ayamiss : public BossAI { - boss_ayamiss(Creature* creature) : BossAI(creature, DATA_AYAMISS) {} + boss_ayamiss(Creature* creature) : BossAI(creature, DATA_AYAMISS) { homePos = creature->GetHomePosition(); } void Reset() override { @@ -103,23 +104,28 @@ struct boss_ayamiss : public BossAI void MovementInform(uint32 type, uint32 id) override { - if (type == POINT_MOTION_TYPE) + if (type == POINT_MOTION_TYPE && id == POINT_AIR) { - switch (id) + me->AddUnitState(UNIT_STATE_ROOT); + } + else if (type == WAYPOINT_MOTION_TYPE && id == POINT_GROUND) + { + SetCombatMovement(true); + me->m_Events.AddEventAtOffset([this]() { - case POINT_AIR: - me->AddUnitState(UNIT_STATE_ROOT); - break; - case POINT_GROUND: + if (me->GetVictim()) + { me->GetMotionMaster()->MoveChase(me->GetVictim()); - break; - } + } + + }, 1s); } } void EnterEvadeMode(EvadeReason why) override { me->ClearUnitState(UNIT_STATE_ROOT); + me->SetHomePosition(homePos); BossAI::EnterEvadeMode(why); } @@ -136,25 +142,21 @@ struct boss_ayamiss : public BossAI me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos); } - void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override { - if (_phase == PHASE_AIR && me->GetHealthPct() < 70.0f) + if (_phase == PHASE_AIR && me->HealthBelowPctDamaged(70, damage)) { _phase = PHASE_GROUND; - SetCombatMovement(true); me->ClearUnitState(UNIT_STATE_ROOT); me->SetCanFly(false); me->SetDisableGravity(false); - if (Unit* victim = me->GetVictim()) - { - Position victimPos = victim->GetPosition(); - me->GetMotionMaster()->MovePoint(POINT_GROUND, victimPos); - } + me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); events.ScheduleEvent(EVENT_LASH, 5s, 8s); events.CancelEvent(EVENT_POISON_STINGER); DoResetThreat(); } - if (!_enraged && me->GetHealthPct() < 20.0f) + + if (!_enraged && me->HealthBelowPctDamaged(20, damage)) { DoCastSelf(SPELL_FRENZY); Talk(EMOTE_FRENZY); @@ -183,10 +185,9 @@ struct boss_ayamiss : public BossAI case EVENT_PARALYZE: if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true)) { - DoCast(target, SPELL_PARALYZE); + DoCast(target, SPELL_PARALYZE, true); instance->SetGuidData(DATA_PARALYZED, target->GetGUID()); - uint8 index = urand(0, 1); - me->SummonCreature(NPC_LARVA, LarvaPos[index], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + DoCastAOE(RAND(SPELL_SUMMON_LARVA_A, SPELL_SUMMON_LARVA_B), true); } events.ScheduleEvent(EVENT_PARALYZE, 15s); break; @@ -206,8 +207,13 @@ struct boss_ayamiss : public BossAI break; case EVENT_SUMMON_SWARMER: { - Position Pos = me->GetRandomPoint(SwarmerPos, 80.0f); - me->SummonCreature(NPC_SWARMER, Pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + Position spawnpos = me->GetRandomPoint(SwarmerPos, 80.0f); + spawnpos.RelocateOffset(offset); + if (Creature* wasp = me->SummonCreature(NPC_SWARMER, spawnpos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) + { + wasp->GetMotionMaster()->MoveRandom(10.0f); + } events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s); break; } @@ -223,6 +229,7 @@ private: GuidList _swarmers; uint8 _phase; bool _enraged; + Position homePos; }; struct npc_hive_zara_larva : public ScriptedAI From 8986421c712e90130456c347b03d4c759d457a49 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 9 Aug 2022 20:28:40 +0000 Subject: [PATCH 109/161] chore(DB): import pending files Referenced commit(s): 32c68abf26c1f472d066bf57847c4a77e1dbbf86 --- .../rev_1659979597195874200.sql => db_world/2022_08_09_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659979597195874200.sql => db_world/2022_08_09_00.sql} (96%) diff --git a/data/sql/updates/pending_db_world/rev_1659979597195874200.sql b/data/sql/updates/db_world/2022_08_09_00.sql similarity index 96% rename from data/sql/updates/pending_db_world/rev_1659979597195874200.sql rename to data/sql/updates/db_world/2022_08_09_00.sql index 1a22cdd9b..14bda1883 100644 --- a/data/sql/updates/pending_db_world/rev_1659979597195874200.sql +++ b/data/sql/updates/db_world/2022_08_09_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_08_00 -> 2022_08_09_00 -- SET @NPC := 15369; SET @PATH := @NPC * 10; From f0afe611ff7e5aa5618a14e69c38563864e10118 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Wed, 10 Aug 2022 04:24:25 +0200 Subject: [PATCH 110/161] =?UTF-8?q?fix(Scripts/AhnQiraj):=20Anubisath=20Se?= =?UTF-8?q?ntinel=20and=20Anubisath=20Guardian=20shou=E2=80=A6=20(#12656)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/AhnQiraj): Anubisath Sentinel and Anubisath Guardian should spawn Small Obsidian Chunk on death. Fixes #12474 --- .../RuinsOfAhnQiraj/boss_ossirian.cpp | 28 +++++++++------- .../mob_anubisath_sentinel.cpp | 32 +++++++++++-------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index f77bfcabb..291f1b0a0 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -36,19 +36,20 @@ enum Texts enum Spells { - SPELL_CURSE_OF_TONGUES = 25195, - SPELL_ENVELOPING_WINDS = 25189, - SPELL_WAR_STOMP = 25188, - SPELL_STRENGHT_OF_OSSIRIAN = 25176, - SPELL_SAND_STORM = 25160, - SPELL_SUMMON_CRYSTAL = 25192, + SPELL_CURSE_OF_TONGUES = 25195, + SPELL_ENVELOPING_WINDS = 25189, + SPELL_WAR_STOMP = 25188, + SPELL_STRENGHT_OF_OSSIRIAN = 25176, + SPELL_SAND_STORM = 25160, + SPELL_SUMMON_CRYSTAL = 25192, + SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK = 27627, // Server-side // Crystal - SPELL_FIRE_WEAKNESS = 25177, - SPELL_FROST_WEAKNESS = 25178, - SPELL_NATURE_WEAKNESS = 25180, - SPELL_ARCANE_WEAKNESS = 25181, - SPELL_SHADOW_WEAKNESS = 25183 + SPELL_FIRE_WEAKNESS = 25177, + SPELL_FROST_WEAKNESS = 25178, + SPELL_NATURE_WEAKNESS = 25180, + SPELL_ARCANE_WEAKNESS = 25181, + SPELL_SHADOW_WEAKNESS = 25183 }; enum Actions @@ -347,6 +348,11 @@ struct npc_anubisath_guardian : public ScriptedAI } } + void JustDied(Unit* /*killer*/) override + { + DoCastSelf(SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK, true); + } + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index c2cb324f7..6db2ba06f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -34,25 +34,27 @@ EndScriptData */ enum Spells { - SPELL_MENDING_BUFF = 2147, + SPELL_MENDING_BUFF = 2147, - SPELL_KNOCK_BUFF = 21737, - SPELL_KNOCK = 25778, - SPELL_MANAB_BUFF = 812, - SPELL_MANAB = 25779, + SPELL_KNOCK_BUFF = 21737, + SPELL_KNOCK = 25778, + SPELL_MANAB_BUFF = 812, + SPELL_MANAB = 25779, - SPELL_REFLECTAF_BUFF = 13022, - SPELL_REFLECTSFr_BUFF = 19595, - SPELL_THORNS_BUFF = 25777, + SPELL_REFLECTAF_BUFF = 13022, + SPELL_REFLECTSFr_BUFF = 19595, + SPELL_THORNS_BUFF = 25777, - SPELL_THUNDER_BUFF = 2834, - SPELL_THUNDER = 8732, + SPELL_THUNDER_BUFF = 2834, + SPELL_THUNDER = 8732, - SPELL_MSTRIKE_BUFF = 9347, - SPELL_MSTRIKE = 24573, + SPELL_MSTRIKE_BUFF = 9347, + SPELL_MSTRIKE = 24573, - SPELL_STORM_BUFF = 2148, - SPELL_STORM = 26546 + SPELL_STORM_BUFF = 2148, + SPELL_STORM = 26546, + + SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK = 27627 // Server-side }; class npc_anubisath_sentinel : public CreatureScript @@ -273,6 +275,8 @@ public: sent->ModifyHealth(int32(sent->CountPctFromMaxHealth(50))); CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); } + + DoCastSelf(SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK, true); } }; }; From b1691e60b15f791f386d46afa49e9715f5503287 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Tue, 9 Aug 2022 23:24:54 -0300 Subject: [PATCH 111/161] fix(Core/RuinsOfAhnQiraj): Kurinnaxx thrash (#12680) fix(Core/RuinsOfAhnQiraj): Kurinaxx thrash --- .../pending_db_world/rev_1659982493488417100.sql | 2 ++ .../Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659982493488417100.sql diff --git a/data/sql/updates/pending_db_world/rev_1659982493488417100.sql b/data/sql/updates/pending_db_world/rev_1659982493488417100.sql new file mode 100644 index 000000000..eaac45402 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659982493488417100.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `creature_addon` WHERE `guid`=144632; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index 199ab9b9a..b0cf0c878 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -28,14 +28,16 @@ enum Spells SPELL_SAND_TRAP = 25648, SPELL_ENRAGE = 26527, SPELL_SUMMON_PLAYER = 26446, - SPELL_WIDE_SLASH = 25814 + SPELL_WIDE_SLASH = 25814, + SPELL_THRASH = 3391 }; enum Events { EVENT_MORTAL_WOUND = 1, EVENT_SAND_TRAP = 2, - EVENT_WIDE_SLASH = 3 + EVENT_WIDE_SLASH = 3, + EVENT_THRASH = 4 }; enum Texts @@ -60,6 +62,7 @@ struct boss_kurinnaxx : public BossAI events.ScheduleEvent(EVENT_MORTAL_WOUND, 8s, 10s); events.ScheduleEvent(EVENT_SAND_TRAP, 5s, 15s); events.ScheduleEvent(EVENT_WIDE_SLASH, 10s, 15s); + events.ScheduleEvent(EVENT_THRASH, 16s); } void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override @@ -114,6 +117,10 @@ struct boss_kurinnaxx : public BossAI DoCastSelf(SPELL_WIDE_SLASH); events.ScheduleEvent(EVENT_WIDE_SLASH, 12s, 15s); break; + case EVENT_THRASH: + DoCastSelf(SPELL_THRASH); + events.ScheduleEvent(EVENT_THRASH, 16s); + break; default: break; } From 1455be34baa198a57d5f5d60681a5756e3141c15 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Wed, 10 Aug 2022 04:26:05 +0200 Subject: [PATCH 112/161] =?UTF-8?q?fix(DB/SAI):Anubisath=20Defender=20shou?= =?UTF-8?q?ld=20spawn=20Large=20Obsidian=20Chunk=E2=80=A6=20(#12657)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(DB/AhnQiraj):Anubisath Defender should spawn Large Obsidian Chunk on death. Fixes #12475 --- data/sql/updates/pending_db_world/rev_1659882561747595900.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659882561747595900.sql diff --git a/data/sql/updates/pending_db_world/rev_1659882561747595900.sql b/data/sql/updates/pending_db_world/rev_1659882561747595900.sql new file mode 100644 index 000000000..cbe7a3cb5 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659882561747595900.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryorguid` = 15277 AND `id`=12; +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 +(15277, 0, 12, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 11, 27630, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Anubisath Defender - On Just Died - Cast \'Serverside - Drop Obsidian\''); From fb785f6ae2ae410942a2c9108155c28aa241e116 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Tue, 9 Aug 2022 23:27:06 -0300 Subject: [PATCH 113/161] fix(Core/TempleOfAhnQiraj): Rewrite Fankriss (#12652) * fix(Core/TempleOfAhnQiraj): Rewrite Fankriss * sneaky line * linked respawn --- .../rev_1659849272980985000.sql | 30 ++++ .../TempleOfAhnQiraj/boss_fankriss.cpp | 161 +++++++----------- .../TempleOfAhnQiraj/temple_of_ahnqiraj.h | 1 + 3 files changed, 96 insertions(+), 96 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659849272980985000.sql diff --git a/data/sql/updates/pending_db_world/rev_1659849272980985000.sql b/data/sql/updates/pending_db_world/rev_1659849272980985000.sql new file mode 100644 index 000000000..222de4294 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659849272980985000.sql @@ -0,0 +1,30 @@ +-- +DELETE FROM `spell_target_position` WHERE `ID` IN (720, 731, 1121, 518, 25831, 25832); +INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`) VALUES +(720, 0, 531, -8043.6, 1254.1, -84.3, 0), +(731, 0, 531, -8003, 1222.9, -82.1, 0), +(1121, 0, 531, -8022.3, 1149, -89.1, 0), +(518, 0, 531, -8028.5, 1050.9, -54, 0), +(25831, 0, 531, -8158.03, 1139.3, -83.95, 0), +(25832, 0, 531, -8029.25, 1237.78, -85.2285, 0); + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15630) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(15630, 0, 0, 0, 0, 0, 100, 3, 10000, 20000, 0, 0, 0, 11, 26662, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spawn of Fankriss - In Combat - Cast \'Berserk\' (No Repeat) (Normal Dungeon)'); + +DELETE FROM `creature_formations` WHERE `memberGUID` IN (87911, 87773, 87775, 87796, 87806, 87792); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(87911, 87911, 0, 0, 3, 0, 0), +(87911, 87773, 0, 0, 3, 0, 0), +(87911, 87775, 0, 0, 3, 0, 0), +(87911, 87796, 0, 0, 3, 0, 0), +(87911, 87806, 0, 0, 3, 0, 0), +(87911, 87792, 0, 0, 3, 0, 0); + +DELETE FROM `linked_respawn` WHERE `guid` IN (87773, 87775, 87796, 87806, 87792); +INSERT INTO `linked_respawn` (`guid`, `linkedGuid`, `linkType`) VALUES +(87773, 87911, 0), +(87775, 87911, 0), +(87796, 87911, 0), +(87806, 87911, 0), +(87792, 87911, 0); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index c35ddb6ea..d0ca30daa 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -15,128 +15,99 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Fankriss -SD%Complete: 100 -SDComment: sound not implemented -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "TaskScheduler.h" #include "temple_of_ahnqiraj.h" -#define SOUND_SENTENCE_YOU 8588 -#define SOUND_SERVE_TO 8589 -#define SOUND_LAWS 8590 -#define SOUND_TRESPASS 8591 -#define SOUND_WILL_BE 8592 - enum Spells { SPELL_MORTAL_WOUND = 25646, - SPELL_ROOT = 28858, + SPELL_ENTANGLE_RIGHT = 720, + SPELL_ENTANGLE_CENTER = 731, + SPELL_ENTANGLE_LEFT = 1121, - // Enrage for his spawns - SPELL_ENRAGE = 28798 + SPELL_SUMMON_WORM_1 = 518, + SPELL_SUMMON_WORM_2 = 25831, + SPELL_SUMMON_WORM_3 = 25832 }; -struct boss_fankriss : public ScriptedAI +enum Misc { - boss_fankriss(Creature* creature) : ScriptedAI(creature) { } + MAX_HATCHLING_SPAWN = 4, + NPC_VEKNISS_HATCHLING = 15962 +}; - void SummonSpawn() +const std::array hatchlingsSpawnPoints +{ { - Rand = 10 + (rand() % 10); - switch (rand() % 2) - { - case 0: - RandX = 0.0f - Rand; - break; - case 1: - RandX = 0.0f + Rand; - break; - } - - Rand = 10 + (rand() % 10); - switch (rand() % 2) - { - case 0: - RandY = 0.0f - Rand; - break; - case 1: - RandY = 0.0f + Rand; - break; - } - Rand = 0; - DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + { -8043.6f, 1254.1f, -84.3f }, // Right + { -8003.0f, 1222.9f, -82.1f }, // Center + { -8022.3f, 1149.0f, -89.1f } // Left } +}; - void EnterCombat(Unit* /*who*/) override +const std::array entangleSpells = { SPELL_ENTANGLE_RIGHT, SPELL_ENTANGLE_CENTER, SPELL_ENTANGLE_LEFT }; + +struct boss_fankriss : public BossAI +{ + boss_fankriss(Creature* creature) : BossAI(creature, DATA_FANKRISS) { } + + void Reset() override { _scheduler.CancelAll(); + summonWormSpells = { SPELL_SUMMON_WORM_1, SPELL_SUMMON_WORM_2, SPELL_SUMMON_WORM_3}; + + BossAI::Reset(); + } + + void SummonWorms() + { + uint32 amount = urand(1, 3); + Acore::Containers::RandomResize(summonWormSpells, amount); + for (uint32 summonSpell : summonWormSpells) + DoCastAOE(summonSpell, true); + summonWormSpells = { SPELL_SUMMON_WORM_1, SPELL_SUMMON_WORM_2, SPELL_SUMMON_WORM_3 }; + } + + void SummonHatchlingWaves() + { + for (Position spawnPos : hatchlingsSpawnPoints) + { + for (uint8 i = 0; i < MAX_HATCHLING_SPAWN; i++) + { + Position randSpawn = me->GetRandomPoint(spawnPos, 10.f); + me->SummonCreature(NPC_VEKNISS_HATCHLING, randSpawn, TEMPSUMMON_CORPSE_DESPAWN); + } + } + } + + void EnterCombat(Unit* who) override + { + _scheduler.CancelAll(); + BossAI::EnterCombat(who); _scheduler - .Schedule(4s, 8s, [this](TaskContext context) + .Schedule(7s, 14s, [this](TaskContext context) { DoCastVictim(SPELL_MORTAL_WOUND); context.Repeat(); }) - .Schedule(15s, 45s, [this](TaskContext context) + .Schedule(30s, 50s, [this](TaskContext context) { - switch (urand(0, 2)) - { - case 0: - SummonSpawn(); - break; - case 1: - SummonSpawn(); - SummonSpawn(); - break; - case 2: - SummonSpawn(); - SummonSpawn(); - SummonSpawn(); - break; - } - context.Repeat(30s, 60s); + SummonWorms(); + context.Repeat(22s, 70s); }) - .Schedule(15s, 45s, [this](TaskContext context) + .Schedule(15s, 20s, [this](TaskContext context) { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true)) { - DoCast(target, SPELL_ROOT); - - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - - switch (urand(0, 2)) - { - case 0: - DoTeleportPlayer(target, -8106.0142f, 1289.2900f, -74.419533f, 5.112f); - me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - break; - case 1: - DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f); - me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - break; - case 2: - DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f); - me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() + 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() - 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(15962, target->GetPositionX() - 5, target->GetPositionY() + 5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - break; - } + uint32 spellId = Acore::Containers::SelectRandomContainerElement(entangleSpells); + DoCast(target, spellId); } - context.Repeat(45s, 60s); + + SummonHatchlingWaves(); + context.Repeat(25s, 55s); }); } @@ -152,9 +123,7 @@ struct boss_fankriss : public ScriptedAI private: TaskScheduler _scheduler; - int Rand; - float RandX; - float RandY; + std::vector summonWormSpells; }; void AddSC_boss_fankriss() diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index 70215f2b1..bd8f239eb 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -35,6 +35,7 @@ enum DataTypes DATA_VEKNILASH = 9, DATA_VEKNILASHISDEAD = 10, DATA_VEKNILASH_DEATH = 11, + DATA_FANKRISS = 12, DATA_BUG_TRIO_DEATH = 14, DATA_CTHUN_PHASE = 20, DATA_VISCIDUS = 21, From a22ba935ef6b03cfb94278f7825961716762308a Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Wed, 10 Aug 2022 02:29:21 +0000 Subject: [PATCH 114/161] chore(DB): import pending files Referenced commit(s): fb785f6ae2ae410942a2c9108155c28aa241e116 --- .../rev_1659849272980985000.sql => db_world/2022_08_10_00.sql} | 1 + .../rev_1659882561747595900.sql => db_world/2022_08_10_01.sql} | 1 + .../rev_1659982493488417100.sql => db_world/2022_08_10_02.sql} | 1 + 3 files changed, 3 insertions(+) rename data/sql/updates/{pending_db_world/rev_1659849272980985000.sql => db_world/2022_08_10_00.sql} (97%) rename data/sql/updates/{pending_db_world/rev_1659882561747595900.sql => db_world/2022_08_10_01.sql} (94%) rename data/sql/updates/{pending_db_world/rev_1659982493488417100.sql => db_world/2022_08_10_02.sql} (54%) diff --git a/data/sql/updates/pending_db_world/rev_1659849272980985000.sql b/data/sql/updates/db_world/2022_08_10_00.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1659849272980985000.sql rename to data/sql/updates/db_world/2022_08_10_00.sql index 222de4294..b5bb80ff1 100644 --- a/data/sql/updates/pending_db_world/rev_1659849272980985000.sql +++ b/data/sql/updates/db_world/2022_08_10_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_09_00 -> 2022_08_10_00 -- DELETE FROM `spell_target_position` WHERE `ID` IN (720, 731, 1121, 518, 25831, 25832); INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1659882561747595900.sql b/data/sql/updates/db_world/2022_08_10_01.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1659882561747595900.sql rename to data/sql/updates/db_world/2022_08_10_01.sql index cbe7a3cb5..86ba73faa 100644 --- a/data/sql/updates/pending_db_world/rev_1659882561747595900.sql +++ b/data/sql/updates/db_world/2022_08_10_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_10_00 -> 2022_08_10_01 -- DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryorguid` = 15277 AND `id`=12; 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/rev_1659982493488417100.sql b/data/sql/updates/db_world/2022_08_10_02.sql similarity index 54% rename from data/sql/updates/pending_db_world/rev_1659982493488417100.sql rename to data/sql/updates/db_world/2022_08_10_02.sql index eaac45402..1acdf4320 100644 --- a/data/sql/updates/pending_db_world/rev_1659982493488417100.sql +++ b/data/sql/updates/db_world/2022_08_10_02.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_10_01 -> 2022_08_10_02 -- DELETE FROM `creature_addon` WHERE `guid`=144632; From f4adbebcc19527dff7fbd6d5a3f5d57e07123bbb Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 11 Aug 2022 13:20:01 -0300 Subject: [PATCH 115/161] fix(DB/Quest): fix Silithus Armament of War class condition (#12698) Co-authored-by: Killyana --- .../updates/pending_db_world/rev_1660216435302974300.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660216435302974300.sql diff --git a/data/sql/updates/pending_db_world/rev_1660216435302974300.sql b/data/sql/updates/pending_db_world/rev_1660216435302974300.sql new file mode 100644 index 000000000..01d785751 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660216435302974300.sql @@ -0,0 +1,9 @@ +-- +UPDATE `quest_template_addon` SET `AllowableClasses`=1 WHERE `id`=8316; +UPDATE `quest_template_addon` SET `AllowableClasses`=2 WHERE `id`=8376; +UPDATE `quest_template_addon` SET `AllowableClasses`=4 WHERE `id`=8377; +UPDATE `quest_template_addon` SET `AllowableClasses`=8 WHERE `id`=8378; +UPDATE `quest_template_addon` SET `AllowableClasses`=16 WHERE `id`=8379; +UPDATE `quest_template_addon` SET `AllowableClasses`=64 WHERE `id`=8380; +UPDATE `quest_template_addon` SET `AllowableClasses`=384 WHERE `id`=8381; +UPDATE `quest_template_addon` SET `AllowableClasses`=1024 WHERE `id`=8382; From 3fc0fa1082e07303189d0f2d9ccb754dfd8e1638 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Thu, 11 Aug 2022 16:22:30 +0000 Subject: [PATCH 116/161] chore(DB): import pending files Referenced commit(s): f4adbebcc19527dff7fbd6d5a3f5d57e07123bbb --- .../rev_1660216435302974300.sql => db_world/2022_08_11_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660216435302974300.sql => db_world/2022_08_11_00.sql} (93%) diff --git a/data/sql/updates/pending_db_world/rev_1660216435302974300.sql b/data/sql/updates/db_world/2022_08_11_00.sql similarity index 93% rename from data/sql/updates/pending_db_world/rev_1660216435302974300.sql rename to data/sql/updates/db_world/2022_08_11_00.sql index 01d785751..2b3b04e9a 100644 --- a/data/sql/updates/pending_db_world/rev_1660216435302974300.sql +++ b/data/sql/updates/db_world/2022_08_11_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_10_02 -> 2022_08_11_00 -- UPDATE `quest_template_addon` SET `AllowableClasses`=1 WHERE `id`=8316; UPDATE `quest_template_addon` SET `AllowableClasses`=2 WHERE `id`=8376; From 896ab722177004f60c1221d8e035d702477af69c Mon Sep 17 00:00:00 2001 From: xadow <72521329+xadowtek@users.noreply.github.com> Date: Fri, 12 Aug 2022 17:19:16 +0200 Subject: [PATCH 117/161] fix(DB/Quest): The Sun Gate (#12685) --- data/sql/updates/pending_db_world/q9740_fix_20220809.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/q9740_fix_20220809.sql diff --git a/data/sql/updates/pending_db_world/q9740_fix_20220809.sql b/data/sql/updates/pending_db_world/q9740_fix_20220809.sql new file mode 100644 index 000000000..863a5d314 --- /dev/null +++ b/data/sql/updates/pending_db_world/q9740_fix_20220809.sql @@ -0,0 +1,2 @@ + +UPDATE `conditions` SET `ConditionValue3` = 0 WHERE `SourceTypeOrReferenceId` = 22 AND `SourceGroup` = 2 AND `SourceEntry` = 182026; From 244dca66609beaba1fbcf66fc607e53572fe8d52 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Fri, 12 Aug 2022 15:22:16 +0000 Subject: [PATCH 118/161] chore(DB): import pending files Referenced commit(s): 896ab722177004f60c1221d8e035d702477af69c --- .../q9740_fix_20220809.sql => db_world/2022_08_12_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/q9740_fix_20220809.sql => db_world/2022_08_12_00.sql} (75%) diff --git a/data/sql/updates/pending_db_world/q9740_fix_20220809.sql b/data/sql/updates/db_world/2022_08_12_00.sql similarity index 75% rename from data/sql/updates/pending_db_world/q9740_fix_20220809.sql rename to data/sql/updates/db_world/2022_08_12_00.sql index 863a5d314..ba7b36701 100644 --- a/data/sql/updates/pending_db_world/q9740_fix_20220809.sql +++ b/data/sql/updates/db_world/2022_08_12_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_11_00 -> 2022_08_12_00 UPDATE `conditions` SET `ConditionValue3` = 0 WHERE `SourceTypeOrReferenceId` = 22 AND `SourceGroup` = 2 AND `SourceEntry` = 182026; From a8c4a16a00d49e818257d2248a5fe7e38a2d469a Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Fri, 12 Aug 2022 15:23:07 -0300 Subject: [PATCH 119/161] =?UTF-8?q?chore(Scripts/BlackwingLair):=20Another?= =?UTF-8?q?=20temporary=20solution=20to=20Chromaggu=E2=80=A6=20(#12664)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore(Scripts/BlackwingLair): Another temporary solution to Chromaggus being pulled through the floor --- .../BlackrockMountain/BlackwingLair/boss_chromaggus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp index 9da7d418a..e01a22aab 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp @@ -85,7 +85,7 @@ public: Acore::Containers::RandomResize(_breathSpells, 2); // Hack fix: This is here to prevent him from being pulled from the floor underneath, remove it once maps are fixed. - creature->SetReactState(REACT_PASSIVE); + creature->SetImmuneToAll(true); } void Initialize() @@ -122,7 +122,7 @@ public: { _playerGUID = guid; // Hack fix: This is here to prevent him from being pulled from the floor underneath, remove it once maps are fixed. - me->SetReactState(REACT_AGGRESSIVE); + me->SetImmuneToAll(false); } } From 7174e5b1cf165053681d921a18b72f938422cfef Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Fri, 12 Aug 2022 16:41:50 -0600 Subject: [PATCH 120/161] chore(scripts/RuinsOfAhnQiraj): cleanup ruins_of_ahnqiraj.h (#12622) --- .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 63 +++++++++---------- .../RuinsOfAhnQiraj/ruins_of_ahnqiraj.h | 3 - 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 37ed998c6..1f2e880db 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -22,52 +22,52 @@ enum Spells { - SPELL_STINGER_SPRAY = 25749, - SPELL_POISON_STINGER = 25748, - SPELL_PARALYZE = 25725, - SPELL_FRENZY = 8269, - SPELL_LASH = 25852, - SPELL_FEED = 25721, + SPELL_STINGER_SPRAY = 25749, + SPELL_POISON_STINGER = 25748, + SPELL_PARALYZE = 25725, + SPELL_FRENZY = 8269, + SPELL_LASH = 25852, + SPELL_FEED = 25721, // Server-side spells - SPELL_SUMMON_LARVA_A = 26538, - SPELL_SUMMON_LARVA_B = 26539, - SPELL_LARVA_AGGRO_EFFECT = 25724, // Unknown purpose - SPELL_LARVA_FEAR_EFFECT = 25726, // Unknown purpose + SPELL_SUMMON_LARVA_A = 26538, + SPELL_SUMMON_LARVA_B = 26539, + SPELL_LARVA_AGGRO_EFFECT = 25724, // Unknown purpose + SPELL_LARVA_FEAR_EFFECT = 25726, // Unknown purpose }; enum Events { - EVENT_STINGER_SPRAY = 1, - EVENT_POISON_STINGER = 2, - EVENT_SUMMON_SWARMER = 3, - EVENT_SWARMER_ATTACK = 4, - EVENT_PARALYZE = 5, - EVENT_LASH = 6 + EVENT_STINGER_SPRAY = 1, + EVENT_POISON_STINGER = 2, + EVENT_SUMMON_SWARMER = 3, + EVENT_SWARMER_ATTACK = 4, + EVENT_PARALYZE = 5, + EVENT_LASH = 6 }; enum Emotes { - EMOTE_FRENZY = 0 + EMOTE_FRENZY = 0 }; enum Phases { - PHASE_AIR = 0, - PHASE_GROUND = 1 + PHASE_AIR = 0, + PHASE_GROUND = 1 }; enum Points { - POINT_AIR = 0, - POINT_GROUND = 2, - POINT_PARALYZE = 2 + POINT_AIR = 0, + POINT_GROUND = 2, + POINT_PARALYZE = 2 }; -const Position AyamissAirPos = { -9689.292f, 1547.912f, 48.02729f, 0.0f }; -const Position AltarPos = { -9717.18f, 1517.72f, 27.4677f, 0.0f }; +const Position AyamissAirPos = { -9689.292f, 1547.912f, 48.02729f, 0.0f }; +const Position AltarPos = { -9717.18f, 1517.72f, 27.4677f, 0.0f }; /// @todo These below are probably incorrect, taken from SD2 -const Position SwarmerPos = { -9647.352f, 1578.062f, 55.32f, 0.0f }; +const Position SwarmerPos = { -9647.352f, 1578.062f, 55.32f, 0.0f }; struct boss_ayamiss : public BossAI { @@ -85,20 +85,13 @@ struct boss_ayamiss : public BossAI { switch (who->GetEntry()) { - case NPC_SWARMER: + case NPC_HIVEZARA_SWARMER: _swarmers.push_back(who->GetGUID()); break; - case NPC_LARVA: + case NPC_HIVEZARA_LARVA: who->GetMotionMaster()->MovePoint(POINT_PARALYZE, AltarPos); break; - case NPC_HORNET: - if (Unit* target = SelectTarget(SelectTargetMethod::Random)) - { - who->AI()->AttackStart(target); - } - break; } - summons.Summon(who); } @@ -210,7 +203,7 @@ struct boss_ayamiss : public BossAI Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; Position spawnpos = me->GetRandomPoint(SwarmerPos, 80.0f); spawnpos.RelocateOffset(offset); - if (Creature* wasp = me->SummonCreature(NPC_SWARMER, spawnpos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) + if (Creature* wasp = me->SummonCreature(NPC_HIVEZARA_SWARMER, spawnpos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) { wasp->GetMotionMaster()->MoveRandom(10.0f); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h index 522b70c78..418c9edbe 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h @@ -60,9 +60,6 @@ enum Creatures NPC_OSSIRIAN_TRIGGER = 15590, NPC_HATCHLING = 15521, NPC_BURU_EGG = 15514, - NPC_LARVA = 15555, - NPC_SWARMER = 15546, - NPC_HORNET = 15934, // Rajaxx NPC_QUUEZ = 15391, From cd8c184f8d4462486adf2aec91aae38e811e4e24 Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Sat, 13 Aug 2022 00:50:43 +0200 Subject: [PATCH 121/161] fix(DB/EversongWoods): Add Eldinarcus Patrol (#12709) --- data/sql/updates/pending_db_world/rev_1660309887806825183.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660309887806825183.sql diff --git a/data/sql/updates/pending_db_world/rev_1660309887806825183.sql b/data/sql/updates/pending_db_world/rev_1660309887806825183.sql new file mode 100644 index 000000000..f1328c043 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660309887806825183.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `wander_distance`=20.0,`MovementType`=1 WHERE `guid`=58019 AND `id1`=16854; From 3771a7120d962bbe7cca70a1c1440b4acba440a5 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Fri, 12 Aug 2022 22:52:52 +0000 Subject: [PATCH 122/161] chore(DB): import pending files Referenced commit(s): cd8c184f8d4462486adf2aec91aae38e811e4e24 --- .../rev_1660309887806825183.sql => db_world/2022_08_12_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660309887806825183.sql => db_world/2022_08_12_01.sql} (69%) diff --git a/data/sql/updates/pending_db_world/rev_1660309887806825183.sql b/data/sql/updates/db_world/2022_08_12_01.sql similarity index 69% rename from data/sql/updates/pending_db_world/rev_1660309887806825183.sql rename to data/sql/updates/db_world/2022_08_12_01.sql index f1328c043..a419681ab 100644 --- a/data/sql/updates/pending_db_world/rev_1660309887806825183.sql +++ b/data/sql/updates/db_world/2022_08_12_01.sql @@ -1 +1,2 @@ +-- DB update 2022_08_12_00 -> 2022_08_12_01 UPDATE `creature` SET `wander_distance`=20.0,`MovementType`=1 WHERE `guid`=58019 AND `id1`=16854; From 5dd22f822df679d011622866a72ce905809e53c2 Mon Sep 17 00:00:00 2001 From: M'Dic Date: Sat, 13 Aug 2022 15:05:23 -0400 Subject: [PATCH 123/161] fix (core): Cast sub-expression to wider-type (#12430) sub-expression may overflow before being added to a wider type. Possible fix for a segmentation fault being reported in the chat. --- src/server/game/Instances/InstanceSaveMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index 6058b300b..f622976ec 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -94,7 +94,7 @@ InstanceSave* InstanceSaveMgr::AddInstanceSave(uint32 mapId, uint32 instanceId, } else { - resetTime = GameTime::GetGameTime().count() + 3 * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup + resetTime = GameTime::GetGameTime().count() + static_cast(3) * DAY; // normals expire after 3 days even if someone is still bound to them, cleared on startup extendedResetTime = 0; } InstanceSave* save = new InstanceSave(mapId, instanceId, difficulty, resetTime, extendedResetTime); From 4952e6032f9fc8981df48181ed3b2e431f8e5575 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 13 Aug 2022 22:24:58 -0300 Subject: [PATCH 124/161] =?UTF-8?q?fix(Scripts/Misc):=20Lower=20Artorius?= =?UTF-8?q?=20damage=20treshold=20when=20he=20damages=20him=E2=80=A6=20(#1?= =?UTF-8?q?2695)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/Misc): Lower Artorius damage treshold when he damages himself & his dot shouldn't be affected by his enrage * Update SpellInfoCorrections.cpp --- src/server/game/Spells/SpellInfoCorrections.cpp | 7 +++++++ .../scripts/World/npc_stave_of_ancients.cpp | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index c667daac3..4a46e8115 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4341,6 +4341,13 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->Effects[EFFECT_0].TargetA = TARGET_UNIT_SUMMONER; }); + // Artorius Demonic Doom + ApplySpellFix({ 23298 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx4 |= SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS; + spellInfo->AttributesEx6 |= SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/World/npc_stave_of_ancients.cpp b/src/server/scripts/World/npc_stave_of_ancients.cpp index e8d32856f..8ce88a0d5 100644 --- a/src/server/scripts/World/npc_stave_of_ancients.cpp +++ b/src/server/scripts/World/npc_stave_of_ancients.cpp @@ -394,6 +394,14 @@ public: DoMeleeAttackIfReady(); } + void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + if (attacker == me) + { + me->LowerPlayerDamageReq(damage); + } + } + void SpellHit(Unit* /*Caster*/, SpellInfo const* Spell) override { uint32 serpentStings[12] = { 1978, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 25295, 27016, 49000, 49001 }; @@ -1173,6 +1181,14 @@ public: } } + void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + if (attacker == me) + { + me->LowerPlayerDamageReq(damage); + } + } + void ScheduleEncounterStart(ObjectGuid playerGUID) { PrepareForEncounter(); From 9fa35180eac4dc49ed725c5715770556f8301fe1 Mon Sep 17 00:00:00 2001 From: Patrick Lewis Date: Sat, 13 Aug 2022 19:31:26 -0700 Subject: [PATCH 125/161] fix(CI): pin boost version (#12730) * fix(CI): pin boost version --- .github/workflows/windows_build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 6fb55ccc3..a57f6d532 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -24,7 +24,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Configure OS - run: choco install --no-progress openssl boost-msvc-14.3 + run: | + choco install --no-progress openssl + choco install --no-progress boost-msvc-14.3 --version=1.79.0 - name: Build shell: bash run: | From eb4f133865dca8e84378a874b0e812f703596b2f Mon Sep 17 00:00:00 2001 From: Eddy Vega <61223313+Si1ker@users.noreply.github.com> Date: Sat, 13 Aug 2022 21:14:50 -0600 Subject: [PATCH 126/161] fix(Scripts/TempleOfAhnQiraj): Improve Sartura (#12577) --- .../rev_1659294015696463500.sql | 7 + .../TempleOfAhnQiraj/boss_sartura.cpp | 535 +++++++++--------- .../TempleOfAhnQiraj/temple_of_ahnqiraj.h | 2 +- 3 files changed, 282 insertions(+), 262 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659294015696463500.sql diff --git a/data/sql/updates/pending_db_world/rev_1659294015696463500.sql b/data/sql/updates/pending_db_world/rev_1659294015696463500.sql new file mode 100644 index 000000000..1f372bfe9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659294015696463500.sql @@ -0,0 +1,7 @@ +-- +UPDATE `creature_formations` SET `dist`=5 WHERE `memberGUID` IN (87649,87650,87651); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=26084 AND `spell_effect`=25174 AND `type`=1; +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(26084, 25174, 1, 'Battleguard Sartura - OnHit Whirlwind - Apply Sundering Cleave'); + diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index f851d2b5c..789fe5bcf 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -15,301 +15,314 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Sartura -SD%Complete: 95 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" +#include "SpellScript.h" #include "ScriptedCreature.h" #include "temple_of_ahnqiraj.h" -enum Sartura +enum Says { - SAY_AGGRO = 0, - SAY_SLAY = 1, - SAY_DEATH = 2, - - SPELL_WHIRLWIND = 26083, - SPELL_ENRAGE = 8269, - SPELL_BERSERK = 27680, - - //Guard Spell - SPELL_WHIRLWINDADD = 26038, - SPELL_KNOCKBACK = 26027 + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2 }; -class boss_sartura : public CreatureScript +enum Spells { -public: - boss_sartura() : CreatureScript("boss_sartura") { } + // Battleguard Sartura + SPELL_WHIRLWIND = 26083, // MechanicImmunity->Stunned (15sec) + SPELL_ENRAGE = 8269, + SPELL_BERSERK = 27680, + SPELL_SUNDERING_CLEAVE = 25174, - CreatureAI* GetAI(Creature* creature) const override - { - return GetTempleOfAhnQirajAI(creature); - } - - struct boss_sarturaAI : public ScriptedAI - { - boss_sarturaAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 WhirlWind_Timer; - uint32 WhirlWindRandom_Timer; - uint32 WhirlWindEnd_Timer; - uint32 AggroReset_Timer; - uint32 AggroResetEnd_Timer; - uint32 EnrageHard_Timer; - - bool Enraged; - bool EnragedHard; - bool WhirlWind; - bool AggroReset; - - void Reset() override - { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = urand(3000, 7000); - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = urand(45000, 55000); - AggroResetEnd_Timer = 5000; - EnrageHard_Timer = 10 * 60000; - - WhirlWind = false; - AggroReset = false; - Enraged = false; - EnragedHard = false; - } - - void EnterCombat(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - } - - void JustDied(Unit* /*killer*/) override - { - Talk(SAY_DEATH); - } - - void KilledUnit(Unit* /*victim*/) override - { - Talk(SAY_SLAY); - } - - void UpdateAI(uint32 diff) override - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (WhirlWind) - { - if (WhirlWindRandom_Timer <= diff) - { - //Attack random Gamers - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) - { - me->AddThreat(target, 1.0f); - me->TauntApply(target); - AttackStart(target); - } - WhirlWindRandom_Timer = urand(3000, 7000); - } - else WhirlWindRandom_Timer -= diff; - - if (WhirlWindEnd_Timer <= diff) - { - WhirlWind = false; - WhirlWind_Timer = urand(25000, 40000); - } - else WhirlWindEnd_Timer -= diff; - } - - if (!WhirlWind) - { - if (WhirlWind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - WhirlWind = true; - WhirlWindEnd_Timer = 15000; - } - else WhirlWind_Timer -= diff; - - if (AggroReset_Timer <= diff) - { - //Attack random Gamers - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) - { - me->AddThreat(target, 1.0f); - me->TauntApply(target); - AttackStart(target); - } - AggroReset = true; - AggroReset_Timer = urand(2000, 5000); - } - else AggroReset_Timer -= diff; - - if (AggroReset) - { - if (AggroResetEnd_Timer <= diff) - { - AggroReset = false; - AggroResetEnd_Timer = 5000; - AggroReset_Timer = urand(35000, 45000); - } - else AggroResetEnd_Timer -= diff; - } - - //If she is 20% enrage - if (!Enraged) - { - if (!HealthAbovePct(20) && !me->IsNonMeleeSpellCast(false)) - { - DoCast(me, SPELL_ENRAGE, true); - Enraged = true; - } - } - - //After 10 minutes hard enrage - if (!EnragedHard) - { - if (EnrageHard_Timer <= diff) - { - DoCast(me, SPELL_BERSERK, true); - EnragedHard = true; - } - else EnrageHard_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - } - }; + // Sartura's Royal Guard + SPELL_GUARD_WHIRLWIND = 26038, + SPELL_GUARD_KNOCKBACK = 26027 }; -class npc_sartura_royal_guard : public CreatureScript +enum events { -public: - npc_sartura_royal_guard() : CreatureScript("npc_sartura_royal_guard") { } + // Battleguard Sartura + EVENT_SARTURA_WHIRLWIND = 1, + EVENT_SARTURA_WHIRLWIND_RANDOM = 2, + EVENT_SARTURA_WHIRLWIND_END = 3, + EVENT_SPELL_BERSERK = 4, + EVENT_SARTURA_AGGRO_RESET = 5, + EVENT_SARTURA_AGGRO_RESET_END = 6, - CreatureAI* GetAI(Creature* creature) const override + // Sartura's Royal Guard + EVENT_GUARD_WHIRLWIND = 7, + EVENT_GUARD_WHIRLWIND_RANDOM = 8, + EVENT_GUARD_WHIRLWIND_END = 9, + EVENT_GUARD_KNOCKBACK = 10, + EVENT_GUARD_AGGRO_RESET = 11, + EVENT_GUARD_AGGRO_RESET_END = 12 +}; + +struct boss_sartura : public BossAI +{ + boss_sartura(Creature* creature) : BossAI(creature, DATA_SARTURA) {} + + void Reset() override { - return GetTempleOfAhnQirajAI(creature); + _Reset(); + whirlwind = false; + enraged = false; + berserked = false; + aggroReset = false; + MinionReset(); + _savedTargetGUID.Clear(); + _savedTargetThreat = 0.f; } - struct npc_sartura_royal_guardAI : public ScriptedAI + void MinionReset() { - npc_sartura_royal_guardAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 WhirlWind_Timer; - uint32 WhirlWindRandom_Timer; - uint32 WhirlWindEnd_Timer; - uint32 AggroReset_Timer; - uint32 AggroResetEnd_Timer; - uint32 KnockBack_Timer; - - bool WhirlWind; - bool AggroReset; - - void Reset() override + std::list royalGuards; + me->GetCreaturesWithEntryInRange(royalGuards, 200.0f, NPC_SARTURA_ROYAL_GUARD); + for (Creature* minion : royalGuards) { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = urand(3000, 7000); - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = urand(45000, 55000); - AggroResetEnd_Timer = 5000; - KnockBack_Timer = 10000; - - WhirlWind = false; - AggroReset = false; + minion->Respawn(); } + } - void EnterCombat(Unit* /*who*/) override + void EnterCombat(Unit* who) override + { + BossAI::EnterCombat(who); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_SARTURA_WHIRLWIND, 30000); + events.ScheduleEvent(EVENT_SARTURA_AGGRO_RESET, urand(45000, 55000)); + events.ScheduleEvent(EVENT_SPELL_BERSERK, 10 * 60000); + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + Talk(SAY_DEATH); + } + + void KilledUnit(Unit* /*victim*/) override + { + Talk(SAY_SLAY); + } + + void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask) override + { + if (!enraged && HealthBelowPct(20)) { + DoCastSelf(SPELL_ENRAGE); + enraged = true; } + } - void UpdateAI(uint32 diff) override + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + { + if (spell->Id != SPELL_SUNDERING_CLEAVE) + return; + + me->RemoveAura(SPELL_SUNDERING_CLEAVE); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!WhirlWind && WhirlWind_Timer <= diff) + switch (eventId) { - DoCast(me, SPELL_WHIRLWINDADD); - WhirlWind = true; - WhirlWind_Timer = urand(25000, 40000); - WhirlWindEnd_Timer = 15000; - } - else WhirlWind_Timer -= diff; - - if (WhirlWind) - { - if (WhirlWindRandom_Timer <= diff) - { - //Attack random Gamers - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) + case EVENT_SARTURA_WHIRLWIND: + DoCastSelf(SPELL_WHIRLWIND, true); + whirlwind = true; + events.ScheduleEvent(EVENT_SARTURA_WHIRLWIND_RANDOM, urand(3000, 7000)); + events.ScheduleEvent(EVENT_SARTURA_WHIRLWIND_END, 15000); + break; + case EVENT_SARTURA_WHIRLWIND_RANDOM: + if (whirlwind == true) { - me->AddThreat(target, 1.0f); - me->TauntApply(target); - AttackStart(target); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) + { + me->AddThreat(target, 1.0f); + me->TauntApply(target); + AttackStart(target); + } + events.RepeatEvent(urand(3000, 7000)); } - - WhirlWindRandom_Timer = urand(3000, 7000); - } - else WhirlWindRandom_Timer -= diff; - - if (WhirlWindEnd_Timer <= diff) - { - WhirlWind = false; - } - else WhirlWindEnd_Timer -= diff; - } - - if (!WhirlWind) - { - if (AggroReset_Timer <= diff) - { - //Attack random Gamers - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) + break; + case EVENT_SARTURA_WHIRLWIND_END: + events.CancelEvent(EVENT_SARTURA_WHIRLWIND_RANDOM); + whirlwind = false; + events.ScheduleEvent(EVENT_SARTURA_WHIRLWIND, urand(25000, 40000)); + break; + case EVENT_SARTURA_AGGRO_RESET: + if (aggroReset == false) { - me->AddThreat(target, 1.0f); - me->TauntApply(target); - AttackStart(target); + if (Unit* originalTarget = SelectTarget(SelectTargetMethod::Random, 0)) + { + _savedTargetGUID = originalTarget->GetGUID(); + _savedTargetThreat = me->GetThreatMgr().getThreat(originalTarget); + me->GetThreatMgr().modifyThreatPercent(originalTarget, -100); + } + aggroReset = true; + events.ScheduleEvent(EVENT_SARTURA_AGGRO_RESET_END, 5000); } - - AggroReset = true; - AggroReset_Timer = urand(2000, 5000); - } - else AggroReset_Timer -= diff; - - if (KnockBack_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWINDADD); - KnockBack_Timer = urand(10000, 20000); - } - else KnockBack_Timer -= diff; + else + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) + { + me->AddThreat(target, 1.0f); + me->TauntApply(target); + AttackStart(target); + } + } + events.RepeatEvent(urand(1000, 2000)); + break; + case EVENT_SARTURA_AGGRO_RESET_END: + events.CancelEvent(EVENT_SARTURA_AGGRO_RESET); + if (Unit* originalTarget = ObjectAccessor::GetUnit(*me, _savedTargetGUID)) + { + me->GetThreatMgr().addThreat(originalTarget, _savedTargetThreat); + _savedTargetGUID.Clear(); + } + aggroReset = false; + events.RescheduleEvent(EVENT_SARTURA_AGGRO_RESET, urand(30000, 40000)); + break; + case EVENT_SPELL_BERSERK: + if (!berserked) + { + DoCastSelf(SPELL_BERSERK); + berserked = true; + } + break; + default: + break; } - - if (AggroReset) - { - if (AggroResetEnd_Timer <= diff) - { - AggroReset = false; - AggroResetEnd_Timer = 5000; - AggroReset_Timer = urand(30000, 40000); - } - else AggroResetEnd_Timer -= diff; - } - - DoMeleeAttackIfReady(); } + DoMeleeAttackIfReady(); }; + private: + bool whirlwind; + bool enraged; + bool berserked; + bool aggroReset; + ObjectGuid _savedTargetGUID; + float _savedTargetThreat; +}; + +struct npc_sartura_royal_guard : public ScriptedAI +{ + npc_sartura_royal_guard(Creature* creature) : ScriptedAI(creature) {} + + void Reset() override + { + events.Reset(); + whirlwind = false; + aggroReset = false; + _savedTargetGUID.Clear(); + _savedTargetThreat = 0.f; + } + + void EnterCombat(Unit* /*who*/) override + { + events.ScheduleEvent(EVENT_GUARD_WHIRLWIND, 30000); + events.ScheduleEvent(EVENT_GUARD_AGGRO_RESET, urand(45000, 55000)); + events.ScheduleEvent(EVENT_GUARD_KNOCKBACK, 10000); + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override + { + if (spell->Id != SPELL_SUNDERING_CLEAVE) + return; + + me->RemoveAura(SPELL_SUNDERING_CLEAVE); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventid = events.ExecuteEvent()) + { + switch (eventid) + { + case EVENT_GUARD_WHIRLWIND: + DoCastSelf(SPELL_GUARD_WHIRLWIND); + whirlwind = true; + events.ScheduleEvent(EVENT_GUARD_WHIRLWIND_RANDOM, urand(3000, 7000)); + events.ScheduleEvent(EVENT_GUARD_WHIRLWIND_END, 15000); + break; + case EVENT_GUARD_WHIRLWIND_RANDOM: + if (whirlwind == true) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) + { + me->AddThreat(target, 1.0f); + me->TauntApply(target); + AttackStart(target); + } + events.RepeatEvent(urand(3000, 7000)); + } + break; + case EVENT_GUARD_WHIRLWIND_END: + events.CancelEvent(EVENT_GUARD_WHIRLWIND_RANDOM); + whirlwind = false; + events.ScheduleEvent(EVENT_GUARD_WHIRLWIND, urand(25000, 40000)); + break; + case EVENT_GUARD_AGGRO_RESET: + if (aggroReset == true) + { + if (Unit* originalTarget = SelectTarget(SelectTargetMethod::Random, 0)) + { + _savedTargetGUID = originalTarget->GetGUID(); + _savedTargetThreat = me->GetThreatMgr().getThreat(originalTarget); + me->GetThreatMgr().modifyThreatPercent(originalTarget, -100); + } + aggroReset = true; + events.ScheduleEvent(EVENT_GUARD_AGGRO_RESET_END, 5000); + } + else + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100.0f, true)) + { + me->AddThreat(target, 1.0f); + me->TauntApply(target); + AttackStart(target); + } + } + events.RepeatEvent(urand(1000, 2000)); + break; + case EVENT_GUARD_AGGRO_RESET_END: + events.CancelEvent(EVENT_GUARD_AGGRO_RESET); + if (Unit* originalTarget = ObjectAccessor::GetUnit(*me, _savedTargetGUID)) + { + me->GetThreatMgr().addThreat(originalTarget, _savedTargetThreat); + _savedTargetGUID.Clear(); + } + aggroReset = false; + events.RescheduleEvent(EVENT_GUARD_AGGRO_RESET, urand(30000, 40000)); + break; + case EVENT_GUARD_KNOCKBACK: + DoCastVictim(SPELL_GUARD_KNOCKBACK); + events.RepeatEvent(urand(10000, 20000)); + break; + } + } + DoMeleeAttackIfReady(); + } + private: + bool whirlwind; + bool aggroReset; + ObjectGuid _savedTargetGUID; + float _savedTargetThreat; }; void AddSC_boss_sartura() { - new boss_sartura(); - new npc_sartura_royal_guard(); + RegisterTempleOfAhnQirajCreatureAI(boss_sartura); + RegisterTempleOfAhnQirajCreatureAI(npc_sartura_royal_guard); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index bd8f239eb..63727f51b 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -56,7 +56,7 @@ enum Creatures NPC_GIANT_EYE_TENTACLE = 15334, NPC_FLESH_TENTACLE = 15802, NPC_GIANT_PORTAL = 15910, - + NPC_SARTURA_ROYAL_GUARD = 15984, NPC_VISCIDUS = 15299, NPC_GLOB_OF_VISCIDUS = 15667, From a8acc871cd08edd2e8a11932991d8edd727f0429 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 14 Aug 2022 03:16:54 +0000 Subject: [PATCH 127/161] chore(DB): import pending files Referenced commit(s): eb4f133865dca8e84378a874b0e812f703596b2f --- .../rev_1659294015696463500.sql => db_world/2022_08_14_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659294015696463500.sql => db_world/2022_08_14_00.sql} (89%) diff --git a/data/sql/updates/pending_db_world/rev_1659294015696463500.sql b/data/sql/updates/db_world/2022_08_14_00.sql similarity index 89% rename from data/sql/updates/pending_db_world/rev_1659294015696463500.sql rename to data/sql/updates/db_world/2022_08_14_00.sql index 1f372bfe9..526cfcded 100644 --- a/data/sql/updates/pending_db_world/rev_1659294015696463500.sql +++ b/data/sql/updates/db_world/2022_08_14_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_12_01 -> 2022_08_14_00 -- UPDATE `creature_formations` SET `dist`=5 WHERE `memberGUID` IN (87649,87650,87651); From 11c1867f056ac8ac2d9e0e90d609a7c4aaeb90f1 Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Sun, 14 Aug 2022 10:17:16 -0300 Subject: [PATCH 128/161] fix(Core/Scripting): OnAuctionSuccessful on buyout (#12732) fix(Core/Scripting): OnAuctionSuccessful --- src/server/game/Handlers/AuctionHouseHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index c03f619aa..ece0e94df 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -506,6 +506,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) sAuctionMgr->SendAuctionSalePendingMail(auction, trans); sAuctionMgr->SendAuctionSuccessfulMail(auction, trans); sAuctionMgr->SendAuctionWonMail(auction, trans); + sScriptMgr->OnAuctionSuccessful(auctionHouse, auction); SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, ERR_AUCTION_OK); From 37e9fac5f6a2a00b2d15e670dfc9acf4c9a885a5 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 14 Aug 2022 15:17:57 +0200 Subject: [PATCH 129/161] fix(Scripts/AhnQiraj): Anubisath Sentinel - added missing spells. (#12726) Fixes #12630 --- .../rev_1660401908463646700.sql | 4 ++ .../mob_anubisath_sentinel.cpp | 41 +++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1660401908463646700.sql diff --git a/data/sql/updates/pending_db_world/rev_1660401908463646700.sql b/data/sql/updates/pending_db_world/rev_1660401908463646700.sql new file mode 100644 index 000000000..6f872c92a --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660401908463646700.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `creature_text` WHERE `CreatureID`=15264; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(15264,0,0,'%s becomes enraged!',16,0,100,0,0,0,24144,0,'Anubisath Sentinel'); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index 6db2ba06f..6d1e21635 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -54,7 +54,13 @@ enum Spells SPELL_STORM_BUFF = 2148, SPELL_STORM = 26546, - SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK = 27627 // Server-side + SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK = 27627, // Server-side + + SPELL_TRANSFER_POWER = 2400, + SPELL_HEAL_BRETHEN = 26565, + SPELL_ENRAGE = 8599, + + TALK_ENRAGE = 0 }; class npc_anubisath_sentinel : public CreatureScript @@ -247,6 +253,7 @@ public: } ClearBuddyList(); gatherOthersWhenAggro = true; + _enraged = false; } void GainSentinelAbility(uint32 id) @@ -263,6 +270,20 @@ public: DoZoneInCombat(); } + void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override + { + if (spellInfo->Id == SPELL_TRANSFER_POWER) + { + if (Creature* sentinel = target->ToCreature()) + { + if (sentinel->IsAIEnabled) + { + CAST_AI(aqsentinelAI, sentinel->AI())->GainSentinelAbility(ability); + } + } + } + } + void JustDied(Unit* /*killer*/) override { for (int ni = 0; ni < 3; ++ni) @@ -272,12 +293,26 @@ public: continue; if (sent->isDead()) continue; - sent->ModifyHealth(int32(sent->CountPctFromMaxHealth(50))); - CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); + DoCast(sent, SPELL_HEAL_BRETHEN, true); + DoCast(sent, SPELL_TRANSFER_POWER, true); } DoCastSelf(SPELL_SUMMON_SMALL_OBSIDIAN_CHUNK, true); } + + void DamageTaken(Unit* /*doneBy*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override + { + if (!_enraged && me->HealthBelowPctDamaged(50, damage)) + { + _enraged = true; + damage = 0; + DoCastSelf(SPELL_ENRAGE, true); + Talk(TALK_ENRAGE); + } + } + + private: + bool _enraged; }; }; From c0084988e868a6230decc2e49cb05314810bc4b8 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 14 Aug 2022 15:18:31 +0200 Subject: [PATCH 130/161] fix(DB/SAI): Hive'Zara Sandstalker. (#12722) * fix(DB/SAI): Hive'Zara Sandstalker. Fixes #12588 * Update. --- .../pending_db_world/rev_1660378795386850300.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660378795386850300.sql diff --git a/data/sql/updates/pending_db_world/rev_1660378795386850300.sql b/data/sql/updates/pending_db_world/rev_1660378795386850300.sql new file mode 100644 index 000000000..e4299c9a7 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660378795386850300.sql @@ -0,0 +1,10 @@ +-- +UPDATE `smart_scripts` SET `link`=2 WHERE `entryorguid` = 15323 AND `source_type` = 0 AND `id`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 15323 AND `source_type` = 0 AND `id` IN (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`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(15323,0,2,3,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hive'Zara Sandstalker - In Combat - Disable melee attack"), +(15323,0,3,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hive'Zara Sandstalker - In Combat - Set Phase 1"), +(15323,0,4,5,0,1,100,0,3000,6000,3000,6000,28,26381,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hive'Zara Sandstalker - IC - Remove Borrow"), +(15323,0,5,6,61,0,100,0,0,0,0,0,11,41390,0,0,0,0,0,2,0,0,0,0,0,0,0,"Hive'Zara Sandstalker - IC - Cast Ambush"), +(15323,0,6,7,61,0,100,0,0,0,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hive'Zara Sandstalker - In Combat - Enable melee attack"), +(15323,0,7,0,61,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hive'Zara Sandstalker - In Combat - Set Phase 0"); From f0e608ed6a7f0c420dd4abb10bcfec2deb1e0b18 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 14 Aug 2022 15:19:12 +0200 Subject: [PATCH 131/161] fix(DB/SAI): Qiraji Gladiator. Base on TC work. (#12719) * fix(DB/SAI): Qiraji Gladiator. Base on TC work. Fixes #12586 * Update. --- .../pending_db_world/rev_1660377276378786800.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660377276378786800.sql diff --git a/data/sql/updates/pending_db_world/rev_1660377276378786800.sql b/data/sql/updates/pending_db_world/rev_1660377276378786800.sql new file mode 100644 index 000000000..738fcc1ef --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660377276378786800.sql @@ -0,0 +1,15 @@ +-- +DELETE FROM `smart_scripts` WHERE `entryorguid` = 15324 AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(15324,0,0,0,11,0,100,256,0,0,0,0,211,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Gladiator - On Respawn - Set not phase reset"), +(15324,0,1,0,0,0,100,0,5400,8500,6000,17000,11,5568,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Gladiator - In Combat - Cast 'Trample'"), +(15324,0,2,0,0,0,100,0,8500,13000,8000,16000,11,10966,0,0,0,0,0,2,0,0,0,0,0,0,0,"Qiraji Gladiator - In Combat - Cast 'Uppercut'"), +(15324,0,3,4,38,0,100,0,0,1,0,0,11,25164,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Gladiator - On Data Set 0 1 - Cast 'Vengeance'"), +(15324,0,4,5,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Gladiator - On Link - Say Line 0"), +(15324,0,5,0,61,0,100,256,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Gladiator - On Link - Set Phase 1"), +(15324,0,6,0,6,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,15324,30,0,0,0,0,0,"Qiraji Gladiator - On Death - Set Data 0 1"), +(15324,0,7,0,0,1,100,0,60000,60000,60000,60000,11,25164,0,0,0,0,0,1,0,0,0,0,0,0,0,"Qiraji Gladiator - IC - Cast 'Vengeance' (Phase 1)"); + +DELETE FROM `creature_text` WHERE `CreatureID`=15324; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(15324,0,0,'%s becomes enraged!',16,0,100,0,0,0,24144,0,'Qiraji Gladiator'); From 415ceefaf6d1fbe18329ce18db147775e1959330 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Sun, 14 Aug 2022 15:19:51 +0200 Subject: [PATCH 132/161] fix(Scripts/AhnQiraj): Hive'Zara Stinger. (#12659) * fix(Scripts/AhnQiraj): Hive'Zara Stinger. Fixes #12532 * Update. * Update. --- .../rev_1659884404778685600.sql | 2 + .../RuinsOfAhnQiraj/ruins_of_ahnqiraj.cpp | 86 +++++++++++++++++++ .../Kalimdor/kalimdor_script_loader.cpp | 2 + 3 files changed, 90 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659884404778685600.sql create mode 100644 src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.cpp diff --git a/data/sql/updates/pending_db_world/rev_1659884404778685600.sql b/data/sql/updates/pending_db_world/rev_1659884404778685600.sql new file mode 100644 index 000000000..3e21fa88f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659884404778685600.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `ScriptName`='npc_hivezara_stinger' WHERE `entry`=15327; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.cpp new file mode 100644 index 000000000..5675b922a --- /dev/null +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.cpp @@ -0,0 +1,86 @@ +/* + * 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 "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ruins_of_ahnqiraj.h" +#include "TaskScheduler.h" + +enum Spells +{ + SPELL_HIVEZARA_CATALYST = 25187, + SPELL_STINGER_CHARGE_NORMAL = 25190, + SPELL_STINGER_CHARGE_BUFFED = 25191 +}; + +struct npc_hivezara_stinger : public ScriptedAI +{ + npc_hivezara_stinger(Creature* creature) : ScriptedAI(creature) + { + } + + void Reset() override + { + _scheduler.CancelAll(); + } + + void EnterCombat(Unit* who) override + { + DoCast(who ,who->HasAura(SPELL_HIVEZARA_CATALYST) ? SPELL_STINGER_CHARGE_BUFFED : SPELL_STINGER_CHARGE_NORMAL, true); + + _scheduler.Schedule(5s, [this](TaskContext context) + { + Unit* target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) + { + return u && !u->IsPet() && u->IsWithinDist2d(me, 20.f) && u->HasAura(SPELL_HIVEZARA_CATALYST); + }); + if (!target) + { + target = SelectTarget(SelectTargetMethod::Random, 1, [&](Unit* u) + { + return u && !u->IsPet() && u->IsWithinDist2d(me, 20.f); + }); + } + + if (target) + { + DoCast(target, target->HasAura(SPELL_HIVEZARA_CATALYST) ? SPELL_STINGER_CHARGE_BUFFED : SPELL_STINGER_CHARGE_NORMAL, true); + } + + context.Repeat(4500ms, 6500ms); + }); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } + + _scheduler.Update(diff, + std::bind(&ScriptedAI::DoMeleeAttackIfReady, this)); + } + +private: + TaskScheduler _scheduler; +}; + +void AddSC_ruins_of_ahnqiraj() +{ + RegisterRuinsOfAhnQirajCreatureAI(npc_hivezara_stinger); +} diff --git a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp index c3391cbdd..e628322e3 100644 --- a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp +++ b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp @@ -57,6 +57,7 @@ void AddSC_boss_moam(); void AddSC_boss_buru(); void AddSC_boss_ayamiss(); void AddSC_boss_ossirian(); +void AddSC_ruins_of_ahnqiraj(); void AddSC_instance_ruins_of_ahnqiraj(); void AddSC_boss_cthun(); //Temple of ahn'qiraj void AddSC_boss_viscidus(); @@ -139,6 +140,7 @@ void AddKalimdorScripts() AddSC_boss_buru(); AddSC_boss_ayamiss(); AddSC_boss_ossirian(); + AddSC_ruins_of_ahnqiraj(); AddSC_instance_ruins_of_ahnqiraj(); AddSC_boss_cthun(); //Temple of ahn'qiraj AddSC_boss_viscidus(); From 562f6b12818970330b70ac4741c47fd4546b93f6 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 14 Aug 2022 13:21:54 +0000 Subject: [PATCH 133/161] chore(DB): import pending files Referenced commit(s): 415ceefaf6d1fbe18329ce18db147775e1959330 --- .../rev_1659884404778685600.sql => db_world/2022_08_14_01.sql} | 1 + .../rev_1660377276378786800.sql => db_world/2022_08_14_02.sql} | 1 + .../rev_1660378795386850300.sql => db_world/2022_08_14_03.sql} | 1 + .../rev_1660401908463646700.sql => db_world/2022_08_14_04.sql} | 1 + 4 files changed, 4 insertions(+) rename data/sql/updates/{pending_db_world/rev_1659884404778685600.sql => db_world/2022_08_14_01.sql} (67%) rename data/sql/updates/{pending_db_world/rev_1660377276378786800.sql => db_world/2022_08_14_02.sql} (97%) rename data/sql/updates/{pending_db_world/rev_1660378795386850300.sql => db_world/2022_08_14_03.sql} (96%) rename data/sql/updates/{pending_db_world/rev_1660401908463646700.sql => db_world/2022_08_14_04.sql} (87%) diff --git a/data/sql/updates/pending_db_world/rev_1659884404778685600.sql b/data/sql/updates/db_world/2022_08_14_01.sql similarity index 67% rename from data/sql/updates/pending_db_world/rev_1659884404778685600.sql rename to data/sql/updates/db_world/2022_08_14_01.sql index 3e21fa88f..1dd0c127f 100644 --- a/data/sql/updates/pending_db_world/rev_1659884404778685600.sql +++ b/data/sql/updates/db_world/2022_08_14_01.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_14_00 -> 2022_08_14_01 -- UPDATE `creature_template` SET `ScriptName`='npc_hivezara_stinger' WHERE `entry`=15327; diff --git a/data/sql/updates/pending_db_world/rev_1660377276378786800.sql b/data/sql/updates/db_world/2022_08_14_02.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1660377276378786800.sql rename to data/sql/updates/db_world/2022_08_14_02.sql index 738fcc1ef..187bacf19 100644 --- a/data/sql/updates/pending_db_world/rev_1660377276378786800.sql +++ b/data/sql/updates/db_world/2022_08_14_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_14_01 -> 2022_08_14_02 -- DELETE FROM `smart_scripts` WHERE `entryorguid` = 15324 AND `source_type` = 0; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1660378795386850300.sql b/data/sql/updates/db_world/2022_08_14_03.sql similarity index 96% rename from data/sql/updates/pending_db_world/rev_1660378795386850300.sql rename to data/sql/updates/db_world/2022_08_14_03.sql index e4299c9a7..bc0408e18 100644 --- a/data/sql/updates/pending_db_world/rev_1660378795386850300.sql +++ b/data/sql/updates/db_world/2022_08_14_03.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_14_02 -> 2022_08_14_03 -- UPDATE `smart_scripts` SET `link`=2 WHERE `entryorguid` = 15323 AND `source_type` = 0 AND `id`=1; DELETE FROM `smart_scripts` WHERE `entryorguid` = 15323 AND `source_type` = 0 AND `id` IN (2,3,4,5,6,7); diff --git a/data/sql/updates/pending_db_world/rev_1660401908463646700.sql b/data/sql/updates/db_world/2022_08_14_04.sql similarity index 87% rename from data/sql/updates/pending_db_world/rev_1660401908463646700.sql rename to data/sql/updates/db_world/2022_08_14_04.sql index 6f872c92a..1f7648d9d 100644 --- a/data/sql/updates/pending_db_world/rev_1660401908463646700.sql +++ b/data/sql/updates/db_world/2022_08_14_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_14_03 -> 2022_08_14_04 -- DELETE FROM `creature_text` WHERE `CreatureID`=15264; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES From accaec8f8e2e29f374848fa699aeade1b921df83 Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Sun, 14 Aug 2022 21:51:31 +0200 Subject: [PATCH 134/161] fix(DB/Loot): Drop condition for Silithid Carapace (#12682) * fix(DB/Loot): Drop condition for Silithid Carapace Now Silithid Carapace depend to the Agent of Nozdormu item and not of the quest give it. * codestyle * . --- .../rev_1659994222187513600.sql | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659994222187513600.sql diff --git a/data/sql/updates/pending_db_world/rev_1659994222187513600.sql b/data/sql/updates/pending_db_world/rev_1659994222187513600.sql new file mode 100644 index 000000000..ebc094f3c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659994222187513600.sql @@ -0,0 +1,23 @@ +-- Fix Silithid Carapace to depend only to Agent of Nozdormu item +UPDATE `creature_loot_template` SET `QuestRequired` = 0 WHERE `Item` = 20384; + +DELETE FROM `conditions` WHERE `SourceEntry` = 20384 AND `ConditionValue1` = 20402; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(1, 11698, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11721, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11722, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11723, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11724, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11725, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11726, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11727, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11728, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11729, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11730, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11731, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11732, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11733, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 11734, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 13136, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 13301, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''), +(1, 15759, 20384, 0, 0, 2, 0, 20402, 1, 0, 0, 0, 0, '', ''); From 8f73d4b7f9ae17034440eb91690c349e2a498904 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Sun, 14 Aug 2022 19:53:33 +0000 Subject: [PATCH 135/161] chore(DB): import pending files Referenced commit(s): accaec8f8e2e29f374848fa699aeade1b921df83 --- .../rev_1659994222187513600.sql => db_world/2022_08_14_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659994222187513600.sql => db_world/2022_08_14_05.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1659994222187513600.sql b/data/sql/updates/db_world/2022_08_14_05.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1659994222187513600.sql rename to data/sql/updates/db_world/2022_08_14_05.sql index ebc094f3c..ff6c8cf76 100644 --- a/data/sql/updates/pending_db_world/rev_1659994222187513600.sql +++ b/data/sql/updates/db_world/2022_08_14_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_14_04 -> 2022_08_14_05 -- Fix Silithid Carapace to depend only to Agent of Nozdormu item UPDATE `creature_loot_template` SET `QuestRequired` = 0 WHERE `Item` = 20384; From dd8cdc9952672a7d4825c9b87245fa5cb2ed3fe1 Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Mon, 15 Aug 2022 07:36:05 +0200 Subject: [PATCH 136/161] fix(DB/Gossip): Fix gossip for anachronos (#12681) --- data/sql/updates/pending_db_world/rev_1659994158000361600.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1659994158000361600.sql diff --git a/data/sql/updates/pending_db_world/rev_1659994158000361600.sql b/data/sql/updates/pending_db_world/rev_1659994158000361600.sql new file mode 100644 index 000000000..88fb8ee3c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659994158000361600.sql @@ -0,0 +1,2 @@ +-- Remove a duplicate and wrong gossip with anachronos +DELETE FROM `gossip_menu_option` WHERE `MenuID` = 6539 AND `OptionID` IN (0); From abdfde24360008186caab5150eec039eaa4e327e Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 05:38:16 +0000 Subject: [PATCH 137/161] chore(DB): import pending files Referenced commit(s): dd8cdc9952672a7d4825c9b87245fa5cb2ed3fe1 --- .../rev_1659994158000361600.sql => db_world/2022_08_15_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659994158000361600.sql => db_world/2022_08_15_00.sql} (75%) diff --git a/data/sql/updates/pending_db_world/rev_1659994158000361600.sql b/data/sql/updates/db_world/2022_08_15_00.sql similarity index 75% rename from data/sql/updates/pending_db_world/rev_1659994158000361600.sql rename to data/sql/updates/db_world/2022_08_15_00.sql index 88fb8ee3c..d50300ebc 100644 --- a/data/sql/updates/pending_db_world/rev_1659994158000361600.sql +++ b/data/sql/updates/db_world/2022_08_15_00.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_14_05 -> 2022_08_15_00 -- Remove a duplicate and wrong gossip with anachronos DELETE FROM `gossip_menu_option` WHERE `MenuID` = 6539 AND `OptionID` IN (0); From 26c69a62c0e73ab7be919df083b641535017b783 Mon Sep 17 00:00:00 2001 From: neifion-00000000 <91289495+neifion-00000000@users.noreply.github.com> Date: Mon, 15 Aug 2022 00:44:42 -0500 Subject: [PATCH 138/161] fix(DB/Creature): Corrects spawn values for creature 2955 (#12702) --- .../rev_1660250344331923000.sql | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660250344331923000.sql diff --git a/data/sql/updates/pending_db_world/rev_1660250344331923000.sql b/data/sql/updates/pending_db_world/rev_1660250344331923000.sql new file mode 100644 index 000000000..eb529dc27 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660250344331923000.sql @@ -0,0 +1,109 @@ +-- +-- Remove all entries, they will be replaced +DELETE FROM `creature` WHERE `id1`=2955; +DELETE FROM `creature` WHERE `id2`=2955; +DELETE FROM `creature` WHERE `id3`=2955; + +-- Corrects spawn points to sniffed values, mostly this was fine, but the XYZ values were done manually rather than from sniffed variables +-- Wander distance was already set to 20, which is a good minimum value, about half of them have a wander value of around 30 or more, the sniff will be uploaded later to the collective if anyone wants to deep dive that for some reason +-- Similarly, 155 was the spawntime set before this fix, 180 is probbably correct, but this is fine imo without dynamic spawning +SET @GUID :=88354; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+96; +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`) VALUES +(@GUID+0, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2915.9321, -117.10601, 77.61542, 1.884955525398254394, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2915.9321 -117.10601 77.61542 +(@GUID+1, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2881.4697, -150.06369, 67.3019, 3.03687286376953125, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2881.4697 -150.06369 67.3019 +(@GUID+2, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2983.2869, -181.743, 63.0384, 2.146754980087280273, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2983.2869 -181.743 63.0384 +(@GUID+3, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3049.5332, -116.48638, 52.78892, 3.612831592559814453, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3049.5332 -116.48638 52.78892 +(@GUID+4, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3084.8281, -151.3636, 47.7102, 1.972222089767456054, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3084.8281 -151.3636 47.7102 +(@GUID+5, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3048.971, -183.28185, 59.85856, 1.553343057632446289, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3048.971 -183.28185 59.85856 +(@GUID+6, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3016.0718, -217.09685, 56.218082, 4.398229598999023437, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3016.0718 -217.09685 56.218082 +(@GUID+7, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2849.0051, -182.61052, 59.357796, 1.692969322204589843, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2849.0051 -182.61052 59.357796 +(@GUID+8, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2817.4912, -216.73177, 56.172832, 3.96189737319946289, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2817.4912 -216.73177 56.172832 +(@GUID+9, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2848.5728, -316.2174, 55.82892, 1.919862151145935058, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2848.5728 -316.2174 55.82892 +(@GUID+10, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2817.3057, -284.28928, 58.999767, 0.261799395084381103, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2817.3057 -284.28928 58.999767 +(@GUID+11, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2791.1252, -316.0387, 55.81441, 5.096361160278320312, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2791.1252 -316.0387 55.81441 +(@GUID+12, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2816.52, -348.31967, 57.394314, 4.747295379638671875, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2816.52 -348.31967 57.394314 +(@GUID+13, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2849.3384, -383.77203, 55.30781, 0.331612557172775268, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2849.3384 -383.77203 55.30781 +(@GUID+14, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2883.8289, -350.39417, 55.231503, 4.171336650848388671, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2883.8289 -350.39417 55.231503 +(@GUID+15, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2915.2188, -383.69476, 55.308075, 3.124139308929443359, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2915.2188 -383.69476 55.308075 +(@GUID+16, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2882.5889, -417.75314, 49.94027, 0, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2882.5889 -417.75314 49.94027 +(@GUID+17, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2864.4363, -449.93967, 53.77305, 1.605702877044677734, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2864.4363 -449.93967 53.77305 +(@GUID+18, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2883.513, -483.6671, 47.450447, 2.687807083129882812, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2883.513 -483.6671 47.450447 +(@GUID+19, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2951.8186, -350.5021, 55.86079, 5.846852779388427734, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2951.8186 -350.5021 55.86079 +(@GUID+20, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2983.916, -316.7991, 48.84321, 1.029744267463684082, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2983.916 -316.7991 48.84321 +(@GUID+21, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3018.8704, -284.1935, 43.844025, 2.111848354339599609, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3018.8704 -284.1935 43.844025 +(@GUID+22, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3050.7756, -317.3549, 42.753426, 0.383972436189651489, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3050.7756 -317.3549 42.753426 +(@GUID+23, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3117.3638, -317.11685, 40.205025, 1.815142393112182617, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3117.3638 -317.11685 40.205025 +(@GUID+24, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3082.7852, -283.14948, 36.52417, 4.450589656829833984, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3082.7852 -283.14948 36.52417 +(@GUID+25, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3082.5708, -350.88812, 36.985973, 0.139626339077949523, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3082.5708 -350.88812 36.985973 +(@GUID+26, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3049.2266, -384.4684, 39.612816, 3.682644605636596679, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3049.2266 -384.4684 39.612816 +(@GUID+27, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3084.3826, -417.4145, 37.911163, 5.951572895050048828, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3084.3826 -417.4145 37.911163 +(@GUID+28, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3116.5625, -383.2819, 41.819256, 2.321287870407104492, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3116.5625 -383.2819 41.819256 +(@GUID+29, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3016.7205, -417.2922, 48.25192, 0.575958669185638427, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3016.7205 -417.2922 48.25192 +(@GUID+30, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2983.6528, -382.88184, 53.537003, 2.827433347702026367, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2983.6528 -382.88184 53.537003 +(@GUID+31, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2984.1338, -450.97092, 46.477955, 4.537856101989746093, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2984.1338 -450.97092 46.477955 +(@GUID+32, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2950.2192, -417.1669, 53.86521, 0.104719758033752441, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2950.2192 -417.1669 53.86521 +(@GUID+33, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2917.082, -450.50412, 46.918938, 4.78220224380493164, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2917.082 -450.50412 46.918938 +(@GUID+34, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2883.351, -549.6797, 51.405052, 5.078907966613769531, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2883.351 -549.6797 51.405052 +(@GUID+35, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2850.924, -517.7154, 50.91358, 5.06145477294921875, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2850.924 -517.7154 50.91358 +(@GUID+36, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2817.7004, -549.1674, 55.274178, 2.617993831634521484, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2817.7004 -549.1674 55.274178 +(@GUID+37, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2851.802, -583.9538, 57.15891, 3.630284786224365234, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2851.802 -583.9538 57.15891 +(@GUID+38, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2915.418, -517.8362, 47.194675, 4.380776405334472656, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2915.418 -517.8362 47.194675 +(@GUID+39, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2817.2737, -617.9309, 56.016186, 5.619960308074951171, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2817.2737 -617.9309 56.016186 +(@GUID+40, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2884.533, -616.6502, 55.083035, 5.969026088714599609, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2884.533 -616.6502 55.083035 +(@GUID+41, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2949.897, -615.9156, 39.461315, 2.897246599197387695, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2949.897 -615.9156 39.461315 +(@GUID+42, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2915.745, -583.6176, 50.565845, 5.462880611419677734, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2915.745 -583.6176 50.565845 +(@GUID+43, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2949.016, -549.3831, 45.385597, 4.049163818359375, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2949.016 -549.3831 45.385597 +(@GUID+44, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2983.931, -583.4975, 38.284866, 6.0737457275390625, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2983.931 -583.4975 38.284866 +(@GUID+45, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3018.492, -617.0446, 29.809212, 1.256637096405029296, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3018.492 -617.0446 29.809212 +(@GUID+46, 2966, 0, 0, 1, 0, 0, 1, 1, 0, -3017.079, -685.03986, 41.89431, 5.432766437530517578, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3017.079 -685.03986 41.89431 +(@GUID+47, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3084.279, -682.7648, 31.90988, 0.802851438522338867, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3084.279 -682.7648 31.90988 +(@GUID+48, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3050.0088, -650.9782, 29.19056, 0.680678427219390869, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3050.0088 -650.9782 29.19056 +(@GUID+49, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3085.173, -617.01215, 34.477776, 5.689773082733154296, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3085.173 -617.01215 34.477776 +(@GUID+50, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3116.6624, -649.3928, 32.413265, 1.169370532035827636, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3116.6624 -649.3928 32.413265 +(@GUID+51, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3116.1125, -714.4594, 33.46272, 0.942477762699127197, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3116.1125 -714.4594 33.46272 +(@GUID+52, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3148.6108, -683.60284, 23.079771, 3.141592741012573242, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3148.6108 -683.60284 23.079771 +(@GUID+53, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3182.7786, -716.07, 26.982426, 4.537856101989746093, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3182.7786 -716.07 26.982426 +(@GUID+54, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3148.8203, -615.4817, 35.513004, 2.356194496154785156, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3148.8203 -615.4817 35.513004 +(@GUID+55, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3117.3677, -251.52632, 41.896477, 2.722713708877563476, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3117.3677 -251.52632 41.896477 +(@GUID+56, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3150.7246, -216.66353, 43.11533, 1.029744267463684082, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3150.7246 -216.66353 43.11533 +(@GUID+57, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3182.763, -249.51974, 40.0922, 0.628318548202514648, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3182.763 -249.51974 40.0922 +(@GUID+58, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3184.1643, -317.5604, 37.124756, 5.707226753234863281, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3184.1643 -317.5604 37.124756 +(@GUID+59, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3150.1514, -285.3053, 39.282925, 3.089232683181762695, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3150.1514 -285.3053 39.282925 +(@GUID+60, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3149.0168, -349.84933, 34.957115, 4.660028934478759765, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3149.0168 -349.84933 34.957115 +(@GUID+61, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3215.4568, -217.2468, 31.292675, 4.328416347503662109, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3215.4568 -217.2468 31.292675 +(@GUID+62, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3182.377, -184.5408, 41.331944, 1.692969322204589843, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3182.377 -184.5408 41.331944 +(@GUID+63, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3215.015, -284.60513, 30.6046, 4.590215682983398437, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3215.015 -284.60513 30.6046 +(@GUID+64, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3284.4084, -217.13043, 39.615646, 3.787364482879638671, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3284.4084 -217.13043 39.615646 +(@GUID+65, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3284.5642, -282.64816, 37.027092, 2.199114799499511718, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3284.5642 -282.64816 37.027092 +(@GUID+66, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3214.8604, -347.4374, 28.102503, 5.969026088714599609, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3214.8604 -347.4374 28.102503 +(@GUID+67, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3248.986, -316.8644, 32.329453, 4.886921882629394531, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3248.986 -316.8644 32.329453 +(@GUID+68, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3282.3496, -350.19608, 43.65876, 2.39110112190246582, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3282.3496 -350.19608 43.65876 +(@GUID+69, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3249.6396, -384.67285, 31.974255, 2.0245819091796875, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3249.6396 -384.67285 31.974255 +(@GUID+70, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3281.6199, -417.9758, 36.595318, 0.122173048555850982, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3281.6199 -417.9758 36.595318 +(@GUID+71, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3215.3584, -416.1518, 25.393665, 2.356194496154785156, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3215.3584 -416.1518 25.393665 +(@GUID+72, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3248.7173, -450.7054, 28.379059, 1.48352980613708496, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3248.7173 -450.7054 28.379059 +(@GUID+73, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3216.2603, -483.22516, 24.11747, 4.310963153839111328, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3216.2603 -483.22516 24.11747 +(@GUID+74, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3249.8452, -516.86914, 27.956903, 5.393067359924316406, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3249.8452 -516.86914 27.956903 +(@GUID+75, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3150.8284, -482.7306, 30.151358, 1.884955525398254394, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3150.8284 -482.7306 30.151358 +(@GUID+76, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3149.8757, -417.15897, 31.773283, 4.590215682983398437, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3149.8757 -417.15897 31.773283 +(@GUID+77, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3115.8054, -449.89996, 29.697945, 3.735004663467407226, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3115.8054 -449.89996 29.697945 +(@GUID+78, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3083.3086, -483.736, 31.280085, 3.560471534729003906, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3083.3086 -483.736 31.280085 +(@GUID+79, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3118.7922, -516.90375, 34.351627, 0.03490658476948738, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3118.7922 -516.90375 34.351627 +(@GUID+80, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3148.536, -550.18274, 30.679869, 2.443460941314697265, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3148.536 -550.18274 30.679869 +(@GUID+81, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3116.379, -583.2126, 34.0221, 4.886921882629394531, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3116.379 -583.2126 34.0221 +(@GUID+82, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3217.4094, -616.01, 28.73066, 3.665191411972045898, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3217.4094 -616.01 28.73066 +(@GUID+83, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3216.0747, -548.41754, 25.538637, 4.834561824798583984, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3216.0747 -548.41754 25.538637 +(@GUID+84, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3282.0308, -550.7741, 46.280766, 1.151917338371276855, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3282.0308 -550.7741 46.280766 +(@GUID+85, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3280.8374, -617.0858, 35.034283, 4.345870018005371093, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3280.8374 -617.0858 35.034283 +(@GUID+86, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3248.9495, -581.88226, 30.587183, 4.677482128143310546, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3248.9495 -581.88226 30.587183 +(@GUID+87, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3281.4895, -683.2465, 39.041134, 1.675516128540039062, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3281.4895 -683.2465 39.041134 +(@GUID+88, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3247.2446, -649.0194, 30.383823, 4.328416347503662109, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3247.2446 -649.0194 30.383823 +(@GUID+89, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3215.3052, -682.5738, 29.801714, 2.042035102844238281, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3215.3052 -682.5738 29.801714 +(@GUID+90, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3247.6877, -714.72, 36.439972, 2.652900457382202148, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3247.6877 -714.72 36.439972 +(@GUID+91, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3182.1843, -648.84247, 29.093792, 1.169370532035827636, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3182.1843 -648.84247 29.093792 +(@GUID+92, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3051.3738, -582.958, 25.07603, 1.535889744758605957, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3051.3738 -582.958 25.07603 +(@GUID+93, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3015.6433, -549.345, 31.536392, 0.401425719261169433, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -3015.6433 -549.345 31.536392 +(@GUID+94, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2949.265, -482.95715, 43.765648, 3.089232683181762695, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2949.265 -482.95715 43.765648 +(@GUID+95, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -2984.5002, -517.8174, 39.379818, 3.141592741012573242, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0), -- .go xyz -2984.5002 -517.8174 39.379818 +(@GUID+96, 2955, 0, 0, 1, 0, 0, 1, 1, 0, -3016.3232, -483.44913, 36.235992, 0.663225114345550537, 155, 20, 0, 1, 0, 1, 0, 0, 0, '', 0); From 5d05fd3fb6d8ce23d87fa25d7e15a30a3c77932f Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 05:46:39 +0000 Subject: [PATCH 139/161] chore(DB): import pending files Referenced commit(s): 26c69a62c0e73ab7be919df083b641535017b783 --- .../rev_1660250344331923000.sql => db_world/2022_08_15_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660250344331923000.sql => db_world/2022_08_15_01.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1660250344331923000.sql b/data/sql/updates/db_world/2022_08_15_01.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1660250344331923000.sql rename to data/sql/updates/db_world/2022_08_15_01.sql index eb529dc27..0020614c9 100644 --- a/data/sql/updates/pending_db_world/rev_1660250344331923000.sql +++ b/data/sql/updates/db_world/2022_08_15_01.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_00 -> 2022_08_15_01 -- -- Remove all entries, they will be replaced DELETE FROM `creature` WHERE `id1`=2955; From 2db38e82a68f232261dc34572d18bf682d9db062 Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Mon, 15 Aug 2022 07:47:56 +0200 Subject: [PATCH 140/161] fix(DB/EversongWoods): Fix Angershade noise spam (#12703) --- data/sql/updates/pending_db_world/rev_1660249698988810843.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660249698988810843.sql diff --git a/data/sql/updates/pending_db_world/rev_1660249698988810843.sql b/data/sql/updates/pending_db_world/rev_1660249698988810843.sql new file mode 100644 index 000000000..88e98c137 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660249698988810843.sql @@ -0,0 +1,3 @@ +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15656) AND (`source_type` = 0) AND (`id` = 2); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(15656, 0, 2, 0, 75, 0, 100, 0, 0, 15958, 20, 1200, 0, 49, 0, 0, 0, 0, 0, 0, 19, 15402, 53, 0, 0, 0, 0, 0, 0, 'Angershade - On Distance To Creature - Start Attacking'); From 01b07969ced81f206d5835253c2d92c11ac4b107 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 05:49:59 +0000 Subject: [PATCH 141/161] chore(DB): import pending files Referenced commit(s): 2db38e82a68f232261dc34572d18bf682d9db062 --- .../rev_1660249698988810843.sql => db_world/2022_08_15_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660249698988810843.sql => db_world/2022_08_15_02.sql} (94%) diff --git a/data/sql/updates/pending_db_world/rev_1660249698988810843.sql b/data/sql/updates/db_world/2022_08_15_02.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1660249698988810843.sql rename to data/sql/updates/db_world/2022_08_15_02.sql index 88e98c137..c00dc06ec 100644 --- a/data/sql/updates/pending_db_world/rev_1660249698988810843.sql +++ b/data/sql/updates/db_world/2022_08_15_02.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_01 -> 2022_08_15_02 DELETE FROM `smart_scripts` WHERE (`entryorguid` = 15656) AND (`source_type` = 0) AND (`id` = 2); INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES (15656, 0, 2, 0, 75, 0, 100, 0, 0, 15958, 20, 1200, 0, 49, 0, 0, 0, 0, 0, 0, 19, 15402, 53, 0, 0, 0, 0, 0, 0, 'Angershade - On Distance To Creature - Start Attacking'); From 59afa51f37dc709a2cf121fdb8a1bdc8c12e83ee Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Mon, 15 Aug 2022 07:50:34 +0200 Subject: [PATCH 142/161] fix(DB/EversongWoods): Add Jero'me weapons (#12710) --- data/sql/updates/pending_db_world/rev_1660317462420871561.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660317462420871561.sql diff --git a/data/sql/updates/pending_db_world/rev_1660317462420871561.sql b/data/sql/updates/pending_db_world/rev_1660317462420871561.sql new file mode 100644 index 000000000..bf5408c68 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660317462420871561.sql @@ -0,0 +1 @@ +UPDATE `creature_addon` SET `bytes2`=1 WHERE `guid`=71028; From 866f5e128c4dacd5129aadc52483eca5cbf4d043 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 05:52:32 +0000 Subject: [PATCH 143/161] chore(DB): import pending files Referenced commit(s): 59afa51f37dc709a2cf121fdb8a1bdc8c12e83ee --- .../rev_1660317462420871561.sql => db_world/2022_08_15_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660317462420871561.sql => db_world/2022_08_15_03.sql} (57%) diff --git a/data/sql/updates/pending_db_world/rev_1660317462420871561.sql b/data/sql/updates/db_world/2022_08_15_03.sql similarity index 57% rename from data/sql/updates/pending_db_world/rev_1660317462420871561.sql rename to data/sql/updates/db_world/2022_08_15_03.sql index bf5408c68..ee1094bba 100644 --- a/data/sql/updates/pending_db_world/rev_1660317462420871561.sql +++ b/data/sql/updates/db_world/2022_08_15_03.sql @@ -1 +1,2 @@ +-- DB update 2022_08_15_02 -> 2022_08_15_03 UPDATE `creature_addon` SET `bytes2`=1 WHERE `guid`=71028; From b7b882367e85fd7d49d1d40f442d86bb83b75c19 Mon Sep 17 00:00:00 2001 From: Synful-Syn Date: Mon, 15 Aug 2022 02:35:07 -0400 Subject: [PATCH 144/161] fix(Core/Mage) Water Elemental wrongly ressurected at Spirit Healer (#12684) --- src/server/game/Entities/Player/Player.cpp | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e6528091c..2aa7b694c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13895,20 +13895,27 @@ void Player::ResummonPetTemporaryUnSummonedIfAny() bool Player::CanResummonPet(uint32 spellid) { - if (getClass() == CLASS_DEATH_KNIGHT) + switch (getClass()) { - if (CanSeeDKPet()) + case CLASS_DEATH_KNIGHT: + if (CanSeeDKPet()) + return true; + else if (spellid == 52150) //Raise Dead + return false; + break; + case CLASS_MAGE: + if (HasSpell(31687) && HasAura(70937)) //Has [Summon Water Elemental] spell and [Glyph of Eternal Water]. + return true; + break; + case CLASS_HUNTER: + case CLASS_WARLOCK: return true; - else if (spellid == 52150) - return false; + break; + default: + break; } - else if (getClass() == CLASS_HUNTER || getClass() == CLASS_MAGE || getClass() == CLASS_WARLOCK) - return true; - if (!HasSpell(spellid)) - return false; - - return true; + return HasSpell(spellid); } bool Player::CanSeeSpellClickOn(Creature const* c) const From 523d4fbb08e04132612d9291d7152e92a2d7919c Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 15 Aug 2022 04:03:36 -0300 Subject: [PATCH 145/161] =?UTF-8?q?fix(Scripts/World):=20Emerald=20Dragon'?= =?UTF-8?q?s=20Dream=20Fog=20should=20chase=20switch=20ta=E2=80=A6=20(#127?= =?UTF-8?q?28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …rgets once reaching their chase target --- .../scripts/World/boss_emerald_dragons.cpp | 112 ++++++++++++++---- 1 file changed, 86 insertions(+), 26 deletions(-) diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 6331f16fb..a45f55d13 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -22,6 +22,7 @@ #include "Spell.h" #include "SpellAuraEffects.h" #include "SpellScript.h" +#include "TaskScheduler.h" // // Emerald Dragon NPCs and IDs (kept here for reference) @@ -34,6 +35,9 @@ enum EmeraldDragonNPC DRAGON_LETHON = 14888, DRAGON_EMERISS = 14889, DRAGON_TAERAR = 14890, + + GUID_DRAGON = 1, + GUID_FOG_TARGET = 2 }; // @@ -144,6 +148,14 @@ struct emerald_dragonAI : public WorldBossAI } } + void JustSummoned(Creature* summon) override + { + if (summon->GetEntry() == NPC_DREAM_FOG) + { + summon->AI()->SetGUID(me->GetGUID(), GUID_DRAGON); + } + } + void UpdateAI(uint32 diff) override { if (!UpdateVictim()) @@ -172,13 +184,66 @@ public: struct npc_dream_fogAI : public ScriptedAI { - npc_dream_fogAI(Creature* creature) : ScriptedAI(creature) - { - } + npc_dream_fogAI(Creature* creature) : ScriptedAI(creature) { } void Reset() override { - _roamTimer = 0; + ScheduleEvents(); + } + + void ScheduleEvents() + { + _scheduler.CancelAll(); + + _scheduler.Schedule(1s, [this](TaskContext context) + { + // Chase target, but don't attack - otherwise just roam around + if (Unit* chaseTarget = GetRandomUnitFromDragonThreatList()) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveFollow(chaseTarget, 0.02f, 0.0f); + _targetGUID = chaseTarget->GetGUID(); + context.Repeat(15s, 30s); + } + else + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveRandom(25.0f); + context.Repeat(2500ms); + } + + // Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it + me->SetWalk(true); + me->SetSpeed(MOVE_WALK, 0.75f); + }); + } + + void SetGUID(ObjectGuid guid, int32 type) override + { + if (type == GUID_DRAGON) + { + _dragonGUID = guid; + } + else if (type == GUID_FOG_TARGET) + { + if (guid == _targetGUID) + { + ScheduleEvents(); + } + } + } + + Unit* GetRandomUnitFromDragonThreatList() + { + if (Creature* dragon = ObjectAccessor::GetCreature(*me, _dragonGUID)) + { + if (dragon->GetAI()) + { + return dragon->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true); + } + } + + return nullptr; } void UpdateAI(uint32 diff) override @@ -186,31 +251,13 @@ public: if (!UpdateVictim()) return; - if (!_roamTimer) - { - // Chase target, but don't attack - otherwise just roam around - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true)) - { - _roamTimer = urand(15000, 30000); - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveChase(target, 0.2f); - } - else - { - _roamTimer = 2500; - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveRandom(25.0f); - } - // Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it - me->SetWalk(true); - me->SetSpeed(MOVE_WALK, 0.75f); - } - else - _roamTimer -= diff; + _scheduler.Update(diff); } private: - uint32 _roamTimer; + ObjectGuid _targetGUID; + ObjectGuid _dragonGUID; + TaskScheduler _scheduler; }; CreatureAI* GetAI(Creature* creature) const override @@ -614,6 +661,7 @@ public: ++_stage; } } + void ExecuteEvent(uint32 eventId) override { switch (eventId) @@ -692,6 +740,17 @@ public: { PrepareSpellScript(spell_dream_fog_sleep_SpellScript); + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + { + if (Unit* target = GetHitUnit()) + { + caster->GetAI()->SetGUID(target->GetGUID(), GUID_FOG_TARGET); + } + } + } + void FilterTargets(std::list& targets) { targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SLEEP)); @@ -699,6 +758,7 @@ public: void Register() override { + OnEffectHitTarget += SpellEffectFn(spell_dream_fog_sleep_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA); OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; From 4fa0d6b0ccfeba9937c0a1245a46644a6e4fbc04 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 15 Aug 2022 06:10:55 -0300 Subject: [PATCH 146/161] fix(Scripts/RuinsOfAhnQiraj): Rework Ayamiss (#12738) * fix(Scripts/RuinsOfAhnQiraj): Rework Ayamiss - Use serverside spells to handle the Hive'Zara Swarmers - Adjust pathing and timers - Rewrite its script to TaskScheduler Co-Authored-By: Gultask <100873791+Gultask@users.noreply.github.com> * fix swarmers not being summoned if the boss is casting & movement * Update landing path for swarmers * fix: Update the looping script * correct trash ability * fix ayamiss landing Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> --- .../rev_1660487670384321500.sql | 157 +++++++++ .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 319 +++++++++++++----- 2 files changed, 394 insertions(+), 82 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1660487670384321500.sql diff --git a/data/sql/updates/pending_db_world/rev_1660487670384321500.sql b/data/sql/updates/pending_db_world/rev_1660487670384321500.sql new file mode 100644 index 000000000..be2b596c0 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660487670384321500.sql @@ -0,0 +1,157 @@ +-- +DELETE FROM `spell_target_position` WHERE `ID` IN (25708, 25709, 25825, 25826, 25827, 25828); +INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES +(25708, 0, 509, -9846, 1353, 106.083336, 0, 0), +(25709, 0, 509, -9757.87, 1416.71, 76.7664, 0, 0), +(25825, 0, 509, -9805.95, 1422.85, 77.5852, 0, 0), +(25826, 0, 509, -9827.58, 1506.28, 82.3052, 0, 0), +(25827, 0, 509, -9778.91, 1419.98, 61.0743, 0, 0), +(25828, 0, 509, -9829.42, 1456.37, 90.7015, 0, 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_ayamiss_swarmer_teleport_trigger'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(25830, 'spell_ayamiss_swarmer_teleport_trigger'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_ayamiss_swarmer_swarm'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(25844, 'spell_ayamiss_swarmer_swarm'); + +UPDATE `spell_dbc` SET `Effect_1` = 28, `EffectMiscValueB_1` = 64, `EffectBasePoints_1` = 1, `EffectDieSides_1` = 0 WHERE `ID` = 25708; + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_ayamiss_swarmer_start_loop'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(25711, 'spell_ayamiss_swarmer_start_loop'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_ayamiss_swarmer_loop_1', 'spell_gen_ayamiss_swarmer_loop_2', 'spell_gen_ayamiss_swarmer_loop_3'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(25833, 'spell_gen_ayamiss_swarmer_loop_1'), +(25834, 'spell_gen_ayamiss_swarmer_loop_2'), +(25835, 'spell_gen_ayamiss_swarmer_loop_3'); + +UPDATE `creature_template` SET `ScriptName` = 'npc_hive_zara_swarmer' WHERE `entry` = 15546; + +SET @NPC := 15546; +SET @PATH := @NPC * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9758.247, 1426.3112, 84.167656, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9762.383, 1436.3455, 84.428795, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9760.481, 1452.1432, 75.32612, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9754.527, 1466.5826, 61.60388, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9750.208, 1479.4608, 45.937202, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 1) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9804.298, 1432.3503, 85.9217, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9799.983, 1443.1294, 82.55095, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9785.31, 1456.0002, 76.88425, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9769.325, 1467.856, 68.520706, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9750.661, 1477.6143, 48.96516, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 2) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9818.727, 1512.838, 89.24695, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9812.264, 1511.9375, 87.49864, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9806.9375, 1505.4645, 83.19313, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9796.596, 1494.5698, 76.8735, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9781.221, 1486.8652, 71.7902, 0, 0, 0, 0, 100, 0), +(@PATH, 6, -9765.105, 1476.7782, 63.17909, 0, 0, 0, 0, 100, 0), +(@PATH, 7, -9753.014, 1478.1317, 50.817974, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 3) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9776.323, 1428.8531, 65.629776, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9776.123, 1436.0718, 67.35508, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9764.125, 1455.0714, 66.27153, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9754.778, 1466.8633, 62.577053, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9747.529, 1473.6367, 49.077087, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 4) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9818.173, 1460.0463, 95.69417, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9811.176, 1460.6091, 92.56013, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9802.768, 1455.1123, 86.143425, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9797.88, 1450.7151, 81.69902, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9761.196, 1470.298, 64.64121, 0, 0, 0, 0, 100, 0), +(@PATH, 6, -9754.684, 1475.3403, 49.030098, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 5) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9745.072, 1489.5533, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9745.766, 1502.0659, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9734.748, 1502.8883, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9715.551, 1496.5533, 42.267452, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9697.712, 1511.8822, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 6, -9694.466, 1539.3663, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 7, -9696.591, 1561.1914, 41.37858, 0, 0, 0, 0, 100, 0), +(@PATH, 8, -9667.614, 1571.5212, 43.489666, 0, 0, 0, 0, 100, 0), +(@PATH, 9, -9653.44, 1552.1632, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 10, -9612.033, 1551.3334, 39.26745, 0, 0, 0, 0, 100, 0), +(@PATH, 11, -9582.261, 1572.4617, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 12, -9598.483, 1615.416, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 13, -9638.286, 1645.0948, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 14, -9682.366, 1625.8219, 37.211887, 0, 0, 0, 0, 100, 0), +(@PATH, 15, -9667.457, 1593.8171, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 16, -9625.382, 1598.9684, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 17, -9618.158, 1566.9963, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 18, -9661.183, 1554.485, 42.489677, 0, 0, 0, 0, 100, 0), +(@PATH, 19, -9690.858, 1543.3951, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 20, -9711.017, 1540.3297, 43.517445, 0, 0, 0, 0, 100, 0), +(@PATH, 21, -9736.964, 1511.8362, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 22, -9725.431, 1487.6272, 44.323, 0, 0, 0, 0, 100, 0), +(@PATH, 23, -9742.012, 1485.945, 44.323, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 6) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9748.129, 1488.4904, 45.764896, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9748.667, 1498.9249, 47.07047, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9744.251, 1508.8634, 46.820465, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9713.56, 1502.6979, 43.542686, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9701.453, 1522.0952, 43.542686, 0, 0, 0, 0, 100, 0), +(@PATH, 6, -9702.735, 1548.3297, 40.987125, 0, 0, 0, 0, 100, 0), +(@PATH, 7, -9682.249, 1544.3987, 41.12602, 0, 0, 0, 0, 100, 0), +(@PATH, 8, -9661.323, 1537.9355, 42.959347, 0, 0, 0, 0, 100, 0), +(@PATH, 9, -9647.55, 1544.9911, 42.959347, 0, 0, 0, 0, 100, 0), +(@PATH, 10, -9651.3125, 1565.7776, 42.98713, 0, 0, 0, 0, 100, 0), +(@PATH, 11, -9657.682, 1593.8557, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 12, -9684.013, 1619.9458, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 13, -9645.765, 1642.1168, 50.042664, 0, 0, 0, 0, 100, 0), +(@PATH, 14, -9618.591, 1606.9883, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 15, -9624.827, 1566.3673, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 16, -9662.095, 1559.2485, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 17, -9689.207, 1559.972, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 18, -9692.733, 1523.6748, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 19, -9731.375, 1527.3365, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 20, -9729.185, 1490.0042, 45.070454, 0, 0, 0, 0, 100, 0), +(@PATH, 21, -9745.345, 1485.0509, 45.487125, 0, 0, 0, 0, 100, 0); + +SET @PATH := (@NPC + 7) * 10; +DELETE FROM `waypoint_data` WHERE `id` = @PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, -9745.88, 1488.399, 45.917397, 0, 0, 0, 0, 100, 0), +(@PATH, 2, -9744.661, 1507.4883, 46.028458, 0, 0, 0, 0, 100, 0), +(@PATH, 3, -9735.175, 1527.706, 43.806267, 0, 0, 0, 0, 100, 0), +(@PATH, 4, -9701.6455, 1545.9641, 44.3896, 0, 0, 0, 0, 100, 0), +(@PATH, 5, -9658.681, 1541.812, 43.472916, 0, 0, 0, 0, 100, 0), +(@PATH, 6, -9616.4375, 1554.6978, 41.278492, 0, 0, 0, 0, 100, 0), +(@PATH, 7, -9583.255, 1572.3322, 42.61181, 0, 0, 0, 0, 100, 0), +(@PATH, 8, -9594.106, 1611.233, 43.16736, 0, 0, 0, 0, 100, 0), +(@PATH, 9, -9626.409, 1625.0471, 40.945137, 0, 0, 0, 0, 100, 0), +(@PATH, 10, -9665.356, 1653.7917, 45.472958, 0, 0, 0, 0, 100, 0), +(@PATH, 11, -9684.14, 1617.8658, 42.111813, 0, 0, 0, 0, 100, 0), +(@PATH, 12, -9687.5625, 1573.8448, 43.97294, 0, 0, 0, 0, 100, 0), +(@PATH, 13, -9690.304, 1535.7795, 44.167366, 0, 0, 0, 0, 100, 0), +(@PATH, 14, -9711.632, 1498.4967, 41.334064, 0, 0, 0, 0, 100, 0), +(@PATH, 15, -9741.987, 1484.3424, 45.7785, 0, 0, 0, 0, 100, 0); + +DELETE FROM `creature_addon` WHERE `guid` = 144641; + +DELETE FROM `creature_template_movement` WHERE `CreatureId` = 15369; +INSERT INTO `creature_template_movement` (`CreatureId`, `Ground`, `Swim`, `Flight`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES +(15369, 1, 0, 1, 0, 0, NULL); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 1f2e880db..41204a176 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -18,7 +18,9 @@ #include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "ruins_of_ahnqiraj.h" +#include "TaskScheduler.h" enum Spells { @@ -28,22 +30,31 @@ enum Spells SPELL_FRENZY = 8269, SPELL_LASH = 25852, SPELL_FEED = 25721, + SPELL_THRASH = 3391, // Server-side spells - SPELL_SUMMON_LARVA_A = 26538, - SPELL_SUMMON_LARVA_B = 26539, - SPELL_LARVA_AGGRO_EFFECT = 25724, // Unknown purpose - SPELL_LARVA_FEAR_EFFECT = 25726, // Unknown purpose + SPELL_SUMMON_LARVA_A = 26538, + SPELL_SUMMON_LARVA_B = 26539, + SPELL_LARVA_AGGRO_EFFECT = 25724, // Unknown purpose + SPELL_LARVA_FEAR_EFFECT = 25726, // Unknown purpose + SPELL_SUMMON_HIVEZARA_SWARMER = 25708, + SPELL_HIVEZARA_SWARMER_TELEPORT_1 = 25709, + SPELL_HIVEZARA_SWARMER_TELEPORT_2 = 25825, + SPELL_HIVEZARA_SWARMER_TELEPORT_3 = 25826, + SPELL_HIVEZARA_SWARMER_TELEPORT_4 = 25827, + SPELL_HIVEZARA_SWARMER_TELEPORT_5 = 25828, + SPELL_HIVEZARA_SWARMER_TELEPORT_TRIGGER = 25830, + SPELL_HIVEZARA_SWARMER_START_LOOP = 25711, + SPELL_HIVEZARA_SWARMER_LOOP_1 = 25833, + SPELL_HIVEZARA_SWARMER_LOOP_2 = 25834, + SPELL_HIVEZARA_SWARMER_LOOP_3 = 25835, + SPELL_HIVEZARA_SWARMER_SWARM = 25844 }; -enum Events +enum Misc { - EVENT_STINGER_SPRAY = 1, - EVENT_POISON_STINGER = 2, - EVENT_SUMMON_SWARMER = 3, - EVENT_SWARMER_ATTACK = 4, - EVENT_PARALYZE = 5, - EVENT_LASH = 6 + MAX_SWARMER_COUNT = 28, + ACTION_SWARMER_SWARM = 1, }; enum Emotes @@ -66,8 +77,6 @@ enum Points const Position AyamissAirPos = { -9689.292f, 1547.912f, 48.02729f, 0.0f }; const Position AltarPos = { -9717.18f, 1517.72f, 27.4677f, 0.0f }; -/// @todo These below are probably incorrect, taken from SD2 -const Position SwarmerPos = { -9647.352f, 1578.062f, 55.32f, 0.0f }; struct boss_ayamiss : public BossAI { @@ -79,6 +88,7 @@ struct boss_ayamiss : public BossAI _phase = PHASE_AIR; _enraged = false; SetCombatMovement(false); + _scheduler.CancelAll(); } void JustSummoned(Creature* who) override @@ -86,12 +96,14 @@ struct boss_ayamiss : public BossAI switch (who->GetEntry()) { case NPC_HIVEZARA_SWARMER: + who->CastSpell(who, SPELL_HIVEZARA_SWARMER_TELEPORT_TRIGGER, true); _swarmers.push_back(who->GetGUID()); break; case NPC_HIVEZARA_LARVA: who->GetMotionMaster()->MovePoint(POINT_PARALYZE, AltarPos); break; } + summons.Summon(who); } @@ -104,6 +116,7 @@ struct boss_ayamiss : public BossAI else if (type == WAYPOINT_MOTION_TYPE && id == POINT_GROUND) { SetCombatMovement(true); + me->m_Events.AddEventAtOffset([this]() { if (me->GetVictim()) @@ -115,6 +128,55 @@ struct boss_ayamiss : public BossAI } } + void ScheduleTasks() + { + _scheduler.Schedule(20s, 30s, [this](TaskContext context) + { + DoCastSelf(SPELL_STINGER_SPRAY); + context.Repeat(15s, 20s); + }).Schedule(5s, [this](TaskContext context) { + DoCastVictim(SPELL_POISON_STINGER); + context.SetGroup(PHASE_AIR); + context.Repeat(2s, 3s); + }).Schedule(5s, [this](TaskContext context) { + DoCastAOE(SPELL_SUMMON_HIVEZARA_SWARMER, true); + + if (_swarmers.size() >= MAX_SWARMER_COUNT) + { + DoCastAOE(SPELL_HIVEZARA_SWARMER_SWARM, true); + } + + context.Repeat(RAND(2400ms, 3600ms)); + }).Schedule(15s, [this](TaskContext context) { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true)) + { + DoCast(target, SPELL_PARALYZE, true); + instance->SetGuidData(DATA_PARALYZED, target->GetGUID()); + DoCastAOE(RAND(SPELL_SUMMON_LARVA_A, SPELL_SUMMON_LARVA_B), true); + } + context.Repeat(); + }); + } + + void DoAction(int32 action) override + { + if (action == ACTION_SWARMER_SWARM) + { + for (ObjectGuid const& guid : _swarmers) + { + if (Creature* swarmer = me->GetMap()->GetCreature(guid)) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random)) + { + swarmer->AI()->AttackStart(target); + } + } + } + + _swarmers.clear(); + } + } + void EnterEvadeMode(EvadeReason why) override { me->ClearUnitState(UNIT_STATE_ROOT); @@ -125,14 +187,10 @@ struct boss_ayamiss : public BossAI void EnterCombat(Unit* attacker) override { BossAI::EnterCombat(attacker); - events.ScheduleEvent(EVENT_STINGER_SPRAY, 20s, 30s); - events.ScheduleEvent(EVENT_POISON_STINGER, 5s); - events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s); - events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60s); - events.ScheduleEvent(EVENT_PARALYZE, 15s); me->SetCanFly(true); me->SetDisableGravity(true); me->GetMotionMaster()->MovePoint(POINT_AIR, AyamissAirPos); + ScheduleTasks(); } void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override @@ -144,9 +202,19 @@ struct boss_ayamiss : public BossAI me->SetCanFly(false); me->SetDisableGravity(false); me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); - events.ScheduleEvent(EVENT_LASH, 5s, 8s); - events.CancelEvent(EVENT_POISON_STINGER); DoResetThreat(); + + _scheduler.Schedule(5s, 8s, [this](TaskContext context) { + DoCastVictim(SPELL_LASH); + context.Repeat(8s, 15s); + }).Schedule(16s, [this](TaskContext context) + { + DoCastSelf(SPELL_THRASH); + context.Repeat(); + }); + + _scheduler.DelayAll(5s); + _scheduler.CancelGroup(PHASE_AIR); } if (!_enraged && me->HealthBelowPctDamaged(20, damage)) @@ -162,66 +230,14 @@ struct boss_ayamiss : public BossAI if (!UpdateVictim()) return; - events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_STINGER_SPRAY: - DoCastSelf(SPELL_STINGER_SPRAY); - events.ScheduleEvent(EVENT_STINGER_SPRAY, 15s, 20s); - break; - case EVENT_POISON_STINGER: - DoCastVictim(SPELL_POISON_STINGER); - events.ScheduleEvent(EVENT_POISON_STINGER, 2s, 3s); - break; - case EVENT_PARALYZE: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0, true)) - { - DoCast(target, SPELL_PARALYZE, true); - instance->SetGuidData(DATA_PARALYZED, target->GetGUID()); - DoCastAOE(RAND(SPELL_SUMMON_LARVA_A, SPELL_SUMMON_LARVA_B), true); - } - events.ScheduleEvent(EVENT_PARALYZE, 15s); - break; - case EVENT_SWARMER_ATTACK: - for (ObjectGuid const& guid : _swarmers) - { - if (Creature* swarmer = me->GetMap()->GetCreature(guid)) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random)) - { - swarmer->AI()->AttackStart(target); - } - } - } - _swarmers.clear(); - events.ScheduleEvent(EVENT_SWARMER_ATTACK, 60s); - break; - case EVENT_SUMMON_SWARMER: - { - Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - Position spawnpos = me->GetRandomPoint(SwarmerPos, 80.0f); - spawnpos.RelocateOffset(offset); - if (Creature* wasp = me->SummonCreature(NPC_HIVEZARA_SWARMER, spawnpos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) - { - wasp->GetMotionMaster()->MoveRandom(10.0f); - } - events.ScheduleEvent(EVENT_SUMMON_SWARMER, 5s); - break; - } - case EVENT_LASH: - DoCastVictim(SPELL_LASH); - events.ScheduleEvent(EVENT_LASH, 8s, 15s); - break; - } - } - DoMeleeAttackIfReady(); + _scheduler.Update(diff, + std::bind(&BossAI::DoMeleeAttackIfReady, this)); } private: GuidList _swarmers; uint8 _phase; bool _enraged; + TaskScheduler _scheduler; Position homePos; }; @@ -234,14 +250,11 @@ struct npc_hive_zara_larva : public ScriptedAI void MovementInform(uint32 type, uint32 id) override { - if (type == POINT_MOTION_TYPE) + if (type == POINT_MOTION_TYPE && id == POINT_PARALYZE) { - if (id == POINT_PARALYZE) + if (Player* target = ObjectAccessor::GetPlayer(*me, _instance->GetGuidData(DATA_PARALYZED))) { - if (Player* target = ObjectAccessor::GetPlayer(*me, _instance->GetGuidData(DATA_PARALYZED))) - { - DoCast(target, SPELL_FEED); - } + DoCast(target, SPELL_FEED); } } } @@ -255,7 +268,6 @@ struct npc_hive_zara_larva : public ScriptedAI } void MoveInLineOfSight(Unit* who) override - { if (_instance->GetBossState(DATA_AYAMISS) == IN_PROGRESS) return; @@ -282,8 +294,151 @@ private: InstanceScript* _instance; }; +struct npc_hive_zara_swarmer : public ScriptedAI +{ + npc_hive_zara_swarmer(Creature* creature) : ScriptedAI(creature) { } + + void PathEndReached(uint32 /*pathId*/) override + { + // Delay is required because we are calling the movement generator from inside the pathing hook. + // If we issue another call here, it will be flushed before it is executed. + me->m_Events.AddEventAtOffset([this]() + { + DoCastSelf(SPELL_HIVEZARA_SWARMER_START_LOOP); + }, 1s); + } +}; + +struct WaspTeleportData +{ + uint32 spellId; + uint32 pathId; +}; + +class spell_ayamiss_swarmer_teleport_trigger : public SpellScript +{ + PrepareSpellScript(spell_ayamiss_swarmer_teleport_trigger); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo + ( { + SPELL_HIVEZARA_SWARMER_TELEPORT_1, SPELL_HIVEZARA_SWARMER_TELEPORT_2, + SPELL_HIVEZARA_SWARMER_TELEPORT_3, SPELL_HIVEZARA_SWARMER_TELEPORT_4, + SPELL_HIVEZARA_SWARMER_TELEPORT_5 + }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + WaspTeleportData telData[5] = + { + { SPELL_HIVEZARA_SWARMER_TELEPORT_1, NPC_HIVEZARA_SWARMER * 10 }, + { SPELL_HIVEZARA_SWARMER_TELEPORT_2, (NPC_HIVEZARA_SWARMER + 1) * 10 }, + { SPELL_HIVEZARA_SWARMER_TELEPORT_3, (NPC_HIVEZARA_SWARMER + 2) * 10 }, + { SPELL_HIVEZARA_SWARMER_TELEPORT_4, (NPC_HIVEZARA_SWARMER + 3) * 10 }, + { SPELL_HIVEZARA_SWARMER_TELEPORT_5, (NPC_HIVEZARA_SWARMER + 4) * 10 } + }; + + WaspTeleportData data = Acore::Containers::SelectRandomContainerElement(telData); + caster->CastSpell((Unit*)nullptr, data.spellId, true); + + uint32 pathId = data.pathId; + caster->m_Events.AddEventAtOffset([caster, pathId]() + { + caster->GetMotionMaster()->MovePath(pathId, false); + }, 1s); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_ayamiss_swarmer_teleport_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +class spell_ayamiss_swarmer_swarm : public SpellScript +{ + PrepareSpellScript(spell_ayamiss_swarmer_swarm); + + bool Load() override + { + return GetCaster()->GetEntry() == NPC_AYAMISS; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->ToCreature()->AI()->DoAction(ACTION_SWARMER_SWARM); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_ayamiss_swarmer_swarm::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +class spell_ayamiss_swarmer_start_loop : public SpellScript +{ + PrepareSpellScript(spell_ayamiss_swarmer_start_loop); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HIVEZARA_SWARMER_LOOP_1, SPELL_HIVEZARA_SWARMER_LOOP_2, SPELL_HIVEZARA_SWARMER_LOOP_3 }); + } + + bool Load() override + { + return GetCaster()->GetEntry() == NPC_HIVEZARA_SWARMER; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + uint32 loopSpells[3] = { SPELL_HIVEZARA_SWARMER_LOOP_1, SPELL_HIVEZARA_SWARMER_LOOP_2, SPELL_HIVEZARA_SWARMER_LOOP_3 }; + GetCaster()->CastSpell((Unit*)nullptr, Acore::Containers::SelectRandomContainerElement(loopSpells)); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_ayamiss_swarmer_start_loop::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +class spell_gen_ayamiss_swarmer_loop: public SpellScript +{ + PrepareSpellScript(spell_gen_ayamiss_swarmer_loop); + +public: + spell_gen_ayamiss_swarmer_loop(uint32 pathId) : SpellScript(), _pathId(pathId) { } + + bool Load() override + { + return GetCaster()->GetEntry() == NPC_HIVEZARA_SWARMER; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->ToCreature()->GetMotionMaster()->Clear(); + GetCaster()->ToCreature()->GetMotionMaster()->MovePath(_pathId, false); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_gen_ayamiss_swarmer_loop::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + +private: + uint32 _pathId; +}; + void AddSC_boss_ayamiss() { RegisterRuinsOfAhnQirajCreatureAI(boss_ayamiss); RegisterRuinsOfAhnQirajCreatureAI(npc_hive_zara_larva); + RegisterRuinsOfAhnQirajCreatureAI(npc_hive_zara_swarmer); + RegisterSpellScript(spell_ayamiss_swarmer_teleport_trigger); + RegisterSpellScript(spell_ayamiss_swarmer_swarm); + RegisterSpellScript(spell_ayamiss_swarmer_start_loop); + RegisterSpellScriptWithArgs(spell_gen_ayamiss_swarmer_loop, "spell_gen_ayamiss_swarmer_loop_1", (NPC_HIVEZARA_SWARMER + 5) * 10); + RegisterSpellScriptWithArgs(spell_gen_ayamiss_swarmer_loop, "spell_gen_ayamiss_swarmer_loop_2", (NPC_HIVEZARA_SWARMER + 6) * 10); + RegisterSpellScriptWithArgs(spell_gen_ayamiss_swarmer_loop, "spell_gen_ayamiss_swarmer_loop_3", (NPC_HIVEZARA_SWARMER + 7) * 10); } From a8787b9d229c95103be6e67ff98c156ec680d00b Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 09:13:12 +0000 Subject: [PATCH 147/161] chore(DB): import pending files Referenced commit(s): 4fa0d6b0ccfeba9937c0a1245a46644a6e4fbc04 --- .../rev_1660487670384321500.sql => db_world/2022_08_15_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660487670384321500.sql => db_world/2022_08_15_04.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1660487670384321500.sql b/data/sql/updates/db_world/2022_08_15_04.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1660487670384321500.sql rename to data/sql/updates/db_world/2022_08_15_04.sql index be2b596c0..f63d5a34f 100644 --- a/data/sql/updates/pending_db_world/rev_1660487670384321500.sql +++ b/data/sql/updates/db_world/2022_08_15_04.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_03 -> 2022_08_15_04 -- DELETE FROM `spell_target_position` WHERE `ID` IN (25708, 25709, 25825, 25826, 25827, 25828); INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES From 986cb2132b8bdf7528180d4433d25a4e300a67be Mon Sep 17 00:00:00 2001 From: temperrr Date: Mon, 15 Aug 2022 14:32:12 +0200 Subject: [PATCH 148/161] fix(DB/SAI): Zanzil zombie should not cast triggered abilities --- .../updates/pending_db_world/zanzilsmartscript.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 data/sql/updates/pending_db_world/zanzilsmartscript.sql diff --git a/data/sql/updates/pending_db_world/zanzilsmartscript.sql b/data/sql/updates/pending_db_world/zanzilsmartscript.sql new file mode 100644 index 000000000..5cdd523f0 --- /dev/null +++ b/data/sql/updates/pending_db_world/zanzilsmartscript.sql @@ -0,0 +1,11 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 1491; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1491) AND (`source_type` = 0) AND (`id` IN (0, 1)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(1491, 0, 0, 0, 0, 0, 100, 512, 3000, 6000, 7000, 8000, 0, 11, 9080, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Zanzil Naga - In Combat - Cast \'Hamstring\''), +(1491, 0, 1, 0, 0, 0, 100, 512, 4000, 5000, 10000, 11000, 0, 11, 12555, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Zanzil Naga - In Combat - Cast \'Pummel\''); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 1488; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1488) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(1488, 0, 0, 0, 0, 0, 100, 513, 2000, 3000, 0, 0, 0, 11, 7102, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Zanzil Zombie - In Combat - Cast \'Contagion of Rot\' (No Repeat)'); From 0fa783793ea2a6baf80efc83981b1d0d191d504d Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 12:34:23 +0000 Subject: [PATCH 149/161] chore(DB): import pending files Referenced commit(s): 986cb2132b8bdf7528180d4433d25a4e300a67be --- .../zanzilsmartscript.sql => db_world/2022_08_15_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/zanzilsmartscript.sql => db_world/2022_08_15_05.sql} (97%) diff --git a/data/sql/updates/pending_db_world/zanzilsmartscript.sql b/data/sql/updates/db_world/2022_08_15_05.sql similarity index 97% rename from data/sql/updates/pending_db_world/zanzilsmartscript.sql rename to data/sql/updates/db_world/2022_08_15_05.sql index 5cdd523f0..335c5db78 100644 --- a/data/sql/updates/pending_db_world/zanzilsmartscript.sql +++ b/data/sql/updates/db_world/2022_08_15_05.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_04 -> 2022_08_15_05 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 1491; DELETE FROM `smart_scripts` WHERE (`entryorguid` = 1491) AND (`source_type` = 0) AND (`id` IN (0, 1)); From d0d1671745e5196e3eb9083b3a546b14b7de34c6 Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:43:41 +0200 Subject: [PATCH 150/161] feat(Core/Debug): GetDebugInfo implementation (#12705) Cherry-pick: https://github.com/TrinityCore/TrinityCore/commit/9a924fb9d557434c5a2e4020c80db6e6bfe466ad Co-authored-by: jackpoz Co-authored-by: jackpoz --- src/server/game/AI/CoreAI/UnitAI.cpp | 8 ++++ src/server/game/AI/CoreAI/UnitAI.h | 2 + .../game/Entities/Creature/Creature.cpp | 9 +++++ src/server/game/Entities/Creature/Creature.h | 2 + .../Entities/Creature/TemporarySummon.cpp | 25 ++++++++++++ .../game/Entities/Creature/TemporarySummon.h | 10 ++++- .../game/Entities/GameObject/GameObject.cpp | 8 ++++ .../game/Entities/GameObject/GameObject.h | 2 + .../game/Entities/Item/Container/Bag.cpp | 7 ++++ src/server/game/Entities/Item/Container/Bag.h | 3 +- src/server/game/Entities/Item/Item.cpp | 12 +++++- src/server/game/Entities/Item/Item.h | 2 + src/server/game/Entities/Object/Object.cpp | 16 ++++++++ src/server/game/Entities/Object/Object.h | 4 ++ src/server/game/Entities/Object/Position.cpp | 7 ++++ src/server/game/Entities/Object/Position.h | 2 + src/server/game/Entities/Pet/Pet.cpp | 10 +++++ src/server/game/Entities/Pet/Pet.h | 2 + src/server/game/Entities/Player/Player.cpp | 7 ++++ src/server/game/Entities/Player/Player.h | 2 + .../game/Entities/Transport/Transport.cpp | 7 ++++ .../game/Entities/Transport/Transport.h | 1 + src/server/game/Entities/Unit/Unit.cpp | 13 ++++++- src/server/game/Entities/Unit/Unit.h | 2 + src/server/game/Maps/Map.cpp | 18 +++++++++ src/server/game/Maps/Map.h | 5 +++ src/server/game/Spells/Auras/SpellAuras.cpp | 39 ++++++++++++------- src/server/game/Spells/Auras/SpellAuras.h | 2 + src/server/game/Spells/Spell.cpp | 9 +++++ src/server/game/Spells/Spell.h | 2 + 30 files changed, 218 insertions(+), 20 deletions(-) diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index baf48ef86..761a01ac0 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -106,6 +106,14 @@ float UnitAI::DoGetSpellMaxRange(uint32 spellId, bool positive) return spellInfo ? spellInfo->GetMaxRange(positive) : 0; } +std::string UnitAI::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << std::boolalpha + << "Me: " << (me ? me->GetDebugInfo() : "NULL"); + return sstr.str(); +} + SpellCastResult UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid) { if (me->IsInCombat()) diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index ae24f2dcb..4f8b00d41 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -345,6 +345,8 @@ public: virtual void sQuestComplete(Player* /*player*/, Quest const* /*quest*/) {} virtual void sQuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) {} virtual void sOnGameEvent(bool /*start*/, uint16 /*eventId*/) {} + + virtual std::string GetDebugInfo() const; }; class PlayerAI : public UnitAI diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 046d404a8..99fa625f8 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -3664,3 +3664,12 @@ uint32 Creature::GetPlayerDamageReq() const { return _playerDamageReq; } + +std::string Creature::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Unit::GetDebugInfo() << "\n" + << "AIName: " << GetAIName() << " ScriptName: " << GetScriptName() + << " WaypointPath: " << GetWaypointPath() << " SpawnId: " << GetSpawnId(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 447515ebc..0dbc3fb04 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -384,6 +384,8 @@ public: void ModifyThreatPercentTemp(Unit* victim, int32 percent, Milliseconds duration); + std::string GetDebugInfo() const override; + 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/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 9f3c289e5..a76ea477f 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -320,6 +320,15 @@ void TempSummon::RemoveFromWorld() Creature::RemoveFromWorld(); } +std::string TempSummon::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Creature::GetDebugInfo() << "\n" + << std::boolalpha + << "TempSummonType : " << std::to_string(GetSummonType()) << " Summoner: " << GetSummonerGUID().ToString(); + return sstr.str(); +} + Minion::Minion(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : TempSummon(properties, owner, isWorldObject) , m_owner(owner) { @@ -378,6 +387,15 @@ void Minion::setDeathState(DeathState s, bool despawn) } } +std::string Minion::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << TempSummon::GetDebugInfo() << "\n" + << std::boolalpha + << "Owner: " << (GetOwner() ? GetOwner()->GetGUID().ToString() : ""); + return sstr.str(); +} + Guardian::Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : Minion(properties, owner, isWorldObject) { m_unitTypeMask |= UNIT_MASK_GUARDIAN; @@ -416,6 +434,13 @@ void Guardian::InitSummon() } } +std::string Guardian::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Minion::GetDebugInfo(); + return sstr.str(); +} + Puppet::Puppet(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner, false), m_owner(owner) //maybe true? { ASSERT(owner.IsPlayer()); diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index c9700e8da..3e005270f 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -52,12 +52,14 @@ public: [[nodiscard]] Unit* GetSummonerUnit() const; [[nodiscard]] Creature* GetSummonerCreatureBase() const; [[nodiscard]] GameObject* GetSummonerGameObject() const; - ObjectGuid GetSummonerGUID() { return m_summonerGUID; } - TempSummonType const& GetSummonType() { return m_type; } + ObjectGuid GetSummonerGUID() const { return m_summonerGUID; } + TempSummonType GetSummonType() const { return m_type; } uint32 GetTimer() { return m_timer; } void SetTimer(uint32 t) { m_timer = t; } const SummonPropertiesEntry* const m_Properties; + + std::string GetDebugInfo() const override; private: TempSummonType m_type; uint32 m_timer; @@ -77,6 +79,8 @@ public: [[nodiscard]] bool IsPetGhoul() const {return GetEntry() == 26125 /*normal ghoul*/ || GetEntry() == 30230 /*Raise Ally ghoul*/;} // Ghoul may be guardian or pet [[nodiscard]] bool IsGuardianPet() const; void setDeathState(DeathState s, bool despawn = false) override; // override virtual Unit::setDeathState + + std::string GetDebugInfo() const override; protected: const ObjectGuid m_owner; float m_followAngle; @@ -97,6 +101,8 @@ public: void UpdateMaxPower(Powers power) override; void UpdateAttackPowerAndDamage(bool ranged = false) override; void UpdateDamagePhysical(WeaponAttackType attType) override; + + std::string GetDebugInfo() const override; }; class Puppet : public Minion diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 65dbaadd1..dfc3b0628 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -3090,3 +3090,11 @@ bool GameObject::IsInSkillupList(ObjectGuid playerGuid) const return false; } + +std::string GameObject::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << WorldObject::GetDebugInfo() << "\n" + << "SpawnId: " << GetSpawnId() << " GoState: " << std::to_string(GetGoState()) << " ScriptId: " << GetScriptId() << " AIName: " << GetAIName(); + return sstr.str(); +} diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index a13a1be39..458189d1a 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -1060,6 +1060,8 @@ public: void UpdateSaveToDb(bool enable); void SavingStateOnDB(); + + std::string GetDebugInfo() const override; protected: bool AIM_Initialize(); GameObjectModel* CreateModel(); diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index 4d887f082..ad7164c56 100644 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -239,3 +239,10 @@ Item* Bag::GetItemByPos(uint8 slot) const return nullptr; } + +std::string Bag::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Item::GetDebugInfo(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index afd59d1c5..dfe7654f8 100644 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -35,7 +35,6 @@ public: bool Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owner) override; - void Clear(); void StoreItem(uint8 slot, Item* pItem, bool update); void RemoveItem(uint8 slot, bool update); @@ -58,6 +57,8 @@ public: void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override; + std::string GetDebugInfo() const override; + protected: // Bag Storage space Item* m_bagslot[MAX_BAG_SIZE]; diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 01149086f..bfcb13892 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1097,7 +1097,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clo if (count > pProto->GetMaxStackSize()) count = pProto->GetMaxStackSize(); - ASSERT(count != 0 && "pProto->Stackable == 0 but checked at loading already"); + ASSERT_NODEBUGINFO(count != 0 && "pProto->Stackable == 0 but checked at loading already"); Item* pItem = NewItemOrBag(pProto); if (pItem->Create(sObjectMgr->GetGenerator().Generate(), item, player)) @@ -1287,3 +1287,13 @@ bool Item::CheckSoulboundTradeExpire() return false; } + +std::string Item::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Object::GetDebugInfo() << "\n" + << std::boolalpha + << "Owner: " << GetOwnerGUID().ToString() << " Count: " << GetCount() + << " BagSlot: " << std::to_string(GetBagSlot()) << " Slot: " << std::to_string(GetSlot()) << " Equipped: " << IsEquipped(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 6be9b0cfe..300e7a6a1 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -353,6 +353,8 @@ public: void RemoveFromObjectUpdate() override; [[nodiscard]] uint32 GetScriptId() const { return GetTemplate()->ScriptId; } + + std::string GetDebugInfo() const override; private: std::string m_text; uint8 m_slot; diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index ac23ffbaf..506f4c3f9 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1010,6 +1010,13 @@ bool Object::PrintIndexError(uint32 index, bool set) const return false; } +std::string Object::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << GetGUID().ToString() + " Entry " << GetEntry(); + return sstr.str(); +} + void MovementInfo::OutDebug() { LOG_INFO("movement", "MOVEMENT INFO"); @@ -2419,6 +2426,15 @@ Player* WorldObject::SelectNearestPlayer(float distance) const return target; } +std::string WorldObject::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << WorldLocation::GetDebugInfo() << "\n" + << Object::GetDebugInfo() << "\n" + << "Name: " << GetName(); + return sstr.str(); +} + void WorldObject::GetGameObjectListWithEntryInGrid(std::list& gameobjectList, uint32 entry, float maxSearchRange) const { Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index bb1bbb476..a7dcd97e3 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -208,6 +208,8 @@ public: DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast(this); else return nullptr; } [[nodiscard]] DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast(this); else return nullptr; } + virtual std::string GetDebugInfo() const; + DataMap CustomData; protected: @@ -613,6 +615,8 @@ public: [[nodiscard]] bool HasAllowedLooter(ObjectGuid guid) const; [[nodiscard]] GuidUnorderedSet const& GetAllowedLooters() const; + std::string GetDebugInfo() const override; + ElunaEventProcessor* elunaEvents; protected: diff --git a/src/server/game/Entities/Object/Position.cpp b/src/server/game/Entities/Object/Position.cpp index a4920bfb4..90302ac4c 100644 --- a/src/server/game/Entities/Object/Position.cpp +++ b/src/server/game/Entities/Object/Position.cpp @@ -208,3 +208,10 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st buf << x << y << z << o; return buf; } + +std::string WorldLocation::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << "MapID: " << m_mapId << " " << Position::ToString(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Object/Position.h b/src/server/game/Entities/Object/Position.h index 98f51e86b..8b87368d1 100644 --- a/src/server/game/Entities/Object/Position.h +++ b/src/server/game/Entities/Object/Position.h @@ -317,6 +317,8 @@ public: } uint32 m_mapId; + + std::string GetDebugInfo() const; }; ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYStreamer const& streamer); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 79ea17ede..dd78a94b7 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2439,3 +2439,13 @@ std::string Pet::GenerateActionBarData() const return oss.str(); } + +std::string Pet::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Guardian::GetDebugInfo() << "\n" + << std::boolalpha + << "PetType: " << std::to_string(getPetType()) << " " + << "PetNumber: " << m_charmInfo->GetPetNumber(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 2f9b84167..12086749d 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -143,6 +143,8 @@ public: void SetLoading(bool load) { m_loading = load; } [[nodiscard]] bool HasTempSpell() const { return m_tempspell != 0; } + + std::string GetDebugInfo() const override; protected: Player* m_owner; int32 m_happinessTimer; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2aa7b694c..ebf6681ea 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -15972,3 +15972,10 @@ uint32 Player::GetSpellCooldownDelay(uint32 spell_id) const SpellCooldowns::const_iterator itr = m_spellCooldowns.find(spell_id); return uint32(itr != m_spellCooldowns.end() && itr->second.end > getMSTime() ? itr->second.end - getMSTime() : 0); } + +std::string Player::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Unit::GetDebugInfo(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 8744b409e..5f9cd4f68 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2558,6 +2558,8 @@ public: [[nodiscard]] PlayerSetting GetPlayerSetting(std::string source, uint8 index); void UpdatePlayerSetting(std::string source, uint8 index, uint32 value); + std::string GetDebugInfo() const override; + protected: // Gamemaster whisper whitelist WhisperListContainer WhisperList; diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 841dd1b69..89e1e329f 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -1004,3 +1004,10 @@ void StaticTransport::RemovePassenger(WorldObject* passenger, bool withAll) } } } + +std::string MotionTransport::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << GameObject::GetDebugInfo(); + return sstr.str(); +} diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index 98aae380f..75fc9f9ee 100644 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -78,6 +78,7 @@ public: uint32 GetPeriod() const { return GetUInt32Value(GAMEOBJECT_LEVEL); } void SetPeriod(uint32 period) { SetUInt32Value(GAMEOBJECT_LEVEL, period); } + std::string GetDebugInfo() const override; private: void MoveToNextWaypoint(); float CalculateSegmentPos(float perc); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2eda1f171..9e6bf78f2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1117,7 +1117,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage { Player* he = duel_wasMounted ? victim->GetCharmer()->ToPlayer() : victim->ToPlayer(); - ASSERT(he && he->duel); + ASSERT_NODEBUGINFO(he && he->duel); if (duel_wasMounted) // In this case victim==mount victim->SetHealth(1); @@ -20809,3 +20809,14 @@ bool Unit::IsInDisallowedMountForm() const return false; } + +std::string Unit::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << WorldObject::GetDebugInfo() << "\n" + << std::boolalpha + << "AliveState: " << IsAlive() + << " UnitMovementFlags: " << GetUnitMovementFlags() << " ExtraUnitMovementFlags: " << GetExtraUnitMovementFlags() + << " Class: " << std::to_string(getClass()); + return sstr.str(); +} diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index d5372a15f..ec2151596 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -2426,6 +2426,8 @@ public: [[nodiscard]] bool CanRestoreMana(SpellInfo const* spellInfo) const; + std::string GetDebugInfo() const override; + protected: explicit Unit (bool isWorldObject); diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 6e604bb6f..2113756da 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -4021,3 +4021,21 @@ void Map::DeleteCorpseData() stmt->SetData(1, GetInstanceId()); CharacterDatabase.Execute(stmt); } + +std::string Map::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << std::boolalpha + << "Id: " << GetId() << " InstanceId: " << GetInstanceId() << " Difficulty: " << std::to_string(GetDifficulty()) + << " HasPlayers: " << HavePlayers(); + return sstr.str(); +} + +std::string InstanceMap::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << Map::GetDebugInfo() << "\n" + << std::boolalpha + << "ScriptId: " << GetScriptId() << " ScriptName: " << GetScriptName(); + return sstr.str(); +} diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index cfa5fba90..a0aa1f82f 100644 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -649,6 +649,8 @@ public: return m_activeNonPlayers.size(); } + virtual std::string GetDebugInfo() const; + private: void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); @@ -830,6 +832,9 @@ public: [[nodiscard]] uint32 GetMaxResetDelay() const; void InitVisibilityDistance() override; + + std::string GetDebugInfo() const override; + private: bool m_resetAfterUnload; bool m_unloadWhenEmpty; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 28c979e86..0a9e80332 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -297,8 +297,8 @@ void AuraApplication::ClientUpdate(bool remove) uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner) { - ASSERT(spellProto); - ASSERT(owner); + ASSERT_NODEBUGINFO(spellProto); + ASSERT_NODEBUGINFO(owner); uint8 effMask = 0; switch (owner->GetTypeId()) { @@ -325,10 +325,10 @@ uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleE Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool* refresh /*= nullptr*/, bool periodicReset /*= false*/) { - ASSERT(spellproto); - ASSERT(owner); - ASSERT(caster || casterGUID); - ASSERT(tryEffMask <= MAX_EFFECT_MASK); + ASSERT_NODEBUGINFO(spellproto); + ASSERT_NODEBUGINFO(owner); + ASSERT_NODEBUGINFO(caster || casterGUID); + ASSERT_NODEBUGINFO(tryEffMask <= MAX_EFFECT_MASK); if (refresh) *refresh = false; uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner); @@ -351,10 +351,10 @@ Aura* Aura::TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMas Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, ObjectGuid itemGUID /*= ObjectGuid::Empty*/) { - ASSERT(spellproto); - ASSERT(owner); - ASSERT(caster || casterGUID); - ASSERT(tryEffMask <= MAX_EFFECT_MASK); + ASSERT_NODEBUGINFO(spellproto); + ASSERT_NODEBUGINFO(owner); + ASSERT_NODEBUGINFO(caster || casterGUID); + ASSERT_NODEBUGINFO(tryEffMask <= MAX_EFFECT_MASK); uint8 effMask = Aura::BuildEffectMaskForOwner(spellproto, tryEffMask, owner); if (!effMask) return nullptr; @@ -363,11 +363,11 @@ Aura* Aura::TryCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, ObjectGuid casterGUID, ObjectGuid itemGUID /*= ObjectGuid::Empty*/) { - ASSERT(effMask); - ASSERT(spellproto); - ASSERT(owner); - ASSERT(caster || casterGUID); - ASSERT(effMask <= MAX_EFFECT_MASK); + ASSERT_NODEBUGINFO(effMask); + ASSERT_NODEBUGINFO(spellproto); + ASSERT_NODEBUGINFO(owner); + ASSERT_NODEBUGINFO(caster || casterGUID); + ASSERT_NODEBUGINFO(effMask <= MAX_EFFECT_MASK); // try to get caster of aura if (casterGUID) { @@ -2707,6 +2707,15 @@ void Aura::SetTriggeredByAuraSpellInfo(SpellInfo const* triggeredByAuraSpellInfo m_triggeredByAuraSpellInfo = triggeredByAuraSpellInfo; } +std::string Aura::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << std::boolalpha + << "Id: " << GetId() << " Caster: " << GetCasterGUID().ToString() + << "\nOwner: " << (GetOwner() ? GetOwner()->GetDebugInfo() : "NULL"); + return sstr.str(); +} + SpellInfo const* Aura::GetTriggeredByAuraSpellInfo() const { return m_triggeredByAuraSpellInfo; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index bcf0d6408..4600a4242 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -236,6 +236,8 @@ public: std::list m_loadedScripts; + virtual std::string GetDebugInfo() const; + void SetTriggeredByAuraSpellInfo(SpellInfo const* triggeredByAuraSpellInfo); SpellInfo const* GetTriggeredByAuraSpellInfo() const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9abd5bbe1..96c554a5d 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -8866,6 +8866,15 @@ void TriggeredByAuraSpellData::Init(AuraEffect const* aurEff) tickNumber = aurEff->GetTickNumber(); } +std::string Spell::GetDebugInfo() const +{ + std::stringstream sstr; + sstr << std::boolalpha + << "Id: " << GetSpellInfo()->Id << " OriginalCaster: " << m_originalCasterGUID.ToString() + << " State: " << getState(); + return sstr.str(); +} + namespace Acore { diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 65f2d9bf7..d9a564871 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -606,6 +606,8 @@ public: Spell** m_selfContainer; // pointer to our spell container (if applicable) + std::string GetDebugInfo() const; + //Spell data SpellSchoolMask m_spellSchoolMask; // Spell school (can be overwrite for some spells (wand shoot for example) WeaponAttackType m_attackType; // For weapon based attack From ffa58395b748f452a8a9348501ef4d7422861849 Mon Sep 17 00:00:00 2001 From: UltraNix <80540499+UltraNix@users.noreply.github.com> Date: Mon, 15 Aug 2022 14:53:21 +0200 Subject: [PATCH 151/161] =?UTF-8?q?fix(Scripts/RuinsOfAhnQiraj):=20Ossiria?= =?UTF-8?q?n=20the=20Unscarred=20-=20Ossirian=20Crystals=20imp=E2=80=A6=20?= =?UTF-8?q?(#12654)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/AhnQiraj): Ossirian the Unscarred - Ossirian Crystals improvements: Added missing initial spawn of crystal. Added more crystal spawn points. Crystals should despawn on wipe. Fixes #12472 * Update. * Update. * Update. Co-authored-by: Angelo Venturini --- .../rev_1659875183606376700.sql | 2 + .../RuinsOfAhnQiraj/boss_ossirian.cpp | 164 ++++++++++++------ 2 files changed, 112 insertions(+), 54 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1659875183606376700.sql diff --git a/data/sql/updates/pending_db_world/rev_1659875183606376700.sql b/data/sql/updates/pending_db_world/rev_1659875183606376700.sql new file mode 100644 index 000000000..873fb58d6 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1659875183606376700.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject_template_addon` SET `flags`=`flags`|1 WHERE `entry`=180619; diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 291f1b0a0..e61163f57 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -64,20 +64,24 @@ enum Events EVENT_STOMP = 3 }; -uint8 const NUM_CRYSTALS = 9; +uint8 const NUM_CRYSTALS = 11; Position CrystalCoordinates[NUM_CRYSTALS] = { - { -9394.230469f, 1951.808594f, 85.97733f, 0.0f }, - { -9357.931641f, 1930.596802f, 85.556198f, 0.0f }, - { -9383.113281f, 2011.042725f, 85.556389f, 0.0f }, - { -9243.36f, 1979.04f, 85.556f, 0.0f }, - { -9281.68f, 1886.66f, 85.5558f, 0.0f }, - { -9241.8f, 1806.39f, 85.5557f, 0.0f }, - { -9366.78f, 1781.76f, 85.5561f, 0.0f }, - { -9430.37f, 1786.86f, 85.557f, 0.0f }, - { -9406.73f, 1863.13f, 85.5558f, 0.0f } + { -9388.4404296875f, 1940.20996093750f, 85.6390991210937f, 3.17650008201599f }, + { -9357.8603515625f, 1929.07995605469f, 85.6390991210937f, 1.06465005874634f }, + { -9383.2900390625f, 2012.68005371094f, 85.6511001586914f, 2.93214988708496f }, + { -9248.4101562500f, 1974.82995605469f, 85.6390991210937f, 5.89920997619629f }, + { -9432.4003906250f, 1782.53002929687f, 85.6390991210937f, 5.86430978775024f }, + { -9299.7304687500f, 1748.44995117187f, 85.6390991210937f, 1.44861996173859f }, + { -9406.0996093750f, 1862.38000488281f, 85.6390991210937f, 6.23082017898560f }, + { -9506.1904296875f, 1865.56994628906f, 85.6390991210937f, 4.27606010437012f }, + { -9282.0800781250f, 1887.33996582031f, 85.6390991210937f, 2.00712990760803f }, + { -9244.4101562500f, 1808.97998046875f, 85.6390991210937f, 5.63741016387939f }, + { -9367.1699218750f, 1780.89001464844f, 85.6390991210937f, 1.90241003036499f } }; +Position initialCrystalPosition = { -9407.7197265625f, 1960.2099609375f, 85.6390991210937f, 1.11700999736786f }; + uint8 const NUM_WEAKNESS = 5; uint32 const spellWeakness[NUM_WEAKNESS] = { SPELL_FIRE_WEAKNESS, SPELL_FROST_WEAKNESS, SPELL_NATURE_WEAKNESS, SPELL_ARCANE_WEAKNESS, SPELL_SHADOW_WEAKNESS }; @@ -89,12 +93,63 @@ struct boss_ossirian : public BossAI _saidIntro = false; } + void InitializeAI() override + { + Reset(); + + if (Creature* trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, initialCrystalPosition)) + { + _triggerGUID[0] = trigger->GetGUID(); + if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL, + initialCrystalPosition.GetPositionX(), + initialCrystalPosition.GetPositionY(), + initialCrystalPosition.GetPositionZ(), + 0, 0, 0, 0, 0, uint32(-1))) + { + _crystalGUID[0] = crystal->GetGUID(); + crystal->SetOwnerGUID(ObjectGuid::Empty); + crystal->RemoveGameObjectFlag(GO_FLAG_IN_USE); + } + } + } + void Reset() override { BossAI::Reset(); - _crystalIterator = 0; - _triggerGUID.Clear(); - _crystalGUID.Clear(); + + _crystalIterator = urand(0, NUM_CRYSTALS - 1); + _triggerGUID[1].Clear(); + _crystalGUID[1].Clear(); + } + + void JustReachedHome() override + { + if (me->IsVisible()) + { + Creature* trigger = me->GetMap()->GetCreature(_triggerGUID[0]); + if (trigger) + { + trigger->DespawnOrUnsummon(); + if (GameObject* crystal = me->GetMap()->GetGameObject(_crystalGUID[0])) + crystal->Delete(); + } + + trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, initialCrystalPosition); + if (trigger) + { + _triggerGUID[0] = trigger->GetGUID(); + if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL, + initialCrystalPosition.GetPositionX(), + initialCrystalPosition.GetPositionY(), + initialCrystalPosition.GetPositionZ(), + 0, 0, 0, 0, 0, uint32(-1))) + { + _crystalGUID[0] = crystal->GetGUID(); + crystal->SetOwnerGUID(ObjectGuid::Empty); + crystal->RemoveGameObjectFlag(GO_FLAG_IN_USE); + } + } + } } void SpellHit(Unit* caster, SpellInfo const* spell) override @@ -104,21 +159,37 @@ struct boss_ossirian : public BossAI if (spell->Id == weakness) { me->RemoveAurasDueToSpell(SPELL_STRENGHT_OF_OSSIRIAN); - ((TempSummon*)caster)->UnSummon(); - SpawnNextCrystal(); + + if (caster->GetGUID() == _triggerGUID[1]) + { + if (Creature* creatureCaster = caster->ToCreature()) + { + creatureCaster->DespawnOrUnsummon(); + } + } } } } - void DoAction(int32 action) override + void SetGUID(ObjectGuid guid, int32 action) override { if (action == ACTION_TRIGGER_WEAKNESS) { - if (Creature* trigger = me->GetMap()->GetCreature(_triggerGUID)) + for (uint8 i = 0; i < 2; ++i) { - if (!trigger->HasUnitState(UNIT_STATE_CASTING)) + if (_crystalGUID[i] == guid) { - trigger->CastSpell(trigger, spellWeakness[urand(0, 4)], false); + if (Creature* trigger = me->GetMap()->GetCreature(_triggerGUID[i])) + { + if (!trigger->HasUnitState(UNIT_STATE_CASTING)) + { + trigger->CastSpell(trigger, spellWeakness[urand(0, 4)], false); + } + } + + SpawnNextCrystal(); + + break; } } } @@ -144,66 +215,51 @@ struct boss_ossirian : public BossAI SpawnNextCrystal(); } + void SummonedCreatureDespawn(Creature* summon) override + { + summons.Despawn(summon); + + if (GameObject* crystal = GetClosestGameObjectWithEntry(summon, GO_OSSIRIAN_CRYSTAL, 5.0f)) + { + crystal->Delete(); + } + } + void KilledUnit(Unit* /*victim*/) override { Talk(SAY_SLAY); } - void EnterEvadeMode(EvadeReason why) override - { - Cleanup(); - summons.DespawnAll(); - BossAI::EnterEvadeMode(why); - } - - void JustDied(Unit* killer) override - { - Cleanup(); - BossAI::JustDied(killer); - } - - void Cleanup() - { - if (GameObject* crystal = me->GetMap()->GetGameObject(_crystalGUID)) - { - crystal->Use(me); - } - - std::list vortexes; - me->GetCreaturesWithEntryInRange(vortexes, 200.f, NPC_SAND_VORTEX); - for (Creature* vortex : vortexes) - vortex->DespawnOrUnsummon(); - } - void SpawnNextCrystal() { if (_crystalIterator == NUM_CRYSTALS) _crystalIterator = 0; - if (Creature* trigger = me->GetMap()->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[_crystalIterator])) + if (Creature* trigger = me->SummonCreature(NPC_OSSIRIAN_TRIGGER, CrystalCoordinates[_crystalIterator])) { - _triggerGUID = trigger->GetGUID(); + _triggerGUID[1] = trigger->GetGUID(); if (GameObject* crystal = trigger->SummonGameObject(GO_OSSIRIAN_CRYSTAL, CrystalCoordinates[_crystalIterator].GetPositionX(), CrystalCoordinates[_crystalIterator].GetPositionY(), CrystalCoordinates[_crystalIterator].GetPositionZ(), 0, 0, 0, 0, 0, uint32(-1))) { - _crystalGUID = crystal->GetGUID(); + _crystalGUID[1] = crystal->GetGUID(); ++_crystalIterator; crystal->SetOwnerGUID(ObjectGuid::Empty); + crystal->RemoveGameObjectFlag(GO_FLAG_IN_USE); } } } void MoveInLineOfSight(Unit* who) override - { if (!_saidIntro) { Talk(SAY_INTRO); _saidIntro = true; } + BossAI::MoveInLineOfSight(who); } @@ -260,8 +316,8 @@ struct boss_ossirian : public BossAI } protected: - ObjectGuid _triggerGUID; - ObjectGuid _crystalGUID; + std::array _triggerGUID; + std::array _crystalGUID; uint8 _crystalIterator; bool _saidIntro; }; @@ -271,17 +327,17 @@ class go_ossirian_crystal : public GameObjectScript public: go_ossirian_crystal() : GameObjectScript("go_ossirian_crystal") { } - bool OnGossipHello(Player* player, GameObject* /*go*/) override + bool OnGossipHello(Player* player, GameObject* go) override { InstanceScript* instance = player->GetInstanceScript(); if (!instance) return true; Creature* ossirian = instance->GetCreature(DATA_OSSIRIAN); - if (!ossirian || instance->GetBossState(DATA_OSSIRIAN) != IN_PROGRESS) + if (!ossirian) return true; - ossirian->AI()->DoAction(ACTION_TRIGGER_WEAKNESS); + ossirian->AI()->SetGUID(go->GetGUID(), ACTION_TRIGGER_WEAKNESS); return false; } }; From a2b5d9bfcfce8908609164e0c3512a43a28ad4fa Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 12:55:19 +0000 Subject: [PATCH 152/161] chore(DB): import pending files Referenced commit(s): ffa58395b748f452a8a9348501ef4d7422861849 --- .../rev_1659875183606376700.sql => db_world/2022_08_15_06.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1659875183606376700.sql => db_world/2022_08_15_06.sql} (65%) diff --git a/data/sql/updates/pending_db_world/rev_1659875183606376700.sql b/data/sql/updates/db_world/2022_08_15_06.sql similarity index 65% rename from data/sql/updates/pending_db_world/rev_1659875183606376700.sql rename to data/sql/updates/db_world/2022_08_15_06.sql index 873fb58d6..41eb9c252 100644 --- a/data/sql/updates/pending_db_world/rev_1659875183606376700.sql +++ b/data/sql/updates/db_world/2022_08_15_06.sql @@ -1,2 +1,3 @@ +-- DB update 2022_08_15_05 -> 2022_08_15_06 -- UPDATE `gameobject_template_addon` SET `flags`=`flags`|1 WHERE `entry`=180619; From 46e0b87e22273a447bff23d976a9bac329c64a67 Mon Sep 17 00:00:00 2001 From: Benjamin Jackson <38561765+heyitsbench@users.noreply.github.com> Date: Mon, 15 Aug 2022 11:14:10 -0400 Subject: [PATCH 153/161] fix(DB/Quest): Add Aqual Quintessence questline steps. (#12707) Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com> --- .../pending_db_world/hydraxian-quest.sql | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 data/sql/updates/pending_db_world/hydraxian-quest.sql diff --git a/data/sql/updates/pending_db_world/hydraxian-quest.sql b/data/sql/updates/pending_db_world/hydraxian-quest.sql new file mode 100644 index 000000000..88576cb4a --- /dev/null +++ b/data/sql/updates/pending_db_world/hydraxian-quest.sql @@ -0,0 +1,62 @@ +DELETE FROM `creature_queststarter` WHERE `quest` IN (6821, 6822, 6823, 6824, 7486) AND `id` = 13278; +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES +(13278, 6821), -- Eye of the Emberseer +(13278, 6822), -- The Molten Core +(13278, 6823), -- Agent of Hydraxis +(13278, 6824), -- Hands of the Enemy +(13278, 7486); -- A Hero's Reward + +DELETE FROM `creature_questender` WHERE `quest` IN (6804, 6821, 6822, 6823, 6824) AND `id` = 13278; +INSERT INTO `creature_questender` (`id`, `quest`) VALUES +(13278, 6804), -- Poisoned Water +(13278, 6821), -- Eye of the Emberseer +(13278, 6822), -- The Molten Core +(13278, 6823), -- Agent of Hydraxis +(13278, 6824); -- Hands of the Enemy + +DELETE FROM `quest_template_addon` WHERE `ID` IN (6821, 6822, 6823, 6824, 7486); +INSERT INTO `quest_template_addon` (`ID`, `PrevQuestID`, `NextQuestID`) VALUES +(6821, 6805, 6822), +(6822, 6021, 6823), +(6823, 6022, 6824), +(6824, 6823, 7486), +(7486, 6824, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceEntry` = 6821; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 6821, 0, 0, 47, 0, 6804, 64, 0, 0, 0, 0, '', 'Quest Eyes of the Emberseer available if quest Poisoned Water has been rewarded.'), +(19, 0, 6821, 0, 0, 47, 0, 6805, 64, 0, 0, 0, 0, '', 'Quest Eyes of the Emberseer available if quest Stormers and Rumblers has been rewarded.'); + +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 15) AND (`SourceGroup` = 5065) AND (`SourceId` IN (0, 1)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 5065, 0, 0, 0, 5, 0, 749, 224, 0, 0, 0, 0, '', 'Duke Hydraxis - Create Aqual Quintessence Gossip - Requires Honored Rep'), +(15, 5065, 0, 0, 0, 47, 0, 6824, 64, 0, 0, 0, 0, '', 'Duke Hydraxis - Aqual Quintessence Gossip available if quest Hand of the Enemy rewarded.'), +(15, 5065, 1, 0, 0, 5, 0, 749, 192, 0, 0, 0, 0, '', 'Duke Hydraxis - Create Eternal Quintessence Gossip - Requires Revered Rep'), +(15, 5065, 1, 0, 0, 47, 0, 6824, 64, 0, 0, 0, 0, '', 'Duke Hydraxis - Create Eternal Quintessence Gossip - Requires Hand of the Enemy rewarded'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceEntry` IN (6822, 6823, 6824, 7486); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 6822, 0, 0, 47, 0, 6821, 64, 0, 0, 0, 0, '', 'Quest Molten Core available if quest Eye of the Emberseer has been rewarded.'), +(19, 0, 6823, 0, 0, 47, 0, 6822, 64, 0, 0, 0, 0, '', 'Quest Agent of Hydraxis available if quest Molten Core has been rewarded.'), +(19, 0, 6824, 0, 0, 47, 0, 6823, 64, 0, 0, 0, 0, '', 'Quest Hands of the Enemy available if quest Agents of Hydraxis has been rewarded.'), +(19, 0, 7486, 0, 0, 47, 0, 6824, 64, 0, 0, 0, 0, '', 'Quest A Hero\'s Reward available if quest Hands of the Enemy has been rewarded.'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 19 AND `SourceEntry` IN (6822, 6823, 6824, 7486); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 6822, 0, 0, 47, 0, 6821, 64, 0, 0, 0, 0, '', 'Quest Molten Core available if quest Eye of the Emberseer has been rewarded.'), +(19, 0, 6823, 0, 0, 47, 0, 6822, 64, 0, 0, 0, 0, '', 'Quest Agent of Hydraxis available if quest Molten Core has been rewarded.'), +(19, 0, 6824, 0, 0, 47, 0, 6823, 64, 0, 0, 0, 0, '', 'Quest Hands of the Enemy available if quest Agents of Hydraxis has been rewarded.'), +(19, 0, 7486, 0, 0, 47, 0, 6824, 64, 0, 0, 0, 0, '', 'Quest A Hero\'s Reward available if quest Hands of the Enemy has been rewarded.'); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 13278; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 13278) AND (`source_type` = 0) AND (`id` IN (0, 1, 2, 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 +(13278, 0, 0, 1, 62, 0, 100, 0, 5065, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Duke Hydraxis - On Gossip Option 0 Selected - Close Gossip'), +(13278, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 56, 17333, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Duke Hydraxis - On Link - Add item \'Aqual Quintessence\''), +(13278, 0, 2, 3, 62, 0, 100, 0, 5065, 1, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Duke Hydraxis - On Gossip Option 1 Selected - Close Gossip'), +(13278, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 56, 22754, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Duke Hydraxis - On Link - Add item \' Eternal Quintessence\''); + +DELETE FROM `gossip_menu_option` WHERE `MenuID` = 5065 AND `OptionID` IN (0, 1); +INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES +(5065,0,0,'I require a vial of aqual quintessence, Hydraxis, for I go to the Molten Core to extinguish a rune of the Firelords.',8666,1,2,0,0,0,0,'',0,0), +(5065,1,0,'I desire this eternal quintessence, Duke Hydraxis.',12363,1,2,0,0,0,0,'',0,0); From c7a0fa1affa9ad300c228dc999a13bf4a3d97a58 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 15:16:20 +0000 Subject: [PATCH 154/161] chore(DB): import pending files Referenced commit(s): 46e0b87e22273a447bff23d976a9bac329c64a67 --- .../hydraxian-quest.sql => db_world/2022_08_15_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/hydraxian-quest.sql => db_world/2022_08_15_07.sql} (99%) diff --git a/data/sql/updates/pending_db_world/hydraxian-quest.sql b/data/sql/updates/db_world/2022_08_15_07.sql similarity index 99% rename from data/sql/updates/pending_db_world/hydraxian-quest.sql rename to data/sql/updates/db_world/2022_08_15_07.sql index 88576cb4a..1aef808c9 100644 --- a/data/sql/updates/pending_db_world/hydraxian-quest.sql +++ b/data/sql/updates/db_world/2022_08_15_07.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_06 -> 2022_08_15_07 DELETE FROM `creature_queststarter` WHERE `quest` IN (6821, 6822, 6823, 6824, 7486) AND `id` = 13278; INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES (13278, 6821), -- Eye of the Emberseer From cb887bbc229b131ff7e3cb96c4d89dc0e96b270a Mon Sep 17 00:00:00 2001 From: Angelo Venturini Date: Mon, 15 Aug 2022 17:51:20 -0300 Subject: [PATCH 155/161] fix(Core/TempleOfAhnQiraj): Ouro rewrite (#12683) --- .../rev_1660074715862707400.sql | 4 + src/server/game/AI/CoreAI/UnitAI.cpp | 18 + src/server/game/AI/CoreAI/UnitAI.h | 1 + .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 378 +++++++++++++----- .../instance_temple_of_ahnqiraj.cpp | 28 +- .../TempleOfAhnQiraj/temple_of_ahnqiraj.h | 5 +- 6 files changed, 340 insertions(+), 94 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1660074715862707400.sql diff --git a/data/sql/updates/pending_db_world/rev_1660074715862707400.sql b/data/sql/updates/pending_db_world/rev_1660074715862707400.sql new file mode 100644 index 000000000..ac19529df --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660074715862707400.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature_template` SET `unit_flags` = `unit_flags` | 33554432, `ScriptName` = 'npc_dirt_mound' WHERE `entry` = 15712; + +UPDATE `gameobject_template_addon` SET `flags` = `flags` | 16 WHERE `entry` = 180795; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 761a01ac0..1304a6cfe 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -90,6 +90,24 @@ bool UnitAI::DoSpellAttackIfReady(uint32 spell) return false; } +void UnitAI::DoSpellAttackToRandomTargetIfReady(uint32 spell, uint32 threatTablePosition /*= 0*/, float dist /*= 0.f*/, bool playerOnly /*= true*/) +{ + if (me->HasUnitState(UNIT_STATE_CASTING) || !me->isAttackReady()) + return; + + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell)) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, threatTablePosition, dist, playerOnly)) + { + if (me->IsWithinCombatRange(target, spellInfo->GetMaxRange(false))) + { + me->CastSpell(target, spell, false); + me->resetAttackTimer(); + } + } + } +} + Unit* UnitAI::SelectTarget(SelectTargetMethod targetType, uint32 position, float dist, bool playerOnly, int32 aura) { return SelectTarget(targetType, position, DefaultTargetSelector(me, dist, playerOnly, aura)); diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 4f8b00d41..a423997b9 100644 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -330,6 +330,7 @@ public: void DoMeleeAttackIfReady(); bool DoSpellAttackIfReady(uint32 spell); + void DoSpellAttackToRandomTargetIfReady(uint32 spell, uint32 threatTablePosition = 0, float dist = 0.f, bool playerOnly = true); static AISpellInfoType* AISpellInfo; static void FillAISpellInfo(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 59f655c92..974620cb8 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -15,25 +15,47 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Ouro -SD%Complete: 85 -SDComment: No model for submerging. Currently just invisible. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" +#include "Player.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "TaskScheduler.h" #include "temple_of_ahnqiraj.h" enum Spells { + // Ouro SPELL_SWEEP = 26103, - SPELL_SANDBLAST = 26102, + SPELL_SAND_BLAST = 26102, SPELL_GROUND_RUPTURE = 26100, - SPELL_BIRTH = 26262, // The Birth Animation + SPELL_BERSERK = 26615, + SPELL_BOULDER = 26616, + SPELL_OURO_SUBMERGE_VISUAL = 26063, + SPELL_SUMMON_SANDWORM_BASE = 26133, + + // Misc - Mounds, Ouro Spawner + SPELL_BIRTH = 26586, SPELL_DIRTMOUND_PASSIVE = 26092, - SPELL_SUMMON_OURO = 26061 + SPELL_SUMMON_OURO = 26061, + SPELL_SUMMON_OURO_MOUNDS = 26058, + SPELL_QUAKE = 26093, + SPELL_SUMMON_SCARABS = 26060, + SPELL_SUMMON_OURO_AURA = 26642, + SPELL_DREAM_FOG = 24780 +}; + +enum Misc +{ + GROUP_EMERGED = 0, + GROUP_PHASE_TRANSITION = 1, + + NPC_DIRT_MOUND = 15712, + GO_SANDWORM_BASE = 180795, + + DATA_OURO_HEALTH = 0 }; struct npc_ouro_spawner : public ScriptedAI @@ -48,15 +70,15 @@ struct npc_ouro_spawner : public ScriptedAI void Reset() override { hasSummoned = false; - DoCast(me, SPELL_DIRTMOUND_PASSIVE); + DoCastSelf(SPELL_DIRTMOUND_PASSIVE); } void MoveInLineOfSight(Unit* who) override { // Spawn Ouro on LoS check - if (!hasSummoned && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 40.0f)) + if (!hasSummoned && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 40.0f) && !who->ToPlayer()->IsGameMaster()) { - DoCast(me, SPELL_SUMMON_OURO); + DoCastSelf(SPELL_SUMMON_OURO); hasSummoned = true; } @@ -69,43 +91,170 @@ struct npc_ouro_spawner : public ScriptedAI if (creature->GetEntry() == NPC_OURO) { creature->SetInCombatWithZone(); - creature->CastSpell(creature, SPELL_BIRTH, false); me->DespawnOrUnsummon(); } } - }; -struct boss_ouro : public ScriptedAI +struct boss_ouro : public BossAI { - boss_ouro(Creature* creature) : ScriptedAI(creature) { } + boss_ouro(Creature* creature) : BossAI(creature, DATA_OURO) + { + SetCombatMovement(false); + me->SetControlled(true, UNIT_STATE_ROOT); + _scheduler.SetValidator([this] { return !me->HasUnitState(UNIT_STATE_CASTING); }); + } - uint32 Sweep_Timer; - uint32 SandBlast_Timer; - uint32 Submerge_Timer; - uint32 Back_Timer; - uint32 ChangeTarget_Timer; - uint32 Spawn_Timer; + void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override + { + if (me->HealthBelowPctDamaged(20, damage) && !_enraged) + { + DoCastSelf(SPELL_BERSERK, true); + _enraged = true; + _scheduler.CancelGroup(GROUP_PHASE_TRANSITION); + _scheduler.Schedule(1s, [this](TaskContext context) + { + if (!IsPlayerWithinMeleeRange()) + DoSpellAttackToRandomTargetIfReady(SPELL_BOULDER); - bool Enrage; - bool Submerged; + context.Repeat(); + }) + .Schedule(20s, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_OURO_MOUNDS, true); + context.Repeat(); + }); + } + } + + void Submerge() + { + me->AttackStop(); + me->SetReactState(REACT_PASSIVE); + me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + _submergeMelee = 0; + _submerged = true; + DoCastSelf(SPELL_OURO_SUBMERGE_VISUAL); + _scheduler.CancelGroup(GROUP_EMERGED); + _scheduler.CancelGroup(GROUP_PHASE_TRANSITION); + + if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 10.f)) + { + base->Use(me); + base->DespawnOrUnsummon(6s); + } + + DoCastSelf(SPELL_SUMMON_OURO_MOUNDS, true); + // According to sniffs, Ouro uses his mounds to respawn. The health management could be a little scuffed. + std::list ouroMounds; + me->GetCreatureListWithEntryInGrid(ouroMounds, NPC_DIRT_MOUND, 200.f); + if (!ouroMounds.empty()) // This can't be possible, but just to be sure. + { + if (Creature* mound = Acore::Containers::SelectRandomContainerElement(ouroMounds)) + { + mound->AddAura(SPELL_SUMMON_OURO_AURA, mound); + mound->AI()->SetData(DATA_OURO_HEALTH, me->GetHealth()); + } + } + + me->DespawnOrUnsummon(1000); + } + + void CastGroundRupture() + { + std::list targets; + Acore::AllWorldObjectsInRange checker(me, 10.0f); + Acore::WorldObjectListSearcher searcher(me, targets, checker); + Cell::VisitAllObjects(me, searcher, 10.0f); + + for (WorldObject* target : targets) + { + if (Unit* unitTarget = target->ToUnit()) + { + if (unitTarget->IsHostileTo(me)) + DoCast(unitTarget, SPELL_GROUND_RUPTURE, true); + } + } + } + + void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override + { + if (spellInfo->Id == SPELL_SAND_BLAST && target) + me->GetThreatMgr().modifyThreatPercent(target, 100); + } + + void Emerge() + { + DoCastSelf(SPELL_BIRTH); + DoCastSelf(SPELL_SUMMON_SANDWORM_BASE, true); + me->SetReactState(REACT_AGGRESSIVE); + CastGroundRupture(); + _scheduler + .Schedule(20s, GROUP_EMERGED, [this](TaskContext context) + { + DoCastVictim(SPELL_SAND_BLAST); + context.Repeat(); + }) + .Schedule(22s, GROUP_EMERGED, [this](TaskContext context) + { + DoCastVictim(SPELL_SWEEP); + context.Repeat(); + }) + .Schedule(90s, GROUP_PHASE_TRANSITION, [this](TaskContext /*context*/) + { + Submerge(); + }) + .Schedule(3s, GROUP_PHASE_TRANSITION, [this](TaskContext context) + { + if (!IsPlayerWithinMeleeRange() && !_submerged) + { + if (_submergeMelee < 10) + { + _submergeMelee++; + } + else + { + if (!_enraged) + Submerge(); + _submergeMelee = 0; + } + } + else + { + _submergeMelee = 0; + } + + if (!_submerged) + context.Repeat(1s); + }); + } void Reset() override { - Sweep_Timer = urand(5000, 10000); - SandBlast_Timer = urand(20000, 35000); - Submerge_Timer = urand(90000, 150000); - Back_Timer = urand(30000, 45000); - ChangeTarget_Timer = urand(5000, 8000); - Spawn_Timer = urand(10000, 20000); - - Enrage = false; - Submerged = false; + instance->SetBossState(DATA_OURO, NOT_STARTED); + _scheduler.CancelAll(); + _submergeMelee = 0; + _submerged = false; + _enraged = false; } - void EnterCombat(Unit* /*who*/) override + void EnterEvadeMode(EvadeReason /*why*/) override { - DoCastVictim(SPELL_BIRTH); + DoCastSelf(SPELL_OURO_SUBMERGE_VISUAL); + me->DespawnOrUnsummon(1000); + // Remove after the header file is sorted with the bosses first. + if (Creature* ouroSpawner = instance->GetCreature(DATA_OURO_SPAWNER)) + ouroSpawner->Respawn(); + instance->SetBossState(DATA_OURO, FAIL); + if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f)) + base->DespawnOrUnsummon(); + } + + void EnterCombat(Unit* who) override + { + Emerge(); + + BossAI::EnterCombat(who); } void UpdateAI(uint32 diff) override @@ -114,67 +263,112 @@ struct boss_ouro : public ScriptedAI if (!UpdateVictim()) return; - //Sweep_Timer - if (!Submerged && Sweep_Timer <= diff) - { - DoCastVictim(SPELL_SWEEP); - Sweep_Timer = urand(15000, 30000); - } - else Sweep_Timer -= diff; - - //SandBlast_Timer - if (!Submerged && SandBlast_Timer <= diff) - { - DoCastVictim(SPELL_SANDBLAST); - SandBlast_Timer = urand(20000, 35000); - } - else SandBlast_Timer -= diff; - - //Submerge_Timer - if (!Submerged && Submerge_Timer <= diff) - { - //Cast - me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetFaction(FACTION_FRIENDLY); - DoCast(me, SPELL_DIRTMOUND_PASSIVE); - - Submerged = true; - Back_Timer = urand(30000, 45000); - } - else Submerge_Timer -= diff; - - //ChangeTarget_Timer - if (Submerged && ChangeTarget_Timer <= diff) - { - Unit* target = SelectTarget(SelectTargetMethod::Random, 0); - - if (target) - me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation()); - - ChangeTarget_Timer = urand(10000, 20000); - } - else ChangeTarget_Timer -= diff; - - //Back_Timer - if (Submerged && Back_Timer <= diff) - { - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - me->SetFaction(FACTION_MONSTER); - - DoCastVictim(SPELL_GROUND_RUPTURE); - - Submerged = false; - Submerge_Timer = urand(60000, 120000); - } - else Back_Timer -= diff; - - DoMeleeAttackIfReady(); + _scheduler.Update(diff, [this] + { + DoMeleeAttackIfReady(); + }); } + +protected: + TaskScheduler _scheduler; + bool _enraged; + uint8 _submergeMelee; + bool _submerged; + + bool IsPlayerWithinMeleeRange() const + { + return me->IsWithinMeleeRange(me->GetVictim()); + } +}; + +struct npc_dirt_mound : ScriptedAI +{ + npc_dirt_mound(Creature* creature) : ScriptedAI(creature) + { + _instance = creature->GetInstanceScript(); + } + + void JustSummoned(Creature* creature) override + { + if (creature->GetEntry() == NPC_OURO) + { + creature->SetInCombatWithZone(); + creature->SetHealth(_ouroHealth); + } + } + + void SetData(uint32 type, uint32 data) override + { + if (type == DATA_OURO_HEALTH) + _ouroHealth = data; + } + + void EnterCombat(Unit* /*who*/) override + { + DoZoneInCombat(); + _scheduler.Schedule(30s, [this](TaskContext /*context*/) + { + DoCastSelf(SPELL_SUMMON_SCARABS, true); + me->DespawnOrUnsummon(1000); + }) + .Schedule(100ms, [this](TaskContext context) + { + ChaseNewTarget(); + context.Repeat(5s, 10s); + }); + } + + void ChaseNewTarget() + { + DoResetThreat(); + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 200.f, true)) + { + me->AddThreat(target, 1000000.f); + AttackStart(target); + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + _scheduler.Update(diff); + } + + void Reset() override + { + DoCastSelf(SPELL_DIRTMOUND_PASSIVE, true); + DoCastSelf(SPELL_DREAM_FOG, true); + DoCastSelf(SPELL_QUAKE, true); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + if (_instance) + { + _instance->SetBossState(DATA_OURO, FAIL); + + // Remove after the header file is sorted with the bosses first. + if (Creature* ouroSpawner = _instance->GetCreature(DATA_OURO_SPAWNER)) + ouroSpawner->Respawn(); + } + + if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f)) + base->DespawnOrUnsummon(); + + me->DespawnOrUnsummon(); + } + +protected: + TaskScheduler _scheduler; + uint32 _ouroHealth; + InstanceScript* _instance; }; void AddSC_boss_ouro() { RegisterTempleOfAhnQirajCreatureAI(npc_ouro_spawner); RegisterTempleOfAhnQirajCreatureAI(boss_ouro); + RegisterTempleOfAhnQirajCreatureAI(npc_dirt_mound); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index 3056a305f..215e4c790 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -30,7 +30,8 @@ EndScriptData */ ObjectData const creatureData[] = { { NPC_SARTURA, DATA_SARTURA }, - { NPC_EYE_OF_CTHUN, DATA_EYE_OF_CTHUN } + { NPC_EYE_OF_CTHUN, DATA_EYE_OF_CTHUN }, + { NPC_OURO_SPAWNER, DATA_OURO_SPAWNER } }; class instance_temple_of_ahnqiraj : public InstanceMapScript @@ -102,6 +103,10 @@ public: case NPC_VISCIDUS: ViscidusGUID = creature->GetGUID(); break; + case NPC_OURO_SPAWNER: + if (GetBossState(DATA_OURO) != DONE) + creature->Respawn(); + break; } InstanceScript::OnCreatureCreate(creature); @@ -177,6 +182,27 @@ public: break; } } + + bool SetBossState(uint32 type, EncounterState state) override + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_OURO: + if (state == FAIL) + { + if (Creature* ouroSpawner = GetCreature(DATA_OURO)) + ouroSpawner->Respawn(); + } + break; + default: + break; + } + + return true; + } }; }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index 63727f51b..9301c9503 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -36,7 +36,9 @@ enum DataTypes DATA_VEKNILASHISDEAD = 10, DATA_VEKNILASH_DEATH = 11, DATA_FANKRISS = 12, - DATA_BUG_TRIO_DEATH = 14, + DATA_OURO = 13, + DATA_OURO_SPAWNER = 14, + DATA_BUG_TRIO_DEATH = 15, DATA_CTHUN_PHASE = 20, DATA_VISCIDUS = 21, DATA_SARTURA = 22, @@ -67,6 +69,7 @@ enum Creatures NPC_VEKLOR = 15276, NPC_VEKNILASH = 15275, NPC_OURO = 15517, + NPC_OURO_SPAWNER = 15957, NPC_SARTURA = 15516 }; From 88eb48297b3a07a9d3b5b61ca4e3e71b7748a4cd Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Mon, 15 Aug 2022 20:53:28 +0000 Subject: [PATCH 156/161] chore(DB): import pending files Referenced commit(s): cb887bbc229b131ff7e3cb96c4d89dc0e96b270a --- .../rev_1660074715862707400.sql => db_world/2022_08_15_08.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660074715862707400.sql => db_world/2022_08_15_08.sql} (83%) diff --git a/data/sql/updates/pending_db_world/rev_1660074715862707400.sql b/data/sql/updates/db_world/2022_08_15_08.sql similarity index 83% rename from data/sql/updates/pending_db_world/rev_1660074715862707400.sql rename to data/sql/updates/db_world/2022_08_15_08.sql index ac19529df..8e8745d1a 100644 --- a/data/sql/updates/pending_db_world/rev_1660074715862707400.sql +++ b/data/sql/updates/db_world/2022_08_15_08.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_07 -> 2022_08_15_08 -- UPDATE `creature_template` SET `unit_flags` = `unit_flags` | 33554432, `ScriptName` = 'npc_dirt_mound' WHERE `entry` = 15712; From c3f7c4371d55eb904bda14e3acfd2aa16ced1592 Mon Sep 17 00:00:00 2001 From: Kargatum Date: Tue, 16 Aug 2022 23:21:55 +0700 Subject: [PATCH 157/161] feat(Core/BattlegroundQueue): remove queue in all group if player leave (#12731) --- .../game/Battlegrounds/BattlegroundQueue.cpp | 21 ++++++++++--------- .../game/Handlers/BattleGroundHandler.cpp | 17 ++++++++++----- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 7f1cbe78b..43f9b7320 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -86,28 +86,29 @@ bool BattlegroundQueue::SelectionPool::KickGroup(const uint32 size) // find last group with proper size or largest bool foundProper = false; - auto groupToKick = SelectedGroups.begin(); - for (auto& itr = groupToKick; itr != SelectedGroups.end(); ++itr) + GroupQueueInfo* groupToKick{ SelectedGroups.front() }; + + for (auto const& gInfo : SelectedGroups) { // if proper size - overwrite to kick last one - if (std::abs(int32((*itr)->Players.size()) - (int32)size) <= 1) + if (std::abs(int32(gInfo->Players.size()) - (int32)size) <= 1) { - groupToKick = itr; + groupToKick = gInfo; foundProper = true; } - else if (!foundProper && (*itr)->Players.size() >= (*groupToKick)->Players.size()) - groupToKick = itr; + else if (!foundProper && gInfo->Players.size() >= groupToKick->Players.size()) + groupToKick = gInfo; } // remove selected from pool - GroupQueueInfo* ginfo = (*groupToKick); - SelectedGroups.erase(groupToKick); - PlayerCount -= ginfo->Players.size(); + auto playersCountInGroup{ groupToKick->Players.size() }; + PlayerCount -= playersCountInGroup; + std::erase(SelectedGroups, groupToKick); if (foundProper) return false; - return (ginfo->Players.size() > size); + return playersCountInGroup > size; } // returns true if added or desired count not yet reached diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index e89c2d71c..7e76aa6e4 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -533,13 +533,20 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData) } else // leave queue { - bgQueue.RemovePlayer(_player->GetGUID(), true); - _player->RemoveBattlegroundQueueId(bgQueueTypeId); + for (auto const& playerGuid : ginfo.Players) + { + auto player = ObjectAccessor::FindConnectedPlayer(playerGuid); + if (!player) + continue; - sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0, TEAM_NEUTRAL); - SendPacket(&data); + bgQueue.RemovePlayer(playerGuid, true); + player->RemoveBattlegroundQueueId(bgQueueTypeId); - LOG_DEBUG("bg.battleground", "Battleground: player {} {} left queue for bgtype {}, queue type {}.", _player->GetName(), _player->GetGUID().ToString(), bg->GetBgTypeID(), bgQueueTypeId); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_NONE, 0, 0, 0, TEAM_NEUTRAL); + player->SendDirectMessage(&data); + + LOG_DEBUG("bg.battleground", "Battleground: player {} {} left queue for bgtype {}, queue type {}.", player->GetName(), playerGuid.ToString(), bg->GetBgTypeID(), bgQueueTypeId); + } // player left queue, we should update it - do not update Arena Queue if (!ginfo.ArenaType) From 3cfdc7e678c9aec92b0e67adba642bb826ee9cd1 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 16 Aug 2022 15:52:01 -0300 Subject: [PATCH 158/161] fix(Core/Loot): Unique items shouldn't be hidden indiscriminately (#12759) --- src/server/game/Loot/LootMgr.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 25cc841f4..062719942 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -429,14 +429,6 @@ bool LootItem::AllowedForPlayer(Player const* player, bool isGivenByMasterLooter return false; } - // Checking for unique or unique(XX) objects - // master looter should still be able to see the loot to give to people. - // casting to avoid warnings, it's unlikely there's an item with unique but 2^31 items allowed. - if (!isMasterLooter && pProto->MaxCount > 0 && ((int32)player->GetItemCount(itemid, true) >= pProto->MaxCount)) - { - return false; - } - // not show loot for not own team if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeamId(true) != TEAM_HORDE) { From 2a297dfe29db3ae75cc3b535218f6ddf013f14ea Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 16 Aug 2022 15:53:37 -0300 Subject: [PATCH 159/161] fix(DB/Loot): Correct Tactical/Logistical assignment loots (#12760) --- .../rev_1660675431410515100.sql | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1660675431410515100.sql diff --git a/data/sql/updates/pending_db_world/rev_1660675431410515100.sql b/data/sql/updates/pending_db_world/rev_1660675431410515100.sql new file mode 100644 index 000000000..d1c1ffd70 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1660675431410515100.sql @@ -0,0 +1,59 @@ +-- +UPDATE `quest_template_addon` SET `SpecialFlags` = `SpecialFlags` | 1 WHERE `id` IN (8805, 8807); + +SET @ENTRY := 21132; +DELETE FROM `item_loot_template` WHERE `Entry` = @ENTRY; +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, 20939, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment II - Alliance"), +(@ENTRY, 21257, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment IV"), +(@ENTRY, 21259, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment V"), +(@ENTRY, 21260, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment VI"), +(@ENTRY, 21263, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment VII"), +(@ENTRY, 20806, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment X"); + +SET @ENTRY := 21266; +DELETE FROM `item_loot_template` WHERE `Entry` = @ENTRY; +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, 21379, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment II - Horde"), +(@ENTRY, 21258, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment IV - Horde"), +(@ENTRY, 21382, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment V - Horde"), +(@ENTRY, 21261, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment VI - Horde"), +(@ENTRY, 21264, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment VII - Horde"), +(@ENTRY, 21385, 0, 0, 0, 1, 1, 1, 1, "Logistics Assigment X - Horde"); + + +SET @ENTRY := 20805; +DELETE FROM `item_loot_template` WHERE `Entry` = @ENTRY; +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, 20807, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment I - Alliance"), +(@ENTRY, 20940, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment III - Alliance"), +(@ENTRY, 21262, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment VIII - Alliance"), +(@ENTRY, 21265, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment IX - Alliance"), +(@ENTRY, 21514, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment XI - Alliance"); + +SET @ENTRY := 21386; +DELETE FROM `item_loot_template` WHERE `Entry` = @ENTRY; +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, 21378, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment I - Horde"), +(@ENTRY, 21380, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment III - Horde"), +(@ENTRY, 21384, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment VIII - Horde"), +(@ENTRY, 21381, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment IX - Horde"), +(@ENTRY, 21514, 0, 0, 0, 1, 1, 1, 1, "Logistics Assignment XI - Horde"); + +SET @ENTRY := 20809; +DELETE FROM `item_loot_template` WHERE `Entry` = @ENTRY; +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, 21245, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment I - Horde"), +(@ENTRY, 21751, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment III - Horde"), +(@ENTRY, 21165, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment VI - Horde"), +(@ENTRY, 21166, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment VII - Horde"), +(@ENTRY, 20944, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment IX - Horde"); + +SET @ENTRY := 21133; +DELETE FROM `item_loot_template` WHERE `Entry` = @ENTRY; +INSERT INTO `item_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, 20945, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment II - Horde"), +(@ENTRY, 20947, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment IV - Horde"), +(@ENTRY, 20948, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment V - Horde"), +(@ENTRY, 21167, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment VIII - Horde"), +(@ENTRY, 20943, 0, 0, 0, 1, 1, 1, 1, "Tactical Assignment X - Horde"); From 3829d26239f3f58c873d97f48b18accb0180b1f8 Mon Sep 17 00:00:00 2001 From: AzerothCoreBot Date: Tue, 16 Aug 2022 18:55:45 +0000 Subject: [PATCH 160/161] chore(DB): import pending files Referenced commit(s): 2a297dfe29db3ae75cc3b535218f6ddf013f14ea --- .../rev_1660675431410515100.sql => db_world/2022_08_16_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1660675431410515100.sql => db_world/2022_08_16_00.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1660675431410515100.sql b/data/sql/updates/db_world/2022_08_16_00.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1660675431410515100.sql rename to data/sql/updates/db_world/2022_08_16_00.sql index d1c1ffd70..d1a2a259e 100644 --- a/data/sql/updates/pending_db_world/rev_1660675431410515100.sql +++ b/data/sql/updates/db_world/2022_08_16_00.sql @@ -1,3 +1,4 @@ +-- DB update 2022_08_15_08 -> 2022_08_16_00 -- UPDATE `quest_template_addon` SET `SpecialFlags` = `SpecialFlags` | 1 WHERE `id` IN (8805, 8807); From b2e449fd15e38b4778a42650f388b8213cf62a6a Mon Sep 17 00:00:00 2001 From: SoglaHash <74299960+SoglaHash@users.noreply.github.com> Date: Tue, 16 Aug 2022 21:02:24 +0200 Subject: [PATCH 161/161] fix(Scripts/BlackwingLair): Chromaggus lever should stay open (#12758) fix(Scripts/BWL): Chromaggus lever should stay open Chromaggus lever door closes after reset, should stay open Closes https://github.com/azerothcore/azerothcore-wotlk/issues/12743 --- .../BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index 586952047..93abf5146 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -35,7 +35,6 @@ DoorData const doorData[] = { GO_PORTCULLIS_RAZORGORE_ROOM, DATA_RAZORGORE_THE_UNTAMED, DOOR_TYPE_ROOM, }, // ID 176964 || GUID 75158 { GO_PORTCULLIS_VAELASTRASZ, DATA_VAELASTRAZ_THE_CORRUPT, DOOR_TYPE_PASSAGE }, // ID 175185 || GUID 7229 { GO_PORTCULLIS_BROODLORD, DATA_BROODLORD_LASHLAYER, DOOR_TYPE_PASSAGE }, // ID 179365 || GUID 75159 - { GO_PORTCULLIS_CHROMAGGUS, DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179116 || GUID 75161 { GO_PORTCULLIS_CHROMAGGUS_EXIT,DATA_CHROMAGGUS, DOOR_TYPE_PASSAGE }, // ID 179117 || GUID 75164 { GO_PORTCULLIS_CHROMAGGUS_EXIT,DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 179117 || GUID 75164 { GO_PORTCULLIS_NEFARIAN, DATA_NEFARIAN, DOOR_TYPE_ROOM }, // ID 176966