No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

luafunctions.cpp 62KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. /*
  2. * Copyright (c) 2010-2017 OTClient <https://github.com/edubart/otclient>
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. * THE SOFTWARE.
  21. */
  22. #include "client.h"
  23. #include "luavaluecasts.h"
  24. #include "game.h"
  25. #include "tile.h"
  26. #include "houses.h"
  27. #include "towns.h"
  28. #include "container.h"
  29. #include "item.h"
  30. #include "effect.h"
  31. #include "missile.h"
  32. #include "statictext.h"
  33. #include "animatedtext.h"
  34. #include "creature.h"
  35. #include "player.h"
  36. #include "localplayer.h"
  37. #include "map.h"
  38. #include "minimap.h"
  39. #include "thingtypemanager.h"
  40. #include "spritemanager.h"
  41. #include "shadermanager.h"
  42. #include "protocolgame.h"
  43. #include "uiitem.h"
  44. #include "uicreature.h"
  45. #include "uimap.h"
  46. #include "uiminimap.h"
  47. #include "uimapanchorlayout.h"
  48. #include "uiprogressrect.h"
  49. #include "uisprite.h"
  50. #include "outfit.h"
  51. #include <framework/luaengine/luainterface.h>
  52. void Client::registerLuaFunctions()
  53. {
  54. g_lua.registerSingletonClass("g_things");
  55. g_lua.bindSingletonFunction("g_things", "loadDat", &ThingTypeManager::loadDat, &g_things);
  56. g_lua.bindSingletonFunction("g_things", "saveDat", &ThingTypeManager::saveDat, &g_things);
  57. g_lua.bindSingletonFunction("g_things", "loadOtb", &ThingTypeManager::loadOtb, &g_things);
  58. g_lua.bindSingletonFunction("g_things", "loadXml", &ThingTypeManager::loadXml, &g_things);
  59. g_lua.bindSingletonFunction("g_things", "loadOtml", &ThingTypeManager::loadOtml, &g_things);
  60. g_lua.bindSingletonFunction("g_things", "isDatLoaded", &ThingTypeManager::isDatLoaded, &g_things);
  61. g_lua.bindSingletonFunction("g_things", "isOtbLoaded", &ThingTypeManager::isOtbLoaded, &g_things);
  62. g_lua.bindSingletonFunction("g_things", "getDatSignature", &ThingTypeManager::getDatSignature, &g_things);
  63. g_lua.bindSingletonFunction("g_things", "getContentRevision", &ThingTypeManager::getContentRevision, &g_things);
  64. g_lua.bindSingletonFunction("g_things", "getThingType", &ThingTypeManager::getThingType, &g_things);
  65. g_lua.bindSingletonFunction("g_things", "getItemType", &ThingTypeManager::getItemType, &g_things);
  66. g_lua.bindSingletonFunction("g_things", "getThingTypes", &ThingTypeManager::getThingTypes, &g_things);
  67. g_lua.bindSingletonFunction("g_things", "findItemTypeByClientId", &ThingTypeManager::findItemTypeByClientId, &g_things);
  68. g_lua.bindSingletonFunction("g_things", "findItemTypeByName", &ThingTypeManager::findItemTypeByName, &g_things);
  69. g_lua.bindSingletonFunction("g_things", "findItemTypesByName", &ThingTypeManager::findItemTypesByName, &g_things);
  70. g_lua.bindSingletonFunction("g_things", "findItemTypesByString", &ThingTypeManager::findItemTypesByString, &g_things);
  71. g_lua.bindSingletonFunction("g_things", "findItemTypeByCategory", &ThingTypeManager::findItemTypeByCategory, &g_things);
  72. g_lua.bindSingletonFunction("g_things", "findThingTypeByAttr", &ThingTypeManager::findThingTypeByAttr, &g_things);
  73. g_lua.registerSingletonClass("g_houses");
  74. g_lua.bindSingletonFunction("g_houses", "clear", &HouseManager::clear, &g_houses);
  75. g_lua.bindSingletonFunction("g_houses", "load", &HouseManager::load, &g_houses);
  76. g_lua.bindSingletonFunction("g_houses", "save", &HouseManager::save, &g_houses);
  77. g_lua.bindSingletonFunction("g_houses", "getHouse", &HouseManager::getHouse, &g_houses);
  78. g_lua.bindSingletonFunction("g_houses", "getHouseByName", &HouseManager::getHouseByName, &g_houses);
  79. g_lua.bindSingletonFunction("g_houses", "addHouse", &HouseManager::addHouse, &g_houses);
  80. g_lua.bindSingletonFunction("g_houses", "removeHouse", &HouseManager::removeHouse, &g_houses);
  81. g_lua.bindSingletonFunction("g_houses", "getHouseList", &HouseManager::getHouseList, &g_houses);
  82. g_lua.bindSingletonFunction("g_houses", "filterHouses", &HouseManager::filterHouses, &g_houses);
  83. g_lua.bindSingletonFunction("g_houses", "sort", &HouseManager::sort, &g_houses);
  84. g_lua.registerSingletonClass("g_towns");
  85. g_lua.bindSingletonFunction("g_towns", "getTown", &TownManager::getTown, &g_towns);
  86. g_lua.bindSingletonFunction("g_towns", "getTownByName",&TownManager::getTownByName,&g_towns);
  87. g_lua.bindSingletonFunction("g_towns", "addTown", &TownManager::addTown, &g_towns);
  88. g_lua.bindSingletonFunction("g_towns", "removeTown", &TownManager::removeTown, &g_towns);
  89. g_lua.bindSingletonFunction("g_towns", "getTowns", &TownManager::getTowns, &g_towns);
  90. g_lua.bindSingletonFunction("g_towns", "sort", &TownManager::sort, &g_towns);
  91. g_lua.registerSingletonClass("g_sprites");
  92. g_lua.bindSingletonFunction("g_sprites", "loadSpr", &SpriteManager::loadSpr, &g_sprites);
  93. g_lua.bindSingletonFunction("g_sprites", "saveSpr", &SpriteManager::saveSpr, &g_sprites);
  94. g_lua.bindSingletonFunction("g_sprites", "unload", &SpriteManager::unload, &g_sprites);
  95. g_lua.bindSingletonFunction("g_sprites", "isLoaded", &SpriteManager::isLoaded, &g_sprites);
  96. g_lua.bindSingletonFunction("g_sprites", "getSprSignature", &SpriteManager::getSignature, &g_sprites);
  97. g_lua.bindSingletonFunction("g_sprites", "getSpritesCount", &SpriteManager::getSpritesCount, &g_sprites);
  98. g_lua.registerSingletonClass("g_map");
  99. g_lua.bindSingletonFunction("g_map", "isLookPossible", &Map::isLookPossible, &g_map);
  100. g_lua.bindSingletonFunction("g_map", "isCovered", &Map::isCovered, &g_map);
  101. g_lua.bindSingletonFunction("g_map", "isCompletelyCovered", &Map::isCompletelyCovered, &g_map);
  102. g_lua.bindSingletonFunction("g_map", "addThing", &Map::addThing, &g_map);
  103. g_lua.bindSingletonFunction("g_map", "getThing", &Map::getThing, &g_map);
  104. g_lua.bindSingletonFunction("g_map", "removeThingByPos", &Map::removeThingByPos, &g_map);
  105. g_lua.bindSingletonFunction("g_map", "removeThing", &Map::removeThing, &g_map);
  106. g_lua.bindSingletonFunction("g_map", "colorizeThing", &Map::colorizeThing, &g_map);
  107. g_lua.bindSingletonFunction("g_map", "removeThingColor", &Map::removeThingColor, &g_map);
  108. g_lua.bindSingletonFunction("g_map", "clean", &Map::clean, &g_map);
  109. g_lua.bindSingletonFunction("g_map", "cleanTile", &Map::cleanTile, &g_map);
  110. g_lua.bindSingletonFunction("g_map", "cleanTexts", &Map::cleanTexts, &g_map);
  111. g_lua.bindSingletonFunction("g_map", "getTile", &Map::getTile, &g_map);
  112. g_lua.bindSingletonFunction("g_map", "getTiles", &Map::getTiles, &g_map);
  113. g_lua.bindSingletonFunction("g_map", "setCentralPosition", &Map::setCentralPosition, &g_map);
  114. g_lua.bindSingletonFunction("g_map", "getCentralPosition", &Map::getCentralPosition, &g_map);
  115. g_lua.bindSingletonFunction("g_map", "getCreatureById", &Map::getCreatureById, &g_map);
  116. g_lua.bindSingletonFunction("g_map", "removeCreatureById", &Map::removeCreatureById, &g_map);
  117. g_lua.bindSingletonFunction("g_map", "getSpectators", &Map::getSpectators, &g_map);
  118. g_lua.bindSingletonFunction("g_map", "findPath", &Map::findPath, &g_map);
  119. g_lua.bindSingletonFunction("g_map", "loadOtbm", &Map::loadOtbm, &g_map);
  120. g_lua.bindSingletonFunction("g_map", "saveOtbm", &Map::saveOtbm, &g_map);
  121. g_lua.bindSingletonFunction("g_map", "loadOtcm", &Map::loadOtcm, &g_map);
  122. g_lua.bindSingletonFunction("g_map", "saveOtcm", &Map::saveOtcm, &g_map);
  123. g_lua.bindSingletonFunction("g_map", "getHouseFile", &Map::getHouseFile, &g_map);
  124. g_lua.bindSingletonFunction("g_map", "setHouseFile", &Map::setHouseFile, &g_map);
  125. g_lua.bindSingletonFunction("g_map", "getSpawnFile", &Map::getSpawnFile, &g_map);
  126. g_lua.bindSingletonFunction("g_map", "setSpawnFile", &Map::setSpawnFile, &g_map);
  127. g_lua.bindSingletonFunction("g_map", "createTile", &Map::createTile, &g_map);
  128. g_lua.bindSingletonFunction("g_map", "setWidth", &Map::setWidth, &g_map);
  129. g_lua.bindSingletonFunction("g_map", "setHeight", &Map::setHeight, &g_map);
  130. g_lua.bindSingletonFunction("g_map", "getSize", &Map::getSize, &g_map);
  131. g_lua.bindSingletonFunction("g_map", "setDescription", &Map::setDescription, &g_map);
  132. g_lua.bindSingletonFunction("g_map", "getDescriptions", &Map::getDescriptions, &g_map);
  133. g_lua.bindSingletonFunction("g_map", "clearDescriptions", &Map::clearDescriptions, &g_map);
  134. g_lua.bindSingletonFunction("g_map", "setShowZone", &Map::setShowZone, &g_map);
  135. g_lua.bindSingletonFunction("g_map", "setShowZones", &Map::setShowZones, &g_map);
  136. g_lua.bindSingletonFunction("g_map", "setZoneColor", &Map::setZoneColor, &g_map);
  137. g_lua.bindSingletonFunction("g_map", "setZoneOpacity", &Map::setZoneOpacity, &g_map);
  138. g_lua.bindSingletonFunction("g_map", "getZoneOpacity", &Map::getZoneOpacity, &g_map);
  139. g_lua.bindSingletonFunction("g_map", "getZoneColor", &Map::getZoneColor, &g_map);
  140. g_lua.bindSingletonFunction("g_map", "showZones", &Map::showZones, &g_map);
  141. g_lua.bindSingletonFunction("g_map", "showZone", &Map::showZone, &g_map);
  142. g_lua.bindSingletonFunction("g_map", "setForceShowAnimations", &Map::setForceShowAnimations, &g_map);
  143. g_lua.bindSingletonFunction("g_map", "isForcingAnimations", &Map::isForcingAnimations, &g_map);
  144. g_lua.bindSingletonFunction("g_map", "isShowingAnimations", &Map::isShowingAnimations, &g_map);
  145. g_lua.bindSingletonFunction("g_map", "setShowAnimations", &Map::setShowAnimations, &g_map);
  146. g_lua.bindSingletonFunction("g_map", "beginGhostMode", &Map::beginGhostMode, &g_map);
  147. g_lua.bindSingletonFunction("g_map", "endGhostMode", &Map::endGhostMode, &g_map);
  148. g_lua.bindSingletonFunction("g_map", "findItemsById", &Map::findItemsById, &g_map);
  149. g_lua.registerSingletonClass("g_minimap");
  150. g_lua.bindSingletonFunction("g_minimap", "clean", &Minimap::clean, &g_minimap);
  151. g_lua.bindSingletonFunction("g_minimap", "loadImage", &Minimap::loadImage, &g_minimap);
  152. g_lua.bindSingletonFunction("g_minimap", "saveImage", &Minimap::saveImage, &g_minimap);
  153. g_lua.bindSingletonFunction("g_minimap", "loadOtmm", &Minimap::loadOtmm, &g_minimap);
  154. g_lua.bindSingletonFunction("g_minimap", "saveOtmm", &Minimap::saveOtmm, &g_minimap);
  155. g_lua.registerSingletonClass("g_creatures");
  156. g_lua.bindSingletonFunction("g_creatures", "getCreatures", &CreatureManager::getCreatures, &g_creatures);
  157. g_lua.bindSingletonFunction("g_creatures", "getCreatureByName", &CreatureManager::getCreatureByName, &g_creatures);
  158. g_lua.bindSingletonFunction("g_creatures", "getCreatureByLook", &CreatureManager::getCreatureByLook, &g_creatures);
  159. g_lua.bindSingletonFunction("g_creatures", "getSpawn", &CreatureManager::getSpawn, &g_creatures);
  160. g_lua.bindSingletonFunction("g_creatures", "getSpawnForPlacePos", &CreatureManager::getSpawnForPlacePos, &g_creatures);
  161. g_lua.bindSingletonFunction("g_creatures", "addSpawn", &CreatureManager::addSpawn, &g_creatures);
  162. g_lua.bindSingletonFunction("g_creatures", "loadMonsters", &CreatureManager::loadMonsters, &g_creatures);
  163. g_lua.bindSingletonFunction("g_creatures", "loadNpcs", &CreatureManager::loadNpcs, &g_creatures);
  164. g_lua.bindSingletonFunction("g_creatures", "loadSingleCreature", &CreatureManager::loadSingleCreature, &g_creatures);
  165. g_lua.bindSingletonFunction("g_creatures", "loadSpawns", &CreatureManager::loadSpawns, &g_creatures);
  166. g_lua.bindSingletonFunction("g_creatures", "saveSpawns", &CreatureManager::saveSpawns, &g_creatures);
  167. g_lua.bindSingletonFunction("g_creatures", "isLoaded", &CreatureManager::isLoaded, &g_creatures);
  168. g_lua.bindSingletonFunction("g_creatures", "isSpawnLoaded", &CreatureManager::isSpawnLoaded, &g_creatures);
  169. g_lua.bindSingletonFunction("g_creatures", "clear", &CreatureManager::clear, &g_creatures);
  170. g_lua.bindSingletonFunction("g_creatures", "clearSpawns", &CreatureManager::clearSpawns, &g_creatures);
  171. g_lua.bindSingletonFunction("g_creatures", "getSpawns", &CreatureManager::getSpawns, &g_creatures);
  172. g_lua.bindSingletonFunction("g_creatures", "deleteSpawn", &CreatureManager::deleteSpawn, &g_creatures);
  173. g_lua.registerSingletonClass("g_game");
  174. g_lua.bindSingletonFunction("g_game", "loginWorld", &Game::loginWorld, &g_game);
  175. g_lua.bindSingletonFunction("g_game", "cancelLogin", &Game::cancelLogin, &g_game);
  176. g_lua.bindSingletonFunction("g_game", "forceLogout", &Game::forceLogout, &g_game);
  177. g_lua.bindSingletonFunction("g_game", "safeLogout", &Game::safeLogout, &g_game);
  178. g_lua.bindSingletonFunction("g_game", "walk", &Game::walk, &g_game);
  179. g_lua.bindSingletonFunction("g_game", "dashWalk", &Game::dashWalk, &g_game);
  180. g_lua.bindSingletonFunction("g_game", "autoWalk", &Game::autoWalk, &g_game);
  181. g_lua.bindSingletonFunction("g_game", "forceWalk", &Game::forceWalk, &g_game);
  182. g_lua.bindSingletonFunction("g_game", "turn", &Game::turn, &g_game);
  183. g_lua.bindSingletonFunction("g_game", "stop", &Game::stop, &g_game);
  184. g_lua.bindSingletonFunction("g_game", "look", &Game::look, &g_game);
  185. g_lua.bindSingletonFunction("g_game", "move", &Game::move, &g_game);
  186. g_lua.bindSingletonFunction("g_game", "moveToParentContainer", &Game::moveToParentContainer, &g_game);
  187. g_lua.bindSingletonFunction("g_game", "rotate", &Game::rotate, &g_game);
  188. g_lua.bindSingletonFunction("g_game", "use", &Game::use, &g_game);
  189. g_lua.bindSingletonFunction("g_game", "useWith", &Game::useWith, &g_game);
  190. g_lua.bindSingletonFunction("g_game", "useInventoryItem", &Game::useInventoryItem, &g_game);
  191. g_lua.bindSingletonFunction("g_game", "useInventoryItemWith", &Game::useInventoryItemWith, &g_game);
  192. g_lua.bindSingletonFunction("g_game", "findItemInContainers", &Game::findItemInContainers, &g_game);
  193. g_lua.bindSingletonFunction("g_game", "open", &Game::open, &g_game);
  194. g_lua.bindSingletonFunction("g_game", "openParent", &Game::openParent, &g_game);
  195. g_lua.bindSingletonFunction("g_game", "close", &Game::close, &g_game);
  196. g_lua.bindSingletonFunction("g_game", "refreshContainer", &Game::refreshContainer, &g_game);
  197. g_lua.bindSingletonFunction("g_game", "attack", &Game::attack, &g_game);
  198. g_lua.bindSingletonFunction("g_game", "cancelAttack", &Game::cancelAttack, &g_game);
  199. g_lua.bindSingletonFunction("g_game", "follow", &Game::follow, &g_game);
  200. g_lua.bindSingletonFunction("g_game", "cancelFollow", &Game::cancelFollow, &g_game);
  201. g_lua.bindSingletonFunction("g_game", "cancelAttackAndFollow", &Game::cancelAttackAndFollow, &g_game);
  202. g_lua.bindSingletonFunction("g_game", "talk", &Game::talk, &g_game);
  203. g_lua.bindSingletonFunction("g_game", "talkChannel", &Game::talkChannel, &g_game);
  204. g_lua.bindSingletonFunction("g_game", "talkPrivate", &Game::talkPrivate, &g_game);
  205. g_lua.bindSingletonFunction("g_game", "openPrivateChannel", &Game::openPrivateChannel, &g_game);
  206. g_lua.bindSingletonFunction("g_game", "requestChannels", &Game::requestChannels, &g_game);
  207. g_lua.bindSingletonFunction("g_game", "joinChannel", &Game::joinChannel, &g_game);
  208. g_lua.bindSingletonFunction("g_game", "leaveChannel", &Game::leaveChannel, &g_game);
  209. g_lua.bindSingletonFunction("g_game", "closeNpcChannel", &Game::closeNpcChannel, &g_game);
  210. g_lua.bindSingletonFunction("g_game", "openOwnChannel", &Game::openOwnChannel, &g_game);
  211. g_lua.bindSingletonFunction("g_game", "inviteToOwnChannel", &Game::inviteToOwnChannel, &g_game);
  212. g_lua.bindSingletonFunction("g_game", "excludeFromOwnChannel", &Game::excludeFromOwnChannel, &g_game);
  213. g_lua.bindSingletonFunction("g_game", "partyInvite", &Game::partyInvite, &g_game);
  214. g_lua.bindSingletonFunction("g_game", "partyJoin", &Game::partyJoin, &g_game);
  215. g_lua.bindSingletonFunction("g_game", "partyRevokeInvitation", &Game::partyRevokeInvitation, &g_game);
  216. g_lua.bindSingletonFunction("g_game", "partyPassLeadership", &Game::partyPassLeadership, &g_game);
  217. g_lua.bindSingletonFunction("g_game", "partyLeave", &Game::partyLeave, &g_game);
  218. g_lua.bindSingletonFunction("g_game", "partyShareExperience", &Game::partyShareExperience, &g_game);
  219. g_lua.bindSingletonFunction("g_game", "requestOutfit", &Game::requestOutfit, &g_game);
  220. g_lua.bindSingletonFunction("g_game", "changeOutfit", &Game::changeOutfit, &g_game);
  221. g_lua.bindSingletonFunction("g_game", "addVip", &Game::addVip, &g_game);
  222. g_lua.bindSingletonFunction("g_game", "removeVip", &Game::removeVip, &g_game);
  223. g_lua.bindSingletonFunction("g_game", "editVip", &Game::editVip, &g_game);
  224. g_lua.bindSingletonFunction("g_game", "setChaseMode", &Game::setChaseMode, &g_game);
  225. g_lua.bindSingletonFunction("g_game", "setFightMode", &Game::setFightMode, &g_game);
  226. g_lua.bindSingletonFunction("g_game", "setPVPMode", &Game::setPVPMode, &g_game);
  227. g_lua.bindSingletonFunction("g_game", "setSafeFight", &Game::setSafeFight, &g_game);
  228. g_lua.bindSingletonFunction("g_game", "getChaseMode", &Game::getChaseMode, &g_game);
  229. g_lua.bindSingletonFunction("g_game", "getFightMode", &Game::getFightMode, &g_game);
  230. g_lua.bindSingletonFunction("g_game", "getPVPMode", &Game::getPVPMode, &g_game);
  231. g_lua.bindSingletonFunction("g_game", "getUnjustifiedPoints", &Game::getUnjustifiedPoints, &g_game);
  232. g_lua.bindSingletonFunction("g_game", "getOpenPvpSituations", &Game::getOpenPvpSituations, &g_game);
  233. g_lua.bindSingletonFunction("g_game", "isSafeFight", &Game::isSafeFight, &g_game);
  234. g_lua.bindSingletonFunction("g_game", "inspectNpcTrade", &Game::inspectNpcTrade, &g_game);
  235. g_lua.bindSingletonFunction("g_game", "buyItem", &Game::buyItem, &g_game);
  236. g_lua.bindSingletonFunction("g_game", "sellItem", &Game::sellItem, &g_game);
  237. g_lua.bindSingletonFunction("g_game", "closeNpcTrade", &Game::closeNpcTrade, &g_game);
  238. g_lua.bindSingletonFunction("g_game", "requestTrade", &Game::requestTrade, &g_game);
  239. g_lua.bindSingletonFunction("g_game", "inspectTrade", &Game::inspectTrade, &g_game);
  240. g_lua.bindSingletonFunction("g_game", "acceptTrade", &Game::acceptTrade, &g_game);
  241. g_lua.bindSingletonFunction("g_game", "rejectTrade", &Game::rejectTrade, &g_game);
  242. g_lua.bindSingletonFunction("g_game", "openRuleViolation", &Game::openRuleViolation, &g_game);
  243. g_lua.bindSingletonFunction("g_game", "closeRuleViolation", &Game::closeRuleViolation, &g_game);
  244. g_lua.bindSingletonFunction("g_game", "cancelRuleViolation", &Game::cancelRuleViolation, &g_game);
  245. g_lua.bindSingletonFunction("g_game", "reportBug", &Game::reportBug, &g_game);
  246. g_lua.bindSingletonFunction("g_game", "reportRuleViolation", &Game::reportRuleViolation, &g_game);
  247. g_lua.bindSingletonFunction("g_game", "debugReport", &Game::debugReport, &g_game);
  248. g_lua.bindSingletonFunction("g_game", "editText", &Game::editText, &g_game);
  249. g_lua.bindSingletonFunction("g_game", "editList", &Game::editList, &g_game);
  250. g_lua.bindSingletonFunction("g_game", "requestQuestLog", &Game::requestQuestLog, &g_game);
  251. g_lua.bindSingletonFunction("g_game", "requestQuestLine", &Game::requestQuestLine, &g_game);
  252. g_lua.bindSingletonFunction("g_game", "equipItem", &Game::equipItem, &g_game);
  253. g_lua.bindSingletonFunction("g_game", "mount", &Game::mount, &g_game);
  254. g_lua.bindSingletonFunction("g_game", "requestItemInfo", &Game::requestItemInfo, &g_game);
  255. g_lua.bindSingletonFunction("g_game", "ping", &Game::ping, &g_game);
  256. g_lua.bindSingletonFunction("g_game", "setPingDelay", &Game::setPingDelay, &g_game);
  257. g_lua.bindSingletonFunction("g_game", "changeMapAwareRange", &Game::changeMapAwareRange, &g_game);
  258. g_lua.bindSingletonFunction("g_game", "canPerformGameAction", &Game::canPerformGameAction, &g_game);
  259. g_lua.bindSingletonFunction("g_game", "canReportBugs", &Game::canReportBugs, &g_game);
  260. g_lua.bindSingletonFunction("g_game", "checkBotProtection", &Game::checkBotProtection, &g_game);
  261. g_lua.bindSingletonFunction("g_game", "isOnline", &Game::isOnline, &g_game);
  262. g_lua.bindSingletonFunction("g_game", "isLogging", &Game::isLogging, &g_game);
  263. g_lua.bindSingletonFunction("g_game", "isDead", &Game::isDead, &g_game);
  264. g_lua.bindSingletonFunction("g_game", "isAttacking", &Game::isAttacking, &g_game);
  265. g_lua.bindSingletonFunction("g_game", "isFollowing", &Game::isFollowing, &g_game);
  266. g_lua.bindSingletonFunction("g_game", "isConnectionOk", &Game::isConnectionOk, &g_game);
  267. g_lua.bindSingletonFunction("g_game", "getPing", &Game::getPing, &g_game);
  268. g_lua.bindSingletonFunction("g_game", "getContainer", &Game::getContainer, &g_game);
  269. g_lua.bindSingletonFunction("g_game", "getContainers", &Game::getContainers, &g_game);
  270. g_lua.bindSingletonFunction("g_game", "getVips", &Game::getVips, &g_game);
  271. g_lua.bindSingletonFunction("g_game", "getAttackingCreature", &Game::getAttackingCreature, &g_game);
  272. g_lua.bindSingletonFunction("g_game", "getFollowingCreature", &Game::getFollowingCreature, &g_game);
  273. g_lua.bindSingletonFunction("g_game", "getServerBeat", &Game::getServerBeat, &g_game);
  274. g_lua.bindSingletonFunction("g_game", "getLocalPlayer", &Game::getLocalPlayer, &g_game);
  275. g_lua.bindSingletonFunction("g_game", "getProtocolGame", &Game::getProtocolGame, &g_game);
  276. g_lua.bindSingletonFunction("g_game", "getProtocolVersion", &Game::getProtocolVersion, &g_game);
  277. g_lua.bindSingletonFunction("g_game", "setProtocolVersion", &Game::setProtocolVersion, &g_game);
  278. g_lua.bindSingletonFunction("g_game", "getClientVersion", &Game::getClientVersion, &g_game);
  279. g_lua.bindSingletonFunction("g_game", "setClientVersion", &Game::setClientVersion, &g_game);
  280. g_lua.bindSingletonFunction("g_game", "setCustomOs", &Game::setCustomOs, &g_game);
  281. g_lua.bindSingletonFunction("g_game", "getOs", &Game::getOs, &g_game);
  282. g_lua.bindSingletonFunction("g_game", "getCharacterName", &Game::getCharacterName, &g_game);
  283. g_lua.bindSingletonFunction("g_game", "getWorldName", &Game::getWorldName, &g_game);
  284. g_lua.bindSingletonFunction("g_game", "getGMActions", &Game::getGMActions, &g_game);
  285. g_lua.bindSingletonFunction("g_game", "getFeature", &Game::getFeature, &g_game);
  286. g_lua.bindSingletonFunction("g_game", "setFeature", &Game::setFeature, &g_game);
  287. g_lua.bindSingletonFunction("g_game", "enableFeature", &Game::enableFeature, &g_game);
  288. g_lua.bindSingletonFunction("g_game", "disableFeature", &Game::disableFeature, &g_game);
  289. g_lua.bindSingletonFunction("g_game", "isGM", &Game::isGM, &g_game);
  290. g_lua.bindSingletonFunction("g_game", "answerModalDialog", &Game::answerModalDialog, &g_game);
  291. g_lua.bindSingletonFunction("g_game", "browseField", &Game::browseField, &g_game);
  292. g_lua.bindSingletonFunction("g_game", "seekInContainer", &Game::seekInContainer, &g_game);
  293. g_lua.bindSingletonFunction("g_game", "getLastWalkDir", &Game::getLastWalkDir, &g_game);
  294. g_lua.bindSingletonFunction("g_game", "buyStoreOffer", &Game::buyStoreOffer, &g_game);
  295. g_lua.bindSingletonFunction("g_game", "requestTransactionHistory", &Game::requestTransactionHistory, &g_game);
  296. g_lua.bindSingletonFunction("g_game", "requestStoreOffers", &Game::requestStoreOffers, &g_game);
  297. g_lua.bindSingletonFunction("g_game", "openStore", &Game::openStore, &g_game);
  298. g_lua.bindSingletonFunction("g_game", "transferCoins", &Game::transferCoins, &g_game);
  299. g_lua.bindSingletonFunction("g_game", "openTransactionHistory", &Game::openTransactionHistory, &g_game);
  300. g_lua.registerSingletonClass("g_shaders");
  301. g_lua.bindSingletonFunction("g_shaders", "createShader", &ShaderManager::createShader, &g_shaders);
  302. g_lua.bindSingletonFunction("g_shaders", "createFragmentShader", &ShaderManager::createFragmentShader, &g_shaders);
  303. g_lua.bindSingletonFunction("g_shaders", "createFragmentShaderFromCode", &ShaderManager::createFragmentShaderFromCode, &g_shaders);
  304. g_lua.bindSingletonFunction("g_shaders", "createItemShader", &ShaderManager::createItemShader, &g_shaders);
  305. g_lua.bindSingletonFunction("g_shaders", "createMapShader", &ShaderManager::createMapShader, &g_shaders);
  306. g_lua.bindSingletonFunction("g_shaders", "getDefaultItemShader", &ShaderManager::getDefaultItemShader, &g_shaders);
  307. g_lua.bindSingletonFunction("g_shaders", "getDefaultMapShader", &ShaderManager::getDefaultMapShader, &g_shaders);
  308. g_lua.bindSingletonFunction("g_shaders", "getShader", &ShaderManager::getShader, &g_shaders);
  309. g_lua.bindGlobalFunction("getOutfitColor", Outfit::getColor);
  310. g_lua.bindGlobalFunction("getAngleFromPos", Position::getAngleFromPositions);
  311. g_lua.bindGlobalFunction("getDirectionFromPos", Position::getDirectionFromPositions);
  312. g_lua.registerClass<ProtocolGame, Protocol>();
  313. g_lua.bindClassStaticFunction<ProtocolGame>("create", []{ return ProtocolGamePtr(new ProtocolGame); });
  314. g_lua.bindClassMemberFunction<ProtocolGame>("login", &ProtocolGame::login);
  315. g_lua.bindClassMemberFunction<ProtocolGame>("sendExtendedOpcode", &ProtocolGame::sendExtendedOpcode);
  316. g_lua.bindClassMemberFunction<ProtocolGame>("addPosition", &ProtocolGame::addPosition);
  317. g_lua.bindClassMemberFunction<ProtocolGame>("setMapDescription", &ProtocolGame::setMapDescription);
  318. g_lua.bindClassMemberFunction<ProtocolGame>("setFloorDescription", &ProtocolGame::setFloorDescription);
  319. g_lua.bindClassMemberFunction<ProtocolGame>("setTileDescription", &ProtocolGame::setTileDescription);
  320. g_lua.bindClassMemberFunction<ProtocolGame>("getOutfit", &ProtocolGame::getOutfit);
  321. g_lua.bindClassMemberFunction<ProtocolGame>("getThing", &ProtocolGame::getThing);
  322. g_lua.bindClassMemberFunction<ProtocolGame>("getCreature", &ProtocolGame::getCreature);
  323. g_lua.bindClassMemberFunction<ProtocolGame>("getItem", &ProtocolGame::getItem);
  324. g_lua.bindClassMemberFunction<ProtocolGame>("getPosition", &ProtocolGame::getPosition);
  325. g_lua.registerClass<Container>();
  326. g_lua.bindClassMemberFunction<Container>("getItem", &Container::getItem);
  327. g_lua.bindClassMemberFunction<Container>("getItems", &Container::getItems);
  328. g_lua.bindClassMemberFunction<Container>("getItemsCount", &Container::getItemsCount);
  329. g_lua.bindClassMemberFunction<Container>("getSlotPosition", &Container::getSlotPosition);
  330. g_lua.bindClassMemberFunction<Container>("getName", &Container::getName);
  331. g_lua.bindClassMemberFunction<Container>("getId", &Container::getId);
  332. g_lua.bindClassMemberFunction<Container>("getCapacity", &Container::getCapacity);
  333. g_lua.bindClassMemberFunction<Container>("getContainerItem", &Container::getContainerItem);
  334. g_lua.bindClassMemberFunction<Container>("hasParent", &Container::hasParent);
  335. g_lua.bindClassMemberFunction<Container>("isClosed", &Container::isClosed);
  336. g_lua.bindClassMemberFunction<Container>("isUnlocked", &Container::isUnlocked);
  337. g_lua.bindClassMemberFunction<Container>("hasPages", &Container::hasPages);
  338. g_lua.bindClassMemberFunction<Container>("getSize", &Container::getSize);
  339. g_lua.bindClassMemberFunction<Container>("getFirstIndex", &Container::getFirstIndex);
  340. g_lua.registerClass<Thing>();
  341. g_lua.bindClassMemberFunction<Thing>("setId", &Thing::setId);
  342. g_lua.bindClassMemberFunction<Thing>("setPosition", &Thing::setPosition);
  343. g_lua.bindClassMemberFunction<Thing>("getId", &Thing::getId);
  344. g_lua.bindClassMemberFunction<Thing>("getPosition", &Thing::getPosition);
  345. g_lua.bindClassMemberFunction<Thing>("getStackPriority", &Thing::getStackPriority);
  346. g_lua.bindClassMemberFunction<Thing>("getStackPos", &Thing::getStackPos);
  347. g_lua.bindClassMemberFunction<Thing>("getAnimationPhases", &Thing::getAnimationPhases);
  348. g_lua.bindClassMemberFunction<Thing>("getTile", &Thing::getTile);
  349. g_lua.bindClassMemberFunction<Thing>("isItem", &Thing::isItem);
  350. g_lua.bindClassMemberFunction<Thing>("isMonster", &Thing::isMonster);
  351. g_lua.bindClassMemberFunction<Thing>("isNpc", &Thing::isNpc);
  352. g_lua.bindClassMemberFunction<Thing>("isCreature", &Thing::isCreature);
  353. g_lua.bindClassMemberFunction<Thing>("isEffect", &Thing::isEffect);
  354. g_lua.bindClassMemberFunction<Thing>("isMissile", &Thing::isMissile);
  355. g_lua.bindClassMemberFunction<Thing>("isPlayer", &Thing::isPlayer);
  356. g_lua.bindClassMemberFunction<Thing>("isLocalPlayer", &Thing::isLocalPlayer);
  357. g_lua.bindClassMemberFunction<Thing>("isAnimatedText", &Thing::isAnimatedText);
  358. g_lua.bindClassMemberFunction<Thing>("isStaticText", &Thing::isStaticText);
  359. g_lua.bindClassMemberFunction<Thing>("isGround", &Thing::isGround);
  360. g_lua.bindClassMemberFunction<Thing>("isGroundBorder", &Thing::isGroundBorder);
  361. g_lua.bindClassMemberFunction<Thing>("isOnBottom", &Thing::isOnBottom);
  362. g_lua.bindClassMemberFunction<Thing>("isOnTop", &Thing::isOnTop);
  363. g_lua.bindClassMemberFunction<Thing>("isContainer", &Thing::isContainer);
  364. g_lua.bindClassMemberFunction<Thing>("isForceUse", &Thing::isForceUse);
  365. g_lua.bindClassMemberFunction<Thing>("isMultiUse", &Thing::isMultiUse);
  366. g_lua.bindClassMemberFunction<Thing>("isRotateable", &Thing::isRotateable);
  367. g_lua.bindClassMemberFunction<Thing>("isNotMoveable", &Thing::isNotMoveable);
  368. g_lua.bindClassMemberFunction<Thing>("isPickupable", &Thing::isPickupable);
  369. g_lua.bindClassMemberFunction<Thing>("isIgnoreLook", &Thing::isIgnoreLook);
  370. g_lua.bindClassMemberFunction<Thing>("isStackable", &Thing::isStackable);
  371. g_lua.bindClassMemberFunction<Thing>("isHookSouth", &Thing::isHookSouth);
  372. g_lua.bindClassMemberFunction<Thing>("isTranslucent", &Thing::isTranslucent);
  373. g_lua.bindClassMemberFunction<Thing>("isFullGround", &Thing::isFullGround);
  374. g_lua.bindClassMemberFunction<Thing>("isMarketable", &Thing::isMarketable);
  375. g_lua.bindClassMemberFunction<Thing>("getMarketData", &Thing::getMarketData);
  376. g_lua.bindClassMemberFunction<Thing>("isUsable", &Thing::isUsable);
  377. g_lua.bindClassMemberFunction<Thing>("isWrapable", &Thing::isWrapable);
  378. g_lua.bindClassMemberFunction<Thing>("isUnwrapable", &Thing::isUnwrapable);
  379. g_lua.bindClassMemberFunction<Thing>("isTopEffect", &Thing::isTopEffect);
  380. g_lua.bindClassMemberFunction<Thing>("isLyingCorpse", &Thing::isLyingCorpse);
  381. g_lua.bindClassMemberFunction<Thing>("getParentContainer", &Thing::getParentContainer);
  382. g_lua.registerClass<House>();
  383. g_lua.bindClassStaticFunction<House>("create", []{ return HousePtr(new House); });
  384. g_lua.bindClassMemberFunction<House>("setId", &House::setId);
  385. g_lua.bindClassMemberFunction<House>("getId", &House::getId);
  386. g_lua.bindClassMemberFunction<House>("setName", &House::setName);
  387. g_lua.bindClassMemberFunction<House>("getName", &House::getName);
  388. g_lua.bindClassMemberFunction<House>("setTownId", &House::setTownId);
  389. g_lua.bindClassMemberFunction<House>("getTownId", &House::getTownId);
  390. g_lua.bindClassMemberFunction<House>("setTile", &House::setTile);
  391. g_lua.bindClassMemberFunction<House>("getTile", &House::getTile);
  392. g_lua.bindClassMemberFunction<House>("setEntry", &House::setEntry);
  393. g_lua.bindClassMemberFunction<House>("getEntry", &House::getEntry);
  394. g_lua.bindClassMemberFunction<House>("addDoor", &House::addDoor);
  395. g_lua.bindClassMemberFunction<House>("removeDoor", &House::removeDoor);
  396. g_lua.bindClassMemberFunction<House>("removeDoorById", &House::removeDoorById);
  397. g_lua.bindClassMemberFunction<House>("setSize", &House::setSize);
  398. g_lua.bindClassMemberFunction<House>("getSize", &House::getSize);
  399. g_lua.bindClassMemberFunction<House>("setRent", &House::setRent);
  400. g_lua.bindClassMemberFunction<House>("getRent", &House::getRent);
  401. g_lua.registerClass<Spawn>();
  402. g_lua.bindClassStaticFunction<Spawn>("create", []{ return SpawnPtr(new Spawn); });
  403. g_lua.bindClassMemberFunction<Spawn>("setRadius", &Spawn::setRadius);
  404. g_lua.bindClassMemberFunction<Spawn>("getRadius", &Spawn::getRadius);
  405. g_lua.bindClassMemberFunction<Spawn>("setCenterPos", &Spawn::setCenterPos);
  406. g_lua.bindClassMemberFunction<Spawn>("getCenterPos", &Spawn::getCenterPos);
  407. g_lua.bindClassMemberFunction<Spawn>("addCreature", &Spawn::addCreature);
  408. g_lua.bindClassMemberFunction<Spawn>("removeCreature", &Spawn::removeCreature);
  409. g_lua.bindClassMemberFunction<Spawn>("getCreatures", &Spawn::getCreatures);
  410. g_lua.registerClass<Town>();
  411. g_lua.bindClassStaticFunction<Town>("create", []{ return TownPtr(new Town); });
  412. g_lua.bindClassMemberFunction<Town>("setId", &Town::setId);
  413. g_lua.bindClassMemberFunction<Town>("setName", &Town::setName);
  414. g_lua.bindClassMemberFunction<Town>("setPos", &Town::setPos);
  415. g_lua.bindClassMemberFunction<Town>("setTemplePos", &Town::setPos); // alternative method
  416. g_lua.bindClassMemberFunction<Town>("getId", &Town::getId);
  417. g_lua.bindClassMemberFunction<Town>("getName", &Town::getName);
  418. g_lua.bindClassMemberFunction<Town>("getPos", &Town::getPos);
  419. g_lua.bindClassMemberFunction<Town>("getTemplePos", &Town::getPos); // alternative method
  420. g_lua.registerClass<CreatureType>();
  421. g_lua.bindClassStaticFunction<CreatureType>("create", []{ return CreatureTypePtr(new CreatureType); });
  422. g_lua.bindClassMemberFunction<CreatureType>("setName", &CreatureType::setName);
  423. g_lua.bindClassMemberFunction<CreatureType>("setOutfit", &CreatureType::setOutfit);
  424. g_lua.bindClassMemberFunction<CreatureType>("setSpawnTime", &CreatureType::setSpawnTime);
  425. g_lua.bindClassMemberFunction<CreatureType>("getName", &CreatureType::getName);
  426. g_lua.bindClassMemberFunction<CreatureType>("getOutfit", &CreatureType::getOutfit);
  427. g_lua.bindClassMemberFunction<CreatureType>("getSpawnTime", &CreatureType::getSpawnTime);
  428. g_lua.bindClassMemberFunction<CreatureType>("cast", &CreatureType::cast);
  429. g_lua.registerClass<Creature, Thing>();
  430. g_lua.bindClassStaticFunction<Creature>("create", []{ return CreaturePtr(new Creature); });
  431. g_lua.bindClassMemberFunction<Creature>("getId", &Creature::getId);
  432. g_lua.bindClassMemberFunction<Creature>("getName", &Creature::getName);
  433. g_lua.bindClassMemberFunction<Creature>("getHealthPercent", &Creature::getHealthPercent);
  434. g_lua.bindClassMemberFunction<Creature>("getSpeed", &Creature::getSpeed);
  435. g_lua.bindClassMemberFunction<Creature>("getBaseSpeed", &Creature::getBaseSpeed);
  436. g_lua.bindClassMemberFunction<Creature>("getSkull", &Creature::getSkull);
  437. g_lua.bindClassMemberFunction<Creature>("getShield", &Creature::getShield);
  438. g_lua.bindClassMemberFunction<Creature>("getEmblem", &Creature::getEmblem);
  439. g_lua.bindClassMemberFunction<Creature>("getIcon", &Creature::getIcon);
  440. g_lua.bindClassMemberFunction<Creature>("setOutfit", &Creature::setOutfit);
  441. g_lua.bindClassMemberFunction<Creature>("getOutfit", &Creature::getOutfit);
  442. g_lua.bindClassMemberFunction<Creature>("setOutfitColor", &Creature::setOutfitColor);
  443. g_lua.bindClassMemberFunction<Creature>("getDirection", &Creature::getDirection);
  444. g_lua.bindClassMemberFunction<Creature>("getStepDuration", &Creature::getStepDuration);
  445. g_lua.bindClassMemberFunction<Creature>("getStepProgress", &Creature::getStepProgress);
  446. g_lua.bindClassMemberFunction<Creature>("getWalkTicksElapsed", &Creature::getWalkTicksElapsed);
  447. g_lua.bindClassMemberFunction<Creature>("getStepTicksLeft", &Creature::getStepTicksLeft);
  448. g_lua.bindClassMemberFunction<Creature>("setDirection", &Creature::setDirection);
  449. g_lua.bindClassMemberFunction<Creature>("setSkullTexture", &Creature::setSkullTexture);
  450. g_lua.bindClassMemberFunction<Creature>("setShieldTexture", &Creature::setShieldTexture);
  451. g_lua.bindClassMemberFunction<Creature>("setEmblemTexture", &Creature::setEmblemTexture);
  452. g_lua.bindClassMemberFunction<Creature>("setIconTexture", &Creature::setIconTexture);
  453. g_lua.bindClassMemberFunction<Creature>("showStaticSquare", &Creature::showStaticSquare);
  454. g_lua.bindClassMemberFunction<Creature>("hideStaticSquare", &Creature::hideStaticSquare);
  455. g_lua.bindClassMemberFunction<Creature>("isWalking", &Creature::isWalking);
  456. g_lua.bindClassMemberFunction<Creature>("isInvisible", &Creature::isInvisible);
  457. g_lua.bindClassMemberFunction<Creature>("isDead", &Creature::isDead);
  458. g_lua.bindClassMemberFunction<Creature>("isRemoved", &Creature::isRemoved);
  459. g_lua.bindClassMemberFunction<Creature>("canBeSeen", &Creature::canBeSeen);
  460. g_lua.bindClassMemberFunction<Creature>("jump", &Creature::jump);
  461. g_lua.registerClass<ItemType>();
  462. g_lua.bindClassMemberFunction<ItemType>("getServerId", &ItemType::getServerId);
  463. g_lua.bindClassMemberFunction<ItemType>("getClientId", &ItemType::getClientId);
  464. g_lua.bindClassMemberFunction<ItemType>("isWritable", &ItemType::isWritable);
  465. g_lua.registerClass<ThingType>();
  466. g_lua.bindClassStaticFunction<ThingType>("create", []{ return ThingTypePtr(new ThingType); });
  467. g_lua.bindClassMemberFunction<ThingType>("getId", &ThingType::getId);
  468. g_lua.bindClassMemberFunction<ThingType>("getClothSlot", &ThingType::getClothSlot);
  469. g_lua.bindClassMemberFunction<ThingType>("getCategory", &ThingType::getCategory);
  470. g_lua.bindClassMemberFunction<ThingType>("getSize", &ThingType::getSize);
  471. g_lua.bindClassMemberFunction<ThingType>("getWidth", &ThingType::getWidth);
  472. g_lua.bindClassMemberFunction<ThingType>("getHeight", &ThingType::getHeight);
  473. g_lua.bindClassMemberFunction<ThingType>("getDisplacement", &ThingType::getDisplacement);
  474. g_lua.bindClassMemberFunction<ThingType>("getDisplacementX", &ThingType::getDisplacementX);
  475. g_lua.bindClassMemberFunction<ThingType>("getDisplacementY", &ThingType::getDisplacementY);
  476. g_lua.bindClassMemberFunction<ThingType>("getExactSize", &ThingType::getExactSize);
  477. g_lua.bindClassMemberFunction<ThingType>("getRealSize", &ThingType::getRealSize);
  478. g_lua.bindClassMemberFunction<ThingType>("getLayers", &ThingType::getLayers);
  479. g_lua.bindClassMemberFunction<ThingType>("getNumPatternX", &ThingType::getNumPatternX);
  480. g_lua.bindClassMemberFunction<ThingType>("getNumPatternY", &ThingType::getNumPatternY);
  481. g_lua.bindClassMemberFunction<ThingType>("getNumPatternZ", &ThingType::getNumPatternZ);
  482. g_lua.bindClassMemberFunction<ThingType>("getAnimationPhases", &ThingType::getAnimationPhases);
  483. g_lua.bindClassMemberFunction<ThingType>("getGroundSpeed", &ThingType::getGroundSpeed);
  484. g_lua.bindClassMemberFunction<ThingType>("getMaxTextLength", &ThingType::getMaxTextLength);
  485. g_lua.bindClassMemberFunction<ThingType>("getLight", &ThingType::getLight);
  486. g_lua.bindClassMemberFunction<ThingType>("getMinimapColor", &ThingType::getMinimapColor);
  487. g_lua.bindClassMemberFunction<ThingType>("getLensHelp", &ThingType::getLensHelp);
  488. g_lua.bindClassMemberFunction<ThingType>("getClothSlot", &ThingType::getClothSlot);
  489. g_lua.bindClassMemberFunction<ThingType>("getElevation", &ThingType::getElevation);
  490. g_lua.bindClassMemberFunction<ThingType>("isGround", &ThingType::isGround);
  491. g_lua.bindClassMemberFunction<ThingType>("isGroundBorder", &ThingType::isGroundBorder);
  492. g_lua.bindClassMemberFunction<ThingType>("isOnBottom", &ThingType::isOnBottom);
  493. g_lua.bindClassMemberFunction<ThingType>("isOnTop", &ThingType::isOnTop);
  494. g_lua.bindClassMemberFunction<ThingType>("isContainer", &ThingType::isContainer);
  495. g_lua.bindClassMemberFunction<ThingType>("isStackable", &ThingType::isStackable);
  496. g_lua.bindClassMemberFunction<ThingType>("isForceUse", &ThingType::isForceUse);
  497. g_lua.bindClassMemberFunction<ThingType>("isMultiUse", &ThingType::isMultiUse);
  498. g_lua.bindClassMemberFunction<ThingType>("isWritable", &ThingType::isWritable);
  499. g_lua.bindClassMemberFunction<ThingType>("isChargeable", &ThingType::isChargeable);
  500. g_lua.bindClassMemberFunction<ThingType>("isWritableOnce", &ThingType::isWritableOnce);
  501. g_lua.bindClassMemberFunction<ThingType>("isFluidContainer", &ThingType::isFluidContainer);
  502. g_lua.bindClassMemberFunction<ThingType>("isSplash", &ThingType::isSplash);
  503. g_lua.bindClassMemberFunction<ThingType>("isNotWalkable", &ThingType::isNotWalkable);
  504. g_lua.bindClassMemberFunction<ThingType>("isNotMoveable", &ThingType::isNotMoveable);
  505. g_lua.bindClassMemberFunction<ThingType>("blockProjectile", &ThingType::blockProjectile);
  506. g_lua.bindClassMemberFunction<ThingType>("isNotPathable", &ThingType::isNotPathable);
  507. g_lua.bindClassMemberFunction<ThingType>("setPathable", &ThingType::setPathable);
  508. g_lua.bindClassMemberFunction<ThingType>("isPickupable", &ThingType::isPickupable);
  509. g_lua.bindClassMemberFunction<ThingType>("isHangable", &ThingType::isHangable);
  510. g_lua.bindClassMemberFunction<ThingType>("isHookSouth", &ThingType::isHookSouth);
  511. g_lua.bindClassMemberFunction<ThingType>("isHookEast", &ThingType::isHookEast);
  512. g_lua.bindClassMemberFunction<ThingType>("isRotateable", &ThingType::isRotateable);
  513. g_lua.bindClassMemberFunction<ThingType>("hasLight", &ThingType::hasLight);
  514. g_lua.bindClassMemberFunction<ThingType>("isDontHide", &ThingType::isDontHide);
  515. g_lua.bindClassMemberFunction<ThingType>("isTranslucent", &ThingType::isTranslucent);
  516. g_lua.bindClassMemberFunction<ThingType>("hasDisplacement", &ThingType::hasDisplacement);
  517. g_lua.bindClassMemberFunction<ThingType>("hasElevation", &ThingType::hasElevation);
  518. g_lua.bindClassMemberFunction<ThingType>("isLyingCorpse", &ThingType::isLyingCorpse);
  519. g_lua.bindClassMemberFunction<ThingType>("isAnimateAlways", &ThingType::isAnimateAlways);
  520. g_lua.bindClassMemberFunction<ThingType>("hasMiniMapColor", &ThingType::hasMiniMapColor);
  521. g_lua.bindClassMemberFunction<ThingType>("hasLensHelp", &ThingType::hasLensHelp);
  522. g_lua.bindClassMemberFunction<ThingType>("isFullGround", &ThingType::isFullGround);
  523. g_lua.bindClassMemberFunction<ThingType>("isIgnoreLook", &ThingType::isIgnoreLook);
  524. g_lua.bindClassMemberFunction<ThingType>("isCloth", &ThingType::isCloth);
  525. g_lua.bindClassMemberFunction<ThingType>("isMarketable", &ThingType::isMarketable);
  526. g_lua.bindClassMemberFunction<ThingType>("getMarketData", &ThingType::getMarketData);
  527. g_lua.bindClassMemberFunction<ThingType>("isUsable", &ThingType::isUsable);
  528. g_lua.bindClassMemberFunction<ThingType>("isWrapable", &ThingType::isWrapable);
  529. g_lua.bindClassMemberFunction<ThingType>("isUnwrapable", &ThingType::isUnwrapable);
  530. g_lua.bindClassMemberFunction<ThingType>("isTopEffect", &ThingType::isTopEffect);
  531. g_lua.bindClassMemberFunction<ThingType>("getSprites", &ThingType::getSprites);
  532. g_lua.bindClassMemberFunction<ThingType>("hasAttribute", &ThingType::hasAttr);
  533. g_lua.bindClassMemberFunction<ThingType>("exportImage", &ThingType::exportImage);
  534. g_lua.registerClass<Item, Thing>();
  535. g_lua.bindClassStaticFunction<Item>("create", &Item::create);
  536. g_lua.bindClassStaticFunction<Item>("createOtb", &Item::createFromOtb);
  537. g_lua.bindClassMemberFunction<Item>("clone", &Item::clone);
  538. g_lua.bindClassMemberFunction<Item>("getContainerItems", &Item::getContainerItems);
  539. g_lua.bindClassMemberFunction<Item>("getContainerItem", &Item::getContainerItem);
  540. g_lua.bindClassMemberFunction<Item>("addContainerItem", &Item::addContainerItem);
  541. g_lua.bindClassMemberFunction<Item>("addContainerItemIndexed", &Item::addContainerItemIndexed);
  542. g_lua.bindClassMemberFunction<Item>("removeContainerItem", &Item::removeContainerItem);
  543. g_lua.bindClassMemberFunction<Item>("clearContainerItems", &Item::clearContainerItems);
  544. g_lua.bindClassMemberFunction<Item>("getContainerItem", &Item::getContainerItem);
  545. g_lua.bindClassMemberFunction<Item>("setCount", &Item::setCount);
  546. g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount);
  547. g_lua.bindClassMemberFunction<Item>("getSubType", &Item::getSubType);
  548. g_lua.bindClassMemberFunction<Item>("getId", &Item::getId);
  549. g_lua.bindClassMemberFunction<Item>("getServerId", &Item::getServerId);
  550. g_lua.bindClassMemberFunction<Item>("getName", &Item::getName);
  551. g_lua.bindClassMemberFunction<Item>("getDescription", &Item::getDescription);
  552. g_lua.bindClassMemberFunction<Item>("getText", &Item::getText);
  553. g_lua.bindClassMemberFunction<Item>("setDescription", &Item::setDescription);
  554. g_lua.bindClassMemberFunction<Item>("setText", &Item::setText);
  555. g_lua.bindClassMemberFunction<Item>("getUniqueId", &Item::getUniqueId);
  556. g_lua.bindClassMemberFunction<Item>("getActionId", &Item::getActionId);
  557. g_lua.bindClassMemberFunction<Item>("setUniqueId", &Item::setUniqueId);
  558. g_lua.bindClassMemberFunction<Item>("setActionId", &Item::setActionId);
  559. g_lua.bindClassMemberFunction<Item>("getTeleportDestination", &Item::getTeleportDestination);
  560. g_lua.bindClassMemberFunction<Item>("setTeleportDestination", &Item::setTeleportDestination);
  561. g_lua.bindClassMemberFunction<Item>("isStackable", &Item::isStackable);
  562. g_lua.bindClassMemberFunction<Item>("isMarketable", &Item::isMarketable);
  563. g_lua.bindClassMemberFunction<Item>("isFluidContainer", &Item::isFluidContainer);
  564. g_lua.bindClassMemberFunction<Item>("getMarketData", &Item::getMarketData);
  565. g_lua.bindClassMemberFunction<Item>("getClothSlot", &Item::getClothSlot);
  566. g_lua.registerClass<Effect, Thing>();
  567. g_lua.bindClassStaticFunction<Effect>("create", []{ return EffectPtr(new Effect); });
  568. g_lua.bindClassMemberFunction<Effect>("setId", &Effect::setId);
  569. g_lua.registerClass<Missile, Thing>();
  570. g_lua.bindClassStaticFunction<Missile>("create", []{ return MissilePtr(new Missile); });
  571. g_lua.bindClassMemberFunction<Missile>("setId", &Missile::setId);
  572. g_lua.registerClass<StaticText, Thing>();
  573. g_lua.bindClassStaticFunction<StaticText>("create", []{ return StaticTextPtr(new StaticText); });
  574. g_lua.bindClassMemberFunction<StaticText>("addMessage", &StaticText::addMessage);
  575. g_lua.bindClassMemberFunction<StaticText>("setText", &StaticText::setText);
  576. g_lua.bindClassMemberFunction<StaticText>("setFont", &StaticText::setFont);
  577. g_lua.bindClassMemberFunction<StaticText>("setColor", &StaticText::setColor);
  578. g_lua.bindClassMemberFunction<StaticText>("getColor", &StaticText::getColor);
  579. g_lua.registerClass<AnimatedText, Thing>();
  580. g_lua.registerClass<Player, Creature>();
  581. g_lua.registerClass<Npc, Creature>();
  582. g_lua.registerClass<Monster, Creature>();
  583. g_lua.registerClass<LocalPlayer, Player>();
  584. g_lua.bindClassMemberFunction<LocalPlayer>("unlockWalk", &LocalPlayer::unlockWalk);
  585. g_lua.bindClassMemberFunction<LocalPlayer>("lockWalk", &LocalPlayer::lockWalk);
  586. g_lua.bindClassMemberFunction<LocalPlayer>("canWalk", &LocalPlayer::canWalk);
  587. g_lua.bindClassMemberFunction<LocalPlayer>("setStates", &LocalPlayer::setStates);
  588. g_lua.bindClassMemberFunction<LocalPlayer>("setSkill", &LocalPlayer::setSkill);
  589. g_lua.bindClassMemberFunction<LocalPlayer>("setHealth", &LocalPlayer::setHealth);
  590. g_lua.bindClassMemberFunction<LocalPlayer>("setTotalCapacity", &LocalPlayer::setTotalCapacity);
  591. g_lua.bindClassMemberFunction<LocalPlayer>("setFreeCapacity", &LocalPlayer::setFreeCapacity);
  592. g_lua.bindClassMemberFunction<LocalPlayer>("setExperience", &LocalPlayer::setExperience);
  593. g_lua.bindClassMemberFunction<LocalPlayer>("setLevel", &LocalPlayer::setLevel);
  594. g_lua.bindClassMemberFunction<LocalPlayer>("setMana", &LocalPlayer::setMana);
  595. g_lua.bindClassMemberFunction<LocalPlayer>("setMagicLevel", &LocalPlayer::setMagicLevel);
  596. g_lua.bindClassMemberFunction<LocalPlayer>("setSoul", &LocalPlayer::setSoul);
  597. g_lua.bindClassMemberFunction<LocalPlayer>("setStamina", &LocalPlayer::setStamina);
  598. g_lua.bindClassMemberFunction<LocalPlayer>("setKnown", &LocalPlayer::setKnown);
  599. g_lua.bindClassMemberFunction<LocalPlayer>("setInventoryItem", &LocalPlayer::setInventoryItem);
  600. g_lua.bindClassMemberFunction<LocalPlayer>("getStates", &LocalPlayer::getStates);
  601. g_lua.bindClassMemberFunction<LocalPlayer>("getSkillLevel", &LocalPlayer::getSkillLevel);
  602. g_lua.bindClassMemberFunction<LocalPlayer>("getSkillBaseLevel", &LocalPlayer::getSkillBaseLevel);
  603. g_lua.bindClassMemberFunction<LocalPlayer>("getSkillLevelPercent", &LocalPlayer::getSkillLevelPercent);
  604. g_lua.bindClassMemberFunction<LocalPlayer>("getHealth", &LocalPlayer::getHealth);
  605. g_lua.bindClassMemberFunction<LocalPlayer>("getMaxHealth", &LocalPlayer::getMaxHealth);
  606. g_lua.bindClassMemberFunction<LocalPlayer>("getFreeCapacity", &LocalPlayer::getFreeCapacity);
  607. g_lua.bindClassMemberFunction<LocalPlayer>("getExperience", &LocalPlayer::getExperience);
  608. g_lua.bindClassMemberFunction<LocalPlayer>("getLevel", &LocalPlayer::getLevel);
  609. g_lua.bindClassMemberFunction<LocalPlayer>("getLevelPercent", &LocalPlayer::getLevelPercent);
  610. g_lua.bindClassMemberFunction<LocalPlayer>("getMana", &LocalPlayer::getMana);
  611. g_lua.bindClassMemberFunction<LocalPlayer>("getMaxMana", &LocalPlayer::getMaxMana);
  612. g_lua.bindClassMemberFunction<LocalPlayer>("getMagicLevel", &LocalPlayer::getMagicLevel);
  613. g_lua.bindClassMemberFunction<LocalPlayer>("getMagicLevelPercent", &LocalPlayer::getMagicLevelPercent);
  614. g_lua.bindClassMemberFunction<LocalPlayer>("getSoul", &LocalPlayer::getSoul);
  615. g_lua.bindClassMemberFunction<LocalPlayer>("getStamina", &LocalPlayer::getStamina);
  616. g_lua.bindClassMemberFunction<LocalPlayer>("getOfflineTrainingTime", &LocalPlayer::getOfflineTrainingTime);
  617. g_lua.bindClassMemberFunction<LocalPlayer>("getRegenerationTime", &LocalPlayer::getRegenerationTime);
  618. g_lua.bindClassMemberFunction<LocalPlayer>("getBaseMagicLevel", &LocalPlayer::getBaseMagicLevel);
  619. g_lua.bindClassMemberFunction<LocalPlayer>("getTotalCapacity", &LocalPlayer::getTotalCapacity);
  620. g_lua.bindClassMemberFunction<LocalPlayer>("getInventoryItem", &LocalPlayer::getInventoryItem);
  621. g_lua.bindClassMemberFunction<LocalPlayer>("getVocation", &LocalPlayer::getVocation);
  622. g_lua.bindClassMemberFunction<LocalPlayer>("getBlessings", &LocalPlayer::getBlessings);
  623. g_lua.bindClassMemberFunction<LocalPlayer>("isPremium", &LocalPlayer::isPremium);
  624. g_lua.bindClassMemberFunction<LocalPlayer>("isKnown", &LocalPlayer::isKnown);
  625. g_lua.bindClassMemberFunction<LocalPlayer>("isPreWalking", &LocalPlayer::isPreWalking);
  626. g_lua.bindClassMemberFunction<LocalPlayer>("hasSight", &LocalPlayer::hasSight);
  627. g_lua.bindClassMemberFunction<LocalPlayer>("isAutoWalking", &LocalPlayer::isAutoWalking);
  628. g_lua.bindClassMemberFunction<LocalPlayer>("isServerWalking", &LocalPlayer::isServerWalking);
  629. g_lua.bindClassMemberFunction<LocalPlayer>("stopAutoWalk", &LocalPlayer::stopAutoWalk);
  630. g_lua.bindClassMemberFunction<LocalPlayer>("autoWalk", &LocalPlayer::autoWalk);
  631. g_lua.registerClass<Tile>();
  632. g_lua.bindClassMemberFunction<Tile>("clean", &Tile::clean);
  633. g_lua.bindClassMemberFunction<Tile>("addThing", &Tile::addThing);
  634. g_lua.bindClassMemberFunction<Tile>("getThing", &Tile::getThing);
  635. g_lua.bindClassMemberFunction<Tile>("getThings", &Tile::getThings);
  636. g_lua.bindClassMemberFunction<Tile>("getItems", &Tile::getItems);
  637. g_lua.bindClassMemberFunction<Tile>("getThingStackPos", &Tile::getThingStackPos);
  638. g_lua.bindClassMemberFunction<Tile>("getThingCount", &Tile::getThingCount);
  639. g_lua.bindClassMemberFunction<Tile>("getTopThing", &Tile::getTopThing);
  640. g_lua.bindClassMemberFunction<Tile>("removeThing", &Tile::removeThing);
  641. g_lua.bindClassMemberFunction<Tile>("getTopLookThing", &Tile::getTopLookThing);
  642. g_lua.bindClassMemberFunction<Tile>("getTopUseThing", &Tile::getTopUseThing);
  643. g_lua.bindClassMemberFunction<Tile>("getTopCreature", &Tile::getTopCreature);
  644. g_lua.bindClassMemberFunction<Tile>("getTopMoveThing", &Tile::getTopMoveThing);
  645. g_lua.bindClassMemberFunction<Tile>("getTopMultiUseThing", &Tile::getTopMultiUseThing);
  646. g_lua.bindClassMemberFunction<Tile>("getPosition", &Tile::getPosition);
  647. g_lua.bindClassMemberFunction<Tile>("getDrawElevation", &Tile::getDrawElevation);
  648. g_lua.bindClassMemberFunction<Tile>("getCreatures", &Tile::getCreatures);
  649. g_lua.bindClassMemberFunction<Tile>("getGround", &Tile::getGround);
  650. g_lua.bindClassMemberFunction<Tile>("isWalkable", &Tile::isWalkable);
  651. g_lua.bindClassMemberFunction<Tile>("isHouseTile", &Tile::isHouseTile);
  652. g_lua.bindClassMemberFunction<Tile>("isFullGround", &Tile::isFullGround);
  653. g_lua.bindClassMemberFunction<Tile>("isFullyOpaque", &Tile::isFullyOpaque);
  654. g_lua.bindClassMemberFunction<Tile>("isLookPossible", &Tile::isLookPossible);
  655. g_lua.bindClassMemberFunction<Tile>("hasCreature", &Tile::hasCreature);
  656. g_lua.bindClassMemberFunction<Tile>("isEmpty", &Tile::isEmpty);
  657. g_lua.bindClassMemberFunction<Tile>("isClickable", &Tile::isClickable);
  658. g_lua.bindClassMemberFunction<Tile>("isPathable", &Tile::isPathable);
  659. g_lua.bindClassMemberFunction<Tile>("overwriteMinimapColor", &Tile::overwriteMinimapColor);
  660. g_lua.bindClassMemberFunction<Tile>("select", &Tile::select);
  661. g_lua.bindClassMemberFunction<Tile>("unselect", &Tile::unselect);
  662. g_lua.bindClassMemberFunction<Tile>("isSelected", &Tile::isSelected);
  663. g_lua.bindClassMemberFunction<Tile>("remFlag", &Tile::remFlag);
  664. g_lua.bindClassMemberFunction<Tile>("setFlag", &Tile::setFlag);
  665. g_lua.bindClassMemberFunction<Tile>("setFlags", &Tile::setFlags);
  666. g_lua.bindClassMemberFunction<Tile>("getFlags", &Tile::getFlags);
  667. g_lua.bindClassMemberFunction<Tile>("hasFlag", &Tile::hasFlag);
  668. g_lua.registerClass<UIItem, UIWidget>();
  669. g_lua.bindClassStaticFunction<UIItem>("create", []{ return UIItemPtr(new UIItem); });
  670. g_lua.bindClassMemberFunction<UIItem>("setItemId", &UIItem::setItemId);
  671. g_lua.bindClassMemberFunction<UIItem>("setItemCount", &UIItem::setItemCount);
  672. g_lua.bindClassMemberFunction<UIItem>("setItemSubType", &UIItem::setItemSubType);
  673. g_lua.bindClassMemberFunction<UIItem>("setItemVisible", &UIItem::setItemVisible);
  674. g_lua.bindClassMemberFunction<UIItem>("setItem", &UIItem::setItem);
  675. g_lua.bindClassMemberFunction<UIItem>("setVirtual", &UIItem::setVirtual);
  676. g_lua.bindClassMemberFunction<UIItem>("clearItem", &UIItem::clearItem);
  677. g_lua.bindClassMemberFunction<UIItem>("getItemId", &UIItem::getItemId);
  678. g_lua.bindClassMemberFunction<UIItem>("getItemCount", &UIItem::getItemCount);
  679. g_lua.bindClassMemberFunction<UIItem>("getItemSubType", &UIItem::getItemSubType);
  680. g_lua.bindClassMemberFunction<UIItem>("getItem", &UIItem::getItem);
  681. g_lua.bindClassMemberFunction<UIItem>("isVirtual", &UIItem::isVirtual);
  682. g_lua.bindClassMemberFunction<UIItem>("isItemVisible", &UIItem::isItemVisible);
  683. g_lua.registerClass<UISprite, UIWidget>();
  684. g_lua.bindClassStaticFunction<UISprite>("create", []{ return UISpritePtr(new UISprite); });
  685. g_lua.bindClassMemberFunction<UISprite>("setSpriteId", &UISprite::setSpriteId);
  686. g_lua.bindClassMemberFunction<UISprite>("clearSprite", &UISprite::clearSprite);
  687. g_lua.bindClassMemberFunction<UISprite>("getSpriteId", &UISprite::getSpriteId);
  688. g_lua.bindClassMemberFunction<UISprite>("setSpriteColor", &UISprite::setSpriteColor);
  689. g_lua.bindClassMemberFunction<UISprite>("hasSprite", &UISprite::hasSprite);
  690. g_lua.registerClass<UICreature, UIWidget>();
  691. g_lua.bindClassStaticFunction<UICreature>("create", []{ return UICreaturePtr(new UICreature); } );
  692. g_lua.bindClassMemberFunction<UICreature>("setCreature", &UICreature::setCreature);
  693. g_lua.bindClassMemberFunction<UICreature>("setOutfit", &UICreature::setOutfit);
  694. g_lua.bindClassMemberFunction<UICreature>("setFixedCreatureSize", &UICreature::setFixedCreatureSize);
  695. g_lua.bindClassMemberFunction<UICreature>("getCreature", &UICreature::getCreature);
  696. g_lua.bindClassMemberFunction<UICreature>("isFixedCreatureSize", &UICreature::isFixedCreatureSize);
  697. g_lua.registerClass<UIMap, UIWidget>();
  698. g_lua.bindClassStaticFunction<UIMap>("create", []{ return UIMapPtr(new UIMap); });
  699. g_lua.bindClassMemberFunction<UIMap>("drawSelf", &UIMap::drawSelf);
  700. g_lua.bindClassMemberFunction<UIMap>("movePixels", &UIMap::movePixels);
  701. g_lua.bindClassMemberFunction<UIMap>("setZoom", &UIMap::setZoom);
  702. g_lua.bindClassMemberFunction<UIMap>("zoomIn", &UIMap::zoomIn);
  703. g_lua.bindClassMemberFunction<UIMap>("zoomOut", &UIMap::zoomOut);
  704. g_lua.bindClassMemberFunction<UIMap>("followCreature", &UIMap::followCreature);
  705. g_lua.bindClassMemberFunction<UIMap>("setCameraPosition", &UIMap::setCameraPosition);
  706. g_lua.bindClassMemberFunction<UIMap>("setMaxZoomIn", &UIMap::setMaxZoomIn);
  707. g_lua.bindClassMemberFunction<UIMap>("setMaxZoomOut", &UIMap::setMaxZoomOut);
  708. g_lua.bindClassMemberFunction<UIMap>("setMultifloor", &UIMap::setMultifloor);
  709. g_lua.bindClassMemberFunction<UIMap>("lockVisibleFloor", &UIMap::lockVisibleFloor);
  710. g_lua.bindClassMemberFunction<UIMap>("unlockVisibleFloor", &UIMap::unlockVisibleFloor);
  711. g_lua.bindClassMemberFunction<UIMap>("setVisibleDimension", &UIMap::setVisibleDimension);
  712. g_lua.bindClassMemberFunction<UIMap>("setViewMode", &UIMap::setViewMode);
  713. g_lua.bindClassMemberFunction<UIMap>("setAutoViewMode", &UIMap::setAutoViewMode);
  714. g_lua.bindClassMemberFunction<UIMap>("setDrawFlags", &UIMap::setDrawFlags);
  715. g_lua.bindClassMemberFunction<UIMap>("setDrawTexts", &UIMap::setDrawTexts);
  716. g_lua.bindClassMemberFunction<UIMap>("setDrawNames", &UIMap::setDrawNames);
  717. g_lua.bindClassMemberFunction<UIMap>("setDrawHealthBars", &UIMap::setDrawHealthBars);
  718. g_lua.bindClassMemberFunction<UIMap>("setDrawLights", &UIMap::setDrawLights);
  719. g_lua.bindClassMemberFunction<UIMap>("setDrawManaBar", &UIMap::setDrawManaBar);
  720. g_lua.bindClassMemberFunction<UIMap>("setAnimated", &UIMap::setAnimated);
  721. g_lua.bindClassMemberFunction<UIMap>("setKeepAspectRatio", &UIMap::setKeepAspectRatio);
  722. g_lua.bindClassMemberFunction<UIMap>("setMapShader", &UIMap::setMapShader);
  723. g_lua.bindClassMemberFunction<UIMap>("setMinimumAmbientLight", &UIMap::setMinimumAmbientLight);
  724. g_lua.bindClassMemberFunction<UIMap>("setLimitVisibleRange", &UIMap::setLimitVisibleRange);
  725. g_lua.bindClassMemberFunction<UIMap>("setAddLightMethod", &UIMap::setAddLightMethod);
  726. g_lua.bindClassMemberFunction<UIMap>("isMultifloor", &UIMap::isMultifloor);
  727. g_lua.bindClassMemberFunction<UIMap>("isAutoViewModeEnabled", &UIMap::isAutoViewModeEnabled);
  728. g_lua.bindClassMemberFunction<UIMap>("isDrawingTexts", &UIMap::isDrawingTexts);
  729. g_lua.bindClassMemberFunction<UIMap>("isDrawingNames", &UIMap::isDrawingNames);
  730. g_lua.bindClassMemberFunction<UIMap>("isDrawingHealthBars", &UIMap::isDrawingHealthBars);
  731. g_lua.bindClassMemberFunction<UIMap>("isDrawingLights", &UIMap::isDrawingLights);
  732. g_lua.bindClassMemberFunction<UIMap>("isDrawingManaBar", &UIMap::isDrawingManaBar);
  733. g_lua.bindClassMemberFunction<UIMap>("isLimitVisibleRangeEnabled", &UIMap::isLimitVisibleRangeEnabled);
  734. g_lua.bindClassMemberFunction<UIMap>("isAnimating", &UIMap::isAnimating);
  735. g_lua.bindClassMemberFunction<UIMap>("isKeepAspectRatioEnabled", &UIMap::isKeepAspectRatioEnabled);
  736. g_lua.bindClassMemberFunction<UIMap>("getVisibleDimension", &UIMap::getVisibleDimension);
  737. g_lua.bindClassMemberFunction<UIMap>("getViewMode", &UIMap::getViewMode);
  738. g_lua.bindClassMemberFunction<UIMap>("getFollowingCreature", &UIMap::getFollowingCreature);
  739. g_lua.bindClassMemberFunction<UIMap>("getDrawFlags", &UIMap::getDrawFlags);
  740. g_lua.bindClassMemberFunction<UIMap>("getCameraPosition", &UIMap::getCameraPosition);
  741. g_lua.bindClassMemberFunction<UIMap>("getPosition", &UIMap::getPosition);
  742. g_lua.bindClassMemberFunction<UIMap>("getTile", &UIMap::getTile);
  743. g_lua.bindClassMemberFunction<UIMap>("getMaxZoomIn", &UIMap::getMaxZoomIn);
  744. g_lua.bindClassMemberFunction<UIMap>("getMaxZoomOut", &UIMap::getMaxZoomOut);
  745. g_lua.bindClassMemberFunction<UIMap>("getZoom", &UIMap::getZoom);
  746. g_lua.bindClassMemberFunction<UIMap>("getMapShader", &UIMap::getMapShader);
  747. g_lua.bindClassMemberFunction<UIMap>("getMinimumAmbientLight", &UIMap::getMinimumAmbientLight);
  748. g_lua.registerClass<UIMinimap, UIWidget>();
  749. g_lua.bindClassStaticFunction<UIMinimap>("create", []{ return UIMinimapPtr(new UIMinimap); });
  750. g_lua.bindClassMemberFunction<UIMinimap>("zoomIn", &UIMinimap::zoomIn);
  751. g_lua.bindClassMemberFunction<UIMinimap>("zoomOut", &UIMinimap::zoomOut);
  752. g_lua.bindClassMemberFunction<UIMinimap>("setZoom", &UIMinimap::setZoom);
  753. g_lua.bindClassMemberFunction<UIMinimap>("setMixZoom", &UIMinimap::setMinZoom);
  754. g_lua.bindClassMemberFunction<UIMinimap>("setMaxZoom", &UIMinimap::setMaxZoom);
  755. g_lua.bindClassMemberFunction<UIMinimap>("setCameraPosition", &UIMinimap::setCameraPosition);
  756. g_lua.bindClassMemberFunction<UIMinimap>("floorUp", &UIMinimap::floorUp);
  757. g_lua.bindClassMemberFunction<UIMinimap>("floorDown", &UIMinimap::floorDown);
  758. g_lua.bindClassMemberFunction<UIMinimap>("getTilePoint", &UIMinimap::getTilePoint);
  759. g_lua.bindClassMemberFunction<UIMinimap>("getTilePosition", &UIMinimap::getTilePosition);
  760. g_lua.bindClassMemberFunction<UIMinimap>("getTileRect", &UIMinimap::getTileRect);
  761. g_lua.bindClassMemberFunction<UIMinimap>("getCameraPosition", &UIMinimap::getCameraPosition);
  762. g_lua.bindClassMemberFunction<UIMinimap>("getMinZoom", &UIMinimap::getMinZoom);
  763. g_lua.bindClassMemberFunction<UIMinimap>("getMaxZoom", &UIMinimap::getMaxZoom);
  764. g_lua.bindClassMemberFunction<UIMinimap>("getZoom", &UIMinimap::getZoom);
  765. g_lua.bindClassMemberFunction<UIMinimap>("getScale", &UIMinimap::getScale);
  766. g_lua.bindClassMemberFunction<UIMinimap>("anchorPosition", &UIMinimap::anchorPosition);
  767. g_lua.bindClassMemberFunction<UIMinimap>("fillPosition", &UIMinimap::fillPosition);
  768. g_lua.bindClassMemberFunction<UIMinimap>("centerInPosition", &UIMinimap::centerInPosition);
  769. g_lua.registerClass<UIProgressRect, UIWidget>();
  770. g_lua.bindClassStaticFunction<UIProgressRect>("create", []{ return UIProgressRectPtr(new UIProgressRect); } );
  771. g_lua.bindClassMemberFunction<UIProgressRect>("setPercent", &UIProgressRect::setPercent);
  772. g_lua.bindClassMemberFunction<UIProgressRect>("getPercent", &UIProgressRect::getPercent);
  773. g_lua.registerClass<UIMapAnchorLayout, UIAnchorLayout>();
  774. }