diff options
-rw-r--r-- | sql/updates/world/2011_03_10_8_world_spell_script_names.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 47 |
2 files changed, 50 insertions, 0 deletions
diff --git a/sql/updates/world/2011_03_10_8_world_spell_script_names.sql b/sql/updates/world/2011_03_10_8_world_spell_script_names.sql new file mode 100644 index 00000000000..28598e0d313 --- /dev/null +++ b/sql/updates/world/2011_03_10_8_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=48917; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(48917, 'spell_q10041_q10040_who_are_they'); 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(); } |