diff options
author | offl <11556157+offl@users.noreply.github.com> | 2022-07-21 00:29:46 +0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-09-05 21:26:35 +0200 |
commit | 4462aad70fc073ecf1d46eefb5f2cfe54acbd114 (patch) | |
tree | f7b7e6c35a1d7ed2008a46e9c179115d37b2ffe0 /src | |
parent | c746d9a59c471c88c909a94a580b2d5c7b32cd7b (diff) |
Scripts/Spells: Random fixes (#28143)
(cherry picked from commit 53cc21b1b45e11ba9358df3281cfa2b021fb1ea0)
Diffstat (limited to 'src')
3 files changed, 99 insertions, 114 deletions
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index 44078696c35..7ca324bdd86 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -25,6 +25,8 @@ EndScriptData */ #include "ScriptMgr.h" #include "InstanceScript.h" #include "ScriptedEscortAI.h" +#include "SpellInfo.h" +#include "SpellScript.h" #include "trial_of_the_champion.h" enum Spells @@ -376,9 +378,54 @@ public: } }; +// 67751 - Ghoul Explode +class spell_black_knight_ghoul_explode : public SpellScript +{ + PrepareSpellScript(spell_black_knight_ghoul_explode); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectInfo(EFFECT_0).CalcValue())); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_black_knight_ghoul_explode::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 67754 - Ghoul Explode +// 67889 - Ghoul Explode +class spell_black_knight_ghoul_explode_risen_ghoul : public SpellScript +{ + PrepareSpellScript(spell_black_knight_ghoul_explode_risen_ghoul); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_1).CalcValue()) }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue())); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_black_knight_ghoul_explode_risen_ghoul::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_boss_black_knight() { new boss_black_knight(); new npc_risen_ghoul(); new npc_black_knight_skeletal_gryphon(); + RegisterSpellScript(spell_black_knight_ghoul_explode); + RegisterSpellScript(spell_black_knight_ghoul_explode_risen_ghoul); } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index a85465a7b3a..a9d8aebc5a2 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -909,6 +909,31 @@ class spell_icecrown_through_the_eye_kill_credit_to_master : public SpellScript } }; +/*###### +## Quest 13008: Scourge Tactics +######*/ + +// 56515 - Summon Freed Crusader +class spell_icecrown_summon_freed_crusader : public SpellScript +{ + PrepareSpellScript(spell_icecrown_summon_freed_crusader); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_icecrown_summon_freed_crusader::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_icecrown() { RegisterCreatureAI(npc_argent_valiant); @@ -922,4 +947,5 @@ void AddSC_icecrown() RegisterSpellScript(spell_icecrown_chum_the_water); RegisterSpellScript(spell_icecrown_through_the_eye_the_eye_of_the_lk); RegisterSpellScript(spell_icecrown_through_the_eye_kill_credit_to_master); + RegisterSpellScript(spell_icecrown_summon_freed_crusader); } diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 9024c5621ae..389ebc14da4 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -31,118 +31,6 @@ #include "Vehicle.h" /*#### -## npc_drakuru_shackles -####*/ - -enum DrakuruShackles -{ - NPC_RAGECLAW = 29686, - QUEST_TROLLS_IS_GONE_CRAZY = 12861, - SPELL_CHAIN_OF_THE_SCURGE_RIGHT = 54990, - SPELL_CHAIN_OF_THE_SCURGE_LEFT = 55009, - SPELL_UNLOCK_SHACKLE = 55083, - SPELL_FREE_RAGECLAW = 55223 -}; - -struct npc_drakuru_shackles : public ScriptedAI -{ - npc_drakuru_shackles(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - _rageclawGUID.Clear(); - me->SetUnitFlag(UNIT_FLAG_UNINTERACTIBLE); - - float x, y, z; - me->GetClosePoint(x, y, z, me->GetCombatReach() / 3, 0.1f); - - if (Creature* summon = me->SummonCreature(NPC_RAGECLAW, x, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 1s)) - { - _rageclawGUID = summon->GetGUID(); - LockRageclaw(summon); - } - } - - void LockRageclaw(Creature* rageclaw) - { - // pointer check not needed - me->SetFacingToObject(rageclaw); - rageclaw->SetFacingToObject(me); - } - - void UnlockRageclaw(Creature* rageclaw) - { - // pointer check not needed - DoCast(rageclaw, SPELL_FREE_RAGECLAW, true); - - me->setDeathState(DEAD); - } - - void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override - { - Player* playerCaster = caster->ToPlayer(); - if (!playerCaster) - return; - - if (spellInfo->Id == SPELL_UNLOCK_SHACKLE) - { - if (playerCaster->GetQuestStatus(QUEST_TROLLS_IS_GONE_CRAZY) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* rageclaw = ObjectAccessor::GetCreature(*me, _rageclawGUID)) - { - UnlockRageclaw(rageclaw); - playerCaster->KilledMonster(rageclaw->GetCreatureTemplate(), _rageclawGUID); - me->RemoveAurasDueToSpell(SPELL_CHAIN_OF_THE_SCURGE_RIGHT); - me->DespawnOrUnsummon(); - } - else - me->setDeathState(JUST_DIED); - } - } - } - -private: - ObjectGuid _rageclawGUID; -}; - -/*#### -## npc_captured_rageclaw -####*/ - -enum Rageclaw -{ - SPELL_UNSHACKLED = 55085, - SAY_RAGECLAW = 0 -}; - -struct npc_captured_rageclaw : public ScriptedAI -{ - npc_captured_rageclaw(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - me->SetFaction(FACTION_FRIENDLY); - DoCast(me, SPELL_CHAIN_OF_THE_SCURGE_RIGHT, true); - } - - void MoveInLineOfSight(Unit* /*who*/) override { } - - void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override - { - if (spellInfo->Id == SPELL_FREE_RAGECLAW) - { - me->RemoveAurasDueToSpell(SPELL_CHAIN_OF_THE_SCURGE_LEFT); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetFaction(me->GetCreatureTemplate()->faction); - DoCast(me, SPELL_UNSHACKLED, true); - Talk(SAY_RAGECLAW); - me->GetMotionMaster()->MoveRandom(10); - me->DespawnOrUnsummon(10s); - } - } -}; - -/*#### ## npc_released_offspring_harkoa ####*/ @@ -993,10 +881,33 @@ class spell_zuldrak_scourgewagon_explosion : public SpellScript } }; +/*###### +## Quest 12861: Trolls Is Gone Crazy! +######*/ + +// 54990 - Chains of the Scourge +class spell_zuldrak_chains_of_the_scourge : public SpellScript +{ + PrepareSpellScript(spell_zuldrak_chains_of_the_scourge); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_1).CalcValue()) }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue())); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_zuldrak_chains_of_the_scourge::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_zuldrak() { - RegisterCreatureAI(npc_drakuru_shackles); - RegisterCreatureAI(npc_captured_rageclaw); RegisterCreatureAI(npc_released_offspring_harkoa); RegisterCreatureAI(npc_crusade_recruit); RegisterCreatureAI(npc_alchemist_finklestein); @@ -1013,4 +924,5 @@ void AddSC_zuldrak() RegisterSpellScript(spell_zuldrak_cocooned_not_on_quest); RegisterSpellScript(spell_zuldrak_cocooned_on_quest); RegisterSpellScript(spell_zuldrak_scourgewagon_explosion); + RegisterSpellScript(spell_zuldrak_chains_of_the_scourge); } |