Additional LUA Functions Markdown documents
This commit is contained in:
parent
7602666b86
commit
804f9c3103
@ -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:**
|
Description: Evacuates the Player (optional field) or their group (No fields) to a safe spot, typically the zone’s designated evacuation point (e.g., the zone entrance). This mimics the effect of an evac spell.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
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.
|
|
||||||
|
|
||||||
**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:
|
||||||
-- Example usage
|
|
||||||
Evac(..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ..., ...)
|
-- 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)
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
### Function: GiveExp(param1, param2)
|
Function: GiveExp(Spawn, Amount)
|
||||||
|
|
||||||
**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.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: int32 - Integer value.
|
|
||||||
|
|
||||||
**Returns:** None.
|
Spawn: Spawn – The player to receive experience.
|
||||||
|
|
||||||
**Example:**
|
Amount: Int32 – The amount of experience points to award.
|
||||||
|
|
||||||
```lua
|
Returns: None.
|
||||||
-- Example usage
|
|
||||||
GiveExp(..., ...)
|
Example:
|
||||||
```
|
|
||||||
|
-- Example usage (give experience upon quest completion)
|
||||||
|
GiveExp(Player, 10000)
|
@ -1,18 +1,15 @@
|
|||||||
### Function: Harvest(param1, param2, param3)
|
Function: Harvest(Player, GroundSpawn)
|
||||||
|
|
||||||
**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.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: unknown - Unknown type.
|
|
||||||
- `param3`: Spawn - The spawn or entity involved.
|
|
||||||
|
|
||||||
**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:
|
||||||
-- Example usage
|
|
||||||
Harvest(..., ..., ...)
|
-- Example usage (not commonly used in scripts; simulated harvest of a node)
|
||||||
```
|
Harvest(Player, Node)
|
@ -1,17 +1,20 @@
|
|||||||
### Function: HasCoin(param1, param2)
|
Function: HasCoin(Spawn, Value)
|
||||||
|
|
||||||
**Description:**
|
Description: Checks if a player (Spawn) has at least a certain amount of coin (Value in copper) on them.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: int32 - Integer value.
|
|
||||||
|
|
||||||
**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:
|
||||||
-- Example usage
|
|
||||||
HasCoin(..., ...)
|
-- 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
|
@ -1,18 +1,20 @@
|
|||||||
### Function: HasItem(param1, param2, param3)
|
Function: HasItem(Player, ItemID, IncludeBank)
|
||||||
|
|
||||||
**Description:**
|
Description: Determines whether a given player possesses an item with the specified Item ID.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: int32 - Integer value.
|
|
||||||
- `param3`: int8 - Small integer or boolean flag.
|
|
||||||
|
|
||||||
**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
|
IncudeBank: Boolean – If we should check the bank also
|
||||||
-- Example usage
|
|
||||||
HasItem(..., ..., ...)
|
Returns: Boolean – true (1) if the spawn’s 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
|
@ -1,16 +1,16 @@
|
|||||||
### Function: InLava(param1)
|
Function: InLava(Spawn)
|
||||||
|
|
||||||
**Description:**
|
Description: Checks if the specified spawn is in lava. Similar to InWater, but specifically for lava volumes which might cause damage.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
|
|
||||||
**Returns:** None.
|
Spawn: Spawn – The entity to check.
|
||||||
|
|
||||||
**Example:**
|
Returns: Boolean – true if the spawn is currently in lava; false otherwise.
|
||||||
|
|
||||||
```lua
|
Example:
|
||||||
-- Example usage
|
|
||||||
InLava(...)
|
-- Example usage (tell the player they are standing in lava)
|
||||||
```
|
if InLava(Player) then
|
||||||
|
SendMessage(Player, "Feels toasty here..", "red")
|
||||||
|
end
|
@ -1,16 +1,18 @@
|
|||||||
### Function: InWater(param1)
|
Function: InWater(Spawn)
|
||||||
|
|
||||||
**Description:**
|
Description: Determines if the given spawn is currently submerged in water.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
|
|
||||||
**Returns:** None.
|
Spawn: Spawn – The entity to check.
|
||||||
|
|
||||||
**Example:**
|
Returns: Boolean – true if the spawn is in water; false if not.
|
||||||
|
|
||||||
```lua
|
Example:
|
||||||
-- Example usage
|
|
||||||
InWater(...)
|
-- 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
|
@ -1,17 +1,20 @@
|
|||||||
### Function: IsEpic(param1, param2)
|
Function: IsEpic(Spawn)
|
||||||
|
|
||||||
**Description:**
|
Description: Checks if the given NPC is flagged as an “Epic” encounter.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: unknown - Unknown type.
|
|
||||||
|
|
||||||
**Returns:** None.
|
Spawn: Spawn – The NPC to check.
|
||||||
|
|
||||||
**Example:**
|
Returns: Boolean – true if the spawn is an Epic tier NPC; false otherwise.
|
||||||
|
|
||||||
```lua
|
Example:
|
||||||
-- Example usage
|
|
||||||
IsEpic(..., ...)
|
-- 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
|
@ -1,16 +1,16 @@
|
|||||||
### Function: IsOpen(param1)
|
Function: IsOpen(DoorSpawn)
|
||||||
|
|
||||||
**Description:**
|
Description: Checks whether a given door spawn is currently open.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
|
|
||||||
**Returns:** None.
|
DoorSpawn: Spawn – The door object to check.
|
||||||
|
|
||||||
**Example:**
|
Returns: Boolean – true if the door is currently open; false if closed.
|
||||||
|
|
||||||
```lua
|
Example:
|
||||||
-- Example usage
|
|
||||||
IsOpen(...)
|
-- 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
|
@ -1,17 +1,16 @@
|
|||||||
### Function: IsPet(param1, param2)
|
Function: IsPet(Spawn)
|
||||||
|
|
||||||
**Description:**
|
Description: Checks whether the given spawn is a pet (either a player’s pet or some kind of charmed/temporary pet).
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: unknown - Unknown type.
|
|
||||||
|
|
||||||
**Returns:** None.
|
Spawn: Spawn – The entity to check.
|
||||||
|
|
||||||
**Example:**
|
Returns: Boolean – true if the spawn is a pet under someone’s control; false otherwise.
|
||||||
|
|
||||||
```lua
|
Example:
|
||||||
-- Example usage
|
|
||||||
IsPet(..., ...)
|
-- Example usage (skip certain actions if the spawn is just a pet)
|
||||||
```
|
if not IsPet(TargetSpawn) then
|
||||||
|
Attack(NPC, TargetSpawn)
|
||||||
|
end
|
@ -1,23 +1,18 @@
|
|||||||
### Function: ProcHate(param1, param2, param3, param4, param5, param6, param7, param8)
|
Function: ProcHate(Source, Target, HateAmount)
|
||||||
|
|
||||||
**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).
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
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.
|
|
||||||
|
|
||||||
**Returns:** None.
|
Source: Spawn – The entity generating hate.
|
||||||
|
|
||||||
**Example:**
|
Target: Spawn – The entity receiving hate (being hated more).
|
||||||
|
|
||||||
```lua
|
HateAmount: Int32 – The amount of hate to add (or remove if negative).
|
||||||
-- Example usage
|
|
||||||
ProcHate(..., ..., ..., ..., ..., ..., ..., ...)
|
Returns: None.
|
||||||
```
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
-- Example usage (increase hate of an NPC toward the player as a taunt proc)
|
||||||
|
ProcHate(Player, NPC, 500)
|
@ -1,18 +1,14 @@
|
|||||||
### Function: Runback(param1, param2, param3)
|
Function: Runback(NPC)
|
||||||
|
|
||||||
**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.
|
||||||
Placeholder description.
|
|
||||||
|
|
||||||
**Parameters:**
|
Parameters:
|
||||||
- `param1`: Spawn - The spawn or entity involved.
|
|
||||||
- `param2`: unknown - Unknown type.
|
|
||||||
- `param3`: unknown - Unknown type.
|
|
||||||
|
|
||||||
**Returns:** None.
|
NPC: Spawn – The NPC that should run back.
|
||||||
|
|
||||||
**Example:**
|
Returns: None.
|
||||||
|
|
||||||
```lua
|
Example:
|
||||||
-- Example usage
|
|
||||||
Runback(..., ..., ...)
|
-- Example usage (an NPC flees and returns home)
|
||||||
```
|
Runback(NPC)
|
17
docs/lua_functions/SetHP.md
Normal file
17
docs/lua_functions/SetHP.md
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user