Core/Scripts: Convert spells to new proc system

- Converted Unit::HandleDummyAuraProc function to AuraScripts
  * Extra: DMC: Madness now uses DB texts. yay!
  * Extra: improvements on Imp. Spell Reflection (range and max targets, filter caster with conditions)

- Fixed Glyph of Succubus. (Closes #6599)

- Changed old (not-blizz) behavior of Vampiric Embrace:
  * Before: party heal affected the priest too and self heal was reduced by that amount to not over-heal
  * Now: self heal amount not affected, rather filter the priest out of the party heal using conditions :)

- Solve bug in AQ 3p set bonus, it should only trigger when healing others, not self heals.
- Priest T10 2p bonus (heal) now rolls its effect properly

- Use brand new GetEffectiveHeal to fix #17142
- While we're at it, also close #17034 for good
- Converted Unit::HandleAuraProc function to AuraScripts (#17941)
- Converted Unit::HandleAuraProc function to AuraScripts (cont'd) (#17955)
- Corrected Flametongue weapon damage formula
- Actually check offhand weapon for flametongue in Lava Lash script
- Implemented halved proc chance for Missile Barrage on Arcane Barrage, Fireball, Frostbolt and Frostfire Bolt cast
- Converted Unit::HandleProcTriggerSpell function to AuraScripts (#17956)
- De-hack Earth shield. Fixes #13808
- Updated Honor among Thieves
- Implemented mana proc for Mark of Conquest in case of ranged attack
- Fixed Scent of Blood giving more stacks than the talent rank currently learnt.
- Ported old proc table. Proc system is dead. Long live the proc system!
- Recklessness should get charges removed per cast. Closes #15529
- Use proc system to remove Molten Core charges on Incinerate/Soul Fire cast. Closes #15942

Closes #3463
Closes #5401
Closes #15595
Closes #15974
Closes #16679
Closes #17925
This commit is contained in:
ariel-
2016-09-25 20:48:31 -03:00
parent e641d0c7d7
commit 2ff855054f
28 changed files with 9190 additions and 323 deletions

View File

@@ -1443,51 +1443,6 @@ class spell_gen_ds_flush_knockback : public SpellScriptLoader
}
};
enum DummyTrigger
{
SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470,
SPELL_PERSISTANT_SHIELD = 26467
};
class spell_gen_dummy_trigger : public SpellScriptLoader
{
public:
spell_gen_dummy_trigger() : SpellScriptLoader("spell_gen_dummy_trigger") { }
class spell_gen_dummy_trigger_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_dummy_trigger_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD_TRIGGERED) ||
!sSpellMgr->GetSpellInfo(SPELL_PERSISTANT_SHIELD))
return false;
return true;
}
void HandleDummy(SpellEffIndex /* effIndex */)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
if (SpellInfo const* triggeredByAuraSpell = GetTriggeringSpell())
if (triggeredByAuraSpell->Id == SPELL_PERSISTANT_SHIELD_TRIGGERED)
caster->CastCustomSpell(target, SPELL_PERSISTANT_SHIELD_TRIGGERED, &damage, NULL, NULL, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_dummy_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_gen_dummy_trigger_SpellScript();
}
};
class spell_gen_dungeon_credit : public SpellScriptLoader
{
public:
@@ -2763,6 +2718,41 @@ class spell_gen_orc_disguise : public SpellScriptLoader
}
};
class spell_gen_proc_below_pct_damaged : public SpellScriptLoader
{
public:
spell_gen_proc_below_pct_damaged(const char* name) : SpellScriptLoader(name) { }
class spell_gen_proc_below_pct_damaged_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_proc_below_pct_damaged_AuraScript);
bool CheckProc(ProcEventInfo& eventInfo)
{
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetDamage())
return false;
int32 pct = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
if (eventInfo.GetActionTarget()->HealthBelowPctDamaged(pct, damageInfo->GetDamage()))
return true;
return false;
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_gen_proc_below_pct_damaged_AuraScript::CheckProc);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_proc_below_pct_damaged_AuraScript();
}
};
enum ParachuteSpells
{
SPELL_PARACHUTE = 45472,
@@ -3535,6 +3525,53 @@ class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader
}
};
enum VampiricTouch
{
SPELL_VAMPIRIC_TOUCH_HEAL = 52724
};
// 52723 - Vampiric Touch
// 60501 - Vampiric Touch
class spell_gen_vampiric_touch : public SpellScriptLoader
{
public:
spell_gen_vampiric_touch() : SpellScriptLoader("spell_gen_vampiric_touch") { }
class spell_gen_vampiric_touch_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_vampiric_touch_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_VAMPIRIC_TOUCH_HEAL))
return false;
return true;
}
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetDamage())
return;
Unit* caster = eventInfo.GetActor();
int32 bp = damageInfo->GetDamage() / 2;
caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_gen_vampiric_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_vampiric_touch_AuraScript();
}
};
enum VehicleScaling
{
SPELL_GEAR_SCALING = 66668
@@ -4324,7 +4361,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_despawn_self();
new spell_gen_divine_storm_cd_reset();
new spell_gen_ds_flush_knockback();
new spell_gen_dummy_trigger();
new spell_gen_dungeon_credit();
new spell_gen_elune_candle();
new spell_gen_gadgetzan_transporter_backfire();
@@ -4352,6 +4388,12 @@ void AddSC_generic_spell_scripts()
new spell_gen_on_tournament_mount();
new spell_gen_oracle_wolvar_reputation();
new spell_gen_orc_disguise();
new spell_gen_proc_below_pct_damaged("spell_item_soul_harvesters_charm");
new spell_gen_proc_below_pct_damaged("spell_item_commendation_of_kaelthas");
new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin");
new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin_heroic");
new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale");
new spell_gen_proc_below_pct_damaged("spell_item_petrified_twilight_scale_heroic");
new spell_gen_parachute();
new spell_gen_pet_summoned();
new spell_gen_profession_research();
@@ -4369,6 +4411,7 @@ void AddSC_generic_spell_scripts()
new spell_pvp_trinket_wotf_shared_cd();
new spell_gen_turkey_marker();
new spell_gen_upper_deck_create_foam_sword();
new spell_gen_vampiric_touch();
new spell_gen_vehicle_scaling();
new spell_gen_vendor_bark_trigger();
new spell_gen_wg_water();