aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-12-13 22:39:32 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-24 11:41:01 +0100
commitcc94b595cfea17e2f524cad402b99f9db9909982 (patch)
tree3f5fbc90d8a0d4a592d6b9c540af17c5443de733 /src
parent69ee7582fcb9b2cdf759fd5c29f3cc4f3d224288 (diff)
Scripts/Quest: Update 'It's All Fun and Games' (12887,12892) (#27394)
(cherry picked from commit 41c8c4ba74bc1507b77ca90994bac194016dabdd)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/zone_icecrown.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp
index f4cfa028751..7471bfa3fe1 100644
--- a/src/server/scripts/Northrend/zone_icecrown.cpp
+++ b/src/server/scripts/Northrend/zone_icecrown.cpp
@@ -22,6 +22,7 @@
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"
+#include "SpellScript.h"
#include "TemporarySummon.h"
/*######
@@ -779,6 +780,28 @@ class npc_frostbrood_skytalon : public CreatureScript
}
};
+// 55288 - It's All Fun and Games: The Ocular On Death
+class spell_the_ocular_on_death : public SpellScript
+{
+ PrepareSpellScript(spell_the_ocular_on_death);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* target = GetHitPlayer())
+ target->CastSpell(target, GetEffectInfo().CalcValue(), true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_the_ocular_on_death::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
void AddSC_icecrown()
{
new npc_argent_valiant;
@@ -786,4 +809,5 @@ void AddSC_icecrown()
new npc_tournament_training_dummy;
new npc_blessed_banner();
new npc_frostbrood_skytalon();
+ RegisterSpellScript(spell_the_ocular_on_death);
}