Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetMobile

Returns detailed data about the mobile with ID as a TMobileData record.

Возвращает детальные данные о мобайле с ID в виде записи TMobileData.

Pascal

function GetMobile(ID: Cardinal): TMobileData;

Type definition:

TMobileData = packed record
  serial: Cardinal;
  graphic: Word;
  color: Word;
  x: Word;
  y: Word;
  z: ShortInt;
  direction: Byte;
  world: Byte;
  flags: Byte;
  notoriety: Byte;
  hp: Integer;
  hp_max: Integer;
  sp: Integer;      // stamina
  sp_max: Integer;
  mp: Integer;      // mana
  mp_max: Integer;
end;

Python

def GetMobile(MobID: int) -> MobileData: ...

Pascal Example

var
  Mob: TMobileData;
begin
  Mob := GetMobile(Self);
  AddToSystemJournal('HP: ' + IntToStr(Mob.hp) + '/' + IntToStr(Mob.hp_max));
end.

Python Example

mob = GetMobile(Self())
AddToSystemJournal(f'HP: {mob.hp}/{mob.hp_max}')

See Also

GetMobiles, IsNPC, GetNotoriety