DB/Misc: Add full script for Pilfering Perfume (A:24656 H:24541)

Closes #5205
This commit is contained in:
w1sht0l1v3
2013-02-04 05:22:09 +02:00
parent e0fca3454e
commit ffb4c63fe3
2 changed files with 177 additions and 0 deletions

View File

@@ -3518,6 +3518,63 @@ class spell_gen_replenishment : public SpellScriptLoader
}
};
enum ServiceUniform
{
SPELL_SERVICE_UNIFORM = 71450,
MODEL_GOBLIN_MALE = 31002,
MODEL_GOBLIN_FEMALE = 31003,
};
class spell_gen_aura_service_uniform : public SpellScriptLoader
{
public:
spell_gen_aura_service_uniform() : SpellScriptLoader("spell_gen_aura_service_uniform") { }
class spell_gen_aura_service_uniform_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_aura_service_uniform_AuraScript);
bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
// Apply model goblin
Unit* target = GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (target->getGender() == GENDER_MALE)
target->SetDisplayId(MODEL_GOBLIN_MALE);
else
target->SetDisplayId(MODEL_GOBLIN_FEMALE);
}
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
target->RestoreDisplayId();
}
void Register()
{
AfterEffectApply += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_gen_aura_service_uniform_AuraScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -3597,4 +3654,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_bonked();
new spell_gen_gift_of_naaru();
new spell_gen_replenishment();
new spell_gen_aura_service_uniform();
}