From b78a26b21142bec3e4e97a856d44895e19bb7ae8 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Wed, 25 Jul 2018 01:15:15 +0200 Subject: [PATCH] Scripts/BrC: fixed Chains of Woe sometimes cancelling their auras due to evade * Angered Earth will now properly engage 500 milliseconds after creation --- .../custom/custom_2018_07_24_00_world.sql | 2 +- .../boss_romogg_bonecrusher.cpp | 54 +++++++++++++++---- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/sql/updates/world/custom/custom_2018_07_24_00_world.sql b/sql/updates/world/custom/custom_2018_07_24_00_world.sql index 3cbc66bedaf..7808d889bc0 100644 --- a/sql/updates/world/custom/custom_2018_07_24_00_world.sql +++ b/sql/updates/world/custom/custom_2018_07_24_00_world.sql @@ -6,7 +6,7 @@ UPDATE `creature_template` SET `unit_flags`= 33554432, `flags_extra`= 128 WHERE -- Angered Earth UPDATE `creature_template` SET `DamageModifier`= 8 WHERE `entry`= 50376; -- Chains of Woe -UPDATE `creature_template` SET `ScriptName`= '' WHERE `entry`= 40447; +UPDATE `creature_template` SET `ScriptName`= 'npc_romogg_chains_of_woe' WHERE `entry`= 40447; UPDATE `creature_template` SET `InhabitType`= 12, `mechanic_immune_mask`= 1 | 2 | 16 | 32 | 256 | 512 | 2048 | 8192 | 65536 | 131072 | 8388608 | 33554432, `flags_extra`= 0x40000000 WHERE `entry` IN (40447, 50379); -- Template Addons diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_romogg_bonecrusher.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_romogg_bonecrusher.cpp index 15f696966a5..5a6b037f86a 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_romogg_bonecrusher.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockCaverns/boss_romogg_bonecrusher.cpp @@ -60,6 +60,23 @@ enum Data DATA_CRUSHING_BONES_AND_CRACKING_SKULLS = 0 }; +class AttackStartEvent : public BasicEvent +{ + public: + AttackStartEvent(Creature* owner) : _owner(owner) { } + + bool Execute(uint64 /*time*/, uint32 /*diff*/) override + { + _owner->SetReactState(REACT_AGGRESSIVE); + if (_owner->IsAIEnabled) + _owner->AI()->DoZoneInCombat(); + return true; + } + + private: + Creature* _owner; +}; + struct boss_romogg_bonecrusher : public BossAI { boss_romogg_bonecrusher(Creature* creature) : BossAI(creature, DATA_ROMOGG_BONECRUSHER) @@ -119,18 +136,11 @@ struct boss_romogg_bonecrusher : public BossAI { summons.Summon(summon); - if (summon->GetEntry() == NPC_CHAINS_OF_WOE) + if (summon->GetEntry() == NPC_ANGERED_EARTH) { summon->SetReactState(REACT_PASSIVE); - summon->SetDisplayId(summon->GetCreatureTemplate()->Modelid2); - summon->CastSpell(summon, SPELL_CHAINS_OF_WOE_TELEPORT); - summon->CastSpell(summon, SPELL_CHAINS_OF_WOE_CHANNELED); - } - else if (summon->GetEntry() == NPC_ANGERED_EARTH) - { summon->SetCorpseDelay(5); - if (summon->IsAIEnabled) - summon->AI()->DoZoneInCombat(); + summon->m_Events.AddEvent(new AttackStartEvent(summon), summon->m_Events.CalculateTime(500)); } } @@ -188,6 +198,31 @@ private: uint8 _killedElementals; }; +struct npc_romogg_chains_of_woe : public ScriptedAI +{ + npc_romogg_chains_of_woe(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + me->SetReactState(REACT_PASSIVE); + } + + void IsSummonedBy(Unit* /*summoner*/) override + { + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + DoCastSelf(SPELL_CHAINS_OF_WOE_TELEPORT); + DoCastSelf(SPELL_CHAINS_OF_WOE_CHANNELED); + } + + void EnterEvadeMode(EvadeReason why) override { } + +private: + EventMap _events; +}; + class spell_romogg_quake : public SpellScript { PrepareSpellScript(spell_romogg_quake); @@ -311,6 +346,7 @@ class achievement_crushing_bones_and_cracking_skulls : public AchievementCriteri void AddSC_boss_romogg_bonecrusher() { RegisterBlackrockCavernsCreatureAI(boss_romogg_bonecrusher); + RegisterBlackrockCavernsCreatureAI(npc_romogg_chains_of_woe); RegisterSpellScript(spell_romogg_quake); RegisterSpellScript(spell_romogg_chains_of_woe); RegisterSpellScript(spell_romogg_chains_of_woe_teleport);