Core/SAI: Add new action SMART_ACTION_SET_HEALTH_PCT
Port From (https://github.com/TrinityCore/TrinityCore/commit/4c30b2a1827b81774136d37cb521dbd5823c3423)
This commit is contained in:
@@ -1515,6 +1515,15 @@ namespace Game.AI
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: Deprecated Event:({e}) skipped.");
|
||||
break;
|
||||
}
|
||||
case SmartActions.SetHealthPct:
|
||||
{
|
||||
if (e.Action.setHealthPct.percent > 100 || e.Action.setHealthPct.percent == 0)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"SmartAIMgr: {e} is trying to set invalid HP percent {e.Action.setHealthPct.percent}, skipped.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SmartActions.CreateConversation:
|
||||
{
|
||||
if (Global.ConversationDataStorage.GetConversationTemplate(e.Action.conversation.id) == null)
|
||||
@@ -2666,6 +2675,9 @@ namespace Game.AI
|
||||
[FieldOffset(4)]
|
||||
public Evade evade;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public SetHealthPct setHealthPct;
|
||||
|
||||
[FieldOffset(4)]
|
||||
public Conversation conversation;
|
||||
|
||||
@@ -3218,6 +3230,10 @@ namespace Game.AI
|
||||
{
|
||||
public uint toRespawnPosition;
|
||||
}
|
||||
public struct SetHealthPct
|
||||
{
|
||||
public uint percent;
|
||||
}
|
||||
public struct Conversation
|
||||
{
|
||||
public uint id;
|
||||
|
||||
Reference in New Issue
Block a user