diff options
author | kaelima <jeppo_meyer@msn.com> | 2011-03-10 20:54:24 +0100 |
---|---|---|
committer | kaelima <jeppo_meyer@msn.com> | 2011-03-10 20:54:24 +0100 |
commit | 8d4b04318fb264faf1d34555190de4f2bbc0710b (patch) | |
tree | 1a65e7e597fd292c2bf1018598d4761811ba9545 /src | |
parent | d7fd0726a25cb2463819a8c91f5b915f026f8dea (diff) |
Scripts/Spells: Added spell script for Shadowy Disguise(48917)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index c6fb1332333..013a635b8ad 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -729,6 +729,52 @@ public: } }; +enum eWhoarethey +{ + SPELL_QUESTGIVER = 48917, + + SPELL_MALE_DISGUISE = 38080, + SPELL_FEMALE_DISGUISE = 38081, + SPELL_GENERIC_DISGUISE = 32756 +}; + +class spell_q10041_q10040_who_are_they : public SpellScriptLoader +{ + public: + spell_q10041_q10040_who_are_they() : SpellScriptLoader("spell_q10041_q10040_who_are_they") { } + + class spell_q10041_q10040_who_are_they_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q10041_q10040_who_are_they_SpellScript); + + bool Validate(SpellEntry const * /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_QUESTGIVER)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + if (!GetHitUnit() || !GetHitUnit()->ToPlayer()) + return; + + GetHitUnit()->CastSpell(GetHitUnit(), GetHitUnit()->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_GENERIC_DISGUISE, true); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_q10041_q10040_who_are_they_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q10041_q10040_who_are_they_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -746,4 +792,5 @@ void AddSC_quest_spell_scripts() new spell_q12683_take_sputum_sample(); new spell_q12851_going_bearback(); new spell_q12937_relief_for_the_fallen(); + new spell_q10041_q10040_who_are_they(); } |