Core/Spells: Implemented SPELL_AURA_ALLOW_TALENT_SWAPPING
Port From (https://github.com/TrinityCore/TrinityCore/commit/49b47047b809ce654661df595b14a5f8c1f01c8c)
This commit is contained in:
@@ -965,7 +965,7 @@ namespace Game.Spells
|
|||||||
void HandleUnused(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleUnused(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ModInvisibilityDetect)]
|
[AuraEffectHandler(AuraType.ModInvisibilityDetect)]
|
||||||
void HandleModInvisibilityDetect(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleModInvisibilityDetect(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -1291,7 +1291,7 @@ namespace Game.Spells
|
|||||||
PhasingHandler.SetAlwaysVisible(target, false, true);
|
PhasingHandler.SetAlwaysVisible(target, false, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
/*** UNIT MODEL ***/
|
/*** UNIT MODEL ***/
|
||||||
/**********************/
|
/**********************/
|
||||||
@@ -1946,7 +1946,7 @@ namespace Game.Spells
|
|||||||
if (apply)
|
if (apply)
|
||||||
aurApp.GetTarget().AttackStop();
|
aurApp.GetTarget().AttackStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ModNoActions)]
|
[AuraEffectHandler(AuraType.ModNoActions)]
|
||||||
void HandleAuraModNoActions(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleAuraModNoActions(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -2106,6 +2106,22 @@ namespace Game.Spells
|
|||||||
target.ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == AuraType.ModSkillTalent);
|
target.ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == AuraType.ModSkillTalent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[AuraEffectHandler(AuraType.AllowTalentSwapping)]
|
||||||
|
void HandleAuraAllowTalentSwapping(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
|
{
|
||||||
|
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||||
|
return;
|
||||||
|
|
||||||
|
Player target = aurApp.GetTarget().ToPlayer();
|
||||||
|
if (target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (apply)
|
||||||
|
target.AddUnitFlag2(UnitFlags2.AllowChangingTalents);
|
||||||
|
else if (!target.HasAuraType(GetAuraType()))
|
||||||
|
target.RemoveUnitFlag2(UnitFlags2.AllowChangingTalents);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************/
|
/****************************/
|
||||||
/*** MOVEMENT ***/
|
/*** MOVEMENT ***/
|
||||||
/****************************/
|
/****************************/
|
||||||
@@ -3497,7 +3513,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
aurApp.GetTarget().ApplyModManaCostMultiplier(GetAmount() / 100.0f, apply);
|
aurApp.GetTarget().ApplyModManaCostMultiplier(GetAmount() / 100.0f, apply);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ModPowerDisplay)]
|
[AuraEffectHandler(AuraType.ModPowerDisplay)]
|
||||||
void HandleAuraModPowerDisplay(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleAuraModPowerDisplay(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -4622,7 +4638,7 @@ namespace Game.Spells
|
|||||||
else
|
else
|
||||||
player.RemoveSpell((uint)GetMiscValue(), false, false, true);
|
player.RemoveSpell((uint)GetMiscValue(), false, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ComprehendLanguage)]
|
[AuraEffectHandler(AuraType.ComprehendLanguage)]
|
||||||
void HandleComprehendLanguage(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleComprehendLanguage(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
@@ -5350,9 +5366,9 @@ namespace Game.Spells
|
|||||||
damage = (uint)(caster.SpellDamageBonusDone(target, GetSpellInfo(), damage, DamageEffectType.DOT, GetSpellEffectInfo(), GetBase().GetStackAmount()) * caster.SpellDamagePctDone(target, m_spellInfo, DamageEffectType.DOT));
|
damage = (uint)(caster.SpellDamageBonusDone(target, GetSpellInfo(), damage, DamageEffectType.DOT, GetSpellEffectInfo(), GetBase().GetStackAmount()) * caster.SpellDamagePctDone(target, m_spellInfo, DamageEffectType.DOT));
|
||||||
damage = target.SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DamageEffectType.DOT, GetSpellEffectInfo(), GetBase().GetStackAmount());
|
damage = target.SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DamageEffectType.DOT, GetSpellEffectInfo(), GetBase().GetStackAmount());
|
||||||
|
|
||||||
// Calculate armor mitigation
|
// Calculate armor mitigation
|
||||||
if (caster.IsDamageReducedByArmor(GetSpellInfo().GetSchoolMask(), GetSpellInfo(), (sbyte)GetEffIndex()))
|
if (caster.IsDamageReducedByArmor(GetSpellInfo().GetSchoolMask(), GetSpellInfo(), (sbyte)GetEffIndex()))
|
||||||
{
|
{
|
||||||
uint damageReductedArmor = caster.CalcArmorReducedDamage(caster, target, damage, GetSpellInfo());
|
uint damageReductedArmor = caster.CalcArmorReducedDamage(caster, target, damage, GetSpellInfo());
|
||||||
cleanDamage.mitigated_damage += damage - damageReductedArmor;
|
cleanDamage.mitigated_damage += damage - damageReductedArmor;
|
||||||
damage = damageReductedArmor;
|
damage = damageReductedArmor;
|
||||||
@@ -6119,7 +6135,7 @@ namespace Game.Spells
|
|||||||
|
|
||||||
target.UpdatePvPState(true);
|
target.UpdatePvPState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
[AuraEffectHandler(AuraType.ModOverrideZonePvpType)]
|
[AuraEffectHandler(AuraType.ModOverrideZonePvpType)]
|
||||||
void HandleModOverrideZonePVPType(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleModOverrideZonePVPType(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user