AI/SmartScripts: Replace SMART_ACTION_INVOKER_CAST with SMART_ACTION_SELF_CAST in action 85. SMART_ACTION_INVOKER_CAST moves to 134.
Port From (https://github.com/TrinityCore/TrinityCore/commit/0aee79dfb8027e8b35472f5f61eb4f318528c951)
This commit is contained in:
@@ -339,7 +339,7 @@ namespace Framework.Constants
|
||||
AddNpcFlag = 82, // Flags
|
||||
RemoveNpcFlag = 83, // Flags
|
||||
SimpleTalk = 84, // Groupid, Can Be Used To Make Players Say Groupid, TextOver Event Is Not Triggered, Whisper Can Not Be Used (Target Units Will Say The Text)
|
||||
InvokerCast = 85, // Spellid, Castflags, If Avaliable, Last Used Invoker Will Cast Spellid With Castflags On Targets
|
||||
SelfCast = 85, // Spellid, Castflags
|
||||
CrossCast = 86, // Spellid, Castflags, Castertargettype, Castertarget Param1, Castertarget Param2, Castertarget Param3, ( + The Origonal Target Fields As Destination Target), Castertargets Will Cast Spellid On All Targets (Use With Caution If Targeting Multiple * Multiple Units)
|
||||
CallRandomTimedActionlist = 87, // Script9 Ids 1-9
|
||||
CallRandomRangeTimedActionlist = 88, // Script9 Id Min, Max
|
||||
@@ -388,7 +388,7 @@ namespace Framework.Constants
|
||||
SpawnSpawngroup = 131, // Group ID, min secs, max secs, spawnflags
|
||||
DespawnSpawngroup = 132, // Group ID, min secs, max secs, spawnflags
|
||||
RespawnBySpawnId = 133, // spawnType, spawnId
|
||||
// 134 : 3.3.5 reserved
|
||||
InvokerCast = 134, // spellID, castFlags
|
||||
PlayCinematic = 135, // reserved for future uses
|
||||
SetMovementSpeed = 136, // movementType, speedInteger, speedFraction
|
||||
PlaySpellVisualKit = 137, // spellVisualKitId, kitType (unknown values, copypaste from packet dumps), duration
|
||||
|
||||
@@ -1070,6 +1070,7 @@ namespace Game.AI
|
||||
}
|
||||
// no break
|
||||
goto case SmartActions.AddAura;
|
||||
case SmartActions.SelfCast:
|
||||
case SmartActions.AddAura:
|
||||
if (!IsSpellValid(e, e.Action.cast.spell))
|
||||
return false;
|
||||
|
||||
@@ -498,6 +498,39 @@ namespace Game.AI
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.SelfCast:
|
||||
{
|
||||
if (targets.Empty())
|
||||
break;
|
||||
|
||||
if (e.Action.cast.targetsLimit != 0)
|
||||
targets.RandomResize(e.Action.cast.targetsLimit);
|
||||
|
||||
TriggerCastFlags triggerFlags = TriggerCastFlags.None;
|
||||
if (e.Action.cast.castFlags.HasAnyFlag((uint)SmartCastFlags.Triggered))
|
||||
{
|
||||
if (e.Action.cast.triggerFlags != 0)
|
||||
triggerFlags = (TriggerCastFlags)e.Action.cast.triggerFlags;
|
||||
else
|
||||
triggerFlags = TriggerCastFlags.FullMask;
|
||||
}
|
||||
|
||||
foreach (WorldObject target in targets)
|
||||
{
|
||||
Unit uTarget = target.ToUnit();
|
||||
if (uTarget == null)
|
||||
continue;
|
||||
|
||||
if (!e.Action.cast.castFlags.HasAnyFlag((uint)SmartCastFlags.AuraNotPresent) || !uTarget.HasAura(e.Action.cast.spell))
|
||||
{
|
||||
if (e.Action.cast.castFlags.HasAnyFlag((uint)SmartCastFlags.InterruptPrevious))
|
||||
uTarget.InterruptNonMeleeSpells(false);
|
||||
|
||||
uTarget.CastSpell(uTarget, e.Action.cast.spell, new CastSpellExtraArgs(triggerFlags));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.InvokerCast:
|
||||
{
|
||||
Unit tempLastInvoker = GetLastInvoker(unit);
|
||||
@@ -507,7 +540,7 @@ namespace Game.AI
|
||||
if (targets.Empty())
|
||||
break;
|
||||
|
||||
if (e.Action.cast.targetsLimit > 0 && targets.Count > e.Action.cast.targetsLimit)
|
||||
if (e.Action.cast.targetsLimit != 0)
|
||||
targets.RandomResize(e.Action.cast.targetsLimit);
|
||||
|
||||
foreach (var target in targets)
|
||||
|
||||
Reference in New Issue
Block a user