1
0

Additional LUA Functions Markdown documents

This commit is contained in:
Emagi 2025-05-19 09:46:16 -04:00
parent 7602666b86
commit 804f9c3103
13 changed files with 172 additions and 160 deletions

View File

@ -1,27 +1,26 @@
### Function: Evac(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12)
Function: Evac(Player, X, Y, Z, Heading)
**Description:**
Placeholder description.
Description: Evacuates the Player (optional field) or their group (No fields) to a safe spot, typically the zones designated evacuation point (e.g., the zone entrance). This mimics the effect of an evac spell.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: float - Floating point value.
- `param4`: unknown - Unknown type.
- `param5`: unknown - Unknown type.
- `param6`: float - Floating point value.
- `param7`: float - Floating point value.
- `param8`: float - Floating point value.
- `param9`: float - Floating point value.
- `param10`: float - Floating point value.
- `param11`: float - Floating point value.
- `param12`: float - Floating point value.
Parameters:
**Returns:** None.
Player: Spawn The player (usually the caster of the evac or the one whose group to evac). This is optional, if Player is set Evac is self only. Otherwise Evac() is for a spell script against all spell targets.
X: Float - Optional X Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
Y: Float - Optional Y Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
Z: Float - Optional Z Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
Heading: Float - Optional Heading Coordinate (must supply X,Y,Z,Heading). If for group set Player to nil.
**Example:**
Returns: None.
```lua
-- Example usage
Evac(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...)
```
Example:
-- In a Spell Script such as Fighter\Crusader\Shadowknight\ShadowyElusion.lua
function cast(Caster, Target)
Evac()
end
-- Evac just Player
Evac(Player, X, Y, Z, Heading)
-- Evac group to specific coordinates
Evac(nil, X, Y, Z, Heading)

View File

@ -1,17 +1,16 @@
### Function: GiveExp(param1, param2)
Function: GiveExp(Spawn, Amount)
**Description:**
Placeholder description.
Description: Awards a certain amount of experience points to the specified player. This can be used to grant quest rewards or bonus experience outside the normal combat exp flow.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: int32 - Integer value.
Parameters:
**Returns:** None.
Spawn: Spawn The player to receive experience.
**Example:**
Amount: Int32 The amount of experience points to award.
```lua
-- Example usage
GiveExp(..., ...)
```
Returns: None.
Example:
-- Example usage (give experience upon quest completion)
GiveExp(Player, 10000)

View File

@ -1,18 +1,15 @@
### Function: Harvest(param1, param2, param3)
Function: Harvest(Player, GroundSpawn)
**Description:**
Placeholder description.
Description: Forces a harvest action on the specified harvestable object or resource node. When called on a harvestable spawn (like a resource node), it attempts to collect from it as if a player harvested it.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Player: Spawn The Player to harvest the node.
GroundSpawn: Spawn - The Spawn that represents the GroundSpawn.
**Example:**
Returns: None (the harvesting results — items or updates — are handled by the system).
```lua
-- Example usage
Harvest(..., ..., ...)
```
Example:
-- Example usage (not commonly used in scripts; simulated harvest of a node)
Harvest(Player, Node)

View File

@ -1,17 +1,20 @@
### Function: HasCoin(param1, param2)
Function: HasCoin(Spawn, Value)
**Description:**
Placeholder description.
Description: Checks if a player (Spawn) has at least a certain amount of coin (Value in copper) on them.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: int32 - Integer value.
Parameters:
**Returns:** None.
Spawn: Spawn The player whose coin purse to check.
Value: Int32 The amount of coin (in copper units) to check for.
**Example:**
Returns: Boolean true (1) if the player has at least that amount of coin; false (0) if they do not have enough money.
```lua
-- Example usage
HasCoin(..., ...)
```
Example:
-- Example usage (charging a fee if the player can afford it)
if HasCoin(Player, 5000) then -- 5000 copper = 50 silver
RemoveCoin(Player, 5000)
SendMessage(Player, "You pay 50 silver for the item.")
else
SendMessage(Player, "You don't have enough coin.")
end

View File

@ -1,18 +1,20 @@
### Function: HasItem(param1, param2, param3)
Function: HasItem(Player, ItemID, IncludeBank)
**Description:**
Placeholder description.
Description: Determines whether a given player possesses an item with the specified Item ID.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: int32 - Integer value.
- `param3`: int8 - Small integer or boolean flag.
Parameters:
**Returns:** None.
Player: Spawn The player or NPC to check for the item. (Typically a Player.)
**Example:**
ItemID: Int32 The unique ID of the item to check for.
```lua
-- Example usage
HasItem(..., ..., ...)
```
IncudeBank: Boolean If we should check the bank also
Returns: Boolean true (1) if the spawns inventory contains at least one of the specified item; false (0) if the item is not present.
Example:
-- Example usage from: ItemScripts/GeldranisVial.lua
if HasItem(Player, FilledVial) == false then
SummonItem(Player, FilledVial, 1)
end

View File

@ -1,16 +1,16 @@
### Function: InLava(param1)
Function: InLava(Spawn)
**Description:**
Placeholder description.
Description: Checks if the specified spawn is in lava. Similar to InWater, but specifically for lava volumes which might cause damage.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to check.
**Example:**
Returns: Boolean true if the spawn is currently in lava; false otherwise.
```lua
-- Example usage
InLava(...)
```
Example:
-- Example usage (tell the player they are standing in lava)
if InLava(Player) then
SendMessage(Player, "Feels toasty here..", "red")
end

View File

@ -1,16 +1,18 @@
### Function: InWater(param1)
Function: InWater(Spawn)
**Description:**
Placeholder description.
Description: Determines if the given spawn is currently submerged in water.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to check.
**Example:**
Returns: Boolean true if the spawn is in water; false if not.
```lua
-- Example usage
InWater(...)
```
Example:
-- Example usage (If NPC is in water make them glow)
if InWater(NPC) then
SpawnSet(NPC, "visual_state", 2103)
else
SpawnSet(NPC, "visual_state", 0)
end

View File

@ -1,17 +1,20 @@
### Function: IsEpic(param1, param2)
Function: IsEpic(Spawn)
**Description:**
Placeholder description.
Description: Checks if the given NPC is flagged as an “Epic” encounter.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The NPC to check.
**Example:**
Returns: Boolean true if the spawn is an Epic tier NPC; false otherwise.
```lua
-- Example usage
IsEpic(..., ...)
```
Example:
-- Example AtrebasEtherealBindings.lua (Spells Script)
function precast(Caster, Target)
-- Does not affect Epic targets
if IsEpic(Target) then
return false, 43
end
return true
end

View File

@ -1,16 +1,16 @@
### Function: IsOpen(param1)
Function: IsOpen(DoorSpawn)
**Description:**
Placeholder description.
Description: Checks whether a given door spawn is currently open.
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
Parameters:
**Returns:** None.
DoorSpawn: Spawn The door object to check.
**Example:**
Returns: Boolean true if the door is currently open; false if closed.
```lua
-- Example usage
IsOpen(...)
```
Example:
-- 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

View File

@ -1,17 +1,16 @@
### Function: IsPet(param1, param2)
Function: IsPet(Spawn)
**Description:**
Placeholder description.
Description: Checks whether the given spawn is a pet (either a players pet or some kind of charmed/temporary pet).
**Parameters:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
Parameters:
**Returns:** None.
Spawn: Spawn The entity to check.
**Example:**
Returns: Boolean true if the spawn is a pet under someones control; false otherwise.
```lua
-- Example usage
IsPet(..., ...)
```
Example:
-- Example usage (skip certain actions if the spawn is just a pet)
if not IsPet(TargetSpawn) then
Attack(NPC, TargetSpawn)
end

View File

@ -1,23 +1,18 @@
### Function: ProcHate(param1, param2, param3, param4, param5, param6, param7, param8)
Function: ProcHate(Source, Target, HateAmount)
**Description:**
Placeholder description.
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:**
- `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.
- `param7`: int32 - Integer value.
- `param8`: string - String value.
Parameters:
**Returns:** None.
Source: Spawn The entity generating hate.
**Example:**
Target: Spawn The entity receiving hate (being hated more).
```lua
-- Example usage
ProcHate(..., ..., ..., ..., ..., ..., ..., ...)
```
HateAmount: Int32 The amount of hate to add (or remove if negative).
Returns: None.
Example:
-- Example usage (increase hate of an NPC toward the player as a taunt proc)
ProcHate(Player, NPC, 500)

View File

@ -1,18 +1,14 @@
### Function: Runback(param1, param2, param3)
Function: Runback(NPC)
**Description:**
Placeholder description.
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:**
- `param1`: Spawn - The spawn or entity involved.
- `param2`: unknown - Unknown type.
- `param3`: unknown - Unknown type.
Parameters:
**Returns:** None.
NPC: Spawn The NPC that should run back.
**Example:**
Returns: None.
```lua
-- Example usage
Runback(..., ..., ...)
```
Example:
-- Example usage (an NPC flees and returns home)
Runback(NPC)

View File

@ -0,0 +1,17 @@
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.
Parameters:
Spawn: Spawn The Spawn whoms HP should be changed.
CurrentHP: SInt32 - New HP value for the spawn.
Returns: None.
Example:
-- Example set Spawn HP to 1000
SetHP(Spawn, 1000)