feat(Core/AI): CU_SAI - Custom Target Options (#2879)

NEW:
* SMART_TARGET_PLAYER_WITH_AURA (spellid, negation?, distMax, distMin) - if target.O is set it will resize the list of targets to target.o
* SMART_TARGET_RANDOM_POINT (range, amount (for summon creature), self (creature is middle else use xyz) (ONLY USED FOR SUMMON CREATURE OR MOVE/JUMP TO POS ACTIONS FOR NOW)

MODIFIED:
* SMART_ACTION_SUMMON_CREATURE now possible to spawn multiple creatures with SMART_TARGET_RANDOM_POINT
* SMART_ACTION_MOVE_TO_POS/JUMP_TO_POS now possible to move to a random point with SMART_TARGET_RANDOM_POINT
* SMART_TARGET_PLAYER_RANGE no longer targets GMs or dead targets and when target.o is >0 it will try all possible targets in max instead of min-maxing


Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
This commit is contained in:
P-Kito
2020-04-18 16:59:52 +02:00
committed by GitHub
parent 63c86a9a14
commit 2514f8fc9a
7 changed files with 1033 additions and 677 deletions

View File

@@ -1294,7 +1294,7 @@ enum SMARTAI_TARGETS
SMART_TARGET_GAMEOBJECT_GUID = 14, // guid, entry
SMART_TARGET_GAMEOBJECT_DISTANCE = 15, // entry(0any), maxDist
SMART_TARGET_INVOKER_PARTY = 16, // invoker's party members
SMART_TARGET_PLAYER_RANGE = 17, // min, max, maxCount (maxCount by pussywizard)
SMART_TARGET_PLAYER_RANGE = 17, // min, max, maxCount (maxCount by pussywizard), set target.o to 1 if u want to search for all in range if min, max fails
SMART_TARGET_PLAYER_DISTANCE = 18, // maxDist
SMART_TARGET_CLOSEST_CREATURE = 19, // CreatureEntry(0any), maxDist, dead?
SMART_TARGET_CLOSEST_GAMEOBJECT = 20, // entry(0any), maxDist
@@ -1308,7 +1308,17 @@ enum SMARTAI_TARGETS
SMART_TARGET_FARTHEST = 28, // maxDist, playerOnly, isInLos
SMART_TARGET_VEHICLE_PASSENGER = 29, // TODO: NOT SUPPORTED YET
SMART_TARGET_END = 30
SMART_TARGET_TC_END = 30, // placeholder
// AC-only SmartTargets:
SMART_TARGET_AC_START = 200, // placeholder
SMART_TARGET_PLAYER_WITH_AURA = 201, // spellId, negation, MaxDist, MinDist, set target.o to a number to random resize the list
SMART_TARGET_RANDOM_POINT = 202, // range, amount (for summoning creature), self als middle (0/1) else use xyz
SMART_TARGET_ROLE_SELECTION = 203, // Range Max, TargetMask (Tanks (1), Healer (2) Damage (4)), resize list
SMART_TARGET_AC_END = 204 // placeholder
};
struct SmartTarget
@@ -1359,6 +1369,13 @@ struct SmartTarget
uint32 getFromHashMap; // Does not work in instances
} unitGUID;
struct
{
uint32 maxDist;
uint32 roleMask;
uint32 resize;
} roleSelection;
struct
{
uint32 creature;
@@ -1432,6 +1449,21 @@ struct SmartTarget
uint32 playerOnly;
} closestFriendly;
struct
{
uint32 range;
uint32 amount;
uint32 self;
} randomPoint;
struct
{
uint32 spellId;
uint32 negation;
uint32 distMax;
uint32 distMin;
} playerWithAura;
struct
{
uint32 param1;
@@ -1442,6 +1474,13 @@ struct SmartTarget
};
};
enum SmartTargetRoleFlags
{
SMART_TARGET_ROLE_FLAG_TANKS = 0x001,
SMART_TARGET_ROLE_FLAG_HEALERS = 0x002,
SMART_TARGET_ROLE_FLAG_DAMAGERS = 0x004
};
enum eSmartAI
{
SMART_EVENT_PARAM_COUNT = 4,