aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp70
1 files changed, 46 insertions, 24 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 2bae3e4a39c..63d084e589b 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -996,36 +996,57 @@ class spell_q12805_lifeblood_dummy : public SpellScriptLoader
*/
enum BattleStandard
{
- NPC_KING_OF_THE_MOUNTAINT_KC = 31766,
+ NPC_KING_OF_THE_MOUNTAINT_KC = 31766,
+ SPELL_PLANT_HORDE_BATTLE_STANDARD = 59643,
+ SPELL_HORDE_BATTLE_STANDARD_STATE = 59642,
+ SPELL_ALLIANCE_BATTLE_STANDARD_STATE = 4339,
+ SPELL_JUMP_ROCKET_BLAST = 4340
};
-class spell_q13280_13283_plant_battle_standard: public SpellScriptLoader
+class spell_q13280_13283_plant_battle_standard : public SpellScript
{
- public:
- spell_q13280_13283_plant_battle_standard() : SpellScriptLoader("spell_q13280_13283_plant_battle_standard") { }
+ PrepareSpellScript(spell_q13280_13283_plant_battle_standard);
- class spell_q13280_13283_plant_battle_standard_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_q13280_13283_plant_battle_standard_SpellScript);
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ Unit* target = GetHitUnit();
+ uint32 triggeredSpellID = SPELL_ALLIANCE_BATTLE_STANDARD_STATE;
- void HandleDummy(SpellEffIndex /*effIndex*/)
- {
- Unit* caster = GetCaster();
- if (caster->IsVehicle())
- if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
- player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
- }
+ caster->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ if (caster->IsVehicle())
+ if (Unit* player = caster->GetVehicleKit()->GetPassenger(0))
+ player->ToPlayer()->KilledMonsterCredit(NPC_KING_OF_THE_MOUNTAINT_KC);
- void Register() override
- {
- OnEffectHit += SpellEffectFn(spell_q13280_13283_plant_battle_standard_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
- }
- };
+ if (GetSpellInfo()->Id == SPELL_PLANT_HORDE_BATTLE_STANDARD)
+ triggeredSpellID = SPELL_HORDE_BATTLE_STANDARD_STATE;
- SpellScript* GetSpellScript() const override
- {
- return new spell_q13280_13283_plant_battle_standard_SpellScript();
- }
+ target->RemoveAllAuras();
+ target->CastSpell(target, triggeredSpellID, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q13280_13283_plant_battle_standard::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+};
+
+class spell_q13280_13283_jump_jets : public SpellScript
+{
+ PrepareSpellScript(spell_q13280_13283_jump_jets);
+
+ void HandleCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->IsVehicle())
+ if (Unit* rocketBunny = caster->GetVehicleKit()->GetPassenger(1))
+ rocketBunny->CastSpell(rocketBunny, SPELL_JUMP_ROCKET_BLAST, true);
+ }
+
+ void Register() override
+ {
+ OnCast += SpellCastFn(spell_q13280_13283_jump_jets::HandleCast);
+ }
};
enum ChumTheWaterSummons
@@ -2790,7 +2811,8 @@ void AddSC_quest_spell_scripts()
new spell_q12659_ahunaes_knife();
new spell_q9874_liquid_fire();
new spell_q12805_lifeblood_dummy();
- new spell_q13280_13283_plant_battle_standard();
+ RegisterSpellScript(spell_q13280_13283_plant_battle_standard);
+ RegisterSpellScript(spell_q13280_13283_jump_jets);
new spell_q14112_14145_chum_the_water();
new spell_q9452_cast_net();
new spell_q12279_cast_net();