/* * Copyright (c) 2010-2012 OTClient * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include "otclient.h" #include #include "luavaluecasts.h" #include "game.h" #include "tile.h" #include "houses.h" #include "towns.h" #include "container.h" #include "item.h" #include "effect.h" #include "missile.h" #include "statictext.h" #include "animatedtext.h" #include "creature.h" #include "player.h" #include "localplayer.h" #include "map.h" #include "thingtypemanager.h" #include "spritemanager.h" #include "shadermanager.h" #include "protocolgame.h" #include "uiitem.h" #include "uicreature.h" #include "uimap.h" #include "uiprogressrect.h" #include "outfit.h" void OTClient::registerLuaFunctions() { g_lua.registerSingletonClass("g_things"); g_lua.bindSingletonFunction("g_things", "loadDat", &ThingTypeManager::loadDat, &g_things); g_lua.bindSingletonFunction("g_things", "loadOtb", &ThingTypeManager::loadOtb, &g_things); g_lua.bindSingletonFunction("g_things", "loadXml", &ThingTypeManager::loadXml, &g_things); g_lua.bindSingletonFunction("g_things", "getDatSignature", &ThingTypeManager::getDatSignature, &g_things); g_lua.bindSingletonFunction("g_things", "getDatSignature", &ThingTypeManager::getDatSignature, &g_things); g_lua.bindSingletonFunction("g_things", "getThingType", &ThingTypeManager::getThingType, &g_things); g_lua.bindSingletonFunction("g_things", "getItemType", &ThingTypeManager::getItemType, &g_things); g_lua.bindSingletonFunction("g_things", "findThingTypeByAttr", &ThingTypeManager::findThingTypeByAttr, &g_things); g_lua.bindSingletonFunction("g_things", "findItemTypeByCategory", &ThingTypeManager::findItemTypeByCategory, &g_things); #if 0 g_lua.registerSingletonClass("g_houses"); g_lua.bindSingletonFunction("g_houses", "load", &Houses::load, &g_houses); g_lua.bindSingletonFunction("g_houses", "getHouse", &Houses::getHouse, &g_houses); g_lua.bindSingletonFunction("g_houses", "addHouse", &Houses::addHouse, &g_houses); g_lua.bindSingletonFunction("g_houses", "removeHouse", &Houses::removeHouse, &g_houses); g_lua.registerSingletonClass("g_towns"); g_lua.bindSingletonFunction("g_towns", "getTown", &Towns::getTown, &g_towns); g_lua.bindSingletonFunction("g_towns", "addTown", &Towns::addTown, &g_towns); g_lua.bindSingletonFunction("g_towns", "removeTown", &Towns::removeTown, &g_towns); #endif g_lua.registerSingletonClass("g_sprites"); g_lua.bindSingletonFunction("g_sprites", "loadSpr", &SpriteManager::loadSpr, &g_sprites); g_lua.bindSingletonFunction("g_sprites", "unload", &SpriteManager::unload, &g_sprites); g_lua.bindSingletonFunction("g_sprites", "isLoaded", &SpriteManager::isLoaded, &g_sprites); g_lua.bindSingletonFunction("g_sprites", "getSprSignature", &SpriteManager::getSignature, &g_sprites); g_lua.bindSingletonFunction("g_sprites", "getSpritesCount", &SpriteManager::getSpritesCount, &g_sprites); g_lua.registerSingletonClass("g_map"); g_lua.bindSingletonFunction("g_map", "isLookPossible", &Map::isLookPossible, &g_map); g_lua.bindSingletonFunction("g_map", "isCovered", &Map::isCovered, &g_map); g_lua.bindSingletonFunction("g_map", "isCompletelyCovered", &Map::isCompletelyCovered, &g_map); g_lua.bindSingletonFunction("g_map", "addThing", &Map::addThing, &g_map); g_lua.bindSingletonFunction("g_map", "getThing", &Map::getThing, &g_map); g_lua.bindSingletonFunction("g_map", "removeThingByPos", &Map::removeThingByPos, &g_map); g_lua.bindSingletonFunction("g_map", "removeThing", &Map::removeThing, &g_map); g_lua.bindSingletonFunction("g_map", "cleanTile", &Map::cleanTile, &g_map); g_lua.bindSingletonFunction("g_map", "cleanTexts", &Map::cleanTexts, &g_map); g_lua.bindSingletonFunction("g_map", "getTile", &Map::getTile, &g_map); g_lua.bindSingletonFunction("g_map", "setCentralPosition", &Map::setCentralPosition, &g_map); g_lua.bindSingletonFunction("g_map", "getCentralPosition", &Map::getCentralPosition, &g_map); g_lua.bindSingletonFunction("g_map", "getCreatureById", &Map::getCreatureById, &g_map); g_lua.bindSingletonFunction("g_map", "removeCreatureById", &Map::removeCreatureById, &g_map); g_lua.bindSingletonFunction("g_map", "getSpectators", &Map::getSpectators, &g_map); g_lua.bindSingletonFunction("g_map", "findPath", &Map::findPath, &g_map); g_lua.bindSingletonFunction("g_map", "loadOtbm", &Map::loadOtbm, &g_map); g_lua.bindSingletonFunction("g_map", "saveOtbm", &Map::saveOtbm, &g_map); g_lua.bindSingletonFunction("g_map", "loadOtcm", &Map::loadOtcm, &g_map); g_lua.bindSingletonFunction("g_map", "saveOtcm", &Map::saveOtcm, &g_map); g_lua.bindSingletonFunction("g_map", "loadMonsters", &Map::loadMonsters, &g_map); g_lua.bindSingletonFunction("g_map", "loadSingleCreature", &Map::loadSingleCreature, &g_map); g_lua.bindSingletonFunction("g_map", "getTown", &Map::getTown, &g_map); g_lua.bindSingletonFunction("g_map", "getHouse", &Map::getHouse, &g_map); g_lua.bindSingletonFunction("g_map", "getCreature", &Map::getCreature, &g_map); g_lua.registerSingletonClass("g_game"); g_lua.bindSingletonFunction("g_game", "loginWorld", &Game::loginWorld, &g_game); g_lua.bindSingletonFunction("g_game", "cancelLogin", &Game::cancelLogin, &g_game); g_lua.bindSingletonFunction("g_game", "forceLogout", &Game::forceLogout, &g_game); g_lua.bindSingletonFunction("g_game", "safeLogout", &Game::safeLogout, &g_game); g_lua.bindSingletonFunction("g_game", "walk", &Game::walk, &g_game); g_lua.bindSingletonFunction("g_game", "autoWalk", &Game::autoWalk, &g_game); g_lua.bindSingletonFunction("g_game", "forceWalk", &Game::forceWalk, &g_game); g_lua.bindSingletonFunction("g_game", "turn", &Game::turn, &g_game); g_lua.bindSingletonFunction("g_game", "stop", &Game::stop, &g_game); g_lua.bindSingletonFunction("g_game", "look", &Game::look, &g_game); g_lua.bindSingletonFunction("g_game", "move", &Game::move, &g_game); g_lua.bindSingletonFunction("g_game", "moveToParentContainer", &Game::moveToParentContainer, &g_game); g_lua.bindSingletonFunction("g_game", "rotate", &Game::rotate, &g_game); g_lua.bindSingletonFunction("g_game", "use", &Game::use, &g_game); g_lua.bindSingletonFunction("g_game", "useWith", &Game::useWith, &g_game); g_lua.bindSingletonFunction("g_game", "useInventoryItem", &Game::useInventoryItem, &g_game); g_lua.bindSingletonFunction("g_game", "useInventoryItemWith", &Game::useInventoryItemWith, &g_game); g_lua.bindSingletonFunction("g_game", "open", &Game::open, &g_game); g_lua.bindSingletonFunction("g_game", "openParent", &Game::openParent, &g_game); g_lua.bindSingletonFunction("g_game", "close", &Game::close, &g_game); g_lua.bindSingletonFunction("g_game", "refreshContainer", &Game::refreshContainer, &g_game); g_lua.bindSingletonFunction("g_game", "attack", &Game::attack, &g_game); g_lua.bindSingletonFunction("g_game", "cancelAttack", &Game::cancelAttack, &g_game); g_lua.bindSingletonFunction("g_game", "follow", &Game::follow, &g_game); g_lua.bindSingletonFunction("g_game", "cancelFollow", &Game::cancelFollow, &g_game); g_lua.bindSingletonFunction("g_game", "cancelAttackAndFollow", &Game::cancelAttackAndFollow, &g_game); g_lua.bindSingletonFunction("g_game", "talk", &Game::talk, &g_game); g_lua.bindSingletonFunction("g_game", "talkChannel", &Game::talkChannel, &g_game); g_lua.bindSingletonFunction("g_game", "talkPrivate", &Game::talkPrivate, &g_game); g_lua.bindSingletonFunction("g_game", "openPrivateChannel", &Game::openPrivateChannel, &g_game); g_lua.bindSingletonFunction("g_game", "requestChannels", &Game::requestChannels, &g_game); g_lua.bindSingletonFunction("g_game", "joinChannel", &Game::joinChannel, &g_game); g_lua.bindSingletonFunction("g_game", "leaveChannel", &Game::leaveChannel, &g_game); g_lua.bindSingletonFunction("g_game", "closeNpcChannel", &Game::closeNpcChannel, &g_game); g_lua.bindSingletonFunction("g_game", "openOwnChannel", &Game::openOwnChannel, &g_game); g_lua.bindSingletonFunction("g_game", "inviteToOwnChannel", &Game::inviteToOwnChannel, &g_game); g_lua.bindSingletonFunction("g_game", "excludeFromOwnChannel", &Game::excludeFromOwnChannel, &g_game); g_lua.bindSingletonFunction("g_game", "partyInvite", &Game::partyInvite, &g_game); g_lua.bindSingletonFunction("g_game", "partyJoin", &Game::partyJoin, &g_game); g_lua.bindSingletonFunction("g_game", "partyRevokeInvitation", &Game::partyRevokeInvitation, &g_game); g_lua.bindSingletonFunction("g_game", "partyPassLeadership", &Game::partyPassLeadership, &g_game); g_lua.bindSingletonFunction("g_game", "partyLeave", &Game::partyLeave, &g_game); g_lua.bindSingletonFunction("g_game", "partyShareExperience", &Game::partyShareExperience, &g_game); g_lua.bindSingletonFunction("g_game", "requestOutfit", &Game::requestOutfit, &g_game); g_lua.bindSingletonFunction("g_game", "changeOutfit", &Game::changeOutfit, &g_game); g_lua.bindSingletonFunction("g_game", "addVip", &Game::addVip, &g_game); g_lua.bindSingletonFunction("g_game", "removeVip", &Game::removeVip, &g_game); g_lua.bindSingletonFunction("g_game", "setChaseMode", &Game::setChaseMode, &g_game); g_lua.bindSingletonFunction("g_game", "setFightMode", &Game::setFightMode, &g_game); g_lua.bindSingletonFunction("g_game", "setSafeFight", &Game::setSafeFight, &g_game); g_lua.bindSingletonFunction("g_game", "getChaseMode", &Game::getChaseMode, &g_game); g_lua.bindSingletonFunction("g_game", "getFightMode", &Game::getFightMode, &g_game); g_lua.bindSingletonFunction("g_game", "isSafeFight", &Game::isSafeFight, &g_game); g_lua.bindSingletonFunction("g_game", "inspectNpcTrade", &Game::inspectNpcTrade, &g_game); g_lua.bindSingletonFunction("g_game", "buyItem", &Game::buyItem, &g_game); g_lua.bindSingletonFunction("g_game", "sellItem", &Game::sellItem, &g_game); g_lua.bindSingletonFunction("g_game", "closeNpcTrade", &Game::closeNpcTrade, &g_game); g_lua.bindSingletonFunction("g_game", "requestTrade", &Game::requestTrade, &g_game); g_lua.bindSingletonFunction("g_game", "inspectTrade", &Game::inspectTrade, &g_game); g_lua.bindSingletonFunction("g_game", "acceptTrade", &Game::acceptTrade, &g_game); g_lua.bindSingletonFunction("g_game", "rejectTrade", &Game::rejectTrade, &g_game); g_lua.bindSingletonFunction("g_game", "reportBug", &Game::reportBug, &g_game); g_lua.bindSingletonFunction("g_game", "reportRuleVilation", &Game::reportRuleVilation, &g_game); g_lua.bindSingletonFunction("g_game", "debugReport", &Game::debugReport, &g_game); g_lua.bindSingletonFunction("g_game", "editText", &Game::editText, &g_game); g_lua.bindSingletonFunction("g_game", "editList", &Game::editList, &g_game); g_lua.bindSingletonFunction("g_game", "requestQuestLog", &Game::requestQuestLog, &g_game); g_lua.bindSingletonFunction("g_game", "requestQuestLine", &Game::requestQuestLine, &g_game); g_lua.bindSingletonFunction("g_game", "equipItem", &Game::equipItem, &g_game); g_lua.bindSingletonFunction("g_game", "mount", &Game::mount, &g_game); g_lua.bindSingletonFunction("g_game", "canPerformGameAction", &Game::canPerformGameAction, &g_game); g_lua.bindSingletonFunction("g_game", "canReportBugs", &Game::canReportBugs, &g_game); g_lua.bindSingletonFunction("g_game", "checkBotProtection", &Game::checkBotProtection, &g_game); g_lua.bindSingletonFunction("g_game", "isOnline", &Game::isOnline, &g_game); g_lua.bindSingletonFunction("g_game", "isDead", &Game::isDead, &g_game); g_lua.bindSingletonFunction("g_game", "isAttacking", &Game::isAttacking, &g_game); g_lua.bindSingletonFunction("g_game", "isFollowing", &Game::isFollowing, &g_game); g_lua.bindSingletonFunction("g_game", "isMounted", &Game::isMounted, &g_game); g_lua.bindSingletonFunction("g_game", "getContainer", &Game::getContainer, &g_game); g_lua.bindSingletonFunction("g_game", "getContainers", &Game::getContainers, &g_game); g_lua.bindSingletonFunction("g_game", "getVips", &Game::getVips, &g_game); g_lua.bindSingletonFunction("g_game", "getAttackingCreature", &Game::getAttackingCreature, &g_game); g_lua.bindSingletonFunction("g_game", "getFollowingCreature", &Game::getFollowingCreature, &g_game); g_lua.bindSingletonFunction("g_game", "getServerBeat", &Game::getServerBeat, &g_game); g_lua.bindSingletonFunction("g_game", "getLocalPlayer", &Game::getLocalPlayer, &g_game); g_lua.bindSingletonFunction("g_game", "getProtocolGame", &Game::getProtocolGame, &g_game); g_lua.bindSingletonFunction("g_game", "getClientVersion", &Game::getClientVersion, &g_game); g_lua.bindSingletonFunction("g_game", "setClientVersion", &Game::setClientVersion, &g_game); g_lua.bindSingletonFunction("g_game", "getCharacterName", &Game::getCharacterName, &g_game); g_lua.bindSingletonFunction("g_game", "getWorldName", &Game::getWorldName, &g_game); g_lua.bindSingletonFunction("g_game", "getGMActions", &Game::getGMActions, &g_game); g_lua.bindSingletonFunction("g_game", "getFeature", &Game::getFeature, &g_game); g_lua.registerSingletonClass("g_shaders"); g_lua.bindSingletonFunction("g_shaders", "createShader", &ShaderManager::createShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "createFragmentShader", &ShaderManager::createFragmentShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "createFragmentShaderFromCode", &ShaderManager::createFragmentShaderFromCode, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "createItemShader", &ShaderManager::createItemShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "createMapShader", &ShaderManager::createMapShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "getDefaultItemShader", &ShaderManager::getDefaultItemShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "getDefaultMapShader", &ShaderManager::getDefaultMapShader, &g_shaders); g_lua.bindSingletonFunction("g_shaders", "getShader", &ShaderManager::getShader, &g_shaders); g_lua.bindGlobalFunction("getOufitColor", Outfit::getColor); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return ProtocolGamePtr(new ProtocolGame); }); g_lua.bindClassMemberFunction("login", &ProtocolGame::login); g_lua.bindClassMemberFunction("sendExtendedOpcode", &ProtocolGame::sendExtendedOpcode); g_lua.bindClassMemberFunction("addPosition", &ProtocolGame::addPosition); g_lua.bindClassMemberFunction("setMapDescription", &ProtocolGame::setMapDescription); g_lua.bindClassMemberFunction("setFloorDescription", &ProtocolGame::setFloorDescription); g_lua.bindClassMemberFunction("setTileDescription", &ProtocolGame::setTileDescription); g_lua.bindClassMemberFunction("getOutfit", &ProtocolGame::getOutfit); g_lua.bindClassMemberFunction("getThing", &ProtocolGame::getThing); g_lua.bindClassMemberFunction("getCreature", &ProtocolGame::getCreature); g_lua.bindClassMemberFunction("getItem", &ProtocolGame::getItem); g_lua.bindClassMemberFunction("getPosition", &ProtocolGame::getPosition); g_lua.registerClass(); g_lua.bindClassMemberFunction("getItem", &Container::getItem); g_lua.bindClassMemberFunction("getItems", &Container::getItems); g_lua.bindClassMemberFunction("getItemsCount", &Container::getItemsCount); g_lua.bindClassMemberFunction("getSlotPosition", &Container::getSlotPosition); g_lua.bindClassMemberFunction("getName", &Container::getName); g_lua.bindClassMemberFunction("getId", &Container::getId); g_lua.bindClassMemberFunction("getCapacity", &Container::getCapacity); g_lua.bindClassMemberFunction("getContainerItem", &Container::getContainerItem); g_lua.bindClassMemberFunction("hasParent", &Container::hasParent); g_lua.bindClassMemberFunction("isClosed", &Container::isClosed); g_lua.registerClass(); g_lua.bindClassMemberFunction("setId", &Thing::setId); g_lua.bindClassMemberFunction("setPosition", &Thing::setPosition); g_lua.bindClassMemberFunction("getId", &Thing::getId); g_lua.bindClassMemberFunction("getPosition", &Thing::getPosition); g_lua.bindClassMemberFunction("getStackPriority", &Thing::getStackPriority); g_lua.bindClassMemberFunction("getAnimationPhases", &Thing::getAnimationPhases); g_lua.bindClassMemberFunction("asThing", &Thing::asThing); g_lua.bindClassMemberFunction("asItem", &Thing::asItem); g_lua.bindClassMemberFunction("asCreature", &Thing::asCreature); g_lua.bindClassMemberFunction("asEffect", &Thing::asEffect); g_lua.bindClassMemberFunction("asMissile", &Thing::asMissile); g_lua.bindClassMemberFunction("asPlayer", &Thing::asPlayer); g_lua.bindClassMemberFunction("asLocalPlayer", &Thing::asLocalPlayer); g_lua.bindClassMemberFunction("asAnimatedText", &Thing::asAnimatedText); g_lua.bindClassMemberFunction("asStaticText", &Thing::asStaticText); g_lua.bindClassMemberFunction("isItem", &Thing::isItem); g_lua.bindClassMemberFunction("isCreature", &Thing::isCreature); g_lua.bindClassMemberFunction("isEffect", &Thing::isEffect); g_lua.bindClassMemberFunction("isMissile", &Thing::isMissile); g_lua.bindClassMemberFunction("isPlayer", &Thing::isPlayer); g_lua.bindClassMemberFunction("isLocalPlayer", &Thing::isLocalPlayer); g_lua.bindClassMemberFunction("isAnimatedText", &Thing::isAnimatedText); g_lua.bindClassMemberFunction("isStaticText", &Thing::isStaticText); g_lua.bindClassMemberFunction("isGround", &Thing::isGround); g_lua.bindClassMemberFunction("isGroundBorder", &Thing::isGroundBorder); g_lua.bindClassMemberFunction("isOnBottom", &Thing::isOnBottom); g_lua.bindClassMemberFunction("isOnTop", &Thing::isOnTop); g_lua.bindClassMemberFunction("isContainer", &Thing::isContainer); g_lua.bindClassMemberFunction("isForceUse", &Thing::isForceUse); g_lua.bindClassMemberFunction("isMultiUse", &Thing::isMultiUse); g_lua.bindClassMemberFunction("isRotateable", &Thing::isRotateable); g_lua.bindClassMemberFunction("isNotMoveable", &Thing::isNotMoveable); g_lua.bindClassMemberFunction("isPickupable", &Thing::isPickupable); g_lua.bindClassMemberFunction("isIgnoreLook", &Thing::isIgnoreLook); g_lua.bindClassMemberFunction("isStackable", &Thing::isStackable); g_lua.bindClassMemberFunction("isHookSouth", &Thing::isHookSouth); g_lua.bindClassMemberFunction("isTranslucent", &Thing::isTranslucent); g_lua.bindClassMemberFunction("isFullGround", &Thing::isFullGround); g_lua.bindClassMemberFunction("isMarketable", &Thing::isMarketable); g_lua.bindClassMemberFunction("getParentContainer", &Thing::getParentContainer); g_lua.bindClassMemberFunction("getMarketData", &Thing::getMarketData); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return HousePtr(new House); }); g_lua.bindClassMemberFunction("setId", &House::setId); g_lua.bindClassMemberFunction("setName", &House::setName); g_lua.bindClassMemberFunction("setTile", &House::setTile); g_lua.bindClassMemberFunction("addTile", &House::setTile); // alternative method g_lua.bindClassMemberFunction("setEntry", &House::setEntry); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return TownPtr(new Town); }); g_lua.bindClassMemberFunction("setId", &Town::setId); g_lua.bindClassMemberFunction("setName", &Town::setName); g_lua.bindClassMemberFunction("setPos", &Town::setPos); g_lua.bindClassMemberFunction("setTemplePos", &Town::setPos); // alternative method g_lua.bindClassMemberFunction("getId", &Town::getId); g_lua.bindClassMemberFunction("getName", &Town::getName); g_lua.bindClassMemberFunction("getPos", &Town::getPos); g_lua.bindClassMemberFunction("getTemplePos", &Town::getPos); // alternative method g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return CreatureTypePtr(new CreatureType); }); g_lua.bindClassMemberFunction("setPos", &CreatureType::setPos); g_lua.bindClassMemberFunction("setName", &CreatureType::setName); g_lua.bindClassMemberFunction("setOutfit", &CreatureType::setOutfit); g_lua.bindClassMemberFunction("setSpawnTime", &CreatureType::setSpawnTime); g_lua.bindClassMemberFunction("getPos", &CreatureType::getPos); g_lua.bindClassMemberFunction("getName", &CreatureType::getName); g_lua.bindClassMemberFunction("getOutfit", &CreatureType::getOutfit); g_lua.bindClassMemberFunction("getSpawnTime", &CreatureType::getSpawnTime); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return CreaturePtr(new Creature); }); g_lua.bindClassMemberFunction("getId", &Creature::getId); g_lua.bindClassMemberFunction("getName", &Creature::getName); g_lua.bindClassMemberFunction("getHealthPercent", &Creature::getHealthPercent); g_lua.bindClassMemberFunction("getSpeed", &Creature::getSpeed); g_lua.bindClassMemberFunction("getSkull", &Creature::getSkull); g_lua.bindClassMemberFunction("getShield", &Creature::getShield); g_lua.bindClassMemberFunction("getEmblem", &Creature::getEmblem); g_lua.bindClassMemberFunction("setOutfit", &Creature::setOutfit); g_lua.bindClassMemberFunction("getOutfit", &Creature::getOutfit); g_lua.bindClassMemberFunction("getDirection", &Creature::getDirection); g_lua.bindClassMemberFunction("setDirection", &Creature::setDirection); g_lua.bindClassMemberFunction("setSkullTexture", &Creature::setSkullTexture); g_lua.bindClassMemberFunction("setShieldTexture", &Creature::setShieldTexture); g_lua.bindClassMemberFunction("setEmblemTexture", &Creature::setEmblemTexture); g_lua.bindClassMemberFunction("showStaticSquare", &Creature::showStaticSquare); g_lua.bindClassMemberFunction("hideStaticSquare", &Creature::hideStaticSquare); g_lua.bindClassMemberFunction("isWalking", &Creature::isWalking); g_lua.bindClassMemberFunction("asMonster", &Creature::asMonster); g_lua.bindClassMemberFunction("asNpc", &Creature::asNpc); g_lua.registerClass(); g_lua.bindClassMemberFunction("getServerId", &ItemType::getServerId); g_lua.bindClassMemberFunction("getClientId", &ItemType::getClientId); g_lua.registerClass(); g_lua.bindClassMemberFunction("getId", &ThingType::getId); g_lua.bindClassMemberFunction("getMarketData", &ThingType::getMarketData); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", &Item::create); g_lua.bindClassMemberFunction("clone", &Item::clone); g_lua.bindClassMemberFunction("setCount", &Item::setCount); g_lua.bindClassMemberFunction("getCount", &Item::getCount); g_lua.bindClassMemberFunction("getId", &Item::getId); g_lua.bindClassMemberFunction("isStackable", &Item::isStackable); g_lua.bindClassMemberFunction("isMarketable", &Item::isMarketable); g_lua.bindClassMemberFunction("getMarketData", &Item::getMarketData); g_lua.bindClassMemberFunction("getClothSlot", &Item::getClothSlot); g_lua.registerClass(); g_lua.registerClass(); g_lua.registerClass(); g_lua.registerClass(); g_lua.registerClass(); g_lua.registerClass(); g_lua.registerClass(); g_lua.registerClass(); g_lua.bindClassMemberFunction("unlockWalk", &LocalPlayer::unlockWalk); g_lua.bindClassMemberFunction("lockWalk", &LocalPlayer::lockWalk); g_lua.bindClassMemberFunction("canWalk", &LocalPlayer::canWalk); g_lua.bindClassMemberFunction("setStates", &LocalPlayer::setStates); g_lua.bindClassMemberFunction("setSkill", &LocalPlayer::setSkill); g_lua.bindClassMemberFunction("setHealth", &LocalPlayer::setHealth); g_lua.bindClassMemberFunction("setFreeCapacity", &LocalPlayer::setFreeCapacity); g_lua.bindClassMemberFunction("setExperience", &LocalPlayer::setExperience); g_lua.bindClassMemberFunction("setLevel", &LocalPlayer::setLevel); g_lua.bindClassMemberFunction("setMana", &LocalPlayer::setMana); g_lua.bindClassMemberFunction("setMagicLevel", &LocalPlayer::setMagicLevel); g_lua.bindClassMemberFunction("setSoul", &LocalPlayer::setSoul); g_lua.bindClassMemberFunction("setStamina", &LocalPlayer::setStamina); g_lua.bindClassMemberFunction("setKnown", &LocalPlayer::setKnown); g_lua.bindClassMemberFunction("setInventoryItem", &LocalPlayer::setInventoryItem); g_lua.bindClassMemberFunction("getStates", &LocalPlayer::getStates); g_lua.bindClassMemberFunction("getSkillLevel", &LocalPlayer::getSkillLevel); g_lua.bindClassMemberFunction("getSkillLevelPercent", &LocalPlayer::getSkillLevelPercent); g_lua.bindClassMemberFunction("getHealth", &LocalPlayer::getHealth); g_lua.bindClassMemberFunction("getMaxHealth", &LocalPlayer::getMaxHealth); g_lua.bindClassMemberFunction("getFreeCapacity", &LocalPlayer::getFreeCapacity); g_lua.bindClassMemberFunction("getExperience", &LocalPlayer::getExperience); g_lua.bindClassMemberFunction("getLevel", &LocalPlayer::getLevel); g_lua.bindClassMemberFunction("getLevelPercent", &LocalPlayer::getLevelPercent); g_lua.bindClassMemberFunction("getMana", &LocalPlayer::getMana); g_lua.bindClassMemberFunction("getMaxMana", &LocalPlayer::getMaxMana); g_lua.bindClassMemberFunction("getMagicLevel", &LocalPlayer::getMagicLevel); g_lua.bindClassMemberFunction("getMagicLevelPercent", &LocalPlayer::getMagicLevelPercent); g_lua.bindClassMemberFunction("getSoul", &LocalPlayer::getSoul); g_lua.bindClassMemberFunction("getStamina", &LocalPlayer::getStamina); g_lua.bindClassMemberFunction("getInventoryItem", &LocalPlayer::getInventoryItem); g_lua.bindClassMemberFunction("getVocation", &LocalPlayer::getVocation); g_lua.bindClassMemberFunction("isPremium", &LocalPlayer::isPremium); g_lua.bindClassMemberFunction("isKnown", &LocalPlayer::isKnown); g_lua.bindClassMemberFunction("isPreWalking", &LocalPlayer::isPreWalking); g_lua.bindClassMemberFunction("asLocalPlayer", &LocalPlayer::asLocalPlayer); g_lua.registerClass(); g_lua.bindClassMemberFunction("clean", &Tile::clean); g_lua.bindClassMemberFunction("addThing", &Tile::addThing); g_lua.bindClassMemberFunction("getThing", &Tile::getThing); g_lua.bindClassMemberFunction("getThingStackpos", &Tile::getThingStackpos); g_lua.bindClassMemberFunction("getThingCount", &Tile::getThingCount); g_lua.bindClassMemberFunction("getTopThing", &Tile::getTopThing); g_lua.bindClassMemberFunction("removeThing", &Tile::removeThing); g_lua.bindClassMemberFunction("getTopLookThing", &Tile::getTopLookThing); g_lua.bindClassMemberFunction("getTopUseThing", &Tile::getTopUseThing); g_lua.bindClassMemberFunction("getTopCreature", &Tile::getTopCreature); g_lua.bindClassMemberFunction("getTopMoveThing", &Tile::getTopMoveThing); g_lua.bindClassMemberFunction("getTopMultiUseThing", &Tile::getTopMultiUseThing); g_lua.bindClassMemberFunction("getPosition", &Tile::getPosition); g_lua.bindClassMemberFunction("getDrawElevation", &Tile::getDrawElevation); g_lua.bindClassMemberFunction("getCreatures", &Tile::getCreatures); g_lua.bindClassMemberFunction("getGround", &Tile::getGround); g_lua.bindClassMemberFunction("isWalkable", &Tile::isWalkable); g_lua.bindClassMemberFunction("isFullGround", &Tile::isFullGround); g_lua.bindClassMemberFunction("isFullyOpaque", &Tile::isFullyOpaque); g_lua.bindClassMemberFunction("isLookPossible", &Tile::isLookPossible); g_lua.bindClassMemberFunction("hasCreature", &Tile::hasCreature); g_lua.bindClassMemberFunction("isEmpty", &Tile::isEmpty); g_lua.bindClassMemberFunction("isClickable", &Tile::isClickable); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return UIItemPtr(new UIItem); }); g_lua.bindClassMemberFunction("setItemId", &UIItem::setItemId); g_lua.bindClassMemberFunction("setItemCount", &UIItem::setItemCount); g_lua.bindClassMemberFunction("setItemSubType", &UIItem::setItemSubType); g_lua.bindClassMemberFunction("setItem", &UIItem::setItem); g_lua.bindClassMemberFunction("setVirtual", &UIItem::setVirtual); g_lua.bindClassMemberFunction("clearItem", &UIItem::clearItem); g_lua.bindClassMemberFunction("getItemId", &UIItem::getItemId); g_lua.bindClassMemberFunction("getItemCount", &UIItem::getItemCount); g_lua.bindClassMemberFunction("getItemSubType", &UIItem::getItemSubType); g_lua.bindClassMemberFunction("getItem", &UIItem::getItem); g_lua.bindClassMemberFunction("isVirtual", &UIItem::isVirtual); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return UICreaturePtr(new UICreature); } ); g_lua.bindClassMemberFunction("setCreature", &UICreature::setCreature); g_lua.bindClassMemberFunction("setFixedCreatureSize", &UICreature::setFixedCreatureSize); g_lua.bindClassMemberFunction("getCreature", &UICreature::getCreature); g_lua.bindClassMemberFunction("isFixedCreatureSize", &UICreature::isFixedCreatureSize); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return UIMapPtr(new UIMap); }); g_lua.bindClassMemberFunction("drawSelf", &UIMap::drawSelf); g_lua.bindClassMemberFunction("setZoom", &UIMap::setZoom); g_lua.bindClassMemberFunction("zoomIn", &UIMap::zoomIn); g_lua.bindClassMemberFunction("zoomOut", &UIMap::zoomOut); g_lua.bindClassMemberFunction("followCreature", &UIMap::followCreature); g_lua.bindClassMemberFunction("setCameraPosition", &UIMap::setCameraPosition); g_lua.bindClassMemberFunction("setMaxZoomIn", &UIMap::setMaxZoomIn); g_lua.bindClassMemberFunction("setMaxZoomOut", &UIMap::setMaxZoomOut); g_lua.bindClassMemberFunction("setMultifloor", &UIMap::setMultifloor); g_lua.bindClassMemberFunction("setVisibleDimension", &UIMap::setVisibleDimension); g_lua.bindClassMemberFunction("setViewMode", &UIMap::setViewMode); g_lua.bindClassMemberFunction("setAutoViewMode", &UIMap::setAutoViewMode); g_lua.bindClassMemberFunction("setDrawFlags", &UIMap::setDrawFlags); g_lua.bindClassMemberFunction("setDrawTexts", &UIMap::setDrawTexts); g_lua.bindClassMemberFunction("setDrawMinimapColors", &UIMap::setDrawMinimapColors); g_lua.bindClassMemberFunction("setAnimated", &UIMap::setAnimated); g_lua.bindClassMemberFunction("setKeepAspectRatio", &UIMap::setKeepAspectRatio); g_lua.bindClassMemberFunction("setMapShader", &UIMap::setMapShader); g_lua.bindClassMemberFunction("isMultifloor", &UIMap::isMultifloor); g_lua.bindClassMemberFunction("isAutoViewModeEnabled", &UIMap::isAutoViewModeEnabled); g_lua.bindClassMemberFunction("isDrawingTexts", &UIMap::isDrawingTexts); g_lua.bindClassMemberFunction("isDrawingMinimapColors", &UIMap::isDrawingMinimapColors); g_lua.bindClassMemberFunction("isAnimating", &UIMap::isAnimating); g_lua.bindClassMemberFunction("isKeepAspectRatioEnabled", &UIMap::isKeepAspectRatioEnabled); g_lua.bindClassMemberFunction("getVisibleDimension", &UIMap::getVisibleDimension); g_lua.bindClassMemberFunction("getViewMode", &UIMap::getViewMode); g_lua.bindClassMemberFunction("getFollowingCreature", &UIMap::getFollowingCreature); g_lua.bindClassMemberFunction("getDrawFlags", &UIMap::getDrawFlags); g_lua.bindClassMemberFunction("getCameraPosition", &UIMap::getCameraPosition); g_lua.bindClassMemberFunction("getTile", &UIMap::getTile); g_lua.bindClassMemberFunction("getMaxZoomIn", &UIMap::getMaxZoomIn); g_lua.bindClassMemberFunction("getMaxZoomOut", &UIMap::getMaxZoomOut); g_lua.bindClassMemberFunction("getZoom", &UIMap::getZoom); g_lua.bindClassMemberFunction("getMapShader", &UIMap::getMapShader); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return UIProgressRectPtr(new UIProgressRect); } ); g_lua.bindClassMemberFunction("setPercent", &UIProgressRect::setPercent); g_lua.bindClassMemberFunction("getPercent", &UIProgressRect::getPercent); }