Scripts/SmartScripts: _SET_IN_COMBAT_WITH_ZONE and _CALL_FOR_HELP no longer use a target. Because that feature made no sense and was unused.

Port From (https://github.com/TrinityCore/TrinityCore/commit/f6ceb4bf0c5f95c043e90708e9369f7199a4201b)
This commit is contained in:
hondacrx
2021-10-30 20:21:02 -04:00
parent deea079d07
commit faa2360995
+9 -17
View File
@@ -958,33 +958,25 @@ namespace Game.AI
}
case SmartActions.SetInCombatWithZone:
{
foreach (var target in targets)
if (_me != null && _me.IsAIEnabled)
{
if (IsCreature(target))
{
Creature creature = target.ToCreature();
if (creature.IsAIEnabled)
creature.GetAI().DoZoneInCombat();
Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature: {_me.GetGUID()}, Target: {target.GetGUID()}");
}
_me.GetAI().DoZoneInCombat();
Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature: {_me.GetGUID()}");
}
break;
}
case SmartActions.CallForHelp:
{
foreach (var target in targets)
if (_me != null)
{
if (IsCreature(target))
_me.CallForHelp(e.Action.callHelp.range);
if (e.Action.callHelp.withEmote != 0)
{
target.ToCreature().CallForHelp(e.Action.callHelp.range);
if (e.Action.callHelp.withEmote != 0)
{
var builder = new BroadcastTextBuilder(_me, ChatMsg.Emote, (uint)BroadcastTextIds.CallForHelp, _me.GetGender());
Global.CreatureTextMgr.SendChatPacket(_me, builder, ChatMsg.MonsterEmote);
}
Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature: {_me.GetGUID()}, Target: {target.GetGUID()}");
var builder = new BroadcastTextBuilder(_me, ChatMsg.Emote, (uint)BroadcastTextIds.CallForHelp, _me.GetGender());
Global.CreatureTextMgr.SendChatPacket(_me, builder, ChatMsg.MonsterEmote);
}
Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature: {_me.GetGUID()}");
}
break;
}