Fixed Heart of the Phoenix pet spell

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-08-03 10:47:38 +02:00
parent e7ee828fe1
commit 109bcb0927
3 changed files with 53 additions and 1 deletions
+1
View File
@@ -14693,6 +14693,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 23989, 'spell_hun_readiness'),
( 53271, 'spell_hun_masters_call'),
( 53478, 'spell_hun_last_stand_pet'),
( 55709, 'spell_hun_pet_heart_of_the_phoenix'),
-- rogue
( 5938, 'spell_rog_shiv'),
( 14185, 'spell_rog_preparation'),
@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=55709 AND `ScriptName`='spell_hun_pet_heart_of_the_phoenix';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(55709, 'spell_hun_pet_heart_of_the_phoenix');
+49 -1
View File
@@ -28,6 +28,9 @@ enum HunterSpells
HUNTER_SPELL_READINESS = 23989,
HUNTER_SPELL_BESTIAL_WRATH = 19574,
HUNTER_PET_SPELL_LAST_STAND_TRIGGERED = 53479,
HUNTER_PET_HEART_OF_THE_PHOENIX = 55709,
HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114,
HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711,
};
class spell_hun_last_stand_pet_SpellScript : public SpellScript
@@ -121,6 +124,46 @@ SpellScript * GetSpellScript_spell_hun_readiness()
return new spell_hun_readiness_SpellScript();
}
class spell_hun_pet_heart_of_the_phoenix : public SpellScript
{
bool Validate(SpellEntry const * spellEntry)
{
if (!sSpellStore.LookupEntry(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED))
return false;
if (!sSpellStore.LookupEntry(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
return false;
return true;
}
void HandleScript(SpellEffIndex effIndex)
{
if (caster->HasAura(HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF))
return;
Unit *caster = GetCaster();
int32 bp0healPercent = 100;
caster->CastCustomSpell(HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED, SPELLVALUE_BASE_POINT0, 100, caster, true);
caster->CastSpell(caster, HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF, true);
}
void Register()
{
// add dummy effect spell handler to pet's Last Stand
EffectHandlers += EffectHandlerFn(spell_hun_pet_heart_of_the_phoenix::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
bool Load()
{
if (!GetCaster()->isPet())
return false;
return true;
}
};
SpellScript * GetSpellScript_spell_hun_pet_heart_of_the_phoenix()
{
return new spell_hun_pet_heart_of_the_phoenix();
}
void AddSC_hunter_spell_scripts()
{
Script *newscript;
@@ -139,4 +182,9 @@ void AddSC_hunter_spell_scripts()
newscript->Name = "spell_hun_readiness";
newscript->GetSpellScript = &GetSpellScript_spell_hun_readiness;
newscript->RegisterSelf();
}
newscript = new Script;
newscript->Name = "spell_hun_pet_heart_of_the_phoenix";
newscript->GetSpellScript = &GetSpellScript_spell_hun_pet_heart_of_the_phoenix;
newscript->RegisterSelf();
}