Core/Spells: Fix Permanent Feign Death spells to be used in creature_addon auras

--HG--
branch : trunk
This commit is contained in:
Shocker
2010-09-08 14:57:44 +03:00
parent 93ccf461e6
commit 047b244f2f
3 changed files with 44 additions and 0 deletions

View File

@@ -115,8 +115,38 @@ public:
}
};
class spell_creature_permanent_feign_death : public SpellScriptLoader
{
public:
spell_creature_permanent_feign_death() : SpellScriptLoader("spell_creature_permanent_feign_death") { }
class spell_creature_permanent_feign_deathAuraScript : public AuraScript
{
void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp, AuraEffectHandleModes /*mode*/)
{
Unit* pTarget = aurApp->GetTarget();
if (!pTarget)
return;
pTarget->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
pTarget->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
}
void Register()
{
OnEffectApply += AuraEffectApplyFn(spell_creature_permanent_feign_deathAuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript *GetAuraScript() const
{
return new spell_creature_permanent_feign_deathAuraScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_pet_summoned();
new spell_gen_remove_flight_auras();
new spell_creature_permanent_feign_death();
}