stable
Leaves a player's pets in the stable and takes them back, as a stablemaster does.
Source: src/Moongate.Server.Ultima/Modules/StableModule.cs
Functions
Section titled “Functions”attend
Section titled “attend”stable.attend(player) -> booleanWhether the caller is the one that serves the player now: true for the first that asks, false for whoever asks again within half a second. Several stablemasters in one square hear the same words in the same moment: each asks, one answers. False for an NPC or a player not in the world.
| Parameter | Type | Default |
|---|---|---|
player | integer |
Returns boolean.
stable.claim(player, place, template) -> StableResultTypeTakes the pet at place (from 1, as in stable.pets) out of the stable and makes it again beside the player, with the player as its owner. The template must be the one of that place, so a list that changed since it was shown is not claimed by mistake. Gives a StableResultType: Ok, NoPlayer, BadIndex (no such pet at that place) or Failed (the template is gone from the data: the place is dropped).
| Parameter | Type | Default |
|---|---|---|
player | integer | |
place | integer | |
template | string |
Returns StableResultType.
stable.fee() -> integerThe gold a pet costs when it is stabled (ultima.stable.fee); 0 for free.
Returns integer.
max_pets
Section titled “max_pets”stable.max_pets() -> integerHow many pets a player may leave in the stable (ultima.stable.max_pets).
Returns integer.
stable.pets(player) -> table?The pets the player has in the stable, in the order they were left, as a list of { template, name } (the name is the one of the template, such as a horse); an empty list for none, nil for an NPC or a player not in the world. A pet is claimed by its place in this list, counted from 1.
| Parameter | Type | Default |
|---|---|---|
player | integer |
Returns table?.
stable
Section titled “stable”stable.stable(player, pet) -> StableResultTypeLeaves the pet in the stable of the player and takes the fee from its backpack and then its bank. Gives a StableResultType: Ok, NotAPet (no mount, or not in the world), NotYours, TooFar (more than a tile), Dying, Full, NoGold, NoPlayer or Failed. The caller says how far the player may be from the stablemaster.
| Parameter | Type | Default |
|---|---|---|
player | integer | |
pet | integer |
Returns StableResultType.
Made with ❤️ by Tom
