Core/Spells: CastSpell Cleanup
Port From (https://github.com/TrinityCore/TrinityCore/commit/)
This commit is contained in:
@@ -1155,7 +1155,7 @@ namespace Game.Spells
|
||||
else if (spellArea.flags.HasAnyFlag(SpellAreaFlag.AutoCast))
|
||||
{
|
||||
if (!target.HasAura(spellArea.spellId))
|
||||
target.CastSpell(target, spellArea.spellId, true);
|
||||
target.CastSpell(target, spellArea.spellId, new CastSpellExtraArgs(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1189,7 +1189,7 @@ namespace Game.Spells
|
||||
if (spell < 0)
|
||||
target.RemoveAurasDueToSpell((uint)-spell);
|
||||
else if (removeMode != AuraRemoveMode.Death)
|
||||
target.CastSpell(target, (uint)spell, true, null, null, GetCasterGUID());
|
||||
target.CastSpell(target, (uint)spell, new CastSpellExtraArgs(GetCasterGUID()));
|
||||
}
|
||||
}
|
||||
spellTriggered = Global.SpellMgr.GetSpellLinked((int)GetId() + (int)SpellLinkedType.Aura);
|
||||
@@ -1237,11 +1237,11 @@ namespace Game.Spells
|
||||
break;
|
||||
case 33572: // Gronn Lord's Grasp, becomes stoned
|
||||
if (GetStackAmount() >= 5 && !target.HasAura(33652))
|
||||
target.CastSpell(target, 33652, true);
|
||||
target.CastSpell(target, 33652, new CastSpellExtraArgs(true));
|
||||
break;
|
||||
case 50836: //Petrifying Grip, becomes stoned
|
||||
if (GetStackAmount() >= 5 && !target.HasAura(50812))
|
||||
target.CastSpell(target, 50812, true);
|
||||
target.CastSpell(target, 50812, new CastSpellExtraArgs(true));
|
||||
break;
|
||||
case 60970: // Heroic Fury (remove Intercept cooldown)
|
||||
if (target.IsTypeId(TypeId.Player))
|
||||
@@ -1258,8 +1258,9 @@ namespace Game.Spells
|
||||
// Druid T8 Restoration 4P Bonus
|
||||
if (caster.HasAura(64760))
|
||||
{
|
||||
int heal = GetEffect(0).GetAmount();
|
||||
caster.CastCustomSpell(target, 64801, heal, 0, 0, true, null, GetEffect(0));
|
||||
CastSpellExtraArgs args = new(GetEffect(0));
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, GetEffect(0).GetAmount());
|
||||
caster.CastSpell(target, 64801, args);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1276,7 +1277,7 @@ namespace Game.Spells
|
||||
case 66: // Invisibility
|
||||
if (removeMode != AuraRemoveMode.Expire)
|
||||
break;
|
||||
target.CastSpell(target, 32612, true, null, GetEffect(1));
|
||||
target.CastSpell(target, 32612, new CastSpellExtraArgs(GetEffect(1)));
|
||||
target.CombatStop();
|
||||
break;
|
||||
default:
|
||||
@@ -1312,8 +1313,9 @@ namespace Game.Spells
|
||||
if (aurEff != null)
|
||||
{
|
||||
float multiplier = aurEff.GetAmount();
|
||||
int basepoints0 = MathFunctions.CalculatePct(caster.GetMaxPower(PowerType.Mana), multiplier);
|
||||
caster.CastCustomSpell(caster, 47755, basepoints0, 0, 0, true);
|
||||
CastSpellExtraArgs args = new CastSpellExtraArgs(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(caster.GetMaxPower(PowerType.Mana), multiplier));
|
||||
caster.CastSpell(caster, 47755, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1329,25 +1331,6 @@ namespace Game.Spells
|
||||
// mods at aura apply or remove
|
||||
switch (GetSpellInfo().SpellFamilyName)
|
||||
{
|
||||
case SpellFamilyNames.Rogue:
|
||||
// Stealth
|
||||
if (GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00400000u))
|
||||
{
|
||||
// Master of subtlety
|
||||
AuraEffect aurEff = target.GetAuraEffect(31223, 0);
|
||||
if (aurEff != null)
|
||||
{
|
||||
if (!apply)
|
||||
target.CastSpell(target, 31666, true);
|
||||
else
|
||||
{
|
||||
int basepoints0 = aurEff.GetAmount();
|
||||
target.CastCustomSpell(target, 31665, basepoints0, 0, 0, true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SpellFamilyNames.Hunter:
|
||||
switch (GetId())
|
||||
{
|
||||
@@ -1360,7 +1343,7 @@ namespace Game.Spells
|
||||
if (owner.HasAura(34692))
|
||||
{
|
||||
if (apply)
|
||||
owner.CastSpell(owner, 34471, true, null, GetEffect(0));
|
||||
owner.CastSpell(owner, 34471, new CastSpellExtraArgs(GetEffect(0)));
|
||||
else
|
||||
owner.RemoveAurasDueToSpell(34471);
|
||||
}
|
||||
@@ -1383,7 +1366,7 @@ namespace Game.Spells
|
||||
if (apply)
|
||||
{
|
||||
if ((GetSpellInfo().Id == 31821 && target.HasAura(19746, GetCasterGUID())) || (GetSpellInfo().Id == 19746 && target.HasAura(31821)))
|
||||
target.CastSpell(target, 64364, true);
|
||||
target.CastSpell(target, 64364, new CastSpellExtraArgs(true));
|
||||
}
|
||||
else
|
||||
target.RemoveAurasDueToSpell(64364, GetCasterGUID());
|
||||
@@ -1393,7 +1376,7 @@ namespace Game.Spells
|
||||
if (target.HasAura(70755))
|
||||
{
|
||||
if (apply)
|
||||
target.CastSpell(target, 71166, true);
|
||||
target.CastSpell(target, 71166, new CastSpellExtraArgs(true));
|
||||
else
|
||||
target.RemoveAurasDueToSpell(71166);
|
||||
}
|
||||
@@ -1409,7 +1392,7 @@ namespace Game.Spells
|
||||
if (apply)
|
||||
{
|
||||
if (target != caster && !target.HealthAbovePct(25))
|
||||
caster.CastSpell(caster, 100001, true);
|
||||
caster.CastSpell(caster, 100001, new CastSpellExtraArgs(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -678,16 +678,16 @@ namespace Game.Spells
|
||||
if (apply)
|
||||
{
|
||||
if (spellId != 0)
|
||||
target.CastSpell(target, spellId, true, null, this);
|
||||
target.CastSpell(target, spellId, new CastSpellExtraArgs(this));
|
||||
|
||||
if (spellId2 != 0)
|
||||
target.CastSpell(target, spellId2, true, null, this);
|
||||
target.CastSpell(target, spellId2, new CastSpellExtraArgs(this));
|
||||
|
||||
if (spellId3 != 0)
|
||||
target.CastSpell(target, spellId3, true, null, this);
|
||||
target.CastSpell(target, spellId3, new CastSpellExtraArgs(this));
|
||||
|
||||
if (spellId4 != 0)
|
||||
target.CastSpell(target, spellId4, true, null, this);
|
||||
target.CastSpell(target, spellId4, new CastSpellExtraArgs(this));
|
||||
|
||||
if (target.IsTypeId(TypeId.Player))
|
||||
{
|
||||
@@ -711,7 +711,7 @@ namespace Game.Spells
|
||||
continue;
|
||||
|
||||
if (Convert.ToBoolean(spellInfo.Stances & (1ul << (GetMiscValue() - 1))))
|
||||
target.CastSpell(target, pair.Key, true, null, this);
|
||||
target.CastSpell(target, pair.Key, new CastSpellExtraArgs(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1246,13 +1246,13 @@ namespace Game.Spells
|
||||
case ShapeShiftForm.CatForm:
|
||||
AuraEffect dummy = target.GetAuraEffect(37315, 0);
|
||||
if (dummy != null)
|
||||
target.CastSpell(target, 37316, true, null, dummy);
|
||||
target.CastSpell(target, 37316, new CastSpellExtraArgs(dummy));
|
||||
break;
|
||||
// Nordrassil Regalia - bonus
|
||||
case ShapeShiftForm.MoonkinForm:
|
||||
dummy = target.GetAuraEffect(37324, 0);
|
||||
if (dummy != null)
|
||||
target.CastSpell(target, 37325, true, null, dummy);
|
||||
target.CastSpell(target, 37325, new CastSpellExtraArgs(dummy));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2062,7 +2062,7 @@ namespace Game.Spells
|
||||
{
|
||||
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
|
||||
if (mountCapability != null)
|
||||
target.CastSpell(target, mountCapability.ModSpellAuraID, true);
|
||||
target.CastSpell(target, mountCapability.ModSpellAuraID, new CastSpellExtraArgs(true));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4064,7 +4064,7 @@ namespace Game.Spells
|
||||
case 13139: // net-o-matic
|
||||
// root to self part of (root_target.charge.root_self sequence
|
||||
if (caster != null)
|
||||
caster.CastSpell(caster, 13138, true, null, this);
|
||||
caster.CastSpell(caster, 13138, new CastSpellExtraArgs(this));
|
||||
break;
|
||||
case 34026: // kill command
|
||||
{
|
||||
@@ -4072,7 +4072,7 @@ namespace Game.Spells
|
||||
if (pet == null)
|
||||
break;
|
||||
|
||||
target.CastSpell(target, 34027, true, null, this);
|
||||
target.CastSpell(target, 34027, new CastSpellExtraArgs(this));
|
||||
|
||||
// set 3 stacks and 3 charges (to make all auras not disappear at once)
|
||||
Aura owner_aura = target.GetAura(34027, GetCasterGUID());
|
||||
@@ -4093,15 +4093,15 @@ namespace Game.Spells
|
||||
if (caster != null)
|
||||
{
|
||||
if (caster.GetGender() == Gender.Female)
|
||||
caster.CastSpell(target, 37095, true, null, this); // Blood Elf Disguise
|
||||
caster.CastSpell(target, 37095, new CastSpellExtraArgs(this)); // Blood Elf Disguise
|
||||
else
|
||||
caster.CastSpell(target, 37093, true, null, this);
|
||||
caster.CastSpell(target, 37093, new CastSpellExtraArgs(this));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 39850: // Rocket Blast
|
||||
if (RandomHelper.randChance(20)) // backfire stun
|
||||
target.CastSpell(target, 51581, true, null, this);
|
||||
target.CastSpell(target, 51581, new CastSpellExtraArgs(this));
|
||||
break;
|
||||
case 43873: // Headless Horseman Laugh
|
||||
target.PlayDistanceSound(11965);
|
||||
@@ -4110,9 +4110,9 @@ namespace Game.Spells
|
||||
if (caster != null)
|
||||
{
|
||||
if (caster.GetGender() == Gender.Female)
|
||||
caster.CastSpell(target, 46356, true, null, this);
|
||||
caster.CastSpell(target, 46356, new CastSpellExtraArgs(this));
|
||||
else
|
||||
caster.CastSpell(target, 46355, true, null, this);
|
||||
caster.CastSpell(target, 46355, new CastSpellExtraArgs(this));
|
||||
}
|
||||
break;
|
||||
case 46361: // Reinforced Net
|
||||
@@ -4186,7 +4186,7 @@ namespace Game.Spells
|
||||
}
|
||||
|
||||
if (finalSpelId != 0)
|
||||
caster.CastSpell(target, finalSpelId, true, null, this);
|
||||
caster.CastSpell(target, finalSpelId, new CastSpellExtraArgs(this));
|
||||
}
|
||||
|
||||
switch (m_spellInfo.SpellFamilyName)
|
||||
@@ -4208,7 +4208,7 @@ namespace Game.Spells
|
||||
break;
|
||||
case 36730: // Flame Strike
|
||||
{
|
||||
target.CastSpell(target, 36731, true, null, this);
|
||||
target.CastSpell(target, 36731, new CastSpellExtraArgs(this));
|
||||
break;
|
||||
}
|
||||
case 44191: // Flame Strike
|
||||
@@ -4217,7 +4217,7 @@ namespace Game.Spells
|
||||
{
|
||||
uint spellId = (uint)(target.GetMap().IsHeroic() ? 46163 : 44190);
|
||||
|
||||
target.CastSpell(target, spellId, true, null, this);
|
||||
target.CastSpell(target, spellId, new CastSpellExtraArgs(this));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -4231,25 +4231,25 @@ namespace Game.Spells
|
||||
break;
|
||||
}
|
||||
case 42783: // Wrath of the Astromancer
|
||||
target.CastSpell(target, (uint)GetAmount(), true, null, this);
|
||||
target.CastSpell(target, (uint)GetAmount(), new CastSpellExtraArgs(this));
|
||||
break;
|
||||
case 46308: // Burning Winds casted only at creatures at spawn
|
||||
target.CastSpell(target, 47287, true, null, this);
|
||||
target.CastSpell(target, 47287, new CastSpellExtraArgs(this));
|
||||
break;
|
||||
case 52172: // Coyote Spirit Despawn Aura
|
||||
case 60244: // Blood Parrot Despawn Aura
|
||||
target.CastSpell((Unit)null, (uint)GetAmount(), true, null, this);
|
||||
target.CastSpell((Unit)null, (uint)GetAmount(), new CastSpellExtraArgs(this));
|
||||
break;
|
||||
case 91604: // Restricted Flight Area
|
||||
if (aurApp.GetRemoveMode() == AuraRemoveMode.Expire)
|
||||
target.CastSpell(target, 58601, true);
|
||||
target.CastSpell(target, 58601, new CastSpellExtraArgs(true));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case SpellFamilyNames.Deathknight:
|
||||
// Summon Gargoyle (Dismiss Gargoyle at remove)
|
||||
if (GetId() == 61777)
|
||||
target.CastSpell(target, (uint)GetAmount(), true);
|
||||
target.CastSpell(target, (uint)GetAmount(), new CastSpellExtraArgs(true));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -4278,9 +4278,13 @@ namespace Game.Spells
|
||||
if (apply && caster != null)
|
||||
{
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(spellId, GetBase().GetCastDifficulty());
|
||||
CastSpellExtraArgs args = new();
|
||||
args.TriggerFlags = TriggerCastFlags.FullMask;
|
||||
args.OriginalCaster = GetCasterGUID();
|
||||
args.CastDifficulty = spell.Difficulty;
|
||||
|
||||
for (uint i = 0; i < spell.StackAmount; ++i)
|
||||
caster.CastSpell(target, spell, true, null, null, GetCasterGUID());
|
||||
caster.CastSpell(target, spell.Id, args);
|
||||
break;
|
||||
}
|
||||
target.RemoveAurasDueToSpell(spellId);
|
||||
@@ -4293,8 +4297,12 @@ namespace Game.Spells
|
||||
if (apply && caster != null)
|
||||
{
|
||||
SpellInfo spell = Global.SpellMgr.GetSpellInfo(spellId, GetBase().GetCastDifficulty());
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.OriginalCaster = GetCasterGUID();
|
||||
args.CastDifficulty = spell.Difficulty;
|
||||
|
||||
for (uint i = 0; i < spell.StackAmount; ++i)
|
||||
caster.CastSpell(target, spell, true, null, null, GetCasterGUID());
|
||||
caster.CastSpell(target, spell.Id, args);
|
||||
break;
|
||||
}
|
||||
target.RemoveAurasDueToSpell(spellId);
|
||||
@@ -4347,7 +4355,7 @@ namespace Game.Spells
|
||||
target.PlayDirectSound(14970, target.ToPlayer());
|
||||
// continue in 58205
|
||||
else
|
||||
target.CastSpell(target, 58205, true);
|
||||
target.CastSpell(target, 58205, new CastSpellExtraArgs(true));
|
||||
}
|
||||
break;
|
||||
// LK Intro VO (2)
|
||||
@@ -4561,11 +4569,12 @@ namespace Game.Spells
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
// If amount avalible cast with basepoints (Crypt Fever for example)
|
||||
if (GetAmount() != 0)
|
||||
caster.CastCustomSpell(target, triggeredSpellId, m_amount, 0, 0, true, null, this);
|
||||
else
|
||||
caster.CastSpell(target, triggeredSpellId, true, null, this);
|
||||
CastSpellExtraArgs args = new(this);
|
||||
|
||||
if (GetAmount() != 0) // If amount avalible cast with basepoints (Crypt Fever for example)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, GetAmount());
|
||||
|
||||
caster.CastSpell(target, triggeredSpellId, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4609,7 +4618,7 @@ namespace Game.Spells
|
||||
break;
|
||||
}
|
||||
|
||||
target.CastSpell(target, triggerSpell, true);
|
||||
target.CastSpell(target, triggerSpell, new CastSpellExtraArgs(true));
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.TriggerSpellOnPowerAmount)]
|
||||
@@ -4638,7 +4647,7 @@ namespace Game.Spells
|
||||
break;
|
||||
}
|
||||
|
||||
target.CastSpell(target, triggerSpell, true);
|
||||
target.CastSpell(target, triggerSpell, new CastSpellExtraArgs(true));
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.OpenStable)]
|
||||
@@ -4808,12 +4817,12 @@ namespace Game.Spells
|
||||
Unit triggerCaster = triggeredSpellInfo.NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target;
|
||||
if (triggerCaster != null)
|
||||
{
|
||||
triggerCaster.CastSpell(target, triggeredSpellInfo, true, null, this);
|
||||
triggerCaster.CastSpell(target, triggerSpellId, new CastSpellExtraArgs(this));
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellAuraTick: Spell {0} Trigger {1}", GetId(), triggeredSpellInfo.Id);
|
||||
}
|
||||
}
|
||||
else
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellAuraTick: Spell {0} has non-existent spell {1} in EffectTriggered[{2}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
|
||||
Log.outWarn(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellAuraTick: Spell {0} has non-existent spell {1} in EffectTriggered[{2}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
|
||||
}
|
||||
|
||||
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit target, Unit caster)
|
||||
@@ -4825,13 +4834,16 @@ namespace Game.Spells
|
||||
Unit triggerCaster = triggeredSpellInfo.NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target;
|
||||
if (triggerCaster != null)
|
||||
{
|
||||
int basepoints = GetAmount();
|
||||
triggerCaster.CastCustomSpell(target, triggerSpellId, basepoints, basepoints, basepoints, true, null, this);
|
||||
CastSpellExtraArgs args = new(this);
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, GetAmount());
|
||||
|
||||
triggerCaster.CastSpell(target, triggerSpellId, args);
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellWithValueAuraTick: Spell {0} Trigger {1}", GetId(), triggeredSpellInfo.Id);
|
||||
}
|
||||
}
|
||||
else
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellWithValueAuraTick: Spell {0} has non-existent spell {1} in EffectTriggered[{2}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
|
||||
Log.outWarn(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellWithValueAuraTick: Spell {0} has non-existent spell {1} in EffectTriggered[{2}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
|
||||
}
|
||||
|
||||
void HandlePeriodicDamageAurasTick(Unit target, Unit caster)
|
||||
@@ -4880,7 +4892,7 @@ namespace Game.Spells
|
||||
if (GetSpellInfo().SpellFamilyName == SpellFamilyNames.Warlock && GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00004000u))
|
||||
{
|
||||
if (caster.IsTypeId(TypeId.Player) && caster.ToPlayer().IsHonorOrXPTarget(target))
|
||||
caster.CastSpell(caster, 95810, true, null, this);
|
||||
caster.CastSpell(caster, 95810, new CastSpellExtraArgs(this));
|
||||
}
|
||||
|
||||
if (GetSpellInfo().SpellFamilyName == SpellFamilyNames.Generic)
|
||||
@@ -5231,7 +5243,10 @@ namespace Game.Spells
|
||||
if (manaFeedVal > 0)
|
||||
{
|
||||
int feedAmount = MathFunctions.CalculatePct(gainedAmount, manaFeedVal);
|
||||
caster.CastCustomSpell(caster, 32554, feedAmount, 0, 0, true, null, this);
|
||||
|
||||
CastSpellExtraArgs args = new(this);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, feedAmount);
|
||||
caster.CastSpell(caster, 32554, args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5367,7 +5382,7 @@ namespace Game.Spells
|
||||
if (triggeredSpellInfo != null)
|
||||
{
|
||||
Log.outDebug(LogFilter.Spells, $"AuraEffect.HandleProcTriggerSpellAuraProc: Triggering spell {triggeredSpellInfo.Id} from aura {GetId()} proc");
|
||||
triggerCaster.CastSpell(triggerTarget, triggeredSpellInfo, true, null, this);
|
||||
triggerCaster.CastSpell(triggerTarget, triggeredSpellInfo.Id, new CastSpellExtraArgs(this));
|
||||
}
|
||||
else if (triggerSpellId != 0 && GetAuraType() != AuraType.Dummy)
|
||||
Log.outError(LogFilter.Spells, $"AuraEffect.HandleProcTriggerSpellAuraProc: Could not trigger spell {triggerSpellId} from aura {GetId()} proc, because the spell does not have an entry in Spell.dbc.");
|
||||
@@ -5382,9 +5397,10 @@ namespace Game.Spells
|
||||
SpellInfo triggeredSpellInfo = Global.SpellMgr.GetSpellInfo(triggerSpellId, GetBase().GetCastDifficulty());
|
||||
if (triggeredSpellInfo != null)
|
||||
{
|
||||
int basepoints0 = GetAmount();
|
||||
Log.outDebug(LogFilter.Spells, "AuraEffect.HandleProcTriggerSpellWithValueAuraProc: Triggering spell {0} with value {1} from aura {2} proc", triggeredSpellInfo.Id, basepoints0, GetId());
|
||||
triggerCaster.CastCustomSpell(triggerTarget, triggerSpellId, basepoints0, 0, 0, true, null, this);
|
||||
CastSpellExtraArgs args = new(this);
|
||||
args.SpellValueOverrides.Add(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());
|
||||
}
|
||||
else
|
||||
Log.outError(LogFilter.Spells, "AuraEffect.HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell {0} from aura {1} proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId());
|
||||
@@ -5580,7 +5596,12 @@ namespace Game.Spells
|
||||
|
||||
// on apply cast summon spell
|
||||
if (apply)
|
||||
target.CastSpell(target, triggerSpellInfo, true, null, this);
|
||||
{
|
||||
CastSpellExtraArgs args = new CastSpellExtraArgs(TriggerCastFlags.FullMask);
|
||||
args.TriggeringAura = this;
|
||||
args.CastDifficulty = triggerSpellInfo.Difficulty;
|
||||
target.CastSpell(target, triggerSpellInfo.Id, args);
|
||||
}
|
||||
// on unapply we need to search for and remove the summoned creature
|
||||
else
|
||||
{
|
||||
|
||||
+101
-14
@@ -2026,7 +2026,7 @@ namespace Game.Spells
|
||||
|
||||
// Check for SPELL_ATTR7_INTERRUPT_ONLY_NONPLAYER
|
||||
if (missInfo == SpellMissInfo.None && m_spellInfo.HasAttribute(SpellAttr7.InterruptOnlyNonplayer) && !unit.IsTypeId(TypeId.Player))
|
||||
caster.CastSpell(unit, 32747, true);
|
||||
caster.CastSpell(unit, 32747, new CastSpellExtraArgs(true));
|
||||
|
||||
if (spellHitTarget != null)
|
||||
{
|
||||
@@ -2149,7 +2149,7 @@ namespace Game.Spells
|
||||
int[] basePoints = new int[SpellConst.MaxEffects];
|
||||
foreach (SpellEffectInfo auraSpellEffect in m_spellInfo.GetEffects())
|
||||
if (auraSpellEffect != null)
|
||||
basePoints[auraSpellEffect.EffectIndex] = (m_spellValue.CustomBasePointsMask & (1 << (int)auraSpellEffect.EffectIndex)) != 0 ?
|
||||
basePoints[auraSpellEffect.EffectIndex] = (m_spellValue.CustomBasePointsMask & (1 << (int)auraSpellEffect.EffectIndex)) != 0 ?
|
||||
m_spellValue.EffectBasePoints[auraSpellEffect.EffectIndex] : auraSpellEffect.CalcBaseValue(m_originalCaster, unit, m_castItemEntry, m_castItemLevel);
|
||||
|
||||
bool refresh = false;
|
||||
@@ -2260,7 +2260,7 @@ namespace Game.Spells
|
||||
{
|
||||
if (CanExecuteTriggersOnHit(effMask, hit.triggeredByAura) && RandomHelper.randChance(hit.chance))
|
||||
{
|
||||
m_caster.CastSpell(unit, hit.triggeredSpell, TriggerCastFlags.FullMask);
|
||||
m_caster.CastSpell(unit, hit.triggeredSpell.Id, new CastSpellExtraArgs(TriggerCastFlags.FullMask).SetCastDifficulty(hit.triggeredSpell.Difficulty));
|
||||
Log.outDebug(LogFilter.Spells, "Spell {0} triggered spell {1} by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo.Id, hit.triggeredSpell.Id);
|
||||
|
||||
// SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
|
||||
@@ -2291,9 +2291,9 @@ namespace Game.Spells
|
||||
foreach (var id in spellTriggered)
|
||||
{
|
||||
if (id < 0)
|
||||
unit.RemoveAurasDueToSpell((uint)-(id));
|
||||
unit.RemoveAurasDueToSpell((uint)-id);
|
||||
else
|
||||
unit.CastSpell(unit, (uint)id, true, null, null, m_caster.GetGUID());
|
||||
unit.CastSpell(unit, (uint)id, new CastSpellExtraArgs(m_caster.GetGUID()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2702,7 +2702,7 @@ namespace Game.Spells
|
||||
|
||||
// Should this be done for original caster?
|
||||
Player modOwner = m_caster.GetSpellModOwner();
|
||||
if (modOwner !=null)
|
||||
if (modOwner != null)
|
||||
{
|
||||
// Set spell which will drop charges for triggered cast spells
|
||||
// if not successfully casted, will be remove in finish(false)
|
||||
@@ -2904,7 +2904,7 @@ namespace Game.Spells
|
||||
if (spellId < 0)
|
||||
m_caster.RemoveAurasDueToSpell((uint)-spellId);
|
||||
else
|
||||
m_caster.CastSpell(m_targets.GetUnitTarget() ?? m_caster, (uint)spellId, true);
|
||||
m_caster.CastSpell(m_targets.GetUnitTarget() ?? m_caster, (uint)spellId, new CastSpellExtraArgs(true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4470,7 +4470,7 @@ namespace Game.Spells
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public SpellCastResult CheckCast(bool strict)
|
||||
{
|
||||
uint param1 = 0, param2 = 0;
|
||||
@@ -5167,7 +5167,7 @@ namespace Game.Spells
|
||||
{
|
||||
Pet pet = m_caster.ToPlayer().GetPet();
|
||||
if (pet != null)
|
||||
pet.CastSpell(pet, 32752, true, null, null, pet.GetGUID());
|
||||
pet.CastSpell(pet, 32752, new CastSpellExtraArgs(pet.GetGUID()));
|
||||
}
|
||||
}
|
||||
else if (!m_spellInfo.HasAttribute(SpellAttr1.DismissPet))
|
||||
@@ -6169,7 +6169,7 @@ namespace Game.Spells
|
||||
return SpellCastResult.DontReport;
|
||||
}
|
||||
else if ((efi = m_spellInfo.GetEffect(1)) != null)
|
||||
player.CastSpell(m_caster, (uint)efi.CalcValue(), false); // move this to anywhere
|
||||
player.CastSpell(m_caster, (uint)efi.CalcValue(), new CastSpellExtraArgs(false)); // move this to anywhere
|
||||
return SpellCastResult.DontReport;
|
||||
}
|
||||
}
|
||||
@@ -6545,7 +6545,7 @@ namespace Game.Spells
|
||||
{
|
||||
return m_powerCost.Any(cost => cost.Power == power);
|
||||
}
|
||||
|
||||
|
||||
bool UpdatePointers()
|
||||
{
|
||||
if (m_originalCasterGUID == m_caster.GetGUID())
|
||||
@@ -6620,7 +6620,7 @@ namespace Game.Spells
|
||||
{
|
||||
return m_caster.GetMap().GetDifficultyID();
|
||||
}
|
||||
|
||||
|
||||
bool CheckEffectTarget(Unit target, SpellEffectInfo effect, Position losPosition)
|
||||
{
|
||||
if (!effect.IsEffect())
|
||||
@@ -6750,7 +6750,7 @@ namespace Game.Spells
|
||||
{
|
||||
return m_spellInfo.IsPositive() && (m_triggeredByAuraSpell == null || m_triggeredByAuraSpell.IsPositive());
|
||||
}
|
||||
|
||||
|
||||
bool IsNeedSendToClient()
|
||||
{
|
||||
return m_SpellVisual.SpellXSpellVisualID != 0 || m_SpellVisual.ScriptVisualID != 0 || m_spellInfo.IsChanneled() ||
|
||||
@@ -7152,7 +7152,7 @@ namespace Game.Spells
|
||||
loadedScript._FinishScriptCall();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CallScriptObjectAreaTargetSelectHandlers(List<WorldObject> targets, uint effIndex, SpellImplicitTargetInfo targetType)
|
||||
{
|
||||
foreach (var script in m_loadedScripts)
|
||||
@@ -8141,4 +8141,91 @@ namespace Game.Spells
|
||||
Unit _victim;
|
||||
ObjectGuid _casterGuid;
|
||||
}
|
||||
|
||||
public class CastSpellExtraArgs
|
||||
{
|
||||
public TriggerCastFlags TriggerFlags;
|
||||
public Item CastItem;
|
||||
public AuraEffect TriggeringAura;
|
||||
public ObjectGuid OriginalCaster = ObjectGuid.Empty;
|
||||
public Difficulty CastDifficulty;
|
||||
public Dictionary<SpellValueMod, int> SpellValueOverrides = new();
|
||||
|
||||
public CastSpellExtraArgs() { }
|
||||
public CastSpellExtraArgs(bool triggered)
|
||||
{
|
||||
TriggerFlags = triggered ? TriggerCastFlags.FullMask : TriggerCastFlags.None;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(TriggerCastFlags trigger)
|
||||
{
|
||||
TriggerFlags = trigger;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(Item item)
|
||||
{
|
||||
TriggerFlags = TriggerCastFlags.FullMask;
|
||||
CastItem = item;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(AuraEffect eff)
|
||||
{
|
||||
TriggerFlags = TriggerCastFlags.FullMask;
|
||||
TriggeringAura = eff;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(ObjectGuid origCaster)
|
||||
{
|
||||
TriggerFlags = TriggerCastFlags.FullMask;
|
||||
OriginalCaster = origCaster;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(AuraEffect eff, ObjectGuid origCaster)
|
||||
{
|
||||
TriggerFlags = TriggerCastFlags.FullMask;
|
||||
TriggeringAura = eff;
|
||||
OriginalCaster = origCaster;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(Difficulty castDifficulty)
|
||||
{
|
||||
CastDifficulty = castDifficulty;
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs(SpellValueMod mod, int val)
|
||||
{
|
||||
SpellValueOverrides.Add(mod, val);
|
||||
}
|
||||
|
||||
public CastSpellExtraArgs SetTriggerFlags(TriggerCastFlags flag)
|
||||
{
|
||||
TriggerFlags = flag;
|
||||
return this;
|
||||
}
|
||||
public CastSpellExtraArgs SetCastItem(Item item)
|
||||
{
|
||||
CastItem = item;
|
||||
return this;
|
||||
}
|
||||
public CastSpellExtraArgs SetTriggeringAura(AuraEffect triggeringAura)
|
||||
{
|
||||
TriggeringAura = triggeringAura;
|
||||
return this;
|
||||
}
|
||||
public CastSpellExtraArgs SetOriginalCaster(ObjectGuid guid)
|
||||
{
|
||||
OriginalCaster = guid;
|
||||
return this;
|
||||
}
|
||||
public CastSpellExtraArgs SetCastDifficulty(Difficulty castDifficulty)
|
||||
{
|
||||
CastDifficulty = castDifficulty;
|
||||
return this;
|
||||
}
|
||||
public CastSpellExtraArgs AddSpellMod(SpellValueMod mod, int val)
|
||||
{
|
||||
SpellValueOverrides.Add(mod, val);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,17 +385,14 @@ namespace Game.Spells
|
||||
targets.SetUnitTarget(m_caster);
|
||||
}
|
||||
|
||||
Dictionary<SpellValueMod, int> values = new();
|
||||
CastSpellExtraArgs args = new(m_originalCasterGUID);
|
||||
// set basepoints for trigger with value effect
|
||||
if (effectInfo.Effect == SpellEffectName.TriggerSpellWithValue)
|
||||
{
|
||||
values.Add(SpellValueMod.BasePoint0, damage);
|
||||
values.Add(SpellValueMod.BasePoint1, damage);
|
||||
values.Add(SpellValueMod.BasePoint2, damage);
|
||||
}
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, damage);
|
||||
|
||||
// original caster guid only for GO cast
|
||||
m_caster.CastSpell(targets, spellInfo, values, TriggerCastFlags.FullMask, null, null, m_originalCasterGUID);
|
||||
m_caster.CastSpell(targets, spellInfo.Id, args);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.TriggerMissile)]
|
||||
@@ -434,18 +431,14 @@ namespace Game.Spells
|
||||
targets.SetUnitTarget(m_caster);
|
||||
}
|
||||
|
||||
Dictionary<SpellValueMod, int> values = new();
|
||||
CastSpellExtraArgs args = new(m_originalCasterGUID);
|
||||
// set basepoints for trigger with value effect
|
||||
if (effectInfo.Effect == SpellEffectName.TriggerMissileSpellWithValue)
|
||||
{
|
||||
// maybe need to set value only when basepoints == 0?
|
||||
values.Add(SpellValueMod.BasePoint0, damage);
|
||||
values.Add(SpellValueMod.BasePoint1, damage);
|
||||
values.Add(SpellValueMod.BasePoint2, damage);
|
||||
}
|
||||
for (int i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0 + i, damage);
|
||||
|
||||
// original caster guid only for GO cast
|
||||
m_caster.CastSpell(targets, spellInfo, values, TriggerCastFlags.FullMask, null, null, m_originalCasterGUID);
|
||||
m_caster.CastSpell(targets, spellInfo.Id, args);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.ForceCast)]
|
||||
@@ -479,25 +472,29 @@ namespace Game.Spells
|
||||
break;
|
||||
case 52463: // Hide In Mine Car
|
||||
case 52349: // Overtake
|
||||
unitTarget.CastCustomSpell(unitTarget, spellInfo.Id, damage, 0, 0, true, null, null, m_originalCasterGUID);
|
||||
return;
|
||||
{
|
||||
CastSpellExtraArgs args1 = new(m_originalCasterGUID);
|
||||
args1.SpellValueOverrides.Add(SpellValueMod.BasePoint0, damage);
|
||||
unitTarget.CastSpell(unitTarget, spellInfo.Id, args1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<SpellValueMod, int> values = new();
|
||||
// set basepoints for trigger with value effect
|
||||
if (effectInfo.Effect == SpellEffectName.ForceCastWithValue)
|
||||
switch (spellInfo.Id)
|
||||
{
|
||||
// maybe need to set value only when basepoints == 0?
|
||||
values.Add(SpellValueMod.BasePoint0, damage);
|
||||
values.Add(SpellValueMod.BasePoint1, damage);
|
||||
values.Add(SpellValueMod.BasePoint2, damage);
|
||||
case 72298: // Malleable Goo Summon
|
||||
unitTarget.CastSpell(unitTarget, spellInfo.Id, new CastSpellExtraArgs(m_originalCasterGUID));
|
||||
return;
|
||||
}
|
||||
|
||||
SpellCastTargets targets = new();
|
||||
targets.SetUnitTarget(m_caster);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
// 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);
|
||||
|
||||
unitTarget.CastSpell(targets, spellInfo, values, TriggerCastFlags.FullMask);
|
||||
unitTarget.CastSpell(m_caster, spellInfo.Id, args);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.TriggerSpell2)]
|
||||
@@ -516,7 +513,7 @@ namespace Game.Spells
|
||||
|
||||
Finish();
|
||||
|
||||
m_caster.CastSpell(null, spellInfo, false);
|
||||
m_caster.CastSpell((Unit)null, spellInfo.Id, new CastSpellExtraArgs(false));
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.Jump)]
|
||||
@@ -1748,11 +1745,13 @@ namespace Game.Spells
|
||||
spellId = spellInfo.Id;
|
||||
}
|
||||
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
|
||||
// if we have small value, it indicates seat position
|
||||
if (basePoints > 0 && basePoints < SharedConst.MaxVehicleSeats)
|
||||
m_originalCaster.CastCustomSpell(spellId, SpellValueMod.BasePoint0, basePoints, summon, true);
|
||||
else
|
||||
m_originalCaster.CastSpell(summon, spellId, true);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, basePoints);
|
||||
|
||||
m_originalCaster.CastSpell(summon, spellId, args);
|
||||
|
||||
uint faction = properties.Faction;
|
||||
if (faction == 0)
|
||||
@@ -2519,7 +2518,7 @@ namespace Game.Spells
|
||||
// Stormstrike
|
||||
AuraEffect aurEff = m_caster.IsScriptOverriden(m_spellInfo, 5634);
|
||||
if (aurEff != null)
|
||||
m_caster.CastSpell(m_caster, 38430, true, null, aurEff);
|
||||
m_caster.CastSpell(m_caster, 38430, new CastSpellExtraArgs(aurEff));
|
||||
break;
|
||||
}
|
||||
case SpellFamilyNames.Druid:
|
||||
@@ -2796,7 +2795,7 @@ namespace Game.Spells
|
||||
switch (m_spellInfo.Id)
|
||||
{
|
||||
case 45204: // Clone Me!
|
||||
m_caster.CastSpell(unitTarget, (uint)damage, true);
|
||||
m_caster.CastSpell(unitTarget, (uint)damage, new CastSpellExtraArgs(true));
|
||||
break;
|
||||
case 55693: // Remove Collapsing Cave Aura
|
||||
if (unitTarget == null)
|
||||
@@ -2811,7 +2810,7 @@ namespace Game.Spells
|
||||
|
||||
uint spell_id = RandomHelper.Rand32(20) != 0 ? 8854u : 8855u;
|
||||
|
||||
m_caster.CastSpell(m_caster, spell_id, true, null);
|
||||
m_caster.CastSpell(m_caster, spell_id, new CastSpellExtraArgs(true));
|
||||
return;
|
||||
}
|
||||
// Brittle Armor - need remove one 24575 Brittle Armor aura
|
||||
@@ -2845,7 +2844,7 @@ namespace Game.Spells
|
||||
return;
|
||||
|
||||
// Shadow Flame
|
||||
m_caster.CastSpell(unitTarget, 22682, true);
|
||||
m_caster.CastSpell(unitTarget, 22682, new CastSpellExtraArgs(true));
|
||||
return;
|
||||
}
|
||||
// Mirren's Drinking Hat
|
||||
@@ -2917,7 +2916,7 @@ namespace Game.Spells
|
||||
if (m_caster.ToPlayer().GetItemByPos(bag, slot).GetCount() == 1) m_caster.ToPlayer().RemoveItem(bag, slot, true);
|
||||
else m_caster.ToPlayer().GetItemByPos(bag, slot).SetCount(m_caster.ToPlayer().GetItemByPos(bag, slot).GetCount() - 1);
|
||||
// Spell 42518 (Braufest - Gratisprobe des Braufest herstellen)
|
||||
m_caster.CastSpell(m_caster, 42518, true);
|
||||
m_caster.CastSpell(m_caster, 42518, new CastSpellExtraArgs(true));
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -2929,7 +2928,7 @@ namespace Game.Spells
|
||||
//Workaround for Range ... should be global for every ScriptEffect
|
||||
float radius = effectInfo.CalcRadius();
|
||||
if (unitTarget != null && unitTarget.IsTypeId(TypeId.Player) && unitTarget.GetDistance(m_caster) >= radius && !unitTarget.HasAura(46394) && unitTarget != m_caster)
|
||||
unitTarget.CastSpell(unitTarget, 46394, true);
|
||||
unitTarget.CastSpell(unitTarget, 46394, new CastSpellExtraArgs(true));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2947,7 +2946,7 @@ namespace Game.Spells
|
||||
case 2: spellId = 46738; break;
|
||||
case 3: spellId = 46736; break;
|
||||
}
|
||||
unitTarget.CastSpell(unitTarget, spellId, true);
|
||||
unitTarget.CastSpell(unitTarget, spellId, new CastSpellExtraArgs(true));
|
||||
break;
|
||||
}
|
||||
// 5, 000 Gold
|
||||
@@ -2992,7 +2991,7 @@ namespace Game.Spells
|
||||
default: return;
|
||||
}
|
||||
|
||||
unitTarget.CastSpell(unitTarget, iTmpSpellId, true);
|
||||
unitTarget.CastSpell(unitTarget, iTmpSpellId, new CastSpellExtraArgs(true));
|
||||
Creature npc = unitTarget.ToCreature();
|
||||
npc.LoadEquipment();
|
||||
return;
|
||||
@@ -3003,7 +3002,7 @@ namespace Game.Spells
|
||||
if (m_originalCaster == null)
|
||||
return;
|
||||
|
||||
m_originalCaster.CastSpell(m_originalCaster, (uint)damage, false);
|
||||
m_originalCaster.CastSpell(m_originalCaster, (uint)damage, new CastSpellExtraArgs(false));
|
||||
break;
|
||||
}
|
||||
// Deathbolt from Thalgran Blightbringer
|
||||
@@ -3014,9 +3013,9 @@ namespace Game.Spells
|
||||
if (unitTarget == null)
|
||||
return;
|
||||
if (unitTarget.HasAura(51845))
|
||||
unitTarget.CastSpell(m_caster, 51856, true);
|
||||
unitTarget.CastSpell(m_caster, 51856, new CastSpellExtraArgs(true));
|
||||
else
|
||||
m_caster.CastSpell(unitTarget, 51855, true);
|
||||
m_caster.CastSpell(unitTarget, 51855, new CastSpellExtraArgs(true));
|
||||
break;
|
||||
}
|
||||
// Summon Ghouls On Scarlet Crusade
|
||||
@@ -3030,7 +3029,7 @@ namespace Game.Spells
|
||||
for (byte i = 0; i < 15; ++i)
|
||||
{
|
||||
m_caster.GetRandomPoint(destTarget, radius, out x, out y, out z);
|
||||
m_caster.CastSpell(x, y, z, 54522, true);
|
||||
m_caster.CastSpell(new Position(x, y, z), 54522, new CastSpellExtraArgs(true));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3041,11 +3040,11 @@ namespace Game.Spells
|
||||
return;
|
||||
case 52479: // Gift of the Harvester
|
||||
if (unitTarget != null && m_originalCaster != null)
|
||||
m_originalCaster.CastSpell(unitTarget, Convert.ToBoolean(RandomHelper.IRand(0, 1)) ? (uint)damage : 52505, true);
|
||||
m_originalCaster.CastSpell(unitTarget, Convert.ToBoolean(RandomHelper.IRand(0, 1)) ? (uint)damage : 52505, new CastSpellExtraArgs(true));
|
||||
return;
|
||||
case 53110: // Devour Humanoid
|
||||
if (unitTarget != null)
|
||||
unitTarget.CastSpell(m_caster, (uint)damage, true);
|
||||
unitTarget.CastSpell(m_caster, (uint)damage, new CastSpellExtraArgs(true));
|
||||
return;
|
||||
case 57347: // Retrieving (Wintergrasp RP-GG pickup spell)
|
||||
{
|
||||
@@ -3076,7 +3075,7 @@ namespace Game.Spells
|
||||
uint questID = (uint)m_spellInfo.GetEffect(1).CalcValue();
|
||||
|
||||
if (unitTarget.ToPlayer().GetQuestStatus(questID) == QuestStatus.Complete)
|
||||
unitTarget.CastSpell(unitTarget, spellID, true);
|
||||
unitTarget.CastSpell(unitTarget, spellID, new CastSpellExtraArgs(true));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -3085,18 +3084,18 @@ namespace Game.Spells
|
||||
{
|
||||
for (uint i = 0; i < 3; ++i)
|
||||
{
|
||||
m_originalCaster.CastSpell(unitTarget, 58689, true);
|
||||
m_originalCaster.CastSpell(unitTarget, 58692, true);
|
||||
m_originalCaster.CastSpell(unitTarget, 58689, new CastSpellExtraArgs(true));
|
||||
m_originalCaster.CastSpell(unitTarget, 58692, new CastSpellExtraArgs(true));
|
||||
}
|
||||
if (m_originalCaster.GetMap().GetDifficultyID() == Difficulty.None)
|
||||
{
|
||||
m_originalCaster.CastSpell(unitTarget, 58695, true);
|
||||
m_originalCaster.CastSpell(unitTarget, 58696, true);
|
||||
m_originalCaster.CastSpell(unitTarget, 58695, new CastSpellExtraArgs(true));
|
||||
m_originalCaster.CastSpell(unitTarget, 58696, new CastSpellExtraArgs(true));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_originalCaster.CastSpell(unitTarget, 60883, true);
|
||||
m_originalCaster.CastSpell(unitTarget, 60884, true);
|
||||
m_originalCaster.CastSpell(unitTarget, 60883, new CastSpellExtraArgs(true));
|
||||
m_originalCaster.CastSpell(unitTarget, 60884, new CastSpellExtraArgs(true));
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -3108,10 +3107,10 @@ namespace Game.Spells
|
||||
|
||||
// return from top
|
||||
if (unitTarget.ToPlayer().GetAreaId() == 4637)
|
||||
unitTarget.CastSpell(unitTarget, 59316, true);
|
||||
unitTarget.CastSpell(unitTarget, 59316, new CastSpellExtraArgs(true));
|
||||
// teleport atop
|
||||
else
|
||||
unitTarget.CastSpell(unitTarget, 59314, true);
|
||||
unitTarget.CastSpell(unitTarget, 59314, new CastSpellExtraArgs(true));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -3126,7 +3125,7 @@ namespace Game.Spells
|
||||
if (parent != null)
|
||||
{
|
||||
// @todo a hack, range = 11, should after some time cast, otherwise too far
|
||||
m_caster.CastSpell(parent, 62496, true);
|
||||
m_caster.CastSpell(parent, 62496, new CastSpellExtraArgs(true));
|
||||
unitTarget.CastSpell(parent, (uint)m_spellInfo.GetEffect(0).CalcValue());
|
||||
}
|
||||
}
|
||||
@@ -3157,7 +3156,7 @@ namespace Game.Spells
|
||||
Aura chargesAura = m_caster.GetAura(59907);
|
||||
if (chargesAura != null)
|
||||
{
|
||||
m_caster.CastSpell(unitTarget, spell_heal, true, null, null, m_caster.ToTempSummon().GetSummonerGUID());
|
||||
m_caster.CastSpell(unitTarget, spell_heal, new CastSpellExtraArgs(m_caster.ToTempSummon().GetSummonerGUID()));
|
||||
if (chargesAura.ModCharges(-1))
|
||||
m_caster.ToTempSummon().UnSummon();
|
||||
}
|
||||
@@ -3176,7 +3175,6 @@ namespace Game.Spells
|
||||
case 58590: // Rank 9
|
||||
case 58591: // Rank 10
|
||||
{
|
||||
int basepoints0 = damage;
|
||||
// Cast Absorb on totems
|
||||
for (byte slot = (int)SummonSlot.Totem; slot < SharedConst.MaxTotemSlot; ++slot)
|
||||
{
|
||||
@@ -3186,7 +3184,9 @@ namespace Game.Spells
|
||||
Creature totem = unitTarget.GetMap().GetCreature(unitTarget.m_SummonSlot[slot]);
|
||||
if (totem != null && totem.IsTotem())
|
||||
{
|
||||
m_caster.CastCustomSpell(totem, 55277, basepoints0, 0, 0, true);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, damage);
|
||||
m_caster.CastSpell(totem, 55277, args);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3588,7 +3588,9 @@ namespace Game.Spells
|
||||
player.DestroyItemCount(foodItem, ref count, true);
|
||||
// @todo fix crash when a spell has two effects, both pointed at the same item target
|
||||
|
||||
m_caster.CastCustomSpell(pet, effectInfo.TriggerSpell, benefit, 0, 0, true);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, benefit);
|
||||
m_caster.CastSpell(pet, effectInfo.TriggerSpell, args);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.DismissPet)]
|
||||
@@ -3962,7 +3964,7 @@ namespace Game.Spells
|
||||
m_caster.Attack(unitTarget, true);
|
||||
|
||||
if (effectInfo.TriggerSpell != 0)
|
||||
m_caster.CastSpell(unitTarget, effectInfo.TriggerSpell, true, null, null, m_originalCasterGUID);
|
||||
m_caster.CastSpell(unitTarget, effectInfo.TriggerSpell, new CastSpellExtraArgs(m_originalCasterGUID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3987,7 +3989,7 @@ namespace Game.Spells
|
||||
else if (effectHandleMode == SpellEffectHandleMode.Hit)
|
||||
{
|
||||
if (effectInfo.TriggerSpell != 0)
|
||||
m_caster.CastSpell(destTarget.GetPositionX(), destTarget.GetPositionY(), destTarget.GetPositionZ(), effectInfo.TriggerSpell, true, null, null, m_originalCasterGUID);
|
||||
m_caster.CastSpell(destTarget, effectInfo.TriggerSpell, new CastSpellExtraArgs(m_originalCasterGUID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4269,7 +4271,11 @@ namespace Game.Spells
|
||||
}
|
||||
MathFunctions.ApplyPct(ref mana, damage);
|
||||
if (mana != 0)
|
||||
m_caster.CastCustomSpell(m_caster, 39104, mana, 0, 0, true);
|
||||
{
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.FullMask);
|
||||
args.SpellValueOverrides.Add(SpellValueMod.BasePoint0, mana);
|
||||
m_caster.CastSpell(m_caster, 39104, args);
|
||||
}
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.DurabilityDamage)]
|
||||
@@ -5073,8 +5079,9 @@ namespace Game.Spells
|
||||
if (!spellInfo.HasAttribute(SpellAttr9.SummonPlayerTotem))
|
||||
continue;
|
||||
|
||||
TriggerCastFlags triggerFlags = (TriggerCastFlags.IgnoreGCD | TriggerCastFlags.IgnoreCastInProgress | TriggerCastFlags.CastDirectly | TriggerCastFlags.DontReportCastError);
|
||||
m_caster.CastSpell(m_caster, spellInfo, triggerFlags);
|
||||
CastSpellExtraArgs args = new(TriggerCastFlags.IgnoreGCD | TriggerCastFlags.IgnoreCastInProgress | TriggerCastFlags.CastDirectly | TriggerCastFlags.DontReportCastError);
|
||||
args.CastDifficulty = GetCastDifficulty();
|
||||
m_caster.CastSpell(m_caster, spellInfo.Id, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3053,6 +3053,7 @@ namespace Game.Entities
|
||||
case 52449: // Summon Skittering Infector (Force Cast)
|
||||
case 53609: // Summon Anub'ar Assassin (Force Cast)
|
||||
case 53457: // Summon Impale Trigger (AoE)
|
||||
case 45907: // Torch Target Picker
|
||||
spellInfo.MaxAffectedTargets = 1;
|
||||
break;
|
||||
case 36384: // Skartax Purple Beam
|
||||
|
||||
Reference in New Issue
Block a user