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)
|
||||
|
||||
@@ -1276,7 +1276,7 @@ namespace Game.Spells
|
||||
if (caster.HasAura(64760))
|
||||
{
|
||||
CastSpellExtraArgs args = new(GetEffect(0));
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, GetEffect(0).GetAmount());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, GetEffect(0).GetAmount());
|
||||
caster.CastSpell(target, 64801, args);
|
||||
}
|
||||
}
|
||||
@@ -1331,7 +1331,7 @@ namespace Game.Spells
|
||||
{
|
||||
float multiplier = aurEff.GetAmount();
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(caster.GetMaxPower(PowerType.Mana), multiplier));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(caster.GetMaxPower(PowerType.Mana), multiplier));
|
||||
caster.CastSpell(caster, 47755, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4619,7 +4619,7 @@ namespace Game.Spells
|
||||
CastSpellExtraArgs args = new(this);
|
||||
|
||||
if (GetAmount() != 0) // If amount avalible cast with basepoints (Crypt Fever for example)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, GetAmount());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, GetAmount());
|
||||
|
||||
caster.CastSpell(target, triggeredSpellId, args);
|
||||
}
|
||||
@@ -4883,7 +4883,7 @@ namespace Game.Spells
|
||||
{
|
||||
CastSpellExtraArgs args = new(this);
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, GetAmount());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, GetAmount());
|
||||
|
||||
triggerCaster.CastSpell(target, triggerSpellId, args);
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellWithValueAuraTick: Spell {0} Trigger {1}", GetId(), triggeredSpellInfo.Id);
|
||||
@@ -5272,7 +5272,7 @@ namespace Game.Spells
|
||||
int feedAmount = MathFunctions.CalculatePct(gainedAmount, manaFeedVal);
|
||||
|
||||
CastSpellExtraArgs args = new(this);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, feedAmount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, feedAmount);
|
||||
caster.CastSpell(caster, 32554, args);
|
||||
}
|
||||
}
|
||||
@@ -5425,7 +5425,7 @@ namespace Game.Spells
|
||||
if (triggeredSpellInfo != null)
|
||||
{
|
||||
CastSpellExtraArgs args = new(this);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, GetAmount());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, GetAmount());
|
||||
triggerCaster.CastSpell(triggerTarget, triggerSpellId, args);
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandleProcTriggerSpellWithValueAuraProc: Triggering spell {0} with value {1} from aura {2} proc", triggeredSpellInfo.Id, GetAmount(), GetId());
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace Game.Spells
|
||||
// set basepoints for trigger with value effect
|
||||
if (effectInfo.Effect == SpellEffectName.TriggerSpellWithValue)
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, damage);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, damage);
|
||||
|
||||
// original caster guid only for GO cast
|
||||
m_caster.CastSpell(targets, spellInfo.Id, args);
|
||||
@@ -435,7 +435,7 @@ namespace Game.Spells
|
||||
// set basepoints for trigger with value effect
|
||||
if (effectInfo.Effect == SpellEffectName.TriggerMissileSpellWithValue)
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, damage);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, damage);
|
||||
|
||||
// original caster guid only for GO cast
|
||||
m_caster.CastSpell(targets, spellInfo.Id, args);
|
||||
@@ -474,7 +474,7 @@ namespace Game.Spells
|
||||
case 52349: // Overtake
|
||||
{
|
||||
CastSpellExtraArgs args1 = new(m_originalCasterGUID);
|
||||
args1.SpellValueOverrides.Add(SpellValueMod.BasePoint0, damage);
|
||||
args1.AddSpellMod(SpellValueMod.BasePoint0, damage);
|
||||
unitTarget.CastSpell(unitTarget, spellInfo.Id, args1);
|
||||
return;
|
||||
}
|
||||
@@ -492,7 +492,7 @@ namespace Game.Spells
|
||||
// set basepoints for trigger with value effect
|
||||
if (effectInfo.Effect == SpellEffectName.ForceCastWithValue)
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, damage);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0 + i, damage);
|
||||
|
||||
unitTarget.CastSpell(m_caster, spellInfo.Id, args);
|
||||
}
|
||||
@@ -1746,7 +1746,7 @@ namespace Game.Spells
|
||||
|
||||
// if we have small value, it indicates seat position
|
||||
if (basePoints > 0 && basePoints < SharedConst.MaxVehicleSeats)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, basePoints);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, basePoints);
|
||||
|
||||
m_originalCaster.CastSpell(summon, spellId, args);
|
||||
|
||||
@@ -3176,7 +3176,7 @@ namespace Game.Spells
|
||||
if (totem != null && totem.IsTotem())
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, damage);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, damage);
|
||||
m_caster.CastSpell(totem, 55277, args);
|
||||
}
|
||||
}
|
||||
@@ -3571,12 +3571,8 @@ namespace Game.Spells
|
||||
|
||||
ExecuteLogEffectDestroyItem(effIndex, foodItem.GetEntry());
|
||||
|
||||
uint count = 1;
|
||||
player.DestroyItemCount(foodItem, ref count, true);
|
||||
// @todo fix crash when a spell has two effects, both pointed at the same item target
|
||||
|
||||
int pct;
|
||||
int levelDiff = (int)(pet.GetLevel() - foodItem.GetTemplate().GetBaseItemLevel());
|
||||
int levelDiff = (int)pet.GetLevel() - (int)foodItem.GetTemplate().GetBaseItemLevel();
|
||||
if (levelDiff >= 30)
|
||||
return;
|
||||
else if (levelDiff >= 20)
|
||||
@@ -3586,7 +3582,13 @@ namespace Game.Spells
|
||||
else
|
||||
pct = 50;
|
||||
|
||||
m_caster.CastSpell(pet, effectInfo.TriggerSpell, new CastSpellExtraArgs(SpellValueMod.BasePoint0, pct).SetTriggerFlags(TriggerCastFlags.FullMask));
|
||||
uint count = 1;
|
||||
player.DestroyItemCount(foodItem, ref count, true);
|
||||
// @todo fix crash when a spell has two effects, both pointed at the same item target
|
||||
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, pct);
|
||||
m_caster.CastSpell(pet, effectInfo.TriggerSpell, args);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.DismissPet)]
|
||||
@@ -4272,7 +4274,7 @@ namespace Game.Spells
|
||||
if (mana != 0)
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, mana);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, mana);
|
||||
m_caster.CastSpell(m_caster, 39104, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,9 +149,8 @@ namespace Scripts.Spells.DeathKnight
|
||||
|
||||
if (!GetTarget().HasAura(SpellIds.VolatileShielding))
|
||||
{
|
||||
int bp = (int)(2 * absorbAmount * 100 / maxHealth);
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(absorbAmount, 2 * absorbAmount * 100 / maxHealth));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(absorbAmount, 2 * absorbAmount * 100 / maxHealth));
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.RunicPowerEnergize, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,10 @@ namespace Scripts.Spells.DemonHunter
|
||||
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.ChaosStrikeEnergize, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount()).SetTriggeringAura(aurEff));
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount());
|
||||
args.SetTriggeringAura(aurEff);
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.ChaosStrikeEnergize, args);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
|
||||
@@ -786,7 +786,7 @@ namespace Scripts.Spells.Druid
|
||||
return;
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount()));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount()));
|
||||
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.LivingSeedProc, args);
|
||||
}
|
||||
|
||||
@@ -808,7 +808,7 @@ namespace Scripts.Spells.Druid
|
||||
{
|
||||
PreventDefaultAction();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, aurEff.GetAmount());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount());
|
||||
GetTarget().CastSpell(GetTarget(), SpellIds.LivingSeedHeal, args);
|
||||
}
|
||||
|
||||
@@ -1187,7 +1187,7 @@ namespace Scripts.Spells.Druid
|
||||
|
||||
int amount = MathFunctions.CalculatePct(spellPowerCost.Amount, aurEff.GetAmount());
|
||||
CastSpellExtraArgs args = new (aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell((Unit)null, SpellIds.Exhilarate, args);
|
||||
}
|
||||
|
||||
@@ -1244,7 +1244,7 @@ namespace Scripts.Spells.Druid
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Languish, AuraType.PeriodicDamage);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell(target, SpellIds.Languish, args);
|
||||
}
|
||||
|
||||
@@ -1327,7 +1327,7 @@ namespace Scripts.Spells.Druid
|
||||
|
||||
int amount = (int)eventInfo.GetHealInfo().GetHeal();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)eventInfo.GetHealInfo().GetHeal());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)eventInfo.GetHealInfo().GetHeal());
|
||||
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.RejuvenationT10Proc, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -753,7 +753,7 @@ namespace Scripts.Spells.Generic
|
||||
|
||||
Unit caster = eventInfo.GetActionTarget();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, aurEff.GetAmount());
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount());
|
||||
caster.CastSpell(caster, SpellIds.BloodReserveHeal, args);
|
||||
caster.RemoveAura(SpellIds.BloodReserveAura);
|
||||
}
|
||||
@@ -983,7 +983,7 @@ namespace Scripts.Spells.Generic
|
||||
if (target)
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, basepoints0);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, basepoints0);
|
||||
caster.CastSpell(target, SpellIds.ChaosBlast, args);
|
||||
}
|
||||
}
|
||||
@@ -1728,7 +1728,7 @@ namespace Scripts.Spells.Generic
|
||||
PreventDefaultAction();
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.MaxTargets, (int)aurEff.GetTickNumber() / 10 + 1);
|
||||
args.AddSpellMod(SpellValueMod.MaxTargets, (int)aurEff.GetTickNumber() / 10 + 1);
|
||||
GetTarget().CastSpell((Unit)null, GetSpellInfo().GetEffect(aurEff.GetEffIndex()).TriggerSpell, args);
|
||||
}
|
||||
|
||||
@@ -2820,7 +2820,7 @@ namespace Scripts.Spells.Generic
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)damageInfo.GetDamage() / 2);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)damageInfo.GetDamage() / 2);
|
||||
caster.CastSpell(caster, SpellIds.VampiricTouchHeal, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -542,7 +542,7 @@ namespace Scripts.Spells.Holiday
|
||||
case SpellIds.RamCanter:
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.AuraStack, 1);
|
||||
args.AddSpellMod(SpellValueMod.AuraStack, 1);
|
||||
target.CastSpell(target, SpellIds.RamFatigue, args);
|
||||
if (aurEff.GetTickNumber() == 8)
|
||||
target.CastSpell(target, QuestIds.BrewfestSpeedBunnyYellow, true);
|
||||
@@ -551,7 +551,7 @@ namespace Scripts.Spells.Holiday
|
||||
case SpellIds.RamGallop:
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.AuraStack, target.HasAura(SpellIds.RamFatigue) ? 4 : 5 /*Hack*/);
|
||||
args.AddSpellMod(SpellValueMod.AuraStack, target.HasAura(SpellIds.RamFatigue) ? 4 : 5 /*Hack*/);
|
||||
target.CastSpell(target, SpellIds.RamFatigue, args);
|
||||
if (aurEff.GetTickNumber() == 8)
|
||||
target.CastSpell(target, QuestIds.BrewfestSpeedBunnyRed, true);
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Scripts.Spells.Hunter
|
||||
{
|
||||
Unit caster = GetCaster();
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)caster.CountPctFromMaxHealth(30));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)caster.CountPctFromMaxHealth(30));
|
||||
caster.CastSpell(caster, SpellIds.PetLastStandTriggered, args);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace Scripts.Spells.Hunter
|
||||
if (!caster.HasAura(SpellIds.PetHeartOfThePhoenixDebuff))
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, 100);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, 100);
|
||||
owner.CastSpell(caster, SpellIds.PetHeartOfThePhoenixTriggered, args);
|
||||
caster.CastSpell(caster, SpellIds.PetHeartOfThePhoenixDebuff, true);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ namespace Scripts.Spells.Hunter
|
||||
PreventDefaultAction();
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()));
|
||||
eventInfo.GetActor().CastSpell(GetCaster(), SpellIds.RoarOfSacrificeTriggered, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -597,7 +597,7 @@ namespace Scripts.Spells.Items
|
||||
|
||||
Unit caster = eventInfo.GetActionTarget();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell((Unit)null, spellId, args);
|
||||
}
|
||||
|
||||
@@ -780,7 +780,7 @@ namespace Scripts.Spells.Items
|
||||
else
|
||||
{
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, absorb);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, absorb);
|
||||
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.ProtectionOfAncientKings, args);
|
||||
}
|
||||
}
|
||||
@@ -833,7 +833,7 @@ namespace Scripts.Spells.Items
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DeadlyPrecision, GetCastDifficulty());
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.AuraStack, (int)spellInfo.StackAmount);
|
||||
args.AddSpellMod(SpellValueMod.AuraStack, (int)spellInfo.StackAmount);
|
||||
GetCaster().CastSpell(GetCaster(), spellInfo.Id, args);
|
||||
}
|
||||
|
||||
@@ -1198,7 +1198,7 @@ namespace Scripts.Spells.Items
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
|
||||
caster.CastSpell((Unit)null, SpellIds.Shadowmend, args);
|
||||
}
|
||||
|
||||
@@ -1459,7 +1459,7 @@ namespace Scripts.Spells.Items
|
||||
return;
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
|
||||
GetTarget().CastSpell((Unit)null, SpellIds.ItemNecroticTouchProc, args);
|
||||
}
|
||||
|
||||
@@ -1587,7 +1587,7 @@ namespace Scripts.Spells.Items
|
||||
return;
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, bp0);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, bp0);
|
||||
caster.CastSpell(target, SpellIds.PersistentShieldTriggered, args);
|
||||
}
|
||||
|
||||
@@ -1616,7 +1616,7 @@ namespace Scripts.Spells.Items
|
||||
return;
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
|
||||
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.HealthLink, args);
|
||||
}
|
||||
|
||||
@@ -1947,7 +1947,7 @@ namespace Scripts.Spells.Items
|
||||
|
||||
Unit caster = eventInfo.GetActor();
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)caster.CountPctFromMaxHealth(aurEff.GetAmount()));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)caster.CountPctFromMaxHealth(aurEff.GetAmount()));
|
||||
caster.CastSpell((Unit)null, SpellIds.SwiftHandOfJusticeHeal, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -591,7 +591,7 @@ namespace Scripts.Spells.Mage
|
||||
amount += (int)eventInfo.GetProcTarget().GetRemainingPeriodicAmount(eventInfo.GetActor().GetGUID(), SpellIds.Ignite, AuraType.PeriodicDamage);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.Ignite, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -642,7 +642,7 @@ namespace Scripts.Spells.Paladin
|
||||
if (!applications.Empty())
|
||||
{
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)heal);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)heal);
|
||||
eventInfo.GetActor().CastSpell(applications[0].GetTarget(), SpellIds.BeaconOfLightHeal, args);
|
||||
}
|
||||
return;
|
||||
@@ -823,7 +823,7 @@ namespace Scripts.Spells.Paladin
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.HolyMending, AuraType.PeriodicHeal);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell(target, SpellIds.HolyMending, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Scripts.Spells.Priest
|
||||
return;
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(healInfo.GetHeal(), 10));
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(healInfo.GetHeal(), 10));
|
||||
caster.CastSpell(caster, SpellIds.OracularHeal, args);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace Scripts.Spells.Priest
|
||||
// Remove the aura now, we don't want 40% healing bonus
|
||||
Remove(AuraRemoveMode.EnemySpell);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, healAmount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, healAmount);
|
||||
target.CastSpell(target, SpellIds.GuardianSpiritHeal, args);
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
}
|
||||
@@ -883,7 +883,7 @@ namespace Scripts.Spells.Priest
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.BlessedHealing, AuraType.PeriodicHeal);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell(target, SpellIds.BlessedHealing, args);
|
||||
}
|
||||
|
||||
@@ -919,8 +919,8 @@ namespace Scripts.Spells.Priest
|
||||
int teamHeal = selfHeal / 2;
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, teamHeal);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint1, selfHeal);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, teamHeal);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint1, selfHeal);
|
||||
GetTarget().CastSpell((Unit)null, SpellIds.VampiricEmbraceHeal, args);
|
||||
}
|
||||
|
||||
@@ -968,7 +968,7 @@ namespace Scripts.Spells.Priest
|
||||
{
|
||||
// backfire damage
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, aurEff.GetAmount() * 8);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount() * 8);
|
||||
caster.CastSpell(target, SpellIds.VampiricTouchDispel, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1655,7 +1655,7 @@ namespace Scripts.Spells.Quest
|
||||
return;
|
||||
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, 2);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, 2);
|
||||
GetHitCreature().CastSpell(GetCaster(), SpellIds.RideGymer, args);
|
||||
GetHitCreature().CastSpell(GetHitCreature(), SpellIds.Grabbed, true);
|
||||
}
|
||||
|
||||
@@ -910,7 +910,7 @@ namespace Scripts.Spells.Shaman
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Electrified, AuraType.PeriodicDamage);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell(target, SpellIds.Electrified, args);
|
||||
}
|
||||
|
||||
@@ -946,7 +946,7 @@ namespace Scripts.Spells.Shaman
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.LavaBurstBonusDamage, AuraType.PeriodicDamage);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell(target, SpellIds.LavaBurstBonusDamage, args);
|
||||
}
|
||||
|
||||
@@ -1014,7 +1014,7 @@ namespace Scripts.Spells.Shaman
|
||||
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.ChainedHeal, AuraType.PeriodicHeal);
|
||||
|
||||
CastSpellExtraArgs args = new(aurEff);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, amount);
|
||||
caster.CastSpell(target, SpellIds.ChainedHeal, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ namespace Scripts.Spells.Warrior
|
||||
Unit target = eventInfo.GetActionTarget();
|
||||
int bp0 = (int)MathFunctions.CalculatePct(target.GetMaxHealth(), GetSpellInfo().GetEffect(1).CalcValue());
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, bp0);
|
||||
args.AddSpellMod(SpellValueMod.BasePoint0, bp0);
|
||||
target.CastSpell((Unit)null, SpellIds.Stoicism, args);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user