lua function list - mtanksl/OpenTibia GitHub Wiki

Lua binding functions

  • void print(params object[] parameters)
  • string typeof(object obj)
  • object cast(object obj, string typeName)
  • object getconfig(string file, string key)
  • string getfullpath(string relativePath)
  • void debugger.start()
  • void command.registerplugin(string nodeType, LuaTable parameters)
  • PromiseResult<object[]> command.waithandle()
  • object[] command.wait(PromiseResult<object[]> promise) block
  • void command.set(PromiseResult<object[]> promise, params object[] parameters)
  • void command.yield(Action callback)
  • void command.delay(int milliseconds) block
  • string command.delay(int milliseconds, Action callback)
  • void command.delay(GameObject gameObject, int milliseconds) block
  • string command.delay(GameObject gameObject, int milliseconds, Action callback)
  • bool command.canceldelay(string key)
  • string command.eventhandler(string eventName, Action callback)
  • string command.eventhandler(GameObject gameObject, string eventName, Action callback)
  • bool command.canceleventhandler(string key)
  • string command.gameobjecteventhandler(GameObject eventSource, string eventName, Action callback)
  • string command.gameobjecteventhandler(GameObject gameObject, GameObject eventSource, string eventName, Action callback)
  • bool command.cancelgameobjecteventhandler(string key)
  • string command.positionaleventhandler(GameObject observer, string eventName, Action callback)
  • string command.positionaleventhandler(GameObject gameObject, GameObject observer, string eventName, Action callback)
  • bool command.cancelpositionaleventhandler(string key)
  • void command.containeradditem(Container container, Item item)
  • Item command.containercreateitem(Container container, ushort openTibiaId, byte count)
  • void command.containerremoveitem(Container container, Item item)
  • void command.containerreplaceitem(Container container, Item fromItem, Item toItem)
  • void command.creatureaddcondition(Creature target, Condition condition)
  • void command.creatureattackarea(Creature attacker, bool beam, Position center, Offset[] area, ProjectileType? projectileType, MagicEffectType? magicEffectType, Attack attack, Condition condition)
  • void command.creatureattackarea(Creature attacker, bool beam, Position center, Offset[] area, ProjectileType? projectileType, MagicEffectType? magicEffectType, ushort openTibiaId, byte count, Attack attack, Condition condition)
  • void command.creatureattackcreature(Creature attacker, Creature target, Attack attack, Condition condition)
  • void command.creatureremovecondition(Creature creature, ConditionSpecialCondition conditionSpecialCondition)
  • void command.creaturedestroy(Creature creature)
  • void command.creatureupdatedirection(Creature creature, Direction direction)
  • void command.creatureupdatehealth(Creature creature, int health)
  • void command.creatureupdateinvisible(Creature creature, bool invisible)
  • void command.creatureupdatelight(Creature creature, Light conditionLight)
  • void command.creatureupdateoutfit(Creature creature, Outfit baseOutfit, Outfit conditionOutfit, bool swimming, bool conditionStealth, bool itemStealth, bool isMounted)
  • void command.creatureupdatespeed(Creature creature, int? conditionSpeed)
  • void command.creaturemove(Creature creature, Tile toTile)
  • void command.fluiditemupdatefluidtype(FluidItem fluidItem, FluidType fluidType)
  • void command.inventoryadditem(Inventory inventory, byte slot, Item item)
  • Item command.inventorycreateitem(Inventory inventory, byte slot, ushort openTibiaId, byte count)
  • void command.inventoryremoveitem(Inventory inventory, Item item)
  • void command.inventoryreplaceitem(Inventory inventory, Item fromItem, Item toItem)
  • Item command.itemclone(Item item, bool deepClone)
  • void command.itemdecrement(Item item, byte count)
  • void command.itemdestroy(Item item)
  • void command.itemmove(Item item, IContainer toContainer, byte toIndex)
  • Item command.itemtransform(Item item, ushort openTibiaId, byte count)
  • void command.monstersay(Monster monster, string message)
  • void command.monsteryell(Monster monster, string message)
  • void command.npcsay(Npc npc, string message)
  • void command.npcsaytoplayer(Npc npc, Player player, string message)
  • void command.npctrade(Npc npc, Player player, object[] offers)
  • void command.npcidle(Npc npc, Player player)
  • void command.npcfarewell(Npc npc, Player player)
  • void command.npcdisappear(Npc npc, Player player)
  • void command.playercreatemoney(Player player, int price)
  • bool command.playerdestroymoney(Player player, int price)
  • int command.playercountmoney(Player player)
  • void command.playercreateitems(Player player, ushort openTibiaId, byte type, int count)
  • bool command.playerdestroyitems(Player player, ushort openTibiaId, byte type, int count)
  • int command.playercountitems(Player player, ushort openTibiaId, byte type)
  • void command.playerachievement(Player player, int incrementStorageKey, int requiredStorageValue, string achievementName)
  • void command.playerbless(Player player, string message, string blessName)
  • void command.playeraddexperience(Player player, ulong experience)
  • void command.playerremoveexperience(Player player, ulong experience)
  • void command.playeraddskillpoints(Player player, Skill skill, ulong skillPoints)
  • void command.playeraremovekillpoints(Player player, Skill skill, ulong skillPoints)
  • void command.playerupdateskill(Player player, Skill skill, ulong skillPoints, byte skillLevel, byte skillPercent)
  • void command.playersay(Player player, string message)
  • void command.playerupdatecapacity(Player player, int capacity)
  • void command.playerupdateexperience(Player player, ulong experience, ushort level, byte levelPercent)
  • void command.playerupdatemana(Player player, int mana)
  • void command.playerupdatesoul(Player player, int soul)
  • void command.playerupdatestamina(Player player, int stamina)
  • void command.playerwhisper(Player player, string message)
  • void command.playeryell(Player player, string message)
  • (bool, Addon) command.playergetoutfit(Player player, ushort outfitId)
  • void command.playersetoutfit(Player player, ushort outfitId, Addon addon)
  • void command.playerremoveoutfit(Player player, ushort outfitId)
  • ushort[] command.playergetmounts(Player player)
  • bool command.playerhasmount(Player player, ushort mountId)
  • void command.playersetmount(Player player, ushort mountId)
  • void command.playerremovemount(Player player, ushort mountId)
  • (bool, int) command.playergetstorage(Player player, int key)
  • void command.playersetstorage(Player player, int key, int value)
  • void command.playerremovestorage(Player player, int key)
  • string[] command.playergetachievements(Player player)
  • bool command.playerhasachievement(Player player, string name)
  • void command.playersetachievement(Player player, string name)
  • void command.playerremoveachievement(Player player, string name)
  • string[] command.playergetspells(Player player)
  • bool command.playerhasspell(Player player, string name)
  • void command.playersetspell(Player player, string name)
  • void command.playerremovespell(Player player, string name)
  • string[] command.playergetblesses(Player player)
  • bool command.playerhasbless(Player player, string name)
  • void command.playersetbless(Player player, string name)
  • void command.playerremovebless(Player player, string name)
  • void command.playerstopwalk(Player player)
  • void command.showanimatedtext(Position position, AnimatedTextColor animatedTextColor, string message)
  • void command.showanimatedtext(IContent content, AnimatedTextColor animatedTextColor, string message)
  • void command.showmagiceffect(Position position, MagicEffectType magicEffectType)
  • void command.showmagiceffect(IContent content, MagicEffectType magicEffectType)
  • void command.showprojectile(IContent fromContent, IContent toContent, ProjectileType projectileType)
  • void command.showprojectile(IContent fromContent, Position toPosition, ProjectileType projectileType)
  • void command.showprojectile(Position fromPosition, IContent toContent, ProjectileType projectileType)
  • void command.showprojectile(Position fromPosition, Position toPosition, ProjectileType projectileType)
  • void command.showtext(Creature creature, TalkType talkType, string message)
  • void command.showwindowtext(Player player, TextColor textColor, string message)
  • void command.splashitemupdatefluidtype(SplashItem splashItem, FluidType fluidType)
  • void command.stackableitemupdatecount(StackableItem stackableItem, byte count)
  • void command.tileaddcreature(Tile tile, Creature creature)
  • void command.tileadditem(Tile tile, Item item)
  • Item command.tilecreateitem(Tile tile, ushort openTibiaId, byte count)
  • void command.tilecreateitemorincrement(Tile tile, ushort openTibiaId, byte count)
  • Monster command.tilecreatemonster(Tile tile, string name)
  • Npc command.tilecreatenpc(Tile tile, string name)
  • void command.tileremovecreature(Tile tile, Creature creature)
  • void command.tileremoveitem(Tile tile, Item item)
  • void command.tilereplaceitem(Tile tile, Item fromItem, Item toItem)
  • Town command.mapgettownbyname(string name)
  • Waypoint command.mapgetwaypointbyname(string name)
  • House command.mapgethousebyname(string name)
  • Tile command.mapgettile(Position position)
  • Player[] command.mapgetobserversoftypeplayer(Position position)
  • Player[] command.gameobjectsgetplayers()
  • Player command.gameobjectsgetplayerbyname(string name)
⚠️ **GitHub.com Fallback** ⚠️