From c4fe6e7230b54d31e50ef012245d2b819538033f Mon Sep 17 00:00:00 2001 From: Emagi Date: Wed, 28 May 2025 21:48:33 -0400 Subject: [PATCH] lua functions fixed the formatting --- docs/lua_functions/AddIconValue.md | 16 +++++----- docs/lua_functions/AddQuestPrereqClass.md | 18 ++++++----- .../AddQuestStepFailureAction.md | 23 +++++++------- docs/lua_functions/AddSkill.md | 25 +++++++++------- docs/lua_functions/AddSpawnProximity.md | 25 +++++++++------- docs/lua_functions/AddSpawnSpellBonus.md | 20 +++++++------ docs/lua_functions/AddSpellTimer.md | 23 +++++++------- docs/lua_functions/AddThreatTransfer.md | 22 +++++++------- docs/lua_functions/AddToWard.md | 17 ++++++----- docs/lua_functions/AddWard.md | 30 ++++++++++--------- docs/lua_functions/AddWaypoint.md | 24 ++++++++------- docs/lua_functions/BlurVision.md | 18 ++++++----- docs/lua_functions/BreatheUnderwater.md | 19 ++++++------ docs/lua_functions/CanHarvest.md | 18 ++++++----- docs/lua_functions/CanSeeInvis.md | 18 ++++++----- docs/lua_functions/CancelSpell.md | 14 +++++---- docs/lua_functions/Charm.md | 19 ++++++------ docs/lua_functions/CheckLOS.md | 19 ++++++------ docs/lua_functions/CheckLOSByCoordinates.md | 25 ++++++++-------- docs/lua_functions/CheckRaceType.md | 19 ++++++------ docs/lua_functions/ClearEncounter.md | 16 +++++----- docs/lua_functions/ClearHate.md | 18 ++++++----- docs/lua_functions/ClearRunback.md | 16 +++++----- docs/lua_functions/CloseDoor.md | 18 ++++++----- docs/lua_functions/CompareSpawns.md | 19 ++++++------ docs/lua_functions/CompleteTransmute.md | 16 +++++----- docs/lua_functions/CopySpawnAppearance.md | 19 ++++++------ docs/lua_functions/CreateOptionWindow.md | 14 +++++---- docs/lua_functions/IsOpen.md | 16 +++++----- docs/lua_functions/IsPet.md | 16 +++++----- docs/lua_functions/IsPlayer.md | 6 ++-- docs/lua_functions/MakeRandomInt.md | 19 ++++++------ docs/lua_functions/OpenDoor.md | 16 +++++----- docs/lua_functions/PauseMovement.md | 19 ++++++------ docs/lua_functions/ProcHate.md | 22 +++++++------- docs/lua_functions/RemoveSpawnSpellBonus.md | 16 +++++----- docs/lua_functions/RemoveWaypoint.md | 18 ++++++----- .../ResetCharacterTitlePrefix.md | 16 +++++----- .../ResetCharacterTitleSuffix.md | 16 +++++----- docs/lua_functions/Runback.md | 16 +++++----- docs/lua_functions/SendWaypoints.md | 16 +++++----- docs/lua_functions/SetHP.md | 20 ++++++------- docs/lua_functions/SetInvulnerable.md | 19 ++++++------ docs/lua_functions/SetPlayerLevel.md | 19 ++++++------ docs/lua_functions/SetSeeHide.md | 19 ++++++------ docs/lua_functions/SetSeeInvis.md | 19 ++++++------ docs/lua_functions/SetTarget.md | 19 ++++++------ 47 files changed, 474 insertions(+), 401 deletions(-) diff --git a/docs/lua_functions/AddIconValue.md b/docs/lua_functions/AddIconValue.md index 5aa58e2..f220104 100644 --- a/docs/lua_functions/AddIconValue.md +++ b/docs/lua_functions/AddIconValue.md @@ -1,14 +1,16 @@ -Function: AddIconValue(Spawn, Value) +### Function: AddIconValue(Spawn, Value) -Description: Add an icon value to the Spawn (this is not confirmed functional). +**Description:** Add an icon value to the Spawn (this is not confirmed functional). -Parameters: - Spawn: Spawn - The spawn or entity involved. - Value: UInt32 - icon value to be added. +**Parameters:** +`Spawn`: Spawn - The spawn or entity involved. + `Value`: UInt32 - icon value to be added. -Returns: Boolean: True if successful, otherwise False.. +**Returns:** Boolean: True if successful, otherwise False.. -Example: +**Example:** +```lua -- Example usage AddIconValue(Spawn, Value) +``` diff --git a/docs/lua_functions/AddQuestPrereqClass.md b/docs/lua_functions/AddQuestPrereqClass.md index 1fc4b77..0635df6 100644 --- a/docs/lua_functions/AddQuestPrereqClass.md +++ b/docs/lua_functions/AddQuestPrereqClass.md @@ -1,14 +1,16 @@ -Function: AddQuestPrereqClass(Quest: quest, Int8: ClassID) +### Function: AddQuestPrereqClass(Quest: quest, Int8: ClassID) -Description: Add a pre requirement class to the Quest. +**Description:** Add a pre requirement class to the Quest. -Parameters: - quest: Quest - Quest to apply the class pre req. - ClassID: Int8 - class id from the classes ID's. +**Parameters:** +`quest`: Quest - Quest to apply the class pre req. +`ClassID`: Int8 - class id from the classes ID's. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage: Restricts Quest to Inquisitor(14) class. -AddQuestPrereqClass(Quest, 14) \ No newline at end of file +AddQuestPrereqClass(Quest, 14) +``` \ No newline at end of file diff --git a/docs/lua_functions/AddQuestStepFailureAction.md b/docs/lua_functions/AddQuestStepFailureAction.md index 00abf7f..ee321fc 100644 --- a/docs/lua_functions/AddQuestStepFailureAction.md +++ b/docs/lua_functions/AddQuestStepFailureAction.md @@ -1,18 +1,17 @@ -Function: AddQuestStepFailureAction(Quest, Step, FunctionName) +### Function: AddQuestStepFailureAction(Quest, Step, FunctionName) -Description: Associates a Lua function (by name) to be called if the specified quest step fails. This allows custom script handling when a step’s failure condition is met (e.g., timer runs out). +**Description:** Associates a Lua function (by name) to be called if the specified quest step fails. This allows custom script handling when a step’s failure condition is met (e.g., timer runs out). -Parameters: +**Parameters:** +`Quest`: Quest – The quest object. +`Step`: Int32 – The step number to attach the failure action to. +`FunctionName`: String – The name of a Lua function to call on failure. - Quest: Quest – The quest object. +**Returns:** None. - Step: Int32 – The step number to attach the failure action to. - - FunctionName: String – The name of a Lua function to call on failure. - -Returns: None. - -Example: +**Example:** +```lua -- Example usage (if step 2 fails, call "OnStealthFail" in the quest script) -AddQuestStepFailureAction(Quest, 2, "OnStealthFail") \ No newline at end of file +AddQuestStepFailureAction(Quest, 2, "OnStealthFail") +``` \ No newline at end of file diff --git a/docs/lua_functions/AddSkill.md b/docs/lua_functions/AddSkill.md index 875ed31..9ee7ced 100644 --- a/docs/lua_functions/AddSkill.md +++ b/docs/lua_functions/AddSkill.md @@ -1,18 +1,21 @@ -Function: AddSkill(Spawn, SkillID, CurrentVal, MaxVal, MoreToAdd) +### Function: AddSkill(Spawn, SkillID, CurrentVal, MaxVal, MoreToAdd) -Description: Grants a new skill to the specified player. If the player does not already have the skill in their skill list, this will add it (usually at base level). +**Description:** Grants a new skill to the specified player. If the player does not already have the skill in their skill list, this will add it (usually at base level). -Parameters: +**Parameters:** - Spawn: Spawn – The player to grant the skill to. - SkillID: Int32 – The ID of the skill to add. - CurrentVal: Int16 – The current value the player will have in the skill. - MaxVal: Int16 – The max skill the player can receive with the current skill. - MoreToAdd: Boolean – When set to true, we skip sending the skill packet, expecting to send yet another skill with AddSkill. +`Spawn`: Spawn – The player to grant the skill to. +`SkillID`: Int32 – The ID of the skill to add. +`CurrentVal`: Int16 – The current value the player will have in the skill. +`MaxVal`: Int16 – The max skill the player can receive with the current skill. +`MoreToAdd`: Boolean – When set to true, we skip sending the skill packet, expecting to send yet another skill with AddSkill. -Returns: If successfully adding the skill we will return true, otherwise we return false noting the player already has the skill. +**Returns:** If successfully adding the skill we will return true, otherwise we return false noting the player already has the skill. -Example: +**Example:** + +```lua -- For SkillID refer to the skills table https://github.com/emagi/eq2emu/blob/main/docs/data_types/skills.md -- Example usage (teach the player the “Gnollish” language skill) -AddSkill(Player, GNOLLISH_LANGUAGE_SKILL_ID) \ No newline at end of file +AddSkill(Player, GNOLLISH_LANGUAGE_SKILL_ID) +``` \ No newline at end of file diff --git a/docs/lua_functions/AddSpawnProximity.md b/docs/lua_functions/AddSpawnProximity.md index 6d72da7..9a34326 100644 --- a/docs/lua_functions/AddSpawnProximity.md +++ b/docs/lua_functions/AddSpawnProximity.md @@ -1,20 +1,22 @@ -Function: AddSpawnProximity(Spawn, SpawnValue, SpawnType, Radius, EnterFunction, LeaveFunction) +### Function: AddSpawnProximity(Spawn, SpawnValue, SpawnType, Radius, EnterFunction, LeaveFunction) -Description: Used on NPC's/Objects/Widgets to track other NPC's/Objects/Widgets entering proximity. SpawnValue is the database id or location id based on the SpawnType. +**Description:** Used on NPC's/Objects/Widgets to track other NPC's/Objects/Widgets entering proximity. SpawnValue is the database id or location id based on the SpawnType. -Parameters: +**Parameters:** - Spawn: Spawn – The central entity defining the proximity area. - SpawnValue: UInt32 – - SpawnType: UInt8 – SPAWNPROXIMITY_DATABASE_ID = 0, SPAWNPROXIMITY_LOCATION_ID = 1 - Radius: Float – The radius (in meters) of the proximity zone around the spawn. - EnterFunction: String – The name of the function to call when a player enters the radius. - LeaveFunction: String – The name of the function to call when a player leaves the radius. +`Spawn`: Spawn – The central entity defining the proximity area. +`SpawnValue`: UInt32 – +`SpawnType`: UInt8 – SPAWNPROXIMITY_DATABASE_ID = 0, SPAWNPROXIMITY_LOCATION_ID = 1 +`Radius`: Float – The radius (in meters) of the proximity zone around the spawn. +`EnterFunction`: String – The name of the function to call when a player enters the radius. +`LeaveFunction`: String – The name of the function to call when a player leaves the radius. -Returns: None. +**Returns:** None. -Example: +**Example:** + +```lua -- Example script taken from SpawnScripts/TimorousDeep/aHaoaeranpoacher.lua (2630018) -- Poacher attacks Crabs when In Range, using the v = SpawnValue, SpawnType = 1 (Location ID), Radius = 5. local crablist = { 35182, 34566, 34575, 34752, 34873, 35006, 35182, 35355, 35470, 35506, 35527, 35535, 35544, 35550, 35551, 35554, 35555, 35581, 35635, 35698, 35768, 35818, 35848, 35867, 35889, 35918, 35943, 35948, 35951, 35960, 35971, 35981 }; -- array with crabs location ID's @@ -35,3 +37,4 @@ end function OutRange(NPC) -- do whatever out of range end +``` \ No newline at end of file diff --git a/docs/lua_functions/AddSpawnSpellBonus.md b/docs/lua_functions/AddSpawnSpellBonus.md index 123319d..18b8b84 100644 --- a/docs/lua_functions/AddSpawnSpellBonus.md +++ b/docs/lua_functions/AddSpawnSpellBonus.md @@ -1,16 +1,18 @@ -Function: AddSpawnSpellBonus(Spawn, BonusType, Value) +### Function: AddSpawnSpellBonus(Spawn, BonusType, Value) -Description: Used only in a Spell Script. Applies a spell bonus or modifier to the specified spawn, versus AddSpellBonus applying to all targets of the Spell. This could be things like increased stats, mitigation, damage, etc., as defined by BonusType. +**Description:** Used only in a Spell Script. Applies a spell bonus or modifier to the specified spawn, versus AddSpellBonus applying to all targets of the Spell. This could be things like increased stats, mitigation, damage, etc., as defined by BonusType. -Parameters: +**Parameters:** - Spawn: Spawn – The entity to receive the bonus. - BonusType: UInt16 – The type of bonus to apply (as defined in game constants, e.g., a particular stat or resist). These are based on the item stat types. - Value: SInt32 – The value of the bonus to add (could be absolute or percentage depending on type). +`Spawn`: Spawn – The entity to receive the bonus. +`BonusType`: UInt16 – The type of bonus to apply (as defined in game constants, e.g., a particular stat or resist). These are based on the item stat types. +`Value`: SInt32 – The value of the bonus to add (could be absolute or percentage depending on type). -Returns: None. +**Returns:** None. -Example: +**Example:** + +```lua -- See item stat types for BonusType ID's: https://raw.githubusercontent.com/emagi/eq2emu/refs/heads/main/docs/data_types/item_stat_types.md -- Spell Script Example usage (increase NPC's defense by 50 temporarily during spell's lifetime) function cast(Caster, Target) @@ -20,4 +22,4 @@ end function remove(Caster, Target) RemoveSpawnSpellBonus(Target) end - +``` \ No newline at end of file diff --git a/docs/lua_functions/AddSpellTimer.md b/docs/lua_functions/AddSpellTimer.md index e20d6c4..d7592b0 100644 --- a/docs/lua_functions/AddSpellTimer.md +++ b/docs/lua_functions/AddSpellTimer.md @@ -1,17 +1,19 @@ -Function: AddSpellTimer(DelayMS, FunctionName, Caster, Target) +### Function: AddSpellTimer(DelayMS, FunctionName, Caster, Target) -Description: Used only in a Spell Script. Schedules a call to a function (by name) in the spawn’s script after a specified delay in milliseconds. This is typically used within NPC scripts to create timed events (like delayed attacks or actions) without blocking the main thread. +**Description:** Used only in a Spell Script. Schedules a call to a function (by name) in the spawn’s script after a specified delay in milliseconds. This is typically used within NPC scripts to create timed events (like delayed attacks or actions) without blocking the main thread. -Parameters: +**Parameters:** - DelayMS: Int32 – The delay in milliseconds before the function is called. - FunctionName: String – The name of the function in the NPC’s Lua script to call when the timer expires. - Caster: Spawn – The source spawn who was the caster/originator. - Target: Spawn – The target spawn who will be included as a secondary argument +`DelayMS`: Int32 – The delay in milliseconds before the function is called. +`FunctionName`: String – The name of the function in the NPC’s Lua script to call when the timer expires. +`Caster`: Spawn – The source spawn who was the caster/originator. +`Target`: Spawn – The target spawn who will be included as a secondary argument -Returns: None. +**Returns:** None. -Example: +**Example:** + +```lua -- taken from Spells/Commoner/Knockdown.lua -- Timer argument taken from spell data in the database, after Timer elapses we call RemoveStunBlur function cast(Caster, Target, Timer) @@ -26,4 +28,5 @@ end function RemoveStunBlur(Caster, Target) RemoveControlEffect(Target, 4) BlurVision(Target, 0) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/AddThreatTransfer.md b/docs/lua_functions/AddThreatTransfer.md index be37e90..70a527b 100644 --- a/docs/lua_functions/AddThreatTransfer.md +++ b/docs/lua_functions/AddThreatTransfer.md @@ -1,18 +1,18 @@ -Function: AddThreatTransfer(Originator, Target, Percent) +### Function: AddThreatTransfer(Originator, Target, Percent) -Description: Establishes a hate (threat) transfer link from the originator to the target. A percentage of hate generated by the originator will be transferred to the target. Typically used by abilities where one character siphons or shares aggro with another (e.g., a hate transfer from scout to tank). +**Description:** Establishes a hate (threat) transfer link from the originator to the target. A percentage of hate generated by the originator will be transferred to the target. Typically used by abilities where one character siphons or shares aggro with another (e.g., a hate transfer from scout to tank). -Parameters: +**Parameters:** - Originator: Spawn – The entity whose threat will be partially transferred. +`Originator`: Spawn – The entity whose threat will be partially transferred. +`Target`: Spawn – The entity receiving the threat. +`Percent`: Int32 – The percentage of hate to transfer (e.g., 25 for 25% transfer). - Target: Spawn – The entity receiving the threat. +**Returns:** None. - Percent: Int32 – The percentage of hate to transfer (e.g., 25 for 25% transfer). - -Returns: None. - -Example: +**Example:** +```lua -- Example usage (a buff that transfers 30% of a scout's hate to the tank) -AddThreatTransfer(ScoutPlayer, TankPlayer, 30) \ No newline at end of file +AddThreatTransfer(ScoutPlayer, TankPlayer, 30) +``` \ No newline at end of file diff --git a/docs/lua_functions/AddToWard.md b/docs/lua_functions/AddToWard.md index d144760..752bf7a 100644 --- a/docs/lua_functions/AddToWard.md +++ b/docs/lua_functions/AddToWard.md @@ -1,14 +1,17 @@ -Function: AddToWard(AdditionalAmount) +### Function: AddToWard(AdditionalAmount) -Description: Used inside a Spell Script. Increases the strength of an existing ward on the target(s) of the spell by the specified amount. If the target(s) has this ward active, this tops it up. +**Description:** Used inside a Spell Script. Increases the strength of an existing ward on the target(s) of the spell by the specified amount. If the target(s) has this ward active, this tops it up. -Parameters: +**Parameters:** - AdditionalAmount: Int32 – How much to increase the ward’s remaining absorption by. +`AdditionalAmount`: Int32 – How much to increase the ward’s remaining absorption by. -Returns: None. +**Returns:** None. -Example: +**Example:** + +```lua -- Example usage (reinforce a companion’s ward during battle) -AddToWard(200) \ No newline at end of file +AddToWard(200) +``` \ No newline at end of file diff --git a/docs/lua_functions/AddWard.md b/docs/lua_functions/AddWard.md index 40c1bd1..f481091 100644 --- a/docs/lua_functions/AddWard.md +++ b/docs/lua_functions/AddWard.md @@ -1,21 +1,23 @@ -Function: AddWard(WardAmount, KeepWard, WardType, DamageTypes, DamageAbsorptionPct, DamageAbsorptionMaxHealthPct, RedirectDamagePct, MaxHitCount) +### Function: AddWard(WardAmount, KeepWard, WardType, DamageTypes, DamageAbsorptionPct, DamageAbsorptionMaxHealthPct, RedirectDamagePct, MaxHitCount) -Description: Used in a Spell Script. Applies a protective ward to all spell targets of the spell. A ward absorbs a certain amount of incoming damage before it expires. This function creates a new ward on the target with the given value. +**Description:** Used in a Spell Script. Applies a protective ward to all spell targets of the spell. A ward absorbs a certain amount of incoming damage before it expires. This function creates a new ward on the target with the given value. -Parameters: +**Parameters:** - WardAmount: UInt32 – The amount of damage the ward can absorb. - KeepWard: Boolean – The amount of damage the ward can absorb. - WardType: UInt8 – The amount of damage the ward can absorb. Options: ALL = 0, Physical Only = 1, Magical Only = 2. - DamageTypes: UInt8 – The amount of damage the ward can absorb. If Ward is Magical Only then 0 allows any Magical or select a Damage Type: https://github.com/emagi/eq2emu/blob/main/docs/data_types/damage_types.md - DamageAbsorptionPct: UInt32 – The amount of damage the ward can absorb. Max of 100. - DamageAbsorptionMaxHealthPct: UInt32 – The amount of damage the ward can absorb. Max of 100. - RedirectDamagePct: UInt32 – The amount of damage the ward can absorb. - MaxHitCount: Int32 – The player or NPC to protect with the ward. +`WardAmount`: UInt32 – The amount of damage the ward can absorb. +`KeepWard`: Boolean – The amount of damage the ward can absorb. +`WardType`: UInt8 – The amount of damage the ward can absorb. Options: ALL = 0, Physical Only = 1, Magical Only = 2. +`DamageTypes`: UInt8 – The amount of damage the ward can absorb. If Ward is Magical Only then 0 allows any Magical or select a Damage Type: https://github.com/emagi/eq2emu/blob/main/docs/data_types/damage_types.md +`DamageAbsorptionPct`: UInt32 – The amount of damage the ward can absorb. Max of 100. +`DamageAbsorptionMaxHealthPct`: UInt32 – The amount of damage the ward can absorb. Max of 100. +`RedirectDamagePct`: UInt32 – The amount of damage the ward can absorb. +`MaxHitCount`: Int32 – The player or NPC to protect with the ward. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (shield the player with a 500 hp point ward) -AddWard(500) \ No newline at end of file +AddWard(500) +``` \ No newline at end of file diff --git a/docs/lua_functions/AddWaypoint.md b/docs/lua_functions/AddWaypoint.md index 5167629..beff285 100644 --- a/docs/lua_functions/AddWaypoint.md +++ b/docs/lua_functions/AddWaypoint.md @@ -1,19 +1,21 @@ -Function: AddWaypoint(Player, Name, X, Y, Z) +### Function: AddWaypoint(Player, Name, X, Y, Z) -Description: Adds a guiding waypoint to a Player with the Name for the description at X, Y, Z coordinates. You can add multiple waypoints and then send waypoints. Refer to RemoveWaypoint(Player, Name) to remove an existing waypoint. +**Description:** Adds a guiding waypoint to a Player with the Name for the description at X, Y, Z coordinates. You can add multiple waypoints and then send waypoints. Refer to RemoveWaypoint(Player, Name) to remove an existing waypoint. -Parameters: +**Parameters:** - Player: Spawn – The Player to which to provide the waypoint. - Name: String - The name / description of the waypoint. - X: Float – The X coordinate of the waypoint. - Y: Float – The Y coordinate (vertical) of the waypoint. - Z: Float – The Z coordinate of the waypoint. +`Player`: Spawn – The Player to which to provide the waypoint. +`Name`: String - The name / description of the waypoint. +`X`: Float – The X coordinate of the waypoint. +`Y`: Float – The Y coordinate (vertical) of the waypoint. +`Z`: Float – The Z coordinate of the waypoint. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Add a waypoint to the client and send the waypoints AddWaypoint(Player, "Lets go here!", 102.5, -12.3, 230.0) -SendWaypoints(Player) \ No newline at end of file +SendWaypoints(Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/BlurVision.md b/docs/lua_functions/BlurVision.md index bfab6c8..36b5d26 100644 --- a/docs/lua_functions/BlurVision.md +++ b/docs/lua_functions/BlurVision.md @@ -1,15 +1,17 @@ -Function: BlurVision(Spawn, Intensity) +### Function: BlurVision(Spawn, Intensity) -Description: For use in Spell Script or against a Spawn directly. Sets the intensity of drunkness on the player. When used in Spell Script applies to all Spell Targets. +**Description:** For use in Spell Script or against a Spawn directly. Sets the intensity of drunkness on the player. When used in Spell Script applies to all Spell Targets. -Parameters: +**Parameters:** - Spawn: Spawn – The player whose vision to affect. - Intensity: Float – Intensity of the player being drunk, setting to 0.0 will mean player is not drunk. The higher the more extreme the screen distortion. +`Spawn`: Spawn – The player whose vision to affect. +`Intensity`: Float – Intensity of the player being drunk, setting to 0.0 will mean player is not drunk. The higher the more extreme the screen distortion. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (blur player's vision while under a drunken effect) -BlurVision(Player, 0.5) \ No newline at end of file +BlurVision(Player, 0.5) +``` \ No newline at end of file diff --git a/docs/lua_functions/BreatheUnderwater.md b/docs/lua_functions/BreatheUnderwater.md index 7977c0e..6a9b886 100644 --- a/docs/lua_functions/BreatheUnderwater.md +++ b/docs/lua_functions/BreatheUnderwater.md @@ -1,16 +1,17 @@ -Function: BreatheUnderwater(Spawn, Allow) +### Function: BreatheUnderwater(Spawn, Allow) -Description: Toggles the underwater breathing ability for the given spawn (typically a player). When allowed, the spawn can breathe indefinitely underwater (no drowning). This is usually triggered by buffs or items like water-breathing spells. When ran in a Spell Script applies to all Targets of the spell. Otherwise it will apply only to the Spawn specified, Spawn is required. +**Description:** Toggles the underwater breathing ability for the given spawn (typically a player). When allowed, the spawn can breathe indefinitely underwater (no drowning). This is usually triggered by buffs or items like water-breathing spells. When ran in a Spell Script applies to all Targets of the spell. Otherwise it will apply only to the Spawn specified, Spawn is required. -Parameters: +**Parameters:** - Spawn: Spawn – The character whose underwater breathing is being set. +`Spawn`: Spawn – The character whose underwater breathing is being set. +`Allow`: Boolean – true to grant underwater breathing; false to require normal breath (drowning applies). - Allow: Boolean – true to grant underwater breathing; false to require normal breath (drowning applies). +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage: -BreatheUnderwater(Player, true) \ No newline at end of file +BreatheUnderwater(Player, true) +``` \ No newline at end of file diff --git a/docs/lua_functions/CanHarvest.md b/docs/lua_functions/CanHarvest.md index 84f4b62..112bb4d 100644 --- a/docs/lua_functions/CanHarvest.md +++ b/docs/lua_functions/CanHarvest.md @@ -1,17 +1,19 @@ -Function: CanHarvest(Player, GroundSpawn) +### Function: CanHarvest(Player, GroundSpawn) -Description: Determines if the specified spawn (which should be a player) is currently able to harvest resources (i.e., not in combat and has the required skill/tool). This function checks general conditions for harvesting. +**Description:** Determines if the specified spawn (which should be a player) is currently able to harvest resources (i.e., not in combat and has the required skill/tool). This function checks general conditions for harvesting. -Parameters: +**Parameters:** - Player: Spawn – The player to check. - GroundSpawn: Spawn – The groundspawn to apply the check on. +`Player`: Spawn – The player to check. +`GroundSpawn`: Spawn – The groundspawn to apply the check on. -Returns: Boolean – true if the player can harvest at the moment; false if something prevents harvesting (lacking skill). +**Returns:** Boolean – true if the player can harvest at the moment; false if something prevents harvesting (lacking skill). -Example: +**Example:** +```lua -- Example usage (before starting an auto-harvest routine, verify the player can harvest) if CanHarvest(Player, GroundSpawn) then Harvest(Player, GroundSpawn) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/CanSeeInvis.md b/docs/lua_functions/CanSeeInvis.md index bfd1c19..3905a91 100644 --- a/docs/lua_functions/CanSeeInvis.md +++ b/docs/lua_functions/CanSeeInvis.md @@ -1,17 +1,19 @@ -Function: CanSeeInvis(Player, Target) +### Function: CanSeeInvis(Player, Target) -Description: Checks if the given NPC or player can see invisible entities. Some NPCs have see-invis or see-stealth abilities, which this would indicate. +**Description:** Checks if the given NPC or player can see invisible entities. Some NPCs have see-invis or see-stealth abilities, which this would indicate. -Parameters: +**Parameters:** - Player/Entity: Spawn – The Player/Entity to check for see-invisibility capability. - Target: Spawn – The entity to check if Player can see them. +`Player/Entity`: Spawn – The Player/Entity to check for see-invisibility capability. +`Target`: Spawn – The entity to check if Player can see them. -Returns: Boolean – true if this spawn can detect invisible targets; false if not. +**Returns:** Boolean – true if this spawn can detect invisible targets; false if not. -Example: +**Example:** +```lua -- Example usage (NPC will attack stealthed players only if it can see invis) if IsPlayer(Target) or CanSeeInvis(NPC, Target) then Attack(NPC, Target) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/CancelSpell.md b/docs/lua_functions/CancelSpell.md index 4414737..ba34e92 100644 --- a/docs/lua_functions/CancelSpell.md +++ b/docs/lua_functions/CancelSpell.md @@ -1,12 +1,14 @@ -Function: CancelSpell() +### Function: CancelSpell() -Description: Cancels the current spell in the script being ran. +**Description:** Cancels the current spell in the script being ran. -Parameters: None. +**Parameters:** None. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (Inside a Spell Script) -CancelSpell() \ No newline at end of file +CancelSpell() +``` \ No newline at end of file diff --git a/docs/lua_functions/Charm.md b/docs/lua_functions/Charm.md index aa68162..aa38ce7 100644 --- a/docs/lua_functions/Charm.md +++ b/docs/lua_functions/Charm.md @@ -1,16 +1,17 @@ -Function: Charm(Spawn, Target) +### Function: Charm(Spawn, Target) -Description: Must be used inside a Spell Script. Sets the Target to become a Pet of the Spawn (Owner). +**Description:** Must be used inside a Spell Script. Sets the Target to become a Pet of the Spawn (Owner). -Parameters: +**Parameters:** - Spawn: Spawn – The entity casting the charm (e.g., a player or NPC that will become the controller). +`Spawn`: Spawn – The entity casting the charm (e.g., a player or NPC that will become the controller). +`Target`: Spawn – The NPC to be charmed. - Target: Spawn – The NPC to be charmed. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (NPC charms another NPC during an encounter) -Charm(NPC, EnemyNPC) \ No newline at end of file +Charm(NPC, EnemyNPC) +``` \ No newline at end of file diff --git a/docs/lua_functions/CheckLOS.md b/docs/lua_functions/CheckLOS.md index dab4a37..20786f1 100644 --- a/docs/lua_functions/CheckLOS.md +++ b/docs/lua_functions/CheckLOS.md @@ -1,18 +1,19 @@ -Function: CheckLOS(Origin, Target) +### Function: CheckLOS(Origin, Target) -Description: Checks line-of-sight between two spawns. Returns true if Origin can “see” Target (no significant obstacles in between), false if line of sight is blocked. +**Description:** Checks line-of-sight between two spawns. Returns true if Origin can “see” Target (no significant obstacles in between), false if line of sight is blocked. -Parameters: +**Parameters:** - Origin: Spawn – The entity from whose perspective to check line of sight. +`Origin`: Spawn – The entity from whose perspective to check line of sight. +`Target`: Spawn – The entity to check if visible. - Target: Spawn – The entity to check if visible. +**Returns:** Boolean – true if there is line-of-sight; false if something blocks the view between origin and target. -Returns: Boolean – true if there is line-of-sight; false if something blocks the view between origin and target. - -Example: +**Example:** +```lua -- Example usage (sniper NPC only shoots if it has line of sight to the player) if CheckLOS(SniperNPC, Player) then CastSpell(SniperNPC, SNIPER_SHOT_ID, 1, Player) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/CheckLOSByCoordinates.md b/docs/lua_functions/CheckLOSByCoordinates.md index f1e74f6..c9bf44e 100644 --- a/docs/lua_functions/CheckLOSByCoordinates.md +++ b/docs/lua_functions/CheckLOSByCoordinates.md @@ -1,22 +1,21 @@ -Function: CheckLOSByCoordinates(Origin, X, Y, Z) +### Function: CheckLOSByCoordinates(Origin, X, Y, Z) -Description: Checks line-of-sight from a spawn to a specific point in the world coordinates. Useful for verifying a location’s visibility (for example, whether a ground target spell can reach a point). +**Description:** Checks line-of-sight from a spawn to a specific point in the world coordinates. Useful for verifying a location’s visibility (for example, whether a ground target spell can reach a point). -Parameters: +**Parameters:** - Origin: Spawn – The entity from which to check LOS. +`Origin`: Spawn – The entity from which to check LOS. +`X`: Float – X coordinate of the target point. +`Y`: Float – Y coordinate of the target point. +`Z`: Float – Z coordinate of the target point. - X: Float – X coordinate of the target point. +**Returns:** Boolean – true if the line from Origin to (X,Y,Z) is clear; false if it’s obstructed. - Y: Float – Y coordinate of the target point. - - Z: Float – Z coordinate of the target point. - -Returns: Boolean – true if the line from Origin to (X,Y,Z) is clear; false if it’s obstructed. - -Example: +**Example:** +```lua -- Example usage (check if a spot is reachable by ranged attack) if CheckLOSByCoordinates(Player, targetX, targetY, targetZ) then LaunchProjectile(Player, targetX, targetY, targetZ) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/CheckRaceType.md b/docs/lua_functions/CheckRaceType.md index d3947b5..7f12e5d 100644 --- a/docs/lua_functions/CheckRaceType.md +++ b/docs/lua_functions/CheckRaceType.md @@ -1,18 +1,19 @@ -Function: CheckRaceType(Spawn, RaceTypeID) +### Function: CheckRaceType(Spawn, RaceTypeID) -Description: Checks if the given spawn’s race matches a specific race type category (such as “Undead,” “Giant,” “Animal,” etc.). This is used in quests or abilities that target categories of creatures. +**Description:** Checks if the given spawn’s race matches a specific race type category (such as “Undead,” “Giant,” “Animal,” etc.). This is used in quests or abilities that target categories of creatures. -Parameters: +**Parameters:** - Spawn: Spawn – The entity whose race to check. +`Spawn`: Spawn – The entity whose race to check. +`RaceTypeID`: Int32 – The ID of the race type category to compare against. - RaceTypeID: Int32 – The ID of the race type category to compare against. +**Returns:** Boolean – true if the spawn belongs to that race type; false otherwise. -Returns: Boolean – true if the spawn belongs to that race type; false otherwise. - -Example: +**Example:** +```lua -- Example usage (quest update if target is of the Gnoll race type) if CheckRaceType(TargetNPC, RACE_TYPE_GNOLL) then UpdateQuestStep(Player, QuestID, Step) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/ClearEncounter.md b/docs/lua_functions/ClearEncounter.md index 5f43ec3..9c11159 100644 --- a/docs/lua_functions/ClearEncounter.md +++ b/docs/lua_functions/ClearEncounter.md @@ -1,14 +1,16 @@ -Function: ClearEncounter(Spawn) +### Function: ClearEncounter(Spawn) -Description: Clears the encounter association for the given spawn. In EQ2, NPCs engaged in combat are part of an “encounter” group. This function removes the spawn from any encounter, effectively resetting its fight grouping. +**Description:** Clears the encounter association for the given spawn. In EQ2, NPCs engaged in combat are part of an “encounter” group. This function removes the spawn from any encounter, effectively resetting its fight grouping. -Parameters: +**Parameters:** - Spawn: Spawn – The NPC or player whose encounter to clear. +`Spawn`: Spawn – The NPC or player whose encounter to clear. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (after battle ends, remove any leftover encounter tags) -ClearEncounter(NPC) \ No newline at end of file +ClearEncounter(NPC) +``` \ No newline at end of file diff --git a/docs/lua_functions/ClearHate.md b/docs/lua_functions/ClearHate.md index 0fecbcb..3a639c4 100644 --- a/docs/lua_functions/ClearHate.md +++ b/docs/lua_functions/ClearHate.md @@ -1,15 +1,17 @@ -Function: ClearHate(NPC, Hated) +### Function: ClearHate(NPC, Hated) -Description: Removes the `Hated` target on the NPC's hate list. +**Description:** Removes the `Hated` target on the NPC's hate list. -Parameters: +**Parameters:** - NPC: Spawn – The NPC whose hate list should be cleared. - Hated: Spawn – The hated target that is to be removed from the hate list. +`NPC`: Spawn – The NPC whose hate list should be cleared. +`Hated`: Spawn – The hated target that is to be removed from the hate list. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (an NPC stops attacking/hating Target) -ClearHate(NPC, Target) \ No newline at end of file +ClearHate(NPC, Target) +``` \ No newline at end of file diff --git a/docs/lua_functions/ClearRunback.md b/docs/lua_functions/ClearRunback.md index 295681e..203c8a9 100644 --- a/docs/lua_functions/ClearRunback.md +++ b/docs/lua_functions/ClearRunback.md @@ -1,14 +1,16 @@ -Function: ClearRunback(NPC) +### Function: ClearRunback(NPC) -Description: Stops the NPC from trying to return to its “runback” point (the spot it was originally at or a designated safe point). Often used when you want to stop an NPC from automatically fleeing back or resetting. +**Description:** Stops the NPC from trying to return to its “runback” point (the spot it was originally at or a designated safe point). Often used when you want to stop an NPC from automatically fleeing back or resetting. -Parameters: +**Parameters:** - NPC: Spawn – The NPC to clear runback for. +`NPC`: Spawn – The NPC to clear runback for. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (prevent an NPC from running back to spawn point after combat) -ClearRunback(NPC) \ No newline at end of file +ClearRunback(NPC) +``` \ No newline at end of file diff --git a/docs/lua_functions/CloseDoor.md b/docs/lua_functions/CloseDoor.md index ef2003c..3ea8412 100644 --- a/docs/lua_functions/CloseDoor.md +++ b/docs/lua_functions/CloseDoor.md @@ -1,15 +1,17 @@ -Function: CloseDoor(DoorSpawn, DisableCloseSound) +### Function: CloseDoor(DoorSpawn, DisableCloseSound) -Description: Closes an open door spawn, playing its closing animation and sound. +**Description:** Closes an open door spawn, playing its closing animation and sound. -Parameters: +**Parameters:** - DoorSpawn: Spawn – The door object to close. - DisableCloseSound: Boolean - Default is false, when set to true, no door close sound will be made. +`DoorSpawn`: Spawn – The door object to close. +`DisableCloseSound`: Boolean - Default is false, when set to true, no door close sound will be made. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (close the door after some time or event) -CloseDoor(CastleGate) \ No newline at end of file +CloseDoor(CastleGate) +``` \ No newline at end of file diff --git a/docs/lua_functions/CompareSpawns.md b/docs/lua_functions/CompareSpawns.md index 1a52694..9e47ded 100644 --- a/docs/lua_functions/CompareSpawns.md +++ b/docs/lua_functions/CompareSpawns.md @@ -1,18 +1,19 @@ -Function: CompareSpawns(SpawnA, SpawnB) +### Function: CompareSpawns(SpawnA, SpawnB) -Description: Compares two spawn objects to determine if they refer to the same actual entity in the world. +**Description:** Compares two spawn objects to determine if they refer to the same actual entity in the world. -Parameters: +**Parameters:** - SpawnA: Spawn – The first spawn to compare. +`SpawnA`: Spawn – The first spawn to compare. +`SpawnB`: Spawn – The second spawn to compare. - SpawnB: Spawn – The second spawn to compare. +**Returns:** Boolean – true if both SpawnA and SpawnB represent the same spawn (same entity); false if they are different. -Returns: Boolean – true if both SpawnA and SpawnB represent the same spawn (same entity); false if they are different. - -Example: +**Example:** +```lua -- Example usage (make sure a target hasn’t changed before proceeding) if CompareSpawns(CurrentTarget, GetTarget(Player)) then -- proceed assuming target remains the same -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/CompleteTransmute.md b/docs/lua_functions/CompleteTransmute.md index 9c11962..4a144fc 100644 --- a/docs/lua_functions/CompleteTransmute.md +++ b/docs/lua_functions/CompleteTransmute.md @@ -1,14 +1,16 @@ -Function: CompleteTransmute(Player) +### Function: CompleteTransmute(Player) -Description: Finalizes a transmuting action for the player, typically yielding the transmuted components. This would be called after StartTransmute once the process should complete (if not automatic). +**Description:** Finalizes a transmuting action for the player, typically yielding the transmuted components. This would be called after StartTransmute once the process should complete (if not automatic). -Parameters: +**Parameters:** - Player: Spawn – The player finishing transmuting. +`Player`: Spawn – The player finishing transmuting. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (complete the transmuting process after a delay or confirmation) -CompleteTransmute(Player) \ No newline at end of file +CompleteTransmute(Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/CopySpawnAppearance.md b/docs/lua_functions/CopySpawnAppearance.md index 8a9cbc7..9fec704 100644 --- a/docs/lua_functions/CopySpawnAppearance.md +++ b/docs/lua_functions/CopySpawnAppearance.md @@ -1,16 +1,17 @@ -Function: CopySpawnAppearance(SourceSpawn, TargetSpawn) +### Function: CopySpawnAppearance(SourceSpawn, TargetSpawn) -Description: Copies the appearance (race, gender, outfit, etc.) from one spawn to another. This effectively makes the target look identical to the source. Often used for illusion or clone effects. +**Description:** Copies the appearance (race, gender, outfit, etc.) from one spawn to another. This effectively makes the target look identical to the source. Often used for illusion or clone effects. -Parameters: +**Parameters:** - SourceSpawn: Spawn – The entity whose appearance to copy. +`SourceSpawn`: Spawn – The entity whose appearance to copy. +`TargetSpawn`: Spawn – The entity that will receive the appearance. - TargetSpawn: Spawn – The entity that will receive the appearance. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (make a decoy NPC look like the player) -CopySpawnAppearance(Player, DecoyNPC) \ No newline at end of file +CopySpawnAppearance(Player, DecoyNPC) +``` \ No newline at end of file diff --git a/docs/lua_functions/CreateOptionWindow.md b/docs/lua_functions/CreateOptionWindow.md index 41b82e1..c6557e3 100644 --- a/docs/lua_functions/CreateOptionWindow.md +++ b/docs/lua_functions/CreateOptionWindow.md @@ -1,15 +1,17 @@ -Function: CreateOptionWindow() +### Function: CreateOptionWindow() -Description: Creates a new custom option selection window. This window can hold multiple options (buttons) that the script can present to the player, usually as part of a custom UI or dialogue. +**Description:** Creates a new custom option selection window. This window can hold multiple options (buttons) that the script can present to the player, usually as part of a custom UI or dialogue. -Parameters: None (after creation, use other functions to add options). +**Parameters:** None (after creation, use other functions to add options). -Returns: OptionWindow – A handle or reference to the newly created option window object. +**Returns:** OptionWindow – A handle or reference to the newly created option window object. -Example: +**Example:** +```lua -- Example usage (creating an option window with choices) local window = CreateOptionWindow() AddOptionWindowOption(window, "Accept Quest", "Do you accept the quest?") AddOptionWindowOption(window, "Decline Quest", "Maybe later.") -SendOptionWindow(window, Player) \ No newline at end of file +SendOptionWindow(window, Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/IsOpen.md b/docs/lua_functions/IsOpen.md index f10d87e..93ff4eb 100644 --- a/docs/lua_functions/IsOpen.md +++ b/docs/lua_functions/IsOpen.md @@ -1,16 +1,18 @@ -Function: IsOpen(DoorSpawn) +### Function: IsOpen(DoorSpawn) -Description: Checks whether a given door spawn is currently open. +**Description:** Checks whether a given door spawn is currently open. -Parameters: +**Parameters:** - DoorSpawn: Spawn – The door object to check. +`DoorSpawn`: Spawn – The door object to check. -Returns: Boolean – true if the door is currently open; false if closed. +**Returns:** Boolean – true if the door is currently open; false if closed. -Example: +**Example:** +```lua -- Example usage (guard reacts if the town gate is open past curfew) if IsOpen(TownGate) then Say(GuardNPC, "Close the gates for the night!") -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/IsPet.md b/docs/lua_functions/IsPet.md index 204d9de..903cdf4 100644 --- a/docs/lua_functions/IsPet.md +++ b/docs/lua_functions/IsPet.md @@ -1,16 +1,18 @@ -Function: IsPet(Spawn) +### Function: IsPet(Spawn) -Description: Checks whether the given spawn is a pet (either a player’s pet or some kind of charmed/temporary pet). +**Description:** Checks whether the given spawn is a pet (either a player’s pet or some kind of charmed/temporary pet). -Parameters: +**Parameters:** - Spawn: Spawn – The entity to check. +`Spawn`: Spawn – The entity to check. -Returns: Boolean – true if the spawn is a pet under someone’s control; false otherwise. +**Returns:** Boolean – true if the spawn is a pet under someone’s control; false otherwise. -Example: +**Example:** +```lua -- Example usage (skip certain actions if the spawn is just a pet) if not IsPet(TargetSpawn) then Attack(NPC, TargetSpawn) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/IsPlayer.md b/docs/lua_functions/IsPlayer.md index 75cc02b..46e8fcd 100644 --- a/docs/lua_functions/IsPlayer.md +++ b/docs/lua_functions/IsPlayer.md @@ -6,11 +6,13 @@ Checks if Player is an actual Player or Spawn. **Parameters:** - `Player`: Spawn - The spawn or entity to check. -Returns: Boolean – true if this spawn is a Player; false if not. +**Returns:** Boolean – true if this spawn is a Player; false if not. **Example:** +```lua -- Example usage (NPC will attack stealthed players only if it can see invis) if IsPlayer(Target) or CanSeeInvis(NPC, Target) then Attack(NPC, Target) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/MakeRandomInt.md b/docs/lua_functions/MakeRandomInt.md index 0421815..13eccd7 100644 --- a/docs/lua_functions/MakeRandomInt.md +++ b/docs/lua_functions/MakeRandomInt.md @@ -1,17 +1,18 @@ -Function: MakeRandomInt(Min, Max) +### Function: MakeRandomInt(Min, Max) -Description: Generates a random integer between the specified minimum and maximum values (inclusive). +**Description:** Generates a random integer between the specified minimum and maximum values (inclusive). -Parameters: +**Parameters:** - Min: Int32 – The minimum value. +`Min`: Int32 – The minimum value. +`Max`: Int32 – The maximum value. - Max: Int32 – The maximum value. +**Returns:** Int32 – A random integer N where Min ≤ N ≤ Max. -Returns: Int32 – A random integer N where Min ≤ N ≤ Max. - -Example: +**Example:** +```lua -- 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 +AddCoin(Player, reward) +``` \ No newline at end of file diff --git a/docs/lua_functions/OpenDoor.md b/docs/lua_functions/OpenDoor.md index 4ffbeae..08dfe3f 100644 --- a/docs/lua_functions/OpenDoor.md +++ b/docs/lua_functions/OpenDoor.md @@ -1,14 +1,16 @@ -Function: OpenDoor(DoorSpawn) +### Function: OpenDoor(DoorSpawn) -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. +**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: +**Parameters:** - DoorSpawn: Spawn – The door object to open (must be a door interactive spawn). +`DoorSpawn`: Spawn – The door object to open (must be a door interactive spawn). -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (open a secret door when puzzle is solved) -OpenDoor(SecretDoor) \ No newline at end of file +OpenDoor(SecretDoor) +``` \ No newline at end of file diff --git a/docs/lua_functions/PauseMovement.md b/docs/lua_functions/PauseMovement.md index 681d1dd..79477db 100644 --- a/docs/lua_functions/PauseMovement.md +++ b/docs/lua_functions/PauseMovement.md @@ -1,16 +1,17 @@ -Function: PauseMovement(Spawn, DurationMS) +### Function: PauseMovement(Spawn, DurationMS) -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. +**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: +**Parameters:** - Spawn: Spawn – The NPC to pause. +`Spawn`: Spawn – The NPC to pause. +`DurationMS`: Int32 – How long to pause movement, in milliseconds. - DurationMS: Int32 – How long to pause movement, in milliseconds. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (stop a guard for 5 seconds when hailed) -PauseMovement(GuardNPC, 5000) \ No newline at end of file +PauseMovement(GuardNPC, 5000) +``` \ No newline at end of file diff --git a/docs/lua_functions/ProcHate.md b/docs/lua_functions/ProcHate.md index 164e85f..cb1d4af 100644 --- a/docs/lua_functions/ProcHate.md +++ b/docs/lua_functions/ProcHate.md @@ -1,18 +1,18 @@ -Function: ProcHate(Source, Target, HateAmount) +### Function: ProcHate(Source, Target, HateAmount) -Description: Directly modifies hate by a given amount as a result of a proc or effect. This will increase (or decrease, if negative) the hate that the source has toward the target or vice versa (depending on internal implementation; likely it adds hate from Source towards Target). +**Description:** Directly modifies hate by a given amount as a result of a proc or effect. This will increase (or decrease, if negative) the hate that the source has toward the target or vice versa (depending on internal implementation; likely it adds hate from Source towards Target). -Parameters: +**Parameters:** - Source: Spawn – The entity generating hate. +`Source`: Spawn – The entity generating hate. +`Target`: Spawn – The entity receiving hate (being hated more). +`HateAmount`: Int32 – The amount of hate to add (or remove if negative). - Target: Spawn – The entity receiving hate (being hated more). +**Returns:** None. - HateAmount: Int32 – The amount of hate to add (or remove if negative). - -Returns: None. - -Example: +**Example:** +```lua -- Example usage (increase hate of an NPC toward the player as a taunt proc) -ProcHate(Player, NPC, 500) \ No newline at end of file +ProcHate(Player, NPC, 500) +``` \ No newline at end of file diff --git a/docs/lua_functions/RemoveSpawnSpellBonus.md b/docs/lua_functions/RemoveSpawnSpellBonus.md index 175f3c4..2892b1a 100644 --- a/docs/lua_functions/RemoveSpawnSpellBonus.md +++ b/docs/lua_functions/RemoveSpawnSpellBonus.md @@ -1,16 +1,18 @@ -Function: RemoveSpawnSpellBonus(Spawn) +### Function: RemoveSpawnSpellBonus(Spawn) -Description: Used in a Spell Script Only. Removes a previously applied spell bonus from the spawn +**Description:** Used in a Spell Script Only. Removes a previously applied spell bonus from the spawn -Parameters: +**Parameters:** - Spawn: Spawn – The entity to remove the bonus from. +`Spawn`: Spawn – The entity to remove the bonus from. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (remove the defense bonus when buff ends) function remove(Caster, Target) RemoveSpawnSpellBonus(Spawn) -end \ No newline at end of file +end +``` \ No newline at end of file diff --git a/docs/lua_functions/RemoveWaypoint.md b/docs/lua_functions/RemoveWaypoint.md index 6fea0ec..a735459 100644 --- a/docs/lua_functions/RemoveWaypoint.md +++ b/docs/lua_functions/RemoveWaypoint.md @@ -1,16 +1,18 @@ -Function: RemoveWaypoint(Player, WaypointIndex) +### Function: RemoveWaypoint(Player, WaypointIndex) -Description: Removes the guiding waypoint for the Player. SendWaypoints should also be sent after. +**Description:** Removes the guiding waypoint for the Player. SendWaypoints should also be sent after. -Parameters: +**Parameters:** - Player: Spawn – The NPC whose waypoint path to modify. - Name: String - The name of the waypoint supplied originally when AddWaypoint was called. +`Player`: Spawn – The NPC whose waypoint path to modify. +`Name`: String - The name of the waypoint supplied originally when AddWaypoint was called. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (remove a previously added waypoint) RemoveWaypoint(Player, "PreviousWaypoint") -SendWaypoints(Player) \ No newline at end of file +SendWaypoints(Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/ResetCharacterTitlePrefix.md b/docs/lua_functions/ResetCharacterTitlePrefix.md index 0150490..47feb48 100644 --- a/docs/lua_functions/ResetCharacterTitlePrefix.md +++ b/docs/lua_functions/ResetCharacterTitlePrefix.md @@ -1,14 +1,16 @@ -Function: ResetCharacterTitlePrefix(Player) +### Function: ResetCharacterTitlePrefix(Player) -Description: Clears the player’s current prefix title, so no prefix is shown before their name. +**Description:** Clears the player’s current prefix title, so no prefix is shown before their name. -Parameters: +**Parameters:** - Player: Spawn – The player whose prefix to clear. +`Player`: Spawn – The player whose prefix to clear. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (player relinquishes a bestowed noble title) -ResetCharacterTitlePrefix(Player) \ No newline at end of file +ResetCharacterTitlePrefix(Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/ResetCharacterTitleSuffix.md b/docs/lua_functions/ResetCharacterTitleSuffix.md index 56f8cff..033f845 100644 --- a/docs/lua_functions/ResetCharacterTitleSuffix.md +++ b/docs/lua_functions/ResetCharacterTitleSuffix.md @@ -1,14 +1,16 @@ -Function: ResetCharacterTitleSuffix(Player) +### Function: ResetCharacterTitleSuffix(Player) -Description: Removes any suffix title currently displayed on the player, resetting it to none. +**Description:** Removes any suffix title currently displayed on the player, resetting it to none. -Parameters: +**Parameters:** - Player: Spawn – The player whose suffix title to clear. +`Player`: Spawn – The player whose suffix title to clear. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (player chooses to hide their suffix title) -ResetCharacterTitleSuffix(Player) \ No newline at end of file +ResetCharacterTitleSuffix(Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/Runback.md b/docs/lua_functions/Runback.md index 79be837..e4e592c 100644 --- a/docs/lua_functions/Runback.md +++ b/docs/lua_functions/Runback.md @@ -1,14 +1,16 @@ -Function: Runback(NPC) +### Function: Runback(NPC) -Description: Forces the NPC to run back to its designated home point or spawn point. This is typically invoked when an encounter ends or the NPC needs to retreat/reset to its origin. +**Description:** Forces the NPC to run back to its designated home point or spawn point. This is typically invoked when an encounter ends or the NPC needs to retreat/reset to its origin. -Parameters: +**Parameters:** - NPC: Spawn – The NPC that should run back. +`NPC`: Spawn – The NPC that should run back. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Example usage (an NPC flees and returns home) -Runback(NPC) \ No newline at end of file +Runback(NPC) +``` \ No newline at end of file diff --git a/docs/lua_functions/SendWaypoints.md b/docs/lua_functions/SendWaypoints.md index 6ba23a2..5bc00a6 100644 --- a/docs/lua_functions/SendWaypoints.md +++ b/docs/lua_functions/SendWaypoints.md @@ -1,15 +1,17 @@ -Function: SendWaypoints(Player) +### Function: SendWaypoints(Player) -Description: Sends the Player the visual/guiding waypoints provided through AddWaypoint. +**Description:** Sends the Player the visual/guiding waypoints provided through AddWaypoint. -Parameters: +**Parameters:** - Player: Spawn – The Player to update their waypoints by sending the packet update. +`Player`: Spawn – The Player to update their waypoints by sending the packet update. -Returns: None. +**Returns:** None. -Example: +**Example:** +```lua -- Add a waypoint to the client and send the waypoints AddWaypoint(Player, "Lets go here!", 102.5, -12.3, 230.0) -SendWaypoints(Player) \ No newline at end of file +SendWaypoints(Player) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetHP.md b/docs/lua_functions/SetHP.md index 5e5cfdc..0920833 100644 --- a/docs/lua_functions/SetHP.md +++ b/docs/lua_functions/SetHP.md @@ -1,17 +1,17 @@ -Function: SetHP(Spawn, CurrentHP) +### Function: SetHP(Spawn, CurrentHP) -Description: -Sets the Spawn's Current HP, if the CurrentHP value is higher than the Spawn's Total HP it will override the Total HP as well. +**Description:** Sets the Spawn's Current HP, if the CurrentHP value is higher than the Spawn's Total HP it will override the Total HP as well. -Parameters: +**Parameters:** - Spawn: Spawn – The Spawn whoms HP should be changed. - CurrentHP: SInt32 - New HP value for the spawn. +`Spawn`: Spawn – The Spawn whoms HP should be changed. +`CurrentHP`: SInt32 - New HP value for the spawn. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example set Spawn HP to 1000 -SetHP(Spawn, 1000) \ No newline at end of file +SetHP(Spawn, 1000) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetInvulnerable.md b/docs/lua_functions/SetInvulnerable.md index 295e513..33f4b51 100644 --- a/docs/lua_functions/SetInvulnerable.md +++ b/docs/lua_functions/SetInvulnerable.md @@ -1,16 +1,17 @@ -Function: SetInvulnerable(Spawn, Enable) +### Function: SetInvulnerable(Spawn, Enable) -Description: Toggles an entity’s invulnerability. When set to true, the spawn will not take damage from any source. +**Description:** Toggles an entity’s invulnerability. When set to true, the spawn will not take damage from any source. -Parameters: +**Parameters:** - Spawn: Spawn – The entity to modify. +`Spawn`: Spawn – The entity to modify. +`Enable`: Boolean – true to make invulnerable; false to remove invulnerability. - Enable: Boolean – true to make invulnerable; false to remove invulnerability. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (make an NPC invulnerable during a dialogue scene) -SetInvulnerable(QuestNPC, true) \ No newline at end of file +SetInvulnerable(QuestNPC, true) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetPlayerLevel.md b/docs/lua_functions/SetPlayerLevel.md index 2e9a7d3..d06cf1f 100644 --- a/docs/lua_functions/SetPlayerLevel.md +++ b/docs/lua_functions/SetPlayerLevel.md @@ -1,16 +1,17 @@ -Function: SetPlayerLevel(Player, Level) +### Function: SetPlayerLevel(Player, Level) -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. +*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: +**Parameters:** - Player: Spawn – The player whose level to change. +`Player`: Spawn – The player whose level to change. +`Level`: Int32 – The new level to set. - Level: Int32 – The new level to set. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (GM tool leveling a player to 50) -SetPlayerLevel(Player, 50) \ No newline at end of file +SetPlayerLevel(Player, 50) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetSeeHide.md b/docs/lua_functions/SetSeeHide.md index 40b9943..8a8ced6 100644 --- a/docs/lua_functions/SetSeeHide.md +++ b/docs/lua_functions/SetSeeHide.md @@ -1,16 +1,17 @@ -Function: SetSeeHide(Spawn, Enable) +### Function: SetSeeHide(Spawn, Enable) -Description: Toggles an NPC’s ability to see hidden/stealthed entities on or off. “Hide” usually refers to stealth as opposed to magical invisibility. +**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: +**Parameters:** - Spawn: Spawn – The NPC in question. +`Spawn`: Spawn – The NPC in question. +`Enable`: Boolean – true to grant see-stealth; false to remove it. - Enable: Boolean – true to grant see-stealth; false to remove it. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (guards become alert and can see stealth during an alarm event) -SetSeeHide(GuardNPC, true) \ No newline at end of file +SetSeeHide(GuardNPC, true) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetSeeInvis.md b/docs/lua_functions/SetSeeInvis.md index 8ee8105..609e73e 100644 --- a/docs/lua_functions/SetSeeInvis.md +++ b/docs/lua_functions/SetSeeInvis.md @@ -1,16 +1,17 @@ -Function: SetSeeInvis(Spawn, Enable) +### Function: SetSeeInvis(Spawn, Enable) -Description: Toggles an NPC’s ability to see invisible on or off. +**Description:** Toggles an NPC’s ability to see invisible on or off. -Parameters: +**Parameters:** - Spawn: Spawn – The NPC whose invis detection to set. +`Spawn`: Spawn – The NPC whose invis detection to set. +`Enable`: Boolean – true to grant see-invis; false to revoke it. - Enable: Boolean – true to grant see-invis; false to revoke it. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- Example usage (temporarily allow a boss to see invis during a phase) -SetSeeInvis(BossNPC, true) \ No newline at end of file +SetSeeInvis(BossNPC, true) +``` \ No newline at end of file diff --git a/docs/lua_functions/SetTarget.md b/docs/lua_functions/SetTarget.md index 1ae856e..774bcec 100644 --- a/docs/lua_functions/SetTarget.md +++ b/docs/lua_functions/SetTarget.md @@ -1,17 +1,18 @@ -Function: SetTarget(Originator, Target) +### Function: SetTarget(Originator, Target) -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. +**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: +**Parameters:** - Originator: Spawn – The entity whose target will be changed. +`Originator`: Spawn – The entity whose target will be changed. +`Target`: Spawn – The entity to set as the new target. - Target: Spawn – The entity to set as the new target. +**Returns:** None. -Returns: None. - -Example: +**Example:** +```lua -- 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 +SetInfoFlag(BossNPC) -- assures we send the changes out immediately versus waiting for process loop +``` \ No newline at end of file