From a98131b6c9692a3570f0d89265fe26c1d28b8dfe Mon Sep 17 00:00:00 2001 From: insunaa Date: Wed, 9 Nov 2022 18:00:13 +0100 Subject: [PATCH] Ulduar: Convert Ignis to BossAI --- sql/scriptdev2/scriptdev2.sql | 11 - sql/scriptdev2/spell.sql | 10 + .../northrend/ulduar/ulduar/boss_ignis.cpp | 457 +++++++++--------- .../northrend/ulduar/ulduar/ulduar.cpp | 1 + .../scripts/northrend/ulduar/ulduar/ulduar.h | 5 +- src/game/Spells/SpellAuras.cpp | 9 - src/game/Spells/SpellEffects.cpp | 29 -- 7 files changed, 240 insertions(+), 282 deletions(-) diff --git a/sql/scriptdev2/scriptdev2.sql b/sql/scriptdev2/scriptdev2.sql index 5a3137c1168..b2fbf297cc0 100644 --- a/sql/scriptdev2/scriptdev2.sql +++ b/sql/scriptdev2/scriptdev2.sql @@ -5760,17 +5760,6 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,broadc ('-1603024','Such a waste.','15502','1','0','0','34130','stonebark SAY_SLAY_2_STONE'), ('-1603025','Matron, flee! They are ruthless....','15503','1','0','0','34132','stonebark SAY_DEATH_STONE'), -('-1603026','Insolent whelps! Your blood will temper the weapons used to reclaim this world!','15564','1','0','0','34306','ignis SAY_AGGRO'), -('-1603027','Let the inferno consume you!','15567','1','0','0','34309','ignis SAY_SCORCH_1'), -('-1603028','BURN! Burn in the makers fire!','15568','1','0','0','34310','ignis SAY_SCORCH_2'), -('-1603029','I will burn away your impurities!','15566','1','0','0','34308','ignis SAY_SLAGPOT'), -('-1603030','Arise, soldiers of the Iron Crucible! The Makers'' will be done!','15565','1','0','0','34307','ignis SAY_ADDS'), -('-1603031','More scraps for the scrapheap!','15569','1','0','0','34311','ignis SAY_SLAY_1'), -('-1603032','Your bones will serve as kindling!','15570','1','0','0','34312','ignis SAY_SLAY_2'), -('-1603033','Let it be finished!','15571','1','0','0','33871','ignis SAY_BERSERK'), -('-1603034','I. Have. Failed.','15572','1','0','0','34313','ignis SAY_DEATH'), -('-1603035','Ignis the Furnace Master begins to cast Flame Jets!','0','3','0','0','0','ignis EMOTE_FLAME_JETS'), - ('-1603036','Welcome, champions! All of our attempts at grounding her have failed. We could use a hand in bring her down with these harpoon guns.','15647','0','0','0','0','razorscale SAY_INTRO_WELCOME'), ('-1603037','Give us a moment to prepare to build the turrets.','0','1','0','0','33820','razorscale SAY_INTRO_1'), ('-1603038','Be on the lookout! Mole machines will be surfacing soon with those nasty Iron dwarves aboard!','0','1','0','0','33607','razorscale SAY_INTRO_2'), diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 5be61822300..604f8d839f7 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -929,6 +929,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (62108,'spell_tails_up_summon_female_frost_leopard'), (62116,'spell_tails_up_summon_female_icepaw_bear'), (62138,'spell_teleport_inside_violet_hold'), +(62382,'spell_ignis_brittle'), (62789,'spell_heart_overload'), (62826,'spell_energy_orb_dummy'), (62828,'spell_recharge_robot'), @@ -937,6 +938,11 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (63018,'spell_searing_light'), (63024,'spell_gravity_bomb'), (63849,'spell_exposed_heart'), +(62488,'spell_activate_construct'), +(62546,'spell_ignis_scorch'), +(62707,'spell_ignis_grab'), +(62717,'spell_slag_pot'), +(63474,'spell_ignis_scorch'), (63482,'spell_lightning_whirl_heroic'), (63845,'spell_create_lance'), (64203,'spell_void_zone_xt'), @@ -946,14 +952,18 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (64235,'spell_void_zone_xt'), (64411,'spell_blessing_of_ancient_kings'), (64415,'spell_valanyr_equip_effect'), +(64475,'spell_ignis_remove_strength'), +(64503,'spell_ignis_water'), (64568,'spell_blood_reserve_enchant'), (65121,'spell_searing_light'), +(65667,'spell_ignis_heat'), (65869,'spell_disengage'), (65932,'spell_retaliation_dummy_creature'), (66118,'spell_leeching_swarm_aura'), (66312,'spell_light_ball_passive'), (66314,'spell_dark_ball_passive'), (67009,'spell_nether_power'), +(67114,'spell_ignis_brittle'), (67322,'spell_burrower_submerge'), (67470,'spell_pursuing_spikes'), (67547,'spell_clear_valkyr_essence'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_ignis.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_ignis.cpp index 481016a8473..d47b33e3a1c 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_ignis.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/boss_ignis.cpp @@ -22,30 +22,34 @@ SDCategory: Ulduar EndScriptData */ #include "AI/ScriptDevAI/include/sc_common.h" +#include "AI/ScriptDevAI/base/BossAI.h" #include "ulduar.h" -#include "Spells/SpellAuras.h" +#include "World/WorldStateDefines.h" enum { - SAY_AGGRO = -1603026, - SAY_SLAGPOT_1 = -1603027, - SAY_SLAGPOT_2 = -1603028, - SAY_FLAME_JETS = -1603029, - SAY_ADDS = -1603030, - SAY_SLAY_1 = -1603031, - SAY_SLAY_2 = -1603032, - SAY_BERSERK = -1603033, - SAY_DEATH = -1603034, - - EMOTE_FLAME_JETS = -1603035, - EMOTE_EXTINGUISH_SCORCH = -1603238, + SAY_AGGRO = 34306, + SAY_FLAME_JETS = 34308, + SAY_SLAGPOT_1 = 34309, + SAY_SLAGPOT_2 = 34310, + SAY_ADDS = 34307, + SAY_SLAY_1 = 34311, + SAY_SLAY_2 = 34312, + SAY_BERSERK = 33871, + SAY_DEATH = 34313, + + EMOTE_FLAME_JETS = 33465, + EMOTE_EXTINGUISH_SCORCH = 34471, // spells SPELL_FLAME_JETS = 62680, SPELL_FLAME_JETS_H = 63472, SPELL_SLAG_POT = 62717, // damage aura applied when passenger is switched to second seat - // SPELL_SLAG_IMBUED = 63536, // buff received if target survives the slag pot + SPELL_SLAG_POT_PERIODIC = 65722, + SPELL_SLAG_POT_PERIODIC_H = 65723, + SPELL_SLAG_IMBUED = 63536, // buff received if target survives the slag pot SPELL_GRAB = 62707, // charge spells for Slag pot - triggers 62708 which will load the player into Ingis' hand (seat 1) + SPELL_GRAB_POS1 = 62708, SPELL_GRAB_POT = 62711, // aura triggered after 1,5 sec after the first grab; switches the seats from hand to pot (seat 2) SPELL_SCORCH = 62546, SPELL_SCORCH_H = 63474, @@ -63,6 +67,8 @@ enum SPELL_BRITTLE = 62382, // stun a construct when chilled in water SPELL_BRITTLE_H = 67114, SPELL_SHATTER = 62383, // sends event 21620 for the achiev check + SPELL_STRENGTH_BUFF = 64473, + SPELL_STRENGTH = 64474, SPELL_STRENGTH_REMOVE = 64475, // remove 1 stack of the Strength of Creator on construct death SPELL_WATER_EFFECT = 64503, // spell effect which cools the heated constructs and scorch npcs // SPELL_WATER = 64502, // cast by world triggers, in order to check when the constructs reach the water @@ -73,7 +79,6 @@ enum // NPC ids NPC_SCORCH = 33221, - NPC_IRON_CONSTRUCT = 33121, // constructs which are activated on demand by Ignis MAX_HEAT_STACKS = 10, }; @@ -82,300 +87,288 @@ enum ## boss_ignis ######*/ -struct boss_ignisAI : public ScriptedAI +struct boss_ignisAI : public BossAI { - boss_ignisAI(Creature* pCreature) : ScriptedAI(pCreature) + boss_ignisAI(Creature* creature) : BossAI(creature, 0), + m_isRegularMode(creature->GetMap()->IsRegularDifficulty()) { - m_pInstance = (instance_ulduar*)pCreature->GetInstanceData(); - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); + SetDataType(TYPE_IGNIS); + AddOnAggroText(SAY_AGGRO); + AddOnKillText(SAY_SLAY_1, SAY_SLAY_2); + AddOnDeathText(SAY_DEATH); + AddCastOnDeath({ObjectGuid(), SPELL_KILL_ALL_CONSTRUCTS, TRIGGERED_OLD_TRIGGERED}); + AddRespawnOnEvade(30s); } - instance_ulduar* m_pInstance; - bool m_bIsRegularMode; + bool m_isRegularMode; - uint32 m_uiBerserkTimer; - uint32 m_uiFlameJetsTimer; - uint32 m_uiSlagPotTimer; - uint32 m_uiScorchTimer; - uint32 m_uiConstructTimer; - - void Reset() override + void EnterEvadeMode() override { - m_uiBerserkTimer = 10 * MINUTE * IN_MILLISECONDS; - m_uiFlameJetsTimer = 20000; - m_uiSlagPotTimer = 25000; - m_uiScorchTimer = 13000; - m_uiConstructTimer = 10000; + BossAI::EnterEvadeMode(); + auto* ignisAdds = m_creature->GetMap()->GetCreatures("ULDUAR_IGNIS_ADDS"); + if (!ignisAdds || (*ignisAdds).empty()) + return; + std::vector constructs((*ignisAdds).size()); + std::copy((*ignisAdds).begin(), (*ignisAdds).end(), std::back_inserter(constructs)); + for (Creature* construct : constructs) + { + if (!construct) + continue; + construct->ForcedDespawn(); + } } - void JustDied(Unit* /*pKiller*/) override + void JustSummoned(Creature* summoned) override { - if (m_pInstance) - m_pInstance->SetData(TYPE_IGNIS, DONE); - - DoCastSpellIfCan(m_creature, SPELL_KILL_ALL_CONSTRUCTS, CAST_TRIGGERED); - DoScriptText(SAY_DEATH, m_creature); + if (summoned->GetEntry() != NPC_SCORCH) + return; + summoned->CastSpell(nullptr, m_isRegularMode ? SPELL_SCORCH_AURA : SPELL_SCORCH_AURA_H, TRIGGERED_OLD_TRIGGERED); + m_creature->AddSummonForOnDeathDespawn(summoned->GetObjectGuid()); } - void KilledUnit(Unit* pVictim) override + void OnPassengerRide(Unit* passenger, bool boarded, uint8 seat) override { - if (pVictim->GetTypeId() != TYPEID_PLAYER) + if (!boarded || !passenger || seat != 1) return; - - DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + DoCastSpellIfCan(passenger, SPELL_SLAG_POT, CAST_TRIGGERED); } +}; - void Aggro(Unit* /*pWho*/) override - { - if (m_pInstance) - m_pInstance->SetData(TYPE_IGNIS, IN_PROGRESS); +/*###### +## npc_iron_construct +######*/ - DoScriptText(SAY_AGGRO, m_creature); +struct npc_iron_constructAI : public ScriptedAI +{ + npc_iron_constructAI(Creature* creature) : ScriptedAI(creature) + { + AddCustomAction(0, true, [&]() + { + m_creature->SetImmuneToPlayer(false); + instance_ulduar* instance = dynamic_cast(m_creature->GetInstanceData()); + if (!instance) + return; + Creature* ignis = instance->GetSingleCreatureFromStorage(NPC_IGNIS); + if (!ignis || !ignis->AI()) + return; + ignis->CastSpell(m_creature, SPELL_STRENGTH, TRIGGERED_OLD_TRIGGERED); + if (ignis->GetVictim()) + AttackStart(ignis->GetVictim()); + }, TIMER_COMBAT_OOC); } - void JustReachedHome() override + void JustRespawned() override { - if (m_pInstance) - m_pInstance->SetData(TYPE_IGNIS, FAIL); + DoCastSpellIfCan(nullptr, SPELL_STONED, CAST_TRIGGERED); + DoCastSpellIfCan(nullptr, SPELL_CONSTRUCT_HITTING_YA, CAST_TRIGGERED); } +}; + +/*###### +## npc_scorch +######*/ + +struct npc_scorchAI : public ScriptedAI +{ + npc_scorchAI(Creature* creature) : ScriptedAI(creature) { Reset(); } - void JustSummoned(Creature* pSummoned) override + void Reset() override { - if (pSummoned->GetEntry() == NPC_SCORCH) - pSummoned->CastSpell(pSummoned, m_bIsRegularMode ? SPELL_SCORCH_AURA : SPELL_SCORCH_AURA_H, TRIGGERED_OLD_TRIGGERED); + SetMeleeEnabled(false); + SetCombatMovement(false); + m_creature->SetImmobilizedState(true, true); + SetReactState(REACT_PASSIVE); + m_creature->ForcedDespawn(50 * IN_MILLISECONDS); } +}; - // TODO: Use the vehicle boarding wrappers when they are implemented in core - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) override +// 62488 - Activate Construct +struct ActivateConstruct : public SpellScript +{ + bool OnCheckTarget(const Spell* /*spell*/, Unit* target, SpellEffectIndex /*eff*/) const override { - if (pCaster->GetTypeId() != TYPEID_PLAYER) - return; - - // Handle the case when passenger is loaded to the second seat - if (pSpell->Id == SPELL_GRAB_POT) - DoCastSpellIfCan(pCaster, SPELL_SLAG_POT, CAST_TRIGGERED); + if (!target || !target->HasAura(SPELL_STONED)) + return false; + return true; } - void UpdateAI(const uint32 uiDiff) override + void OnHit(Spell* spell, SpellMissInfo /*missInfo*/) const override { - if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim()) + Unit* unitTarget = spell->GetUnitTarget(); + if (!unitTarget || !unitTarget->AI()) return; - - if (m_uiBerserkTimer) - { - if (m_uiBerserkTimer <= uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) - { - DoScriptText(SAY_BERSERK, m_creature); - m_uiBerserkTimer = 0; - } - } - else - m_uiBerserkTimer -= uiDiff; - } - - if (m_uiFlameJetsTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FLAME_JETS : SPELL_FLAME_JETS_H) == CAST_OK) - { - DoScriptText(EMOTE_FLAME_JETS, m_creature); - DoScriptText(SAY_FLAME_JETS, m_creature); - m_uiFlameJetsTimer = 35000; - } - } - else - m_uiFlameJetsTimer -= uiDiff; - - if (m_uiSlagPotTimer < uiDiff) - { - if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1, SPELL_GRAB, SELECT_FLAG_PLAYER)) - { - if (DoCastSpellIfCan(pTarget, SPELL_GRAB) == CAST_OK) - { - DoScriptText(urand(0, 1) ? SAY_SLAGPOT_1 : SAY_SLAGPOT_2, m_creature); - m_uiSlagPotTimer = 30000; - } - } - } - else - m_uiSlagPotTimer -= uiDiff; - - if (m_uiConstructTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, SPELL_ACTIVATE_CONSTRUCT) == CAST_OK) - { - DoScriptText(SAY_ADDS, m_creature); - m_uiConstructTimer = 40000; - } - } - else - m_uiConstructTimer -= uiDiff; - - if (m_uiScorchTimer < uiDiff) - { - if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SCORCH : SPELL_SCORCH_H) == CAST_OK) - { - DoCastSpellIfCan(m_creature, SPELL_SCORCH_SUMMON, CAST_TRIGGERED); - m_uiScorchTimer = 25000; - } - } - else - m_uiScorchTimer -= uiDiff; - - DoMeleeAttackIfReady(); + unitTarget->AI()->ResetTimer(0, 3s); + unitTarget->RemoveAurasDueToSpell(SPELL_STONED); + unitTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE); } }; -UnitAI* GetAI_boss_ignis(Creature* pCreature) +// 62707 - Grab +struct IgnisGrab : public SpellScript { - return new boss_ignisAI(pCreature); -} - -/*###### -## npc_iron_construct -######*/ - -struct npc_iron_constructAI : public ScriptedAI -{ - npc_iron_constructAI(Creature* pCreature) : ScriptedAI(pCreature) + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override { - m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); - Reset(); + if (effIdx != EFFECT_INDEX_0) + return; + Unit* unitTarget = spell->GetUnitTarget(); + if (!unitTarget) + return; + unitTarget->CastSpell(nullptr, SPELL_GRAB_POS1, TRIGGERED_OLD_TRIGGERED); } +}; - bool m_bIsRegularMode; - bool m_bHasShattered; - - void Reset() override +// 62717 - Slag Pot +struct SlagPot : public AuraScript +{ + void OnPeriodicDummy(Aura* aura) const override { - m_bHasShattered = false; + Unit* target = aura->GetTarget(); + Unit* caster = aura->GetCaster(); + if (!caster || !target) + return; + caster->CastSpell(target, target->GetMap()->IsRegularDifficulty() ? SPELL_SLAG_POT_PERIODIC : SPELL_SLAG_POT_PERIODIC_H, TRIGGERED_OLD_TRIGGERED, nullptr, aura); - DoCastSpellIfCan(m_creature, SPELL_STONED, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_CONSTRUCT_HITTING_YA, CAST_TRIGGERED); + if (aura->GetAuraTicks() == 10) + target->CastSpell(target, SPELL_SLAG_IMBUED, TRIGGERED_OLD_TRIGGERED, nullptr, aura); } +}; - void JustReachedHome() override +// 62548, 63476 - Scorch +struct IgnisScorch : public AuraScript +{ + void OnPeriodicTrigger(Aura* aura, PeriodicTriggerData& /*data*/) const override { - // reset flags if necessary - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE)) - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE); - - DoCastSpellIfCan(m_creature, SPELL_STONED, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_CONSTRUCT_HITTING_YA, CAST_TRIGGERED); + if (aura->GetAuraTicks() != 4) + return; + Unit* caster = aura->GetCaster(); + caster->CastSpell(nullptr, SPELL_SCORCH_SUMMON, TRIGGERED_IGNORE_CURRENT_CASTED_SPELL | TRIGGERED_IGNORE_GCD | TRIGGERED_HIDE_CAST_IN_COMBAT_LOG); } +}; - void DamageTaken(Unit* pDoneBy, uint32& uiDamage, DamageEffectType /*damagetype*/, SpellEntry const* spellInfo) override +// 65667 - Heat +struct IgnisHeat : public SpellScript +{ + bool OnCheckTarget(const Spell* spell, Unit* target, SpellEffectIndex eff) const override { - // ToDo: This may need more research related to spell proc - if (m_creature->HasAura(m_bIsRegularMode ? SPELL_BRITTLE : SPELL_BRITTLE_H) && !m_bHasShattered) + if (!target || target->GetEntry() != NPC_IRON_CONSTRUCT) + return false; + if (target->HasAura(SPELL_STONED) || target->HasAura(SPELL_BRITTLE) || target->HasAura(SPELL_BRITTLE_H)) + return false; + if (target->IsImmuneToPlayer() || target->IsImmuneToNPC()) + return false; + if (target->HasAura(SPELL_MOLTEN)) { - if (uiDamage > 5000) - { - DoCastSpellIfCan(m_creature, SPELL_SHATTER, CAST_TRIGGERED); - DoCastSpellIfCan(m_creature, SPELL_STRENGTH_REMOVE, CAST_TRIGGERED); - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE); - m_creature->GetMotionMaster()->MoveIdle(); - m_bHasShattered = true; - } + target->CastSpell(target, SPELL_MOLTEN, TRIGGERED_OLD_TRIGGERED); + return false; } + return true; } - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) override + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override { - if (pSpell->Id == SPELL_HEAT) - { - if (SpellAuraHolder* pHeatAura = m_creature->GetSpellAuraHolder(SPELL_HEAT)) - { - if (pHeatAura && pHeatAura->GetStackAmount() == MAX_HEAT_STACKS) - DoCastSpellIfCan(m_creature, SPELL_MOLTEN); - } - } + if (effIdx != EFFECT_INDEX_0) + return; + Unit* target = spell->GetUnitTarget(); + if (!target) + return; + if (target->GetAuraCount(SPELL_HEAT) >= MAX_HEAT_STACKS - 1) + target->CastSpell(target, SPELL_MOLTEN, TRIGGERED_OLD_TRIGGERED); } +}; - void UpdateAI(const uint32 /*uiDiff*/) override +// 64503 - Water +struct IgnisWater : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override { - if (!m_creature->SelectHostileTarget() || !m_creature->GetVictim()) + if (effIdx != EFFECT_INDEX_0) return; - - // stop attacking after shattered - if (m_bHasShattered) + Creature* target = (spell->GetUnitTarget() && spell->GetUnitTarget()->IsCreature()) ? static_cast(spell->GetUnitTarget()) : nullptr; + if (!target) return; - - DoMeleeAttackIfReady(); + switch (target->GetEntry()) + { + case NPC_SCORCH: + { + DoBroadcastText(EMOTE_EXTINGUISH_SCORCH, target); + target->ForcedDespawn(); + break; + } + case NPC_IRON_CONSTRUCT: + { + if (target->HasAura(SPELL_MOLTEN)) + target->CastSpell(nullptr, SPELL_CHILL, TRIGGERED_OLD_TRIGGERED); + break; + } + default: break; + } } }; -UnitAI* GetAI_npc_iron_construct(Creature* pCreature) +// 62382, 67114 - Brittle +struct IgnisBrittle : public AuraScript { - return new npc_iron_constructAI(pCreature); -} - -bool EffectScriptEffectCreature_npc_iron_construct(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget, ObjectGuid /*originalCasterGuid*/) -{ - if (uiSpellId == SPELL_WATER_EFFECT && uiEffIndex == EFFECT_INDEX_0 && pCreatureTarget->GetEntry() == NPC_IRON_CONSTRUCT) + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override { - // chill the iron construct if molten (effect handled in core) - if (pCreatureTarget->HasAura(SPELL_MOLTEN)) - pCreatureTarget->CastSpell(pCreatureTarget, SPELL_CHILL, TRIGGERED_OLD_TRIGGERED); - - return true; + if (procData.damage < 5000) + return SPELL_AURA_PROC_CANT_TRIGGER; + Creature* creatureTarget = (aura->GetTarget() && aura->GetTarget()->IsCreature()) ? static_cast(aura->GetTarget()) : nullptr; + if (!creatureTarget || !creatureTarget->AI()) + return SPELL_AURA_PROC_FAILED; + + creatureTarget->RemoveAllAurasOnDeath(); + + creatureTarget->AI()->DoCastSpellIfCan(nullptr, SPELL_SHATTER, CAST_TRIGGERED); + creatureTarget->AI()->DoCastSpellIfCan(nullptr, SPELL_STRENGTH_REMOVE, CAST_TRIGGERED); + + creatureTarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE); + creatureTarget->AI()->SetMeleeEnabled(false); + creatureTarget->AI()->SetCombatMovement(false); + creatureTarget->SetImmuneToPlayer(true); + creatureTarget->SetImmuneToNPC(true); + creatureTarget->GetMotionMaster()->MoveIdle(); + creatureTarget->SetImmobilizedState(true, true); + return SPELL_AURA_PROC_OK; } - - return false; -} - -/*###### -## npc_scorch -######*/ - -// TODO Remove this 'script' when combat can be proper prevented from core-side -struct npc_scorchAI : public Scripted_NoMovementAI -{ - npc_scorchAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) { Reset(); } - - void Reset() override { } - void AttackStart(Unit* /*pWho*/) override { } - void MoveInLineOfSight(Unit* /*pWho*/) override { } - void UpdateAI(const uint32 /*uiDiff*/) override { } }; -UnitAI* GetAI_npc_scorch(Creature* pCreature) -{ - return new npc_scorchAI(pCreature); -} - -bool EffectScriptEffectCreature_npc_scorch(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget, ObjectGuid /*originalCasterGuid*/) +// 64475 - Strength of the Creator +struct RemoveStrengthOfTheCreator : public SpellScript { - if (uiSpellId == SPELL_WATER_EFFECT && uiEffIndex == EFFECT_INDEX_0 && pCreatureTarget->GetEntry() == NPC_SCORCH) + void OnEffectExecute(Spell* spell, SpellEffectIndex effIdx) const override { - // despawn the Scorch in water - DoScriptText(EMOTE_EXTINGUISH_SCORCH, pCreatureTarget); - pCreatureTarget->ForcedDespawn(); - return true; + if (effIdx != EFFECT_INDEX_0) + return; + Unit* target = spell->GetUnitTarget(); + if (!target) + return; + target->RemoveAuraHolderFromStack(SPELL_STRENGTH_BUFF); } - - return false; -} +}; void AddSC_boss_ignis() { Script* pNewScript = new Script; pNewScript->Name = "boss_ignis"; - pNewScript->GetAI = GetAI_boss_ignis; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->RegisterSelf(); pNewScript = new Script; pNewScript->Name = "npc_iron_construct"; - pNewScript->GetAI = &GetAI_npc_iron_construct; - pNewScript->pEffectScriptEffectNPC = &EffectScriptEffectCreature_npc_iron_construct; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->RegisterSelf(); pNewScript = new Script; pNewScript->Name = "npc_scorch"; - pNewScript->GetAI = &GetAI_npc_scorch; - pNewScript->pEffectScriptEffectNPC = &EffectScriptEffectCreature_npc_scorch; + pNewScript->GetAI = &GetNewAIInstance; pNewScript->RegisterSelf(); + + RegisterSpellScript("spell_activate_construct"); + RegisterSpellScript("spell_ignis_grab"); + RegisterSpellScript("spell_slag_pot"); + RegisterSpellScript("spell_ignis_scorch"); + RegisterSpellScript("spell_ignis_heat"); + RegisterSpellScript("spell_ignis_water"); + RegisterSpellScript("spell_ignis_brittle"); + RegisterSpellScript("spell_ignis_remove_strength"); } diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp index df51e0601c6..9d609047461 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.cpp @@ -181,6 +181,7 @@ void instance_ulduar::OnCreatureCreate(Creature* pCreature) case NPC_EXPLORER_DELLORAH: case NPC_BRANN_BRONZEBEARD: case NPC_ORBITAL_SUPPORT: + case NPC_IGNIS: case NPC_RAZORSCALE: case NPC_EXPEDITION_COMMANDER: case NPC_XT002: diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.h b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.h index 3840bac6c32..b1189c3aa5c 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.h +++ b/src/game/AI/ScriptDevAI/scripts/northrend/ulduar/ulduar/ulduar.h @@ -65,7 +65,7 @@ enum // The siege of ulduar NPC_LEVIATHAN = 33113, - // NPC_IGNIS = 33118, + NPC_IGNIS = 33118, NPC_RAZORSCALE = 33186, NPC_XT002 = 33293, NPC_HEART_DECONSTRUCTOR = 33329, @@ -89,6 +89,9 @@ enum NPC_SALVAGED_DEMOLISHER = 33109, // NPC_LIQUID_PYRITE = 33189, + // Ignis adds + NPC_IRON_CONSTRUCT = 33121, + // Razorscale helper npcs NPC_EXPEDITION_COMMANDER = 33210, NPC_EXPEDITION_ENGINEER = 33287, // npc used to repair the Harpoons diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 8691d380cb5..b7b0e84b309 100755 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -9011,15 +9011,6 @@ void Aura::PeriodicDummyTick() target->CastSpell(target, 62593, TRIGGERED_OLD_TRIGGERED); return; } - case 62717: // Slag Pot - { - target->CastSpell(target, target->GetMap()->IsRegularDifficulty() ? 65722 : 65723, TRIGGERED_OLD_TRIGGERED, nullptr, this); - - // cast Slag Imbued if the target survives up to the last tick - if (GetAuraTicks() == 10) - target->CastSpell(target, 63536, TRIGGERED_OLD_TRIGGERED, nullptr, this); - return; - } case 63050: // Sanity { if (GetHolder()->GetStackAmount() <= 25 && !target->HasAura(63752)) diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 3f9acab5b52..7e365d3126d 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -10091,19 +10091,6 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) unitTarget->CastSpell(unitTarget, 62382, TRIGGERED_OLD_TRIGGERED); return; } - case 62488: // Activate Construct - { - if (!unitTarget || !unitTarget->HasAura(62468)) - return; - - unitTarget->RemoveAurasDueToSpell(62468); - unitTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNINTERACTIBLE); - unitTarget->CastSpell(unitTarget, 64474, TRIGGERED_OLD_TRIGGERED); - - if (m_caster->GetVictim()) - ((Creature*)unitTarget)->AI()->AttackStart(m_caster->GetVictim()); - return; - } case 62524: // Attuned to Nature 2 Dose Reduction case 62525: // Attuned to Nature 10 Dose Reduction case 62521: // Attuned to Nature 25 Dose Reduction @@ -10152,14 +10139,6 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) return; } - case 62707: // Grab - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - unitTarget->CastSpell(unitTarget, 62708, TRIGGERED_OLD_TRIGGERED); - return; - } case 63010: // Charge case 68307: // Charge case 68504: // Shield-Breaker @@ -10347,14 +10326,6 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) unitTarget->CastSpell(unitTarget, m_caster->GetMap()->IsRegularDifficulty() ? 64468 : 64486, TRIGGERED_OLD_TRIGGERED); return; } - case 64475: // Strength of the Creator - { - if (!unitTarget) - return; - - unitTarget->RemoveAuraHolderFromStack(64473); - return; - } case 64623: // Frost Bomb { if (!unitTarget)