Core/Spells: CastSpell Cleanup

Port From (https://github.com/TrinityCore/TrinityCore/commit/)
This commit is contained in:
hondacrx
2021-04-18 18:42:11 -04:00
parent b1ea7212f3
commit d0faa12ef6
45 changed files with 775 additions and 632 deletions
+2 -2
View File
@@ -74,8 +74,8 @@ namespace Scripts.Pets
_victimGUID = player.GetGUID();
DoCast(player, SpellIds.FeelingFroggy, true);
DoCast(me, SpellIds.SeductionVisual, true);
DoCast(player, SpellIds.FeelingFroggy, new Game.Spells.CastSpellExtraArgs(true));
DoCast(me, SpellIds.SeductionVisual, new Game.Spells.CastSpellExtraArgs(true));
me.GetMotionMaster().MoveFollow(player, 0.0f, 0.0f);
}
+2 -1
View File
@@ -19,6 +19,7 @@ using Framework.Constants;
using Game.AI;
using Game.Entities;
using Game.Scripting;
using Game.Spells;
namespace Scripts.Pets
{
@@ -68,7 +69,7 @@ namespace Scripts.Pets
}
if (!_isViper)
DoCast(me, SpellIds.DeadlyPoisonPassive, true);
DoCast(me, SpellIds.DeadlyPoisonPassive, new CastSpellExtraArgs(true));
}
// Redefined for random target selection:
+1 -1
View File
@@ -36,7 +36,7 @@ namespace Scripts.Pets
{
public npc_pet_pri_lightwell(Creature creature) : base(creature)
{
DoCast(creature, SpellIds.LightWellCharges, false);
DoCast(creature, SpellIds.LightWellCharges, new Game.Spells.CastSpellExtraArgs(false));
}
public override void EnterEvadeMode(EvadeReason why)
+13 -9
View File
@@ -150,7 +150,9 @@ namespace Scripts.Spells.DeathKnight
if (!GetTarget().HasAura(SpellIds.VolatileShielding))
{
int bp = (int)(2 * absorbAmount * 100 / maxHealth);
GetTarget().CastCustomSpell(SpellIds.RunicPowerEnergize, SpellValueMod.BasePoint0, bp, GetTarget(), true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(absorbAmount, 2 * absorbAmount * 100 / maxHealth));
GetTarget().CastSpell(GetTarget(), SpellIds.RunicPowerEnergize, args);
}
}
@@ -159,8 +161,9 @@ namespace Scripts.Spells.DeathKnight
AuraEffect volatileShielding = GetTarget().GetAuraEffect(SpellIds.VolatileShielding, 1);
if (volatileShielding != null)
{
int damage = (int)MathFunctions.CalculatePct(absorbedAmount, volatileShielding.GetAmount());
GetTarget().CastCustomSpell(SpellIds.VolatileShieldingDamage, SpellValueMod.BasePoint0, damage, null, TriggerCastFlags.FullMask, null, volatileShielding);
CastSpellExtraArgs args = new(volatileShielding);
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(absorbedAmount, volatileShielding.GetAmount()));
GetTarget().CastSpell((Unit)null, SpellIds.VolatileShieldingDamage, args);
}
}
@@ -292,7 +295,7 @@ namespace Scripts.Spells.DeathKnight
{
WorldLocation pos = GetExplTargetDest();
if (pos != null)
GetCaster().CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), SpellIds.TighteningGraspSlow, true);
GetCaster().CastSpell(pos, SpellIds.TighteningGraspSlow, new CastSpellExtraArgs(true));
}
}
@@ -301,6 +304,7 @@ namespace Scripts.Spells.DeathKnight
OnCast.Add(new CastHandler(HandleDummy));
}
}
[Script] // 43265 - Death and Decay
class spell_dk_death_and_decay_AuraScript : AuraScript
{
@@ -308,7 +312,7 @@ namespace Scripts.Spells.DeathKnight
{
Unit caster = GetCaster();
if (caster)
caster.CastSpell(GetTarget(), SpellIds.DeathAndDecayDamage, true, null, aurEff);
caster.CastSpell(GetTarget(), SpellIds.DeathAndDecayDamage, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -331,7 +335,7 @@ namespace Scripts.Spells.DeathKnight
caster.CastSpell(GetHitUnit(), SpellIds.DeathCoilDamage, true);
AuraEffect unholyAura = caster.GetAuraEffect(SpellIds.Unholy, 6);
if (unholyAura != null) // can be any effect, just here to send SpellFailedDontReport on failure
caster.CastSpell(caster, SpellIds.UnholyVigor, true, null, unholyAura);
caster.CastSpell(caster, SpellIds.UnholyVigor, new CastSpellExtraArgs(unholyAura));
}
public override void Register()
@@ -442,11 +446,11 @@ namespace Scripts.Spells.DeathKnight
int pctOfMaxHealth = MathFunctions.CalculatePct(spellInfo.GetEffect(2).CalcValue(GetCaster()), caster.GetMaxHealth());
heal = Math.Max(heal, pctOfMaxHealth);
caster.CastCustomSpell(SpellIds.DeathStrikeHeal, SpellValueMod.BasePoint0, heal, caster, true);
caster.CastSpell(caster, SpellIds.DeathStrikeHeal, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, heal));
AuraEffect aurEff = caster.GetAuraEffect(SpellIds.BloodShieldMastery, 0);
if (aurEff != null)
caster.CastCustomSpell(SpellIds.BloodShieldAbsorb, SpellValueMod.BasePoint0, MathFunctions.CalculatePct(heal, aurEff.GetAmount()), caster);
caster.CastSpell(caster, SpellIds.BloodShieldAbsorb, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(heal, aurEff.GetAmount())));
if (caster.HasAura(SpellIds.Frost))
caster.CastSpell(GetHitUnit(), SpellIds.DeathStrikeOffhand, true);
@@ -513,7 +517,7 @@ namespace Scripts.Spells.DeathKnight
void HandleScriptEffect(uint effIndex)
{
GetCaster().CastCustomSpell(SpellIds.FesteringWound, SpellValueMod.AuraStack, GetEffectValue(), GetHitUnit(), TriggerCastFlags.FullMask);
GetCaster().CastSpell(GetHitUnit(), SpellIds.FesteringWound, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.AuraStack, GetEffectValue()));
}
public override void Register()
+1 -1
View File
@@ -38,7 +38,7 @@ namespace Scripts.Spells.DemonHunter
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastCustomSpell(SpellIds.ChaosStrikeEnergize, SpellValueMod.BasePoint0, aurEff.GetAmount(), GetTarget(), true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.ChaosStrikeEnergize, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount()).SetTriggeringAura(aurEff));
}
public override void Register()
+59 -60
View File
@@ -154,7 +154,7 @@ namespace Scripts.Spells.Druid
Unit target = GetTarget();
Unit attacker = dmgInfo.GetAttacker();
if (attacker != null)
target.CastCustomSpell(SpellIds.BramblesRelect, SpellValueMod.BasePoint0, (int)absorbAmount, attacker, TriggerCastFlags.FullMask);
target.CastSpell(attacker, SpellIds.BramblesRelect, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, (int)absorbAmount));
}
public override void Register()
@@ -181,7 +181,7 @@ namespace Scripts.Spells.Druid
Unit target = GetTarget();
uint rage = (uint)(target.GetMaxPower(PowerType.Rage) * (float)damageInfo.GetDamage() / (float)target.GetMaxHealth());
if (rage > 0)
target.CastCustomSpell(SpellIds.BristlingFurGainRage, SpellValueMod.BasePoint0, (int)rage, target, TriggerCastFlags.FullMask);
target.CastSpell(target, SpellIds.BristlingFurGainRage, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, (int)rage));
}
}
@@ -232,7 +232,7 @@ namespace Scripts.Spells.Druid
{
Aura aura = unitOwner.GetAura(spellId);
if (aura == null)
unitOwner.CastCustomSpell(spellId, SpellValueMod.AuraStack, (int)amount, null, TriggerCastFlags.FullMask);
unitOwner.CastSpell(unitOwner, spellId, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.AuraStack, (int)amount));
else
aura.SetStackAmount((byte)amount);
}
@@ -316,7 +316,7 @@ namespace Scripts.Spells.Druid
void OnOwnerOutOfCombat(bool isNowInCombat)
{
if (!isNowInCombat)
GetTarget().CastSpell(GetTarget(), SpellIds.EclipseOoc, TriggerCastFlags.FullMask);
GetTarget().CastSpell(GetTarget(), SpellIds.EclipseOoc, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -342,7 +342,7 @@ namespace Scripts.Spells.Druid
else
{
// cast eclipse
target.CastSpell(target, eclipseAuraSpellId, TriggerCastFlags.FullMask);
target.CastSpell(target, eclipseAuraSpellId, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
// Remove stacks from other one as well
// reset remaining power on other spellId
@@ -524,7 +524,7 @@ namespace Scripts.Spells.Druid
return;
}
target.CastSpell(target, triggerspell, true, null, aurEff);
target.CastSpell(target, triggerspell, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -698,7 +698,7 @@ namespace Scripts.Spells.Druid
return;
if (RandomHelper.randChance(chance))
eventInfo.GetActor().CastSpell((Unit)null, spellId, true, null, aurEff);
eventInfo.GetActor().CastSpell((Unit)null, spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -715,14 +715,8 @@ namespace Scripts.Spells.Druid
return ValidateSpellInfo(SpellIds.LifebloomFinalHeal, SpellIds.LifebloomEnergize);
}
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
void OnRemoveEffect(Unit target, AuraEffect aurEff, uint stack)
{
// Final heal only on duration end
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Expire)
return;
// final heal
uint stack = GetStackAmount();
uint healAmount = (uint)aurEff.GetAmount();
Unit caster = GetCaster();
if (caster != null)
@@ -730,22 +724,34 @@ namespace Scripts.Spells.Druid
healAmount = caster.SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, DamageEffectType.Heal, aurEff.GetSpellEffectInfo(), stack);
healAmount = GetTarget().SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, DamageEffectType.Heal, aurEff.GetSpellEffectInfo(), stack);
GetTarget().CastCustomSpell(GetTarget(), SpellIds.LifebloomFinalHeal, (int)healAmount, 0, 0, true, null, aurEff, GetCasterGUID());
// restore mana
var spellPowerCostList = GetSpellInfo().CalcPowerCost(caster, GetSpellInfo().GetSchoolMask());
var spellPowerCost = spellPowerCostList.Find(cost => cost.Power == PowerType.Mana);
if (spellPowerCost != null)
{
int returnMana = spellPowerCost.Amount * (int)stack / 2;
caster.CastCustomSpell(caster, SpellIds.LifebloomEnergize, returnMana, 0, 0, true, null, aurEff, GetCasterGUID());
CastSpellExtraArgs args1 = new(aurEff);
args1.OriginalCaster = GetCasterGUID();
args1.AddSpellMod(SpellValueMod.BasePoint0, (int)(spellPowerCost.Amount * stack / 2));
caster.CastSpell(caster, SpellIds.LifebloomEnergize, args1);
}
return;
}
GetTarget().CastCustomSpell(GetTarget(), SpellIds.LifebloomFinalHeal, (int)healAmount, 0, 0, true, null, aurEff, GetCasterGUID());
CastSpellExtraArgs args = new(aurEff);
args.OriginalCaster = GetCasterGUID();
args.AddSpellMod(SpellValueMod.BasePoint0, (int)healAmount);
target.CastSpell(target, SpellIds.LifebloomFinalHeal, args);
}
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
{
// Final heal only on duration end
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Expire)
return;
// final heal
OnRemoveEffect(GetTarget(), aurEff, GetStackAmount());
}
void HandleDispel(DispelInfo dispelInfo)
{
Unit target = GetUnitOwner();
@@ -753,29 +759,7 @@ namespace Scripts.Spells.Druid
{
AuraEffect aurEff = GetEffect(1);
if (aurEff != null)
{
// final heal
uint healAmount = (uint)aurEff.GetAmount();
Unit caster = GetCaster();
if (caster != null)
{
healAmount = caster.SpellHealingBonusDone(target, GetSpellInfo(), healAmount, DamageEffectType.Heal, aurEff.GetSpellEffectInfo(), dispelInfo.GetRemovedCharges());
healAmount = target.SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, DamageEffectType.Heal, aurEff.GetSpellEffectInfo(), dispelInfo.GetRemovedCharges());
target.CastCustomSpell(target, SpellIds.LifebloomFinalHeal, (int)healAmount, 0, 0, true, null, null, GetCasterGUID());
// restore mana
var spellPowerCostList = GetSpellInfo().CalcPowerCost(caster, GetSpellInfo().GetSchoolMask());
var spellPowerCost = spellPowerCostList.Find(cost => cost.Power == PowerType.Mana);
if (spellPowerCost != null)
{
int returnMana = spellPowerCost.Amount * dispelInfo.GetRemovedCharges() / 2;
caster.CastCustomSpell(caster, SpellIds.LifebloomEnergize, returnMana, 0, 0, true, null, null, GetCasterGUID());
}
return;
}
target.CastCustomSpell(target, SpellIds.LifebloomFinalHeal, (int)healAmount, 0, 0, true, null, null, GetCasterGUID());
}
OnRemoveEffect(target, aurEff, dispelInfo.GetRemovedCharges()); // final heal
}
}
@@ -797,8 +781,13 @@ namespace Scripts.Spells.Druid
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
int amount = (int)MathFunctions.CalculatePct(eventInfo.GetHealInfo().GetHeal(), aurEff.GetAmount());
GetTarget().CastCustomSpell(SpellIds.LivingSeedProc, SpellValueMod.BasePoint0, amount, eventInfo.GetProcTarget(), true, null, aurEff);
HealInfo healInfo = eventInfo.GetHealInfo();
if (healInfo == null || healInfo.GetHeal() == 0)
return;
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(healInfo.GetHeal(), aurEff.GetAmount()));
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.LivingSeedProc, args);
}
public override void Register()
@@ -818,7 +807,9 @@ namespace Scripts.Spells.Druid
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastCustomSpell(SpellIds.LivingSeedHeal, SpellValueMod.BasePoint0, aurEff.GetAmount(), GetTarget(), true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, aurEff.GetAmount());
GetTarget().CastSpell(GetTarget(), SpellIds.LivingSeedHeal, args);
}
public override void Register()
@@ -858,7 +849,7 @@ namespace Scripts.Spells.Druid
{
Unit target = GetTarget();
if (target.HasAura(SpellIds.BalanceT10Bonus))
target.CastSpell((Unit)null, SpellIds.BalanceT10BonusProc, true, null);
target.CastSpell(null, SpellIds.BalanceT10BonusProc, true);
}
public override void Register()
@@ -971,7 +962,7 @@ namespace Scripts.Spells.Druid
void AfterApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.CastSpell(target, SpellIds.SavageRoar, true, null, aurEff, GetCasterGUID());
target.CastSpell(target, SpellIds.SavageRoar, new CastSpellExtraArgs(aurEff, GetCasterGUID()));
}
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
@@ -1020,8 +1011,8 @@ namespace Scripts.Spells.Druid
if (GetTarget().GetShapeshiftForm() != ShapeShiftForm.CatForm || eventInfo.GetDamageInfo().GetSpellInfo().Id != SpellIds.FeralChargeCat)
return;
GetTarget().CastSpell(GetTarget(), Global.SpellMgr.GetSpellWithRank(SpellIds.StampedeCatRank1, GetSpellInfo().GetRank()), true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.StampedeCatState, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), Global.SpellMgr.GetSpellWithRank(SpellIds.StampedeCatRank1, GetSpellInfo().GetRank()), new CastSpellExtraArgs(aurEff));
GetTarget().CastSpell(GetTarget(), SpellIds.StampedeCatState, new CastSpellExtraArgs(aurEff));
}
void HandleEffectBearProc(AuraEffect aurEff, ProcEventInfo eventInfo)
@@ -1030,7 +1021,7 @@ namespace Scripts.Spells.Druid
if (GetTarget().GetShapeshiftForm() != ShapeShiftForm.BearForm || eventInfo.GetDamageInfo().GetSpellInfo().Id != SpellIds.FeralChargeBear)
return;
GetTarget().CastSpell(GetTarget(), Global.SpellMgr.GetSpellWithRank(SpellIds.StampedeBearRank1, GetSpellInfo().GetRank()), true, null, aurEff);
GetTarget().CastSpell(GetTarget(), Global.SpellMgr.GetSpellWithRank(SpellIds.StampedeBearRank1, GetSpellInfo().GetRank()), new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1120,7 +1111,9 @@ namespace Scripts.Spells.Druid
void AfterApply(AuraEffect aurEff, AuraEffectHandleModes mode)
{
Unit target = GetTarget();
target.CastSpell(target, SpellIds.SurvivalInstincts, true);
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, (int)target.CountPctFromMaxHealth(aurEff.GetAmount()));
target.CastSpell(target, SpellIds.SurvivalInstincts, args);
}
public override void Register()
@@ -1162,7 +1155,7 @@ namespace Scripts.Spells.Druid
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), SpellIds.BlessingOfTheClaw, true, null, aurEff);
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), SpellIds.BlessingOfTheClaw, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1193,7 +1186,9 @@ namespace Scripts.Spells.Druid
return;
int amount = MathFunctions.CalculatePct(spellPowerCost.Amount, aurEff.GetAmount());
caster.CastCustomSpell(SpellIds.Exhilarate, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
CastSpellExtraArgs args = new (aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell((Unit)null, SpellIds.Exhilarate, args);
}
public override void Register()
@@ -1214,7 +1209,7 @@ namespace Scripts.Spells.Druid
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.Infusion, true, null, aurEff);
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.Infusion, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1248,7 +1243,9 @@ namespace Scripts.Spells.Druid
// Add remaining ticks to damage done
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Languish, AuraType.PeriodicDamage);
caster.CastCustomSpell(SpellIds.Languish, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell(target, SpellIds.Languish, args);
}
public override void Register()
@@ -1329,7 +1326,9 @@ namespace Scripts.Spells.Druid
PreventDefaultAction();
int amount = (int)eventInfo.GetHealInfo().GetHeal();
eventInfo.GetActor().CastCustomSpell(SpellIds.RejuvenationT10Proc, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)eventInfo.GetHealInfo().GetHeal());
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.RejuvenationT10Proc, args);
}
public override void Register()
@@ -1354,7 +1353,7 @@ namespace Scripts.Spells.Druid
{
Unit caster = GetCaster();
caster.CastSpell(hitUnit, SpellIds.ThrashBearAura, TriggerCastFlags.FullMask);
caster.CastSpell(hitUnit, SpellIds.ThrashBearAura, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
}
@@ -1429,7 +1428,7 @@ namespace Scripts.Spells.Druid
Player player = GetTarget().ToPlayer();
if (triggeredSpellId != 0) // Apply new form
player.CastSpell(player, triggeredSpellId, true, null, aurEff);
player.CastSpell(player, triggeredSpellId, new CastSpellExtraArgs(aurEff));
else // If not set, simply remove Travel Form dummy
player.RemoveAura(SpellIds.TravelForm);
}
@@ -1512,7 +1511,7 @@ namespace Scripts.Spells.Druid
// Outdoor check already passed - Travel Form (dummy) has SPELL_ATTR0_OUTDOORS_ONLY attribute.
uint triggeredSpellId = spell_dru_travel_form_AuraScript.GetFormSpellId(player, GetCastDifficulty(), false);
player.CastSpell(player, triggeredSpellId, true, null, aurEff);
player.CastSpell(player, triggeredSpellId, new CastSpellExtraArgs(aurEff));
}
void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode)
+29 -20
View File
@@ -440,7 +440,7 @@ namespace Scripts.Spells.Generic
default:
return;
}
GetTarget().CastSpell(GetTarget(), spellId, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -752,7 +752,9 @@ namespace Scripts.Spells.Generic
PreventDefaultAction();
Unit caster = eventInfo.GetActionTarget();
caster.CastCustomSpell(SpellIds.BloodReserveHeal, SpellValueMod.BasePoint0, aurEff.GetAmount(), caster, TriggerCastFlags.FullMask, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, aurEff.GetAmount());
caster.CastSpell(caster, SpellIds.BloodReserveHeal, args);
caster.RemoveAura(SpellIds.BloodReserveAura);
}
@@ -979,7 +981,11 @@ namespace Scripts.Spells.Generic
Unit caster = GetCaster();
Unit target = GetHitUnit();
if (target)
caster.CastCustomSpell(target, SpellIds.ChaosBlast, basepoints0, 0, 0, true);
{
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, basepoints0);
caster.CastSpell(target, SpellIds.ChaosBlast, args);
}
}
public override void Register()
@@ -1393,7 +1399,7 @@ namespace Scripts.Spells.Generic
else
spellId = SpellIds.Normal;
GetCaster().CastSpell(GetHitUnit(), spellId, true, null);
GetCaster().CastSpell(GetHitUnit(), spellId, true);
}
public override void Register()
@@ -1514,7 +1520,7 @@ namespace Scripts.Spells.Generic
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.GenThrowInterrupt, true, null, aurEff);
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.GenThrowInterrupt, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1570,7 +1576,7 @@ namespace Scripts.Spells.Generic
return;
// final heal
GetTarget().CastSpell(GetTarget(), _spellId, true, null, aurEff, GetCasterGUID());
GetTarget().CastSpell(GetTarget(), _spellId, new CastSpellExtraArgs(aurEff, GetCasterGUID()));
}
public override void Register()
@@ -1700,7 +1706,7 @@ namespace Scripts.Spells.Generic
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
eventInfo.GetActionTarget().CastSpell((Unit)null, SpellIds.FallDown, true, null, aurEff);
eventInfo.GetActionTarget().CastSpell((Unit)null, SpellIds.FallDown, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1721,7 +1727,9 @@ namespace Scripts.Spells.Generic
{
PreventDefaultAction();
GetTarget().CastCustomSpell(GetSpellInfo().GetEffect(aurEff.GetEffIndex()).TriggerSpell, SpellValueMod.MaxTargets, (int)(aurEff.GetTickNumber() / 10 + 1), null, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.MaxTargets, (int)aurEff.GetTickNumber() / 10 + 1);
GetTarget().CastSpell((Unit)null, GetSpellInfo().GetEffect(aurEff.GetEffIndex()).TriggerSpell, args);
}
public override void Register()
@@ -1863,7 +1871,7 @@ namespace Scripts.Spells.Generic
default:
return;
}
GetTarget().CastSpell(GetTarget(), spellId, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1947,7 +1955,7 @@ namespace Scripts.Spells.Generic
if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Expire)
return;
GetTarget().CastSpell((Unit)null, SpellIds.Paralysis, true, null, aurEff);
GetTarget().CastSpell((Unit)null, SpellIds.Paralysis, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -2117,10 +2125,10 @@ namespace Scripts.Spells.Generic
switch (caster.GetTeam())
{
case Team.Alliance:
caster.CastSpell(caster, SpellIds.PvpTrinketAlliance, TriggerCastFlags.FullMask);
caster.CastSpell(caster, SpellIds.PvpTrinketAlliance, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
break;
case Team.Horde:
caster.CastSpell(caster, SpellIds.PvpTrinketHorde, TriggerCastFlags.FullMask);
caster.CastSpell(caster, SpellIds.PvpTrinketHorde, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
break;
}
}
@@ -2334,7 +2342,7 @@ namespace Scripts.Spells.Generic
{
// Definitely not a good thing, but currently the only way to do something at cast start
// Should be replaced as soon as possible with a new hook: BeforeCastStart
GetCaster().CastSpell(GetCaster(), SpellIds.AlteredForm, TriggerCastFlags.FullMask);
GetCaster().CastSpell(GetCaster(), SpellIds.AlteredForm, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
return false;
}
@@ -2363,7 +2371,7 @@ namespace Scripts.Spells.Generic
// cast speed aura
MountCapabilityRecord mountCapability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount());
if (mountCapability != null)
target.CastSpell(target, mountCapability.ModSpellAuraID, TriggerCastFlags.FullMask);
target.CastSpell(target, mountCapability.ModSpellAuraID, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -2400,7 +2408,7 @@ namespace Scripts.Spells.Generic
if (target.HasAuraType(AuraType.WorgenAlteredForm))
target.RemoveAurasByType(AuraType.WorgenAlteredForm);
else // Basepoints 1 for this aura control whether to trigger transform transition animation or not.
target.CastCustomSpell(SpellIds.AlteredForm, SpellValueMod.BasePoint0, 1, target, TriggerCastFlags.FullMask);
target.CastSpell(target, SpellIds.AlteredForm, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, 1));
}
public override void Register()
@@ -2415,7 +2423,7 @@ namespace Scripts.Spells.Generic
{
void TriggerTransform()
{
GetCaster().CastSpell(GetCaster(), SpellIds.AlteredForm, TriggerCastFlags.FullMask);
GetCaster().CastSpell(GetCaster(), SpellIds.AlteredForm, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -2746,7 +2754,7 @@ namespace Scripts.Spells.Generic
// on stack 15 cast the achievement crediting spell
if (GetStackAmount() >= 15)
target.CastSpell(target, SpellIds.TurkeyVengeance, true, null, aurEff, GetCasterGUID());
target.CastSpell(target, SpellIds.TurkeyVengeance, new CastSpellExtraArgs(aurEff, GetCasterGUID()));
}
void OnPeriodic(AuraEffect aurEff)
@@ -2811,8 +2819,9 @@ namespace Scripts.Spells.Generic
return;
Unit caster = eventInfo.GetActor();
int bp = (int)(damageInfo.GetDamage() / 2);
caster.CastCustomSpell(SpellIds.VampiricTouchHeal, SpellValueMod.BasePoint0, bp, caster, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)damageInfo.GetDamage() / 2);
caster.CastSpell(caster, SpellIds.VampiricTouchHeal, args);
}
public override void Register()
@@ -3462,7 +3471,7 @@ namespace Scripts.Spells.Generic
if (target.GetPower(PowerType.Mana) == 0)
{
target.CastSpell(target, SpellIds.MarkOfKazrogalDamageHellfire, true, null, aurEff);
target.CastSpell(target, SpellIds.MarkOfKazrogalDamageHellfire, new CastSpellExtraArgs(aurEff));
// Remove aura
SetDuration(0);
}
+18 -11
View File
@@ -540,19 +540,26 @@ namespace Scripts.Spells.Holiday
}
break;
case SpellIds.RamCanter:
target.CastCustomSpell(SpellIds.RamFatigue, SpellValueMod.AuraStack, 1, target, TriggerCastFlags.FullMask);
if (aurEff.GetTickNumber() == 8)
target.CastSpell(target, QuestIds.BrewfestSpeedBunnyYellow, true);
break;
{
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.AuraStack, 1);
target.CastSpell(target, SpellIds.RamFatigue, args);
if (aurEff.GetTickNumber() == 8)
target.CastSpell(target, QuestIds.BrewfestSpeedBunnyYellow, true);
break;
}
case SpellIds.RamGallop:
target.CastCustomSpell(SpellIds.RamFatigue, SpellValueMod.AuraStack, target.HasAura(SpellIds.RamFatigue) ? 4 : 5 /*Hack*/, target, TriggerCastFlags.FullMask);
if (aurEff.GetTickNumber() == 8)
target.CastSpell(target, QuestIds.BrewfestSpeedBunnyRed, true);
break;
{
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(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);
break;
}
default:
break;
}
}
public override void Register()
@@ -623,7 +630,7 @@ namespace Scripts.Spells.Holiday
PreventHitDefaultEffect(effIndex);
// All this spells trigger a spell that requires reagents; if the
// triggered spell is cast as "triggered", reagents are not consumed
GetHitUnit().CastSpell(null, GetEffectInfo().TriggerSpell, TriggerCastFlags.FullMask & ~TriggerCastFlags.IgnorePowerAndReagentCost);
GetHitUnit().CastSpell((Unit)null, GetEffectInfo().TriggerSpell, new CastSpellExtraArgs(TriggerCastFlags.FullMask & ~TriggerCastFlags.IgnorePowerAndReagentCost));
}
public override void Register()
@@ -643,7 +650,7 @@ namespace Scripts.Spells.Holiday
if (aura != null)
{
aura.SetDuration(aura.GetDuration() + 30 * Time.InMilliseconds);
GetCaster().CastSpell(GetHitUnit(), SpellIds.RelayRaceTurnIn, TriggerCastFlags.FullMask);
GetCaster().CastSpell(GetHitUnit(), SpellIds.RelayRaceTurnIn, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
}
+11 -7
View File
@@ -116,8 +116,9 @@ namespace Scripts.Spells.Hunter
void HandleDummy(uint effIndex)
{
Unit caster = GetCaster();
int healthModSpellBasePoints0 = (int)caster.CountPctFromMaxHealth(30);
caster.CastCustomSpell(caster, SpellIds.PetLastStandTriggered, healthModSpellBasePoints0, 0, 0, true, null);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)caster.CountPctFromMaxHealth(30));
caster.CastSpell(caster, SpellIds.PetLastStandTriggered, args);
}
public override void Register()
@@ -215,7 +216,7 @@ namespace Scripts.Spells.Hunter
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.MisdirectionProc, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.MisdirectionProc, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -265,7 +266,9 @@ namespace Scripts.Spells.Hunter
{
if (!caster.HasAura(SpellIds.PetHeartOfThePhoenixDebuff))
{
owner.CastCustomSpell(SpellIds.PetHeartOfThePhoenixTriggered, SpellValueMod.BasePoint0, 100, caster, true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, 100);
owner.CastSpell(caster, SpellIds.PetHeartOfThePhoenixTriggered, args);
caster.CastSpell(caster, SpellIds.PetHeartOfThePhoenixDebuff, true);
}
}
@@ -301,8 +304,9 @@ namespace Scripts.Spells.Hunter
{
PreventDefaultAction();
int damage = (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount());
eventInfo.GetActor().CastCustomSpell(SpellIds.RoarOfSacrificeTriggered, SpellValueMod.BasePoint0, damage, GetCaster(), TriggerCastFlags.FullMask, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()));
eventInfo.GetActor().CastSpell(GetCaster(), SpellIds.RoarOfSacrificeTriggered, args);
}
public override void Register()
@@ -422,7 +426,7 @@ namespace Scripts.Spells.Hunter
PreventDefaultAction();
Unit caster = eventInfo.GetActor();
caster.CastSpell(caster.ToPlayer().GetPet(), SpellIds.T94PGreatness, true, null, aurEff);
caster.CastSpell(caster.ToPlayer().GetPet(), SpellIds.T94PGreatness, new CastSpellExtraArgs(aurEff));
}
public override void Register()
+80 -66
View File
@@ -500,7 +500,7 @@ namespace Scripts.Spells.Items
Unit caster = GetCaster();
Item item = GetCastItem();
if (item)
caster.CastSpell(caster, _triggeredSpellId, true, item);
caster.CastSpell(caster, _triggeredSpellId, new CastSpellExtraArgs(item));
}
public override void Register()
@@ -522,7 +522,7 @@ namespace Scripts.Spells.Items
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.AegisHeal, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.AegisHeal, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -546,7 +546,7 @@ namespace Scripts.Spells.Items
if (!GetCaster() || !GetTarget().IsTypeId(TypeId.Unit))
return;
GetCaster().CastSpell(GetCaster(), SpellIds.EyeOfGrillok, true, null, aurEff);
GetCaster().CastSpell(GetCaster(), SpellIds.EyeOfGrillok, new CastSpellExtraArgs(aurEff));
GetTarget().ToCreature().DespawnOrUnsummon();
}
@@ -592,7 +592,10 @@ namespace Scripts.Spells.Items
if (spellId == 0)
return;
GetTarget().CastCustomSpell(spellId, SpellValueMod.BasePoint0, amount, GetTarget(), true, null, aurEff);
Unit caster = eventInfo.GetActionTarget();
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell((Unit)null, spellId, args);
}
public override void Register()
@@ -638,7 +641,7 @@ namespace Scripts.Spells.Items
if (player.GetWeaponForAttack(WeaponAttackType.OffAttack, true) && RandomHelper.URand(0, 1) != 0)
spellId = SpellIds.ManifestAngerOffHand;
caster.CastSpell(target, spellId, true, null, aurEff);
caster.CastSpell(target, spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -708,7 +711,7 @@ namespace Scripts.Spells.Items
PreventDefaultAction();
Unit caster = eventInfo.GetActor();
uint spellId = triggeredSpells[(int)caster.GetClass()].SelectRandom();
caster.CastSpell(caster, spellId, true, null, aurEff);
caster.CastSpell(caster, spellId, new CastSpellExtraArgs(aurEff));
if (RandomHelper.randChance(10))
caster.Say(TextIds.SayMadness);
@@ -731,7 +734,7 @@ namespace Scripts.Spells.Items
void HandlePeriodicDummy(AuraEffect aurEff)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), RandomHelper.RAND(SpellIds.DementiaPos, SpellIds.DementiaNeg), true, null, aurEff);
GetTarget().CastSpell(GetTarget(), RandomHelper.RAND(SpellIds.DementiaPos, SpellIds.DementiaNeg), new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -772,7 +775,11 @@ namespace Scripts.Spells.Items
protEff.GetBase().RefreshDuration();
}
else
GetTarget().CastCustomSpell(SpellIds.ProtectionOfAncientKings, SpellValueMod.BasePoint0, absorb, eventInfo.GetProcTarget(), true, null, aurEff);
{
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, absorb);
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.ProtectionOfAncientKings, args);
}
}
public override void Register()
@@ -822,7 +829,9 @@ namespace Scripts.Spells.Items
void HandleDummy(uint effIndex)
{
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.DeadlyPrecision, GetCastDifficulty());
GetCaster().CastCustomSpell(spellInfo.Id, SpellValueMod.AuraStack, (int)spellInfo.StackAmount, GetCaster(), true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.AuraStack, (int)spellInfo.StackAmount);
GetCaster().CastSpell(GetCaster(), spellInfo.Id, args);
}
public override void Register()
@@ -891,7 +900,7 @@ namespace Scripts.Spells.Items
return;
uint spellId = randomSpells.SelectRandom();
caster.CastSpell(caster, spellId, true, null, aurEff);
caster.CastSpell(caster, spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -964,7 +973,7 @@ namespace Scripts.Spells.Items
{
PreventHitDefaultEffect(effIndex);
if (_failSpell != 0)
GetCaster().CastSpell(GetCaster(), _failSpell, true, GetCastItem());
GetCaster().CastSpell(GetCaster(), _failSpell, new CastSpellExtraArgs(GetCastItem()));
}
}
@@ -988,7 +997,7 @@ namespace Scripts.Spells.Items
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.DesperateRage, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.DesperateRage, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1015,7 +1024,7 @@ namespace Scripts.Spells.Items
{
Unit caster = GetCaster();
uint spellId = RandomHelper.URand(SpellIds.Sleepy, SpellIds.HealthySpirit);
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
public override void Register()
@@ -1035,7 +1044,7 @@ namespace Scripts.Spells.Items
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.DiscerningEyeBeast, true, null, aurEff);
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.DiscerningEyeBeast, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1184,9 +1193,10 @@ namespace Scripts.Spells.Items
if (damageInfo == null || damageInfo.GetDamage() == 0)
return;
int amount = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
Unit caster = eventInfo.GetActor();
caster.CastCustomSpell(SpellIds.Shadowmend, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
caster.CastSpell((Unit)null, SpellIds.Shadowmend, args);
}
public override void Register()
@@ -1270,7 +1280,7 @@ namespace Scripts.Spells.Items
return;
}
caster.CastSpell((Unit)null, spellId, true, null, aurEff);
caster.CastSpell((Unit)null, spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1346,7 +1356,7 @@ namespace Scripts.Spells.Items
spellId = SpellIds.TinyMagicalCrawdad;
break;
}
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
public override void Register()
@@ -1372,7 +1382,7 @@ namespace Scripts.Spells.Items
// in that case, do not cast heal spell
PreventDefaultAction();
// but mana instead
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.MarkOfConquestEnergize, true, null, aurEff);
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.MarkOfConquestEnergize, new CastSpellExtraArgs(aurEff));
}
}
@@ -1445,8 +1455,9 @@ namespace Scripts.Spells.Items
if (damageInfo == null || damageInfo.GetDamage() == 0)
return;
int bp = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
GetTarget().CastCustomSpell(SpellIds.ItemNecroticTouchProc, SpellValueMod.BasePoint0, bp, eventInfo.GetProcTarget(), true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
GetTarget().CastSpell((Unit)null, SpellIds.ItemNecroticTouchProc, args);
}
public override void Register()
@@ -1477,7 +1488,7 @@ namespace Scripts.Spells.Items
else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
spellId = SpellIds.NetOMaticTriggered2;
GetCaster().CastSpell(target, spellId, true, null);
GetCaster().CastSpell(target, spellId, true);
}
}
@@ -1515,7 +1526,7 @@ namespace Scripts.Spells.Items
break;
}
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
public override void Register()
@@ -1572,7 +1583,9 @@ namespace Scripts.Spells.Items
if (shield.GetAmount() > bp0)
return;
caster.CastCustomSpell(SpellIds.PersistentShieldTriggered, SpellValueMod.BasePoint0, bp0, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, bp0);
caster.CastSpell(target, SpellIds.PersistentShieldTriggered, args);
}
public override void Register()
@@ -1599,9 +1612,9 @@ namespace Scripts.Spells.Items
if (damageInfo == null || damageInfo.GetDamage() == 0)
return;
int bp = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
Unit caster = eventInfo.GetActor();
caster.CastCustomSpell(SpellIds.HealthLink, SpellValueMod.BasePoint0, bp, null, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
eventInfo.GetActor().CastSpell((Unit)null, SpellIds.HealthLink, args);
}
public override void Register()
@@ -1652,7 +1665,7 @@ namespace Scripts.Spells.Items
// Yaaarrrr - pirate
case 2: spellId = (caster.GetGender() == Gender.Male ? SpellIds.YaaarrrrMale : SpellIds.YaaarrrrFemale); break;
}
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
public override void Register()
@@ -1745,7 +1758,7 @@ namespace Scripts.Spells.Items
if (!caster || !target)
return;
caster.CastSpell(target, SpellIds.SoulFeast, TriggerCastFlags.FullMask);
caster.CastSpell(target, SpellIds.SoulFeast, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -1772,7 +1785,7 @@ namespace Scripts.Spells.Items
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.ShadowmourneSoulFragment, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.ShadowmourneSoulFragment, new CastSpellExtraArgs(aurEff));
// this can't be handled in AuraScript of SoulFragments because we need to know victim
Aura soulFragments = GetTarget().GetAura(SpellIds.ShadowmourneSoulFragment);
@@ -1780,7 +1793,7 @@ namespace Scripts.Spells.Items
{
if (soulFragments.GetStackAmount() >= 10)
{
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.ShadowmourneChaosBaneDamage, true, null, aurEff);
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.ShadowmourneChaosBaneDamage, new CastSpellExtraArgs(aurEff));
soulFragments.Remove();
}
}
@@ -1873,7 +1886,7 @@ namespace Scripts.Spells.Items
target = caster;
}
caster.CastSpell(target, spellId, true, GetCastItem());
caster.CastSpell(target, spellId, new CastSpellExtraArgs(GetCastItem()));
}
}
@@ -1896,8 +1909,9 @@ namespace Scripts.Spells.Items
PreventDefaultAction();
Unit caster = eventInfo.GetActor();
int amount = (int)caster.CountPctFromMaxHealth(aurEff.GetAmount());
caster.CastCustomSpell(SpellIds.SwiftHandOfJusticeHeal, SpellValueMod.BasePoint0, amount, null, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)caster.CountPctFromMaxHealth(aurEff.GetAmount()));
caster.CastSpell((Unit)null, SpellIds.SwiftHandOfJusticeHeal, args);
}
public override void Register()
@@ -1949,7 +1963,7 @@ namespace Scripts.Spells.Items
spellId = SpellIds.UnderbellyElixirTriggered2;
break;
}
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
public override void Register()
@@ -2261,7 +2275,7 @@ namespace Scripts.Spells.Items
void HandleDummy(uint effIndex)
{
Unit caster = GetCaster();
caster.CastSpell(caster, RandomHelper.randChance(50) ? SpellIds.SummonPurifiedHelboarMeat : SpellIds.SummonToxicHelboarMeat, true, null);
caster.CastSpell(caster, RandomHelper.randChance(50) ? SpellIds.SummonPurifiedHelboarMeat : SpellIds.SummonToxicHelboarMeat, true);
}
public override void Register()
@@ -2357,9 +2371,9 @@ namespace Scripts.Spells.Items
if (castItem)
{
if (RandomHelper.randChance(86)) // Nigh-Invulnerability - success
caster.CastSpell(caster, SpellIds.NighInvulnerability, true, castItem);
caster.CastSpell(caster, SpellIds.NighInvulnerability, new CastSpellExtraArgs(castItem));
else // Complete Vulnerability - backfire in 14% casts
caster.CastSpell(caster, SpellIds.CompleteVulnerability, true, castItem);
caster.CastSpell(caster, SpellIds.CompleteVulnerability, new CastSpellExtraArgs(castItem));
}
}
@@ -2380,7 +2394,7 @@ namespace Scripts.Spells.Items
void HandleDummy(uint effIndex)
{
if (GetCastItem() && GetHitUnit())
GetCaster().CastSpell(GetHitUnit(), RandomHelper.randChance(80) ? SpellIds.PoultryizerSuccess : SpellIds.PoultryizerBackfire, true, GetCastItem());
GetCaster().CastSpell(GetHitUnit(), RandomHelper.randChance(80) ? SpellIds.PoultryizerSuccess : SpellIds.PoultryizerBackfire, new CastSpellExtraArgs(GetCastItem()));
}
public override void Register()
@@ -2481,7 +2495,7 @@ namespace Scripts.Spells.Items
GetHitCreature().DespawnOrUnsummon();
//cast spell Raptor Capture Credit
caster.CastSpell(caster, SpellIds.RaptorCaptureCredit, true, null);
caster.CastSpell(caster, SpellIds.RaptorCaptureCredit, true);
}
}
@@ -2583,7 +2597,7 @@ namespace Scripts.Spells.Items
bool success = true;
if (areaEntry != null && areaEntry.IsFlyable() && !caster.GetMap().IsDungeon())
success = RandomHelper.randChance(95);
caster.CastSpell(caster, success ? SpellIds.NitroBoostsSuccess : SpellIds.NitroBoostsBackfire, true, GetCastItem());
caster.CastSpell(caster, success ? SpellIds.NitroBoostsSuccess : SpellIds.NitroBoostsBackfire, new CastSpellExtraArgs(GetCastItem()));
}
public override void Register()
@@ -2612,7 +2626,7 @@ namespace Scripts.Spells.Items
if (curZ < lastZ)
{
if (RandomHelper.randChance(80)) // we don't have enough sniffs to verify this, guesstimate
GetTarget().CastSpell(GetTarget(), SpellIds.NitroBoostsParachute, true, null, effect);
GetTarget().CastSpell(GetTarget(), SpellIds.NitroBoostsParachute, new CastSpellExtraArgs(effect));
GetAura().Remove();
}
else
@@ -2677,7 +2691,7 @@ namespace Scripts.Spells.Items
bg.EventPlayerDroppedFlag(caster);
caster.GetSpellHistory().ResetCooldown(SpellIds.RocketBootsProc);
caster.CastSpell(caster, SpellIds.RocketBootsProc, true, null);
caster.CastSpell(caster, SpellIds.RocketBootsProc, true);
}
SpellCastResult CheckCast()
@@ -2836,10 +2850,10 @@ namespace Scripts.Spells.Items
Unit target = eventInfo.GetProcTarget();
if (eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.DoneSpellMagicDmgClassPos))
caster.CastSpell(target, _healProcSpellId, true, null, aurEff);
caster.CastSpell(target, _healProcSpellId, new CastSpellExtraArgs(aurEff));
if (eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.DoneSpellMagicDmgClassNeg))
caster.CastSpell(target, _damageProcSpellId, true, null, aurEff);
caster.CastSpell(target, _damageProcSpellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -2868,16 +2882,16 @@ namespace Scripts.Spells.Items
switch (caster.GetClass())
{
case Class.Druid:
caster.CastSpell(caster, SpellIds.SoulPreserverDruid, true, null, aurEff);
caster.CastSpell(caster, SpellIds.SoulPreserverDruid, new CastSpellExtraArgs(aurEff));
break;
case Class.Paladin:
caster.CastSpell(caster, SpellIds.SoulPreserverPaladin, true, null, aurEff);
caster.CastSpell(caster, SpellIds.SoulPreserverPaladin, new CastSpellExtraArgs(aurEff));
break;
case Class.Priest:
caster.CastSpell(caster, SpellIds.SoulPreserverPriest, true, null, aurEff);
caster.CastSpell(caster, SpellIds.SoulPreserverPriest, new CastSpellExtraArgs(aurEff));
break;
case Class.Shaman:
caster.CastSpell(caster, SpellIds.SoulPreserverShaman, true, null, aurEff);
caster.CastSpell(caster, SpellIds.SoulPreserverShaman, new CastSpellExtraArgs(aurEff));
break;
default:
break;
@@ -2923,10 +2937,10 @@ namespace Scripts.Spells.Items
// Aggression checks are in the spell system... just cast and forget
if (player.GetReputationRank(FactionIds.Aldor) == ReputationRank.Exalted)
player.CastSpell(target, _aldorSpellId, true, null, aurEff);
player.CastSpell(target, _aldorSpellId, new CastSpellExtraArgs(aurEff));
if (player.GetReputationRank(FactionIds.Scryers) == ReputationRank.Exalted)
player.CastSpell(target, _scryersSpellId, true, null, aurEff);
player.CastSpell(target, _scryersSpellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -2987,17 +3001,17 @@ namespace Scripts.Spells.Items
case SpellIds.DeathChoiceNormalAura:
{
if (str > agi)
caster.CastSpell(caster, SpellIds.DeathChoiceNormalStrength, true, null, aurEff);
caster.CastSpell(caster, SpellIds.DeathChoiceNormalStrength, new CastSpellExtraArgs(aurEff));
else
caster.CastSpell(caster, SpellIds.DeathChoiceNormalAgility, true, null, aurEff);
caster.CastSpell(caster, SpellIds.DeathChoiceNormalAgility, new CastSpellExtraArgs(aurEff));
break;
}
case SpellIds.DeathChoiceHeroicAura:
{
if (str > agi)
caster.CastSpell(caster, SpellIds.DeathChoiceHeroicStrength, true, null, aurEff);
caster.CastSpell(caster, SpellIds.DeathChoiceHeroicStrength, new CastSpellExtraArgs(aurEff));
else
caster.CastSpell(caster, SpellIds.DeathChoiceHeroicAgility, true, null, aurEff);
caster.CastSpell(caster, SpellIds.DeathChoiceHeroicAgility, new CastSpellExtraArgs(aurEff));
break;
}
default:
@@ -3034,7 +3048,7 @@ namespace Scripts.Spells.Items
Unit caster = eventInfo.GetActor();
caster.CastSpell(caster, _stackSpell, true, null, aurEff); // cast the stack
caster.CastSpell(caster, _stackSpell, new CastSpellExtraArgs(aurEff)); // cast the stack
Aura dummy = caster.GetAura(_stackSpell); // retrieve aura
@@ -3046,7 +3060,7 @@ namespace Scripts.Spells.Items
caster.RemoveAurasDueToSpell(_stackSpell);
Unit target = eventInfo.GetActionTarget();
if (target)
caster.CastSpell(target, _triggerSpell, true, null, aurEff);
caster.CastSpell(target, _triggerSpell, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -3103,7 +3117,7 @@ namespace Scripts.Spells.Items
stat = vers;
}
caster.CastSpell(caster, spellTrigger, true, null, aurEff);
caster.CastSpell(caster, spellTrigger, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -3128,10 +3142,10 @@ namespace Scripts.Spells.Items
Unit target = eventInfo.GetActionTarget();
if (caster.IsAlive())
caster.CastSpell(caster, SpellIds.ManaDrainEnergize, true, null, aurEff);
caster.CastSpell(caster, SpellIds.ManaDrainEnergize, new CastSpellExtraArgs(aurEff));
if (target && target.IsAlive())
caster.CastSpell(target, SpellIds.ManaDrainLeech, true, null, aurEff);
caster.CastSpell(target, SpellIds.ManaDrainLeech, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -3199,7 +3213,7 @@ namespace Scripts.Spells.Items
if (target)
{
if (RandomHelper.randChance(95))
caster.CastSpell(target, RandomHelper.randChance(32) ? SpellIds.Dullard : SpellIds.GnomishMindControlCap, true, GetCastItem());
caster.CastSpell(target, RandomHelper.randChance(32) ? SpellIds.Dullard : SpellIds.GnomishMindControlCap, new CastSpellExtraArgs(GetCastItem()));
else
target.CastSpell(caster, SpellIds.GnomishMindControlCap, true); // backfire - 5% chance
}
@@ -3233,11 +3247,11 @@ namespace Scripts.Spells.Items
{
uint chance = RandomHelper.URand(0, 99);
if (chance < 15)
GetCaster().CastSpell(target, SpellIds.TargetLock, true, GetCastItem());
GetCaster().CastSpell(target, SpellIds.TargetLock, new CastSpellExtraArgs(GetCastItem()));
else if (chance < 25)
GetCaster().CastSpell(target, SpellIds.MobilityMalfunction, true, GetCastItem());
GetCaster().CastSpell(target, SpellIds.MobilityMalfunction, new CastSpellExtraArgs(GetCastItem()));
else
GetCaster().CastSpell(target, SpellIds.ControlMachine, true, GetCastItem());
GetCaster().CastSpell(target, SpellIds.ControlMachine, new CastSpellExtraArgs(GetCastItem()));
}
}
@@ -3521,7 +3535,7 @@ namespace Scripts.Spells.Items
}
if (useElixir)
target.CastSpell(target, chosenElixir, true, GetCastItem());
target.CastSpell(target, chosenElixir, new CastSpellExtraArgs(GetCastItem()));
}
public override void Register()
@@ -3559,7 +3573,7 @@ namespace Scripts.Spells.Items
uint chosenElixir = availableElixirs.SelectRandom();
target.CastSpell(target, chosenElixir, true, GetCastItem());
target.CastSpell(target, chosenElixir, new CastSpellExtraArgs(GetCastItem()));
}
public override void Register()
+16 -11
View File
@@ -157,9 +157,9 @@ namespace Scripts.Spells.Mage
}
GetTarget().SetHealth(GetTarget().CountPctFromMaxHealth(effectInfo.GetAmount()));
GetTarget().CastSpell(GetTarget(), GetSpellInfo().GetEffect(2).TriggerSpell, TriggerCastFlags.FullMask);
GetTarget().CastSpell(GetTarget(), SpellIds.CauterizeDot, TriggerCastFlags.FullMask);
GetTarget().CastSpell(GetTarget(), SpellIds.Cauterized, TriggerCastFlags.FullMask);
GetTarget().CastSpell(GetTarget(), GetSpellInfo().GetEffect(2).TriggerSpell, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
GetTarget().CastSpell(GetTarget(), SpellIds.CauterizeDot, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
GetTarget().CastSpell(GetTarget(), SpellIds.Cauterized, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -268,7 +268,7 @@ namespace Scripts.Spells.Mage
void Trigger(AuraEffect aurEff, ProcEventInfo eventInfo)
{
eventInfo.GetActor().CastSpell(GetTarget(), SpellIds.FingersOfFrost, true, null, aurEff);
eventInfo.GetActor().CastSpell(GetTarget(), SpellIds.FingersOfFrost, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -356,7 +356,9 @@ namespace Scripts.Spells.Mage
}
// put target index for chain value multiplier into EFFECT_1 base points, otherwise triggered spell doesn't know which damage multiplier to apply
caster.CastCustomSpell(SpellIds.IceLanceTrigger, SpellValueMod.BasePoint1, index, target, true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.BasePoint1, index);
caster.CastSpell(target, SpellIds.IceLanceTrigger, args);
}
public override void Register()
@@ -409,7 +411,10 @@ namespace Scripts.Spells.Mage
int amount = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), pct) / igniteDot.GetMaxTicks());
amount += (int)eventInfo.GetProcTarget().GetRemainingPeriodicAmount(eventInfo.GetActor().GetGUID(), SpellIds.Ignite, AuraType.PeriodicDamage);
GetTarget().CastCustomSpell(SpellIds.Ignite, SpellValueMod.BasePoint0, amount, eventInfo.GetProcTarget(), true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.Ignite, args);
}
public override void Register()
@@ -451,7 +456,7 @@ namespace Scripts.Spells.Mage
void HandleDummy(uint effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster().CastCustomSpell(SpellIds.LivingBombPeriodic, SpellValueMod.BasePoint2, 1, GetHitUnit(), TriggerCastFlags.FullMask);
GetCaster().CastSpell(GetHitUnit(), SpellIds.LivingBombPeriodic, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint2, 1));
}
public override void Register()
@@ -476,7 +481,7 @@ namespace Scripts.Spells.Mage
void HandleSpread(uint effIndex)
{
if (GetSpellValue().EffectBasePoints[0] > 0)
GetCaster().CastCustomSpell(SpellIds.LivingBombPeriodic, SpellValueMod.BasePoint2, 0, GetHitUnit(), TriggerCastFlags.FullMask);
GetCaster().CastSpell(GetHitUnit(), SpellIds.LivingBombPeriodic, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint2, 0));
}
public override void Register()
@@ -501,7 +506,7 @@ namespace Scripts.Spells.Mage
Unit caster = GetCaster();
if (caster)
caster.CastCustomSpell(SpellIds.LivingBombExplosion, SpellValueMod.BasePoint0, aurEff.GetAmount(), GetTarget(), TriggerCastFlags.FullMask);
caster.CastSpell(GetTarget(), SpellIds.LivingBombExplosion, new CastSpellExtraArgs (TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount()));
}
public override void Register()
@@ -574,7 +579,7 @@ namespace Scripts.Spells.Mage
{
TempSummon ringOfFrost = GetRingOfFrostMinion();
if (ringOfFrost)
GetTarget().CastSpell(ringOfFrost.GetPositionX(), ringOfFrost.GetPositionY(), ringOfFrost.GetPositionZ(), SpellIds.RingOfFrostFreeze, true);
GetTarget().CastSpell(ringOfFrost.GetPosition(), SpellIds.RingOfFrostFreeze, new CastSpellExtraArgs(true));
}
void Apply(AuraEffect aurEff, AuraEffectHandleModes mode)
@@ -729,7 +734,7 @@ namespace Scripts.Spells.Mage
Unit caster = GetCaster();
if (caster != null)
caster.CastCustomSpell(SpellIds.TouchOfTheMagiExplode, SpellValueMod.BasePoint0, amount, GetTarget(), TriggerCastFlags.FullMask);
caster.CastSpell(GetTarget(), SpellIds.TouchOfTheMagiExplode, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, amount));
}
public override void Register()
+3 -3
View File
@@ -49,7 +49,7 @@ namespace Scripts.Spells.Monk
Unit caster = GetCaster();
if (caster)
if (caster.HasAura(SpellIds.StanceOfTheSpiritedCrane))
caster.CastSpell(caster, SpellIds.CracklingJadeLightningChiProc, TriggerCastFlags.FullMask);
caster.CastSpell(caster, SpellIds.CracklingJadeLightningChiProc, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -83,8 +83,8 @@ namespace Scripts.Spells.Monk
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
GetTarget().CastSpell(eventInfo.GetActor(), SpellIds.CracklingJadeLightningKnockback, TriggerCastFlags.FullMask);
GetTarget().CastSpell(GetTarget(), SpellIds.CracklingJadeLightningKnockbackCd, TriggerCastFlags.FullMask);
GetTarget().CastSpell(eventInfo.GetActor(), SpellIds.CracklingJadeLightningKnockback, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
GetTarget().CastSpell(GetTarget(), SpellIds.CracklingJadeLightningKnockbackCd, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
+13 -7
View File
@@ -434,7 +434,7 @@ namespace Scripts.Spells.Paladin
{
Unit caster = GetCaster();
if (caster.HasSpell(SpellIds.JudgementProtRetR3))
caster.CastSpell(caster, SpellIds.JudementGainHolyPower, TriggerCastFlags.FullMask);
caster.CastSpell(caster, SpellIds.JudementGainHolyPower, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -517,7 +517,7 @@ namespace Scripts.Spells.Paladin
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.ItemHealingTrance, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.ItemHealingTrance, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -560,7 +560,7 @@ namespace Scripts.Spells.Paladin
return;
if (RandomHelper.randChance(chance))
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), spellId, true, null, aurEff);
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -640,7 +640,11 @@ namespace Scripts.Spells.Paladin
{
List<AuraApplication> applications = eff.GetApplicationList();
if (!applications.Empty())
eventInfo.GetActor().CastCustomSpell(SpellIds.BeaconOfLightHeal, SpellValueMod.BasePoint0, (int)heal, applications.First().GetTarget(), true);
{
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)heal);
eventInfo.GetActor().CastSpell(applications[0].GetTarget(), SpellIds.BeaconOfLightHeal, args);
}
return;
}
}
@@ -784,7 +788,7 @@ namespace Scripts.Spells.Paladin
return;
}
caster.CastSpell(target, spellId, true, null, aurEff);
caster.CastSpell(target, spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -818,7 +822,9 @@ namespace Scripts.Spells.Paladin
// Add remaining ticks to damage done
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.HolyMending, AuraType.PeriodicHeal);
caster.CastCustomSpell(SpellIds.HolyMending, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell(target, SpellIds.HolyMending, args);
}
public override void Register()
@@ -838,7 +844,7 @@ namespace Scripts.Spells.Paladin
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo procInfo)
{
Unit target = GetTarget();
target.CastCustomSpell(SpellIds.ZealAura, SpellValueMod.AuraStack, aurEff.GetAmount(), target, true);
target.CastSpell(target, SpellIds.ZealAura, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.AuraStack, aurEff.GetAmount()));
PreventDefaultAction();
}
+43 -25
View File
@@ -87,8 +87,9 @@ namespace Scripts.Spells.Priest
if (healInfo == null || healInfo.GetHeal() == 0)
return;
int amount = (int)MathFunctions.CalculatePct(healInfo.GetHeal(), 10);
caster.CastCustomSpell(SpellIds.OracularHeal, SpellValueMod.BasePoint0, amount, caster, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(healInfo.GetHeal(), 10));
caster.CastSpell(caster, SpellIds.OracularHeal, args);
}
public override void Register()
@@ -115,14 +116,15 @@ namespace Scripts.Spells.Priest
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
DamageInfo damageInfo = eventInfo.GetDamageInfo();
int heal = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount()));
_appliedAtonements.RemoveAll(targetGuid =>
{
Unit target = Global.ObjAccessor.GetUnit(GetTarget(), targetGuid);
if (target)
{
if (target.GetExactDist(GetTarget()) < GetSpellInfo().GetEffect(1).CalcValue())
GetTarget().CastCustomSpell(SpellIds.AtonementHeal, SpellValueMod.BasePoint0, heal, target, true);
GetTarget().CastSpell(target, SpellIds.AtonementHeal, args);
return false;
}
@@ -254,7 +256,9 @@ namespace Scripts.Spells.Priest
int healAmount = (int)target.CountPctFromMaxHealth((int)healPct);
// Remove the aura now, we don't want 40% healing bonus
Remove(AuraRemoveMode.EnemySpell);
target.CastCustomSpell(target, SpellIds.GuardianSpiritHeal, healAmount, 0, 0, true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, healAmount);
target.CastSpell(target, SpellIds.GuardianSpiritHeal, args);
absorbAmount = dmgInfo.GetDamage();
}
@@ -306,7 +310,7 @@ namespace Scripts.Spells.Priest
SpellCastTargets targets = new SpellCastTargets();
targets.SetDst(destPos);
targets.SetUnitTarget(GetCaster());
GetHitUnit().CastSpell(targets, Global.SpellMgr.GetSpellInfo((uint)GetEffectValue(), GetCastDifficulty()), null);
GetHitUnit().CastSpell(targets, (uint)GetEffectValue(), new CastSpellExtraArgs(GetCastDifficulty()));
}
public override void Register()
@@ -482,10 +486,10 @@ namespace Scripts.Spells.Priest
void HandleEffectDummy(uint effIndex)
{
uint basePoints = GetCaster().SpellHealingBonusDone(GetHitUnit(), _spellInfoHeal, (uint)_healEffectDummy.CalcValue(GetCaster()), DamageEffectType.Heal, _healEffectDummy);
Dictionary<SpellValueMod, int> values = new Dictionary<SpellValueMod, int>();
values.Add(SpellValueMod.AuraStack, (byte)GetEffectValue());
values.Add(SpellValueMod.BasePoint0, (int)basePoints);
GetCaster().CastCustomSpell(SpellIds.PrayerOfMendingAura, values, GetHitUnit(), TriggerCastFlags.FullMask);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.AuraStack, GetEffectValue());
args.AddSpellMod(SpellValueMod.BasePoint0, (int)basePoints);
GetCaster().CastSpell(GetHitUnit(), SpellIds.PrayerOfMendingAura, args);
}
public override void Register()
@@ -511,12 +515,18 @@ namespace Scripts.Spells.Priest
if (caster != null)
{
// Cast the spell to heal the owner
caster.CastSpell(target, SpellIds.PrayerOfMendingHeal, true, null, aurEff);
caster.CastSpell(target, SpellIds.PrayerOfMendingHeal, new CastSpellExtraArgs(aurEff));
// Only cast jump if stack is higher than 0
int stackAmount = GetStackAmount();
if (stackAmount > 1)
target.CastCustomSpell(SpellIds.PrayerOfMendingJump, SpellValueMod.BasePoint0, stackAmount - 1, target, true, null, aurEff, caster.GetGUID());
{
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.TriggeringAura = aurEff;
args.OriginalCaster = caster.GetGUID();
args.AddSpellMod(SpellValueMod.BasePoint0, stackAmount - 1);
target.CastSpell(target, SpellIds.PrayerOfMendingJump, args);
}
Remove();
}
@@ -580,10 +590,10 @@ namespace Scripts.Spells.Priest
if (origCaster)
{
uint basePoints = origCaster.SpellHealingBonusDone(target, _spellInfoHeal, (uint)_healEffectDummy.CalcValue(origCaster), DamageEffectType.Heal, _healEffectDummy);
Dictionary<SpellValueMod, int> values = new Dictionary<SpellValueMod, int>();
values.Add(SpellValueMod.AuraStack, (byte)GetEffectValue());
values.Add(SpellValueMod.BasePoint0, (int)basePoints);
origCaster.CastCustomSpell(SpellIds.PrayerOfMendingAura, values, target, TriggerCastFlags.FullMask);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.AuraStack, GetEffectValue());
args.AddSpellMod(SpellValueMod.BasePoint0, (int)basePoints);
origCaster.CastSpell(target, SpellIds.PrayerOfMendingAura, args);
}
}
@@ -607,7 +617,7 @@ namespace Scripts.Spells.Priest
Unit target = GetTarget();
if (dmgInfo.GetDamage() >= target.GetHealth())
{
target.CastSpell(target, SpellIds.SpiritOfRedemption, TriggerCastFlags.FullMask, null, aurEff);
target.CastSpell(target, SpellIds.SpiritOfRedemption, new CastSpellExtraArgs(aurEff));
target.SetFullHealth();
return;
}
@@ -632,7 +642,7 @@ namespace Scripts.Spells.Priest
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), SpellIds.ArmorOfFaith, true, null, aurEff);
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), SpellIds.ArmorOfFaith, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -667,7 +677,7 @@ namespace Scripts.Spells.Priest
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.ItemEfficiency, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.ItemEfficiency, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -702,7 +712,9 @@ namespace Scripts.Spells.Priest
Unit target = eventInfo.GetProcTarget();
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.BlessedHealing, AuraType.PeriodicHeal);
caster.CastCustomSpell(SpellIds.BlessedHealing, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell(target, SpellIds.BlessedHealing, args);
}
public override void Register()
@@ -736,7 +748,10 @@ namespace Scripts.Spells.Priest
int selfHeal = (int)MathFunctions.CalculatePct(damageInfo.GetDamage(), aurEff.GetAmount());
int teamHeal = selfHeal / 2;
GetTarget().CastCustomSpell(null, SpellIds.VampiricEmbraceHeal, teamHeal, selfHeal, 0, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, teamHeal);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint1, selfHeal);
GetTarget().CastSpell((Unit)null, SpellIds.VampiricEmbraceHeal, args);
}
public override void Register()
@@ -781,9 +796,10 @@ namespace Scripts.Spells.Priest
AuraEffect aurEff = GetEffect(1);
if (aurEff != null)
{
int damage = aurEff.GetAmount() * 8;
// backfire damage
caster.CastCustomSpell(target, SpellIds.VampiricTouchDispel, damage, 0, 0, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, aurEff.GetAmount() * 8);
caster.CastSpell(target, SpellIds.VampiricTouchDispel, args);
}
}
}
@@ -797,7 +813,7 @@ namespace Scripts.Spells.Priest
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
eventInfo.GetProcTarget().CastSpell((Unit)null, SpellIds.GenReplenishment, true, null, aurEff);
eventInfo.GetProcTarget().CastSpell((Unit)null, SpellIds.GenReplenishment, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -830,7 +846,9 @@ namespace Scripts.Spells.Priest
{
SpellCastTargets targets = new SpellCastTargets();
targets.SetDst(destPos);
GetCaster().CastSpell(targets, Global.SpellMgr.GetSpellInfo(SpellIds.AngelicFeatherAreatrigger, GetCastDifficulty()), null);
CastSpellExtraArgs args = new CastSpellExtraArgs(TriggerCastFlags.FullMask);
args.CastDifficulty = GetCastDifficulty();
GetCaster().CastSpell(targets, SpellIds.AngelicFeatherAreatrigger, args);
}
}
+14 -12
View File
@@ -371,7 +371,7 @@ namespace Scripts.Spells.Quest
{
Unit caster = GetCaster();
uint spellId = RandomHelper.randChance(50) ? SpellIds.CreateResonatingSkull : SpellIds.CreateBoneDust;
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
public override void Register()
@@ -466,7 +466,7 @@ namespace Scripts.Spells.Quest
if (target.IsTypeId(TypeId.Unit) && target.HasAura(SpellIds.ForceShieldArcanePurpleX3))
// Make sure nobody else is channeling the same target
if (!target.HasAura(SpellIds.ScourgingCrystalController))
GetCaster().CastSpell(target, SpellIds.ScourgingCrystalController, true, GetCastItem());
GetCaster().CastSpell(target, SpellIds.ScourgingCrystalController, new CastSpellExtraArgs(GetCastItem()));
}
public override void Register()
@@ -574,7 +574,7 @@ namespace Scripts.Spells.Quest
default:
return;
}
caster.CastSpell(caster, spellId, true, castItem);
caster.CastSpell(caster, spellId, new CastSpellExtraArgs(castItem));
caster.CastSpell(caster, SpellIds.RobotKillCredit, true);
target.DespawnOrUnsummon();
}
@@ -645,7 +645,7 @@ namespace Scripts.Spells.Quest
// sometimes, if you're lucky, you get a dwarf
if (RandomHelper.randChance(5))
spellId = SpellIds.SummonAdventurousDwarf;
GetCaster().CastSpell(GetCaster(), spellId, true, null);
GetCaster().CastSpell(GetCaster(), spellId, true);
}
public override void Register()
@@ -667,7 +667,7 @@ namespace Scripts.Spells.Quest
if (caster.HasAuraEffect(reqAuraId, 0))
{
uint spellId = (uint)GetSpellInfo().GetEffect(0).CalcValue();
caster.CastSpell(caster, spellId, true, null);
caster.CastSpell(caster, spellId, true);
}
}
@@ -739,7 +739,7 @@ namespace Scripts.Spells.Quest
Creature target = GetHitCreature();
if (target)
{
caster.CastSpell(caster, SpellIds.TriggerAidOfTheEarthen, true, null);
caster.CastSpell(caster, SpellIds.TriggerAidOfTheEarthen, true);
caster.KilledMonsterCredit(CreatureIds.FallenEarthenDefender);
target.DespawnOrUnsummon();
}
@@ -1204,7 +1204,7 @@ namespace Scripts.Spells.Quest
if (playerTarget)
// Check if found player target is on fly mount or using flying form
if (playerTarget.HasAuraType(AuraType.Fly) || playerTarget.HasAuraType(AuraType.ModIncreaseMountedFlightSpeed))
playerTarget.CastSpell(playerTarget, SpellIds.FlakCannonTrigger, TriggerCastFlags.IgnoreCasterMountedOrOnVehicle);
playerTarget.CastSpell(playerTarget, SpellIds.FlakCannonTrigger, new CastSpellExtraArgs(TriggerCastFlags.IgnoreCasterMountedOrOnVehicle));
}
public override void Register()
@@ -1444,7 +1444,7 @@ namespace Scripts.Spells.Quest
{
WorldLocation pos = GetExplTargetDest();
if (pos != null)
GetCaster().CastSpell(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), (uint)GetEffectValue(), true);
GetCaster().CastSpell(pos.GetPosition(), (uint)GetEffectValue(), new CastSpellExtraArgs(true));
}
public override void Register()
@@ -1617,7 +1617,7 @@ namespace Scripts.Spells.Quest
PreventDefaultAction();
Unit caster = GetCaster();
if (caster)
caster.CastSpell(caster, aurEff.GetSpellEffectInfo().TriggerSpell, true, null, aurEff);
caster.CastSpell(caster, aurEff.GetSpellEffectInfo().TriggerSpell, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -1651,10 +1651,12 @@ namespace Scripts.Spells.Quest
void HandleScript(uint effIndex)
{
sbyte seatId = 2;
if (!GetHitCreature())
return;
GetHitCreature().CastCustomSpell(SpellIds.RideGymer, SpellValueMod.BasePoint0, seatId, GetCaster(), true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, 2);
GetHitCreature().CastSpell(GetCaster(), SpellIds.RideGymer, args);
GetHitCreature().CastSpell(GetHitCreature(), SpellIds.Grabbed, true);
}
@@ -1725,7 +1727,7 @@ namespace Scripts.Spells.Quest
{
Player player = GetHitPlayer();
if (player)
player.CastSpell(player, SpellIds.TotemOfTheEarthenRing, TriggerCastFlags.FullMask); // ignore reagent cost, consumed by quest
player.CastSpell(player, SpellIds.TotemOfTheEarthenRing, new CastSpellExtraArgs(TriggerCastFlags.FullMask)); // ignore reagent cost, consumed by quest
}
public override void Register()
+38 -18
View File
@@ -101,7 +101,11 @@ namespace Scripts.Spells.Shaman
PreventDefaultAction();
int bp0 = MathFunctions.CalculatePct((int)eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount());
if (bp0 != 0)
eventInfo.GetActor().CastCustomSpell(SpellIds.AncestralGuidanceHeal, SpellValueMod.BasePoint0, bp0, eventInfo.GetActor(), true, null, aurEff);
{
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, bp0);
eventInfo.GetActor().CastSpell(eventInfo.GetActor(), SpellIds.AncestralGuidanceHeal, args);
}
}
public override void Register()
@@ -180,7 +184,11 @@ namespace Scripts.Spells.Shaman
AuraEffect gatheringStorms = GetCaster().GetAuraEffect(SpellIds.GatheringStorms, 0);
if (gatheringStorms != null)
GetCaster().CastCustomSpell(SpellIds.GatheringStormsBuff, SpellValueMod.BasePoint0, (int)(gatheringStorms.GetAmount() * _targetsHit), GetCaster(), true);
{
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.BasePoint0, (int)(gatheringStorms.GetAmount() * _targetsHit));
GetCaster().CastSpell(GetCaster(), SpellIds.GatheringStormsBuff, args);
}
}
public override void Register()
@@ -211,7 +219,7 @@ namespace Scripts.Spells.Shaman
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.EarthShieldHeal, true, null, aurEff, GetCasterGUID());
GetTarget().CastSpell(GetTarget(), SpellIds.EarthShieldHeal, new CastSpellExtraArgs(aurEff, GetCasterGUID()));
}
public override void Register()
@@ -298,7 +306,7 @@ namespace Scripts.Spells.Shaman
Player caster = GetCaster().ToPlayer();
uint spellId = RandomHelper.RAND(SpellIds.ElementalBlastCrit, SpellIds.ElementalBlastHaste, SpellIds.ElementalBlastMastery);
caster.CastSpell(caster, spellId, TriggerCastFlags.FullMask);
caster.CastSpell(caster, spellId, new CastSpellExtraArgs(TriggerCastFlags.FullMask));
}
public override void Register()
@@ -354,8 +362,9 @@ namespace Scripts.Spells.Shaman
PreventDefaultAction();
Unit attacker = eventInfo.GetActor();
int damage = Math.Max(1, (int)(attacker.GetTotalAttackPowerValue(WeaponAttackType.BaseAttack) * 0.0264f));
attacker.CastCustomSpell(SpellIds.FlametongueAttack, SpellValueMod.BasePoint0, damage, eventInfo.GetActionTarget(), TriggerCastFlags.FullMask, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, Math.Max(1, (int)(attacker.GetTotalAttackPowerValue(WeaponAttackType.BaseAttack) * 0.0264f)));
attacker.CastSpell(eventInfo.GetActionTarget(), SpellIds.FlametongueAttack, args);
}
public override void Register()
@@ -411,7 +420,7 @@ namespace Scripts.Spells.Shaman
void HandleEffectPeriodic(AuraEffect aurEff)
{
GetTarget().CastSpell(_x, _y, _z, SpellIds.HealingRainHeal, true, null, aurEff);
GetTarget().CastSpell(new Position(_x, _y, _z), SpellIds.HealingRainHeal, new CastSpellExtraArgs(aurEff));
}
void HandleEffecRemoved(AuraEffect aurEff, AuraEffectHandleModes mode)
@@ -488,7 +497,7 @@ namespace Scripts.Spells.Shaman
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.ItemLightningShield, true, null, aurEff);
GetTarget().CastSpell(eventInfo.GetProcTarget(), SpellIds.ItemLightningShield, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -508,7 +517,7 @@ namespace Scripts.Spells.Shaman
void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
GetTarget().CastSpell(GetTarget(), SpellIds.ItemLightningShieldDamage, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.ItemLightningShieldDamage, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -540,7 +549,11 @@ namespace Scripts.Spells.Shaman
{
int mana = MathFunctions.CalculatePct(m.Amount, 35);
if (mana > 0)
GetTarget().CastCustomSpell(SpellIds.ItemManaSurge, SpellValueMod.BasePoint0, mana, GetTarget(), true, null, aurEff);
{
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, mana);
GetTarget().CastSpell(GetTarget(), SpellIds.ItemManaSurge, args);
}
}
}
@@ -792,10 +805,11 @@ namespace Scripts.Spells.Shaman
void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo)
{
PreventDefaultAction();
int basePoints0 = -aurEff.GetAmount();
int basePoints1 = aurEff.GetAmount();
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, -aurEff.GetAmount());
args.AddSpellMod(SpellValueMod.BasePoint1, aurEff.GetAmount());
GetTarget().CastCustomSpell(GetTarget(), SpellIds.TidalWaves, basePoints0, basePoints1, 0, true, null, aurEff);
GetTarget().CastSpell(GetTarget(), SpellIds.TidalWaves, args);
}
public override void Register()
@@ -843,7 +857,7 @@ namespace Scripts.Spells.Shaman
return;
}
caster.CastSpell(target, spellId, true, null, aurEff);
caster.CastSpell(target, spellId, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -895,7 +909,9 @@ namespace Scripts.Spells.Shaman
Unit target = eventInfo.GetProcTarget();
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.Electrified, AuraType.PeriodicDamage);
caster.CastCustomSpell(SpellIds.Electrified, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell(target, SpellIds.Electrified, args);
}
public override void Register()
@@ -929,7 +945,9 @@ namespace Scripts.Spells.Shaman
Unit target = eventInfo.GetProcTarget();
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.LavaBurstBonusDamage, AuraType.PeriodicDamage);
caster.CastCustomSpell(SpellIds.LavaBurstBonusDamage, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell(target, SpellIds.LavaBurstBonusDamage, args);
}
public override void Register()
@@ -995,7 +1013,9 @@ namespace Scripts.Spells.Shaman
Unit target = eventInfo.GetProcTarget();
amount += (int)target.GetRemainingPeriodicAmount(caster.GetGUID(), SpellIds.ChainedHeal, AuraType.PeriodicHeal);
caster.CastCustomSpell(SpellIds.ChainedHeal, SpellValueMod.BasePoint0, amount, target, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, amount);
caster.CastSpell(target, SpellIds.ChainedHeal, args);
}
public override void Register()
@@ -1017,7 +1037,7 @@ namespace Scripts.Spells.Shaman
PreventDefaultAction();
for (uint i = 0; i < 2; ++i)
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), SpellIds.WindfuryAttack, true, null, aurEff);
eventInfo.GetActor().CastSpell(eventInfo.GetProcTarget(), SpellIds.WindfuryAttack, new CastSpellExtraArgs(aurEff));
}
public override void Register()
+9 -7
View File
@@ -208,15 +208,16 @@ namespace Scripts.Spells.Warlock
if (effect != null)
{
Unit caster = GetCaster();
int heal_amount = effect.CalcValue(caster);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.BasePoint0, effect.CalcValue(caster));
caster.CastCustomSpell(caster, SpellIds.DevourMagicHeal, heal_amount, 0, 0, true);
caster.CastSpell(caster, SpellIds.DevourMagicHeal, args);
// Glyph of Felhunter
Unit owner = caster.GetOwner();
if (owner)
if (owner.GetAura(SpellIds.GlyphOfDemonTraining) != null)
owner.CastCustomSpell(owner, SpellIds.DevourMagicHeal, heal_amount, 0, 0, true);
owner.CastSpell(owner, SpellIds.DevourMagicHeal, args);
}
}
@@ -427,7 +428,7 @@ namespace Scripts.Spells.Warlock
if (!caster)
return;
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.SeedOfCorruptionGeneric, true, null, aurEff);
caster.CastSpell(eventInfo.GetActionTarget(), SpellIds.SeedOfCorruptionGeneric, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -617,7 +618,7 @@ namespace Scripts.Spells.Warlock
{
PreventDefaultAction();
Unit caster = eventInfo.GetActor();
caster.CastSpell(caster, _triggerSpell, true, null, aurEff);
caster.CastSpell(caster, _triggerSpell, new CastSpellExtraArgs(aurEff));
}
public override void Register()
@@ -644,9 +645,10 @@ namespace Scripts.Spells.Warlock
AuraEffect aurEff = GetEffect(1);
if (aurEff != null)
{
int damage = aurEff.GetAmount() * 9;
// backfire damage and silence
caster.CastCustomSpell(dispelInfo.GetDispeller(), SpellIds.UnstableAfflictionDispel, damage, 0, 0, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, aurEff.GetAmount() * 9);
caster.CastSpell(dispelInfo.GetDispeller(), SpellIds.UnstableAfflictionDispel, args);
}
}
}
+15 -9
View File
@@ -144,7 +144,7 @@ namespace Scripts.Spells.Warrior
{
Unit caster = GetCaster();
Unit target = GetHitUnit();
caster.CastCustomSpell(SpellIds.ChargePauseRageDecay, SpellValueMod.BasePoint0, 0, caster, true);
caster.CastSpell(caster, SpellIds.ChargePauseRageDecay, new CastSpellExtraArgs(TriggerCastFlags.FullMask).AddSpellMod(SpellValueMod.BasePoint0, 0));
caster.CastSpell(target, SpellIds.ChargeRootEffect, true);
caster.CastSpell(target, SpellIds.ChargeSlowEffect, true);
}
@@ -224,7 +224,7 @@ namespace Scripts.Spells.Warrior
{
WorldLocation dest = GetHitDest();
if (dest != null)
GetCaster().CastSpell(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), SpellIds.HeroicLeapJump, true);
GetCaster().CastSpell(dest.GetPosition(), SpellIds.HeroicLeapJump, new CastSpellExtraArgs(true));
}
public override void Register()
@@ -311,7 +311,9 @@ namespace Scripts.Spells.Warrior
Unit target = eventInfo.GetActionTarget();
int bp0 = (int)MathFunctions.CalculatePct(target.GetMaxHealth(), GetSpellInfo().GetEffect(1).CalcValue());
target.CastCustomSpell(SpellIds.Stoicism, SpellValueMod.BasePoint0, bp0, (Unit)null, true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, bp0);
target.CastSpell((Unit)null, SpellIds.Stoicism, args);
}
public override void Register()
@@ -356,9 +358,10 @@ namespace Scripts.Spells.Warrior
void HandleScript(uint effIndex)
{
int basePoints0 = (int)(GetHitUnit().CountPctFromMaxHealth(GetEffectValue()));
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.BasePoint0, (int)GetHitUnit().CountPctFromMaxHealth(GetEffectValue()));
GetCaster().CastCustomSpell(GetHitUnit(), SpellIds.RallyingCry, basePoints0, 0, 0, true);
GetCaster().CastSpell(GetHitUnit(), SpellIds.RallyingCry, args);
}
public override void Register()
@@ -472,12 +475,13 @@ namespace Scripts.Spells.Warrior
if (spellInfo != null && (spellInfo.Id == SpellIds.BladestormPeriodicWhirlwind || (spellInfo.Id == SpellIds.Execute && !_procTarget.HasAuraState(AuraStateType.Wounded20Percent))))
{
// If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, true, null, aurEff);
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack2, new CastSpellExtraArgs(aurEff));
}
else
{
int damage = (int)damageInfo.GetDamage();
GetTarget().CastCustomSpell(SpellIds.SweepingStrikesExtraAttack1, SpellValueMod.BasePoint0, damage, _procTarget, true, null, aurEff);
CastSpellExtraArgs args = new(aurEff);
args.AddSpellMod(SpellValueMod.BasePoint0, (int)damageInfo.GetDamage());
GetTarget().CastSpell(_procTarget, SpellIds.SweepingStrikesExtraAttack1, args);
}
}
}
@@ -506,7 +510,9 @@ namespace Scripts.Spells.Warrior
int remainingDamage = (int)target.GetRemainingPeriodicAmount(target.GetGUID(), SpellIds.TraumaEffect, AuraType.PeriodicDamage);
//Get 25% of damage from the spell casted (Slam & Whirlwind) plus Remaining Damage from Aura
int damage = (int)(MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount()) / Global.SpellMgr.GetSpellInfo(SpellIds.TraumaEffect, GetCastDifficulty()).GetMaxTicks()) + remainingDamage;
GetCaster().CastCustomSpell(SpellIds.TraumaEffect, SpellValueMod.BasePoint0, damage, target, true);
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
args.AddSpellMod(SpellValueMod.BasePoint0, damage);
GetCaster().CastSpell(target, SpellIds.TraumaEffect, args);
}
public override void Register()
+7 -7
View File
@@ -103,7 +103,7 @@ namespace Scripts.World.EmeraldDragons
base.Reset();
me.RemoveUnitFlag(UnitFlags.NotSelectable | UnitFlags.NonAttackable);
me.SetReactState(ReactStates.Aggressive);
DoCast(me, SpellIds.MarkOfNatureAura, true);
DoCast(me, SpellIds.MarkOfNatureAura, new CastSpellExtraArgs(true));
_scheduler.Schedule(TimeSpan.FromSeconds(4), task =>
{
@@ -123,8 +123,8 @@ namespace Scripts.World.EmeraldDragons
{
// Seeping Fog appears only as "pairs", and only ONE pair at any given time!
// Despawntime is 2 minutes, so reschedule it for new cast after 2 minutes + a minor "random time" (30 seconds at max)
DoCast(me, SpellIds.SeepingFogLeft, true);
DoCast(me, SpellIds.SeepingFogRight, true);
DoCast(me, SpellIds.SeepingFogLeft, new CastSpellExtraArgs(true));
DoCast(me, SpellIds.SeepingFogRight, new CastSpellExtraArgs(true));
task.Repeat(TimeSpan.FromMinutes(2), TimeSpan.FromMinutes(2.5));
});
}
@@ -245,7 +245,7 @@ namespace Scripts.World.EmeraldDragons
Talk(TextIds.SayYsondreSummonDruids);
for (byte i = 0; i < 10; ++i)
DoCast(me, SpellIds.SummonDruidSpirits, true);
DoCast(me, SpellIds.SummonDruidSpirits, new CastSpellExtraArgs(true));
++_stage;
}
}
@@ -357,7 +357,7 @@ namespace Scripts.World.EmeraldDragons
public override void KilledUnit(Unit who)
{
if (who.IsTypeId(TypeId.Player))
DoCast(who, SpellIds.PutridMushroom, true);
DoCast(who, SpellIds.PutridMushroom, new CastSpellExtraArgs(true));
base.KilledUnit(who);
}
@@ -372,7 +372,7 @@ namespace Scripts.World.EmeraldDragons
if (!HealthAbovePct(100 - 25 * _stage))
{
Talk(TextIds.SayEmerissCastCorruption);
DoCast(me, SpellIds.CorruptionOfEarth, true);
DoCast(me, SpellIds.CorruptionOfEarth, new CastSpellExtraArgs(true));
++_stage;
}
}
@@ -445,7 +445,7 @@ namespace Scripts.World.EmeraldDragons
Talk(TextIds.SayTaerarSummonShades);
foreach (var spell in SpellIds.TaerarShadeSpells)
DoCastVictim(spell, true);
DoCastVictim(spell, new CastSpellExtraArgs(true));
_shades += (byte)SpellIds.TaerarShadeSpells.Length;
DoCast(SpellIds.Shade);
+7 -2
View File
@@ -15,9 +15,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Constants;
using Game.AI;
using Game.Entities;
using Game.Scripting;
using Game.Spells;
using System;
namespace Scripts.World
@@ -27,10 +29,13 @@ namespace Scripts.World
{
public trigger_periodic(Creature creature) : base(creature)
{
var interval = me.GetBaseAttackTime(Framework.Constants.WeaponAttackType.BaseAttack);
var interval = me.GetBaseAttackTime(WeaponAttackType.BaseAttack);
var spell = me.m_spells[0] != 0 ? Global.SpellMgr.GetSpellInfo(me.m_spells[0], me.GetMap().GetDifficultyID()) : null;
_scheduler.Schedule(TimeSpan.FromMilliseconds(interval), task =>
{
me.CastSpell(me, me.m_spells[0], true);
if (spell != null)
me.CastSpell(me, spell.Id, new CastSpellExtraArgs(TriggerCastFlags.FullMask).SetCastDifficulty(spell.Difficulty));
task.Repeat(TimeSpan.FromMilliseconds(interval));
});
}
+16 -16
View File
@@ -695,8 +695,8 @@ namespace Scripts.World.NpcSpecial
public override void Reset()
{
Initialize();
DoCast(me, SpellIds.Brazier, true);
DoCast(me, SpellIds.FieryAura, false);
DoCast(me, SpellIds.Brazier, new CastSpellExtraArgs(true));
DoCast(me, SpellIds.FieryAura, new CastSpellExtraArgs(false));
float x, y, z;
me.GetPosition(out x, out y, out z);
me.Relocate(x, y, z + 0.94f);
@@ -744,7 +744,7 @@ namespace Scripts.World.NpcSpecial
break;
case TextEmotes.Dance:
if (!player.HasAura(SpellIds.Seduction))
DoCast(player, SpellIds.Seduction, true);
DoCast(player, SpellIds.Seduction, new CastSpellExtraArgs(true));
break;
}
}
@@ -1330,7 +1330,7 @@ namespace Scripts.World.NpcSpecial
if (me.IsAttackReady())
{
DoCastVictim(SpellIds.Deathtouch, true);
DoCastVictim(SpellIds.Deathtouch, new CastSpellExtraArgs(true));
me.ResetAttackTimer();
}
}
@@ -1404,7 +1404,7 @@ namespace Scripts.World.NpcSpecial
player.SendGossipMenu(GossipMenus.YourFortuneIsCast, me.GetGUID());
break;
case eTradeskill.GossipActionInfoDef + 6:
DoCast(player, SpellIds.Fortune, false);
DoCast(player, SpellIds.Fortune, new CastSpellExtraArgs(false));
player.SendGossipMenu(GossipMenus.HereIsYourFortune, me.GetGUID());
break;
}
@@ -1449,7 +1449,7 @@ namespace Scripts.World.NpcSpecial
if (spellId != 0)
{
DoCast(player, spellId, false);
DoCast(player, spellId, new CastSpellExtraArgs(false));
player.GetSpellHistory().AddCooldown(spellId, 0, TimeSpan.FromHours(2));
SendAction(player, action);
}
@@ -1509,7 +1509,7 @@ namespace Scripts.World.NpcSpecial
{
if (ExplosionTimer <= diff)
{
DoCast(me, SpellIds.TonkMineDetonate, true);
DoCast(me, SpellIds.TonkMineDetonate, new CastSpellExtraArgs(true));
me.SetDeathState(DeathState.Dead); // unsummon it
}
else
@@ -1654,27 +1654,27 @@ namespace Scripts.World.NpcSpecial
{
case eTradeskill.GossipActionInfoDef + 1: // Borean Tundra
player.CloseGossipMenu();
DoCast(player, SpellIds.BoreanTundra, false);
DoCast(player, SpellIds.BoreanTundra, new CastSpellExtraArgs(false));
break;
case eTradeskill.GossipActionInfoDef + 2: // Howling Fjord
player.CloseGossipMenu();
DoCast(player, SpellIds.HowlingFjord, false);
DoCast(player, SpellIds.HowlingFjord, new CastSpellExtraArgs(false));
break;
case eTradeskill.GossipActionInfoDef + 3: // Sholazar Basin
player.CloseGossipMenu();
DoCast(player, SpellIds.SholazarBasin, false);
DoCast(player, SpellIds.SholazarBasin, new CastSpellExtraArgs(false));
break;
case eTradeskill.GossipActionInfoDef + 4: // Icecrown
player.CloseGossipMenu();
DoCast(player, SpellIds.Icecrown, false);
DoCast(player, SpellIds.Icecrown, new CastSpellExtraArgs(false));
break;
case eTradeskill.GossipActionInfoDef + 5: // Storm peaks
player.CloseGossipMenu();
DoCast(player, SpellIds.StormPeaks, false);
DoCast(player, SpellIds.StormPeaks, new CastSpellExtraArgs(false));
break;
case eTradeskill.GossipActionInfoDef + 6: // Underground
player.CloseGossipMenu();
DoCast(player, SpellIds.Underground, false);
DoCast(player, SpellIds.Underground, new CastSpellExtraArgs(false));
break;
}
@@ -1931,7 +1931,7 @@ namespace Scripts.World.NpcSpecial
}
else
//me.CastSpell(me, GetFireworkSpell(me.GetEntry()), true);
me.CastSpell(me.GetPositionX(), me.GetPositionY(), me.GetPositionZ(), GetFireworkSpell(me.GetEntry()), true);
me.CastSpell(me.GetPosition(), GetFireworkSpell(me.GetEntry()), new CastSpellExtraArgs(true));
}
}
@@ -2253,9 +2253,9 @@ namespace Scripts.World.NpcSpecial
case GossipMenus.OptionIdIronforgeSilvermoonPennant:
case GossipMenus.OptionIdStormwindThunderbluffPennant:
if (IsArgentSquire())
DoCastSelf(Misc.bannerSpells[gossipListId - 3].Item1, true);
DoCastSelf(Misc.bannerSpells[gossipListId - 3].Item1, new CastSpellExtraArgs(true));
else
DoCastSelf(Misc.bannerSpells[gossipListId - 3].Item2, true);
DoCastSelf(Misc.bannerSpells[gossipListId - 3].Item2, new CastSpellExtraArgs(true));
break;
}
player.PlayerTalkClass.SendCloseGossip();