target
Gives a player the target cursor and runs a function with what it picked.
Source: src/Moongate.Server.Ultima/Modules/TargetModule.cs
Functions
Section titled “Functions”cancel
Section titled “cancel”target.cancel(player) -> booleanCancels the player's target cursor; its function runs with { kind = 'canceled' } on the next turn of the game loop. False for an NPC or a player not in the world.
| Parameter | Type | Default |
|---|---|---|
player | integer |
Returns boolean.
target.pick(player, callback) -> booleanGives the player a cursor to pick an item or a mobile; the function gets { kind = 'object', serial } or { kind = 'canceled', reason } (reason is 'canceled' for ESC, 'overridden' when another cursor took its place, 'disconnected' when the player left). A cursor a script replaces is told canceled on the next turn of the game loop. False for an NPC or a player not in the world.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
callback | function |
Returns boolean.
pick_location
Section titled “pick_location”target.pick_location(player, callback) -> booleanGives the player a cursor to pick a place; the function gets { kind = 'location', map, x, y, z, graphic, land } (graphic is the static picked there, which is really on the map, or 0 for the land; land is the land tile of the cell, read from the map), an object when one was clicked, or { kind = 'canceled', reason } (reason is 'canceled' for ESC, 'overridden' when another cursor took its place, 'disconnected' when the player left). A cursor a script replaces is told canceled on the next turn of the game loop. False for an NPC or a player not in the world.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
callback | function |
Returns boolean.
Made with ❤️ by Tom
