Core/Spells: Implementation of QAston proc system

- Move checks from Unit::IsTriggeredAtSpellProcEvent (old system) to Aura::IsProcTriggeredOnEvent (new system)
- Templatize SpellModOp param of Player::ApplySpellMod, also killed charge counter from SpellModifier and Player system for handling charges... no point in having 3 different systems doing the same thing
- Automatically add default entries to spellProcMap, based on spellinfo (else auras won't proc without an entry) Based on old Unit::ProcDamageAndSpellFor
- Old Unit::ProcDamageAndSpellFor renamed to Unit::ProcSkillsAndReactives and made private, will no longer handle auras.
- Start making use of HealInfo::AbsorbHeal in unit calculations, add effective healing info to HealInfo struct
- Changes in spell reflection system, emulates old behaviour, delaying aura drop
- Removed old charge count hacks in SpellMgr::LoadSpellInfoCorrections
- Removed bogus error log when procChance is 0: Some auras have initial 0 procChance but modified by SPELLMOD_CHANCE_OF_SUCCESS
- Fixed TriggerAurasProcOnEvent logic that tried to trigger twice from actor.
- Allow non damaging spells with DamageClass Melee or Ranged to proc character enchants. Ref issue #17034:

  * http://web.archive.org/web/20110309092008/http://elitistjerks.com/f47/t49865-paladin_retribution_pve/
  * When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system).

  * 1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..)
  * 2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided.

  * Holy Vengeance is the "hidden strike" it has an apply aura effect and damage class melee.
- Fixed Blood Tap interaction with Death Runes (btw, don't know what was going on with those MiscValueB, spell 45529 doesn't have any MiscValueB in SPELL_EFFECT_ACTIVATE_RUNE)
- Ported some AuraEffect checks from old Unit.cpp function. added new AuraScript hook to check procs of an specific effect
- Allow only AuraEffects that passed the check to proc, this won't block whole aura from proccing (and lose charges) if at least one of the effects procs, though
- Changes in spell mod system (for SPELLMOD_CASTING_TIME). fixes #17558.
- Added an exception for SPELLMOD_CRITICAL_CHANCE too, fixes #15193
This commit is contained in:
Aokromes
2016-10-05 13:19:51 +02:00
parent eb745277cd
commit a70e4e26b3
22 changed files with 1192 additions and 3882 deletions

View File

@@ -592,7 +592,7 @@ float SpellEffectInfo::CalcValueMultiplier(Unit* caster, Spell* spell) const
{
float multiplier = ValueMultiplier;
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_VALUE_MULTIPLIER, multiplier, spell);
modOwner->ApplySpellMod<SPELLMOD_VALUE_MULTIPLIER>(_spellInfo->Id, multiplier, spell);
return multiplier;
}
@@ -600,7 +600,7 @@ float SpellEffectInfo::CalcDamageMultiplier(Unit* caster, Spell* spell) const
{
float multiplierPercent = DamageMultiplier * 100.0f;
if (Player* modOwner = (caster ? caster->GetSpellModOwner() : NULL))
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_DAMAGE_MULTIPLIER, multiplierPercent, spell);
modOwner->ApplySpellMod<SPELLMOD_DAMAGE_MULTIPLIER>(_spellInfo->Id, multiplierPercent, spell);
return multiplierPercent / 100.0f;
}
@@ -629,7 +629,7 @@ float SpellEffectInfo::CalcRadius(Unit* caster, Spell* spell) const
radius += entry->RadiusPerLevel * caster->getLevel();
radius = std::min(radius, entry->RadiusMax);
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(_spellInfo->Id, SPELLMOD_RADIUS, radius, spell);
modOwner->ApplySpellMod<SPELLMOD_RADIUS>(_spellInfo->Id, radius, spell);
}
return radius;
@@ -2295,7 +2295,7 @@ float SpellInfo::GetMaxRange(bool positive, Unit* caster, Spell* spell) const
range = RangeEntry->maxRangeHostile;
if (caster)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_RANGE, range, spell);
modOwner->ApplySpellMod<SPELLMOD_RANGE>(Id, range, spell);
return range;
}
@@ -2461,7 +2461,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) c
// Apply cost mod by spell
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(Id, SPELLMOD_COST, powerCost);
modOwner->ApplySpellMod<SPELLMOD_COST>(Id, powerCost);
if (!caster->IsControlledByPlayer())
{
@@ -2643,7 +2643,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
}
break;
case SPELLFAMILY_MAGE:
// Ignite
// Impact
if (SpellIconID == 45)
return true;
break;