Core/Spells: Proc handler script converions (#17122)

* Blazing Speed (Mage)
* Blessed Recovery (Priest)
* Druid Forms Trinket
* Idol Of Mutilation
* Nature's Guardian (Shaman)
* Nether Protection (Warlock)
* Piercing Shots and Bonus 4P T9 Hunter
* Lightning Shield (Shaman)
* Acclimation (DK)
* Move DK T10 4P Melee Bonus
* Move DK Improved Blood Presence triggered heal (DK)
* Rogue T10 2P Bonus
* Illumination (Paladin)
* Soul Preserver
* Death Choice trinket
* stack trinket scripts (ToC25 Caster Trinket, Lightning Capacitor, Thunder Capacitor)
* Battle Experience (ICC - Gunship)
* Blood Reserve (enchant proc)
* Darkmoon Card Greatness
* Charm of the Amani Witch Doctor
* Mana Drain
This commit is contained in:
mik1893
2016-05-13 00:13:19 +01:00
committed by Shauren
parent e7a12edb83
commit 5b8e68ee63
14 changed files with 1366 additions and 413 deletions
+106
View File
@@ -51,9 +51,11 @@ enum HunterSpells
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114,
SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_DEBUFF = 55711,
SPELL_HUNTER_PET_CARRION_FEEDER_TRIGGERED = 54045,
SPELL_HUNTER_PIERCING_SHOTS = 63468,
SPELL_HUNTER_READINESS = 23989,
SPELL_HUNTER_SNIPER_TRAINING_R1 = 53302,
SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1 = 64418,
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_VICIOUS_VIPER = 61609,
SPELL_HUNTER_VIPER_ATTACK_SPEED = 60144,
SPELL_DRAENEI_GIFT_OF_THE_NAARU = 59543
@@ -704,6 +706,63 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
}
};
// -53234 - Piercing Shots
class spell_hun_piercing_shots : public SpellScriptLoader
{
public:
spell_hun_piercing_shots() : SpellScriptLoader("spell_hun_piercing_shots") { }
class spell_hun_piercing_shots_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_piercing_shots_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_PIERCING_SHOTS))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetActionTarget())
return true;
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetActionTarget();
if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
{
SpellInfo const* piercingShots = sSpellMgr->AssertSpellInfo(SPELL_HUNTER_PIERCING_SHOTS);
int32 duration = piercingShots->GetMaxDuration();
uint32 amplitude = piercingShots->Effects[EFFECT_0].Amplitude;
uint32 dmg = dmgInfo->GetDamage();
uint32 bp = CalculatePct(int32(dmg), aurEff->GetAmount()) / (duration / int32(amplitude));
bp += target->GetRemainingPeriodicAmount(target->GetGUID(), SPELL_HUNTER_PIERCING_SHOTS, SPELL_AURA_PERIODIC_DAMAGE);
caster->CastCustomSpell(SPELL_HUNTER_PIERCING_SHOTS, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff);
}
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_hun_piercing_shots_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_hun_piercing_shots_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_hun_piercing_shots_AuraScript();
}
};
// 56654, 58882 - Rapid Recuperation
class spell_hun_rapid_recuperation : public SpellScriptLoader
{
@@ -967,6 +1026,51 @@ class spell_hun_target_only_pet_and_owner : public SpellScriptLoader
}
};
// 67151 - T9 4P Bonus
class spell_hun_t9_4p_bonus : public SpellScriptLoader
{
public:
spell_hun_t9_4p_bonus() : SpellScriptLoader("spell_hun_t9_4p_bonus") { }
class spell_hun_t9_4p_bonus_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_t9_4p_bonus_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_T9_4P_GREATNESS))
return false;
return true;
}
bool CheckProc(ProcEventInfo& eventInfo)
{
if (eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER && eventInfo.GetActor()->ToPlayer()->GetPet())
return true;
return false;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
caster->CastSpell(caster->ToPlayer()->GetPet(), SPELL_HUNTER_T9_4P_GREATNESS, true, nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_hun_t9_4p_bonus_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_hun_t9_4p_bonus_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_hun_t9_4p_bonus_AuraScript();
}
};
// 60144 - Viper Attack Speed
class spell_hun_viper_attack_speed : public SpellScriptLoader
{
@@ -1025,11 +1129,13 @@ void AddSC_hunter_spell_scripts()
new spell_hun_misdirection_proc();
new spell_hun_pet_carrion_feeder();
new spell_hun_pet_heart_of_the_phoenix();
new spell_hun_piercing_shots();
new spell_hun_rapid_recuperation();
new spell_hun_readiness();
new spell_hun_scatter_shot();
new spell_hun_sniper_training();
new spell_hun_tame_beast();
new spell_hun_target_only_pet_and_owner();
new spell_hun_t9_4p_bonus();
new spell_hun_viper_attack_speed();
}