Skip to content

mobile

Acts on a mobile in the world, a player or an NPC: teleports it, reads where it is, plays a sound on it, tells a player something.

Source: src/Moongate.Server.Ultima/Modules/MobileModule.cs

mobile.add_stat_bonus(serial, stat, amount, seconds, replace?) -> boolean

Raises the mobile's 'strength', 'dexterity' or 'intelligence' by amount for seconds, as a strength or an agility potion does: a player's maximum hits, stamina or mana rise with it (an NPC's stay), and when the time is up both go back and what is above the new maximum is lost. The bonus is never saved and ends when the player leaves. False when it has a bonus of that stat already, for an unknown stat or mobile, or an amount or a time that is not positive. With replace true, as a spell buff does, a weaker bonus of the stat is replaced by this one and only one as strong or stronger refuses it.

A shrine that makes a player stronger for two minutes, once at a time:

if not mobile.add_stat_bonus(user, "strength", 10, 120) then
mobile.message_cliloc(user, 502173) -- You are already under a similar effect.
end

A spell buff passes true last: a weaker bonus of the stat is replaced, and only one as strong or stronger refuses it:

mobile.add_stat_bonus(target, "dexterity", 11, 120, true)
ParameterTypeDefault
serialinteger
statstring
amountinteger
secondsinteger
replace (optional)booleannil

Returns boolean.

mobile.add_stat_curse(serial, stat, amount, seconds, refresh?) -> boolean

Lowers the mobile's 'strength', 'dexterity' or 'intelligence' by amount for seconds, as the curses of Magery do: a player's maximum hits, stamina or mana fall with it (an NPC's stay) and what is above the new maximum is lost; it ends when the time is up or the player leaves, and is never saved. A stronger curse of the same stat replaces the one it is under; false when that one is at least as strong, for an unknown stat or mobile, or an amount or a time that is not positive. With refresh true, as a song that keeps a curse up does, a curse as strong is replaced too and its time starts over, and only a stronger one refuses it. A bonus of the same stat is kept: the two add up.

A curse of the dexterity, as Clumsy casts it: 11 points for two minutes. A curse of the same stat that is as strong or stronger stays:

if mobile.add_stat_curse(target, "dexterity", 11, 120) then
mobile.message(target, "Your hands feel clumsy.")
end
ParameterTypeDefault
serialinteger
statstring
amountinteger
secondsinteger
refresh (optional)booleannil

Returns boolean.

mobile.aggressed(serial) -> table?

The serials of the players and NPCs the mobile acted against within `aggressor_seconds` (two minutes by default), as a list; empty for a quiet mobile, nil for a serial that is not in the world.

ParameterTypeDefault
serialinteger

Returns table?.

mobile.aggressors(serial) -> table?

The serials of the players and NPCs that acted against the mobile within `aggressor_seconds` (two minutes by default), as a list; empty for a quiet mobile, nil for a serial that is not in the world.

Who attacked a mobile within aggressor_seconds (two minutes by default), and whom it attacked:

for _, attacker in ipairs(mobile.aggressors(who) or {}) do
mobile.message(attacker, "You have been fighting " .. mobile.name(who) .. ".")
end
if #(mobile.aggressed(who) or {}) > 0 then
-- who has hit somebody lately
end
ParameterTypeDefault
serialinteger

Returns table?.

mobile.animate(serial, action, frames?, repeat_count?) -> boolean

Plays an action (0 to 65535) of the mobile's body, seen by its player and those who see it, with frames (1 to 255, default 5) and how many times (1 to 255, default 1). The bodies do not share the numbers: use the names of HumanAnimationType, MonsterAnimationType or AnimalAnimationType. False for a mobile not in the world or a number out of range.

Some of the names: HumanAnimationType has Bow, Salute, Fidget1, Spell1; MonsterAnimationType has Attack1, GetHit, Pillage, Fidget1; AnimalAnimationType has Eat, Alert, LieDown. A number works too:

mobile.animate(who, HumanAnimationType.Bow)
ParameterTypeDefault
serialinteger
actioninteger
frames (optional)integer5
repeat_count (optional)integer1

Returns boolean.

mobile.backpack(serial) -> integer?

The serial of the backpack the mobile wears, to look into with item.contents; nil for a mobile without one or not in the world.

ParameterTypeDefault
serialinteger

Returns integer?.

mobile.body_type(serial) -> BodyType?

The kind of the mobile's body, as data/bodies.toml says, a BodyType: Human (every race of player and the human NPCs), Monster, Animal, Sea, Equipment, or Empty for a body the file does not list; it tells which animations the body has. Nil for a mobile not in the world.

The kind of the body tells which animations it has:

if mobile.body_type(who) == BodyType.Human then mobile.animate(who, HumanAnimationType.Eat) end
ParameterTypeDefault
serialinteger

Returns BodyType?.

mobile.criminal(serial) -> boolean?

Whether the mobile is a criminal now, its name in grey for those who see it; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns boolean?.

mobile.cure(serial) -> boolean

Ends the mobile's poison and its green bar; false when it was not poisoned or is unknown.

A healer’s blessing that ends a poison:

if mobile.cure(user) then
mobile.message_cliloc(user, 500231) -- You feel cured of poison!
end
ParameterTypeDefault
serialinteger

Returns boolean.

mobile.direction(serial) -> DirectionType?

The direction the mobile faces, a DirectionType; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns DirectionType?.

mobile.disguise(serial, options, seconds) -> boolean

Disguises the mobile for the seconds given: the options table may hold name (a text of at most 30 characters), name_list (the id of a list of data/names.toml, such as 'male', to take a random name from), body (0 to 65535) and hue (0 to 65535); what it lacks stays. When the time is up, the mobile dies or logs in after a restart that took longer, its own looks come back. A rider that takes a body that is not a human one is dismounted. False, with nothing changed, for a mobile already disguised, dead or not in the world, an empty table, a bad value or a time that is not positive.

The options may name a body, a hue, a name or the id of a list of names; what is left out stays. The mobile gets its own back when the time is up, when it dies and at login after a restart:

mobile.disguise(caster, { name_list = "male", hue = 0x3F0 }, 120)
mobile.disguise(caster, { body = 0xE1 }, 60) -- a wolf; a rider is dismounted
ParameterTypeDefault
serialinteger
optionstable
secondsnumber

Returns boolean.

mobile.end_disguise(serial) -> boolean

Gives the mobile its own name, body and hue back at once; false when it was not disguised.

mobile.end_disguise(who)
ParameterTypeDefault
serialinteger

Returns boolean.

mobile.flags(serial) -> table?

What the mobile is, as { hidden, frozen, war_mode }, each true or false; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns table?.

mobile.get_prop(serial, key) -> any?

A value the mobile, a player or an NPC, keeps across restarts: a string, a number or a bool; nil when it has none.

ParameterTypeDefault
serialinteger
keystring

Returns any?.

mobile.hands_empty(serial) -> boolean

Whether the mobile holds nothing in either hand, as stealing needs: nothing in the one-handed and nothing in the two-handed layer, a shield included. False for an unknown mobile.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.has_free_hand(serial) -> boolean

Whether the mobile has a hand free, as drinking a potion needs: not when it holds a two-handed weapon, nor a one-handed weapon with a shield. False for an unknown mobile.

Refuses to drink with both hands full:

if not mobile.has_free_hand(user) then
mobile.message_cliloc(user, 502172) -- You must have a free hand to drink a potion.
return true
end
ParameterTypeDefault
serialinteger

Returns boolean.

mobile.has_night_sight(serial) -> boolean

Whether the mobile has night sight; false for an unknown mobile.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.heal(patient, amount, healer?) -> integer?

Gives the mobile amount hit points back, up to its maximum, and tells how many it got: what a bandage or a heal spell does. The healer, optional, is told to the on_heal of an NPC, whose script may change the amount (a number replaces it, false gives none) before it lands; regeneration is not a heal. Its player sees the new status, the players around the health bar. 0 for a dead mobile, an amount of 0 or less or a mobile at its maximum; nil for a mobile not in the world.

Healing a patient; the on_heal of an NPC patient may change the amount before it lands:

local gained = mobile.heal(patient, 12, healer)
ParameterTypeDefault
patientinteger
amountnumber
healer (optional)integernil

Returns integer?.

mobile.hunger(serial) -> integer?

How full the mobile is, from 0 (starving) to 20 (full); a player loses a point every ultima.regeneration.hunger_minutes, counted from when it entered the world, and at 0 gets no hit points back; the staff neither gets hungry nor starves. Nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns integer?.

mobile.is_dead(serial) -> boolean

True for a player that is dead, a ghost; false for anyone else, an NPC that dies leaves the world, or a serial that is not a mobile.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.is_disguised(serial) -> boolean

Whether a mobile.disguise is on the mobile now.

if mobile.is_disguised(caster) then return 1061631 end
ParameterTypeDefault
serialinteger

Returns boolean.

mobile.is_female(serial) -> boolean

Whether the mobile, a player or an NPC, is female; false for a male one and for an unknown serial.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.is_mounted(serial) -> boolean

True when the mobile rides a mount, such as a horse; false for a mobile on foot or a serial that is not a mobile in the world.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.is_murderer(serial) -> boolean

True for a player with five kills or more reported against it, a murderer with a red name; false for anyone else or a serial that is not a mobile.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.is_paralyzed(serial) -> boolean

Whether the mobile is frozen by a paralysis that has not ended; a mobile frozen by mobile.set_frozen is not.

if mobile.is_paralyzed(who) then mobile.release_paralysis(who) end
ParameterTypeDefault
serialinteger

Returns boolean.

mobile.is_player(serial) -> boolean

Whether the serial is a player's character in the world; false for an NPC or an unknown serial.

ParameterTypeDefault
serialinteger

Returns boolean.

mobile.kill(serial, killer?) -> boolean

Kills a mobile: it leaves its corpse with what it carried and wore and the players around see and hear it die. An NPC runs its on_death(npc, corpse, killer) and leaves the world; a player stays as a ghost. killer is the serial of who did it, kept on the corpse, or nil. False for a mobile not in the world, a player that is dead already, or a body without a ghost.

ParameterTypeDefault
serialinteger
killer (optional)integernil

Returns boolean.

mobile.light(serial) -> integer?

The light level where the mobile stands, 0 (day) to 30 (dark): the hour, or its dungeon's; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns integer?.

mobile.location(serial) -> table?

Where the mobile stands, as a table { x, y, z, map }; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns table?.

mobile.max_weight(serial) -> integer?

The stones the mobile may carry before it is overloaded: 40 and 3.5 a point of strength; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns integer?.

mobile.message(serial, text) -> boolean

A system message, in the lower left of the screen, read only by that player (cut at 128 characters); false for an empty text, an NPC or a player not in the world.

mobile.message(who, "That is too far away.")
ParameterTypeDefault
serialinteger
textstring

Returns boolean.

mobile.message_cliloc(serial, cliloc, args?) -> boolean

A system message of the client's own texts, by cliloc number, read only by that player in the language of its client; args fills its ~1_NAME~ places, split by tabs. False for a number not above 0, an NPC or a player not in the world.

mobile.message_cliloc(who, 500867)
ParameterTypeDefault
serialinteger
clilocinteger
args (optional)stringnil

Returns boolean.

mobile.murders(serial) -> table?

The murder counts of the mobile as { kills, short_term }: the kills a victim reported (five make a murderer, red) and the short-term murders (five make a resurrection cost skills and stats). nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns table?.

mobile.name(serial) -> string?

The mobile's name; nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns string?.

mobile.notoriety(serial) -> string?

The notoriety others see the mobile with, as a name: innocent (blue), ally, attackable, criminal (grey), enemy, murderer (red) or invulnerable (yellow). A criminal reads criminal and a murderer murderer, whatever its template says. nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns string?.

mobile.paralyze(serial, seconds) -> boolean

Paralyzes the mobile for the seconds given: it neither steps, turns nor casts until they pass, and the time is saved with it, so a player that logs out is freed at the right moment. False, with nothing changed, for a mobile already frozen or dead, a time that is not positive or a mobile that is not in the world; a paralysis does not stack or extend.

A paralysis lasts a few seconds, is kept with the mobile, and does not stack or extend; release_paralysis ends it at once:

if mobile.paralyze(target, 7 + magery * 0.2) then
spell.disturb(target)
end
ParameterTypeDefault
serialinteger
secondsnumber

Returns boolean.

mobile.pathfind_to(serial, x, y, z) -> boolean

Tells the player's client to walk its character to x, y, z of its map by itself, as after a double right click on the ground: the client finds the way and walks it step by step, and the player may walk elsewhere at any time. It is the client that decides: a spot too far or with no way to it is simply not walked to, and the server is not told. True when the client was told; false for an NPC, a player that is not in the world, or coordinates outside 0 to 65535 (x, y) and -128 to 127 (z).

A guide that sends who asks the way to the bank of Britain: the player’s client walks there by itself, and the player can stop by walking elsewhere:

function guide.on_speech(serial, speaker, text)
if text:lower():find("bank", 1, true) then
npc.say(serial, "Follow your feet.")
mobile.pathfind_to(speaker, 1434, 1699, 0)
end
end
ParameterTypeDefault
serialinteger
xnumber
ynumber
znumber

Returns boolean.

mobile.play_music(serial, music) -> boolean

Plays a music (a MusicType) to the player, until its region gives it another; false for an NPC or a player not in the world.

ParameterTypeDefault
serialinteger
musicMusicType | string

Returns boolean.

mobile.play_sound(serial, sound) -> boolean

Plays a sound id (0 to 65535) where the mobile stands, for the players within 15 cells; false for a mobile not in the world or a sound out of range.

ParameterTypeDefault
serialinteger
soundinteger

Returns boolean.

mobile.poison(serial, level) -> any

Poisons the mobile at level 0 (lesser), 1 (regular), 2 (greater), 3 (deadly) or 4 (lethal): it loses hits every few seconds until the poison wears off, is cured or kills, its health bar turns green and it gets no hits back. 'poisoned' when it is, 'higher' when a poison as strong or stronger is at work already; false for an unknown level, a dead or unknown mobile. The level is saved with the mobile.

A trap that poisons whoever opens the chest:

if mobile.poison(user, 1) == "poisoned" then
mobile.message(user, "A cloud of green gas rises from the chest!")
end
ParameterTypeDefault
serialinteger
levelinteger

Returns any.

mobile.poison_level(serial) -> any

The level of the mobile's poison, 0 (lesser) to 4 (lethal); nil when it is not poisoned or is unknown.

Refuses a deadly poisoned player at the gate:

local level = mobile.poison_level(user)
if level and level >= 3 then
mobile.message(user, "Come back when you are cured.")
end
ParameterTypeDefault
serialinteger

Returns any.

mobile.region(serial) -> string?

The name of the region the mobile stands in; nil outside every region or for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns string?.

mobile.release_paralysis(serial) -> boolean

Ends the mobile's paralysis and frees it at once; false when it was not paralyzed.

mobile.release_paralysis(who)
ParameterTypeDefault
serialinteger

Returns boolean.

mobile.resurrect(corpse, healer?) -> boolean

Raises a dead player, a ghost, at once: its living body is back with 10 hit points, full stamina and no mana, and a death robe replaces its shroud; false for a player that is not dead. Given the corpse of an NPC instead, raises the NPC a corpse is of, on a later turn of the game loop: one of the same template is born where the corpse lies, with the name and the facing of who died and the equipment of its template, and the corpse is gone with what was left inside. False, and nothing is started, for what is not an item with the corpse graphic; a corpse that names no template is left as it is. The optional healer is told to the on_resurrect of the NPC that rises.

ParameterTypeDefault
corpseinteger
healer (optional)integernil

Returns boolean.

mobile.say(serial, text) -> boolean

The mobile says text overhead, seen by the players around it, as a countdown over a held explosion potion. False for an unknown mobile or blank text.

A countdown over the player who holds a lit fuse:

for count = 3, 1, -1 do
mobile.say(user, tostring(count))
wait(1)
end
ParameterTypeDefault
serialinteger
textstring

Returns boolean.

mobile.set_body(serial, body) -> boolean

Gives the mobile another body graphic (0 to 65535), seen at once by its player and the players around; false for a body out of range or a mobile not in the world.

ParameterTypeDefault
serialinteger
bodyinteger

Returns boolean.

mobile.set_criminal(serial, criminal) -> boolean

Makes the mobile a criminal for ultima.crime.criminal_seconds, starting the time again if it is one, or pardons it at once with false; false for a mobile not in the world.

ParameterTypeDefault
serialinteger
criminalboolean

Returns boolean.

mobile.set_frozen(serial, frozen) -> boolean

Freezes or frees the mobile: frozen, it neither steps nor turns; saved with the mobile. A paralysis that was running is ended by it, so its time does not lift the freeze. False for a mobile not in the world.

A freeze set by a script is the script’s own: it ends a paralysis that was running, so the time of that paralysis does not lift it later:

mobile.set_frozen(statue, true) -- stays frozen until a script or a command frees it
ParameterTypeDefault
serialinteger
frozenboolean

Returns boolean.

mobile.set_hidden(serial, hidden) -> boolean

Hides or reveals the mobile: hidden, the players around no longer see it, hear it, open its paperdoll or read its tooltip, and NPCs do not sense it; the staff still sees it and world.mobiles_in_range still returns it. Saved with the mobile. False for a mobile not in the world.

ParameterTypeDefault
serialinteger
hiddenboolean

Returns boolean.

mobile.set_hue(serial, hue) -> boolean

Gives the mobile another skin hue (0 to 65535, 0 the colours of its art), seen at once by its player and the players around; false for a hue out of range or a mobile not in the world.

ParameterTypeDefault
serialinteger
hueinteger

Returns boolean.

mobile.set_hunger(serial, hunger) -> boolean

Sets how full the mobile is, kept from 0 (starving) to 20 (full); false for a mobile not in the world.

Feeding a mobile; thirst works the same way:

mobile.set_hunger(who, mobile.hunger(who) + 3)
mobile.set_thirst(who, mobile.thirst(who) + 3)
ParameterTypeDefault
serialinteger
hungerinteger

Returns boolean.

mobile.set_name(serial, name) -> boolean

Gives the mobile another name of at most 30 characters, seen by its player and the players around; false for a blank or longer name or a mobile not in the world.

ParameterTypeDefault
serialinteger
namestring

Returns boolean.

mobile.set_night_sight(serial, level, seconds) -> boolean

Gives the player a personal light of level (0 to 30, more is brighter) for seconds, as a night sight potion does; it ends when the time is up or the player leaves. False when it has night sight already, for an unknown mobile, a level out of range or a time that is not positive.

A torch-bearer’s blessing that lets a player see in the dark for twenty minutes:

if not mobile.set_night_sight(user, 13, 1200) then
mobile.message(user, "You already have night sight.")
end
ParameterTypeDefault
serialinteger
levelinteger
secondsinteger

Returns boolean.

mobile.set_prop(serial, key, value?) -> boolean

Keeps a string, a number or a bool on the mobile across restarts, a player's saved with its character; nil removes it. False for a table, a function, a blank key or a mobile not in the world.

ParameterTypeDefault
serialinteger
keystring
value (optional)anynil

Returns boolean.

mobile.set_skill(serial, skill, value, cap?) -> boolean

Sets a skill of the mobile in points (50.5), and its cap when given; the value stays between 0 and the cap. False for a cap outside 0 to 6553.5 or a mobile not in the world; a skill number that is no SkillType raises an error. The mobile's player sees it in the skill window.

ParameterTypeDefault
serialinteger
skillSkillType | string
valuenumber
cap (optional)numbernil

Returns boolean.

mobile.set_stats(serial, values) -> boolean

Changes the mobile's numbers, given as a table with any of those mobile.stats gives but body; hits, mana and stamina stay between 0 and their maximum, also when only the maximum changes. Its player sees its bars or status change, the players around its health bar. False, with nothing changed, for an unknown name, a value that is not a whole number, a strength, dexterity, intelligence or maximum outside 0 to 65535, an empty table or a mobile not in the world.

mobile.set_stats(who, { hits = 10, strength = 80 })
ParameterTypeDefault
serialinteger
valuestable

Returns boolean.

mobile.set_stealth_steps(serial, steps) -> boolean

Sets how many steps the hidden mobile may take before a step shows it (0 to 1000); hiding or showing it again clears them, and running always shows it. False for a mobile not in the world or a number out of range.

ParameterTypeDefault
serialinteger
stepsinteger

Returns boolean.

mobile.set_thirst(serial, thirst) -> boolean

Sets how quenched the mobile is, kept from 0 (parched) to 20 (quenched); false for a mobile not in the world.

ParameterTypeDefault
serialinteger
thirstinteger

Returns boolean.

mobile.set_war_mode(serial, war_mode) -> boolean

Puts the mobile in war mode or in peace, seen by its player and the players around; a mobile comes back in peace after a restart. False for a mobile not in the world.

ParameterTypeDefault
serialinteger
war_modeboolean

Returns boolean.

mobile.skill(serial, skill) -> table?

A skill of the mobile as { value, cap, lock }: value and cap in points (50.5), lock is up, down or locked; a skill never trained is 0. nil for a mobile not in the world.

mobile.skill(who, SkillType.Magery).value
ParameterTypeDefault
serialinteger
skillSkillType | string

Returns table?.

mobile.skill_points(serial, skill) -> number?

The value of one skill of the mobile in points (50.5) as a plain number, without the table mobile.skill builds; 0 for a skill never trained, nil for a mobile not in the world.

One skill as a plain number of points, 0 when never trained:

if mobile.skill_points(who, SkillType.Magery) >= 50 then
mobile.message(who, "You know your magic well.")
end
ParameterTypeDefault
serialinteger
skillSkillType | string

Returns number?.

mobile.skills(serial) -> table?

The skills of the mobile above 0, as a table of name (magery, evaluating_intelligence) and value in points; nil for a mobile not in the world.

Every skill above 0, as a table of name and value:

mobile.skills(who).magery
ParameterTypeDefault
serialinteger

Returns table?.

mobile.stat_bonus(serial, stat) -> integer

What the mobile's 'strength', 'dexterity' or 'intelligence' is moved by now: the bonus less the curse it is under; 0 for none, an unknown stat or mobile.

ParameterTypeDefault
serialinteger
statstring

Returns integer.

mobile.stats(serial) -> table?

The mobile's numbers as a table: body, strength, dexterity, intelligence, hits, hits_max, mana, mana_max, stamina, stamina_max, fame, karma, base_strength, base_dexterity, base_hits_max, base_stamina_max; nil for a mobile not in the world. Strength, dexterity and the maximums count the timed bonuses (mobile.add_stat_bonus); the base_ ones are what mobile.set_stats sets. Read only; change them with mobile.set_stats.

ParameterTypeDefault
serialinteger

Returns table?.

mobile.stealth_steps(serial) -> integer?

How many more steps the mobile may take hidden before a step shows it, as the Stealth skill gave them; 0 for none, nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns integer?.

mobile.teleport(serial, x, y, z, map?, with_pets?) -> boolean

Teleports the mobile to x, y, z on its map, or on the given map (a MapType or its name, such as Tokuno); the players around the old spot lose it and those around the new one see it. With the sixth argument true, the creatures that follow it (pets and hirelings within 3 tiles, on its map, not told to stay, not fighting) arrive at the same spot after it; with the text "bonded" only the bonded pets do, as Recall brings them. False for a mobile not in the world, a map that does not exist or is not loaded, a spot outside the map or a z outside -128 to 127.

A player’s client is told of the map change (0xBF 0x08) and where it stands (0x20):

mobile.teleport(who, x, y, z, "Tokuno")

The last argument brings the pets and hirelings of the player that are within 3 tiles: true for all of them, "bonded" for the bonded pets only, as Recall does:

mobile.teleport(who, x, y, z, "Tokuno", true)
mobile.teleport(who, x, y, z, "Tokuno", "bonded")
ParameterTypeDefault
serialinteger
xinteger
yinteger
zinteger
map (optional)anynil
with_pets (optional)anynil

Returns boolean.

mobile.template(serial) -> string?

The id of the mobile template an NPC was made from, such as f_baker; nil for a player or a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns string?.

mobile.thirst(serial) -> integer?

How quenched the mobile is, from 0 (parched) to 20 (quenched); a player loses a point every ultima.regeneration.hunger_minutes, counted as for hunger, and at 0 gets no stamina back; the staff is left alone. Nil for a mobile not in the world.

ParameterTypeDefault
serialinteger

Returns integer?.

mobile.turn(serial, direction) -> boolean

Turns the mobile on the spot, without a step, to one of the eight directions, named as mobile.direction gives them (north, south_east); the turn is seen by those around and by the mobile's own client. A frozen mobile does not turn. False for a mobile not in the world or a direction that is not one of the eight.

The turn is on the spot, without a step, and is seen by those around and by the mobile’s own client; a frozen mobile does not turn:

mobile.turn(who, "south_east")
ParameterTypeDefault
serialinteger
directionstring

Returns boolean.

mobile.weight(serial) -> integer?

The stones the mobile carries: what it wears and everything inside, without the bank box, each pile rounded up as its tooltip says; nil for a mobile not in the world.

if mobile.weight(who) > mobile.max_weight(who) then ... end
ParameterTypeDefault
serialinteger

Returns integer?.

Made with ❤️ by Tom

Buy me a coffee