Core/Auras: Rename many old aura types to their new meaning
Port From (https://github.com/TrinityCore/TrinityCore/commit/bd7c714c97beb04eb815b0aa175badfb6933ccf1)
This commit is contained in:
@@ -1034,11 +1034,6 @@ namespace Game.Spells
|
||||
modOwner.ApplySpellMod(GetId(), SpellModOp.ResistDispelChance, ref resistChance);
|
||||
}
|
||||
|
||||
// Dispel resistance from target SPELL_AURA_MOD_DISPEL_RESIST
|
||||
// Only affects offensive dispels
|
||||
if (offensive && auraTarget != null)
|
||||
resistChance += auraTarget.GetTotalAuraModifier(AuraType.ModDispelResist);
|
||||
|
||||
resistChance = resistChance < 0 ? 0 : resistChance;
|
||||
resistChance = resistChance > 100 ? 100 : resistChance;
|
||||
return 100 - resistChance;
|
||||
|
||||
@@ -957,43 +957,6 @@ namespace Game.Spells
|
||||
#endregion
|
||||
|
||||
#region AuraEffect Handlers
|
||||
[AuraEffectHandler(AuraType.None)]
|
||||
[AuraEffectHandler(AuraType.Unk46)]
|
||||
[AuraEffectHandler(AuraType.Unk48)]
|
||||
[AuraEffectHandler(AuraType.PetDamageMulti)]
|
||||
[AuraEffectHandler(AuraType.ModCriticalThreat)]
|
||||
[AuraEffectHandler(AuraType.ModCooldown)]
|
||||
[AuraEffectHandler(AuraType.Unk214)]
|
||||
[AuraEffectHandler(AuraType.ModDetaunt)]
|
||||
[AuraEffectHandler(AuraType.ModSpellDamageFromHealing)]
|
||||
[AuraEffectHandler(AuraType.ModTargetResistBySpellClass)]
|
||||
[AuraEffectHandler(AuraType.ModDamageDoneForMechanic)]
|
||||
[AuraEffectHandler(AuraType.BlockSpellFamily)]
|
||||
[AuraEffectHandler(AuraType.Strangulate)]
|
||||
[AuraEffectHandler(AuraType.ModCritChanceForCaster)]
|
||||
[AuraEffectHandler(AuraType.Unk311)]
|
||||
[AuraEffectHandler(AuraType.AnimReplacementSet)]
|
||||
[AuraEffectHandler(AuraType.ModSpellPowerPct)]
|
||||
[AuraEffectHandler(AuraType.OverrideUnlockedAzeriteEssenceRank)]
|
||||
[AuraEffectHandler(AuraType.ModBlind)]
|
||||
[AuraEffectHandler(AuraType.Unk335)]
|
||||
[AuraEffectHandler(AuraType.MountRestrictions)]
|
||||
[AuraEffectHandler(AuraType.ModResurrectedHealthByGuildMember)]
|
||||
[AuraEffectHandler(AuraType.ModSpellCooldownByHaste)]
|
||||
[AuraEffectHandler(AuraType.ModGatheringItemsGainedPercent)]
|
||||
[AuraEffectHandler(AuraType.Unk351)]
|
||||
[AuraEffectHandler(AuraType.Unk352)]
|
||||
[AuraEffectHandler(AuraType.ModCamouflage)]
|
||||
[AuraEffectHandler(AuraType.Unk354)]
|
||||
[AuraEffectHandler(AuraType.EnableBoss1UnitFrame)]
|
||||
[AuraEffectHandler(AuraType.WorgenAlteredForm)]
|
||||
[AuraEffectHandler(AuraType.ProcTriggerSpellCopy)]
|
||||
[AuraEffectHandler(AuraType.OverrideAutoattackWithMeleeSpell)]
|
||||
[AuraEffectHandler(AuraType.ModNextSpell)]
|
||||
[AuraEffectHandler(AuraType.MaxFarClipPlane)]
|
||||
[AuraEffectHandler(AuraType.EnablePowerBarTimer)]
|
||||
void HandleUnused(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) { }
|
||||
|
||||
/**************************************/
|
||||
/*** VISIBILITY & PHASES ***/
|
||||
/**************************************/
|
||||
@@ -1949,7 +1912,7 @@ namespace Game.Spells
|
||||
HandleAuraModSilence(aurApp, mode, apply);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.AllowOnlyAbility)]
|
||||
[AuraEffectHandler(AuraType.DisableCastingExceptAbilities)]
|
||||
void HandleAuraAllowOnlyAbility(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.SendForClientMask))
|
||||
@@ -1963,7 +1926,7 @@ namespace Game.Spells
|
||||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target.HasAuraType(AuraType.AllowOnlyAbility))
|
||||
if (target.HasAuraType(AuraType.DisableCastingExceptAbilities))
|
||||
return;
|
||||
target.RemovePlayerFlag(PlayerFlags.AllowOnlyAbility);
|
||||
}
|
||||
@@ -3135,38 +3098,6 @@ namespace Game.Spells
|
||||
target.ToPlayer().UpdateSpellDamageAndHealingBonus();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModSpellDamageOfAttackPower)]
|
||||
void HandleModSpellDamagePercentFromAttackPower(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag((AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (!target.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
// Magic damage modifiers implemented in Unit.SpellDamageBonus
|
||||
// This information for client side use only
|
||||
// Recalculate bonus
|
||||
target.ToPlayer().UpdateSpellDamageAndHealingBonus();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModSpellHealingOfAttackPower)]
|
||||
void HandleModSpellHealingPercentFromAttackPower(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag((AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (!target.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
// Recalculate bonus
|
||||
target.ToPlayer().UpdateSpellDamageAndHealingBonus();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModHealingDone)]
|
||||
void HandleModHealingDone(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
@@ -3237,29 +3168,6 @@ namespace Game.Spells
|
||||
target.SetHealth(Math.Max(MathFunctions.CalculatePct(target.GetMaxHealth(), healthPct), (zeroHealth ? 0 : 1ul)));
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModResistanceOfStatPercent)]
|
||||
void HandleAuraModResistenceOfStatPercent(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag((AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (!target.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
if (GetMiscValue() != (int)SpellSchoolMask.Normal)
|
||||
{
|
||||
// support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
|
||||
// and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
|
||||
Log.outError(LogFilter.Spells, "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Recalculate Armor
|
||||
target.UpdateArmor();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModExpertise)]
|
||||
void HandleAuraModExpertise(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
@@ -3389,21 +3297,6 @@ namespace Game.Spells
|
||||
HandleModPowerRegen(aurApp, mode, apply);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModManaRegenFromStat)]
|
||||
void HandleModManaRegen(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag((AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat)))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (!target.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
//Note: an increase in regen does NOT cause threat.
|
||||
target.ToPlayer().UpdateManaRegen();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModManaRegenPct)]
|
||||
void HandleModManaRegenPct(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
@@ -3709,7 +3602,15 @@ namespace Game.Spells
|
||||
[AuraEffectHandler(AuraType.InterruptRegen)]
|
||||
void HandleAuraModRegenInterrupt(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
HandleModManaRegen(aurApp, mode, apply);
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.ChangeAmountMask | AuraEffectHandleModes.Stat))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (!target.IsPlayer())
|
||||
return;
|
||||
|
||||
target.ToPlayer().UpdateManaRegen();
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.ModWeaponCritPercent)]
|
||||
@@ -4194,23 +4095,6 @@ namespace Game.Spells
|
||||
target.ToPlayer().SetNoRegentCostMask(mask);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.RetainComboPoints)]
|
||||
void HandleAuraRetainComboPoints(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||
return;
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
if (!target.IsTypeId(TypeId.Player))
|
||||
return;
|
||||
|
||||
// combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
|
||||
// remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
|
||||
if (!apply && aurApp.GetRemoveMode() == AuraRemoveMode.Expire)
|
||||
target.ToPlayer().AddComboPoints((sbyte)-GetAmount());
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/*** OTHERS ***/
|
||||
/*********************************************************/
|
||||
|
||||
@@ -3286,17 +3286,7 @@ namespace Game.Spells
|
||||
|
||||
if (IsAutoActionResetSpell())
|
||||
{
|
||||
bool found = false;
|
||||
var vIgnoreReset = m_caster.GetAuraEffectsByType(AuraType.IgnoreMeleeReset);
|
||||
foreach (var i in vIgnoreReset)
|
||||
{
|
||||
if (i.IsAffectingSpell(m_spellInfo))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found && !m_spellInfo.HasAttribute(SpellAttr2.NotResetAutoActions))
|
||||
if (!m_spellInfo.HasAttribute(SpellAttr2.NotResetAutoActions))
|
||||
{
|
||||
m_caster.ResetAttackTimer(WeaponAttackType.BaseAttack);
|
||||
if (m_caster.HaveOffhandWeapon())
|
||||
@@ -4533,9 +4523,6 @@ namespace Game.Spells
|
||||
}
|
||||
}
|
||||
|
||||
if (m_caster.HasAuraTypeWithMiscvalue(AuraType.BlockSpellFamily, (int)m_spellInfo.SpellFamilyName))
|
||||
return SpellCastResult.SpellUnavailable;
|
||||
|
||||
bool reqCombat = true;
|
||||
var stateAuras = m_caster.GetAuraEffectsByType(AuraType.AbilityIgnoreAurastate);
|
||||
foreach (var aura in stateAuras)
|
||||
@@ -5645,7 +5632,7 @@ namespace Game.Spells
|
||||
bool CheckSpellCancelsStun(ref uint param1)
|
||||
{
|
||||
return CheckSpellCancelsAuraEffect(AuraType.ModStun, ref param1) &&
|
||||
CheckSpellCancelsAuraEffect(AuraType.Strangulate, ref param1);
|
||||
CheckSpellCancelsAuraEffect(AuraType.ModStunDisableGravity, ref param1);
|
||||
}
|
||||
|
||||
bool CheckSpellCancelsSilence(ref uint param1)
|
||||
@@ -7232,7 +7219,7 @@ namespace Game.Spells
|
||||
m_spellInfo.HasAttribute(SpellAttr0.ReqAmmo) || m_spellInfo.HasAttribute(SpellAttr0.Ability);
|
||||
|
||||
// Apply haste rating
|
||||
if (gcd > 750 && ((m_spellInfo.StartRecoveryCategory == 133 && !isMeleeOrRangedSpell) || m_caster.HasAuraTypeWithAffectMask(AuraType.ModGlobalCooldownByHaste, m_spellInfo)))
|
||||
if (gcd > 750 && (m_spellInfo.StartRecoveryCategory == 133 && !isMeleeOrRangedSpell))
|
||||
{
|
||||
gcd = (int)(gcd * m_caster.m_unitData.ModSpellHaste);
|
||||
MathFunctions.RoundToInterval(ref gcd, 750, 1500);
|
||||
|
||||
Reference in New Issue
Block a user