Scripting/Storm Peaks: Add spell script for spell_jokkum_scriptcast.

Quest 13010 Krolmir, Hammer of Storms is not yet fully scripted but is now completeable.
This commit is contained in:
Malcrom
2013-11-24 13:09:48 -03:30
parent dcfbe1d987
commit f3ade339d8
2 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=61319;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (61319, 'spell_jokkum_scriptcast');

View File

@@ -460,6 +460,52 @@ class spell_close_rift : public SpellScriptLoader
}
};
/*#####
# spell_jokkum_scriptcast
#####*/
enum JokkumScriptcast
{
SPELL_JOKKUM_KILL_CREDIT = 56545,
SPELL_JOKKUM_SUMMON = 56541
};
class spell_jokkum_scriptcast : public SpellScriptLoader
{
public: spell_jokkum_scriptcast() : SpellScriptLoader("spell_jokkum_scriptcast") { }
class spell_jokkum_scriptcast_AuraScript : public AuraScript
{
PrepareAuraScript(spell_jokkum_scriptcast_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_KILL_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetTarget()->ToPlayer())
{
player->CastSpell(player, SPELL_JOKKUM_KILL_CREDIT, true);
player->CastSpell(player, SPELL_JOKKUM_SUMMON, true);
}
}
void Register() OVERRIDE
{
OnEffectApply += AuraEffectApplyFn(spell_jokkum_scriptcast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_jokkum_scriptcast_AuraScript();
}
};
void AddSC_storm_peaks()
{
new npc_injured_goblin();
@@ -469,4 +515,5 @@ void AddSC_storm_peaks()
new npc_icefang();
new npc_hyldsmeet_protodrake();
new spell_close_rift();
new spell_jokkum_scriptcast();
}