From 1a84ab6983d038f92b547c5b5b1026190adbc2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Mauger?= Date: Sat, 23 Sep 2023 20:49:20 +0200 Subject: [PATCH 01/49] fix(Core/Unit): Fix CanSwim method not accurate for players (#17320) --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a42fb492d..b95b31962 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -20224,7 +20224,7 @@ bool Unit::CanSwim() const // Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water if (HasUnitFlag(UNIT_FLAG_CANNOT_SWIM)) return false; - if (HasUnitFlag(UNIT_FLAG_POSSESSED)) // is player + if (HasUnitFlag(UNIT_FLAG_POSSESSED) || HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) // is player return true; if (HasUnitFlag2(UNIT_FLAG2_UNUSED_6)) return false; From e7d0c75c7ef16e999f308d27dba0f12285e732be Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 23 Sep 2023 23:32:35 +0200 Subject: [PATCH 02/49] fix(CI): windows build (#17328) --- .github/workflows/windows_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 76d78e7e0..9210ae8ae 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -45,7 +45,7 @@ jobs: - name: Copy dll files shell: bash run: | - cp "/c/Program Files/OpenSSL/bin/legacy.dll" "env/dist" + cp "/c/Program Files/OpenSSL-Win64/bin/legacy.dll" "env/dist" - name: Dry run authserver shell: bash run: | From 58f8fe6426d3c9465359599fac11af094c1fc980 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Sat, 23 Sep 2023 23:55:45 +0200 Subject: [PATCH 03/49] refactor(Scripts/Midsummer): Remove old unused code for spell 45644 (#17324) - spell 45644 used to be linked to spell_midsummer_juggling_torch - spell 45644 was later linked to new implementation spell_midsummer_torch_catch in e1e4c6cddc44971054c61df1a884ac7c795c8b73 - old implementation of spell 45644 was never removed from spell_midsummer_juggling_torch --- src/server/scripts/Events/midsummer.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/server/scripts/Events/midsummer.cpp b/src/server/scripts/Events/midsummer.cpp index a7b7d5ad7..b24d7ed6b 100644 --- a/src/server/scripts/Events/midsummer.cpp +++ b/src/server/scripts/Events/midsummer.cpp @@ -424,8 +424,6 @@ class spell_midsummer_juggling_torch : public SpellScript { PrepareSpellScript(spell_midsummer_juggling_torch); - bool handled; - bool Load() override { handled = false; return true; } void HandleFinish() { Unit* caster = GetCaster(); @@ -447,27 +445,9 @@ class spell_midsummer_juggling_torch : public SpellScript caster->CastSpell(caster, SPELL_JUGGLE_SELF, true); } - void HandleDummy(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - Unit* caster = GetCaster(); - if (!caster || caster->GetTypeId() != TYPEID_PLAYER) - return; - - if (Player* target = GetHitPlayer()) - if (!handled && target->GetQuestRewardStatus(target->GetTeamId() == TEAM_ALLIANCE ? 11657 : 11923)) - { - handled = true; - caster->CastSpell(target, SPELL_GIVE_TORCH, true); - } - } - void Register() override { - if (m_scriptSpellId == SPELL_TORCH_CHECK) - OnEffectHitTarget += SpellEffectFn(spell_midsummer_juggling_torch::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - else - AfterCast += SpellCastFn(spell_midsummer_juggling_torch::HandleFinish); + AfterCast += SpellCastFn(spell_midsummer_juggling_torch::HandleFinish); } }; From 701b3efe07a2feade5a3adf49f52148525003865 Mon Sep 17 00:00:00 2001 From: damnablebear <127447064+damnablebear@users.noreply.github.com> Date: Sun, 24 Sep 2023 04:29:43 -0400 Subject: [PATCH 04/49] fix(DB/Quests): adding AllowableRaces flags for Quests 'The Mark of the Lightbringer' and 'Tomb of the Lightbringer' (#17301) * Add files via upload * Update lightbringer-quest-allowableraces.sql * Update lightbringer-quest-allowableraces.sql * Update lightbringer-quest-allowableraces.sql --------- Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> --- .../pending_db_world/lightbringer-quest-allowableraces.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql diff --git a/data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql b/data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql new file mode 100644 index 000000000..c2dddd649 --- /dev/null +++ b/data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql @@ -0,0 +1 @@ +UPDATE `quest_template` SET `AllowableRaces` = 1101 WHERE (`ID` IN (9474,9446)); From f7779a8fe4ce07e34551c8ed35d7f6445b9ab4a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 Sep 2023 08:30:55 +0000 Subject: [PATCH 05/49] chore(DB): import pending files Referenced commit(s): 701b3efe07a2feade5a3adf49f52148525003865 --- .../2023_09_24_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/lightbringer-quest-allowableraces.sql => db_world/2023_09_24_00.sql} (64%) diff --git a/data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql b/data/sql/updates/db_world/2023_09_24_00.sql similarity index 64% rename from data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql rename to data/sql/updates/db_world/2023_09_24_00.sql index c2dddd649..2651315b4 100644 --- a/data/sql/updates/pending_db_world/lightbringer-quest-allowableraces.sql +++ b/data/sql/updates/db_world/2023_09_24_00.sql @@ -1 +1,2 @@ +-- DB update 2023_09_20_07 -> 2023_09_24_00 UPDATE `quest_template` SET `AllowableRaces` = 1101 WHERE (`ID` IN (9474,9446)); From def86cc74ec36dadf8af6b58d305a066ae5d01c7 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 24 Sep 2023 10:19:00 -0300 Subject: [PATCH 06/49] =?UTF-8?q?feat(Scripts/Commands):=20Display=20creat?= =?UTF-8?q?ure=20entry=20when=20using=20the=20npc=20nea=E2=80=A6=20(#17331?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat(Scripts/Commands): Display creature entry when using the npc near command --- .../updates/pending_db_world/rev_1695556771332912400.sql | 4 ++++ src/server/scripts/Commands/cs_npc.cpp | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695556771332912400.sql diff --git a/data/sql/updates/pending_db_world/rev_1695556771332912400.sql b/data/sql/updates/pending_db_world/rev_1695556771332912400.sql new file mode 100644 index 000000000..741ff1f66 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695556771332912400.sql @@ -0,0 +1,4 @@ +-- +UPDATE `acore_string` SET `content_default` = '%d - (entry: %d) |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r', +`locale_deDE` = '%d - (entry: %d) |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r', +`locale_zhCN` = '%d%s - (entry: %d) |cffffffff|H生物:%d|h[%s X:%f Y:%f Z:%f 地图号:%d]|h|r' WHERE `entry` = 515; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 7813f5e42..3db1a22fe 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -15,13 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -Name: npc_commandscript -%Complete: 100 -Comment: All npc related commands -Category: commandscripts -EndScriptData */ - #include "Chat.h" #include "CreatureAI.h" #include "CreatureGroups.h" @@ -719,7 +712,7 @@ public: if (!creatureTemplate) continue; - handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, creatureTemplate->Name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, entry, guid, creatureTemplate->Name.c_str(), x, y, z, mapId, "", ""); ++count; } while (result->NextRow()); From 5952861e92387a25ccc35294aa553d3fb6d12539 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 Sep 2023 13:20:05 +0000 Subject: [PATCH 07/49] chore(DB): import pending files Referenced commit(s): def86cc74ec36dadf8af6b58d305a066ae5d01c7 --- .../rev_1695556771332912400.sql => db_world/2023_09_24_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1695556771332912400.sql => db_world/2023_09_24_01.sql} (88%) diff --git a/data/sql/updates/pending_db_world/rev_1695556771332912400.sql b/data/sql/updates/db_world/2023_09_24_01.sql similarity index 88% rename from data/sql/updates/pending_db_world/rev_1695556771332912400.sql rename to data/sql/updates/db_world/2023_09_24_01.sql index 741ff1f66..1f7f081aa 100644 --- a/data/sql/updates/pending_db_world/rev_1695556771332912400.sql +++ b/data/sql/updates/db_world/2023_09_24_01.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_24_00 -> 2023_09_24_01 -- UPDATE `acore_string` SET `content_default` = '%d - (entry: %d) |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r', `locale_deDE` = '%d - (entry: %d) |cffffffff|Hcreature:%d|h[%s X:%f Y:%f Z:%f MapId:%d]|h|r', From e361c92d6680733e3e2b59b12956590c8778cb9e Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Sun, 24 Sep 2023 17:46:13 +0000 Subject: [PATCH 08/49] fix(Scripts/Karazhan): Sync Enfeeble and Shadow Nova (#17314) Update boss_prince_malchezaar.cpp --- .../EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 0d4774a61..1f44a23d9 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -205,13 +205,12 @@ struct boss_malchezaar : public BossAI }); context.SetGroup(GROUP_ENFEEBLE); - scheduler.DelayGroup(GROUP_SHADOW_NOVA, 5s); context.Repeat(); }).Schedule(35500ms, [this](TaskContext context) { DoCastAOE(SPELL_SHADOW_NOVA); context.SetGroup(GROUP_SHADOW_NOVA); - context.Repeat(); + context.Repeat(30s); }).Schedule(40s, [this](TaskContext context) { if (!MaxSpawns(infernalTargets)) // only spawn infernal when the area is not full From 6990a1d2a43b085cccf83a1cfe23c03675a69c88 Mon Sep 17 00:00:00 2001 From: Grimgravy Date: Sun, 24 Sep 2023 16:23:58 -0300 Subject: [PATCH 09/49] fix(Scripts/Quest): improve Catch the Wild Wolpertinger! (#17333) --- .../rev_1695559726583951400.sql | 7 ++++ .../game/Spells/SpellInfoCorrections.cpp | 6 --- src/server/scripts/Events/brewfest.cpp | 39 +++++++++---------- 3 files changed, 25 insertions(+), 27 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695559726583951400.sql diff --git a/data/sql/updates/pending_db_world/rev_1695559726583951400.sql b/data/sql/updates/pending_db_world/rev_1695559726583951400.sql new file mode 100644 index 000000000..58555e35f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695559726583951400.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND (`SourceGroup` = 0) AND (`SourceEntry` = 41621) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 1) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 23487) AND (`ConditionValue3` = 0); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, 41621, 0, 0, 31, 1, 3, 23487, 0, 0, 0, 0, '', 'Throw a net at a wild wolpertinger, which will allow you to capture it and place it in your pack.'); + +-- both missions are for the horde and alliance factions +UPDATE `spell_script_names` SET `ScriptName`='spell_catch_the_wild_wolpertinger' WHERE `spell_id`=41621 AND `ScriptName`='spell_q11117_catch_the_wild_wolpertinger'; diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 3aff2bee8..d55a5505d 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -3922,12 +3922,6 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->ExcludeCasterAuraSpell = 42299; }); - // Catch the Wild Wolpertinger! - ApplySpellFix({ 41621 }, [](SpellInfo* spellInfo) - { - spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY; - }); - // Brewfest quests ApplySpellFix({ 47134, 51798 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index badf22dd9..b202673cd 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -1031,35 +1031,32 @@ class spell_brewfest_apple_trap : public SpellScript } }; -class spell_q11117_catch_the_wild_wolpertinger : public SpellScript +enum Catch { - PrepareSpellScript(spell_q11117_catch_the_wild_wolpertinger); + NPC_WILD_WOLPERTINGER = 23487, - SpellCastResult CheckTarget() + ITEM_STUNNED_WOLPERTINGER = 32906 +}; + +class spell_catch_the_wild_wolpertinger : public AuraScript +{ + PrepareAuraScript(spell_catch_the_wild_wolpertinger); + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* caster = GetCaster()) - if (caster->ToPlayer()) - if (Unit* target = caster->ToPlayer()->GetSelectedUnit()) - if (target->GetEntry() == 23487 && target->IsAlive()) - return SPELL_CAST_OK; - - return SPELL_FAILED_BAD_TARGETS; - } - - void HandleDummyEffect(SpellEffIndex /*effIndex*/) - { - if (GetCaster() && GetCaster()->ToPlayer()) + if (Creature* wild = GetTarget()->ToCreature()) { - GetCaster()->ToPlayer()->AddItem(32906, 1); - if (Unit* target = GetCaster()->ToPlayer()->GetSelectedUnit()) - target->ToCreature()->DespawnOrUnsummon(500); + if (wild->GetEntry() == NPC_WILD_WOLPERTINGER) + { + wild->ToCreature()->DespawnOrUnsummon(1s, 0s); + GetCaster()->ToPlayer()->AddItem(ITEM_STUNNED_WOLPERTINGER, 1); + } } } void Register() override { - OnCheckCast += SpellCheckCastFn(spell_q11117_catch_the_wild_wolpertinger::CheckTarget); - OnEffectHitTarget += SpellEffectFn(spell_q11117_catch_the_wild_wolpertinger::HandleDummyEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + OnEffectApply += AuraEffectApplyFn(spell_catch_the_wild_wolpertinger::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL); } }; @@ -2072,7 +2069,7 @@ void AddSC_event_brewfest_scripts() RegisterSpellScript(spell_brewfest_ram_fatigue); RegisterSpellScript(spell_brewfest_apple_trap); // other - RegisterSpellScript(spell_q11117_catch_the_wild_wolpertinger); + RegisterSpellScript(spell_catch_the_wild_wolpertinger); RegisterSpellScript(spell_brewfest_fill_keg); RegisterSpellScript(spell_brewfest_unfill_keg); RegisterSpellScript(spell_brewfest_toss_mug); From e2e393502c981ac08be312bd5a51da04517ab091 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Sun, 24 Sep 2023 21:24:33 +0200 Subject: [PATCH 10/49] fix(Scripts/Midsummer): Add missing torch shadows (#17323) --- src/server/scripts/Events/midsummer.cpp | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Events/midsummer.cpp b/src/server/scripts/Events/midsummer.cpp index b24d7ed6b..d428e1747 100644 --- a/src/server/scripts/Events/midsummer.cpp +++ b/src/server/scripts/Events/midsummer.cpp @@ -296,6 +296,7 @@ enum flingTorch SPELL_FLING_TORCH_DUMMY = 46747, SPELL_MISSED_TORCH = 45676, SPELL_TORCH_COUNTER = 45693, + SPELL_TORCH_SHADOW = 46105 }; class spell_midsummer_fling_torch : public SpellScript @@ -339,7 +340,10 @@ class spell_midsummer_fling_torch : public SpellScript // we have any pos if (pos.GetPositionX()) + { caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_FLING_TORCH, true); + caster->CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SPELL_TORCH_SHADOW, true); + } } void HandleFinish() @@ -417,7 +421,12 @@ enum eJuggle SPELL_TORCH_CHECK = 45644, SPELL_GIVE_TORCH = 45280, QUEST_TORCH_CATCHING_A = 11657, - QUEST_TORCH_CATCHING_H = 11923 + QUEST_TORCH_CATCHING_H = 11923, + + SPELL_TORCH_SHADOW_SELF = 46121, + SPELL_TORCH_SHADOW_SLOW = 46120, + SPELL_TORCH_SHADOW_MED = 46118, + SPELL_TORCH_SHADOW_FAST = 46117 }; class spell_midsummer_juggling_torch : public SpellScript @@ -433,16 +442,31 @@ class spell_midsummer_juggling_torch : public SpellScript if (const WorldLocation* loc = GetExplTargetDest()) { if (loc->GetExactDist(caster) < 3.0f) + { caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SELF, true); + caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SELF, true); + } else if (loc->GetExactDist(caster) < 10.0f) + { caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_SLOW, true); + caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_SLOW, true); + } else if (loc->GetExactDist(caster) < 25.0f) + { caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_MED, true); + caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_MED, true); + } else + { caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_JUGGLE_FAST, true); + caster->CastSpell(loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), SPELL_TORCH_SHADOW_FAST, true); + } } else + { caster->CastSpell(caster, SPELL_JUGGLE_SELF, true); + caster->CastSpell(caster, SPELL_TORCH_SHADOW_SELF, true); + } } void Register() override From 09c8aeac326eb06fed049c8fec9dde9da285c4a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 Sep 2023 19:25:10 +0000 Subject: [PATCH 11/49] chore(DB): import pending files Referenced commit(s): 6990a1d2a43b085cccf83a1cfe23c03675a69c88 --- .../rev_1695559726583951400.sql => db_world/2023_09_24_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1695559726583951400.sql => db_world/2023_09_24_02.sql} (95%) diff --git a/data/sql/updates/pending_db_world/rev_1695559726583951400.sql b/data/sql/updates/db_world/2023_09_24_02.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1695559726583951400.sql rename to data/sql/updates/db_world/2023_09_24_02.sql index 58555e35f..a58cd048f 100644 --- a/data/sql/updates/pending_db_world/rev_1695559726583951400.sql +++ b/data/sql/updates/db_world/2023_09_24_02.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_24_01 -> 2023_09_24_02 -- DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 17) AND (`SourceGroup` = 0) AND (`SourceEntry` = 41621) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 31) AND (`ConditionTarget` = 1) AND (`ConditionValue1` = 3) AND (`ConditionValue2` = 23487) AND (`ConditionValue3` = 0); INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES From f2e289ea070e9f3d2d69cd8f8c383a2762cfc903 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Mon, 25 Sep 2023 05:55:24 +0200 Subject: [PATCH 12/49] fix(DB/GameObject): fix Malchezaar door being selectable (#16275) initial --- .../pending_db_world/make_malchezaar_door_not_interactable.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql diff --git a/data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql b/data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql new file mode 100644 index 000000000..54d977996 --- /dev/null +++ b/data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql @@ -0,0 +1,3 @@ +-- +-- fix Malchezaar event door not being interactable with players +UPDATE `gameobject_template_addon` SET `flags` = `flags`|16 WHERE `entry` = 185134; From 07b106e4ab2065059eb2d4e415410f993cdad6b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Sep 2023 03:56:32 +0000 Subject: [PATCH 13/49] chore(DB): import pending files Referenced commit(s): f2e289ea070e9f3d2d69cd8f8c383a2762cfc903 --- .../2023_09_25_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/make_malchezaar_door_not_interactable.sql => db_world/2023_09_25_00.sql} (77%) diff --git a/data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql b/data/sql/updates/db_world/2023_09_25_00.sql similarity index 77% rename from data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql rename to data/sql/updates/db_world/2023_09_25_00.sql index 54d977996..69afe7231 100644 --- a/data/sql/updates/pending_db_world/make_malchezaar_door_not_interactable.sql +++ b/data/sql/updates/db_world/2023_09_25_00.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_24_02 -> 2023_09_25_00 -- -- fix Malchezaar event door not being interactable with players UPDATE `gameobject_template_addon` SET `flags` = `flags`|16 WHERE `entry` = 185134; From 13284125011d725637b1e25a2e3afe746136b763 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:09:00 -0300 Subject: [PATCH 14/49] fix(Scripts/Commands): Fix list creature string output (#17351) --- src/server/scripts/Commands/cs_list.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index a260a7863..6a64ba68f 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -126,7 +126,7 @@ public: for (std::unordered_multimap::const_iterator itr = creBounds.first; itr != creBounds.second;) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " "); + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, cInfo->Entry, guid, cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " "); else handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " "); ++itr; @@ -138,7 +138,7 @@ public: if (!liveFound) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, guid, cInfo->Name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, cInfo->Entry, guid, cInfo->Name.c_str(), x, y, z, mapId, "", ""); else handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId, "", ""); } From cc60bc0c353573f8b3d5b3d8024407f80912f24f Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:10:23 -0300 Subject: [PATCH 15/49] =?UTF-8?q?fix(Scripts/Spells):=20Fix=20Healing=20&?= =?UTF-8?q?=20Mana=20injectors=20not=20giving=20bonus=20to=E2=80=A6=20(#17?= =?UTF-8?q?348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/Spells): Fix Healing & Mana injectors not giving bonus to engineers * Update SpellEffects.cpp * Update spell_item.cpp --- .../rev_1695609935652952000.sql | 7 ++++ src/server/game/Spells/SpellEffects.cpp | 7 ---- src/server/scripts/Spells/spell_item.cpp | 35 ++++++++++++++++--- 3 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695609935652952000.sql diff --git a/data/sql/updates/pending_db_world/rev_1695609935652952000.sql b/data/sql/updates/pending_db_world/rev_1695609935652952000.sql new file mode 100644 index 000000000..9ac4d6392 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695609935652952000.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` IN (67486, 67489, 67487, 67490); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(67486, 'spell_item_healing_injector'), +(67489, 'spell_item_healing_injector'), +(67487, 'spell_item_mana_injector'), +(67490, 'spell_item_mana_injector'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 91a6fc804..ea793ce8a 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1930,13 +1930,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) case 48542: // Revitalize damage = int32(CalculatePct(unitTarget->GetMaxPower(power), damage)); break; - case 67490: // Runic Mana Injector (mana gain increased by 25% for engineers - 3.2.0 patch change) - { - if (Player* player = m_caster->ToPlayer()) - if (player->HasSkill(SKILL_ENGINEERING)) - AddPct(damage, 25); - break; - } case 71132: // Glyph of Shadow Word: Pain damage = int32(CalculatePct(unitTarget->GetCreateMana(), 1)); // set 1 as value, missing in dbc break; diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index a1cc175c8..17d9156e9 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -3342,9 +3342,9 @@ class spell_item_rocket_boots : public SpellScript } }; -class spell_item_runic_healing_injector : public SpellScript +class spell_item_healing_injector : public SpellScript { - PrepareSpellScript(spell_item_runic_healing_injector); + PrepareSpellScript(spell_item_healing_injector); bool Load() override { @@ -3360,7 +3360,33 @@ class spell_item_runic_healing_injector : public SpellScript void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_item_runic_healing_injector::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + OnEffectHitTarget += SpellEffectFn(spell_item_healing_injector::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + } +}; + +class spell_item_mana_injector : public SpellScript +{ + PrepareSpellScript(spell_item_mana_injector); + + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleEnergize(SpellEffIndex /*effIndex*/) + { + if (Player* caster = GetCaster()->ToPlayer()) + { + if (caster->HasSkill(SKILL_ENGINEERING)) + { + SetEffectValue(GetEffectValue() * 1.25f); + } + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_item_mana_injector::HandleEnergize, EFFECT_0, SPELL_EFFECT_ENERGIZE); } }; @@ -3959,7 +3985,8 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_nitro_boots); RegisterSpellScript(spell_item_teach_language); RegisterSpellScript(spell_item_rocket_boots); - RegisterSpellScript(spell_item_runic_healing_injector); + RegisterSpellScript(spell_item_healing_injector); + RegisterSpellScript(spell_item_mana_injector); RegisterSpellScript(spell_item_pygmy_oil); RegisterSpellScript(spell_item_unusual_compass); RegisterSpellScript(spell_item_chicken_cover); From 13a9de1083e289ed58aece466c1da4addb974f73 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:10:56 -0300 Subject: [PATCH 16/49] refactor(Scripts/GruulsLair): Clean up instance script (#17347) --- .../GruulsLair/instance_gruuls_lair.cpp | 66 ++++--------------- 1 file changed, 12 insertions(+), 54 deletions(-) diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index 5fbfadbcb..a826f8857 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -26,6 +26,12 @@ DoorData const doorData[] = { 0, 0, DOOR_TYPE_ROOM } // END }; +ObjectData const creatureData[] = +{ + { NPC_MAULGAR, DATA_MAULGAR }, + { 0, 0 } +}; + MinionData const minionData[] = { { NPC_MAULGAR, DATA_MAULGAR }, @@ -46,64 +52,13 @@ public: { SetHeaders(DataHeader); SetBossNumber(MAX_ENCOUNTER); + LoadObjectData(creatureData, nullptr); LoadDoorData(doorData); LoadMinionData(minionData); _addsKilled = 0; } - void OnCreatureCreate(Creature* creature) override - { - switch (creature->GetEntry()) - { - case NPC_MAULGAR: - _maulgarGUID = creature->GetGUID(); - [[fallthrough]]; - case NPC_KROSH_FIREHAND: - case NPC_OLM_THE_SUMMONER: - case NPC_KIGGLER_THE_CRAZED: - case NPC_BLINDEYE_THE_SEER: - AddMinion(creature, true); - break; - } - } - - void OnCreatureRemove(Creature* creature) override - { - switch (creature->GetEntry()) - { - case NPC_MAULGAR: - case NPC_KROSH_FIREHAND: - case NPC_OLM_THE_SUMMONER: - case NPC_KIGGLER_THE_CRAZED: - case NPC_BLINDEYE_THE_SEER: - AddMinion(creature, false); - break; - } - } - - void OnGameObjectCreate(GameObject* go) override - { - switch (go->GetEntry()) - { - case GO_MAULGAR_DOOR: - case GO_GRUUL_DOOR: - AddDoor(go, true); - break; - } - } - - void OnGameObjectRemove(GameObject* go) override - { - switch (go->GetEntry()) - { - case GO_MAULGAR_DOOR: - case GO_GRUUL_DOOR: - AddDoor(go, false); - break; - } - } - bool SetBossState(uint32 id, EncounterState state) override { if (!InstanceScript::SetBossState(id, state)) @@ -117,8 +72,12 @@ public: void SetData(uint32 type, uint32 /*id*/) override { if (type == DATA_ADDS_KILLED) - if (Creature* maulgar = instance->GetCreature(_maulgarGUID)) + { + if (Creature* maulgar = GetCreature(DATA_MAULGAR)) + { maulgar->AI()->DoAction(++_addsKilled); + } + } } uint32 GetData(uint32 type) const override @@ -130,7 +89,6 @@ public: protected: uint32 _addsKilled; - ObjectGuid _maulgarGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const override From f0c4ab3c959e54b0f83403e934405f769fda671d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:11:12 -0300 Subject: [PATCH 17/49] refactor(Scripts/MagistersTerrace): Clean up instance script (#17346) --- .../boss_felblood_kaelthas.cpp | 11 +- .../boss_priestess_delrissa.cpp | 8 +- .../MagistersTerrace/boss_selin_fireheart.cpp | 6 +- .../MagistersTerrace/boss_vexallus.cpp | 6 +- .../instance_magisters_terrace.cpp | 136 +++--------------- .../MagistersTerrace/magisters_terrace.h | 11 +- 6 files changed, 44 insertions(+), 134 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 333ef040f..182b4588b 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -105,7 +105,7 @@ public: events.Reset(); summons.DespawnAll(); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); - instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); + instance->SetBossState(DATA_KAELTHAS, NOT_STARTED); me->SetImmuneToAll(false); } @@ -125,12 +125,17 @@ public: void JustDied(Unit*) override { - instance->SetData(DATA_KAELTHAS_EVENT, DONE); + instance->SetBossState(DATA_KAELTHAS, DONE); + + if (GameObject* orb = instance->GetGameObject(DATA_ESCAPE_ORB)) + { + orb->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); + } } void JustEngagedWith(Unit* /*who*/) override { - instance->SetData(DATA_KAELTHAS_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_KAELTHAS, IN_PROGRESS); me->SetInCombatWithZone(); events.ScheduleEvent(EVENT_SPELL_FIREBALL, 0); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index f15de20a8..f47af976e 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -105,7 +105,7 @@ public: { PlayersKilled = SAY_PLAYER_KILLED; HelpersKilled = SAY_HELPER_DIED; - instance->SetData(DATA_DELRISSA_EVENT, NOT_STARTED); + instance->SetBossState(DATA_DELRISSA, NOT_STARTED); summons.Respawn(); me->SetLootMode(0); @@ -141,7 +141,7 @@ public: { me->loot.clear(); me->loot.FillLoot(me->GetCreatureTemplate()->lootid, LootTemplates_Creature, me->GetLootRecipient(), false, false, 1, me); - instance->SetData(DATA_DELRISSA_EVENT, DONE); + instance->SetBossState(DATA_DELRISSA, DONE); me->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE); } ++HelpersKilled; @@ -151,7 +151,7 @@ public: { Talk(SAY_AGGRO); summons.DoZoneInCombat(); - instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_DELRISSA, IN_PROGRESS); events.ScheduleEvent(EVENT_SPELL_FLASH_HEAL, 15000); events.ScheduleEvent(EVENT_SPELL_RENEW, 10000); @@ -177,7 +177,7 @@ public: Talk(SAY_DEATH); if (HelpersKilled == MAX_ACTIVE_HELPERS + 1) - instance->SetData(DATA_DELRISSA_EVENT, DONE); + instance->SetBossState(DATA_DELRISSA, DONE); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index d14c9ff3e..2c14c0fba 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -106,7 +106,7 @@ public: events.Reset(); summons.DespawnAll(); SpawnCrystals(); - instance->SetData(DATA_SELIN_EVENT, NOT_STARTED); + instance->SetBossState(DATA_SELIN_FIREHEART, NOT_STARTED); CrystalGUID.Clear(); me->SetPower(POWER_MANA, 0); } @@ -114,7 +114,7 @@ public: void JustEngagedWith(Unit* /*who*/) override { Talk(SAY_AGGRO); - instance->SetData(DATA_SELIN_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_SELIN_FIREHEART, IN_PROGRESS); events.ScheduleEvent(EVENT_SPELL_DRAIN_LIFE, 2500, 1); events.ScheduleEvent(EVENT_SPELL_FEL_EXPLOSION, 2000); @@ -134,7 +134,7 @@ public: { Talk(SAY_DEATH); - instance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete! + instance->SetBossState(DATA_SELIN_FIREHEART, DONE); // Encounter complete! summons.DespawnAll(); } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 574afed7d..f550b9554 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -87,7 +87,7 @@ public: summons.DespawnAll(); IntervalHealthAmount = 1; - instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); + instance->SetBossState(DATA_VEXALLUS, NOT_STARTED); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ENERGY_FEEDBACK); } @@ -100,14 +100,14 @@ public: void JustDied(Unit* /*killer*/) override { summons.DespawnAll(); - instance->SetData(DATA_VEXALLUS_EVENT, DONE); + instance->SetBossState(DATA_VEXALLUS, DONE); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ENERGY_FEEDBACK); } void JustEngagedWith(Unit* /*who*/) override { Talk(SAY_AGGRO); - instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS); + instance->SetBossState(DATA_VEXALLUS, IN_PROGRESS); events.ScheduleEvent(EVENT_SPELL_CHAIN_LIGHTNING, 8000); events.ScheduleEvent(EVENT_SPELL_ARCANE_SHOCK, 5000); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 315a7df18..bf73f9095 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -26,6 +26,21 @@ ObjectData const creatureData[] = { 0, 0 } }; +ObjectData const gameobjectData[] = +{ + { GO_ESCAPE_ORB, DATA_ESCAPE_ORB }, + { 0, 0, } +}; + +DoorData const doorData[] = +{ + { GO_SELIN_DOOR, DATA_SELIN_FIREHEART, DOOR_TYPE_PASSAGE }, + { GO_SELIN_ENCOUNTER_DOOR, DATA_SELIN_FIREHEART, DOOR_TYPE_ROOM }, + { GO_VEXALLUS_DOOR, DATA_VEXALLUS, DOOR_TYPE_PASSAGE }, + { GO_DELRISSA_DOOR, DATA_DELRISSA, DOOR_TYPE_PASSAGE }, + { 0, 0, DOOR_TYPE_ROOM } // END +}; + Position const KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f }; class instance_magisters_terrace : public InstanceMapScript @@ -38,47 +53,16 @@ public: instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map) { SetHeaders(DataHeader); - LoadObjectData(creatureData, nullptr); + SetBossNumber(MAX_ENCOUNTER); + LoadObjectData(creatureData, gameobjectData); + LoadDoorData(doorData); } - uint32 Encounter[MAX_ENCOUNTER]; - - ObjectGuid VexallusDoorGUID; - ObjectGuid SelinDoorGUID; - ObjectGuid SelinEncounterDoorGUID; - ObjectGuid DelrissaDoorGUID; - ObjectGuid KaelDoorGUID; ObjectGuid EscapeOrbGUID; ObjectGuid DelrissaGUID; ObjectGuid KaelGUID; - void Initialize() override - { - memset(&Encounter, 0, sizeof(Encounter)); - } - - bool IsEncounterInProgress() const override - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (Encounter[i] == IN_PROGRESS) - return true; - return false; - } - - uint32 GetData(uint32 identifier) const override - { - switch (identifier) - { - case DATA_SELIN_EVENT: - case DATA_VEXALLUS_EVENT: - case DATA_DELRISSA_EVENT: - case DATA_KAELTHAS_EVENT: - return Encounter[identifier]; - } - return 0; - } - void ProcessEvent(WorldObject* /*obj*/, uint32 eventId) override { if (eventId == EVENT_SPAWN_KALECGOS) @@ -97,37 +81,6 @@ public: } } - void SetData(uint32 identifier, uint32 data) override - { - switch (identifier) - { - case DATA_SELIN_EVENT: - HandleGameObject(SelinDoorGUID, data == DONE); - HandleGameObject(SelinEncounterDoorGUID, data != IN_PROGRESS); - Encounter[identifier] = data; - break; - case DATA_VEXALLUS_EVENT: - if (data == DONE) - HandleGameObject(VexallusDoorGUID, true); - Encounter[identifier] = data; - break; - case DATA_DELRISSA_EVENT: - if (data == DONE) - HandleGameObject(DelrissaDoorGUID, true); - Encounter[identifier] = data; - break; - case DATA_KAELTHAS_EVENT: - HandleGameObject(KaelDoorGUID, data != IN_PROGRESS); - if (data == DONE) - if (GameObject* escapeOrb = instance->GetGameObject(EscapeOrbGUID)) - escapeOrb->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); - Encounter[identifier] = data; - break; - } - - SaveToDB(); - } - void OnCreatureCreate(Creature* creature) override { switch (creature->GetEntry()) @@ -148,60 +101,11 @@ public: InstanceScript::OnCreatureCreate(creature); } - void OnGameObjectCreate(GameObject* go) override - { - switch (go->GetEntry()) - { - case GO_SELIN_DOOR: - if (GetData(DATA_SELIN_EVENT) == DONE) - HandleGameObject(ObjectGuid::Empty, true, go); - SelinDoorGUID = go->GetGUID(); - break; - case GO_SELIN_ENCOUNTER_DOOR: - SelinEncounterDoorGUID = go->GetGUID(); - break; - - case GO_VEXALLUS_DOOR: - if (GetData(DATA_VEXALLUS_EVENT) == DONE) - HandleGameObject(ObjectGuid::Empty, true, go); - VexallusDoorGUID = go->GetGUID(); - break; - - case GO_DELRISSA_DOOR: - if (GetData(DATA_DELRISSA_EVENT) == DONE) - HandleGameObject(ObjectGuid::Empty, true, go); - DelrissaDoorGUID = go->GetGUID(); - break; - case GO_KAEL_DOOR: - KaelDoorGUID = go->GetGUID(); - break; - case GO_ESCAPE_ORB: - if (GetData(DATA_KAELTHAS_EVENT) == DONE) - go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); - EscapeOrbGUID = go->GetGUID(); - break; - } - } - - // @todo: Use BossStates. This is for code compatibility - void ReadSaveDataMore(std::istringstream& data) override - { - data >> Encounter[1]; - data >> Encounter[2]; - data >> Encounter[3]; - } - - void WriteSaveDataMore(std::ostringstream& data) override - { - data << Encounter[0] << ' ' << Encounter[1] << ' ' << Encounter[2] << ' ' << Encounter[3]; - } - ObjectGuid GetGuidData(uint32 identifier) const override { - switch (identifier) + if (identifier == NPC_DELRISSA) { - case NPC_DELRISSA: - return DelrissaGUID; + return DelrissaGUID; } return ObjectGuid::Empty; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h index d265866cd..e985711ac 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -28,13 +28,14 @@ enum MTData { - DATA_SELIN_EVENT = 0, - DATA_VEXALLUS_EVENT = 1, - DATA_DELRISSA_EVENT = 2, - DATA_KAELTHAS_EVENT = 3, + DATA_SELIN_FIREHEART = 0, + DATA_VEXALLUS = 1, + DATA_DELRISSA = 2, + DATA_KAELTHAS = 3, MAX_ENCOUNTER = 4, - DATA_KALECGOS = 5 + DATA_KALECGOS = 5, + DATA_ESCAPE_ORB = 6 }; enum MTCreatures From 6d1517f5e5a881b4cf66d43f3fbfda5ccbf352f8 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:11:27 -0300 Subject: [PATCH 18/49] fix(Scripts/Karazhan): Make Chess door non interactable (#17349) Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> --- data/sql/updates/pending_db_world/rev_1695611850243926000.sql | 2 ++ .../scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1695611850243926000.sql diff --git a/data/sql/updates/pending_db_world/rev_1695611850243926000.sql b/data/sql/updates/pending_db_world/rev_1695611850243926000.sql new file mode 100644 index 000000000..2ff53bd46 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695611850243926000.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject_template_addon` SET `faction` = 1375, `flags` = 32 WHERE (`entry` = 184277); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index f8568de6c..c344f96c5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -240,6 +240,9 @@ public: } } break; + case DONE: + HandleGameObject(m_uiGamesmansExitDoor, true); + break; } default: DoRemoveAurasDueToSpellOnPlayers(SPELL_GAME_IN_SESSION); From ebe887c5ba5b126dc1c37e40b7c900680ec6971b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Sep 2023 09:11:45 +0000 Subject: [PATCH 19/49] chore(DB): import pending files Referenced commit(s): cc60bc0c353573f8b3d5b3d8024407f80912f24f --- .../rev_1695609935652952000.sql => db_world/2023_09_25_01.sql} | 1 + .../rev_1695611850243926000.sql => db_world/2023_09_25_02.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1695609935652952000.sql => db_world/2023_09_25_01.sql} (87%) rename data/sql/updates/{pending_db_world/rev_1695611850243926000.sql => db_world/2023_09_25_02.sql} (69%) diff --git a/data/sql/updates/pending_db_world/rev_1695609935652952000.sql b/data/sql/updates/db_world/2023_09_25_01.sql similarity index 87% rename from data/sql/updates/pending_db_world/rev_1695609935652952000.sql rename to data/sql/updates/db_world/2023_09_25_01.sql index 9ac4d6392..ef0857572 100644 --- a/data/sql/updates/pending_db_world/rev_1695609935652952000.sql +++ b/data/sql/updates/db_world/2023_09_25_01.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_00 -> 2023_09_25_01 -- DELETE FROM `spell_script_names` WHERE `spell_id` IN (67486, 67489, 67487, 67490); INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1695611850243926000.sql b/data/sql/updates/db_world/2023_09_25_02.sql similarity index 69% rename from data/sql/updates/pending_db_world/rev_1695611850243926000.sql rename to data/sql/updates/db_world/2023_09_25_02.sql index 2ff53bd46..2659f7d8d 100644 --- a/data/sql/updates/pending_db_world/rev_1695611850243926000.sql +++ b/data/sql/updates/db_world/2023_09_25_02.sql @@ -1,2 +1,3 @@ +-- DB update 2023_09_25_01 -> 2023_09_25_02 -- UPDATE `gameobject_template_addon` SET `faction` = 1375, `flags` = 32 WHERE (`entry` = 184277); From 84d4d60cfcc2d97cf09aba55668e2ff5d81eef36 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:38:01 -0300 Subject: [PATCH 20/49] fix(Scripts/Karazhan): Fix Julliane awarding no loot (#17334) * fix(Scripts/Karazhan): Fix Julliene awarding no loot * Update bosses_opera.cpp --- src/server/game/Entities/Creature/Creature.h | 1 + .../EasternKingdoms/Karazhan/bosses_opera.cpp | 261 +++++------------- .../Karazhan/instance_karazhan.cpp | 36 +++ .../EasternKingdoms/Karazhan/karazhan.h | 8 + 4 files changed, 107 insertions(+), 199 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 903ae7099..c7c3102a1 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -366,6 +366,7 @@ public: // Handling caster facing during spellcast void SetTarget(ObjectGuid guid = ObjectGuid::Empty) override; + void ClearTarget() { SetTarget(); }; void FocusTarget(Spell const* focusSpell, WorldObject const* target); void ReleaseFocus(Spell const* focusSpell); [[nodiscard]] bool IsMovementPreventedByCasting() const override; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index 24fb4e991..1c037f381 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -947,7 +947,7 @@ enum JulianneRomulo SAY_ROMULO_AGGRO = 0, SAY_ROMULO_DEATH = 1, - SAY_ROMULO_ENTER = 2, + SAY_ROMULO_DEATH2 = 2, SAY_ROMULO_RESURRECT = 3, SAY_ROMULO_SLAY = 4, @@ -985,12 +985,10 @@ enum RAJGroups enum RAJActions { - ACTION_DIED_ANNOUNCE = 0, - ACTION_PHASE_SET = 1, ACTION_FAKING_DEATH = 2, ACTION_COMBAT_SCHEDULE = 3, - ACTION_DO_RESURRECT = 4, - ACTION_EARLY_REVIVE = 5, + //ACTION_DO_RESURRECT = 4, + //ACTION_RESS_ROMULO = 5, ACTION_CANCEL_COMBAT = 6 }; @@ -999,7 +997,6 @@ void PretendToDie(Creature* creature) creature->AI()->DoAction(ACTION_CANCEL_COMBAT); creature->InterruptNonMeleeSpells(true); creature->RemoveAllAuras(); - creature->SetHealth(0); creature->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); creature->SetReactState(REACT_PASSIVE); creature->GetMotionMaster()->MovementExpired(false); @@ -1032,14 +1029,6 @@ struct boss_julianne : public ScriptedAI isFakingDeath = false; } - InstanceScript* instance; - - uint32 phase; - - bool isFakingDeath; - bool summonedRomulo; - bool romuloDied; - void Reset() override { phase = PHASE_JULIANNE; @@ -1051,10 +1040,8 @@ struct boss_julianne : public ScriptedAI } summonedRomulo = false; - romuloDied = false; me->SetImmuneToPC(true); - //intro sequence _scheduler.Schedule(1s, [this](TaskContext) { Talk(SAY_JULIANNE_ENTER); @@ -1071,38 +1058,29 @@ struct boss_julianne : public ScriptedAI { switch(action) { - case ACTION_DIED_ANNOUNCE: - romuloDied = true; - break; - case ACTION_EARLY_REVIVE: - romuloDied = true; - _resurrectScheduler.Schedule(10s, [this](TaskContext) - { - Talk(SAY_JULIANNE_RESURRECT); - romuloDied = false; - }); - break; - case ACTION_PHASE_SET: - phase = PHASE_BOTH; - isFakingDeath = false; - break; case ACTION_FAKING_DEATH: isFakingDeath = false; break; case ACTION_COMBAT_SCHEDULE: ScheduleCombat(); break; - case ACTION_DO_RESURRECT: - _resurrectScheduler.Schedule(1s, [this](TaskContext) + case ACTION_RESS_ROMULO: + me->m_Events.AddEventAtOffset([this] { - if (Creature* Romulo = instance->GetCreature(DATA_ROMULO)) + if (Creature* romulo = instance->GetCreature(DATA_ROMULO)) { Talk(SAY_JULIANNE_RESURRECT); - Resurrect(Romulo); - Romulo->AI()->DoAction(ACTION_FAKING_DEATH); - romuloDied = false; + Resurrect(romulo); + romulo->AI()->DoAction(ACTION_FAKING_DEATH); + romulo->AI()->Talk(SAY_ROMULO_RESURRECT); } - }); + }, 1s); + break; + case ACTION_DO_RESURRECT: + phase = PHASE_BOTH; + isFakingDeath = false; + Resurrect(me); + me->ResumeChasingVictim(); break; case ACTION_CANCEL_COMBAT: _scheduler.CancelGroup(GROUP_COMBAT); @@ -1128,11 +1106,11 @@ struct boss_julianne : public ScriptedAI { if (urand(0, 1) && summonedRomulo) { - if (Creature* Romulo = instance->GetCreature(DATA_ROMULO)) + if (Creature* romulo = instance->GetCreature(DATA_ROMULO)) { - if (Romulo->IsAlive() && !romuloDied) + if (!romulo->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) { - DoCast(Romulo, SPELL_ETERNAL_AFFECTION); + DoCast(romulo, SPELL_ETERNAL_AFFECTION); } } } @@ -1149,22 +1127,6 @@ struct boss_julianne : public ScriptedAI ScheduleCombat(); } - void AttackStart(Unit* who) override - { - if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) override - { - if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - void JustReachedHome() override { me->DespawnOrUnsummon(); @@ -1183,10 +1145,9 @@ struct boss_julianne : public ScriptedAI phase = PHASE_ROMULO; _scheduler.Schedule(10s, GROUP_RP, [this](TaskContext) { - if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR * 2 * IN_MILLISECONDS)) + if (Creature* romulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR * 2 * IN_MILLISECONDS)) { - pRomulo->AI()->DoAction(ACTION_PHASE_SET); - pRomulo->SetInCombatWithZone(); + romulo->SetInCombatWithZone(); } summonedRomulo = true; }); @@ -1201,13 +1162,12 @@ struct boss_julianne : public ScriptedAI return; } - //anything below only used if incoming damage will kill + damage = me->GetHealth() - 1; if (phase == PHASE_JULIANNE) { - damage = 0; + me->ClearTarget(); - //this means already drinking, so return if (isFakingDeath) { return; @@ -1222,50 +1182,12 @@ struct boss_julianne : public ScriptedAI return; } - if (phase == PHASE_ROMULO) + if (phase == PHASE_BOTH && !isFakingDeath) { - //LOG_ERROR("scripts", "boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); - damage = 0; - return; + PretendToDie(me); + isFakingDeath = true; + instance->DoAction(ACTION_SCHEDULE_RAJ_CHECK); } - - if (phase == PHASE_BOTH) - { - //if this is true then we have to kill romulo too - if (romuloDied) - { - if (Creature* Romulo = instance->GetCreature(DATA_ROMULO)) - { - _scheduler.CancelAll(); - _resurrectScheduler.CancelAll(); - Romulo->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - Romulo->GetMotionMaster()->Clear(); - Romulo->setDeathState(JUST_DIED); - Romulo->CombatStop(true); - Romulo->GetThreatMgr().ClearAllThreat(); - Romulo->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE); - //this does not seem to really work - the lootable dynamic flags - } - - return; - } - - //if not already returned, then romulo is alive and we can pretend die - if (Creature* Romulo = instance->GetCreature(DATA_ROMULO)) - { - PretendToDie(me); - isFakingDeath = true; - Romulo->AI()->DoAction(ACTION_EARLY_REVIVE); - _scheduler.Schedule(10050ms, [this](TaskContext) - { - Resurrect(me); - isFakingDeath = false; - }); - damage = 0; - return; - } - } - //LOG_ERROR("scripts", "boss_julianneAI: DamageTaken reach end of code, that should not happen."); } void EnterEvadeMode(EvadeReason reason) override @@ -1286,15 +1208,17 @@ struct boss_julianne : public ScriptedAI instance->SetBossState(DATA_OPERA_PERFORMANCE, DONE); } - void KilledUnit(Unit* /*victim*/) override + void KilledUnit(Unit* victim) override { - Talk(SAY_JULIANNE_SLAY); + if (victim != me) + { + Talk(SAY_JULIANNE_SLAY); + } } void UpdateAI(uint32 diff) override { _scheduler.Update(diff); - _resurrectScheduler.Update(diff); if (!UpdateVictim()) { @@ -1307,50 +1231,30 @@ struct boss_julianne : public ScriptedAI } } private: + InstanceScript* instance; + uint32 phase; + bool isFakingDeath; + bool summonedRomulo; TaskScheduler _scheduler; - TaskScheduler _resurrectScheduler; }; struct boss_romulo : public ScriptedAI { boss_romulo(Creature* creature) : ScriptedAI(creature) { - instance = creature->GetInstanceScript(); //not necessary + instance = creature->GetInstanceScript(); } - InstanceScript* instance; - - uint32 phase; - - bool isFakingDeath; - bool julianneDead; - void Reset() override { phase = PHASE_ROMULO; - isFakingDeath = false; - julianneDead = false; } void DoAction(int32 action) override { switch(action) { - case ACTION_DIED_ANNOUNCE: - julianneDead = true; - break; - case ACTION_EARLY_REVIVE: - julianneDead = true; - _resurrectScheduler.Schedule(10s, [this](TaskContext) - { - Talk(SAY_ROMULO_RESURRECT); - julianneDead = false; - }); - break; - case ACTION_PHASE_SET: - phase = PHASE_ROMULO; - break; case ACTION_FAKING_DEATH: isFakingDeath = false; break; @@ -1375,9 +1279,11 @@ struct boss_romulo : public ScriptedAI void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override { if (damage < me->GetHealth()) + { return; + } - //anything below only used if incoming damage will kill + damage = me->GetHealth() - 1; if (phase == PHASE_ROMULO) { @@ -1386,63 +1292,24 @@ struct boss_romulo : public ScriptedAI isFakingDeath = true; phase = PHASE_BOTH; - if (Creature* Julianne = instance->GetCreature(DATA_JULIANNE)) + me->m_Events.AddEventAtOffset([this] { - Julianne->AI()->DoAction(ACTION_DIED_ANNOUNCE); - //resurrect julianne - _scheduler.Schedule(10s, GROUP_RP, [this](TaskContext) + Resurrect(me); + isFakingDeath = false; + if (Creature* julliane = instance->GetCreature(DATA_JULIANNE)) { - if (Creature* Julianne = instance->GetCreature(DATA_JULIANNE)) - { - Resurrect(Julianne); - Julianne->AI()->DoAction(ACTION_PHASE_SET); - Julianne->AI()->DoAction(ACTION_DO_RESURRECT); - if (Julianne->GetVictim()) - { - AttackStart(Julianne->GetVictim()); - } - } - }); - } - - damage = 0; - return; - } - - if (phase == PHASE_BOTH) - { - if (julianneDead) - { - if (Creature* Julianne = instance->GetCreature(DATA_JULIANNE)) - { - _scheduler.CancelAll(); - _resurrectScheduler.CancelAll(); - Julianne->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - Julianne->GetMotionMaster()->Clear(); - Julianne->setDeathState(JUST_DIED); - Julianne->CombatStop(true); - Julianne->GetThreatMgr().ClearAllThreat(); - Julianne->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE); - //this does not seem to really work + julliane->AI()->DoAction(ACTION_DO_RESURRECT); } - return; - } - - if (Creature* Julianne = instance->GetCreature(DATA_JULIANNE)) - { - PretendToDie(me); - isFakingDeath = true; - Julianne->AI()->DoAction(ACTION_EARLY_REVIVE); - _scheduler.Schedule(10050ms, [this](TaskContext) - { - Resurrect(me); - isFakingDeath = false; - }); - damage = 0; - return; - } + }, 3s); + } + + if (phase == PHASE_BOTH && !isFakingDeath) + { + Talk(SAY_ROMULO_DEATH2); + PretendToDie(me); + instance->DoAction(ACTION_SCHEDULE_RAJ_CHECK); + isFakingDeath = true; } - //LOG_ERROR("scripts", "boss_romuloAI: DamageTaken reach end of code, that should not happen."); } void ScheduleCombat() @@ -1488,14 +1355,6 @@ struct boss_romulo : public ScriptedAI ScheduleCombat(); } - void MoveInLineOfSight(Unit* who) override - { - if (me->HasUnitFlag(UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - void EnterEvadeMode(EvadeReason reason) override { ScriptedAI::EnterEvadeMode(reason); @@ -1510,15 +1369,17 @@ struct boss_romulo : public ScriptedAI instance->SetBossState(DATA_OPERA_PERFORMANCE, DONE); } - void KilledUnit(Unit* /*victim*/) override + void KilledUnit(Unit* victim) override { - Talk(SAY_ROMULO_SLAY); + if (victim != me) + { + Talk(SAY_ROMULO_SLAY); + } } void UpdateAI(uint32 diff) override { _scheduler.Update(diff); - _resurrectScheduler.Update(diff); if (!UpdateVictim()) { @@ -1531,8 +1392,10 @@ struct boss_romulo : public ScriptedAI } } private: + InstanceScript* instance; + uint32 phase; + bool isFakingDeath; TaskScheduler _scheduler; - TaskScheduler _resurrectScheduler; }; void AddSC_bosses_opera() diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index c344f96c5..0fe84199b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -421,6 +421,42 @@ public: return 0; } + void DoAction(int32 actionId) override + { + if (actionId == ACTION_SCHEDULE_RAJ_CHECK) + { + scheduler.Schedule(10s, [this](TaskContext) + { + Creature* julliane = GetCreature(DATA_JULIANNE); + Creature* romulo = GetCreature(DATA_ROMULO); + + if (julliane && romulo) + { + if (julliane->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE) + && romulo->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) + { + julliane->KillSelf(); + julliane->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + romulo->KillSelf(); + romulo->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + } + else + { + if (romulo->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) + { + julliane->AI()->DoAction(ACTION_RESS_ROMULO); + } + + if (julliane->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)) + { + julliane->AI()->DoAction(ACTION_DO_RESURRECT); + } + } + } + }); + } + } + ObjectGuid GetGuidData(uint32 data) const override { switch (data) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h index 274a5f1f3..7dbdbdb91 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h @@ -204,6 +204,14 @@ enum KarazhanChessGameFactions CHESS_FACTION_BOTH = 536 }; +enum InstanceActions +{ + ACTION_SCHEDULE_RAJ_CHECK, + + ACTION_DO_RESURRECT = 4, + ACTION_RESS_ROMULO = 5, +}; + template inline AI* GetKarazhanAI(T* obj) { From 4a0b879ee3ff6fd7318577f8b36b2eaf91ad59c3 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 06:41:21 -0300 Subject: [PATCH 21/49] =?UTF-8?q?fix(Scripts/Karazhan):=20Fix=20Shade=20of?= =?UTF-8?q?=20Aran=20Blizzard=20and=20use=20proper=20spel=E2=80=A6=20(#173?= =?UTF-8?q?29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/Karazhan): Fix Shade of Aran Blizzard and use proper spells to summon elementals * Update boss_shade_of_aran.cpp * Update boss_shade_of_aran.cpp * Update rev_1695546719351253200.sql * missing sql --- .../rev_1695546719351253200.sql | 40 ++++++++ .../game/Spells/SpellInfoCorrections.cpp | 6 ++ .../Karazhan/boss_shade_of_aran.cpp | 94 +++++++++---------- 3 files changed, 91 insertions(+), 49 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695546719351253200.sql diff --git a/data/sql/updates/pending_db_world/rev_1695546719351253200.sql b/data/sql/updates/pending_db_world/rev_1695546719351253200.sql new file mode 100644 index 000000000..6602a00cd --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695546719351253200.sql @@ -0,0 +1,40 @@ +-- +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` IN (29962, 37051, 37052, 37053, 29969)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 29962, 0, 0, 31, 0, 3, 17172, 0, 0, 0, 0, '', 'Summon Water Elementals (29962) can only target Shade of Aran Teleport NE (17172)'), +(13, 1, 37051, 0, 0, 31, 0, 3, 17175, 0, 0, 0, 0, '', 'Summon Water Elementals (37051) can only target Shade of Aran Teleport NW (17175)'), +(13, 1, 37052, 0, 0, 31, 0, 3, 17174, 0, 0, 0, 0, '', 'Summon Water Elementals (37052) can only target Shade of Aran Teleport SW (17174)'), +(13, 1, 37053, 0, 0, 31, 0, 3, 17173, 0, 0, 0, 0, '', 'Summon Water Elementals (37053) can only target Shade of Aran Teleport SE (17173)'), +(13, 1, 29969, 0, 0, 31, 0, 3, 17161, 0, 0, 0, 0, '', 'Summon Blizzard (29969) can only target Blizzard (Shade of Aran) (17161)'); + +SET @NPC := 135127; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `wander_distance`=0,`MovementType`=2,`position_x`=-11179.069,`position_y`=-1903.9922,`position_z`=231.99551 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, ''); +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,-11179.069,-1903.9922,231.99551,NULL,0,0,0,100,0), +(@PATH,2,-11175.637,-1898.6766,231.99551,NULL,0,0,0,100,0), +(@PATH,3,-11170.077,-1896.4208,231.99551,NULL,0,0,0,100,0), +(@PATH,4,-11163.756,-1896.4015,231.99551,NULL,0,0,0,100,0), +(@PATH,5,-11157.39,-1897.875,231.99551,NULL,0,0,0,100,0), +(@PATH,6,-11152.051,-1901.6866,231.99551,NULL,0,0,0,100,0), +(@PATH,7,-11148.58,-1906.875,231.99551,NULL,0,0,0,100,0), +(@PATH,8,-11148.341,-1914.24,231.99551,NULL,0,0,0,100,0), +(@PATH,9,-11149.94,-1919.9163,231.99551,NULL,0,0,0,100,0), +(@PATH,10,-11154.768,-1924.6886,231.99551,NULL,0,0,0,100,0), +(@PATH,11,-11160.866,-1927.3403,231.99551,NULL,0,0,0,100,0), +(@PATH,12,-11166.848,-1927.012,231.99551,NULL,0,0,0,100,0), +(@PATH,13,-11173.295,-1925.4417,231.99551,NULL,0,0,0,100,0), +(@PATH,14,-11178.082,-1922.4479,231.99551,NULL,0,0,0,100,0), +(@PATH,15,-11180.802,-1915.3156,231.99551,NULL,0,0,0,100,0), +(@PATH,16,-11181.109,-1909.6647,231.99551,NULL,0,0,0,100,0); + +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 17161; + +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 17161) 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 +(17161, 0, 0, 0, 8, 0, 100, 0, 29969, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blizzard (Shade of Aran) - On Spellhit \'Summon Blizzard\' - Set Event Phase 1'), +(17161, 0, 1, 0, 60, 1, 100, 0, 1000, 1000, 2000, 2000, 0, 11, 29951, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blizzard (Shade of Aran) - On Update - Cast \'Blizzard\' (Phase 1)'), +(17161, 0, 2, 0, 60, 1, 100, 0, 20000, 20000, 20000, 20000, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Blizzard (Shade of Aran) - On Update - Set Event Phase 0 (Phase 1)'); diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index d55a5505d..18aaac71a 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -4574,6 +4574,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->ProcChance = 3; }); + // Summon Water Elementals + ApplySpellFix({ 29962, 37051, 37052, 37053 }, [](SpellInfo* spellInfo) + { + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index 61f4538b2..fa75f1d3d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -22,45 +22,52 @@ #include "karazhan.h" #include "TaskScheduler.h" -enum ShadeOfAran +enum Texts { - SAY_AGGRO = 0, + SAY_AGGRO = 0, SAY_FLAMEWREATH = 1, - SAY_BLIZZARD = 2, - SAY_EXPLOSION = 3, - SAY_DRINK = 4, - SAY_ELEMENTALS = 5, - SAY_KILL = 6, - SAY_TIMEOVER = 7, - SAY_DEATH = 8, + SAY_BLIZZARD = 2, + SAY_EXPLOSION = 3, + SAY_DRINK = 4, + SAY_ELEMENTALS = 5, + SAY_KILL = 6, + SAY_TIMEOVER = 7, + SAY_DEATH = 8 +}; +enum Spells +{ //Spells - SPELL_FROSTBOLT = 29954, - SPELL_FIREBALL = 29953, - SPELL_ARCMISSLE = 29955, - SPELL_CHAINSOFICE = 29991, - SPELL_DRAGONSBREATH = 29964, - SPELL_MASSSLOW = 30035, - SPELL_FLAME_WREATH = 29946, - SPELL_AOE_CS = 29961, - SPELL_PLAYERPULL = 32265, - SPELL_AEXPLOSION = 29973, - SPELL_MASS_POLY = 29963, - SPELL_BLINK_CENTER = 29967, - SPELL_ELEMENTALS = 29962, - SPELL_CONJURE = 29975, - SPELL_DRINK = 30024, - SPELL_POTION = 32453, - SPELL_AOE_PYROBLAST = 29978, + SPELL_FROSTBOLT = 29954, + SPELL_FIREBALL = 29953, + SPELL_ARCMISSLE = 29955, + SPELL_CHAINSOFICE = 29991, + SPELL_DRAGONSBREATH = 29964, + SPELL_MASSSLOW = 30035, + SPELL_FLAME_WREATH = 29946, + SPELL_AOE_CS = 29961, + SPELL_PLAYERPULL = 32265, + SPELL_AEXPLOSION = 29973, + SPELL_MASS_POLY = 29963, + SPELL_BLINK_CENTER = 29967, + SPELL_CONJURE = 29975, + SPELL_DRINK = 30024, + SPELL_POTION = 32453, + SPELL_AOE_PYROBLAST = 29978, - //Creature Spells - SPELL_CIRCULAR_BLIZZARD = 29951, - SPELL_SHADOW_PYRO = 29978, + SPELL_SUMMON_WELEMENTAL_1 = 29962, + SPELL_SUMMON_WELEMENTAL_2 = 37051, + SPELL_SUMMON_WELEMENTAL_3 = 37052, + SPELL_SUMMON_WELEMENTAL_4 = 37053, - //Creatures - NPC_WATER_ELEMENTAL = 17167, - NPC_SHADOW_OF_ARAN = 18254, - NPC_ARAN_BLIZZARD = 17161, + SPELL_SUMMON_BLIZZARD = 29969, // Activates the Blizzard NPC + + SPELL_SHADOW_PYRO = 29978 +}; + +enum Creatures +{ + NPC_SHADOW_OF_ARAN = 18254 }; enum SuperSpell @@ -133,17 +140,11 @@ struct boss_shade_of_aran : public BossAI ScheduleHealthCheckEvent(40, [&]{ Talk(SAY_ELEMENTALS); - for(Position pos : elementalPos) + std::vector elementalSpells = { SPELL_SUMMON_WELEMENTAL_1, SPELL_SUMMON_WELEMENTAL_2, SPELL_SUMMON_WELEMENTAL_3, SPELL_SUMMON_WELEMENTAL_4 }; + + for (auto const& spell : elementalSpells) { - if(Creature* elemental = me->SummonCreature(NPC_WATER_ELEMENTAL, pos, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000)) - { - if(Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 100, true)) - { - DoStartNoMovement(target); - elemental->SetInCombatWithZone(); - elemental->CombatStart(target); - } - } + DoCastAOE(spell, true); } }); } @@ -341,12 +342,7 @@ struct boss_shade_of_aran : public BossAI case SUPER_BLIZZARD: Talk(SAY_BLIZZARD); - - if (Creature* pSpawn = me->SummonCreature(NPC_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) - { - pSpawn->SetFaction(me->GetFaction()); - pSpawn->CastSpell(me, SPELL_CIRCULAR_BLIZZARD, false); - } + DoCastAOE(SPELL_SUMMON_BLIZZARD); break; } } From 708bfb2c4884aa73f9447826a53efdb5cfd7cbd2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Sep 2023 09:42:28 +0000 Subject: [PATCH 22/49] chore(DB): import pending files Referenced commit(s): 4a0b879ee3ff6fd7318577f8b36b2eaf91ad59c3 --- .../rev_1695546719351253200.sql => db_world/2023_09_25_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1695546719351253200.sql => db_world/2023_09_25_03.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1695546719351253200.sql b/data/sql/updates/db_world/2023_09_25_03.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1695546719351253200.sql rename to data/sql/updates/db_world/2023_09_25_03.sql index 6602a00cd..9f8d0a396 100644 --- a/data/sql/updates/pending_db_world/rev_1695546719351253200.sql +++ b/data/sql/updates/db_world/2023_09_25_03.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_02 -> 2023_09_25_03 -- DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` IN (29962, 37051, 37052, 37053, 29969)); INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES From 3c698f86af7fa248973dff052ca4b6929fa6f608 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:04:15 -0300 Subject: [PATCH 23/49] fix(DB/Text): Add missing Netherspite text emotes (#17335) * fix(DB/Text): Add missing Netherspite text emotes * fix emote order * Update boss_netherspite.cpp --- .../rev_1695579044772631700.sql | 5 +++ .../Karazhan/boss_netherspite.cpp | 43 ++++++++----------- 2 files changed, 22 insertions(+), 26 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695579044772631700.sql diff --git a/data/sql/updates/pending_db_world/rev_1695579044772631700.sql b/data/sql/updates/pending_db_world/rev_1695579044772631700.sql new file mode 100644 index 000000000..35244f033 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695579044772631700.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `creature_text` WHERE `CreatureId` = 15689; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(15689, 0, 0, '%s goes into a nether-fed rage!', 41, 0, 100, 19877, 3, 'Netherspite EMOTE_PHASE_BANISH'), +(15689, 1, 0, '%s cries out in withdrawal, opening gates to the nether.', 41, 0, 100, 19880, 3, 'Netherspite EMOTE_PHASE_PORTAL'); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index 46f16be95..f16654cfb 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -24,8 +24,8 @@ enum Emotes { - EMOTE_PHASE_PORTAL = 0, - EMOTE_PHASE_BANISH = 1 + EMOTE_PHASE_BANISH = 0, + EMOTE_PHASE_PORTAL = 1 }; enum Spells @@ -101,7 +101,6 @@ struct boss_netherspite : public BossAI BossAI::Reset(); berserk = false; HandleDoors(true); - DestroyPortals(); } void SummonPortals() @@ -121,23 +120,6 @@ struct boss_netherspite : public BossAI } } - void DestroyPortals() - { - for (int i = 0; i < 3; ++i) - { - if (Creature* portal = ObjectAccessor::GetCreature(*me, PortalGUID[i])) - { - portal->DisappearAndDie(); - } - if (Creature* portal = ObjectAccessor::GetCreature(*me, BeamerGUID[i])) - { - portal->DisappearAndDie(); - } - PortalGUID[i].Clear(); - BeamTarget[i].Clear(); - } - } - void UpdatePortals() // Here we handle the beams' behavior { for (int j = 0; j < 3; ++j) // j = color @@ -203,8 +185,13 @@ struct boss_netherspite : public BossAI } } - void SwitchToPortalPhase() + void SwitchToPortalPhase(bool aggro = false) { + if (!aggro) + { + Talk(EMOTE_PHASE_PORTAL); + } + scheduler.CancelGroup(VANISH_PHASE); me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT); me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL); @@ -230,17 +217,22 @@ struct boss_netherspite : public BossAI DoCastRandomTarget(SPELL_VOIDZONE, 1, 45.0f, true, true); context.Repeat(15s); }); - Talk(EMOTE_PHASE_PORTAL); } void SwitchToBanishPhase() { + Talk(EMOTE_PHASE_BANISH); scheduler.CancelGroup(PORTAL_PHASE); me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT); me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA); DoCastSelf(SPELL_BANISH_VISUAL, true); DoCastSelf(SPELL_BANISH_ROOT, true); - DestroyPortals(); + + for (uint32 id : PortalID) + { + summons.DespawnEntry(id); + } + scheduler.Schedule(30s, [this](TaskContext) { SwitchToPortalPhase(); @@ -250,7 +242,7 @@ struct boss_netherspite : public BossAI DoCastRandomTarget(SPELL_NETHERBREATH, 0, 40.0f, true); context.Repeat(5s, 7s); }); - Talk(EMOTE_PHASE_BANISH); + for (uint8 i = 0; i < 3; ++i) { me->RemoveAurasDueToSpell(NetherBuff[i]); @@ -269,7 +261,7 @@ struct boss_netherspite : public BossAI { BossAI::JustEngagedWith(who); HandleDoors(false); - SwitchToPortalPhase(); + SwitchToPortalPhase(true); DoZoneInCombat(); scheduler.Schedule(9min, [this](TaskContext /*context*/) { @@ -286,7 +278,6 @@ struct boss_netherspite : public BossAI { BossAI::JustDied(killer); HandleDoors(true); - DestroyPortals(); } void UpdateAI(uint32 diff) override From bfb40db86db70977af43cc32c4d68faf28c3c12a Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:04:49 -0300 Subject: [PATCH 24/49] fix(Scripts/SlavePens): Correct target selector for Quagmirran Acid Spray (#17341) fix(Scripts/SlavePens): Correct target for Quagmirran Acid Spray --- .../pending_db_world/rev_1695589175269497100.sql | 4 ++++ .../SlavePens/boss_quagmirran.cpp | 14 ++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695589175269497100.sql diff --git a/data/sql/updates/pending_db_world/rev_1695589175269497100.sql b/data/sql/updates/pending_db_world/rev_1695589175269497100.sql new file mode 100644 index 000000000..09372c758 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695589175269497100.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spelldifficulty_dbc` WHERE `ID`=34780; +INSERT INTO `spelldifficulty_dbc` VALUES +(34780,34780,39340,0,0); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_quagmirran.cpp b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_quagmirran.cpp index 105b17616..136348fa6 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_quagmirran.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/boss_quagmirran.cpp @@ -23,8 +23,7 @@ enum Spells { SPELL_ACID_SPRAY = 38153, SPELL_CLEAVE = 40504, - SPELL_POISON_BOLT_VOLLEY_N = 34780, - SPELL_POISON_BOLT_VOLLEY_H = 39340, + SPELL_POISON_BOLT_VOLLEY = 34780, SPELL_UPPERCUT = 32055 }; @@ -38,11 +37,6 @@ struct boss_quagmirran : public BossAI }); } - void Reset() override - { - _Reset(); - } - void JustEngagedWith(Unit* /*who*/) override { _JustEngagedWith(); @@ -57,11 +51,11 @@ struct boss_quagmirran : public BossAI context.Repeat(21800ms); }).Schedule(25200ms, [this](TaskContext context) { - DoCastVictim(SPELL_ACID_SPRAY); + DoCastRandomTarget(SPELL_ACID_SPRAY); context.Repeat(25s); }).Schedule(31800ms, [this](TaskContext context) { - DoCastSelf(DUNGEON_MODE(SPELL_POISON_BOLT_VOLLEY_N, SPELL_POISON_BOLT_VOLLEY_H)); + DoCastAOE(SPELL_POISON_BOLT_VOLLEY); context.Repeat(24400ms); }); } @@ -70,4 +64,4 @@ struct boss_quagmirran : public BossAI void AddSC_boss_quagmirran() { RegisterTheSlavePensCreatureAI(boss_quagmirran); -} \ No newline at end of file +} From f9a88b52868e9125590d7f389b3b408a33486f12 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:05:20 -0300 Subject: [PATCH 25/49] fix(DB/Conditions): Fix Berthold teleport gossip conditions (#17336) --- data/sql/updates/pending_db_world/rev_1695581559864061500.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1695581559864061500.sql diff --git a/data/sql/updates/pending_db_world/rev_1695581559864061500.sql b/data/sql/updates/pending_db_world/rev_1695581559864061500.sql new file mode 100644 index 000000000..56c56f212 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695581559864061500.sql @@ -0,0 +1,3 @@ +-- +UPDATE `conditions` SET `ConditionValue1` = 6, `ConditionValue3` = 2 WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 7139 AND `SourceEntry` = 3; +UPDATE `spell_target_position` SET `PositionX` = -11165.2, `PositionY` = -1911.95, `PositionZ` = 232.009, `Orientation` = 2.14352, VerifiedBuild = 51845 WHERE `ID` = 39567; From e4717dc1791bd8ac405ed3b28cc17df9dee9d185 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Sep 2023 11:05:28 +0000 Subject: [PATCH 26/49] chore(DB): import pending files Referenced commit(s): 3c698f86af7fa248973dff052ca4b6929fa6f608 --- .../rev_1695579044772631700.sql => db_world/2023_09_25_04.sql} | 1 + .../rev_1695581559864061500.sql => db_world/2023_09_25_05.sql} | 1 + .../rev_1695589175269497100.sql => db_world/2023_09_25_06.sql} | 1 + 3 files changed, 3 insertions(+) rename data/sql/updates/{pending_db_world/rev_1695579044772631700.sql => db_world/2023_09_25_04.sql} (91%) rename data/sql/updates/{pending_db_world/rev_1695581559864061500.sql => db_world/2023_09_25_05.sql} (88%) rename data/sql/updates/{pending_db_world/rev_1695589175269497100.sql => db_world/2023_09_25_06.sql} (73%) diff --git a/data/sql/updates/pending_db_world/rev_1695579044772631700.sql b/data/sql/updates/db_world/2023_09_25_04.sql similarity index 91% rename from data/sql/updates/pending_db_world/rev_1695579044772631700.sql rename to data/sql/updates/db_world/2023_09_25_04.sql index 35244f033..4d161db76 100644 --- a/data/sql/updates/pending_db_world/rev_1695579044772631700.sql +++ b/data/sql/updates/db_world/2023_09_25_04.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_03 -> 2023_09_25_04 -- DELETE FROM `creature_text` WHERE `CreatureId` = 15689; INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `BroadcastTextId`, `TextRange`, `comment`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1695581559864061500.sql b/data/sql/updates/db_world/2023_09_25_05.sql similarity index 88% rename from data/sql/updates/pending_db_world/rev_1695581559864061500.sql rename to data/sql/updates/db_world/2023_09_25_05.sql index 56c56f212..6ab5b3910 100644 --- a/data/sql/updates/pending_db_world/rev_1695581559864061500.sql +++ b/data/sql/updates/db_world/2023_09_25_05.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_04 -> 2023_09_25_05 -- UPDATE `conditions` SET `ConditionValue1` = 6, `ConditionValue3` = 2 WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 7139 AND `SourceEntry` = 3; UPDATE `spell_target_position` SET `PositionX` = -11165.2, `PositionY` = -1911.95, `PositionZ` = 232.009, `Orientation` = 2.14352, VerifiedBuild = 51845 WHERE `ID` = 39567; diff --git a/data/sql/updates/pending_db_world/rev_1695589175269497100.sql b/data/sql/updates/db_world/2023_09_25_06.sql similarity index 73% rename from data/sql/updates/pending_db_world/rev_1695589175269497100.sql rename to data/sql/updates/db_world/2023_09_25_06.sql index 09372c758..27331db4f 100644 --- a/data/sql/updates/pending_db_world/rev_1695589175269497100.sql +++ b/data/sql/updates/db_world/2023_09_25_06.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_05 -> 2023_09_25_06 -- DELETE FROM `spelldifficulty_dbc` WHERE `ID`=34780; INSERT INTO `spelldifficulty_dbc` VALUES From b6e5e9f8842962ee381f371e23f885f9a7e3b339 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:05:39 -0300 Subject: [PATCH 27/49] =?UTF-8?q?fix(Scripts/SethekkHalls):=20Fix=20Anzu?= =?UTF-8?q?=20not=20leaving=20banish=20phase=20when=20all=E2=80=A6=20(#173?= =?UTF-8?q?37)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/SethekkHalls): Fix Anzu not leaving banish phase when all adds die --- .../scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp index c13ec226e..fe184a9c7 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_anzu.cpp @@ -83,13 +83,13 @@ struct boss_anzu : public BossAI uint32 talkTimer; - void SummonedCreatureDies(Creature* summon, Unit*) override + void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override { if (summon->GetEntry() == NPC_BROOD_OF_ANZU) { summons.Despawn(summon); summons.RemoveNotExisting(); - if (summons.empty()) + if (!summons.HasEntry(NPC_BROOD_OF_ANZU)) { me->RemoveAurasDueToSpell(SPELL_BANISH_SELF); } From 4afc200f41b58a419396e639ddbabe689f4e8094 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:06:01 -0300 Subject: [PATCH 28/49] fix(Scripts/Spells): Druid Dash require Cat Form (#17343) --- src/server/scripts/Spells/spell_druid.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index d7da1c33c..27f3cdece 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -388,20 +388,25 @@ class spell_dru_treant_scaling : public AuraScript }; // -1850 - Dash -class spell_dru_dash : public AuraScript +class spell_dru_dash : public SpellScript { - PrepareAuraScript(spell_dru_dash); + PrepareSpellScript(spell_dru_dash); - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + SpellCastResult CheckCast() { - // do not set speed if not in cat form - if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT) - amount = 0; + Unit* caster = GetCaster(); + if (caster->GetShapeshiftForm() != FORM_CAT) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_IN_CAT_FORM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; } void Register() override { - DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_dash::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED); + OnCheckCast += SpellCheckCastFn(spell_dru_dash::CheckCast); } }; From c7b7b7dc075c85d2a7b1bfc2791932e411682cd5 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:07:09 -0300 Subject: [PATCH 29/49] fix(Scripts/Spells): Fix Glyph of Voidwalker applying to every pet (#17342) * fix(Scripts/Spells): Fix Glyph of Voidwalker applying to every pet * Update src/server/game/Entities/Pet/Pet.cpp --- .../rev_1695598231920750800.sql | 4 ++ src/server/game/Entities/Pet/Pet.cpp | 8 ++++ src/server/game/Entities/Pet/PetDefines.h | 1 + .../game/Spells/SpellInfoCorrections.cpp | 8 ---- src/server/scripts/Spells/spell_warlock.cpp | 40 +++++++++++++++++++ 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1695598231920750800.sql diff --git a/data/sql/updates/pending_db_world/rev_1695598231920750800.sql b/data/sql/updates/pending_db_world/rev_1695598231920750800.sql new file mode 100644 index 000000000..fc56bd72f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695598231920750800.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warl_glyph_of_voidwalker' AND `spell_id` = 56247; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(56247, 'spell_warl_glyph_of_voidwalker'); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 5696c18ac..2b7f0570c 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1175,6 +1175,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), true); } + break; + } + case NPC_VOIDWALKER: + { + if (AuraEffect* aurEff = owner->GetAuraEffectDummy(SPELL_GLYPH_OF_VOIDWALKER)) + { + HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_PCT, aurEff->GetAmount(), true); + } break; } case NPC_WATER_ELEMENTAL_PERM: diff --git a/src/server/game/Entities/Pet/PetDefines.h b/src/server/game/Entities/Pet/PetDefines.h index 22849c217..65de91faa 100644 --- a/src/server/game/Entities/Pet/PetDefines.h +++ b/src/server/game/Entities/Pet/PetDefines.h @@ -147,6 +147,7 @@ enum PetScalingSpells SPELL_WARLOCK_PET_SCALING_04 = 34958, SPELL_WARLOCK_PET_SCALING_05 = 61013, // Hit / Expertise SPELL_GLYPH_OF_FELGUARD = 56246, + SPELL_GLYPH_OF_VOIDWALKER = 56247, SPELL_INFERNAL_SCALING_01 = 36186, SPELL_INFERNAL_SCALING_02 = 36188, SPELL_INFERNAL_SCALING_03 = 36189, diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 18aaac71a..c3ca283d2 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -1028,14 +1028,6 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(6); }); - // Glyph of Voidwalker - ApplySpellFix({ 56247 }, [](SpellInfo* spellInfo) - { - spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER; - spellInfo->Effects[EFFECT_0].MiscValue = SPELLMOD_EFFECT1; - spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x8000000, 0, 0); - }); - // Everlasting Affliction ApplySpellFix({ 47201, 47202, 47203, 47204, 47205 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 822d7bf64..e8efd5d51 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1267,6 +1267,45 @@ class spell_warl_glyph_of_felguard : public AuraScript } }; +class spell_warl_glyph_of_voidwalker : public AuraScript +{ + PrepareAuraScript(spell_warl_glyph_of_voidwalker); + + void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetCaster()->ToPlayer()) + { + if (Pet* pet = player->GetPet()) + { + if (pet->GetEntry() == NPC_VOIDWALKER) + { + pet->HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_PCT, aurEff->GetAmount(), true); + } + } + } + } + + void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (Player* player = GetCaster()->ToPlayer()) + { + if (Pet* pet = player->GetPet()) + { + if (pet->GetEntry() == NPC_VOIDWALKER) + { + pet->HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_PCT, aurEff->GetAmount(), false); + } + } + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_warl_glyph_of_voidwalker::HandleApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_warl_glyph_of_voidwalker::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + void AddSC_warlock_spell_scripts() { RegisterSpellScript(spell_warl_eye_of_kilrogg); @@ -1299,4 +1338,5 @@ void AddSC_warlock_spell_scripts() RegisterSpellScript(spell_warl_drain_soul); RegisterSpellScript(spell_warl_shadowburn); RegisterSpellScript(spell_warl_glyph_of_felguard); + RegisterSpellScript(spell_warl_glyph_of_voidwalker); } From 970c57954720733a2e02d32721395657db07ccd4 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:07:30 -0300 Subject: [PATCH 30/49] fix(Scripts/Ulduar): Respawn Algalon on wipes (#17344) --- .../Ulduar/Ulduar/boss_algalon_the_observer.cpp | 3 +++ .../Northrend/Ulduar/Ulduar/instance_ulduar.cpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index f187c85a5..86fc02904 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -366,6 +366,9 @@ public: return; } + if (m_pInstance) + m_pInstance->SetData(TYPE_ALGALON, FAIL); + ScriptedAI::EnterEvadeMode(why); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 52a25f438..df114d77d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -786,6 +786,18 @@ public: go->SetGoState(data == IN_PROGRESS ? GO_STATE_ACTIVE : GO_STATE_READY); go->EnableCollision(false); } + + if (data == FAIL) + { + scheduler.Schedule(5s, [this](TaskContext) + { + if (m_algalonTimer && (m_algalonTimer <= 60 || m_algalonTimer == TIMER_ALGALON_TO_SUMMON)) + { + instance->SummonCreature(NPC_ALGALON, AlgalonLandPos); + } + }); + } + break; // Achievement @@ -1109,6 +1121,8 @@ public: void Update(uint32 diff) override { + InstanceScript::Update(diff); + if (_events.Empty()) return; From 62c7d074f9020430c09f6a1f1545cfdc7d04a640 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Sep 2023 11:08:21 +0000 Subject: [PATCH 31/49] chore(DB): import pending files Referenced commit(s): c7b7b7dc075c85d2a7b1bfc2791932e411682cd5 --- .../rev_1695598231920750800.sql => db_world/2023_09_25_07.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1695598231920750800.sql => db_world/2023_09_25_07.sql} (83%) diff --git a/data/sql/updates/pending_db_world/rev_1695598231920750800.sql b/data/sql/updates/db_world/2023_09_25_07.sql similarity index 83% rename from data/sql/updates/pending_db_world/rev_1695598231920750800.sql rename to data/sql/updates/db_world/2023_09_25_07.sql index fc56bd72f..25279d51c 100644 --- a/data/sql/updates/pending_db_world/rev_1695598231920750800.sql +++ b/data/sql/updates/db_world/2023_09_25_07.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_06 -> 2023_09_25_07 -- DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warl_glyph_of_voidwalker' AND `spell_id` = 56247; INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES From 14ed5860e18017bcfb4f6759af3b955f09ce730d Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:33:23 -0300 Subject: [PATCH 32/49] =?UTF-8?q?fix(Core/Spells):=20Correct=20swapped=20T?= =?UTF-8?q?ARGET=5FUNIT=5FNEARBY=5FALLY=20and=20TARGET=5F=E2=80=A6=20(#173?= =?UTF-8?q?39)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spells): Correct swapped TARGET_UNIT_NEARBY_ALLY and TARGET_UNIT_NEARBY_PARTY (cherry picked from commit https://github.com/TrinityCore/TrinityCore/commit/7c6d92012afa4efe7b075aa6543e2169cda3faed ) Co-Authored-By: xvwyh <43143822+xvwyh@users.noreply.github.com> --- src/server/game/Spells/SpellInfo.cpp | 4 ++-- src/server/shared/SharedDefines.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index bdab02384..baaf3f1af 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -212,8 +212,8 @@ std::array SpellImplic {TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 1 TARGET_UNIT_CASTER {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 2 TARGET_UNIT_NEARBY_ENEMY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 3 TARGET_UNIT_NEARBY_PARTY - {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 4 TARGET_UNIT_NEARBY_ALLY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 3 TARGET_UNIT_NEARBY_ALLY + {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 4 TARGET_UNIT_NEARBY_PARTY {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 5 TARGET_UNIT_PET {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 6 TARGET_UNIT_TARGET_ENEMY {TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 7 TARGET_UNIT_SRC_AREA_ENTRY diff --git a/src/server/shared/SharedDefines.h b/src/server/shared/SharedDefines.h index 3a5623d8a..be1179b06 100644 --- a/src/server/shared/SharedDefines.h +++ b/src/server/shared/SharedDefines.h @@ -1381,8 +1381,8 @@ enum Targets { TARGET_UNIT_CASTER = 1, TARGET_UNIT_NEARBY_ENEMY = 2, - TARGET_UNIT_NEARBY_PARTY = 3, - TARGET_UNIT_NEARBY_ALLY = 4, + TARGET_UNIT_NEARBY_ALLY = 3, + TARGET_UNIT_NEARBY_PARTY = 4, TARGET_UNIT_PET = 5, TARGET_UNIT_TARGET_ENEMY = 6, TARGET_UNIT_SRC_AREA_ENTRY = 7, From 7140c0aa6456cdbf2b174c10ed8ee6669dd9ee93 Mon Sep 17 00:00:00 2001 From: KJack Date: Mon, 25 Sep 2023 08:34:09 -0400 Subject: [PATCH 33/49] fix(DB/Conditions): Argent Dawn shoulder enchant quest fixes (#17354) * Fix Argent Dawn enchants to only be available once the appropriate quest has been completed. * Remove horde-only flag, handle Chromatic enchant quests too --- .../rev_1695612785136315613.sql | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1695612785136315613.sql diff --git a/data/sql/updates/pending_db_world/rev_1695612785136315613.sql b/data/sql/updates/pending_db_world/rev_1695612785136315613.sql new file mode 100644 index 000000000..eb129046c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695612785136315613.sql @@ -0,0 +1,140 @@ +/* +################################################## +Argent Dawn Vendors: +- Argent Quartermaster Hasana (10856) +- Argent Quartermaster Lightspark (10857) +- Quartermaster Miranda Breechlock (11536) + +Quests: +- Mantles of the Dawn (5504) +- Mantles of the Dawn (5507) +- Mantles of the Dawn (5513) + +Shoulder Enchants: +- Flame Mantle of the Dawn (18169) +- Frost Mantle of the Dawn (18170) +- Arcane Mantle of the Dawn (18171) +- Nature Mantle of the Dawn (18172) +- Shadow Mantle of the Dawn (18173) + +Follow-up Quests: +- Chromatic Mantle of the Dawn (5517) +- Chromatic Mantle of the Dawn (5521) +- Chromatic Mantle of the Dawn (5524) + +Shoulder Enchant: +- Chromatic Mantle of the Dawn (18182) + +Vendor should only sell shoulder enchants if the player has completed the appropriate quest. +################################################## +*/ + +-- Add the Mantle of the Dawn quests (5504, 5507, 5513) to an ExclusiveGroup +DELETE FROM `quest_template_addon` WHERE `ID` in (5504, 5507, 5513); +INSERT INTO `quest_template_addon` (`ID`, `MaxLevel`, `AllowableClasses`, `SourceSpellID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`, `RewardMailTemplateID`, `RewardMailDelay`, `RequiredSkillID`, `RequiredSkillPoints`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `ProvidedItemCount`, `SpecialFlags`) VALUES +(5504, 0, 0, 0, 0, 0, 5504, 0, 0, 0, 0, 529, 0, 21000, 0, 0, 0), +(5507, 0, 0, 0, 0, 0, 5504, 0, 0, 0, 0, 529, 0, 21000, 0, 0, 0), +(5513, 0, 0, 0, 0, 0, 5504, 0, 0, 0, 0, 529, 0, 21000, 0, 0, 0); + +-- Add the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) to an ExclusiveGroup, and remove the repeatable flag +DELETE FROM `quest_template_addon` WHERE `ID` in (5517, 5521, 5524); +INSERT INTO `quest_template_addon` (`ID`, `MaxLevel`, `AllowableClasses`, `SourceSpellID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`, `RewardMailTemplateID`, `RewardMailDelay`, `RequiredSkillID`, `RequiredSkillPoints`, `RequiredMinRepFaction`, `RequiredMaxRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepValue`, `ProvidedItemCount`, `SpecialFlags`) VALUES +(5517, 0, 0, 0, 0, 0, 5517, 0, 0, 0, 0, 529, 0, 42000, 0, 0, 0), +(5521, 0, 0, 0, 0, 0, 5517, 0, 0, 0, 0, 529, 0, 42000, 0, 0, 0), +(5524, 0, 0, 0, 0, 0, 5517, 0, 0, 0, 0, 529, 0, 42000, 0, 0, 0); + +-- Make the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) require one of the Mantle of the Dawn quests (5504, 5507, 5513) +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 19 AND `SourceEntry` IN (5517, 5521, 5524)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 5517, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5517) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), +(19, 0, 5517, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5517) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), +(19, 0, 5517, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5517) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), + +(19, 0, 5521, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5521) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), +(19, 0, 5521, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5521) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), +(19, 0, 5521, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5521) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), + +(19, 0, 5524, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5524) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), +(19, 0, 5524, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5524) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'), +(19, 0, 5524, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Chromatic Mantle of the Dawn (5524) - Requires one of the Mantle of the Dawn quests (5504, 5507, 5513) rewarded'); + +-- Argent QuarterMaster Hasana (10856) Conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 23 AND `SourceGroup` = 10856 AND `SourceEntry` IN (18169, 18170, 18171, 18172, 18173, 18182)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(23, 10856, 18169, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18169, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18169, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10856, 18170, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18170, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18170, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10856, 18171, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18171, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18171, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10856, 18172, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18172, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18172, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10856, 18173, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18173, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10856, 18173, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10856, 18182, 0, 1, 47, 0, 5517, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'), +(23, 10856, 18182, 0, 2, 47, 0, 5521, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'), +(23, 10856, 18182, 0, 3, 47, 0, 5524, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Hasana (10856) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'); + +-- Argent QuarterMaster Lightspark (10857) Conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 23 AND `SourceGroup` = 10857 AND `SourceEntry` IN (18169, 18170, 18171, 18172, 18173, 18182)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(23, 10857, 18169, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18169, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18169, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10857, 18170, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18170, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18170, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10857, 18171, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18171, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18171, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10857, 18172, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18172, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18172, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10857, 18173, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18173, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 10857, 18173, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 10857, 18182, 0, 1, 47, 0, 5517, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'), +(23, 10857, 18182, 0, 2, 47, 0, 5521, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'), +(23, 10857, 18182, 0, 3, 47, 0, 5524, 64, 0, 0, 0, 0, '', 'Argent Quartermaster Lightspark (10857) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'); + +-- Quartermaster Miranda Breechlock (11536) Conditions +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 23 AND `SourceGroup` = 11536 AND `SourceEntry` IN (18169, 18170, 18171, 18172, 18173, 18182)); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(23, 11536, 18169, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18169, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18169, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Flame Mantle of the Dawn (18169) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 11536, 18170, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18170, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18170, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Frost Mantle of the Dawn (18170) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 11536, 18171, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18171, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18171, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Arcane Mantle of the Dawn (18171) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 11536, 18172, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18172, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18172, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Nature Mantle of the Dawn (18172) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 11536, 18173, 0, 1, 47, 0, 5504, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18173, 0, 2, 47, 0, 5507, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), +(23, 11536, 18173, 0, 3, 47, 0, 5513, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Shadow Mantle of the Dawn (18173) if one of the Mantle of the Dawn quests (5504, 5507, 5513) is rewarded.'), + +(23, 11536, 18182, 0, 1, 47, 0, 5517, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'), +(23, 11536, 18182, 0, 2, 47, 0, 5521, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'), +(23, 11536, 18182, 0, 3, 47, 0, 5524, 64, 0, 0, 0, 0, '', 'Quartermaster Miranda Breechlock (11536) - Only sell Chromatic Mantle of the Dawn (18182) if one of the Chromatic Mantle of the Dawn quests (5517, 5521, 5524) is rewarded.'); From b40640fc38965e083ec89a21eca07436f2a18178 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 25 Sep 2023 12:35:15 +0000 Subject: [PATCH 34/49] chore(DB): import pending files Referenced commit(s): 7140c0aa6456cdbf2b174c10ed8ee6669dd9ee93 --- .../rev_1695612785136315613.sql => db_world/2023_09_25_08.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1695612785136315613.sql => db_world/2023_09_25_08.sql} (99%) diff --git a/data/sql/updates/pending_db_world/rev_1695612785136315613.sql b/data/sql/updates/db_world/2023_09_25_08.sql similarity index 99% rename from data/sql/updates/pending_db_world/rev_1695612785136315613.sql rename to data/sql/updates/db_world/2023_09_25_08.sql index eb129046c..366134a83 100644 --- a/data/sql/updates/pending_db_world/rev_1695612785136315613.sql +++ b/data/sql/updates/db_world/2023_09_25_08.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_07 -> 2023_09_25_08 /* ################################################## Argent Dawn Vendors: From 2d3e9a8f2386eb7725c83b14d72c49766168dd21 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:01:19 +0200 Subject: [PATCH 35/49] fix(Player/Achievement): fix crash (#17357) * closes https://github.com/azerothcore/azerothcore-wotlk/issues/17330 --- src/server/game/Instances/InstanceSaveMgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index d934ec3ad..ec6854ede 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -676,7 +676,8 @@ InstancePlayerBind* InstanceSaveMgr::PlayerBindToInstance(ObjectGuid guid, Insta stmt->SetData(2, permanent); CharacterDatabase.Execute(stmt); - player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, 1); + if (player) + player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, 1); } if (bind.save != save) From e67a0b1a82a0173c6100921b1bcf91b8834c9308 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:31:36 -0300 Subject: [PATCH 36/49] =?UTF-8?q?fix(Scripts/Spells):=20Fix=20Furious=20Ho?= =?UTF-8?q?wl=20not=20giving=20ranged=20attack=20power=20=E2=80=A6=20(#173?= =?UTF-8?q?45)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rev_1695604876617457700.sql | 6 +++++ src/server/scripts/Spells/spell_hunter.cpp | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1695604876617457700.sql diff --git a/data/sql/updates/pending_db_world/rev_1695604876617457700.sql b/data/sql/updates/pending_db_world/rev_1695604876617457700.sql new file mode 100644 index 000000000..ba48608ae --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695604876617457700.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`= -24604 AND `ScriptName` = 'spell_hun_furious_howl'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(-24604, 'spell_hun_furious_howl'); + +DELETE FROM `spell_dbc` WHERE `ID` IN (24604, 64491, 64492, 64493, 64494, 64495, 53434); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 7f3468659..4bbb80310 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -1308,6 +1308,29 @@ class spell_hun_bestial_wrath : public SpellScript } }; +class spell_hun_furious_howl : public SpellScript +{ + PrepareSpellScript(spell_hun_furious_howl); + + bool Load() override + { + return GetCaster()->IsPet(); + } + + void FilterTargets(std::list& targets) + { + targets.remove_if([&](WorldObject const* target) -> bool + { + return target != GetCaster() && target != GetCaster()->ToPet()->GetOwner(); + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_furious_howl::FilterTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_PARTY); + } +}; + void AddSC_hunter_spell_scripts() { RegisterSpellScript(spell_hun_check_pet_los); @@ -1338,4 +1361,5 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_lock_and_load); RegisterSpellScript(spell_hun_intimidation); RegisterSpellScript(spell_hun_bestial_wrath); + RegisterSpellScript(spell_hun_furious_howl); } From a7969472b46f64ff1d8a050ba784f35ea78b6b31 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Sep 2023 00:32:43 +0000 Subject: [PATCH 37/49] chore(DB): import pending files Referenced commit(s): e67a0b1a82a0173c6100921b1bcf91b8834c9308 --- .../rev_1695604876617457700.sql => db_world/2023_09_26_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1695604876617457700.sql => db_world/2023_09_26_00.sql} (87%) diff --git a/data/sql/updates/pending_db_world/rev_1695604876617457700.sql b/data/sql/updates/db_world/2023_09_26_00.sql similarity index 87% rename from data/sql/updates/pending_db_world/rev_1695604876617457700.sql rename to data/sql/updates/db_world/2023_09_26_00.sql index ba48608ae..6e7eea892 100644 --- a/data/sql/updates/pending_db_world/rev_1695604876617457700.sql +++ b/data/sql/updates/db_world/2023_09_26_00.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_25_08 -> 2023_09_26_00 -- DELETE FROM `spell_script_names` WHERE `spell_id`= -24604 AND `ScriptName` = 'spell_hun_furious_howl'; INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES From a8e514ea39590d2ee3a66b9e419e641fb2f910a6 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:30:35 -0300 Subject: [PATCH 38/49] =?UTF-8?q?fix(Core/Unit):=20Threat=20from=20energiz?= =?UTF-8?q?e=20effects=20should=20be=20proportional=20t=E2=80=A6=20(#17352?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Unit): Threat from energize effects should be proportional to the amount of power gained --- src/server/game/Entities/Unit/Unit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b95b31962..c7964a1ff 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11255,12 +11255,12 @@ void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellID, uint32 damage, Pow void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers powerType) { - victim->ModifyPower(powerType, damage, false); + int32 gainedPower = victim->ModifyPower(powerType, damage, false); - if (powerType != POWER_HAPPINESS) + if (powerType != POWER_HAPPINESS && gainedPower) { SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID); - victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo); + victim->getHostileRefMgr().threatAssist(this, float(gainedPower) * 0.5f, spellInfo); } SendEnergizeSpellLog(victim, spellID, damage, powerType); From c05acf4f96e22d12826e3710fbf274c278ed94a9 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Tue, 26 Sep 2023 21:15:18 +0000 Subject: [PATCH 39/49] fix(Script/Karazhan): Netherspite resets threat after portal phase (#17362) * Update boss_netherspite.cpp * Update boss_netherspite.cpp * Update boss_netherspite.cpp --- .../scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index f16654cfb..0adb88ffb 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -50,7 +50,7 @@ enum Portals enum Groups { PORTAL_PHASE = 0, - VANISH_PHASE = 1 + BANISH_PHASE = 1 }; const float PortalCoord[3][3] = @@ -192,7 +192,7 @@ struct boss_netherspite : public BossAI Talk(EMOTE_PHASE_PORTAL); } - scheduler.CancelGroup(VANISH_PHASE); + scheduler.CancelGroup(BANISH_PHASE); me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT); me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL); SummonPortals(); @@ -236,8 +236,9 @@ struct boss_netherspite : public BossAI scheduler.Schedule(30s, [this](TaskContext) { SwitchToPortalPhase(); + DoResetThreatList(); return; - }).Schedule(10s, VANISH_PHASE, [this](TaskContext context) + }).Schedule(10s, BANISH_PHASE, [this](TaskContext context) { DoCastRandomTarget(SPELL_NETHERBREATH, 0, 40.0f, true); context.Repeat(5s, 7s); From ae99ce586a57e64c921437f8d6c01c20af002a97 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:27:23 -0300 Subject: [PATCH 40/49] fix(Scripts/Karazhan): Fix Aran combat movement behavior (#17359) * fix(Scripts/Karazhan): Fix Aran combat movement behavior * Update SmartScript.cpp --- src/server/game/Entities/Creature/Creature.cpp | 18 ++++++++++++++++++ src/server/game/Entities/Creature/Creature.h | 6 ++++++ .../Karazhan/boss_shade_of_aran.cpp | 15 ++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index f8a41cc57..8340fbc72 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -3707,6 +3707,24 @@ uint32 Creature::GetPlayerDamageReq() const return _playerDamageReq; } +bool Creature::CanCastSpell(uint32 spellID) const +{ + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID); + int32 currentPower = GetPower(getPowerType()); + + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED) || IsSpellProhibited(spellInfo->GetSchoolMask())) + { + return false; + } + + if (spellInfo && (currentPower < spellInfo->CalcPowerCost(this, spellInfo->GetSchoolMask()))) + { + return false; + } + + return true; +} + std::string Creature::GetDebugInfo() const { std::stringstream sstr; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index c7c3102a1..d0a6b8b72 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -399,6 +399,12 @@ public: * */ void ResumeChasingVictim() { GetMotionMaster()->MoveChase(GetVictim()); }; + /** + * @brief Returns true if the creature is able to cast the spell. + * + * */ + bool CanCastSpell(uint32 spellID) const; + std::string GetDebugInfo() const override; protected: diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp index fa75f1d3d..df45f50f1 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -256,7 +256,20 @@ struct boss_shade_of_aran : public BossAI if (AvailableSpells) { CurrentNormalSpell = Spells[rand() % AvailableSpells]; - DoCast(target, CurrentNormalSpell); + + if (!me->CanCastSpell(CurrentNormalSpell)) + { + me->SetWalk(false); + me->ResumeChasingVictim(); + } + else + { + DoCast(target, CurrentNormalSpell); + if (me->GetVictim()) + { + me->GetMotionMaster()->MoveChase(me->GetVictim(), 45.0f); + } + } } } context.Repeat(2s); From 2d620f20ddbe707c4dda7336141d99cf187ac722 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Tue, 26 Sep 2023 23:50:44 +0200 Subject: [PATCH 41/49] fix(DB/Creature): make Malchezaar interrupt immune (#17363) initial --- .../updates/pending_db_world/malchezaar-interrupt-immune.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql diff --git a/data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql b/data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql new file mode 100644 index 000000000..5ae03f969 --- /dev/null +++ b/data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|33554432 WHERE `entry` = 15690; From 6649ad08d7154d5e1614b8f7382f241ce63b054d Mon Sep 17 00:00:00 2001 From: Ludwig Date: Tue, 26 Sep 2023 23:51:59 +0200 Subject: [PATCH 42/49] fix(Scripts/Midsummer): Make beam target Ribbon Pole top (#17358) * fix(Scripts/Midsummer): Make beam target Ribbon Pole top progress #12145 * refactor(Scripts/Midsummer): shorten spell_midsummer_ribbon_pole_visual::UpdateTarget --- .../rev_1695647577303392800.sql | 4 +++ src/server/scripts/Events/midsummer.cpp | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1695647577303392800.sql diff --git a/data/sql/updates/pending_db_world/rev_1695647577303392800.sql b/data/sql/updates/pending_db_world/rev_1695647577303392800.sql new file mode 100644 index 000000000..63d4b5270 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695647577303392800.sql @@ -0,0 +1,4 @@ +-- #12145 midsummer add spell script spell_midsummer_ribbon_pole_visual +DELETE FROM acore_world.spell_script_names WHERE spell_id = 29172; +INSERT INTO acore_world.spell_script_names (spell_id, ScriptName) VALUES +(29172, 'spell_midsummer_ribbon_pole_visual'); diff --git a/src/server/scripts/Events/midsummer.cpp b/src/server/scripts/Events/midsummer.cpp index d428e1747..8c9b251bb 100644 --- a/src/server/scripts/Events/midsummer.cpp +++ b/src/server/scripts/Events/midsummer.cpp @@ -253,6 +253,39 @@ class spell_midsummer_ribbon_pole : public AuraScript } }; +class spell_midsummer_ribbon_pole_visual : public SpellScript +{ + PrepareSpellScript(spell_midsummer_ribbon_pole_visual) + + void UpdateTarget(WorldObject*& target) + { + if (!target) + return; + + // find NPC at ribbon pole top as target + // trap 181604 also spawns NPCs at pole bottom - ignore those + std::list crList; + target->GetCreaturesWithEntryInRange(crList, 30.0f, NPC_RIBBON_POLE_DEBUG_TARGET); + if (crList.empty()) + return; + + for (std::list::const_iterator itr = crList.begin(); itr != crList.end(); ++itr) + { + // NPC on ribbon pole top is no tempsummon + if (!(*itr)->ToTempSummon()) + { + target = *itr; + return; + } + } + } + + void Register() override + { + OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_midsummer_ribbon_pole_visual::UpdateTarget, EFFECT_0, TARGET_UNIT_NEARBY_ENTRY); + } +}; + class spell_midsummer_torch_quest : public AuraScript { PrepareAuraScript(spell_midsummer_torch_quest) @@ -514,6 +547,7 @@ void AddSC_event_midsummer_scripts() // Spells RegisterSpellScript(spell_gen_crab_disguise); RegisterSpellScript(spell_midsummer_ribbon_pole); + RegisterSpellScript(spell_midsummer_ribbon_pole_visual); RegisterSpellScript(spell_midsummer_torch_quest); RegisterSpellScript(spell_midsummer_fling_torch); RegisterSpellScript(spell_midsummer_juggling_torch); From 501399cd0eb87a24ac10ac6966a00ae70855f1da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Sep 2023 21:52:08 +0000 Subject: [PATCH 43/49] chore(DB): import pending files Referenced commit(s): 2d620f20ddbe707c4dda7336141d99cf187ac722 --- .../2023_09_26_01.sql} | 1 + .../rev_1695647577303392800.sql => db_world/2023_09_26_02.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/malchezaar-interrupt-immune.sql => db_world/2023_09_26_01.sql} (71%) rename data/sql/updates/{pending_db_world/rev_1695647577303392800.sql => db_world/2023_09_26_02.sql} (85%) diff --git a/data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql b/data/sql/updates/db_world/2023_09_26_01.sql similarity index 71% rename from data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql rename to data/sql/updates/db_world/2023_09_26_01.sql index 5ae03f969..dc0500e06 100644 --- a/data/sql/updates/pending_db_world/malchezaar-interrupt-immune.sql +++ b/data/sql/updates/db_world/2023_09_26_01.sql @@ -1,2 +1,3 @@ +-- DB update 2023_09_26_00 -> 2023_09_26_01 -- UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|33554432 WHERE `entry` = 15690; diff --git a/data/sql/updates/pending_db_world/rev_1695647577303392800.sql b/data/sql/updates/db_world/2023_09_26_02.sql similarity index 85% rename from data/sql/updates/pending_db_world/rev_1695647577303392800.sql rename to data/sql/updates/db_world/2023_09_26_02.sql index 63d4b5270..fc823837d 100644 --- a/data/sql/updates/pending_db_world/rev_1695647577303392800.sql +++ b/data/sql/updates/db_world/2023_09_26_02.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_26_01 -> 2023_09_26_02 -- #12145 midsummer add spell script spell_midsummer_ribbon_pole_visual DELETE FROM acore_world.spell_script_names WHERE spell_id = 29172; INSERT INTO acore_world.spell_script_names (spell_id, ScriptName) VALUES From 8d7461eb2cbeb92f534e32723eb088afe2504283 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Wed, 27 Sep 2023 00:23:26 +0200 Subject: [PATCH 44/49] refactor(Scripts/SSC): Lady Vashj boss script updated (#17083) * initial * whitespace1 * fix timers repeat maxtimer needs work. average is skewed because the max is very high. I took the average timer as maxtimer now * fixes --- .../SerpentShrine/boss_lady_vashj.cpp | 374 +++++++++--------- 1 file changed, 186 insertions(+), 188 deletions(-) diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 4ecb9e585..b496d3e25 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -64,20 +64,6 @@ enum Misc ITEM_TAINTED_CORE = 31088, POINT_HOME = 1, - - EVENT_SPELL_SHOCK_BLAST = 1, - EVENT_SPELL_STATIC_CHARGE = 2, - EVENT_SPELL_ENTANGLE = 3, - EVENT_CHECK_HEALTH = 4, - EVENT_SPELL_FORKED_LIGHTNING = 5, - EVENT_SUMMON_A = 6, - EVENT_SUMMON_B = 7, - EVENT_SUMMON_C = 8, - EVENT_SUMMON_D = 9, - EVENT_CHECK_HEALTH2 = 10, - EVENT_SUMMON_SPOREBAT = 11, - - EVENT_KILL_TALK = 20 }; class startFollow : public BasicEvent @@ -88,215 +74,223 @@ public: bool Execute(uint64 /*execTime*/, uint32 /*diff*/) override { if (InstanceScript* instance = _owner->GetInstanceScript()) + { if (Creature* vashj = ObjectAccessor::GetCreature(*_owner, instance->GetGuidData(NPC_LADY_VASHJ))) + { _owner->GetMotionMaster()->MoveFollow(vashj, 3.0f, vashj->GetAngle(_owner), MOTION_SLOT_CONTROLLED); + } + } return true; } - private: Unit* _owner; }; -class boss_lady_vashj : public CreatureScript +struct boss_lady_vashj : public BossAI { -public: - boss_lady_vashj() : CreatureScript("boss_lady_vashj") { } - - CreatureAI* GetAI(Creature* creature) const override + boss_lady_vashj(Creature* creature) : BossAI(creature, DATA_LADY_VASHJ) { - return GetSerpentShrineAI(creature); + scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + + _intro = false; } - struct boss_lady_vashjAI : public BossAI + void Reset() override { - boss_lady_vashjAI(Creature* creature) : BossAI(creature, DATA_LADY_VASHJ) + _count = 0; + _recentlySpoken = false; + _batTimer = 20s; + BossAI::Reset(); + + ScheduleHealthCheckEvent(70, [&]{ + Talk(SAY_PHASE2); + me->SetReactState(REACT_PASSIVE); + me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true); + }); + } + + void KilledUnit(Unit* /*victim*/) override + { + if(!_recentlySpoken) { - intro = false; + Talk(SAY_SLAY); + _recentlySpoken = true; + } + scheduler.Schedule(6s, [this](TaskContext) + { + _recentlySpoken = false; + }); + } + + void JustDied(Unit* killer) override + { + Talk(SAY_DEATH); + BossAI::JustDied(killer); + } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + Talk(SAY_AGGRO); + DoCastSelf(SPELL_REMOVE_TAINTED_CORES, true); + + ScheduleSpells(); + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + if (summon->GetEntry() == WORLD_TRIGGER) + { + summon->CastSpell(summon, SPELL_MAGIC_BARRIER); + } + else if (summon->GetEntry() == NPC_ENCHANTED_ELEMENTAL) + { + summon->SetWalk(true); + summon->m_Events.AddEvent(new startFollow(summon), summon->m_Events.CalculateTime(0)); + } + else if (summon->GetEntry() == NPC_TOXIC_SPOREBAT) + { + summon->GetMotionMaster()->MoveRandom(30.0f); + } + else if (summon->GetEntry() != NPC_TAINTED_ELEMENTAL) + { + summon->GetMotionMaster()->MovePoint(POINT_HOME, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), true, true); + } + } + + void ScheduleSpells() + { + scheduler.Schedule(14550ms, [this](TaskContext context) + { + DoCastVictim(SPELL_SHOCK_BLAST); + context.Repeat(10850ms, 25100ms); + }).Schedule(18150ms, [this](TaskContext context) + { + DoCastRandomTarget(SPELL_STATIC_CHARGE); + context.Repeat(7250ms, 27050ms); + }).Schedule(25450ms, [this](TaskContext context) + { + DoCastSelf(SPELL_ENTANGLE); + context.Repeat(18200ms, 51500ms); + }); + } + + void MoveInLineOfSight(Unit* who) override + { + if (!_intro && who->GetTypeId() == TYPEID_PLAYER) + { + _intro = true; + Talk(SAY_INTRO); } - bool intro; - int32 count; + BossAI::MoveInLineOfSight(who); + } - void Reset() override + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE || id != POINT_HOME) { - count = 0; - BossAI::Reset(); + return; } - void KilledUnit(Unit* /*victim*/) override + me->SetFacingTo(me->GetHomePosition().GetOrientation()); + instance->SetData(DATA_ACTIVATE_SHIELD, 0); + scheduler.CancelAll(); + + scheduler.Schedule(2400ms, [this](TaskContext context) { - if (events.GetNextEventTime(EVENT_KILL_TALK) == 0) + DoCastRandomTarget(SPELL_FORKED_LIGHTNING); + context.Repeat(2400ms, 12450ms); + }).Schedule(0s, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_ENCHANTED_ELEMENTAL, true); + context.Repeat(2500ms); + }).Schedule(45s, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_COILFANG_ELITE, true); + context.Repeat(45s); + }).Schedule(60s, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_COILFANG_STRIDER, true); + context.Repeat(60s); + }).Schedule(50s, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_TAINTED_ELEMENTAL, true); + context.Repeat(50s); + }).Schedule(1s, [this](TaskContext context) + { + if (!me->HasAura(SPELL_MAGIC_BARRIER)) { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6000); - } - } + Talk(SAY_PHASE3); + me->SetReactState(REACT_AGGRESSIVE); + me->GetMotionMaster()->MoveChase(me->GetVictim()); + scheduler.CancelAll(); - void JustDied(Unit* killer) override - { - Talk(SAY_DEATH); - BossAI::JustDied(killer); - } - - void JustEngagedWith(Unit* who) override - { - BossAI::JustEngagedWith(who); - Talk(SAY_AGGRO); - - me->CastSpell(me, SPELL_REMOVE_TAINTED_CORES, true); - events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, 10000); - events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 15000); - events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 20000); - events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000); - } - - void JustSummoned(Creature* summon) override - { - summons.Summon(summon); - if (summon->GetEntry() == WORLD_TRIGGER) - summon->CastSpell(summon, SPELL_MAGIC_BARRIER, false); - else if (summon->GetEntry() == NPC_ENCHANTED_ELEMENTAL) - { - summon->SetWalk(true); - summon->m_Events.AddEvent(new startFollow(summon), summon->m_Events.CalculateTime(0)); - } - else if (summon->GetEntry() == NPC_TOXIC_SPOREBAT) - summon->GetMotionMaster()->MoveRandom(30.0f); - else if (summon->GetEntry() != NPC_TAINTED_ELEMENTAL) - summon->GetMotionMaster()->MovePoint(POINT_HOME, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), true, true); - } - - void MoveInLineOfSight(Unit* who) override - { - if (!intro && who->GetTypeId() == TYPEID_PLAYER) - { - intro = true; - Talk(SAY_INTRO); - } - - BossAI::MoveInLineOfSight(who); - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type != POINT_MOTION_TYPE || id != POINT_HOME) - return; - - me->SetFacingTo(me->GetHomePosition().GetOrientation()); - instance->SetData(DATA_ACTIVATE_SHIELD, 0); - events.Reset(); - events.ScheduleEvent(EVENT_SPELL_FORKED_LIGHTNING, 3000); - events.ScheduleEvent(EVENT_SUMMON_A, 0); - events.ScheduleEvent(EVENT_SUMMON_B, 45000); - events.ScheduleEvent(EVENT_SUMMON_C, 60000); - events.ScheduleEvent(EVENT_SUMMON_D, 50000); - events.ScheduleEvent(EVENT_CHECK_HEALTH2, 1000); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - switch (events.ExecuteEvent()) - { - case EVENT_SPELL_SHOCK_BLAST: - me->CastSpell(me->GetVictim(), SPELL_SHOCK_BLAST, false); - events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, urand(10000, 20000)); - break; - case EVENT_SPELL_STATIC_CHARGE: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f)) - me->CastSpell(target, SPELL_STATIC_CHARGE, false); - events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 20000); - break; - case EVENT_SPELL_ENTANGLE: - me->CastSpell(me, SPELL_ENTANGLE, false); - events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 30000); - break; - case EVENT_CHECK_HEALTH: - if (me->HealthBelowPct(71)) - { - Talk(SAY_PHASE2); - me->SetReactState(REACT_PASSIVE); - me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true); - break; - } - events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000); - break; - case EVENT_SPELL_FORKED_LIGHTNING: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 60.0f)) - me->CastSpell(target, SPELL_FORKED_LIGHTNING, false); - events.ScheduleEvent(EVENT_SPELL_FORKED_LIGHTNING, urand(2500, 5000)); - break; - case EVENT_SUMMON_A: - me->CastSpell(me, SPELL_SUMMON_ENCHANTED_ELEMENTAL, true); - events.ScheduleEvent(EVENT_SUMMON_A, 2500); - break; - case EVENT_SUMMON_B: - me->CastSpell(me, SPELL_SUMMON_COILFANG_ELITE, true); - events.ScheduleEvent(EVENT_SUMMON_B, 45000); - break; - case EVENT_SUMMON_C: - me->CastSpell(me, SPELL_SUMMON_COILFANG_STRIDER, true); - events.ScheduleEvent(EVENT_SUMMON_C, 60000); - break; - case EVENT_SUMMON_D: - me->CastSpell(me, SPELL_SUMMON_TAINTED_ELEMENTAL, true); - events.ScheduleEvent(EVENT_SUMMON_D, 50000); - break; - case EVENT_CHECK_HEALTH2: - if (!me->HasAura(SPELL_MAGIC_BARRIER)) - { - Talk(SAY_PHASE3); - me->SetReactState(REACT_AGGRESSIVE); - me->GetMotionMaster()->MoveChase(me->GetVictim()); - events.Reset(); - events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, 10000); - events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 15000); - events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 20000); - events.ScheduleEvent(EVENT_SUMMON_SPOREBAT, 5000); - break; - } - events.ScheduleEvent(EVENT_CHECK_HEALTH2, 1000); - break; - case EVENT_SUMMON_SPOREBAT: - me->CastSpell(me, SPELL_SUMMON_TOXIC_SPOREBAT, true); - events.ScheduleEvent(EVENT_SUMMON_SPOREBAT, 20000 - 1000 * std::min(count++, 16)); - break; - } - - if (me->GetReactState() != REACT_AGGRESSIVE || !me->isAttackReady()) - return; - - if (!me->IsWithinMeleeRange(me->GetVictim())) - { - me->resetAttackTimer(); - me->SetSheath(SHEATH_STATE_RANGED); - me->CastSpell(me->GetVictim(), roll_chance_i(33) ? SPELL_MULTI_SHOT : SPELL_SHOOT, false); - if (roll_chance_i(15)) - Talk(SAY_BOWSHOT); + ScheduleSpells(); + scheduler.Schedule(5s, [this](TaskContext context) + { + DoCastSelf(SPELL_SUMMON_TOXIC_SPOREBAT, true); + _batTimer = 20s - static_cast(std::min(_count++, 16)); + context.Repeat(_batTimer); + }); } else { - me->SetSheath(SHEATH_STATE_MELEE); - DoMeleeAttackIfReady(); + context.Repeat(1s); } + }); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + scheduler.Update(diff); + + if (me->GetReactState() != REACT_AGGRESSIVE || !me->isAttackReady()) + { + return; } - bool CheckEvadeIfOutOfCombatArea() const override + if (!me->IsWithinMeleeRange(me->GetVictim())) { - return me->GetHomePosition().GetExactDist2d(me) > 80.0f || !SelectTargetFromPlayerList(100.0f); + me->resetAttackTimer(); + me->SetSheath(SHEATH_STATE_RANGED); + me->CastSpell(me->GetVictim(), roll_chance_i(33) ? SPELL_MULTI_SHOT : SPELL_SHOOT, false); + if (roll_chance_i(15)) + { + Talk(SAY_BOWSHOT); + } } - }; + else + { + me->SetSheath(SHEATH_STATE_MELEE); + DoMeleeAttackIfReady(); + } + } + + bool CheckEvadeIfOutOfCombatArea() const override + { + return me->GetHomePosition().GetExactDist2d(me) > 80.0f || !SelectTargetFromPlayerList(100.0f); + } + +private: + bool _recentlySpoken; + bool _intro; + int32 _count; + std::chrono::seconds _batTimer; }; + /* //Toxic Sporebat //Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. +//deprecated -- adds do work class npc_toxic_sporebat : public CreatureScript { public: @@ -433,7 +427,9 @@ public: { PreventHitDefaultEffect(effIndex); if (Player* target = GetHitPlayer()) + { target->DestroyItemCount(ITEM_TAINTED_CORE, -1, true); + } } void Register() override @@ -488,7 +484,9 @@ public: { PreventHitDefaultEffect(effIndex); if (Unit* target = GetHitUnit()) + { target->CastSpell(target, SPELL_TOXIC_SPORES, true, nullptr, nullptr, GetCaster()->GetGUID()); + } } void Register() override @@ -505,7 +503,7 @@ public: void AddSC_boss_lady_vashj() { - new boss_lady_vashj(); + RegisterSerpentShrineAI(boss_lady_vashj); new spell_lady_vashj_magic_barrier(); new spell_lady_vashj_remove_tainted_cores(); new spell_lady_vashj_summon_sporebat(); From 39ee52f9cb17051d950a351659f728bd05500287 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:03:00 -0300 Subject: [PATCH 45/49] chore: fix sql (#17365) --- data/sql/updates/db_world/2023_09_26_02.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/sql/updates/db_world/2023_09_26_02.sql b/data/sql/updates/db_world/2023_09_26_02.sql index fc823837d..5d9b41a93 100644 --- a/data/sql/updates/db_world/2023_09_26_02.sql +++ b/data/sql/updates/db_world/2023_09_26_02.sql @@ -1,5 +1,5 @@ -- DB update 2023_09_26_01 -> 2023_09_26_02 -- #12145 midsummer add spell script spell_midsummer_ribbon_pole_visual -DELETE FROM acore_world.spell_script_names WHERE spell_id = 29172; -INSERT INTO acore_world.spell_script_names (spell_id, ScriptName) VALUES +DELETE FROM `spell_script_names` WHERE `spell_id` = 29172; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (29172, 'spell_midsummer_ribbon_pole_visual'); From 4b85e3ed98c674fbb165bc9a5c24a6514cbb7d0d Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Wed, 27 Sep 2023 01:07:04 +0200 Subject: [PATCH 46/49] refactor(Scripts/SSC): Fathomlord Karathress boss script updated (#17079) --- .../updates/pending_db_world/fathomguards.sql | 21 + .../boss_fathomlord_karathress.cpp | 590 ++++++++++++++---- .../SerpentShrine/instance_serpent_shrine.cpp | 16 + .../SerpentShrine/serpent_shrine.h | 5 + 4 files changed, 516 insertions(+), 116 deletions(-) create mode 100644 data/sql/updates/pending_db_world/fathomguards.sql diff --git a/data/sql/updates/pending_db_world/fathomguards.sql b/data/sql/updates/pending_db_world/fathomguards.sql new file mode 100644 index 000000000..0cb4856fb --- /dev/null +++ b/data/sql/updates/pending_db_world/fathomguards.sql @@ -0,0 +1,21 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN (22486, 22487); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (22091, 22486, 22487); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(22091, 0, 0, 0, 0, 0, 100, 0, 0, 0, 3000, 3000, 0, 0, 11, 38296, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Spitfire Totem - In Combat - Cast Attack'), +(22091, 0, 1, 0, 6, 0, 100, 512, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 9, 21965, 0, 100, 1, 0, 0, 0, 0, 'Spitfire Totem - On Death - Do Action on Fathom-Guard Tidalvess'), +(22486, 0, 0, 0, 6, 0, 100, 512, 0, 0, 0, 0, 0, 0, 223, 2, 0, 0, 0, 0, 0, 9, 21965, 0, 100, 1, 0, 0, 0, 0, 'Greater Earthbind Totem - On Death - Do Action on Fathom-Guard Tidalvess'), +(22487, 0, 0, 0, 6, 0, 100, 512, 0, 0, 0, 0, 0, 0, 223, 3, 0, 0, 0, 0, 0, 9, 21965, 0, 100, 1, 0, 0, 0, 0, 'Greater Poison Cleansing Totem - On Death - Do Action on Fathom-Guard Tidalvess'); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (21964, 21965, 21966) AND `source_type` = 0; + +UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'boss_fathomguard_caribdis' WHERE `entry` = 21964; +UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'boss_fathomguard_tidalvess' WHERE `entry` = 21965; +UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'boss_fathomguard_sharkkis' WHERE `entry` = 21966; + +DELETE FROM `creature_template_movement` WHERE `CreatureId` IN (22091, 22486, 22487); +INSERT INTO `creature_template_movement` (`CreatureId`, `Flight`, `Rooted`) VALUES +(22091, 1, 1), +(22486, 1, 1), +(22487, 1, 1); diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index ef979b2c9..832a11dcf 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -18,6 +18,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "serpent_shrine.h" +#include "TaskScheduler.h" enum Talk { @@ -32,26 +33,41 @@ enum Talk enum Spells { + //Fathomlord Karathress SPELL_CATACLYSMIC_BOLT = 38441, SPELL_SEAR_NOVA = 38445, SPELL_ENRAGE = 24318, - SPELL_BLESSING_OF_THE_TIDES = 38449 + SPELL_BLESSING_OF_THE_TIDES = 38449, + //Fathomguard Sharkkis + SPELL_HURL_TRIDENT = 38374, + SPELL_LEECHING_THROW = 29436, + SPELL_MULTI_TOSS = 38366, + SPELL_SUMMON_FATHOM_SPOREBAT = 38431, + SPELL_SUMMON_FATHOM_LURKER = 38433, + SPELL_THE_BEAST_WITHIN = 38373, + SPELL_BESTIAL_WRATH = 38371, + SPELL_POWER_OF_SHARKKIS = 38455, + //Fathomguard Tidalvess + SPELL_FROST_SHOCK = 38234, + SPELL_EARTHBIND_TOTEM = 38304, + SPELL_POISON_CLEANSING_TOTEM = 38306, + SPELL_SPITFIRE_TOTEM = 38236, + SPELL_POWER_OF_TIDALVESS = 38452, + //Fathomguard Caribdis + SPELL_SUMMON_CYCLONE = 38337, + SPELL_WATER_BOLT_VOLLEY = 38335, + SPELL_TIDAL_SURGE = 38358, + SPELL_HEALING_WAVE = 38330, + SPELL_POWER_OF_CARIBDIS = 38451, + //Spitfire Totem + SPELL_ATTACK = 38296 }; enum Misc { MAX_ADVISORS = 3, - NPC_FATHOM_GUARD_CARIBDIS = 21964, - NPC_FATHOM_GUARD_TIDALVESS = 21965, - NPC_FATHOM_GUARD_SHARKKIS = 21966, NPC_SEER_OLUM = 22820, GO_CAGE = 185952, - - EVENT_SPELL_CATACLYSMIC_BOLT = 1, - EVENT_SPELL_ENRAGE = 2, - EVENT_SPELL_SEAR_NOVA = 3, - EVENT_HEALTH_CHECK = 4, - EVENT_KILL_TALK = 5 }; const Position advisorsPosition[MAX_ADVISORS + 2] = @@ -63,124 +79,463 @@ const Position advisorsPosition[MAX_ADVISORS + 2] = {457.37f, -544.71f, -7.54f, 0.00f} }; -class boss_fathomlord_karathress : public CreatureScript +struct boss_fathomlord_karathress : public BossAI { -public: - boss_fathomlord_karathress() : CreatureScript("boss_fathomlord_karathress") { } - - CreatureAI* GetAI(Creature* creature) const override + boss_fathomlord_karathress(Creature* creature) : BossAI(creature, DATA_FATHOM_LORD_KARATHRESS) { - return GetSerpentShrineAI(creature); + scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); } - struct boss_fathomlord_karathressAI : public BossAI + void Reset() override { - boss_fathomlord_karathressAI(Creature* creature) : BossAI(creature, DATA_FATHOM_LORD_KARATHRESS) - { - } + BossAI::Reset(); + _recentlySpoken = false; - void Reset() override - { - BossAI::Reset(); + me->SummonCreature(NPC_FATHOM_GUARD_TIDALVESS, advisorsPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000); + me->SummonCreature(NPC_FATHOM_GUARD_SHARKKIS, advisorsPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000); + me->SummonCreature(NPC_FATHOM_GUARD_CARIBDIS, advisorsPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000); - me->SummonCreature(NPC_FATHOM_GUARD_TIDALVESS, advisorsPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000); - me->SummonCreature(NPC_FATHOM_GUARD_SHARKKIS, advisorsPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000); - me->SummonCreature(NPC_FATHOM_GUARD_CARIBDIS, advisorsPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000); - } - - void JustSummoned(Creature* summon) override - { - summons.Summon(summon); - if (summon->GetEntry() == NPC_SEER_OLUM) + ScheduleHealthCheckEvent(75, [&]{ + for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr) { - summon->SetWalk(true); - summon->GetMotionMaster()->MovePoint(0, advisorsPosition[MAX_ADVISORS + 1], false); - } - } - - void SummonedCreatureDies(Creature* summon, Unit*) override - { - summons.Despawn(summon); - if (summon->GetEntry() == NPC_FATHOM_GUARD_TIDALVESS) - Talk(SAY_GAIN_ABILITY1); - if (summon->GetEntry() == NPC_FATHOM_GUARD_SHARKKIS) - Talk(SAY_GAIN_ABILITY2); - if (summon->GetEntry() == NPC_FATHOM_GUARD_CARIBDIS) - Talk(SAY_GAIN_ABILITY3); - } - - void KilledUnit(Unit* /*victim*/) override - { - if (events.GetNextEventTime(EVENT_KILL_TALK) == 0) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6000); - } - } - - void JustDied(Unit* killer) override - { - Talk(SAY_DEATH); - BossAI::JustDied(killer); - me->SummonCreature(NPC_SEER_OLUM, advisorsPosition[MAX_ADVISORS], TEMPSUMMON_TIMED_DESPAWN, 3600000); - if (GameObject* gobject = me->FindNearestGameObject(GO_CAGE, 100.0f)) - gobject->SetGoState(GO_STATE_ACTIVE); - } - - void JustEngagedWith(Unit* who) override - { - BossAI::JustEngagedWith(who); - Talk(SAY_AGGRO); - me->CallForHelp(10.0f); - - events.ScheduleEvent(EVENT_SPELL_CATACLYSMIC_BOLT, 10000); - events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000); - events.ScheduleEvent(EVENT_SPELL_SEAR_NOVA, 25000); - events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - events.Update(diff); - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - switch (events.ExecuteEvent()) - { - case EVENT_SPELL_ENRAGE: - me->CastSpell(me, SPELL_ENRAGE, true); - break; - case EVENT_SPELL_CATACLYSMIC_BOLT: - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, PowerUsersSelector(me, POWER_MANA, 50.0f, true))) - me->CastSpell(target, SPELL_CATACLYSMIC_BOLT, false); - events.ScheduleEvent(EVENT_SPELL_CATACLYSMIC_BOLT, 6000); - break; - case EVENT_SPELL_SEAR_NOVA: - me->CastSpell(me, SPELL_SEAR_NOVA, false); - events.ScheduleEvent(EVENT_SPELL_SEAR_NOVA, 20000 + urand(0, 20000)); - break; - case EVENT_HEALTH_CHECK: - if (me->HealthBelowPct(76)) + if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr)) + { + if (summon->GetMaxHealth() > 500000) { - for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr) - if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr)) - if (summon->GetMaxHealth() > 500000) - summon->CastSpell(me, SPELL_BLESSING_OF_THE_TIDES, true); - - if (me->HasAura(SPELL_BLESSING_OF_THE_TIDES)) - Talk(SAY_GAIN_BLESSING); - break; + summon->CastSpell(me, SPELL_BLESSING_OF_THE_TIDES, true); } - events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000); - break; + } } + if (me->HasAura(SPELL_BLESSING_OF_THE_TIDES)) + { + Talk(SAY_GAIN_BLESSING); + } + }); + } - DoMeleeAttackIfReady(); + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + if (summon->GetEntry() == NPC_SEER_OLUM) + { + summon->SetWalk(true); + summon->GetMotionMaster()->MovePoint(0, advisorsPosition[MAX_ADVISORS + 1], false); } - }; + } + + void SummonedCreatureDies(Creature* summon, Unit*) override + { + summons.Despawn(summon); + if (summon->GetEntry() == NPC_FATHOM_GUARD_TIDALVESS) + Talk(SAY_GAIN_ABILITY1); + if (summon->GetEntry() == NPC_FATHOM_GUARD_SHARKKIS) + Talk(SAY_GAIN_ABILITY2); + if (summon->GetEntry() == NPC_FATHOM_GUARD_CARIBDIS) + Talk(SAY_GAIN_ABILITY3); + } + + void KilledUnit(Unit* /*victim*/) override + { + if (!_recentlySpoken) + { + Talk(SAY_SLAY); + _recentlySpoken = true; + } + scheduler.Schedule(6s, [this](TaskContext) + { + _recentlySpoken = false; + }); + } + + void JustDied(Unit* killer) override + { + Talk(SAY_DEATH); + BossAI::JustDied(killer); + me->SummonCreature(NPC_SEER_OLUM, advisorsPosition[MAX_ADVISORS], TEMPSUMMON_TIMED_DESPAWN, 3600000); + if (GameObject* gobject = me->FindNearestGameObject(GO_CAGE, 100.0f)) + { + gobject->SetGoState(GO_STATE_ACTIVE); + } + } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + Talk(SAY_AGGRO); + + instance->DoForAllMinions(DATA_FATHOM_LORD_KARATHRESS, [&](Creature* fathomguard) { + fathomguard->SetInCombatWithZone(); + }); + + scheduler.Schedule(10s, [this](TaskContext context) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, PowerUsersSelector(me, POWER_MANA, 50.0f, true))) + { + me->CastSpell(target, SPELL_CATACLYSMIC_BOLT); + } + context.Repeat(6s); + }).Schedule(25s, [this](TaskContext context) + { + DoCastSelf(SPELL_SEAR_NOVA); + context.Repeat(20s, 40s); + }).Schedule(10min, [this](TaskContext) + { + DoCastSelf(SPELL_ENRAGE, true); + }); + } +private: + bool _recentlySpoken; +}; + +struct LeechingThrowSelector +{ +public: + explicit LeechingThrowSelector(WorldObject const* source) : _source(source) { } + + bool operator() (Unit* unit) const + { + return unit->getPowerType() == POWER_MANA && _source->GetDistance(unit) < 50.0f; + } +private: + WorldObject const* _source; +}; + +struct boss_fathomguard_sharkkis : public ScriptedAI +{ + boss_fathomguard_sharkkis(Creature* creature) : ScriptedAI(creature), summons(creature) + { + summons.clear(); + + _instance = creature->GetInstanceScript(); + + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + } + + SummonList summons; + + void Reset() override + { + _scheduler.CancelAll(); + + summons.DespawnAll(); + } + + void JustSummoned(Creature* summon) override + { + summon->SetInCombatWithZone(); + summons.Summon(summon); + } + + void JustEngagedWith(Unit* /*who*/) override + { + _scheduler.Schedule(2500ms, [this](TaskContext context) + { + DoCastRandomTarget(SPELL_HURL_TRIDENT); + context.Repeat(5s); + }).Schedule(20650ms, [this](TaskContext context) + { + DoCastRandomTarget(SPELL_MULTI_TOSS); + context.Repeat(12150ms, 26350ms); + }).Schedule(6050ms, [this](TaskContext context) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, LeechingThrowSelector(me))) + { + me->CastSpell(target, SPELL_LEECHING_THROW); + } + context.Repeat(6050ms, 22250ms); + }).Schedule(41250ms, [this](TaskContext context) + { + DoCastSelf(SPELL_THE_BEAST_WITHIN); + summons.DoForAllSummons([&](WorldObject* summon) + { + me->CastSpell(summon->ToCreature(), SPELL_BESTIAL_WRATH, true); + }); + context.Repeat(39950ms, 46050ms); + }).Schedule(14550ms, [this](TaskContext context) + { + DoCastSelf(urand(0, 1) ? SPELL_SUMMON_FATHOM_LURKER : SPELL_SUMMON_FATHOM_SPOREBAT); + context.Repeat(30300ms); + }); + } + + void JustDied(Unit* /*killer*/) override + { + if (Creature* karathress = _instance->GetCreature(DATA_FATHOM_LORD_KARATHRESS)) + { + me->CastSpell(karathress, SPELL_POWER_OF_SHARKKIS); + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } + + _scheduler.Update(diff); + + DoMeleeAttackIfReady(); + } + +private: + TaskScheduler _scheduler; + InstanceScript* _instance; +}; + +enum NPCTotems +{ + NPC_SPITFIRE_TOTEM = 22091, + NPC_GREATER_EARTHBIND_TOTEM = 22486, + NPC_GREATER_POISON_CLEANSING_TOTEM = 22487 +}; + +enum TidalActions +{ + ACTION_REMOVE_SPITFIRE = 1, + ACTION_REMOVE_EARTHBIND = 2, + ACTION_REMOVE_CLEANSING = 3 +}; + +enum TotemChoice +{ + SPITFIRE = 1, + EARTHBIND = 2, + CLEANSING = 3 +}; + +struct boss_fathomguard_tidalvess : public ScriptedAI +{ + boss_fathomguard_tidalvess(Creature* creature) : ScriptedAI(creature), summons(creature) + { + _instance = creature->GetInstanceScript(); + + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + } + + SummonList summons; + + std::list entryList; + + void Reset() override + { + _scheduler.CancelAll(); + _choice = 0; + + summons.DespawnAll(); + + entryList.clear(); + + entryList = {NPC_SPITFIRE_TOTEM, NPC_GREATER_EARTHBIND_TOTEM, NPC_GREATER_POISON_CLEANSING_TOTEM}; + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + summon->Attack(me->GetVictim(), false); + summon->SetInCombatWithZone(); + } + + void ScheduleRemoval(uint32 entry) + { + std::chrono::seconds timer = 0s; + int32 action = 0; + uint8 group = 0; + + switch(entry) + { + case NPC_SPITFIRE_TOTEM: + timer = 59s; + action = ACTION_REMOVE_SPITFIRE; + group = SPITFIRE; + break; + case NPC_GREATER_EARTHBIND_TOTEM: + timer = 44s; + action = ACTION_REMOVE_EARTHBIND; + group = EARTHBIND; + break; + case NPC_GREATER_POISON_CLEANSING_TOTEM: + timer = 29s; + action = ACTION_REMOVE_CLEANSING; + group = CLEANSING; + break; + default: + timer = 29s; + } + _totemScheduler.Schedule(timer, group, [this, action](TaskContext) + { + me->AI()->DoAction(action); + }); + } + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_REMOVE_SPITFIRE: + _totemScheduler.CancelGroup(SPITFIRE); + entryList.push_back(NPC_SPITFIRE_TOTEM); + break; + case ACTION_REMOVE_EARTHBIND: + _totemScheduler.CancelGroup(EARTHBIND); + entryList.push_back(NPC_GREATER_EARTHBIND_TOTEM); + break; + case ACTION_REMOVE_CLEANSING: + _totemScheduler.CancelGroup(CLEANSING); + entryList.push_back(NPC_GREATER_POISON_CLEANSING_TOTEM); + break; + default: + return; + } + } + + void SummonTotem(uint32 entry) + { + switch(entry) + { + case NPC_SPITFIRE_TOTEM: + DoCastSelf(SPELL_SPITFIRE_TOTEM); + break; + case NPC_GREATER_EARTHBIND_TOTEM: + DoCastSelf(SPELL_EARTHBIND_TOTEM); + break; + case NPC_GREATER_POISON_CLEANSING_TOTEM: + DoCastSelf(SPELL_POISON_CLEANSING_TOTEM); + break; + default: + return; + } + } + + void JustEngagedWith(Unit* /*who*/) override + { + _scheduler.Schedule(10900ms, [this](TaskContext context) + { + DoCastVictim(SPELL_FROST_SHOCK); + context.Repeat(10900ms, 14700ms); + }).Schedule(15800ms, [this](TaskContext context) + { + if (entryList.size() != 0) //don't summon when all totems are up + { + uint32 totemEntry = entryList.front(); + entryList.pop_front(); + SummonTotem(totemEntry); + ScheduleRemoval(totemEntry); + } + context.Repeat(13350ms, 24250ms); + }); + } + + void JustDied(Unit* /*killer*/) override + { + if (Creature* karathress = _instance->GetCreature(DATA_FATHOM_LORD_KARATHRESS)) + { + me->CastSpell(karathress, SPELL_POWER_OF_TIDALVESS); + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } + + _scheduler.Update(diff); + _totemScheduler.Update(diff); + + DoMeleeAttackIfReady(); + } + +private: + TaskScheduler _scheduler; + TaskScheduler _totemScheduler; + InstanceScript* _instance; + uint8 _choice; +}; + +struct boss_fathomguard_caribdis : public ScriptedAI +{ + boss_fathomguard_caribdis(Creature* creature) : ScriptedAI(creature), summons(creature) + { + _instance = creature->GetInstanceScript(); + + _scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); + } + + SummonList summons; + + void Reset() override + { + _scheduler.CancelAll(); + + summons.DespawnAll(); + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + } + + void JustEngagedWith(Unit* /*who*/) override + { + _scheduler.Schedule(27900ms, [this](TaskContext context) + { + DoCastSelf(SPELL_WATER_BOLT_VOLLEY); + context.Repeat(6050ms, 19750ms); + }).Schedule(23050ms, [this](TaskContext context) + { + DoCastSelf(SPELL_TIDAL_SURGE); + context.Repeat(24250ms, 33250ms); + }).Schedule(15750ms, [this](TaskContext context) + { + DoCastRandomTarget(SPELL_SUMMON_CYCLONE); + context.Repeat(47250ms, 51550ms); + }).Schedule(20s, [this](TaskContext context) + { + if (Unit* target = DoSelectLowestHpFriendly(60.0f, 150000)) + { + DoCast(target, SPELL_HEALING_WAVE); + } + context.Repeat(20s); + }); + } + + void JustDied(Unit* /*killer*/) override + { + if (Creature* karathress = _instance->GetCreature(DATA_FATHOM_LORD_KARATHRESS)) + { + me->CastSpell(karathress, SPELL_POWER_OF_CARIBDIS); + } + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } + + _scheduler.Update(diff); + + DoMeleeAttackIfReady(); + } + +private: + TaskScheduler _scheduler; + InstanceScript* _instance; }; class spell_karathress_power_of_caribdis : public SpellScriptLoader @@ -213,6 +568,9 @@ public: void AddSC_boss_fathomlord_karathress() { - new boss_fathomlord_karathress(); + RegisterSerpentShrineAI(boss_fathomlord_karathress); + RegisterSerpentShrineAI(boss_fathomguard_sharkkis); + RegisterSerpentShrineAI(boss_fathomguard_tidalvess); + RegisterSerpentShrineAI(boss_fathomguard_caribdis); new spell_karathress_power_of_caribdis(); } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp index d22cd4c47..90d4c5e6c 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -29,6 +29,20 @@ DoorData const doorData[] = { GO_COILFANG_BRIDGE3, DATA_BRIDGE_EMERGED, DOOR_TYPE_PASSAGE } }; +ObjectData const creatureData[] = +{ + { NPC_FATHOM_LORD_KARATHRESS, DATA_FATHOM_LORD_KARATHRESS }, + { 0, 0 } +}; + +MinionData const minionData[] = +{ + { NPC_FATHOM_GUARD_SHARKKIS, DATA_FATHOM_LORD_KARATHRESS }, + { NPC_FATHOM_GUARD_TIDALVESS, DATA_FATHOM_LORD_KARATHRESS }, + { NPC_FATHOM_GUARD_CARIBDIS, DATA_FATHOM_LORD_KARATHRESS }, + { 0, 0, } +}; + class instance_serpent_shrine : public InstanceMapScript { public: @@ -45,6 +59,8 @@ public: SetHeaders(DataHeader); SetBossNumber(MAX_ENCOUNTERS); LoadDoorData(doorData); + LoadObjectData(creatureData, nullptr); + LoadMinionData(minionData); AliveKeepersCount = 0; } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h index 3963cb6c2..8e10302b9 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h @@ -53,8 +53,13 @@ enum SSNPCs NPC_THE_LURKER_BELOW = 21217, NPC_LEOTHERAS_THE_BLIND = 21215, NPC_CYCLONE_KARATHRESS = 22104, + NPC_FATHOM_LORD_KARATHRESS = 21214, NPC_LADY_VASHJ = 21212, + NPC_FATHOM_GUARD_SHARKKIS = 21966, + NPC_FATHOM_GUARD_TIDALVESS = 21965, + NPC_FATHOM_GUARD_CARIBDIS = 21964, + NPC_COILFANG_SHATTERER = 21301, NPC_COILFANG_PRIESTESS = 21220, From 0db63275c8a5b9daae46a507833ebff2d2e05e25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 26 Sep 2023 23:08:12 +0000 Subject: [PATCH 47/49] chore(DB): import pending files Referenced commit(s): 4b85e3ed98c674fbb165bc9a5c24a6514cbb7d0d --- .../fathomguards.sql => db_world/2023_09_26_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/fathomguards.sql => db_world/2023_09_26_03.sql} (97%) diff --git a/data/sql/updates/pending_db_world/fathomguards.sql b/data/sql/updates/db_world/2023_09_26_03.sql similarity index 97% rename from data/sql/updates/pending_db_world/fathomguards.sql rename to data/sql/updates/db_world/2023_09_26_03.sql index 0cb4856fb..29deae622 100644 --- a/data/sql/updates/pending_db_world/fathomguards.sql +++ b/data/sql/updates/db_world/2023_09_26_03.sql @@ -1,3 +1,4 @@ +-- DB update 2023_09_26_02 -> 2023_09_26_03 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` IN (22486, 22487); From 2e77820153b12f40738a7950b6a87c1fa2281be8 Mon Sep 17 00:00:00 2001 From: samsam1993 <136090818+samsam1993@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:45:07 +0300 Subject: [PATCH 48/49] fix(DB/reference_loot_template): Corrected Shadow Labyrinth gem drops (#17190) * fix(DB/reference_loot_template): Corrected Shadow Labyrinth gem drops Heroic Shadow Labyrinth bosses dropped incorrect gem. They had a chance to drop Glinting Fire Opal, but this fix corrects them to drop Etched Fire Opal instead. * Update data/sql/updates/pending_db_world/SL_gem_loot_fix.sql * Update data/sql/updates/pending_db_world/SL_gem_loot_fix.sql --------- Co-authored-by: Dan <83884799+elthehablo@users.noreply.github.com> --- data/sql/updates/pending_db_world/SL_gem_loot_fix.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/SL_gem_loot_fix.sql diff --git a/data/sql/updates/pending_db_world/SL_gem_loot_fix.sql b/data/sql/updates/pending_db_world/SL_gem_loot_fix.sql new file mode 100644 index 000000000..f7e3a95b4 --- /dev/null +++ b/data/sql/updates/pending_db_world/SL_gem_loot_fix.sql @@ -0,0 +1,2 @@ +-- +UPDATE `reference_loot_template` SET `Item` = 30559, `Comment` = 'Etched Fire Opal' WHERE `Entry` = 43010 AND `Item` = 30556; From 26c583c24ab7dbbf1fecf3dcd737c1ad543c8b33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 27 Sep 2023 08:46:16 +0000 Subject: [PATCH 49/49] chore(DB): import pending files Referenced commit(s): 2e77820153b12f40738a7950b6a87c1fa2281be8 --- .../SL_gem_loot_fix.sql => db_world/2023_09_27_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/SL_gem_loot_fix.sql => db_world/2023_09_27_00.sql} (74%) diff --git a/data/sql/updates/pending_db_world/SL_gem_loot_fix.sql b/data/sql/updates/db_world/2023_09_27_00.sql similarity index 74% rename from data/sql/updates/pending_db_world/SL_gem_loot_fix.sql rename to data/sql/updates/db_world/2023_09_27_00.sql index f7e3a95b4..f7627aad7 100644 --- a/data/sql/updates/pending_db_world/SL_gem_loot_fix.sql +++ b/data/sql/updates/db_world/2023_09_27_00.sql @@ -1,2 +1,3 @@ +-- DB update 2023_09_26_03 -> 2023_09_27_00 -- UPDATE `reference_loot_template` SET `Item` = 30559, `Comment` = 'Etched Fire Opal' WHERE `Entry` = 43010 AND `Item` = 30556;