/* * 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void OTClient::registerLuaFunctions() { Application::registerLuaFunctions(); g_lua.registerStaticClass("g_thingsType"); g_lua.bindClassStaticFunction("g_thingsType", "load", std::bind(&ThingsType::load, &g_thingsType, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_thingsType", "isLoaded", std::bind(&ThingsType::isLoaded, &g_thingsType)); g_lua.bindClassStaticFunction("g_thingsType", "getSignature", std::bind(&ThingsType::getSignature, &g_thingsType)); g_lua.registerStaticClass("g_sprites"); g_lua.bindClassStaticFunction("g_sprites", "load", std::bind(&SpriteManager::load, &g_sprites, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_sprites", "unload", std::bind(&SpriteManager::unload, &g_sprites)); g_lua.bindClassStaticFunction("g_sprites", "isLoaded", std::bind(&SpriteManager::isLoaded, &g_sprites)); g_lua.bindClassStaticFunction("g_sprites", "getSignature", std::bind(&SpriteManager::getSignature, &g_sprites)); g_lua.bindClassStaticFunction("g_sprites", "getSpritesCount", std::bind(&SpriteManager::getSpritesCount, &g_sprites)); g_lua.registerStaticClass("g_map"); g_lua.bindClassStaticFunction("g_map", "isLookPossible", std::bind(&Map::isLookPossible, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "isCovered", std::bind(&Map::isCovered, &g_map, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_map", "isCompletelyCovered", std::bind(&Map::isCompletelyCovered, &g_map, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_map", "addThing", std::bind(&Map::addThing, &g_map, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.bindClassStaticFunction("g_map", "getThing", std::bind(&Map::getThing, &g_map, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_map", "removeThingByPos", std::bind(&Map::removeThingByPos, &g_map, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_map", "removeThing", std::bind(&Map::removeThing, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "cleanTile", std::bind(&Map::cleanTile, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "getTile", std::bind(&Map::getTile, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "setCentralPosition", std::bind(&Map::setCentralPosition, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "getCentralPosition", std::bind(&Map::getCentralPosition, &g_map)); g_lua.bindClassStaticFunction("g_map", "getCreatureById", std::bind(&Map::getCreatureById, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "removeCreatureById", std::bind(&Map::removeCreatureById, &g_map, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_map", "getSpectators", std::bind(&Map::getSpectators, &g_map, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_map", "findPath", std::bind(&Map::findPath, &g_map, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.registerStaticClass("g_game"); g_lua.bindClassStaticFunction("g_game", "loginWorld", std::bind(&Game::loginWorld, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6)); g_lua.bindClassStaticFunction("g_game", "cancelLogin", std::bind(&Game::cancelLogin, &g_game)); g_lua.bindClassStaticFunction("g_game", "forceLogout", std::bind(&Game::forceLogout, &g_game)); g_lua.bindClassStaticFunction("g_game", "safeLogout", std::bind(&Game::safeLogout, &g_game)); g_lua.bindClassStaticFunction("g_game", "walk", std::bind(&Game::walk, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "autoWalk", std::bind(&Game::autoWalk, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "forceWalk", std::bind(&Game::forceWalk, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "turn", std::bind(&Game::turn, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "stop", std::bind(&Game::stop, &g_game)); g_lua.bindClassStaticFunction("g_game", "look", std::bind(&Game::look, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "move", std::bind(&Game::move, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.bindClassStaticFunction("g_game", "moveToParentContainer", std::bind(&Game::moveToParentContainer, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "rotate", std::bind(&Game::rotate, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "use", std::bind(&Game::use, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "useWith", std::bind(&Game::useWith, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "useInventoryItem", std::bind(&Game::useInventoryItem, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "useInventoryItemWith", std::bind(&Game::useInventoryItemWith, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "open", std::bind(&Game::open, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "openParent", std::bind(&Game::openParent, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "close", std::bind(&Game::close, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "refreshContainer", std::bind(&Game::refreshContainer, &g_game)); g_lua.bindClassStaticFunction("g_game", "attack", std::bind(&Game::attack, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "cancelAttack", std::bind(&Game::cancelAttack, &g_game)); g_lua.bindClassStaticFunction("g_game", "follow", std::bind(&Game::follow, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "cancelFollow", std::bind(&Game::cancelFollow, &g_game)); g_lua.bindClassStaticFunction("g_game", "cancelAttackAndFollow", std::bind(&Game::cancelAttackAndFollow, &g_game)); g_lua.bindClassStaticFunction("g_game", "talk", std::bind(&Game::talk, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "talkChannel", std::bind(&Game::talkChannel, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.bindClassStaticFunction("g_game", "talkPrivate", std::bind(&Game::talkPrivate, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.bindClassStaticFunction("g_game", "openPrivateChannel", std::bind(&Game::openPrivateChannel, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "requestChannels", std::bind(&Game::requestChannels, &g_game)); g_lua.bindClassStaticFunction("g_game", "joinChannel", std::bind(&Game::joinChannel, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "leaveChannel", std::bind(&Game::leaveChannel, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "closeNpcChannel", std::bind(&Game::closeNpcChannel, &g_game)); g_lua.bindClassStaticFunction("g_game", "openOwnChannel", std::bind(&Game::openOwnChannel, &g_game)); g_lua.bindClassStaticFunction("g_game", "inviteToOwnChannel", std::bind(&Game::inviteToOwnChannel, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "excludeFromOwnChannel", std::bind(&Game::excludeFromOwnChannel, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "partyInvite", std::bind(&Game::partyInvite, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "partyJoin", std::bind(&Game::partyJoin, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "partyRevokeInvitation", std::bind(&Game::partyRevokeInvitation, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "partyPassLeadership", std::bind(&Game::partyPassLeadership, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "partyLeave", std::bind(&Game::partyLeave, &g_game)); g_lua.bindClassStaticFunction("g_game", "partyShareExperience", std::bind(&Game::partyShareExperience, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "requestOutfit", std::bind(&Game::requestOutfit, &g_game)); g_lua.bindClassStaticFunction("g_game", "changeOutfit", std::bind(&Game::changeOutfit, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "addVip", std::bind(&Game::addVip, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "removeVip", std::bind(&Game::removeVip, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "setChaseMode", std::bind(&Game::setChaseMode, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "setFightMode", std::bind(&Game::setFightMode, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "setSafeFight", std::bind(&Game::setSafeFight, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "getChaseMode", std::bind(&Game::getChaseMode, &g_game)); g_lua.bindClassStaticFunction("g_game", "getFightMode", std::bind(&Game::getFightMode, &g_game)); g_lua.bindClassStaticFunction("g_game", "isSafeFight", std::bind(&Game::isSafeFight, &g_game)); g_lua.bindClassStaticFunction("g_game", "inspectNpcTrade", std::bind(&Game::inspectNpcTrade, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "buyItem", std::bind(&Game::buyItem, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); g_lua.bindClassStaticFunction("g_game", "sellItem", std::bind(&Game::sellItem, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.bindClassStaticFunction("g_game", "closeNpcTrade", std::bind(&Game::closeNpcTrade, &g_game)); g_lua.bindClassStaticFunction("g_game", "requestTrade", std::bind(&Game::requestTrade, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "inspectTrade", std::bind(&Game::inspectTrade, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "acceptTrade", std::bind(&Game::acceptTrade, &g_game)); g_lua.bindClassStaticFunction("g_game", "rejectTrade", std::bind(&Game::rejectTrade, &g_game)); g_lua.bindClassStaticFunction("g_game", "reportBug", std::bind(&Game::reportBug, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "reportRuleVilation", std::bind(&Game::reportRuleVilation, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7)); g_lua.bindClassStaticFunction("g_game", "debugReport", std::bind(&Game::debugReport, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4)); g_lua.bindClassStaticFunction("g_game", "editText", std::bind(&Game::editText, &g_game, std::placeholders::_1, std::placeholders::_2)); g_lua.bindClassStaticFunction("g_game", "editList", std::bind(&Game::editList, &g_game, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); g_lua.bindClassStaticFunction("g_game", "requestQuestLog", std::bind(&Game::requestQuestLog, &g_game)); g_lua.bindClassStaticFunction("g_game", "requestQuestLine", std::bind(&Game::requestQuestLine, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "canPerformGameAction", std::bind(&Game::canPerformGameAction, &g_game)); g_lua.bindClassStaticFunction("g_game", "canReportBugs", std::bind(&Game::canReportBugs, &g_game)); g_lua.bindClassStaticFunction("g_game", "checkBotProtection", std::bind(&Game::checkBotProtection, &g_game)); g_lua.bindClassStaticFunction("g_game", "isOnline", std::bind(&Game::isOnline, &g_game)); g_lua.bindClassStaticFunction("g_game", "isDead", std::bind(&Game::isDead, &g_game)); g_lua.bindClassStaticFunction("g_game", "isAttacking", std::bind(&Game::isAttacking, &g_game)); g_lua.bindClassStaticFunction("g_game", "isFollowing", std::bind(&Game::isFollowing, &g_game)); g_lua.bindClassStaticFunction("g_game", "getContainer", std::bind(&Game::getContainer, &g_game, std::placeholders::_1)); g_lua.bindClassStaticFunction("g_game", "getContainers", std::bind(&Game::getContainers, &g_game)); g_lua.bindClassStaticFunction("g_game", "getVips", std::bind(&Game::getVips, &g_game)); g_lua.bindClassStaticFunction("g_game", "getAttackingCreature", std::bind(&Game::getAttackingCreature, &g_game)); g_lua.bindClassStaticFunction("g_game", "getFollowingCreature", std::bind(&Game::getFollowingCreature, &g_game)); g_lua.bindClassStaticFunction("g_game", "getServerBeat", std::bind(&Game::getServerBeat, &g_game)); g_lua.bindClassStaticFunction("g_game", "getLocalPlayer", std::bind(&Game::getLocalPlayer, &g_game)); g_lua.bindClassStaticFunction("g_game", "getProtocolGame", std::bind(&Game::getProtocolGame, &g_game)); g_lua.bindClassStaticFunction("g_game", "getProtocolVersion", std::bind(&Game::getProtocolVersion, &g_game)); g_lua.bindClassStaticFunction("g_game", "getWorldName", std::bind(&Game::getWorldName, &g_game)); g_lua.bindClassStaticFunction("g_game", "getGMActions", std::bind(&Game::getGMActions, &g_game)); g_lua.bindGlobalFunction("getOufitColor", Outfit::getColor); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", &ProtocolLogin::create); g_lua.bindClassMemberFunction("login", &ProtocolLogin::login); g_lua.bindClassMemberFunction("cancelLogin", &ProtocolLogin::cancelLogin); g_lua.registerClass(); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return ContainerPtr(new Container); }); g_lua.bindClassMemberFunction("open", &Container::open); g_lua.bindClassMemberFunction("close", &Container::close); g_lua.bindClassMemberFunction("addItem", &Container::addItem); g_lua.bindClassMemberFunction("addItems", &Container::addItems); g_lua.bindClassMemberFunction("updateItem", &Container::updateItem); g_lua.bindClassMemberFunction("removeItem", &Container::removeItem); g_lua.bindClassMemberFunction("getItem", &Container::getItem); g_lua.bindClassMemberFunction("getSlotPosition", &Container::getSlotPosition); g_lua.bindClassMemberFunction("setId", &Container::setId); g_lua.bindClassMemberFunction("setCapacity", &Container::setCapacity); g_lua.bindClassMemberFunction("setName", &Container::setName); g_lua.bindClassMemberFunction("setContainerItem", &Container::setContainerItem); g_lua.bindClassMemberFunction("setHasParent", &Container::setHasParent); g_lua.bindClassMemberFunction("getName", &Container::getName); g_lua.bindClassMemberFunction("getId", &Container::getId); g_lua.bindClassMemberFunction("getCapacity", &Container::getCapacity); g_lua.bindClassMemberFunction("getItemsCount", &Container::getItemsCount); g_lua.bindClassMemberFunction("getContainerItem", &Container::getContainerItem); g_lua.bindClassMemberFunction("hasParent", &Container::hasParent); 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("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("getParentContainer", &Thing::getParentContainer); g_lua.registerClass(); g_lua.bindClassMemberFunction("getId", &Creature::getId); g_lua.bindClassMemberFunction("getName", &Creature::getName); g_lua.bindClassMemberFunction("getHealthPercent", &Creature::getHealthPercent); 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("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.bindClassStaticFunction("create", &Item::create); 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.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("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("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("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); }