Core/Spell: SpellValueOverrides encapsulation
Port From (https://github.com/TrinityCore/TrinityCore/commit/5fbddef85f48f6b9140d025d7f2e14faae0af178)
This commit is contained in:
@@ -1401,7 +1401,7 @@ namespace Game.Entities
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
|
||||
if (auraId == 35696) // Demonic Knowledge
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(aura.GetDamage(), GetStat(Stats.Stamina) + GetStat(Stats.Intellect)));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(aura.GetDamage(), GetStat(Stats.Stamina) + GetStat(Stats.Intellect)));
|
||||
|
||||
CastSpell(this, auraId, args);
|
||||
}
|
||||
|
||||
@@ -5138,7 +5138,7 @@ namespace Game.Entities
|
||||
if (artifactPowerRank.AuraPointsOverride != 0)
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
if (spellInfo.GetEffect((uint)i) != null)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, (int)artifactPowerRank.AuraPointsOverride);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, (int)artifactPowerRank.AuraPointsOverride);
|
||||
|
||||
CastSpell(this, artifactPowerRank.SpellID, args);
|
||||
}
|
||||
@@ -5228,7 +5228,11 @@ namespace Game.Entities
|
||||
if (major && currentRank == 1)
|
||||
{
|
||||
if (apply)
|
||||
CastSpell(this, PlayerConst.SpellIdHeartEssenceActionBarOverride, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, (int)azeriteEssencePower.MajorPowerDescription));
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)azeriteEssencePower.MajorPowerDescription);
|
||||
CastSpell(this, PlayerConst.SpellIdHeartEssenceActionBarOverride, args);
|
||||
}
|
||||
else
|
||||
RemoveAurasDueToSpell(PlayerConst.SpellIdHeartEssenceActionBarOverride);
|
||||
}
|
||||
|
||||
@@ -3268,7 +3268,7 @@ namespace Game.Entities
|
||||
for (byte i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
{
|
||||
if (spellInfo.GetEffect(i).IsEffect())
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, MathFunctions.CalculatePct(spellInfo.GetEffect(i).CalcValue(this), effectPct));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, MathFunctions.CalculatePct(spellInfo.GetEffect(i).CalcValue(this), effectPct));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3009,7 +3009,7 @@ namespace Game.Entities
|
||||
{
|
||||
CastSpellExtraArgs args = new(flags);
|
||||
args.OriginalCaster = origCasterGUID;
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, seatId + 1);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, seatId + 1);
|
||||
caster.CastSpell(target, clickInfo.spellId, args);
|
||||
}
|
||||
else // This can happen during Player._LoadAuras
|
||||
|
||||
@@ -862,11 +862,11 @@ namespace Game.Entities
|
||||
return targets.SelectRandom();
|
||||
}
|
||||
|
||||
public void EnterVehicle(Unit Base, sbyte seatId = -1)
|
||||
public void EnterVehicle(Unit baseUnit, sbyte seatId = -1)
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.IgnoreCasterMountedOrOnVehicle);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, seatId + 1);
|
||||
CastSpell(this, SharedConst.VehicleSpellRideHardcoded, args);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, seatId + 1);
|
||||
CastSpell(baseUnit, SharedConst.VehicleSpellRideHardcoded, args);
|
||||
}
|
||||
|
||||
public void _EnterVehicle(Vehicle vehicle, sbyte seatId, AuraApplication aurApp)
|
||||
|
||||
Reference in New Issue
Block a user