Core/Scripts: implemented enchant Blade Warding

This commit is contained in:
ariel- authored and roc13x committed 2017-05-05 04:02:32 +01:00
1 parent ea20370fce
commit 1e475a6942
2 files changed
+55

No files matched your search

@@ -0,0 +1,6 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_blade_warding';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(64440, 'spell_gen_blade_warding');
-- no cooldown
UPDATE `spell_proc` SET `Cooldown`=0 WHERE `SpellId`=64440;
@@ -493,6 +493,54 @@ class spell_gen_bandage : public SpellScriptLoader
}
};
// Blade Warding - 64440
enum BladeWarding
{
SPELL_GEN_BLADE_WARDING_TRIGGERED = 64442
};
class spell_gen_blade_warding : public SpellScriptLoader
{
public:
spell_gen_blade_warding() : SpellScriptLoader("spell_gen_blade_warding") { }
class spell_gen_blade_warding_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_blade_warding_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_GEN_BLADE_WARDING_TRIGGERED });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget();
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_GEN_BLADE_WARDING_TRIGGERED);
uint8 stacks = GetStackAmount();
int32 bp = 0;
for (uint8 i = 0; i < stacks; ++i)
bp += spellInfo->Effects[EFFECT_0].CalcValue(caster);
caster->CastCustomSpell(SPELL_GEN_BLADE_WARDING_TRIGGERED, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), TRIGGERED_FULL_MASK, nullptr, aurEff);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_gen_blade_warding_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_blade_warding_AuraScript();
}
};
enum Bonked
{
SPELL_BONKED = 62991,
@@ -4154,6 +4202,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_blade_warding();
new spell_gen_bonked();
new spell_gen_break_shield("spell_gen_break_shield");
new spell_gen_break_shield("spell_gen_tournament_counterattack");