summaryrefslogtreecommitdiff
path: root/docs/smart_scripts.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/smart_scripts.md')
-rw-r--r--docs/smart_scripts.md40
1 files changed, 22 insertions, 18 deletions
diff --git a/docs/smart_scripts.md b/docs/smart_scripts.md
index c9910ea..ac62390 100644
--- a/docs/smart_scripts.md
+++ b/docs/smart_scripts.md
@@ -59,6 +59,12 @@ The `smart_scripts` table has 30 attributes. It serves to make scripts in SQL la
- EntryOrGuid < 0: `guid` of the creature / game object / etc.
- **Depends on source\_type.**
+When using GUID-specific SAI, the extra_flag DONT_OVERRIDE_SAI_ENTRY allows us to not require duplicating rows shared between all creatures of the same entry.
+
+For example, you can keep all movement-related scripting in the GUID script, while combat scripting is handled by the ENTRY script.
+
+For creatures that use this flag, SAI row IDs cannot overlap, thus we use row IDs starting with 1000 and incrementing it (e.g. 1000, 1001, 1002, ...).
+
### source\_type
Object type: creature, game object, spell. see table below for values
@@ -200,7 +206,7 @@ This is the probability of the event to occur as a percentage from 0-100. So, if
| SMART_EVENT_JUST_CREATED | 63 | | | | | | |
| SMART_EVENT_GOSSIP_HELLO | 64 | | | | | | On Right-Click Creature/Gameobject that have gossip enabled. |
| SMART_EVENT_FOLLOW_COMPLETED | 65 | | | | | | |
-| SMART_EVENT_EVENT_PHASE_CHANGE | 66 | event phase mask | | | | | On event phase mask set |
+| SMART_EVENT_EVENT_PHASE_CHANGE | 66 | event phase mask | | | | | On event phase mask set |
| SMART_EVENT_IS_BEHIND_TARGET | 67 | CooldownMin | CooldownMax | | | | On Creature is behind target. |
| SMART_EVENT_GAME_EVENT_START | 68 | game_event.eventEntry | | | | | On game_event started. |
| SMART_EVENT_GAME_EVENT_END | 69 | game_event.eventEntry | | | | | On game_event ended. |
@@ -212,7 +218,7 @@ This is the probability of the event to occur as a percentage from 0-100. So, if
| SMART_EVENT_DISTANCE_CREATURE | 75 | database guid | database entry | distance | repeat interval (ms) | | On creature guid OR any instance of creature entry is within distance. |
| SMART_EVENT_DISTANCE_GAMEOBJECT | 76 | database guid | database entry | distance | repeat interval (ms) | | On gameobject guid OR any instance of gameobject entry is within distance. |
| SMART_EVENT_COUNTER_SET | 77 | counterID | value | cooldownMin | cooldownMax | | If the value of specified counterID is equal to a specified value |
-| SMART_EVENT_SUMMONED_UNIT_DIES | 82 | CreatureId(0 all) | CooldownMin | CooldownMax | | | |
+| SMART_EVENT_SUMMONED_UNIT_DIES | 82 | CreatureId(0 all) | CooldownMin | CooldownMax | | | |
| SMART_EVENT_NEAR_PLAYERS | 101 | minPlayers | Range (yards) | FirstCheck (ms) | RepeatCheck (ms) | | Event will trigger if there are more than minPlayers in range. |
| SMART_EVENT_NEAR_PLAYERS_NEGATION | 102 | maxPlayers | Range (yards) | FirstCheck (ms) | RepeatCheck (ms) | | Event will trigger if there are less than maxPlayers in range. |
@@ -335,19 +341,18 @@ This is the probability of the event to occur as a percentage from 0-100. So, if
| SMART_ACTION_GAME_EVENT_START | 112 | game_event.eventEntry | | | | | | |
| SMART_ACTION_START_CLOSEST_WAYPOINT | 113 | wp1 | wp2 | wp3 | wp4 | wp5 | wp6 | Make target follow closest waypoint to its location |
| SMART_ACTION_RISE_UP | 114 | distance | | | | | | move up for the specified distance (warning: TC 3.3.5 uses another action here: SMART_ACTION_MOVE_OFFSET) |
-| SMART_ACTION_RANDOM_SOUND | 115 | soundId1 | soundId2 | soundId3 | soundId4 | onlySelf (0/1) | distance | |
-| SMART_ACTION_SET_CORPSE_DELAY | 116 | timer | | | | | | |
-| SMART_ACTION_DISABLE_EVADE | 117 | 0/1 (1 = disabled, 0 = enabled) | | | | | | |
-| SMART_ACTION_GO_SET_GO_STATE | 118 | state | | | | | | |
+| SMART_ACTION_RANDOM_SOUND | 115 | soundId1 | soundId2 | soundId3 | soundId4 | onlySelf (0/1) | distance | |
+| SMART_ACTION_SET_CORPSE_DELAY | 116 | timer | | | | | | |
+| SMART_ACTION_DISABLE_EVADE | 117 | 0/1 (1 = disabled, 0 = enabled) | | | | | | |
+| SMART_ACTION_GO_SET_GO_STATE | 118 | state | | | | | | |
| SMART_ACTION_SET_SIGHT_DIST | 121 | SightDistance | | | | | | |
| SMART_ACTION_FLEE | 122 | FleeTime | | | | | | |
| SMART_ACTION_ADD_THREAT | 123 | +threat | -threat | | | | | |
| SMART_ACTION_LOAD_EQUIPMENT | 124 | Id | force | | | | | |
| SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT | 125 | id min range | id max range | | | | | |
-| SMART_ACTION_INVOKER_CAST | 134 | SpellId | [castFlags](#cast-flags) | [triggeredFlags](#triggered-flags) | limitTargets (0 = all) | | | Last used invoker will cast the spell. |
-| SMART_ACTION_PLAY_CINEMATIC | 135 | entry | | | | | | |
-| SMART_ACTION_SET_MOVEMENT_SPEED | 136 | movementType | speedInteger | speedFraction | | | | MOVE_WALK = 0, MOVE_RUN = 1, MOVE_RUN_BACK = 2, MOVE_SWIM = 3, MOVE_SWIM_BACK= 4, MOVE_TURN_RATE= 5, MOVE_FLIGHT = 6, MOVE_FLIGHT_BACK = 7, MOVE_PITCH_RATE = 8 |
-| SMART_ACTION_SET_HEALTH_PCT | 142 | percent | | | | | | |
+| SMART_ACTION_PLAY_CINEMATIC | 135 | entry | | | | | | |
+| SMART_ACTION_SET_MOVEMENT_SPEED | 136 | movementType | speedInteger | speedFraction | | | | MOVE_WALK = 0, MOVE_RUN = 1, MOVE_RUN_BACK = 2, MOVE_SWIM = 3, MOVE_SWIM_BACK= 4, MOVE_TURN_RATE= 5, MOVE_FLIGHT = 6, MOVE_FLIGHT_BACK = 7, MOVE_PITCH_RATE = 8 |
+| SMART_ACTION_SET_HEALTH_PCT | 142 | percent | | | | | | |
| SMART_ACTION_REMOVE_ALL_GAMEOBJECTS | 126 | | | | | | | |
| SMART_ACTION_MOVE_TO_POS_TARGET | 201 | pointId | | | | | | |
| SMART_ACTION_EXIT_VEHICLE | 203 | | | | | | | |
@@ -370,8 +375,9 @@ This is the probability of the event to occur as a percentage from 0-100. So, if
| SMART_ACTION_PLAYER_TALK | 220 | acore_string.id | yell? (0/1) | | | | | Make the player say something |
| SMART_ACTION_VORTEX_SUMMON | 221 | entry | Duration (ms)<br/>0 = permanent | Spiral scaling | Spiral appearance | range max | phi_delta | Allows you to summon creature in a customizable spiral(/vortex). Parameters can be confusing, exmaple parameters for testing: 5000 - summon duration, 5 - Spiral Scaling, 25 - spiral appearance, 60 - range max, 40 - phi delta |
| SMART_ACTION_CU_ENCOUNTER_START | 222 | | | | | | | Resets all cooldowns and removes exhausted debuffs when action is called |
-| SMART_ACTION_DO_ACTION | 223 | ActionId | | | | | | Allows to call for a DoAction in code |
-| SMART_ACTION_ATTACK_STOP | 224 | | | | | | | Stop melee, spell casting during combat, chasing the target and facing |
+| SMART_ACTION_DO_ACTION | 223 | ActionId | | | | | | Allows to call for a DoAction in code |
+| SMART_ACTION_ATTACK_STOP | 224 | | | | | | | Stop melee, spell casting during combat, chasing the target and facing |
+| SMART_ACTION_SET_GUID | 225 | 0/1 (0 = Self Guid, 0 = Invoker Guid) | Index | | | | | Allows the target to perform an action similar to DO_ACTION, but allows a guid to be sent |
### Predefined SAI templates
@@ -415,14 +421,12 @@ This is the probability of the event to occur as a percentage from 0-100. So, if
| SMART_TARGET_THREAT_LIST | 24 | maxDist (0 any) | | | | | | | | All units on creature's threat list within the specified distance if maxDist > 0 |
| SMART_TARGET_CLOSEST_ENEMY | 25 | maxDist | playerOnly (0/1) | | | | | | | Any attackable target (creature or player) within maxDist |
| SMART_TARGET_CLOSEST_FRIENDLY | 26 | maxDist | playerOnly (0/1) | | | | | | | Any friendly unit (creature, player or pet) within maxDist |
-| SMART_TARGET_LOOT_RECIPIENTS | 27 | | | | | | | | | All players that have tagged this creature (for kill credit) |
+| SMART_TARGET_LOOT_RECIPIENTS | 27 | | | | | | | | | All players that have tagged this creature (for kill credit) |
| SMART_TARGET_FARTHEST | 28 | maxDist | playerOnly (0/1) | isInLos (0/1) | | | | | | Farthest unit on the threat list |
-| SMART_TARGET_VEHICLE_PASSENGER | 29 | seat number (vehicle can target it's own accessory) | | | | | | | | |
+| SMART_TARGET_VEHICLE_PASSENGER | 29 | seat number (vehicle can target it's own accessory) | | | | | | | | |
| SMART_TARGET_PLAYER_WITH_AURA | 201 | spellID | Negative (0/1) | MaxDist | MinDist | | | | Number to resize the target list | Target players with or without aura |
-| SMART_TARGET_RANDOM_POINT | 201 | range (yards) | amount (for summoning creature) | self as middle (0/1)<br/>else use xyz | | | | | | This only works with SMART_ACTION_SUMMON_CREATURE, SMART_ACTION_MOVE_TO_POS and SMART_ACTION_JUMP_TO_POS |
-| SMART_TARGET_ROLE_SELECTION | 201 | rangeMax (yards) | TargetMask (Tanks (1), Healer (2) Damage (4)) | Resize list | | | | | | Target a Tank/Healer/DPS role. Based on the players spec. |
-| 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_RANDOM_POINT | 202 | range (yards) | amount (for summoning creature) | self as middle (0/1)<br/>else use xyz | | | | | | This only works with SMART_ACTION_SUMMON_CREATURE, SMART_ACTION_MOVE_TO_POS and SMART_ACTION_JUMP_TO_POS |
+| SMART_TARGET_ROLE_SELECTION | 203 | rangeMax (yards) | TargetMask (Tanks (1), Healer (2) Damage (4)) | Resize list | | | | | | Target a Tank/Healer/DPS role. Based on the players spec. |
| SMART_TARGET_SUMMONED_CREATURES | 204 | [creature_template.Entry](creature_template#entry) | | | | | | | | |
| SMART_TARGET_INSTANCE_STORAGE | 205 | data index | Type (creature (1), gameobject (2)) | | | | | | | |