mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 21:50:50 -04:00
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:
@@ -430,6 +430,61 @@ class spell_gen_bandage : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// Blood Reserve - 64568
|
||||
enum BloodReserve
|
||||
{
|
||||
SPELL_GEN_BLOOD_RESERVE_AURA = 64568,
|
||||
SPELL_GEN_BLOOD_RESERVE_HEAL = 64569
|
||||
};
|
||||
|
||||
class spell_gen_blood_reserve : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_blood_reserve() : SpellScriptLoader("spell_gen_blood_reserve") { }
|
||||
|
||||
class spell_gen_blood_reserve_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_blood_reserve_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_GEN_BLOOD_RESERVE_HEAL))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo())
|
||||
if (Unit* caster = eventInfo.GetActionTarget())
|
||||
if (caster->HealthBelowPctDamaged(35, dmgInfo->GetDamage()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* caster = eventInfo.GetActionTarget();
|
||||
caster->CastCustomSpell(SPELL_GEN_BLOOD_RESERVE_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), caster, TRIGGERED_FULL_MASK, nullptr, aurEff);
|
||||
caster->RemoveAura(SPELL_GEN_BLOOD_RESERVE_AURA);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_gen_blood_reserve_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_gen_blood_reserve_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_gen_blood_reserve_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum Bonked
|
||||
{
|
||||
SPELL_BONKED = 62991,
|
||||
@@ -4199,6 +4254,7 @@ void AddSC_generic_spell_scripts()
|
||||
new spell_gen_aura_service_uniform();
|
||||
new spell_gen_av_drekthar_presence();
|
||||
new spell_gen_bandage();
|
||||
new spell_gen_blood_reserve();
|
||||
new spell_gen_bonked();
|
||||
new spell_gen_break_shield("spell_gen_break_shield");
|
||||
new spell_gen_break_shield("spell_gen_tournament_counterattack");
|
||||
|
||||
Reference in New Issue
Block a user