From 7602666b8620e16efb0bb64bc70a9ef80ce94994 Mon Sep 17 00:00:00 2001 From: Emagi Date: Thu, 15 May 2025 09:50:31 -0400 Subject: [PATCH] Additional LUA Doc and slash commands --- docs/lua_functions/MakeRandomInt.md | 24 +++++++++---------- docs/lua_functions/OpenDoor.md | 22 ++++++++---------- docs/lua_functions/PauseMovement.md | 23 +++++++++---------- docs/lua_functions/SetInvulnerable.md | 23 +++++++++---------- docs/lua_functions/SetPlayerLevel.md | 27 +++++++++------------- docs/lua_functions/SetSeeHide.md | 33 +++++++++------------------ docs/lua_functions/SetSeeInvis.md | 23 +++++++++---------- docs/lua_functions/SetTarget.md | 26 ++++++++++----------- docs/slash_commands/invite.md | 13 +++++++++++ docs/slash_commands/invulnerable.md | 16 +++++++++++++ 10 files changed, 117 insertions(+), 113 deletions(-) create mode 100644 docs/slash_commands/invite.md create mode 100644 docs/slash_commands/invulnerable.md diff --git a/docs/lua_functions/MakeRandomInt.md b/docs/lua_functions/MakeRandomInt.md index fb84a0b..0421815 100644 --- a/docs/lua_functions/MakeRandomInt.md +++ b/docs/lua_functions/MakeRandomInt.md @@ -1,17 +1,17 @@ -### Function: MakeRandomInt(param1, param2) +Function: MakeRandomInt(Min, Max) -**Description:** -Placeholder description. +Description: Generates a random integer between the specified minimum and maximum values (inclusive). -**Parameters:** -- `param1`: unknown - Unknown type. -- `param2`: unknown - Unknown type. +Parameters: -**Returns:** None. + Min: Int32 – The minimum value. -**Example:** + Max: Int32 – The maximum value. -```lua --- Example usage -MakeRandomInt(..., ...) -``` +Returns: Int32 – A random integer N where Min ≤ N ≤ Max. + +Example: + +-- Example usage (roll a random amount of coin to reward) +local reward = MakeRandomInt(100, 500) -- between 100 and 500 copper +AddCoin(Player, reward) \ No newline at end of file diff --git a/docs/lua_functions/OpenDoor.md b/docs/lua_functions/OpenDoor.md index 9b85574..4ffbeae 100644 --- a/docs/lua_functions/OpenDoor.md +++ b/docs/lua_functions/OpenDoor.md @@ -1,18 +1,14 @@ -### Function: OpenDoor(param1, param2, param3) +Function: OpenDoor(DoorSpawn) -**Description:** -Placeholder description. +Description: Opens a door spawn in the world. This will play the door’s open animation and typically allow passage. The door remains open until closed by script or by its own auto-close timer if any. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: bool - Boolean value (true/false). +Parameters: -**Returns:** None. + DoorSpawn: Spawn – The door object to open (must be a door interactive spawn). -**Example:** +Returns: None. -```lua --- Example usage -OpenDoor(..., ..., ...) -``` +Example: + +-- Example usage (open a secret door when puzzle is solved) +OpenDoor(SecretDoor) \ No newline at end of file diff --git a/docs/lua_functions/PauseMovement.md b/docs/lua_functions/PauseMovement.md index b8577d0..681d1dd 100644 --- a/docs/lua_functions/PauseMovement.md +++ b/docs/lua_functions/PauseMovement.md @@ -1,17 +1,16 @@ -### Function: PauseMovement(param1, param2) +Function: PauseMovement(Spawn, DurationMS) -**Description:** -Placeholder description. +Description: Pauses the given NPC’s movement for the specified duration (in milliseconds). The NPC will stop moving along waypoints or patrols, and then resume after the pause. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int32 - Integer value. +Parameters: -**Returns:** None. + Spawn: Spawn – The NPC to pause. -**Example:** + DurationMS: Int32 – How long to pause movement, in milliseconds. -```lua --- Example usage -PauseMovement(..., ...) -``` +Returns: None. + +Example: + +-- Example usage (stop a guard for 5 seconds when hailed) +PauseMovement(GuardNPC, 5000) \ No newline at end of file diff --git a/docs/lua_functions/SetInvulnerable.md b/docs/lua_functions/SetInvulnerable.md index d6b89f0..295e513 100644 --- a/docs/lua_functions/SetInvulnerable.md +++ b/docs/lua_functions/SetInvulnerable.md @@ -1,17 +1,16 @@ -### Function: SetInvulnerable(param1, param2) +Function: SetInvulnerable(Spawn, Enable) -**Description:** -Placeholder description. +Description: Toggles an entity’s invulnerability. When set to true, the spawn will not take damage from any source. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: bool - Boolean value (true/false). +Parameters: -**Returns:** None. + Spawn: Spawn – The entity to modify. -**Example:** + Enable: Boolean – true to make invulnerable; false to remove invulnerability. -```lua --- Example usage -SetInvulnerable(..., ...) -``` +Returns: None. + +Example: + +-- Example usage (make an NPC invulnerable during a dialogue scene) +SetInvulnerable(QuestNPC, true) \ No newline at end of file diff --git a/docs/lua_functions/SetPlayerLevel.md b/docs/lua_functions/SetPlayerLevel.md index 647af63..2e9a7d3 100644 --- a/docs/lua_functions/SetPlayerLevel.md +++ b/docs/lua_functions/SetPlayerLevel.md @@ -1,21 +1,16 @@ -### Function: SetPlayerLevel(param1, param2, param3, param4, param5, param6) +Function: SetPlayerLevel(Player, Level) -**Description:** -Placeholder description. +Description: Sets the player’s adventure level to the specified value. This is an administrative function (normally level changes by experience gain), allowing GM or script to directly change level. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: unknown - Unknown type. -- `param5`: unknown - Unknown type. -- `param6`: int8 - Small integer or boolean flag. +Parameters: -**Returns:** None. + Player: Spawn – The player whose level to change. -**Example:** + Level: Int32 – The new level to set. -```lua --- Example usage -SetPlayerLevel(..., ..., ..., ..., ..., ...) -``` +Returns: None. + +Example: + +-- Example usage (GM tool leveling a player to 50) +SetPlayerLevel(Player, 50) \ No newline at end of file diff --git a/docs/lua_functions/SetSeeHide.md b/docs/lua_functions/SetSeeHide.md index cb234fe..40b9943 100644 --- a/docs/lua_functions/SetSeeHide.md +++ b/docs/lua_functions/SetSeeHide.md @@ -1,27 +1,16 @@ -### Function: SetSeeHide(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12) +Function: SetSeeHide(Spawn, Enable) -**Description:** -Placeholder description. +Description: Toggles an NPC’s ability to see hidden/stealthed entities on or off. “Hide” usually refers to stealth as opposed to magical invisibility. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: Spawn - The spawn or entity involved. -- `param3`: Spawn - The spawn or entity involved. -- `param4`: Spawn - The spawn or entity involved. -- `param5`: int8 - Small integer or boolean flag. -- `param6`: Spawn - The spawn or entity involved. -- `param7`: int32 - Integer value. -- `param8`: string - String value. -- `param9`: string - String value. -- `param10`: string - String value. -- `param11`: int8 - Small integer or boolean flag. -- `param12`: int8 - Small integer or boolean flag. +Parameters: -**Returns:** None. + Spawn: Spawn – The NPC in question. -**Example:** + Enable: Boolean – true to grant see-stealth; false to remove it. -```lua --- Example usage -SetSeeHide(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...) -``` +Returns: None. + +Example: + +-- Example usage (guards become alert and can see stealth during an alarm event) +SetSeeHide(GuardNPC, true) \ No newline at end of file diff --git a/docs/lua_functions/SetSeeInvis.md b/docs/lua_functions/SetSeeInvis.md index dc9fa28..8ee8105 100644 --- a/docs/lua_functions/SetSeeInvis.md +++ b/docs/lua_functions/SetSeeInvis.md @@ -1,17 +1,16 @@ -### Function: SetSeeInvis(param1, param2) +Function: SetSeeInvis(Spawn, Enable) -**Description:** -Placeholder description. +Description: Toggles an NPC’s ability to see invisible on or off. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: int8 - Small integer or boolean flag. +Parameters: -**Returns:** None. + Spawn: Spawn – The NPC whose invis detection to set. -**Example:** + Enable: Boolean – true to grant see-invis; false to revoke it. -```lua --- Example usage -SetSeeInvis(..., ...) -``` +Returns: None. + +Example: + +-- Example usage (temporarily allow a boss to see invis during a phase) +SetSeeInvis(BossNPC, true) \ No newline at end of file diff --git a/docs/lua_functions/SetTarget.md b/docs/lua_functions/SetTarget.md index a0bc216..1ae856e 100644 --- a/docs/lua_functions/SetTarget.md +++ b/docs/lua_functions/SetTarget.md @@ -1,19 +1,17 @@ -### Function: SetTarget(param1, param2, param3, param4) +Function: SetTarget(Originator, Target) -**Description:** -Placeholder description. +Description: Forces one spawn (Originator) to target another (Target). This can make an NPC switch targets mid-combat or cause a player’s target to change under certain conditions. -**Parameters:** -- `param1`: Spawn - The spawn or entity involved. -- `param2`: unknown - Unknown type. -- `param3`: unknown - Unknown type. -- `param4`: Spawn - The spawn or entity involved. +Parameters: -**Returns:** None. + Originator: Spawn – The entity whose target will be changed. -**Example:** + Target: Spawn – The entity to set as the new target. -```lua --- Example usage -SetTarget(..., ..., ..., ...) -``` +Returns: None. + +Example: + +-- Example usage (boss switches target to a healer) +SetTarget(BossNPC, HealerNPC) +SetInfoFlag(BossNPC) -- assures we send the changes out immediately versus waiting for process loop \ No newline at end of file diff --git a/docs/slash_commands/invite.md b/docs/slash_commands/invite.md new file mode 100644 index 0000000..c80e24f --- /dev/null +++ b/docs/slash_commands/invite.md @@ -0,0 +1,13 @@ +### Command: /invite name + +**Handler Macro:** COMMAND_GROUPINVITE + +**Handler Value:** 15 + +**Required Status:** 0 + +**Arguments:** +- `arg[0]`: `string name` + +**Notes:** +- Invites a target player to group or otherwise uses the `name` argument to invite a character of the name. \ No newline at end of file diff --git a/docs/slash_commands/invulnerable.md b/docs/slash_commands/invulnerable.md new file mode 100644 index 0000000..c180792 --- /dev/null +++ b/docs/slash_commands/invulnerable.md @@ -0,0 +1,16 @@ +### Command: /invulnerable val + +**Handler Macro:** COMMAND_INVULNERABLE + +**Handler Value:** 93 + +**Required Status:** 10 + +**Arguments:** +- `arg[0]`: `int val` + +**Usage Examples:** +- `/invulnerable [0/1]");` + +**Notes:** +- GM Command to make you invulnerable to damage physical and atmospheric. \ No newline at end of file