Skip to content

Instantly share code, notes, and snippets.

@DDuarte
Created October 22, 2011 11:54
Show Gist options
  • Save DDuarte/1305909 to your computer and use it in GitHub Desktop.
Save DDuarte/1305909 to your computer and use it in GitHub Desktop.
enum ChumTheWaterSummons
{
SUMMON_ANGRY_KVALDIR = 66737,
SUMMON_NORTH_SEA_MAKO = 66738,
SUMMON_NORTH_SEA_THRESHER = 66739,
SUMMON_NORTH_SEA_BLUE_SHARK = 66740
};
class spell_q14112_14145_chum_the_water: public SpellScriptLoader
{
public:
spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { }
class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript
{
bool Validate(SpellInfo const* /*spellEntry*/)
{
if (!sSpellMgr->GetSpellInfo(SUMMON_ANGRY_KVALDIR))
return false;
if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_MAKO))
return false;
if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_THRESHER))
return false;
if (!sSpellMgr->GetSpellInfo(SUMMON_NORTH_SEA_BLUE_SHARK))
return false;
return true;
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK));
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_q14112_14145_chum_the_water_SpellScript();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment