Core/Spells: Fix more startup error with spells
This commit is contained in:
1 parent
40176543c1
commit
e9acee868b
6 files changed
+18
-387
No files matched your search
@@ -32,12 +32,9 @@
|
||||
|
||||
enum HunterSpells
|
||||
{
|
||||
SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET = 61669,
|
||||
SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE = 34075,
|
||||
SPELL_HUNTER_BESTIAL_WRATH = 19574,
|
||||
SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353,
|
||||
SPELL_HUNTER_FIRE = 82926,
|
||||
SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER = 56851,
|
||||
SPELL_HUNTER_IMPROVED_MEND_PET = 24406,
|
||||
SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398,
|
||||
SPELL_HUNTER_LOCK_AND_LOAD = 56453,
|
||||
@@ -58,99 +55,6 @@ enum HunterSpells
|
||||
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543,
|
||||
};
|
||||
|
||||
// 13161 - Aspect of the Beast
|
||||
class spell_hun_aspect_of_the_beast : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_aspect_of_the_beast() : SpellScriptLoader("spell_hun_aspect_of_the_beast") { }
|
||||
|
||||
class spell_hun_aspect_of_the_beast_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_aspect_of_the_beast_AuraScript);
|
||||
|
||||
bool Load() OVERRIDE
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* caster = GetCaster()->ToPlayer())
|
||||
if (Pet* pet = caster->GetPet())
|
||||
pet->RemoveAurasDueToSpell(SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET);
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* caster = GetCaster()->ToPlayer())
|
||||
if (caster->GetPet())
|
||||
caster->CastSpell(caster, SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET, true);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_of_the_beast_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const OVERRIDE
|
||||
{
|
||||
return new spell_hun_aspect_of_the_beast_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 34074 - Aspect of the Viper
|
||||
class spell_hun_ascpect_of_the_viper : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hun_ascpect_of_the_viper() : SpellScriptLoader("spell_hun_ascpect_of_the_viper") { }
|
||||
|
||||
class spell_hun_ascpect_of_the_viper_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hun_ascpect_of_the_viper_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 maxMana = GetTarget()->GetMaxPower(POWER_MANA);
|
||||
int32 mana = CalculatePct(maxMana, GetTarget()->GetAttackTime(RANGED_ATTACK) / 1000.0f);
|
||||
|
||||
if (AuraEffect const* glyph = GetTarget()->GetAuraEffect(SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER, EFFECT_0))
|
||||
AddPct(mana, glyph->GetAmount());
|
||||
|
||||
GetTarget()->CastCustomSpell(SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_hun_ascpect_of_the_viper_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_OBS_MOD_POWER);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const OVERRIDE
|
||||
{
|
||||
return new spell_hun_ascpect_of_the_viper_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 53209 - Chimera Shot
|
||||
class spell_hun_chimera_shot : public SpellScriptLoader
|
||||
{
|
||||
@@ -1036,8 +940,6 @@ class spell_hun_tnt : public SpellScriptLoader
|
||||
|
||||
void AddSC_hunter_spell_scripts()
|
||||
{
|
||||
new spell_hun_aspect_of_the_beast();
|
||||
new spell_hun_ascpect_of_the_viper();
|
||||
new spell_hun_chimera_shot();
|
||||
new spell_hun_disengage();
|
||||
new spell_hun_fire();
|
||||
|
||||
Reference in new issue
Block a user