aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 05fad623114..e7befff87a3 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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();
}