Core/Scripts: Import missing gen/item scripts

This commit is contained in:
roc13x committed 2017-05-05 04:26:38 +01:00
1 parent 1e475a6942
commit 97e8b18ceb
2 files changed
+442 -6

No files matched your search

@@ -493,6 +493,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();
}
};
// Blade Warding - 64440
enum BladeWarding
{
@@ -4202,6 +4257,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_blade_warding();
new spell_gen_bonked();
new spell_gen_break_shield("spell_gen_break_shield");