Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Salve rapaziada do tibiaking, alguém saberia me informar o motivo da função doSendPlayerExtendedOpcode não estar funcionando em meu servidor? (OBS: utilizo OTX 2.12 para servidor 8.60 ela já vem com OpCodes instalados), o servidor consegue receber OpCode do client, porém a função doSendPlayerExtendedOpcode em si não está funcionando embora esteja declarada e adicionada na source, alguém saberia informar o motivo? Vou deixar imagens do erro. Se precisarem de + informações ou até mesmo dos arquivos da source, favor informar que disponibilizo.

Sem título.png

Link para o post
Compartilhar em outros sites
Spoiler

 

////////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
////////////////////////////////////////////////////////////////////////
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////

#ifndef __LUASCRIPT__
#define __LUASCRIPT__
#include "otsystem.h"

#if defined(__ALT_LUA_PATH__)
extern "C"
{
    #include <lua5.1/lua.h>
    #include <lua5.1/lauxlib.h>
    #include <lua5.1/lualib.h>
}
#else
extern "C"
{
    #include <lua.h>
    #include <lauxlib.h>
    #include <lualib.h>

    #ifdef __LUAJIT__
    #include <luajit.h>
    #endif
}
#endif


#include "database.h"
#include "position.h"

enum LuaVariantType_t
{
    VARIANT_NONE = 0,
    VARIANT_NUMBER,
    VARIANT_POSITION,
    VARIANT_TARGETPOSITION,
    VARIANT_STRING
};

struct LuaVariant
{
    LuaVariant()
    {
        type = VARIANT_NONE;
        text = "";
        pos = PositionEx();
        number = 0;
    }

    LuaVariantType_t type;
    std::string text;
    PositionEx pos;
    uint32_t number;
};

typedef std::map<std::string, std::string> StorageMap;

class Game;
class Thing;
class LuaInterface;

class Creature;
class Player;
class Npc;

class Item;
class Container;

class Combat;
class CombatArea;
class Condition;

struct Outfit_t;
class ScriptEnviroment
{
    public:
        ScriptEnviroment();
        virtual ~ScriptEnviroment();

        static bool saveGameState();
        static bool loadGameState();

        bool getStorage(const std::string& key, std::string& value) const;
        void setStorage(const std::string& key, const std::string& value) {m_storageMap[key] = value;}
        void eraseStorage(const std::string& key) {m_storageMap.erase(key);}

        inline StorageMap::const_iterator getStorageBegin() const {return m_storageMap.begin();}
        inline StorageMap::const_iterator getStorageEnd() const {return m_storageMap.end();}

        int32_t getScriptId() const {return m_scriptId;};
        void setScriptId(int32_t scriptId, LuaInterface* interface)
            {m_scriptId = scriptId; m_interface = interface;}

        int32_t getCallbackId() const {return m_callbackId;};
        bool setCallbackId(int32_t callbackId, LuaInterface* interface);

        std::string getEvent() const {return m_event;};
        void setEvent(const std::string& desc) {m_event = desc;}

        Position getRealPos() const {return m_realPos;};
        void setRealPos(const Position& realPos) {m_realPos = realPos;}

        Npc* getNpc() const {return m_curNpc;}
        void setNpc(Npc* npc) {m_curNpc = npc;}

        static uint32_t addCombatArea(CombatArea* area);
        static CombatArea* getCombatArea(uint32_t areaId);

        static uint32_t addCombatObject(Combat* combat);
        static Combat* getCombatObject(uint32_t combatId);

        static uint32_t addConditionObject(Condition* condition);
        static uint32_t addTempConditionObject(Condition* condition);
        static Condition* getConditionObject(uint32_t conditionId, bool loaded);

        Thing* getThingByUID(uint32_t uid);
        Item* getItemByUID(uint32_t uid);
        Container* getContainerByUID(uint32_t uid);
        Creature* getCreatureByUID(uint32_t uid);
        Player* getPlayerByUID(uint32_t uid);

        uint32_t addThing(Thing* thing);
        void insertThing(uint32_t uid, Thing* thing);
        void removeThing(uint32_t uid);

        static void addTempItem(ScriptEnviroment* env, Item* item);
        static void removeTempItem(ScriptEnviroment* env, Item* item);
        static void removeTempItem(Item* item);

        DBResult* getResultByID(uint32_t id);
        uint32_t addResult(DBResult* res);
        bool removeResult(uint32_t id);

        static void addUniqueThing(Thing* thing);
        static void removeUniqueThing(Thing* thing);

        static uint32_t getLastConditionId() {return m_lastConditionId;}
        static uint32_t getLastCombatId() {return m_lastCombatId;}
        static uint32_t getLastAreaId() {return m_lastAreaId;}

        void setTimerEvent() {m_timerEvent = true;}
        void resetTimerEvent() {m_timerEvent = false;}

        LuaInterface* getInterface() {return m_interface;}
        void getInfo(int32_t& scriptId, std::string& desc, LuaInterface*& interface, int32_t& callbackId, bool& timerEvent);
        void reset();
        void resetCallback() {m_callbackId = 0;}

        void streamVariant(std::ostringstream& stream, const std::string& local, const LuaVariant& var);
        void streamThing(std::ostringstream& stream, const std::string& local, Thing* thing, uint32_t id = 0);
        void streamPosition(std::ostringstream& stream, const std::string& local, const PositionEx& position)
            {streamPosition(stream, local, position, position.stackpos);}
        void streamPosition(std::ostringstream& stream, const std::string& local, const Position& position, uint32_t stackpos);
        void streamOutfit(std::ostringstream& stream, const std::string& local, const Outfit_t& outfit);

    private:
        typedef std::map<uint64_t, Thing*> ThingMap;
        typedef std::vector<const LuaVariant*> VariantVector;
        typedef std::list<Item*> ItemList;
        typedef std::map<ScriptEnviroment*, ItemList> TempItemListMap;

        typedef std::map<uint32_t, CombatArea*> AreaMap;
        typedef std::map<uint32_t, Combat*> CombatMap;
        typedef std::map<uint32_t, Condition*> ConditionMap;
        typedef std::map<uint32_t, DBResult*> DBResultMap;

        LuaInterface* m_interface;
        int32_t m_scriptId, m_callbackId;
        std::string m_event;
        bool m_timerEvent;

        ThingMap m_localMap;
        DBResultMap m_tempResults;

        static TempItemListMap m_tempItems;
        static StorageMap m_storageMap;
        static ThingMap m_globalMap;

        static uint32_t m_lastAreaId;
        static AreaMap m_areaMap;

        static uint32_t m_lastCombatId;
        static CombatMap m_combatMap;

        static uint32_t m_lastConditionId, m_lastTempConditionId;
        static ConditionMap m_conditionMap;
        static ConditionMap m_tempConditionMap;

        int32_t m_lastUID;
        bool m_loaded;
        Position m_realPos;
        Npc* m_curNpc;
};

enum ErrorCode_t
{
    LUA_ERROR_PLAYER_NOT_FOUND,
    LUA_ERROR_MONSTER_NOT_FOUND,
    LUA_ERROR_NPC_NOT_FOUND,
    LUA_ERROR_CREATURE_NOT_FOUND,
    LUA_ERROR_ITEM_NOT_FOUND,
    LUA_ERROR_THING_NOT_FOUND,
    LUA_ERROR_TILE_NOT_FOUND,
    LUA_ERROR_HOUSE_NOT_FOUND,
    LUA_ERROR_COMBAT_NOT_FOUND,
    LUA_ERROR_CONDITION_NOT_FOUND,
    LUA_ERROR_AREA_NOT_FOUND,
    LUA_ERROR_CONTAINER_NOT_FOUND,
    LUA_ERROR_VARIANT_NOT_FOUND,
    LUA_ERROR_VARIANT_UNKNOWN,
    LUA_ERROR_SPELL_NOT_FOUND
};

enum Recursive_t
{
    RECURSE_FIRST = -1,
    RECURSE_NONE = 0,
    RECURSE_ALL = 1
};

#define errorEx(a) error(__FUNCTION__, a)
class LuaInterface
{
    public:
        LuaInterface(std::string interfaceName);
        virtual ~LuaInterface();

        virtual bool initState();
        bool reInitState();

        static bool reserveEnv()
        {
            if(++m_scriptEnvIndex > 20)
            {
                --m_scriptEnvIndex;
                return false;
            }

            return true;
        }
        static void releaseEnv()
        {
            if(m_scriptEnvIndex >= 0)
            {
                m_scriptEnv[m_scriptEnvIndex].reset();
                --m_scriptEnvIndex;
            }
        }

        bool loadBuffer(const std::string& text, Npc* npc = NULL);
        bool loadFile(const std::string& file, Npc* npc = NULL);
        bool loadDirectory(std::string dir, bool recursively, bool loadSystems, Npc* npc = NULL);

        std::string getName() const {return m_interfaceName;};
        std::string getScript(int32_t scriptId);
        std::string getLastError() const {return m_lastError;}

        int32_t getEvent(const std::string& eventName);
        lua_State* getState() {return m_luaState;}
        static ScriptEnviroment* getEnv()
        {
            assert(m_scriptEnvIndex >= 0 && m_scriptEnvIndex < 21);
            return &m_scriptEnv[m_scriptEnvIndex];
        }

        bool pushFunction(int32_t functionId);
        bool callFunction(uint32_t params);
        static int32_t handleFunction(lua_State* L);

        void dumpStack(lua_State* L = NULL);

        //push/pop common structures
        static void pushThing(lua_State* L, Thing* thing, uint32_t id = 0, Recursive_t recursive = RECURSE_FIRST);
        static void pushVariant(lua_State* L, const LuaVariant& var);
        static void pushPosition(lua_State* L, const PositionEx& position) {pushPosition(L, position, position.stackpos);}
        static void pushPosition(lua_State* L, const Position& position, uint32_t stackpos);
        static void pushOutfit(lua_State* L, const Outfit_t& outfit);
        static void pushCallback(lua_State* L, int32_t callback);

        static LuaVariant popVariant(lua_State* L);
        static void popPosition(lua_State* L, PositionEx& position);
        static void popPosition(lua_State* L, Position& position, uint32_t& stackpos);
        static bool popBoolean(lua_State* L);
        static int64_t popNumber(lua_State* L);
        static double popFloatNumber(lua_State* L);
        static std::string popString(lua_State* L);
        static int32_t popCallback(lua_State* L);
        static Outfit_t popOutfit(lua_State* L);

        static int64_t getField(lua_State* L, const char* key);
        static uint64_t getFieldUnsigned(lua_State* L, const char* key);
        static std::string getFieldString(lua_State* L, const char* key);
        static bool getFieldBool(lua_State* L, const char* key);

        static void setField(lua_State* L, const char* index, int32_t val);
        static void setField(lua_State* L, const char* index, const std::string& val);
        static void setFieldBool(lua_State* L, const char* index, bool val);
        static void setFieldFloat(lua_State* L, const char* index, double val);

        static void createTable(lua_State* L, const char* index);
        static void createTable(lua_State* L, const char* index, int32_t narr, int32_t nrec);
        static void createTable(lua_State* L, int32_t index);
        static void createTable(lua_State* L, int32_t index, int32_t narr, int32_t nrec);
        static void pushTable(lua_State* L);

        static std::string getGlobalString(lua_State* L, const std::string& _identifier, const std::string& _default = "");
        static bool getGlobalBool(lua_State* L, const std::string& _identifier, bool _default = false);
        static int64_t getGlobalNumber(lua_State* L, const std::string& _identifier, const int64_t _default = 0);
        static double getGlobalDouble(lua_State* L, const std::string& _identifier, const double _default = 0);

        static void getValue(const std::string& key, lua_State* L, lua_State* _L);
        static void moveValue(lua_State* from, lua_State* to);

        static void error(const char* function, const std::string& desc);

    protected:
        virtual bool closeState();

        static std::string getError(ErrorCode_t code);
        static bool getArea(lua_State* L, std::list<uint32_t>& list, uint32_t& rows);

        virtual void registerFunctions();


        //lua functions
        static int32_t luaDoRemoveItem(lua_State* L);
        static int32_t luaDoPlayerFeed(lua_State* L);
        static int32_t luaDoPlayerSendCancel(lua_State* L);
        static int32_t luaDoSendDefaultCancel(lua_State* L);
        static int32_t luaGetSearchString(lua_State* L);
        static int32_t luaGetClosestFreeTile(lua_State* L);
        static int32_t luaDoTeleportThing(lua_State* L);
        static int32_t luaDoItemSetDestination(lua_State* L);
        static int32_t luaDoTransformItem(lua_State* L);
        static int32_t luaDoSendCreatureSquare(lua_State* L);
        static int32_t luaDoSendAnimatedText(lua_State* L);
        static int32_t luaDoSendMagicEffect(lua_State* L);
        static int32_t luaDoSendDistanceShoot(lua_State* L);
        static int32_t luaDoShowTextWindow(lua_State* L);
        static int32_t luaDoShowTextDialog(lua_State* L);
        static int32_t luaDoDecayItem(lua_State* L);
        static int32_t luaDoCreateItem(lua_State* L);
        static int32_t luaDoCreateItemEx(lua_State* L);
        static int32_t luaDoCreateTeleport(lua_State* L);
        static int32_t luaDoCreateMonster(lua_State* L);
        static int32_t luaDoCreateNpc(lua_State* L);
        static int32_t luaDoSummonMonster(lua_State* L);
        static int32_t luaDoConvinceCreature(lua_State* L);
        static int32_t luaGetMonsterTargetList(lua_State* L);
        static int32_t luaGetMonsterFriendList(lua_State* L);
        static int32_t luaDoMonsterSetTarget(lua_State* L);
        static int32_t luaDoMonsterChangeTarget(lua_State* L);
        static int32_t luaDoAddCondition(lua_State* L);
        static int32_t luaDoRemoveCondition(lua_State* L);
        static int32_t luaDoRemoveConditions(lua_State* L);
        static int32_t luaDoRemoveCreature(lua_State* L);
        static int32_t luaDoMoveCreature(lua_State* L);
        static int32_t luaDoSteerCreature(lua_State* L);
        static int32_t luaDoCreatureSay(lua_State* L);
        static int32_t luaDoPlayerAddSkillTry(lua_State* L);
        static int32_t luaDoCreatureAddHealth(lua_State* L);
        static int32_t luaDoCreatureAddMana(lua_State* L);
        static int32_t luaSetCreatureMaxHealth(lua_State* L);
        static int32_t luaSetCreatureMaxMana(lua_State* L);
        static int32_t luaDoPlayerSetMaxCapacity(lua_State* L);
        static int32_t luaDoPlayerAddSpentMana(lua_State* L);
        static int32_t luaDoPlayerAddItem(lua_State* L);
        static int32_t luaDoPlayerAddItemEx(lua_State* L);
        static int32_t luaDoTileAddItemEx(lua_State* L);
        static int32_t luaDoAddContainerItemEx(lua_State* L);
        static int32_t luaDoRelocate(lua_State* L);
        static int32_t luaDoCleanTile(lua_State* L);
        static int32_t luaDoPlayerSendTextMessage(lua_State* L);
        static int32_t luaDoPlayerSendChannelMessage(lua_State* L);
        static int32_t luaDoCreatureChannelSay(lua_State* L);
        static int32_t luaDoPlayerOpenChannel(lua_State* L);
        static int32_t luaDoPlayerSendChannels(lua_State* L);
        static int32_t luaDoPlayerAddMoney(lua_State* L);
        static int32_t luaDoPlayerRemoveMoney(lua_State* L);
        static int32_t luaDoPlayerTransferMoneyTo(lua_State* L);
        static int32_t luaDoPlayerSetPzLocked(lua_State* L);
        static int32_t luaDoPlayerSetTown(lua_State* L);
        static int32_t luaDoPlayerSetVocation(lua_State* L);
        static int32_t luaDoPlayerRemoveItem(lua_State* L);
        static int32_t luaDoPlayerAddSoul(lua_State* L);
        static int32_t luaDoPlayerSetExtraAttackSpeed(lua_State* L);
        static int32_t luaDoPlayerSetStamina(lua_State* L);
        static int32_t luaDoPlayerAddExperience(lua_State* L);
        static int32_t luaDoPlayerSetGuildId(lua_State* L);
        static int32_t luaDoPlayerSetGuildLevel(lua_State* L);
        static int32_t luaDoPlayerSetGuildNick(lua_State* L);
        static int32_t luaDoPlayerSetSex(lua_State* L);
        static int32_t luaDoPlayerSetIdleTime(lua_State* L);
        static int32_t luaGetPlayerIdleTime(lua_State* L);
        static int32_t luaDoCreatureSetLookDir(lua_State* L);
        static int32_t luaGetCreatureHideHealth(lua_State* L);
        static int32_t luaDoCreatureSetHideHealth(lua_State* L);
        static int32_t luaGetCreatureSpeakType(lua_State* L);
        static int32_t luaDoCreatureSetSpeakType(lua_State* L);
        static int32_t luaGetCreatureGuildEmblem(lua_State* L);
        static int32_t luaDoCreatureSetGuildEmblem(lua_State* L);
        static int32_t luaGetCreaturePartyShield(lua_State* L);
        static int32_t luaDoCreatureSetPartyShield(lua_State* L);
        static int32_t luaGetCreatureSkullType(lua_State* L);
        static int32_t luaDoCreatureSetSkullType(lua_State* L);
        static int32_t luaGetPlayerSkullEnd(lua_State* L);
        static int32_t luaDoPlayerSetSkullEnd(lua_State* L);
        static int32_t luaDoPlayerSwitchSaving(lua_State* L);
        static int32_t luaDoPlayerSave(lua_State* L);
        static int32_t luaDoPlayerSaveItems(lua_State* L);
        static int32_t luaDoPlayerSendOutfitWindow(lua_State* L);
        static int32_t luaDoCreatureExecuteTalkAction(lua_State* L);
        static int32_t luaGetCreatureByName(lua_State* L);
        static int32_t luaGetPlayerByGUID(lua_State* L);
        static int32_t luaGetPlayerByNameWildcard(lua_State* L);
        static int32_t luaGetPlayerGUIDByName(lua_State* L);
        static int32_t luaGetPlayerNameByGUID(lua_State* L);
        static int32_t luaDoPlayerChangeName(lua_State* L);
        static int32_t luaGetPlayersByAccountId(lua_State* L);
        static int32_t luaGetAccountIdByName(lua_State* L);
        static int32_t luaGetAccountByName(lua_State* L);
        static int32_t luaGetAccountIdByAccount(lua_State* L);
        static int32_t luaGetAccountByAccountId(lua_State* L);
        static int32_t luaGetAccountFlagValue(lua_State* L);
        static int32_t luaGetAccountCustomFlagValue(lua_State* L);
        static int32_t luaGetIpByName(lua_State* L);
        static int32_t luaGetPlayersByIp(lua_State* L);
        static int32_t luaIsIpBanished(lua_State* L);
        static int32_t luaIsPlayerBanished(lua_State* L);
        static int32_t luaIsAccountBanished(lua_State* L);
        static int32_t luaDoAddIpBanishment(lua_State* L);
        static int32_t luaDoAddPlayerBanishment(lua_State* L);
        static int32_t luaDoAddAccountBanishment(lua_State* L);
        static int32_t luaDoAddNotation(lua_State* L);
        static int32_t luaDoAddStatement(lua_State* L);
        static int32_t luaDoRemoveIpBanishment(lua_State* L);
        static int32_t luaDoRemovePlayerBanishment(lua_State* L);
        static int32_t luaDoRemoveAccountBanishment(lua_State* L);
        static int32_t luaDoAddAccountWarnings(lua_State* L);
        static int32_t luaGetAccountWarnings(lua_State* L);
        static int32_t luaDoRemoveNotations(lua_State* L);
        static int32_t luaDoRemoveStatements(lua_State* L);
        static int32_t luaGetNotationsCount(lua_State* L);
        static int32_t luaGetStatementsCount(lua_State* L);
        static int32_t luaGetBanData(lua_State* L);
        static int32_t luaGetBanReason(lua_State* L);
        static int32_t luaGetBanAction(lua_State* L);
        static int32_t luaGetBanList(lua_State* L);
        static int32_t luaGetPlayerModes(lua_State* L);
        static int32_t luaGetPlayerRates(lua_State* L);
        static int32_t luaDoPlayerSetRate(lua_State* L);
        static int32_t luaDoCreatureSetDropLoot(lua_State* L);
        static int32_t luaGetPlayerLossPercent(lua_State* L);
        static int32_t luaDoPlayerSetLossPercent(lua_State* L);
        static int32_t luaDoPlayerSetLossSkill(lua_State* L);
        static int32_t luaGetPlayerLossSkill(lua_State* L);
        static int32_t luaGetThing(lua_State* L);
        static int32_t luaGetThingPosition(lua_State* L);
        static int32_t luaDoItemRaidUnref(lua_State* L);
        static int32_t luaHasItemProperty(lua_State* L);
        static int32_t luaHasMonsterRaid(lua_State* L);
        static int32_t luaGetThingFromPosition(lua_State* L);
        static int32_t luaGetTileItemById(lua_State* L);
        static int32_t luaGetTileItemByType(lua_State* L);
        static int32_t luaGetTopCreature(lua_State* L);
        static int32_t luaGetTileInfo(lua_State* L);
        static int32_t luaDoTileQueryAdd(lua_State* L);
        static int32_t luaGetHouseInfo(lua_State* L);
        static int32_t luaGetHouseAccessList(lua_State* L);
        static int32_t luaGetHouseByPlayerGUID(lua_State* L);
        static int32_t luaGetHouseFromPosition(lua_State* L);
        static int32_t luaSetHouseOwner(lua_State* L);
        static int32_t luaSetHouseAccessList(lua_State* L);
        static int32_t luaDoPlayerSetNameDescription(lua_State* L);
        static int32_t luaGetPlayerNameDescription(lua_State* L);
        static int32_t luaDoPlayerSetSpecialDescription(lua_State* L);
        static int32_t luaGetPlayerSpecialDescription(lua_State* L);
        static int32_t luaGetPlayerFood(lua_State* L);
        static int32_t luaGetPlayerAccess(lua_State* L);
        static int32_t luaGetPlayerGhostAccess(lua_State* L);
        static int32_t luaGetPlayerLevel(lua_State* L);
        static int32_t luaGetPlayerExperience(lua_State* L);
        static int32_t luaGetPlayerMagLevel(lua_State* L);
        static int32_t luaGetPlayerSpentMana(lua_State* L);
        static int32_t luaGetCreatureMana(lua_State* L);
        static int32_t luaGetCreatureMaxMana(lua_State* L);
        static int32_t luaGetCreatureHealth(lua_State* L);
        static int32_t luaGetCreatureMaxHealth(lua_State* L);
        static int32_t luaGetCreatureSpeed(lua_State* L);
        static int32_t luaGetCreatureBaseSpeed(lua_State* L);
        static int32_t luaGetCreatureTarget(lua_State* L);
        static int32_t luaGetCreatureLookDirection(lua_State* L);
        static int32_t luaGetPlayerSkillLevel(lua_State* L);
        static int32_t luaGetPlayerSkillTries(lua_State* L);
        static int32_t luaDoPlayerSetOfflineTrainingSkill(lua_State* L);
        static int32_t luaGetPlayerVocation(lua_State* L);
        static int32_t luaGetPlayerTown(lua_State* L);
        static int32_t luaGetPlayerItemCount(lua_State* L);
        static int32_t luaGetPlayerMoney(lua_State* L);
        static int32_t luaGetPlayerSoul(lua_State* L);
        static int32_t luaGetPlayerStamina(lua_State* L);
        static int32_t luaGetPlayerFreeCap(lua_State* L);
        static int32_t luaGetPlayerLight(lua_State* L);
        static int32_t luaGetPlayerSlotItem(lua_State* L);
        static int32_t luaGetPlayerWeapon(lua_State* L);
        static int32_t luaGetPlayerItemById(lua_State* L);
        static int32_t luaGetPlayerRequiredMana(lua_State* L);
        static int32_t luaGetPlayerRequiredSkillTries(lua_State* L);
        static int32_t luaGetPlayerIp(lua_State* L);
        static int32_t luaGetPlayerLastLoad(lua_State* L);
        static int32_t luaGetPlayerLastLogin(lua_State* L);
        static int32_t luaGetPlayerTradeState(lua_State* L);
        static int32_t luaGetPlayerAccountManager(lua_State* L);
        static int32_t luaGetPlayerAccountId(lua_State* L);
        static int32_t luaGetPlayerAccount(lua_State* L);
        static int32_t luaGetPlayerDepotItems(lua_State* L);
        static int32_t luaGetPlayerGuildId(lua_State* L);
        static int32_t luaGetPlayerGuildName(lua_State* L);
        static int32_t luaGetPlayerGuildRank(lua_State* L);
        static int32_t luaGetPlayerGuildRankId(lua_State* L);
        static int32_t luaGetPlayerGuildLevel(lua_State* L);
        static int32_t luaGetPlayerGuildNick(lua_State* L);
        static int32_t luaGetPlayerSex(lua_State* L);
        static int32_t luaGetPlayerGUID(lua_State* L);
        static int32_t luaGetPlayerOperatingSystem(lua_State* L);
        static int32_t luaGetPlayerClientVersion(lua_State* L);
        static int32_t luaGetPlayerFlagValue(lua_State* L);
        static int32_t luaGetPlayerCustomFlagValue(lua_State* L);
        static int32_t luaHasCreatureCondition(lua_State* L);
        static int32_t luaGetCreatureConditionInfo(lua_State* L);
        static int32_t luaHasPlayerClient(lua_State* L);
        static int32_t luaGetDepotId(lua_State* L);
        static int32_t luaGetVocationInfo(lua_State* L);
        static int32_t luaGetGroupInfo(lua_State* L);
        static int32_t luaGetMonsterInfo(lua_State* L);
        static int32_t luaGetPlayerPromotionLevel(lua_State* L);
        static int32_t luaDoPlayerSetPromotionLevel(lua_State* L);
        static int32_t luaGetPlayerGroupId(lua_State* L);
        static int32_t luaDoPlayerSetGroupId(lua_State* L);
        static int32_t luaDoPlayerLearnInstantSpell(lua_State* L);
        static int32_t luaDoPlayerUnlearnInstantSpell(lua_State* L);
        static int32_t luaGetPlayerLearnedInstantSpell(lua_State* L);
        static int32_t luaGetPlayerInstantSpellCount(lua_State* L);
        static int32_t luaGetPlayerInstantSpellInfo(lua_State* L);
        static int32_t luaGetInstantSpellInfo(lua_State* L);
        static int32_t luaDoCreatureCastSpell(lua_State* L);
        static int32_t luaGetPlayerPartner(lua_State* L);
        static int32_t luaDoPlayerSetPartner(lua_State* L);
        static int32_t luaDoPlayerFollowCreature(lua_State* L);
        static int32_t luaGetPlayerParty(lua_State* L);
        static int32_t luaDoPlayerJoinParty(lua_State* L);
        static int32_t luaDoPlayerLeaveParty(lua_State* L);
        static int32_t luaGetPartyMembers(lua_State* L);
        static int32_t luaGetCreatureStorageList(lua_State* L);
        static int32_t luaGetCreatureStorage(lua_State* L);
        static int32_t luaDoCreatureSetStorage(lua_State* L);
        static int32_t luaGetPlayerSpectators(lua_State* L);
        static int32_t luaDoPlayerSetSpectators(lua_State* L);
        static int32_t luaDoPlayerAddBlessing(lua_State* L);
        static int32_t luaGetPlayerBlessing(lua_State* L);
        static int32_t luaDoPlayerSetPVPBlessing(lua_State* L);
        static int32_t luaGetPlayerPVPBlessing(lua_State* L);
        static int32_t luaDoGuildAddEnemy(lua_State* L);
        static int32_t luaDoGuildRemoveEnemy(lua_State* L);
        static int32_t luaGetStorageList(lua_State* L);
        static int32_t luaGetStorage(lua_State* L);
        static int32_t luaDoSetStorage(lua_State* L);
        static int32_t luaDoPlayerAddOutfit(lua_State* L);
        static int32_t luaDoPlayerRemoveOutfit(lua_State* L);
        static int32_t luaDoPlayerAddOutfitId(lua_State* L);
        static int32_t luaDoPlayerRemoveOutfitId(lua_State* L);
        static int32_t luaCanPlayerWearOutfit(lua_State* L);
        static int32_t luaCanPlayerWearOutfitId(lua_State* L);
        static int32_t luaGetWorldType(lua_State* L);
        static int32_t luaSetWorldType(lua_State* L);
        static int32_t luaGetWorldTime(lua_State* L);
        static int32_t luaGetWorldLight(lua_State* L);
        static int32_t luaGetWorldCreatures(lua_State* L);
        static int32_t luaGetWorldUpTime(lua_State* L);
        static int32_t luaGetGuildId(lua_State* L);
        static int32_t luaGetGuildMotd(lua_State* L);
        static int32_t luaIsPlayerPzLocked(lua_State* L);
        static int32_t luaIsPlayerSaving(lua_State* L);
        static int32_t luaIsPlayerProtected(lua_State* L);
        static int32_t luaIsCreature(lua_State* L);
        static int32_t luaIsMovable(lua_State* L);
        static int32_t luaGetContainerSize(lua_State* L);
        static int32_t luaGetContainerCap(lua_State* L);
        static int32_t luaGetContainerItem(lua_State* L);
        static int32_t luaDoAddContainerItem(lua_State* L);
        static int32_t luaCreateCombatObject(lua_State* L);
        static int32_t luaCreateCombatArea(lua_State* L);
        static int32_t luaSetCombatArea(lua_State* L);
        static int32_t luaSetCombatCondition(lua_State* L);
        static int32_t luaSetCombatParam(lua_State* L);
        static int32_t luaCreateConditionObject(lua_State* L);
        static int32_t luaSetConditionParam(lua_State* L);
        static int32_t luaAddDamageCondition(lua_State* L);
        static int32_t luaAddOutfitCondition(lua_State* L);
        static int32_t luaSetCombatCallBack(lua_State* L);
        static int32_t luaSetCombatFormula(lua_State* L);
        static int32_t luaSetConditionFormula(lua_State* L);
        static int32_t luaDoCombat(lua_State* L);
        static int32_t luaDoCombatAreaHealth(lua_State* L);
        static int32_t luaDoTargetCombatHealth(lua_State* L);
        static int32_t luaDoCombatAreaMana(lua_State* L);
        static int32_t luaDoTargetCombatMana(lua_State* L);
        static int32_t luaDoCombatAreaCondition(lua_State* L);
        static int32_t luaDoTargetCombatCondition(lua_State* L);
        static int32_t luaDoCombatAreaDispel(lua_State* L);
        static int32_t luaDoTargetCombatDispel(lua_State* L);
        static int32_t luaDoChallengeCreature(lua_State* L);
        static int32_t luaNumberToVariant(lua_State* L);
        static int32_t luaStringToVariant(lua_State* L);
        static int32_t luaPositionToVariant(lua_State* L);
        static int32_t luaTargetPositionToVariant(lua_State* L);
        static int32_t luaVariantToNumber(lua_State* L);
        static int32_t luaVariantToString(lua_State* L);
        static int32_t luaVariantToPosition(lua_State* L);
        static int32_t luaDoChangeSpeed(lua_State* L);
        static int32_t luaGetExperienceStage(lua_State* L);
        static int32_t luaDoCreatureChangeOutfit(lua_State* L);
        static int32_t luaSetCreatureOutfit(lua_State* L);
        static int32_t luaGetCreatureOutfit(lua_State* L);
        static int32_t luaSetMonsterOutfit(lua_State* L);
        static int32_t luaSetItemOutfit(lua_State* L);
        static int32_t luaGetCreatureLastPosition(lua_State* L);
        static int32_t luaGetCreatureName(lua_State* L);
        static int32_t luaGetCreatureMaster(lua_State* L);
        static int32_t luaGetCreatureSummons(lua_State* L);
        static int32_t luaGetHighscoreString(lua_State* L);
        static int32_t luaIsSightClear(lua_State* L);
        static int32_t luaAddEvent(lua_State* L);
        static int32_t luaStopEvent(lua_State* L);
        static int32_t luaRegisterCreatureEvent(lua_State* L);
        static int32_t luaUnregisterCreatureEvent(lua_State* L);
        static int32_t luaUnregisterCreatureEventType(lua_State* L);
        static int32_t luaGetPlayerBalance(lua_State* L);
        static int32_t luaDoPlayerSetBalance(lua_State* L);
        static int32_t luaDoPlayerPopupFYI(lua_State* L);
        static int32_t luaDoPlayerSendTutorial(lua_State* L);
        static int32_t luaDoPlayerSendMailByName(lua_State* L);
        static int32_t luaDoPlayerAddMapMark(lua_State* L);
        static int32_t luaGetPlayerPremiumDays(lua_State* L);
        static int32_t luaDoPlayerAddPremiumDays(lua_State* L);
        static int32_t luaGetCreatureNoMove(lua_State* L);
        static int32_t luaDoCreatureSetNoMove(lua_State* L);
        static int32_t luaGetTownId(lua_State* L);
        static int32_t luaGetTownName(lua_State* L);
        static int32_t luaGetTownTemplePosition(lua_State* L);
        static int32_t luaGetTownHouses(lua_State* L);
        static int32_t luaGetSpectators(lua_State* L);
        static int32_t luaGetGameState(lua_State* L);
        static int32_t luaDoSetGameState(lua_State* L);
        static int32_t luaGetChannelUsers(lua_State* L);
        static int32_t luaGetPlayersOnline(lua_State* L);
        static int32_t luaDoExecuteRaid(lua_State* L);
        static int32_t luaDoReloadInfo(lua_State* L);
        static int32_t luaDoSaveServer(lua_State* L);
        static int32_t luaDoSaveHouse(lua_State* L);
        static int32_t luaDoCleanHouse(lua_State* L);
        static int32_t luaDoCleanMap(lua_State* L);
        static int32_t luaDoRefreshMap(lua_State* L);
        static int32_t luaDoUpdateHouseAuctions(lua_State* L);
        static int32_t luaGetItemIdByName(lua_State* L);
        static int32_t luaGetItemInfo(lua_State* L);
        static int32_t luaGetItemWeight(lua_State* L);
        static int32_t luaGetItemParent(lua_State* L);
        static int32_t luaGetItemAttribute(lua_State* L);
        static int32_t luaDoItemSetAttribute(lua_State* L);
        static int32_t luaDoItemEraseAttribute(lua_State* L);
        static int32_t luaGetVocationList(lua_State* L);
        static int32_t luaGetGroupList(lua_State* L);
        static int32_t luaGetChannelList(lua_State* L);
        static int32_t luaGetTalkActionList(lua_State* L);
        static int32_t luaGetExperienceStageList(lua_State* L);
        static int32_t luaGetTownList(lua_State* L);
        static int32_t luaGetWaypointList(lua_State* L);
        static int32_t luaGetWaypointPosition(lua_State* L);
        static int32_t luaDoWaypointAddTemporial(lua_State* L);
        static int32_t luaGetDataDir(lua_State* L);
        static int32_t luaGetLogsDir(lua_State* L);
        static int32_t luaGetConfigFile(lua_State* L);
        static int32_t luaGetConfigValue(lua_State* L);
        static int32_t luaGetModList(lua_State* L);
        static int32_t luaDoPlayerSetWalkthrough(lua_State* L);
        static int32_t luaIsPlayerUsingOtclient(lua_State* L);
        static int32_t luaDoSendPlayerExtendedOpcode(lua_State* L);

        static int32_t luaL_errors(lua_State* L);
        static int32_t luaL_loadmodlib(lua_State* L);
        static int32_t luaL_domodlib(lua_State* L);
        static int32_t luaL_dodirectory(lua_State* L);

        static const luaL_Reg luaSystemTable[2];
        static int32_t luaSystemTime(lua_State* L);

        static const luaL_Reg luaDatabaseTable[13];
        static int32_t luaDatabaseExecute(lua_State* L);
        static int32_t luaDatabaseStoreQuery(lua_State* L);
        static int32_t luaDatabaseEscapeString(lua_State* L);
        static int32_t luaDatabaseEscapeBlob(lua_State* L);
        static int32_t luaDatabaseLastInsertId(lua_State* L);
        static int32_t luaDatabaseStringComparer(lua_State* L);
        static int32_t luaDatabaseUpdateLimiter(lua_State* L);
        static int32_t luaDatabaseConnected(lua_State* L);
        static int32_t luaDatabaseTableExists(lua_State* L);
        static int32_t luaDatabaseTransBegin(lua_State* L);
        static int32_t luaDatabaseTransRollback(lua_State* L);
        static int32_t luaDatabaseTransCommit(lua_State* L);

        static const luaL_Reg luaResultTable[7];
        static int32_t luaResultGetDataInt(lua_State* L);
        static int32_t luaResultGetDataLong(lua_State* L);
        static int32_t luaResultGetDataString(lua_State* L);
        static int32_t luaResultGetDataStream(lua_State* L);
        static int32_t luaResultNext(lua_State* L);
        static int32_t luaResultFree(lua_State* L);

        static const luaL_Reg luaBitTable[13];
        static int32_t luaBitNot(lua_State* L);
        static int32_t luaBitAnd(lua_State* L);
        static int32_t luaBitOr(lua_State* L);
        static int32_t luaBitXor(lua_State* L);
        static int32_t luaBitLeftShift(lua_State* L);
        static int32_t luaBitRightShift(lua_State* L);
        static int32_t luaBitUNot(lua_State* L);
        static int32_t luaBitUAnd(lua_State* L);
        static int32_t luaBitUOr(lua_State* L);
        static int32_t luaBitUXor(lua_State* L);
        static int32_t luaBitULeftShift(lua_State* L);
        static int32_t luaBitURightShift(lua_State* L);

        static const luaL_Reg luaStdTable[9];
        static int32_t luaStdCout(lua_State* L);
        static int32_t luaStdClog(lua_State* L);
        static int32_t luaStdCerr(lua_State* L);
        static int32_t luaStdMD5(lua_State* L);
        static int32_t luaStdSHA1(lua_State* L);
        static int32_t luaStdSHA256(lua_State* L);
        static int32_t luaStdSHA512(lua_State* L);
        static int32_t luaStdCheckName(lua_State* L);

        lua_State* m_luaState;
        bool m_errors;
        std::string m_lastError;

    private:
        void executeTimer(uint32_t eventIndex);

        enum PlayerInfo_t
        {
            PlayerInfoFood,
            PlayerInfoAccess,
            PlayerInfoGhostAccess,
            PlayerInfoLevel,
            PlayerInfoExperience,
            PlayerInfoManaSpent,
            PlayerInfoVocation,
            PlayerInfoTown,
            PlayerInfoPromotionLevel,
            PlayerInfoMoney,
            PlayerInfoFreeCap,
            PlayerInfoGuildId,
            PlayerInfoGuildName,
            PlayerInfoGuildRankId,
            PlayerInfoGuildRank,
            PlayerInfoGuildLevel,
            PlayerInfoGuildNick,
            PlayerInfoGroupId,
            PlayerInfoGUID,
            PlayerInfoAccountId,
            PlayerInfoAccount,
            PlayerInfoPremiumDays,
            PlayerInfoBalance,
            PlayerInfoStamina,
            PlayerInfoLossSkill,
            PlayerInfoMarriage,
            PlayerInfoPzLock,
            PlayerInfoSaving,
            PlayerInfoProtected,
            PlayerInfoIp,
            PlayerInfoSkullEnd,
            PlayerInfoOutfitWindow,
            PlayerInfoNameDescription,
            PlayerInfoSpecialDescription,
            PlayerInfoIdleTime,
            PlayerInfoClient,
            PlayerInfoLastLoad,
            PlayerInfoLastLogin,
            PlayerInfoAccountManager,
            PlayerInfoTradeState,
            PlayerInfoOperatingSystem,
            PlayerInfoClientVersion
        };
        static int32_t internalGetPlayerInfo(lua_State* L, PlayerInfo_t info);

        int32_t m_runningEvent;
        uint32_t m_lastTimer;
        std::string m_loadingFile, m_interfaceName;

        static ScriptEnviroment m_scriptEnv[21];
        static int32_t m_scriptEnvIndex;

        //events information
        struct LuaTimerEvent
        {
            int32_t scriptId, function;
            uint32_t eventId;
            Npc* npc;
            std::list<int32_t> parameters;
        };

        typedef std::map<uint32_t, LuaTimerEvent> LuaTimerEvents;
        LuaTimerEvents m_timerEvents;

        //script file cache
        typedef std::map<int32_t, std::string> ScriptsCache;
        ScriptsCache m_cacheFiles;
};
#endif

 

 

Link para o post
Compartilhar em outros sites

Como assim, no caso a script que está tentando enviar o opcode pro client? Vou postar ela aqui pra você poder dar uma olhada:


function onUse(cid, item, frompos, item2, topos)
local level = 10 -- level
local amount = 1 -- qntos pontos vc vai dar
local tier = getPlayerStorageValue(cid, TIER_STORAGE) <= 0 and 0 or getPlayerStorageValue(cid, TIER_STORAGE)
if item.itemid == 2236 then -- id do book
if getPlayerLevel(cid) >= level then
setPlayerStorageValue(cid, TIER_STORAGE, tier+amount)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Voce recebeu 1 ponto de tier.")
doSendPlayerExtendedOpcode(cid, 123, "Sucesso")
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"Você precisa ser level "..level.."")
end 
return 
true 
end  
end

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por matiasz123
      [OTCLIENT SHOWOFF] Questlog Actualizado
      Updated quest log, showing quest details:
      Npc name Npc level Npc outfit Mission status Description Amount of reward experience Number of reward points Enemies you must kill Items to collect  
       

       
      When you click on the follow button, an alternative map opens that shows you the next objective of the mission and at what coordinates:


       
      If you want the system write a comment with your discord
    • Por Mutio
      PokeDash by Pota TFS 1.2
      OTCv8
      Dialogue module by Gengo (Reworked)
       
      Hello everyone, would anyone be able to help me improve this dialogue system?
      When I have a lot of text, it expands, and there's a write effect. I made this primarily for myself, but you can also benefit from it.
      The problem is that if there's a lot of text, the window doesn't layout as I intended, specifically regarding the buttons. They get cut off, and I'd like the window to adjust its size based on the amount of text and buttons. For example, if there are 3 buttons, the window should not cut them off but should expand, adding a few pixels at the bottom to display the buttons correctly.
      Additionally, I've implemented a feature in the code to display items in the center if they are required for quests or anything an NPC might ask from the player. I'd like to make sure this feature also adapts correctly to the window size.
      Perhaps there is an expert in the OTC module who could guide me or correct and remove unnecessary code that I've written and is not needed. I must admit that I'm not a very skilled developer in OTC, but I managed to accomplish something. If someone can help me, I can share this dialogue system. (Modified version of Gengo)



      LUA:
       
      local npcWindowDialog local buttonHolder local lblTitle local outfitBox local panelMsg local scrollPanel local lblMessage local LabelText local itemBox local buttondialog local fadeOutEvent = nil local initialHeight = 200 function init() connect(g_game, { onGameEnd = offline }) connect(LocalPlayer, { onPositionChange = onCreaturePositionChange }) ProtocolGame.registerExtendedOpcode(80, function(protocol, opcode, buffer) print("Received extended opcode data: " .. buffer) local data = json.decode(buffer) if (data.action == "close") then offline() elseif (data.action == "create") then NpcDialog(data.data) end end) npcWindowDialog = g_ui.displayUI('npcdialog') buttonHolder = npcWindowDialog:getChildById('buttonHolder') lblTitle = npcWindowDialog:getChildById('lblTitle') scrollPanel = npcWindowDialog:getChildById('scrollPanel') panelMsg = npcWindowDialog:getChildById('panelMsg') outfitBox = npcWindowDialog:getChildById('outfitBox') itemBox = npcWindowDialog:getChildById('itemBox') buttondialog = npcWindowDialog:getChildById('buttondialog') lblMessage = g_ui.createWidget('LabelText', panelMsg) end function terminate() disconnect(g_game, { onGameEnd = offline }) disconnect(Creature, { onPositionChange = onCreaturePositionChange }) ProtocolGame.unregisterExtendedOpcode(80) removeEvent(npcWindowDialog.fadeEvent) npcWindowDialog:destroy() end function clearItemBox() itemBox:destroyChildren() end function offline() clearItemBox() buttondialog:destroyChildren() npcWindowDialog:hide() npcWindowDialog:setHeight(initialHeight) if fadeOutEvent then removeEvent(fadeOutEvent) end end function onCreaturePositionChange(creature, newPos, oldPos) if creature:isLocalPlayer() then clearItemBox() npcWindowDialog:setHeight(initialHeight) npcWindowDialog:hide() end end function openDialog() npcWindowDialog:raise() npcWindowDialog:show() npcWindowDialog:setOpacity(0) npcWindowDialog:setHeight(initialHeight) g_effects.fadeIn(npcWindowDialog, 150) if fadeOutEvent then removeEvent(fadeOutEvent) end fadeOutEvent = scheduleEvent(function() g_effects.fadeOut(npcWindowDialog, 150) end, 30000) end function writeTextEffect(lblMessage, text, delay, callback) lblMessage:clearText() local textSize = #text local initialHeight = npcWindowDialog:getHeight() for i = 1, textSize do scheduleEvent(function() lblMessage:setText(lblMessage:getText() .. text:sub(i, i)) local newHeight = initialHeight + lblMessage:getTextSize().height npcWindowDialog:setHeight(newHeight) end, delay * i) end end function NpcDialog(value) clearItemBox() local Npc = g_map.getCreatureById(value.npcId) lblTitle:setText(Npc:getName()) outfitBox:setOutfit(Npc:getOutfit()) lblMessage:clearText() writeTextEffect(lblMessage, tr(value.message), 15) scrollPanel:setVisible(lblMessage:getTextSize().height > panelMsg.limitText) local textLength = string.len(value.message) local windowHeight = textLength * 10 if value.items ~= nil then local itemHeight = 10 windowHeight = windowHeight + (#value.items * itemHeight) end local maxHeight = 800 if windowHeight > maxHeight then windowHeight = maxHeight end npcWindowDialog:setHeight(windowHeight) if value.items ~= nil then for _, itemId in ipairs(value.items) do local item = g_ui.createWidget('Item', itemBox) item:setItemId(itemId) end end buttondialog:destroyChildren() if value.options ~= '' then local option = value.options:split('&') for i = 1, #option do local button = g_ui.createWidget('OptionButton', buttondialog) button:setText(tr(option[i])) button:setWidth(500) button:setHeight(150) button:setVisible(false) button.onClick = function() g_game.talkChannel(MessageModes.NpcTo, 0, option[i]) npcWindowDialog:setHeight(initialHeight) button:setVisible(false) end end buttondialog:setHeight(#option > 25 and 88 or 25) scheduleEvent(function() for i, child in ipairs(buttondialog:getChildren()) do child:setVisible(true) g_effects.fadeIn(child, 500) end end, (#value.message * 8) + 500) end openDialog() end

      OTUI:

       
      LabelText < Label padding-bottom: 5 font: sans-bold-16px color: #e8c05e text-wrap: true text-auto-resize: true OptionButton < UIButton image-source: /images/ui/buttondialog image-repeated: true text-offset: 0 1 change-cursor-image: true cursor: pointer $pressed: image-color: #dfdfdf44 $disabled: image-color: #dfdfdf55 change-cursor-image: false UIWindow id: npcWindowDialog size: 690 381 visible: false focusable: false image-source: window image-repeated: false anchors.centerIn: parent @onEscape: modules.game_npcdialog.offline() Label id: lblTitle font: sans-bold-16px anchors.top: parent.top anchors.left: parent.left !text: tr('Title') margin: 18 0 5 25 color: #e8c05e text-auto-resize: true UICreature id: outfitBox size: 58 58 anchors.top: prev.bottom anchors.left: parent.left margin: 20 0 5 34 VerticalScrollBar id: scrollPanel height: 65 anchors.top: panelMsg.top anchors.left: panelMsg.right anchors.bottom: panelMsg.bottom pixels-scroll: true step: 14 margin-left: 5 visible: false ScrollablePanel id: panelMsg size: 0 60 anchors.top: lblTitle.bottom anchors.left: outfitBox.right anchors.right: parent.right margin: 8 30 10 25 vertical-scrollbar: scrollPanel layout: verticalBox &limitText: 80 UIItem id: itemBox size: 50 50 anchors.horizontalCenter: parent.horizontalCenter anchors.top: panelMsg.bottom layout: type: horizontalBox cell-size: 50 50 cell-spacing: 12 num-columns: 10 fit-children: true UIScrollArea id: buttondialog anchors.top: itemBox.bottom anchors.left: parent.left anchors.right: parent.right margin: 15 10 25 10 layout: type: grid cell-size: 500 42 flow: true fit-children: true
       

       


    • Por AddroJhonny
      Andei buscando de tudo que é forma para que o minimap fique com a imagem já liberada, assim como é no PxG. Porém, não encontrei em nenhum lugar alguma instrução. Comecei a mexer no arquivo minimap.lua e consegui avançar em algo.
       
      Meu script ficou assim:
      function updateCameraPosition() local player = g_game.getLocalPlayer() if not player then return end local pos = player:getPosition() if not pos then return end if not minimapWidget:recursiveGetChildById('posLabel') then local minimap = g_ui.createWidget('Minimap', minimapWidget) minimapWidget:setImageSource('/mapa/pisos/piso1') minimapWidget:setId('posLabel') minimapWidget:setOpacity(0.3) minimapWidget:centerInPosition(map, {x = 1015, y=1012, z=7}) end if not minimapWidget:isDragging() then if not fullmapView then minimapWidget:setCameraPosition(player:getPosition()) end minimapWidget:setCrossPosition(player:getPosition()) end minimapPos = minimapWindow:recursiveGetChildById('posLabel') minimapPos:setText('X:'..pos.x..' Y:'..pos.y..' Z:'..pos.z) if minimapWidget:getCameraPosition().z ~= 7 then local minimap = minimapWidget:recursiveGetChildById('posLabel') minimap:setVisible(false) minimapWidget:setColor('black') end end  
      Agora a imagem realmente está aparecendo no minimap com transparência... e quase perfeito. Mas ainda falta conseguir fazer ela acompanhar a posição do player no lugar de ficar aberto por inteiro.
       
      Segue como ficou:
       

       
      Alguém consegue ajudar a melhor maneira de fazer isso? Ou se fiz errado também...
       
      Ty.
    • Por PokemonXdemon
      .Qual servidor ou website você utiliza como base? 
      Servidor Pxu  versão 0.3.6
      Qual o motivo deste tópico? 
      Estou com cliente crashando dentro das quests
       
       
       

    • Por becertified
      Oi pessoal, gostaria de saber como posso mudar meu otc para um otcv8 com uma base poketibia tfs 0.3.6
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo