StendhalScripting/LuaAPI: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>AntumDeluge →game: added "game:getZone(string)" method |
imported>AntumDeluge →game: add descriptions |
||
| Line 66: | Line 66: | ||
Methods: |
Methods: |
||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
; ''<span style="color:green">game: |
; ''<span style="color:green">game:add</span>(object)'' |
||
: Adds an {{MarauroaFile|master|src/marauroa/common/game/RPObject.java|RPObject}} instance to the current zone. |
|||
: '''''object:''''' Object to add. |
|||
| ⚫ | |||
: Adds an {{StendhalFile|master|src/games/stendhal/server/entity/npc/NPC.java|NPC}} instance to the current zone. |
|||
: '''''npc:''''' NPC to add. |
|||
| ⚫ | |||
: Adds a {{StendhalFile|master|src/games/stendhal/server/entity/creature/Creature.java|Creature}} instance to the current zone. |
|||
: '''''creature:''''' Creature to add. |
|||
: '''''x:''''' Horizontal position of where to add creature. |
|||
: '''''y:''''' Vertical position of where to add creature. |
|||
| ⚫ | |||
: |
|||
: '''''object:''''' |
|||
| ⚫ | |||
: |
|||
: '''''npc:''''' |
|||
| ⚫ | |||
: Adds a new {{StendhalFile|master|src/games/stendhal/server/core/engine/GameEvent.java|GameEvent}}. |
|||
: '''''source:''''' |
|||
: '''''event:''''' |
|||
: '''''params:''''' |
|||
| ⚫ | |||
: Sets the current zone. |
|||
: '''''name:''''' String identifier for zone to be set as current zone. |
|||
: ''returns:'' <code>true</code> if zone was successfully set. |
|||
| ⚫ | |||
: Sets the current zone. |
|||
: '''''zone:''''' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} instance to set as current zone. |
|||
: ''returns:'' <code>true</code> if zone was successfully set. |
|||
| ⚫ | |||
: Retrieves the zone where <code>object</code> is located. |
|||
: '''''object:''''' The {{MarauroaFile|master|src/marauroa/common/game/RPObject.java|RPObject}} from which the zone should be retrieved. |
|||
: ''returns:'' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} or <code>null</code> if it doesn't exists |
|||
| ⚫ | |||
: Retrieves a zone by string ID. |
: Retrieves a zone by string ID. |
||
: '''''zoneName:''''' Name of zone to retrieve. |
: '''''zoneName:''''' Name of zone to retrieve. |
||
: ''returns:'' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} |
: ''returns:'' {{StendhalFile|master|src/games/stendhal/server/core/engine/StendhalRPZone.java|StendhalRPZone}} or <code>null</code> if it doesn't exist. |
||
; ''<span style="color:green">game:setMusic</span>(filename, args)'' |
; ''<span style="color:green">game:setMusic</span>(filename, args)'' |
||
| Line 93: | Line 127: | ||
::: <span style="color:darkblue; font-style:italic;">radius:</span> The radius from which the music can be heard (default: 10000). |
::: <span style="color:darkblue; font-style:italic;">radius:</span> The radius from which the music can be heard (default: 10000). |
||
; ''<span style="color:green">game:playerIsInZone</span>(player, zoneName)'' |
|||
: |
|||
| ⚫ | |||
: '''''player:''''' |
|||
| ⚫ | |||
: '''''zoneName:''''' |
|||
| ⚫ | |||
: ''returns:'' <code>boolean</code> |
|||
| ⚫ | |||
| ⚫ | |||
; ''<span style="color:green">game:getCreatures</span>()'' |
|||
: |
|||
| ⚫ | |||
: ''returns:'' An array of all available creatures. |
|||
* ''<span style="color:green">game:setMessage</span>(message)'' |
|||
| ⚫ | |||
: Retrieves a {{StendhalFile|master|src/games/stendhal/server/entity/creature/Creature.java|Creature}} instance. |
|||
: '''''clazz:''''' String name of the creature. |
|||
: ''returns:'' Creature or <code>null</code> if doesn't exist. |
|||
| ⚫ | |||
: |
|||
: ''returns:'' Array list of available items. |
|||
| ⚫ | |||
: |
|||
: '''name:''' |
|||
: ''returns:'' Item instance or <code>null</code> if doesn't exist. |
|||
| ⚫ | |||
: |
|||
: '''''entity:''''' |
|||
| ⚫ | |||
: Sends a private text to a player. |
|||
: '''''player:''''' Player to receive the message. |
|||
: '''''text:''''' Message text to send to player. |
|||
| ⚫ | |||
: |
|||
: ''returns:'' <code>String</code> |
|||
== entities == |
== entities == |
||