Scripts/Grizzlyhills: Spell: Infected Worgen Bite - Apply Spellscript and Transformation

closes #12165
This commit is contained in:
Rushor
2015-02-06 21:17:04 +01:00
parent ccdc100d10
commit 6080234e98
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
-- assign spellscript for Spell: 'Infected Worgen Bite'
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=53095;
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(53095,-53094,2,'Infected Worgen Bite - Worgen\'s Call Immunity');
DELETE FROM `spell_script_names` WHERE `spell_id`=53094;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(53094,'spell_infected_worgen_bite');

View File

@@ -816,6 +816,44 @@ class spell_shredder_delivery : public SpellScriptLoader
}
};
enum InfectedWorgenBite
{
SPELL_INFECTED_WORGEN_BITE = 53094,
SPELL_WORGENS_CALL = 53095
};
class spell_infected_worgen_bite : public SpellScriptLoader
{
public:
spell_infected_worgen_bite() : SpellScriptLoader("spell_infected_worgen_bite") { }
class spell_infected_worgen_bite_AuraScript : public AuraScript
{
PrepareAuraScript(spell_infected_worgen_bite_AuraScript);
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
if (GetStackAmount() == GetSpellInfo()->StackAmount)
{
Remove();
target->CastSpell(target, SPELL_WORGENS_CALL, true);
}
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_infected_worgen_bite_AuraScript::HandleAfterEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAPPLY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_infected_worgen_bite_AuraScript();
}
};
void AddSC_grizzly_hills()
{
new npc_emily();
@@ -827,4 +865,5 @@ void AddSC_grizzly_hills()
new npc_venture_co_straggler();
new npc_lake_frog();
new spell_shredder_delivery();
new spell_infected_worgen_bite();
}