Core/Spells: Removed old combo point code leftovers
Port From (https://github.com/TrinityCore/TrinityCore/commit/197d4369c894e9b088f862c7189f4fe20b4836ca)
This commit is contained in:
@@ -1533,7 +1533,7 @@ namespace Framework.Constants
|
|||||||
IgnoreCastItem = 0x08, //! Will Not Take Away Cast Item Or Update Related Achievement Criteria
|
IgnoreCastItem = 0x08, //! Will Not Take Away Cast Item Or Update Related Achievement Criteria
|
||||||
IgnoreAuraScaling = 0x10, //! Will Ignore Aura Scaling
|
IgnoreAuraScaling = 0x10, //! Will Ignore Aura Scaling
|
||||||
IgnoreCastInProgress = 0x20, //! Will Not Check If A Current Cast Is In Progress
|
IgnoreCastInProgress = 0x20, //! Will Not Check If A Current Cast Is In Progress
|
||||||
IgnoreComboPoints = 0x40, //! Will Ignore Combo Point Requirement
|
// reuse = 0x40, //
|
||||||
CastDirectly = 0x80, //! In Spell.Prepare, Will Be Cast Directly Without Setting Containers For Executed Spell
|
CastDirectly = 0x80, //! In Spell.Prepare, Will Be Cast Directly Without Setting Containers For Executed Spell
|
||||||
IgnoreAuraInterruptFlags = 0x100, //! Will Ignore Interruptible Aura'S At Cast
|
IgnoreAuraInterruptFlags = 0x100, //! Will Ignore Interruptible Aura'S At Cast
|
||||||
IgnoreSetFacing = 0x200, //! Will Not Adjust Facing To Target (If Any)
|
IgnoreSetFacing = 0x200, //! Will Not Adjust Facing To Target (If Any)
|
||||||
|
|||||||
@@ -518,8 +518,8 @@ namespace Game.Entities
|
|||||||
opponent.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.DuelEnd);
|
opponent.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.DuelEnd);
|
||||||
|
|
||||||
// cleanup combo points
|
// cleanup combo points
|
||||||
ClearComboPoints();
|
SetPower(PowerType.ComboPoints, 0);
|
||||||
opponent.ClearComboPoints();
|
opponent.SetPower(PowerType.ComboPoints, 0);
|
||||||
|
|
||||||
//cleanups
|
//cleanups
|
||||||
SetDuelArbiter(ObjectGuid.Empty);
|
SetDuelArbiter(ObjectGuid.Empty);
|
||||||
|
|||||||
@@ -645,8 +645,8 @@ namespace Game.Entities
|
|||||||
|
|
||||||
// drunken state is cleared on death
|
// drunken state is cleared on death
|
||||||
SetDrunkValue(0);
|
SetDrunkValue(0);
|
||||||
// lost combo points at any target (targeted combo points clear in Unit::setDeathState)
|
|
||||||
ClearComboPoints();
|
SetPower(PowerType.ComboPoints, 0);
|
||||||
|
|
||||||
ClearResurrectRequestData();
|
ClearResurrectRequestData();
|
||||||
|
|
||||||
@@ -723,7 +723,7 @@ namespace Game.Entities
|
|||||||
StopCastingCharm();
|
StopCastingCharm();
|
||||||
StopCastingBindSight();
|
StopCastingBindSight();
|
||||||
UnsummonPetTemporaryIfAny();
|
UnsummonPetTemporaryIfAny();
|
||||||
ClearComboPoints();
|
SetPower(PowerType.ComboPoints, 0);
|
||||||
GetSession().DoLootReleaseAll();
|
GetSession().DoLootReleaseAll();
|
||||||
m_lootRolls.Clear();
|
m_lootRolls.Clear();
|
||||||
OutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
OutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
|
||||||
|
|||||||
@@ -3343,47 +3343,6 @@ namespace Game.Entities
|
|||||||
return nearMembers[randTarget];
|
return nearMembers[randTarget];
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint GetComboPoints() { return (uint)GetPower(PowerType.ComboPoints); }
|
|
||||||
|
|
||||||
public void AddComboPoints(sbyte count, Spell spell = null)
|
|
||||||
{
|
|
||||||
if (count == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sbyte comboPoints = (sbyte)(spell != null ? spell.m_comboPointGain : GetPower(PowerType.ComboPoints));
|
|
||||||
|
|
||||||
comboPoints += count;
|
|
||||||
|
|
||||||
if (comboPoints > 5)
|
|
||||||
comboPoints = 5;
|
|
||||||
else if (comboPoints < 0)
|
|
||||||
comboPoints = 0;
|
|
||||||
|
|
||||||
if (!spell)
|
|
||||||
SetPower(PowerType.ComboPoints, comboPoints);
|
|
||||||
else
|
|
||||||
spell.m_comboPointGain = comboPoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GainSpellComboPoints(sbyte count)
|
|
||||||
{
|
|
||||||
if (count == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
sbyte cp = (sbyte)GetPower(PowerType.ComboPoints);
|
|
||||||
|
|
||||||
cp += count;
|
|
||||||
if (cp > 5) cp = 5;
|
|
||||||
else if (cp < 0) cp = 0;
|
|
||||||
|
|
||||||
SetPower(PowerType.ComboPoints, cp);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearComboPoints()
|
|
||||||
{
|
|
||||||
SetPower(PowerType.ComboPoints, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearAllReactives()
|
public void ClearAllReactives()
|
||||||
{
|
{
|
||||||
for (ReactiveType i = 0; i < ReactiveType.Max; ++i)
|
for (ReactiveType i = 0; i < ReactiveType.Max; ++i)
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ namespace Game.Spells
|
|||||||
m_spellInfo = info;
|
m_spellInfo = info;
|
||||||
m_caster = (info.HasAttribute(SpellAttr6.OriginateFromController) && caster.GetCharmerOrOwner() != null ? caster.GetCharmerOrOwner() : caster);
|
m_caster = (info.HasAttribute(SpellAttr6.OriginateFromController) && caster.GetCharmerOrOwner() != null ? caster.GetCharmerOrOwner() : caster);
|
||||||
m_spellValue = new SpellValue(m_spellInfo, caster);
|
m_spellValue = new SpellValue(m_spellInfo, caster);
|
||||||
m_needComboPoints = m_spellInfo.NeedsComboPoints();
|
|
||||||
|
|
||||||
// Get data for type of attack
|
// Get data for type of attack
|
||||||
m_attackType = info.GetAttackType();
|
m_attackType = info.GetAttackType();
|
||||||
@@ -2527,10 +2526,6 @@ namespace Game.Spells
|
|||||||
if (m_CastItem == null)
|
if (m_CastItem == null)
|
||||||
m_powerCost = m_spellInfo.CalcPowerCost(m_caster, m_spellSchoolMask, this);
|
m_powerCost = m_spellInfo.CalcPowerCost(m_caster, m_spellSchoolMask, this);
|
||||||
|
|
||||||
// Set combo point requirement
|
|
||||||
if (Convert.ToBoolean(_triggeredCastFlags & TriggerCastFlags.IgnoreComboPoints) || m_CastItem != null)
|
|
||||||
m_needComboPoints = false;
|
|
||||||
|
|
||||||
int param1 = 0, param2 = 0;
|
int param1 = 0, param2 = 0;
|
||||||
SpellCastResult result = CheckCast(true, ref param1, ref param2);
|
SpellCastResult result = CheckCast(true, ref param1, ref param2);
|
||||||
// target is checked in too many locations and with different results to handle each of them
|
// target is checked in too many locations and with different results to handle each of them
|
||||||
@@ -3256,18 +3251,8 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
Unit unitCaster = m_caster.ToUnit();
|
Unit unitCaster = m_caster.ToUnit();
|
||||||
if (unitCaster != null)
|
if (unitCaster != null)
|
||||||
{
|
|
||||||
// Take for real after all targets are processed
|
|
||||||
if (m_needComboPoints)
|
|
||||||
unitCaster.ClearComboPoints();
|
|
||||||
|
|
||||||
// Real add combo points from effects
|
|
||||||
if (m_comboPointGain != 0)
|
|
||||||
unitCaster.AddComboPoints(m_comboPointGain);
|
|
||||||
|
|
||||||
if (m_spellInfo.HasEffect(SpellEffectName.AddExtraAttacks))
|
if (m_spellInfo.HasEffect(SpellEffectName.AddExtraAttacks))
|
||||||
unitCaster.SetLastExtraAttackSpell(m_spellInfo.Id);
|
unitCaster.SetLastExtraAttackSpell(m_spellInfo.Id);
|
||||||
}
|
|
||||||
|
|
||||||
// Handle procs on finish
|
// Handle procs on finish
|
||||||
if (!m_originalCaster)
|
if (!m_originalCaster)
|
||||||
@@ -4795,21 +4780,6 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool reqCombat = true;
|
|
||||||
var stateAuras = unitCaster.GetAuraEffectsByType(AuraType.AbilityIgnoreAurastate);
|
|
||||||
foreach (var aura in stateAuras)
|
|
||||||
{
|
|
||||||
if (aura.IsAffectingSpell(m_spellInfo))
|
|
||||||
{
|
|
||||||
m_needComboPoints = false;
|
|
||||||
if (aura.GetMiscValue() == 1)
|
|
||||||
{
|
|
||||||
reqCombat = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// caster state requirements
|
// caster state requirements
|
||||||
// not for triggered spells (needed by execute)
|
// not for triggered spells (needed by execute)
|
||||||
if (!_triggeredCastFlags.HasFlag(TriggerCastFlags.IgnoreCasterAurastate))
|
if (!_triggeredCastFlags.HasFlag(TriggerCastFlags.IgnoreCasterAurastate))
|
||||||
@@ -4830,7 +4800,7 @@ namespace Game.Spells
|
|||||||
if (m_spellInfo.ExcludeCasterAuraType != 0 && unitCaster.HasAuraType(m_spellInfo.ExcludeCasterAuraType))
|
if (m_spellInfo.ExcludeCasterAuraType != 0 && unitCaster.HasAuraType(m_spellInfo.ExcludeCasterAuraType))
|
||||||
return SpellCastResult.CasterAurastate;
|
return SpellCastResult.CasterAurastate;
|
||||||
|
|
||||||
if (reqCombat && unitCaster.IsInCombat() && !m_spellInfo.CanBeUsedInCombat(unitCaster))
|
if (unitCaster.IsInCombat() && !m_spellInfo.CanBeUsedInCombat(unitCaster))
|
||||||
return SpellCastResult.AffectingCombat;
|
return SpellCastResult.AffectingCombat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5844,15 +5814,6 @@ namespace Game.Spells
|
|||||||
return SpellCastResult.ItemAlreadyEnchanted;
|
return SpellCastResult.ItemAlreadyEnchanted;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if caster has at least 1 combo point for spells that require combo points
|
|
||||||
if (m_needComboPoints)
|
|
||||||
{
|
|
||||||
Player plrCaster = m_caster.ToPlayer();
|
|
||||||
if (plrCaster != null)
|
|
||||||
if (plrCaster.GetComboPoints() == 0)
|
|
||||||
return SpellCastResult.NoComboPoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
// all ok
|
// all ok
|
||||||
return SpellCastResult.SpellCastOk;
|
return SpellCastResult.SpellCastOk;
|
||||||
}
|
}
|
||||||
@@ -8074,7 +8035,6 @@ namespace Game.Spells
|
|||||||
public object m_customArg;
|
public object m_customArg;
|
||||||
public SpellCastVisual m_SpellVisual;
|
public SpellCastVisual m_SpellVisual;
|
||||||
public SpellCastTargets m_targets = new();
|
public SpellCastTargets m_targets = new();
|
||||||
public sbyte m_comboPointGain;
|
|
||||||
public SpellCustomErrors m_customError;
|
public SpellCustomErrors m_customError;
|
||||||
|
|
||||||
public List<Aura> m_appliedMods = new();
|
public List<Aura> m_appliedMods = new();
|
||||||
@@ -8106,7 +8066,6 @@ namespace Game.Spells
|
|||||||
// These vars are used in both delayed spell system and modified immediate spell system
|
// These vars are used in both delayed spell system and modified immediate spell system
|
||||||
bool m_referencedFromCurrentSpell;
|
bool m_referencedFromCurrentSpell;
|
||||||
bool m_executedCurrently;
|
bool m_executedCurrently;
|
||||||
internal bool m_needComboPoints;
|
|
||||||
uint m_applyMultiplierMask;
|
uint m_applyMultiplierMask;
|
||||||
float[] m_damageMultipliers = new float[SpellConst.MaxEffects];
|
float[] m_damageMultipliers = new float[SpellConst.MaxEffects];
|
||||||
|
|
||||||
@@ -8656,10 +8615,6 @@ namespace Game.Spells
|
|||||||
spell.m_hitMask |= hitMask;
|
spell.m_hitMask |= hitMask;
|
||||||
spell.m_procSpellType |= procSpellType;
|
spell.m_procSpellType |= procSpellType;
|
||||||
|
|
||||||
// Do not take combo points on dodge and miss
|
|
||||||
if (MissCondition != SpellMissInfo.None && spell.m_needComboPoints && spell.m_targets.GetUnitTargetGUID() == TargetGUID)
|
|
||||||
spell.m_needComboPoints = false;
|
|
||||||
|
|
||||||
// _spellHitTarget can be null if spell is missed in DoSpellHitOnUnit
|
// _spellHitTarget can be null if spell is missed in DoSpellHitOnUnit
|
||||||
if (MissCondition != SpellMissInfo.Evade && _spellHitTarget && !spell.GetCaster().IsFriendlyTo(unit) && (!spell.IsPositive() || spell.m_spellInfo.HasEffect(SpellEffectName.Dispel)))
|
if (MissCondition != SpellMissInfo.Evade && _spellHitTarget && !spell.GetCaster().IsFriendlyTo(unit) && (!spell.IsPositive() || spell.m_spellInfo.HasEffect(SpellEffectName.Dispel)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -548,11 +548,6 @@ namespace Game.Spells
|
|||||||
return IsChanneled() && !ChannelInterruptFlags.HasFlag(SpellAuraInterruptFlags.Moving | SpellAuraInterruptFlags.Turning);
|
return IsChanneled() && !ChannelInterruptFlags.HasFlag(SpellAuraInterruptFlags.Moving | SpellAuraInterruptFlags.Turning);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool NeedsComboPoints()
|
|
||||||
{
|
|
||||||
return HasAttribute(SpellAttr1.FinishingMoveDamage | SpellAttr1.FinishingMoveDuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsNextMeleeSwingSpell()
|
public bool IsNextMeleeSwingSpell()
|
||||||
{
|
{
|
||||||
return HasAttribute(SpellAttr0.OnNextSwingNoDamage | SpellAttr0.OnNextSwing);
|
return HasAttribute(SpellAttr0.OnNextSwingNoDamage | SpellAttr0.OnNextSwing);
|
||||||
@@ -4193,7 +4188,7 @@ namespace Game.Spells
|
|||||||
// bonus amount from combo points
|
// bonus amount from combo points
|
||||||
if (comboDamage != 0)
|
if (comboDamage != 0)
|
||||||
{
|
{
|
||||||
uint comboPoints = casterUnit.GetComboPoints();
|
int comboPoints = casterUnit.GetPower(PowerType.ComboPoints);
|
||||||
if (comboPoints != 0)
|
if (comboPoints != 0)
|
||||||
value += comboDamage * comboPoints;
|
value += comboDamage * comboPoints;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -876,7 +876,7 @@ namespace Scripts.Spells.Druid
|
|||||||
if (caster != null)
|
if (caster != null)
|
||||||
{
|
{
|
||||||
// 0.01 * $AP * cp
|
// 0.01 * $AP * cp
|
||||||
byte cp = (byte)caster.ToPlayer().GetComboPoints();
|
int cp = caster.GetPower(PowerType.ComboPoints);
|
||||||
|
|
||||||
// Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs
|
// Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs
|
||||||
AuraEffect idol = caster.GetAuraEffect(SpellIds.IdolOfFeralShadows, 0);
|
AuraEffect idol = caster.GetAuraEffect(SpellIds.IdolOfFeralShadows, 0);
|
||||||
|
|||||||
@@ -551,7 +551,7 @@ namespace Scripts.Spells.Rogue
|
|||||||
0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs
|
0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs
|
||||||
};
|
};
|
||||||
|
|
||||||
uint cp = caster.GetComboPoints();
|
int cp = caster.GetPower(PowerType.ComboPoints);
|
||||||
if (cp > 5)
|
if (cp > 5)
|
||||||
cp = 5;
|
cp = 5;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user