1
0

Some LUA Functions Documented..

This commit is contained in:
Emagi 2025-05-13 22:57:49 -04:00
parent 8ad25150a2
commit ca901574a6
46 changed files with 514 additions and 574 deletions

View File

@ -1,17 +1,14 @@
### Function: AddIconValue(Spawn, Value)
Function: AddIconValue(Spawn, Value)
**Description:**
Add an icon value to the Spawn.
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)
```

View File

@ -1,17 +1,14 @@
### Function: AddQuestPrereqClass(param1, param2)
Function: AddQuestPrereqClass(Quest: quest, Int8: ClassID)
**Description:**
Placeholder description.
Description: Add a pre requirement class to the Quest.
**Parameters:**
- `param1`: unknown - Unknown type.
- `param2`: int8 - Small integer or boolean flag.
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
AddQuestPrereqClass(..., ...)
```
-- Example usage: Restricts Quest to Inquisitor(14) class.
AddQuestPrereqClass(Quest, 14)

View File

@ -1,21 +1,18 @@
### Function: AddQuestStepFailureAction(param1, param2, param3, param4, param5, param6)
Function: AddQuestStepFailureAction(Quest, Step, FunctionName)
**Description:**
Placeholder description.
Description: Associates a Lua function (by name) to be called if the specified quest step fails. This allows custom script handling when a steps failure condition is met (e.g., timer runs out).
**Parameters:**
- `param1`: unknown - Unknown type.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: int32 - Integer value.
- `param6`: string - String value.
Parameters:
**Returns:** None.
Quest: Quest The quest object.
**Example:**
Step: Int32 The step number to attach the failure action to.
```lua
-- Example usage
AddQuestStepFailureAction(..., ..., ..., ..., ..., ...)
```
FunctionName: String The name of a Lua function to call on failure.
Returns: None.
Example:
-- Example usage (if step 2 fails, call "OnStealthFail" in the quest script)
AddQuestStepFailureAction(Quest, 2, "OnStealthFail")

View File

@ -1,25 +1,18 @@
### Function: AddThreatTransfer(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10)
Function: AddThreatTransfer(Originator, Target, Percent)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: unknown - Unknown type.
- `param6`: unknown - Unknown type.
- `param7`: unknown - Unknown type.
- `param8`: unknown - Unknown type.
- `param9`: Spawn - The spawn or entity involved.
- `param10`: float - Floating point value.
Parameters:
**Returns:** None.
Originator: Spawn The entity whose threat will be partially transferred.
**Example:**
Target: Spawn The entity receiving the threat.
```lua
-- Example usage
AddThreatTransfer(..., ..., ..., ..., ..., ..., ..., ..., ..., ...)
```
Percent: Int32 The percentage of hate to transfer (e.g., 25 for 25% transfer).
Returns: None.
Example:
-- Example usage (a buff that transfers 30% of a scout's hate to the tank)
AddThreatTransfer(ScoutPlayer, TankPlayer, 30)

View File

@ -1,17 +1,14 @@
### Function: AddToWard(param1, param2)
Function: AddToWard(AdditionalAmount)
**Description:**
Placeholder description.
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:**
- `param1`: int32 - Integer value.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
AdditionalAmount: Int32 How much to increase the wards remaining absorption by.
**Example:**
Returns: None.
```lua
-- Example usage
AddToWard(..., ...)
```
Example:
-- Example usage (reinforce a companions ward during battle)
AddToWard(200)

View File

@ -1,11 +1,11 @@
### Function: Attack(param1, param2)
### Function: Attack(NPC, Target)
**Description:**
Placeholder description.
NPC will attack its target (NPC/Player/Bot).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: Spawn - The spawn or entity involved.
- `NPC`: Spawn - The spawn or entity involved.
- `Target`: Spawn - The spawn or entity involved.
**Returns:** None.
@ -13,5 +13,5 @@ Placeholder description.
```lua
-- Example usage
Attack(..., ...)
Attack(NPC, Target)
```

View File

@ -1,20 +1,16 @@
### Function: BreatheUnderwater(param1, param2, param3, param4, param5)
Function: BreatheUnderwater(Spawn, Allow)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: bool - Boolean value (true/false).
Parameters:
**Returns:** None.
Spawn: Spawn The character whose underwater breathing is being set.
**Example:**
Allow: Boolean true to grant underwater breathing; false to require normal breath (drowning applies).
```lua
-- Example usage
BreatheUnderwater(..., ..., ..., ..., ...)
```
Returns: None.
Example:
-- Example usage:
BreatheUnderwater(Player, true)

View File

@ -1,21 +1,17 @@
### Function: CanHarvest(param1, param2, param3, param4, param5, param6)
Function: CanHarvest(Player, GroundSpawn)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: unknown - Unknown type.
- `param6`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Player: Spawn The player to check.
GroundSpawn: Spawn The groundspawn to apply the check on.
**Example:**
Returns: Boolean true if the player can harvest at the moment; false if something prevents harvesting (lacking skill).
```lua
-- Example usage
CanHarvest(..., ..., ..., ..., ..., ...)
```
Example:
-- Example usage (before starting an auto-harvest routine, verify the player can harvest)
if CanHarvest(Player, GroundSpawn) then
Harvest(Player, GroundSpawn)
end

View File

@ -1,17 +1,17 @@
### Function: CanSeeInvis(param1, param2)
Function: CanSeeInvis(Player, Target)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Player/Entity: Spawn The Player/Entity to check for see-invisibility capability.
Target: Spawn The entity to check if Player can see them.
**Example:**
Returns: Boolean true if this spawn can detect invisible targets; false if not.
```lua
-- Example usage
CanSeeInvis(..., ...)
```
Example:
-- 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

View File

@ -1,19 +1,12 @@
### Function: CancelSpell(param1, param2, param3, param4)
Function: CancelSpell()
**Description:**
Placeholder description.
Description: Cancels the current spell in the script being ran.
**Parameters:**
- `param1`: unknown - Unknown type.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
Parameters: None.
**Returns:** None.
Returns: None.
**Example:**
Example:
```lua
-- Example usage
CancelSpell(..., ..., ..., ...)
```
-- Example usage (Inside a Spell Script)
CancelSpell()

View File

@ -1,19 +1,16 @@
### Function: Charm(param1, param2, param3, param4)
Function: Charm(Spawn, Target)
**Description:**
Placeholder description.
Description: Must be used inside a Spell Script. Sets the Target to become a Pet of the Spawn (Owner).
**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.
Spawn: Spawn The entity casting the charm (e.g., a player or NPC that will become the controller).
**Example:**
Target: Spawn The NPC to be charmed.
```lua
-- Example usage
Charm(..., ..., ..., ...)
```
Returns: None.
Example:
-- Example usage (NPC charms another NPC during an encounter)
Charm(NPC, EnemyNPC)

View File

@ -1,17 +1,18 @@
### Function: CheckLOS(param1, param2)
Function: CheckLOS(Origin, Target)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Origin: Spawn The entity from whose perspective to check line of sight.
**Example:**
Target: Spawn The entity to check if visible.
```lua
-- Example usage
CheckLOS(..., ...)
```
Returns: Boolean true if there is line-of-sight; false if something blocks the view between origin and target.
Example:
-- 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

View File

@ -1,19 +1,22 @@
### Function: CheckLOSByCoordinates(param1, param2, param3, param4)
Function: CheckLOSByCoordinates(Origin, X, Y, Z)
**Description:**
Placeholder description.
Description: Checks line-of-sight from a spawn to a specific point in the world coordinates. Useful for verifying a locations visibility (for example, whether a ground target spell can reach a point).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: float - Floating point value.
- `param3`: float - Floating point value.
- `param4`: float - Floating point value.
Parameters:
**Returns:** None.
Origin: Spawn The entity from which to check LOS.
**Example:**
X: Float X coordinate of the target point.
```lua
-- Example usage
CheckLOSByCoordinates(..., ..., ..., ...)
```
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 its obstructed.
Example:
-- Example usage (check if a spot is reachable by ranged attack)
if CheckLOSByCoordinates(Player, targetX, targetY, targetZ) then
LaunchProjectile(Player, targetX, targetY, targetZ)
end

View File

@ -1,19 +1,18 @@
### Function: CheckRaceType(param1, param2, param3, param4)
Function: CheckRaceType(Spawn, RaceTypeID)
**Description:**
Placeholder description.
Description: Checks if the given spawns 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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: int16 - Short integer value.
Parameters:
**Returns:** None.
Spawn: Spawn The entity whose race to check.
**Example:**
RaceTypeID: Int32 The ID of the race type category to compare against.
```lua
-- Example usage
CheckRaceType(..., ..., ..., ...)
```
Returns: Boolean true if the spawn belongs to that race type; false otherwise.
Example:
-- Example usage (quest update if target is of the Gnoll race type)
if CheckRaceType(TargetNPC, RACE_TYPE_GNOLL) then
UpdateQuestStep(Player, QuestID, Step)
end

View File

@ -1,18 +1,14 @@
### Function: ClearEncounter(param1, param2, param3)
Function: ClearEncounter(Spawn)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The NPC or player whose encounter to clear.
**Example:**
Returns: None.
```lua
-- Example usage
ClearEncounter(..., ..., ...)
```
Example:
-- Example usage (after battle ends, remove any leftover encounter tags)
ClearEncounter(NPC)

View File

@ -1,18 +1,14 @@
### Function: ClearRunback(param1, param2, param3)
Function: ClearRunback(NPC)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
NPC: Spawn The NPC to clear runback for.
**Example:**
Returns: None.
```lua
-- Example usage
ClearRunback(..., ..., ...)
```
Example:
-- Example usage (prevent an NPC from running back to spawn point after combat)
ClearRunback(NPC)

View File

@ -1,19 +1,18 @@
### Function: CompareSpawns(param1, param2, param3, param4)
Function: CompareSpawns(SpawnA, SpawnB)
**Description:**
Placeholder description.
Description: Compares two spawn objects to determine if they refer to the same actual entity in the world.
**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.
SpawnA: Spawn The first spawn to compare.
**Example:**
SpawnB: Spawn The second spawn to compare.
```lua
-- Example usage
CompareSpawns(..., ..., ..., ...)
```
Returns: Boolean true if both SpawnA and SpawnB represent the same spawn (same entity); false if they are different.
Example:
-- Example usage (make sure a target hasnt changed before proceeding)
if CompareSpawns(CurrentTarget, GetTarget(Player)) then
-- proceed assuming target remains the same
end

View File

@ -1,18 +1,14 @@
### Function: CompleteTransmute(param1, param2, param3)
Function: CompleteTransmute(Player)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
Player: Spawn The player finishing transmuting.
**Example:**
Returns: None.
```lua
-- Example usage
CompleteTransmute(..., ..., ...)
```
Example:
-- Example usage (complete the transmuting process after a delay or confirmation)
CompleteTransmute(Player)

View File

@ -1,19 +1,16 @@
### Function: CopySpawnAppearance(param1, param2, param3, param4)
Function: CopySpawnAppearance(SourceSpawn, TargetSpawn)
**Description:**
Placeholder description.
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:**
- `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.
SourceSpawn: Spawn The entity whose appearance to copy.
**Example:**
TargetSpawn: Spawn The entity that will receive the appearance.
```lua
-- Example usage
CopySpawnAppearance(..., ..., ..., ...)
```
Returns: None.
Example:
-- Example usage (make a decoy NPC look like the player)
CopySpawnAppearance(Player, DecoyNPC)

View File

@ -0,0 +1,15 @@
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.
Parameters: None (after creation, use other functions to add options).
Returns: OptionWindow A handle or reference to the newly created option window object.
Example:
-- 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)

View File

@ -1,16 +1,16 @@
### Function: DeleteDBShardID(param1)
Function: DeleteDBShardID(ShardID)
**Description:**
Placeholder description.
Description: Removes the database record for a given spirit shard, effectively deleting the shard (often after its been collected or expired).
**Parameters:**
- `param1`: int32 - Integer value.
Parameters:
**Returns:** None.
ShardID: Int32 The ID of the shard to delete.
**Example:**
Returns: Boolean true if a shard record was found and deleted; false if not.
```lua
-- Example usage
DeleteDBShardID(...)
```
Example:
-- Example usage (clean up a shard after player retrieves it)
if DeleteDBShardID(shardID) then
SendMessage(Player, "You feel whole again as your spirit shard dissipates.", "white")
end

View File

@ -1,18 +1,14 @@
### Function: DismissPet(param1, param2, param3)
Function: DismissPet(Spawn)
**Description:**
Placeholder description.
Description: Dismisses (despawns) the specified players active pet. This works for combat pets, cosmetic pets, deity pets, etc., causing them to vanish as if the player dismissed them manually.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The player whose pet should be dismissed.
**Example:**
Returns: None.
```lua
-- Example usage
DismissPet(..., ..., ...)
```
Example:
-- Example usage (dismissing a pet at the end of an event)
DismissPet(Player)

View File

@ -1,19 +1,14 @@
### Function: EndAutoMount(param1, param2, param3, param4)
Function: EndAutoMount(Spawn)
**Description:**
Placeholder description.
Description: Dismounts a player who was auto-mounted via StartAutoMount. Typically called at the end of an automated travel route or upon leaving the area where auto-mount is enforced.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The player to dismount.
**Example:**
Returns: None.
```lua
-- Example usage
EndAutoMount(..., ..., ..., ...)
```
Example:
-- Example usage (dismount the player after griffon flight ends)
EndAutoMount(Player)

View File

@ -1,18 +1,20 @@
### Function: GetAlignment(param1, param2, param3)
Function: GetAlignment(Player)
**Description:**
Placeholder description.
Description: Returns the alignment of the player character typically Good, Neutral, or Evil in EQ2. Alignment often affects starting city and some quest options.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
Player: Spawn The player to query.
**Example:**
Returns: Int32 An alignment value (e.g., 0=Neutral, 1=Good, 2=Evil as commonly used).
```lua
-- Example usage
GetAlignment(..., ..., ...)
```
Example:
-- Example usage (greet players differently by alignment)
if GetAlignment(Player) == 1 then
Say(NPC, "Well met, friend of Qeynos.")
elseif GetAlignment(Player) == 0 then
Say(NPC, "I smell the stench of Freeport on you.")
elseif GetAlignment(Player) == 2 then
Say(NPC, "Neutrality you say?")
end

View File

@ -1,16 +1,17 @@
### Function: GetCharmedPet(param1)
Function: GetCharmedPet(Spawn)
**Description:**
Placeholder description.
Description: Returns the NPC that the given player or NPC has charmed, if any. When a player charms an NPC (through a spell), that NPC becomes a pet under their control — this function retrieves it.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The entity (usually a player) who may have a charmed pet.
**Example:**
Returns: Spawn The charmed pet NPC if one exists, or nil if there is no active charmed pet.
```lua
-- Example usage
GetCharmedPet(...)
```
Example:
-- Example usage (checking if player currently has a charmed creature)
local charmed = GetCharmedPet(Player)
if charmed ~= nil then
Say(charmed, "I am under your control...")
end

View File

@ -1,16 +1,16 @@
### Function: GetClientVersion(param1)
Function: GetClientVersion(Spawn)
**Description:**
Placeholder description.
Description: Retrieves the game client version of the specified player (useful if the server supports multiple client versions). This can determine differences in available features or UI.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The player whose client version to get.
**Example:**
Returns: Int32 The client version number (for example, corresponding to certain expansions or patches).
```lua
-- Example usage
GetClientVersion(...)
```
Example:
-- Example usage (check if players client supports a feature)
if GetClientVersion(Player) < REQUIRED_CLIENT_VERSION then
SendMessage(Player, "Please update your client for the best experience.", "yellow")
end

View File

@ -1,16 +1,17 @@
### Function: GetCosmeticPet(param1)
Function: GetCosmeticPet(Spawn)
**Description:**
Placeholder description.
Description: Returns the cosmetic pet (fun pet) entity of the given player if one is currently summoned.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The player whose cosmetic pet to retrieve.
**Example:**
Returns: Spawn The cosmetic pet spawn if active, or nil if the player has no cosmetic pet out.
```lua
-- Example usage
GetCosmeticPet(...)
```
Example:
-- Example usage (pet-related quest checking if a particular pet is summoned)
local pet = GetCosmeticPet(Player)
if pet ~= nil and GetName(pet) == "Frostfell Elf" then
Say(NPC, "I see you have a festive friend with you!")
end

View File

@ -1,16 +1,16 @@
### Function: GetDeityPet(param1)
Function: GetDeityPet(Spawn)
**Description:**
Placeholder description.
Description: Retrieves the deity pet entity belonging to the specified player, if the deity pet is currently summoned.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The player whose deity pet to get.
**Example:**
Returns: Spawn The deity pet spawn if it is currently active, or nil if no deity pet is out.
```lua
-- Example usage
GetDeityPet(...)
```
Example:
-- Example usage (check for deity pet presence)
if GetDeityPet(Player) ~= nil then
SendMessage(Player, "Your deity companion watches over you.", "white")
end

View File

@ -1,17 +1,17 @@
### Function: GetFollowTarget(param1, param2)
Function: GetFollowTarget(Spawn)
**Description:**
Placeholder description.
Description: Retrieves the current follow target of a given NPC or pet. If the spawn is following someone, this returns the entity being followed.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The NPC (or players pet) that might be following a target.
**Example:**
Returns: Spawn The entity that Spawn is currently following, or nil if its not following anyone.
```lua
-- Example usage
GetFollowTarget(..., ...)
```
Example:
-- Example usage (check who an escort NPC is following)
local leader = GetFollowTarget(EscortNPC)
if leader == Player then
Say(EscortNPC, "I am right behind you!")
end

View File

@ -1,17 +1,19 @@
### Function: GetGroup(param1, param2)
Function: GetGroup(Spawn)
**Description:**
Placeholder description.
Description: Returns the group object that the given spawn (player or NPC) belongs to. This can be used to iterate over group members or to perform group-wide actions.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity whose group is requested (typically a Player).
**Example:**
Returns: Group A group object or identifier that represents the spawns group. If the spawn is not in a group, this may return nil or an empty group reference.
```lua
-- Example usage
GetGroup(..., ...)
```
Example:
-- Example usage (send a message to all members of a player's group)
local group = GetGroup(Player)
if group ~= nil then
for _, member in ipairs(GetGroupMembers(group)) do
SendMessage(member, "A teammate has activated the device!")
end
end

View File

@ -1,18 +1,16 @@
### Function: GetHateList(param1, param2, param3)
Function: GetHateList(NPC)
**Description:**
Placeholder description.
Description: Returns a list of all spawns currently on the specified NPCs hate (aggro) list. This includes anyone who has attacked or otherwise generated hate on the NPC.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
NPC: Spawn The NPC whose hate list to retrieve.
**Example:**
Returns: Table A list/array of spawns that the NPC currently hates, typically sorted by hate amount (highest first).
```lua
-- Example usage
GetHateList(..., ..., ...)
```
Example:
-- Example usage (apply an effect to all players an epic boss has aggro on)
for _, enemy in ipairs(GetHateList(EpicBoss)) do
CastSpell(EpicBoss, AOE_DEBUFF_ID, 1, enemy)
end

View File

@ -1,18 +1,16 @@
### Function: GetInfoStructFloat(param1, param2, param3)
Function: GetInfoStructFloat(Spawn, FieldName)
**Description:**
Placeholder description.
Description: Retrieves a floating-point field from a spawns info data. Could be used for precise position, speed multipliers, etc. if stored there.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: string - String value.
Parameters:
**Returns:** None.
Spawn: Spawn The entity whose info to check.
**Example:**
FieldName: String The name of the float field.
```lua
-- Example usage
GetInfoStructFloat(..., ..., ...)
```
Returns: Float The value of the field.
Example:
-- Example usage (get an entity's size scale factor)
local scale = GetInfoStructFloat(NPC, "size")

View File

@ -1,18 +1,16 @@
### Function: GetInfoStructSInt(param1, param2, param3)
Function: GetInfoStructSInt(Spawn, FieldName)
**Description:**
Placeholder description.
Description: Gets a signed integer field from the spawns info struct. Similar to GetInfoStructUInt but for fields that can be negative.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: string - String value.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to query.
**Example:**
FieldName: String The field name to retrieve.
```lua
-- Example usage
GetInfoStructSInt(..., ..., ...)
```
Returns: Int32 The value of that field.
Example:
-- Example usage (get an NPC's faction alignment which could be negative or positive)
local faction = GetInfoStructSInt(NPC, "faction_id")

View File

@ -1,18 +1,16 @@
### Function: GetInfoStructString(param1, param2, param3)
Function: GetInfoStructString(Spawn, FieldName)
**Description:**
Placeholder description.
Description: Retrieves a string field from the spawns info data structure. The info struct contains various attributes of a spawn (like name, last name, guild, etc.). FieldName is the identifier of the string field.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: string - String value.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to query.
**Example:**
FieldName: String The field to retrieve (e.g., "last_name", "guild_name").
```lua
-- Example usage
GetInfoStructString(..., ..., ...)
```
Returns: String The value of that field, or an empty string if not set.
Example:
-- Example usage (get a player's surname)
local surname = GetInfoStructString(Player, "last_name")

View File

@ -1,18 +1,18 @@
### Function: GetInfoStructUInt(param1, param2, param3)
Function: GetInfoStructUInt(Spawn, FieldName)
**Description:**
Placeholder description.
Description: Retrieves an unsigned integer field from a spawns info struct. This can include things like level, model type, gender, etc.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: string - String value.
Parameters:
**Returns:** None.
Spawn: Spawn The entity in question.
**Example:**
FieldName: String The name of the UInt field to get (e.g., "age", "race_id").
```lua
-- Example usage
GetInfoStructUInt(..., ..., ...)
```
Returns: Int32 The value of the field.
Example:
-- Example usage (check an NPC's model type for conditional behavior)
if GetInfoStructUInt(NPC, "model_type") == 3 then
-- model_type 3 (maybe indicating a mounted model)
end

View File

@ -1,18 +1,17 @@
### Function: GetMostHated(param1, param2, param3)
Function: GetMostHated(NPC)
**Description:**
Placeholder description.
Description: Retrieves the spawn that currently has the highest hate (aggro) on the specified NPCs hate list. This is usually the NPCs current primary target in combat.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
NPC: Spawn The NPC whose hate list to examine.
**Example:**
Returns: Spawn The entity with top hate on the NPC (often the tank or highest damage dealer), or nil if the NPC has no hate list.
```lua
-- Example usage
GetMostHated(..., ..., ...)
```
Example:
-- Example usage (make the boss shout at whoever has top aggro)
local topAggro = GetMostHated(BossNPC)
if topAggro ~= nil then
Say(BossNPC, "I will destroy you, " .. GetName(topAggro) .. "!")
end

View File

@ -1,17 +1,14 @@
### Function: GetOrigX(param1, param2)
Function: GetOrigX(Spawn)
**Description:**
Placeholder description.
Description: Returns the original X coordinate of the specified spawns spawn point (where it was initially placed in the zone).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to query.
**Example:**
Returns: Float The X position of the spawns original location.
```lua
-- Example usage
GetOrigX(..., ...)
```
Example:
-- Example usage (see how far an NPC has moved from its spawn point on X axis)
local deltaX = math.abs(GetX(NPC) - GetOrigX(NPC))

View File

@ -1,17 +1,14 @@
### Function: GetOrigY(param1, param2)
Function: GetOrigY(Spawn)
**Description:**
Placeholder description.
Description: Returns the original Y coordinate (vertical position) of the spawns starting point in the zone.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity in question.
**Example:**
Returns: Float The Y coordinate of its original spawn location.
```lua
-- Example usage
GetOrigY(..., ...)
```
Example:
-- Example usage (for debugging an NPC's elevation change)
print("NPC original Y: " .. GetOrigY(NPC) .. ", current Y: " .. GetY(NPC))

View File

@ -1,17 +1,14 @@
### Function: GetOrigZ(param1, param2)
Function: GetOrigZ(Spawn)
**Description:**
Placeholder description.
Description: Returns the original Z coordinate of where the spawn was initially placed.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to check.
**Example:**
Returns: Float The Z position of the spawns original location.
```lua
-- Example usage
GetOrigZ(..., ...)
```
Example:
-- Example usage (calculate how far NPC roamed from spawn point horizontally)
local distanceFromSpawn = math.sqrt((GetX(NPC)-GetOrigX(NPC))^2 + (GetZ(NPC)-GetOrigZ(NPC))^2)

View File

@ -1,16 +1,17 @@
### Function: GetPet(param1)
Function: GetPet(Spawn)
**Description:**
Placeholder description.
Description: Retrieves the pet entity of the given spawn, if one exists. For players, this returns their current summoned combat pet (summoner or necromancer pet, etc.), or for NPCs, a charmed pet or warder.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The owner whose pet we want to get.
**Example:**
Returns: Spawn The pet entity of the owner, or nil if no pet is present.
```lua
-- Example usage
GetPet(...)
```
Example:
-- Example usage (command a player's pet to attack if it exists)
local pet = GetPet(Player)
if pet ~= nil then
Attack(pet, TargetNPC)
end

View File

@ -1,19 +1,20 @@
### Function: GetPlayerHistory(param1, param2, param3, param4)
Function: GetPlayerHistory(Player, HistoryID)
**Description:**
Placeholder description.
Description: Retrieves the value of a specific player history flag. This tells if a player has a certain historical event or choice recorded (and what value it is).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: int32 - Integer value.
Parameters:
**Returns:** None.
Player: Spawn The player to check.
**Example:**
HistoryID: Int32 The history flag ID to retrieve.
```lua
-- Example usage
GetPlayerHistory(..., ..., ..., ...)
```
Returns: Int32 The value of that history entry for the player (commonly 0 or 1, but could be other integers if used as counters).
Example:
-- Example usage (branch dialog if player has a specific history flag)
if GetPlayerHistory(Player, ALLIED_WITH_GNOLLS_HISTORY_ID) == 1 then
Say(NPC, "Welcome, friend of the Gnolls!")
else
Say(NPC, "Stranger, tread carefully...")
end

View File

@ -1,17 +1,16 @@
### Function: GetPlayersInZone(param1, param2)
Function: GetPlayersInZone(Zone)
**Description:**
Placeholder description.
Description: Retrieves a list of all player spawns currently present in the specified zone.
**Parameters:**
- `param1`: ZoneServer - The zone object.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Zone: Zone The zone object or context to search in.
**Example:**
Returns: Table A list (array) of player Spawn objects in that zone.
```lua
-- Example usage
GetPlayersInZone(..., ...)
```
Example:
-- Example usage (announce a message to all players in the zone)
for _, player in ipairs(GetPlayersInZone(GetZone(NPC))) do
SendMessage(player, "The dragon roars in the distance!", "red")
end

View File

@ -1,20 +1,19 @@
### Function: GetQuestCompleteCount(param1, param2, param3, param4, param5)
Function: GetQuestCompleteCount(Spawn, QuestID)
**Description:**
Placeholder description.
Description: Retrieves how many times the specified player (Spawn) has completed a particular quest (identified by QuestID). For non-repeatable quests this is usually 0 or 1; for repeatable quests it could be higher.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
- `param4`: unknown - Unknown type.
- `param5`: int32 - Integer value.
Parameters:
**Returns:** None.
Spawn: Spawn The player to check.
**Example:**
QuestID: Int32 The quest ID to count completions of.
```lua
-- Example usage
GetQuestCompleteCount(..., ..., ..., ..., ...)
```
Returns: Int32 The number of times the player has completed that quest.
Example:
-- Example usage (give a different dialogue if the player has done a quest multiple times)
local timesDone = GetQuestCompleteCount(Player, 9001)
if timesDone > 0 then
Say(NPC, "Back again? You know the drill.")
end

View File

@ -1,17 +1,15 @@
### Function: GetQuestFlags(param1, param2)
Function: GetQuestFlags(Quest)
**Description:**
Placeholder description.
Description: Retrieves the bitwise flags set for a quest. These flags might denote various quest properties (such as hidden, completed, failed, etc.). This is more of an internal function for quest data management.
**Parameters:**
- `param1`: unknown - Unknown type.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Quest: Quest The quest object in question.
**Example:**
Returns: Int32 The flags value for the quest.
```lua
-- Example usage
GetQuestFlags(..., ...)
```
Example:
-- Example usage (debugging quest state flags)
local flags = GetQuestFlags(Quest)
print("Quest flags: " .. flags)

View File

@ -1,17 +1,16 @@
### Function: GetRaceBaseType(param1, param2)
Function: GetRaceBaseType(Spawn)
**Description:**
Placeholder description.
Description: Returns the base race category of the spawn, which may be similar to GetRaceType but often refers to an even broader grouping (like “Player” vs “NPC” races or base model types).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to check.
**Example:**
Returns: Int32 An identifier for the base race category.
```lua
-- Example usage
GetRaceBaseType(..., ...)
```
Example:
-- Example usage (check if a target is a player character or an NPC by base type)
if GetRaceBaseType(Target) == BASE_RACE_PLAYER then
Say(NPC, "Greetings, adventurer.")
end

View File

@ -1,17 +1,16 @@
### Function: GetRaceType(param1, param2)
Function: GetRaceType(Spawn)
**Description:**
Placeholder description.
Description: Retrieves the race type category ID of the specified spawn. Instead of the specific race (human, elf, etc.), this returns a broader category (e.g., humanoid, animal, etc.).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity whose race type to get.
**Example:**
Returns: Int32 The race type ID of the spawn (corresponding to categories in game data).
```lua
-- Example usage
GetRaceType(..., ...)
```
Example:
-- Example usage (determine if NPC is animal-type for a charm spell)
if GetRaceType(NPC) == RACE_TYPE_ANIMAL then
SendMessage(Player, "This creature can be charmed by your spell.", "white")
end