Core/Spell: Unlocking zuluhed chains

Core/Spell: Unlocking zuluheds chains

Core/Spell: Unlocking zuluheds chains

Core/Spell: Unlocking zuluheds chains
This commit is contained in:
Gacko
2012-09-01 00:35:52 +02:00
parent 305b8d2d69
commit 74d4aec49b
2 changed files with 40 additions and 3 deletions
@@ -0,0 +1,4 @@
-- Unlocking zuluhed chains
DELETE FROM `spell_script_names` WHERE `spell_id`=38790;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(38790, 'spell_unlocking_zuluheds_chains');
@@ -1868,9 +1868,41 @@ public:
};
};
/*#####
#
######*/
enum ZuluhedChains
{
QUEST_ZULUHED = 10866,
NPC_KARYNAKU = 22112,
};
class spell_unlocking_zuluheds_chains : public SpellScriptLoader
{
public:
spell_unlocking_zuluheds_chains() : SpellScriptLoader("spell_unlocking_zuluheds_chains") { }
class spell_unlocking_zuluheds_chains_SpellScript : public SpellScript
{
PrepareSpellScript(spell_unlocking_zuluheds_chains_SpellScript);
void HandleOnCast()
{
// FIXME: Hackish solution, a better way to reward killcredit should be found
if (Unit* caster = GetCaster())
if(Player* player = caster->ToPlayer())
if (player->GetQuestStatus(QUEST_ZULUHED) == QUEST_STATUS_INCOMPLETE)
player->CastedCreatureOrGO(NPC_KARYNAKU, MAKE_NEW_GUID(0, NPC_KARYNAKU, HIGHGUID_UNIT), 0);
}
void Register()
{
OnCast += SpellCastFn(spell_unlocking_zuluheds_chains_SpellScript::HandleOnCast);
}
};
SpellScript* GetSpellScript() const
{
return new spell_unlocking_zuluheds_chains_SpellScript();
}
};
void AddSC_shadowmoon_valley()
{
@@ -1889,4 +1921,5 @@ void AddSC_shadowmoon_valley()
new mob_illidari_spawn();
new mob_torloth_the_magnificent();
new npc_enraged_spirit();
new spell_unlocking_zuluheds_chains();
}