lua functions doc
This commit is contained in:
parent
7427396a02
commit
0cb0f53c0e
@ -1,17 +1,34 @@
|
||||
### Function: GetCanGate(param1, param2)
|
||||
### Function: GetCanGate(Spawn)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Checks if the Spawn is allowed to use Gate spells in this zone or area.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `Spawn`: Spawn - The spawn to check if Gate is allowed.
|
||||
|
||||
**Returns:** None.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
GetCanGate(..., ...)
|
||||
-- Example usage Spells/Commoner/CalltoHome.lua (spell to send player to their Bind with Gate)
|
||||
function precast(Caster, Target)
|
||||
if GetBoundZoneID(Caster) == 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
if(GetCanGate(Caster) == 1)
|
||||
then
|
||||
return true
|
||||
else
|
||||
SendMessage(Caster, "You cannot use Call to Home from this location.", "red")
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function cast(Caster, Target)
|
||||
Gate(Caster)
|
||||
end
|
||||
```
|
||||
|
@ -1,17 +1,23 @@
|
||||
### Function: IsNight(param1, param2)
|
||||
### Function: IsNight(Zone)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
***Description:***
|
||||
Checks if it is currently nighttime in the specified zone. This usually refers to the game’s day/night cycle.
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: ZoneServer - The zone object.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `Zone`: Zone - The zone to check if the time is night.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Return's true if the current time is dusk/night. Otherwise return's false.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
IsNight(..., ...)
|
||||
-- Example usage: On hail tell the user if it is night or day
|
||||
|
||||
function hail(NPC,Spawn)
|
||||
if IsNight(GetZone(NPC)) then
|
||||
Say(NPC, "It is night!")
|
||||
else
|
||||
Say(NPC, "It is day!")
|
||||
end
|
||||
end
|
||||
```
|
||||
|
@ -1,20 +1,17 @@
|
||||
### Function: RemoveCoin(param1, param2, param3, param4, param5)
|
||||
### Function: RemoveCoin(Spawn, Amount)
|
||||
|
||||
**Description:**
|
||||
Placeholder description.
|
||||
Deducts the specified amount of coin (in copper) from the spawn’s money. If the spawn does not have enough, this could reduce them to zero or potentially go negative (though typically it will not allow negative).
|
||||
|
||||
**Parameters:**
|
||||
- `param1`: Spawn - The spawn or entity involved.
|
||||
- `param2`: unknown - Unknown type.
|
||||
- `param3`: unknown - Unknown type.
|
||||
- `param4`: unknown - Unknown type.
|
||||
- `param5`: int32 - Integer value.
|
||||
- `Spawn`: Spawn - The player from whom to take coin.
|
||||
- `Amount`: UInt32 - The amount in copper to remove.
|
||||
|
||||
**Returns:** None.
|
||||
**Returns:** Return's true if the Player has enough coin to remove, otherwise return's false.
|
||||
|
||||
**Example:**
|
||||
|
||||
```lua
|
||||
-- Example usage
|
||||
RemoveCoin(..., ..., ..., ..., ...)
|
||||
```
|
||||
-- Example usage (charge a fee of 2 silver, 50 copper i.e., 250 copper total)
|
||||
RemoveCoin(Player, 250)
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user