Postado Maio 1, 2015 10 anos Falta de atenção minha, código corrigido. Em data/movements/scripts, fly.lua: Remova as linhas: for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, 3) or hasProperty(tile.uid, 7) or tile.itemid == 919 then doTransformItem(item.uid, 11677) end end end Essas funções já vêm escritas no TFS. Há uma versão em lua semelhante a getPosByDir, que é: function getPositionByDirection(position, direction, size) local n = size or 1 if(direction == NORTH) then position.y = position.y - n elseif(direction == SOUTH) then position.y = position.y + n elseif(direction == WEST) then position.x = position.x - n elseif(direction == EAST) then position.x = position.x + n elseif(direction == NORTHWEST) then position.y = position.y - n position.x = position.x - n elseif(direction == NORTHEAST) then position.y = position.y - n position.x = position.x + n elseif(direction == SOUTHWEST) then position.y = position.y + n position.x = position.x - n elseif(direction == SOUTHEAST) then position.y = position.y + n position.x = position.x + n end return position end Já getCreatureLookDir é C++ made. Segue o código: int32_t LuaScriptInterface::luaGetCreatureLookDirection(lua_State* L) { //getCreatureLookDirection(cid) ScriptEnviroment* env = getEnv(); if(Creature* creature = env->getCreatureByUID(popNumber(L))) lua_pushnumber(L, creature->getDirection()); else { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); } return 1; } Na pasta data do servidor, em algum arquivo da lib, basta declarar que getCreatureLookDir = getCreatureLookDirection. Porém, suponho que já haja tais funções em seu servidor. PS: O código do !fly que escrevi não funciona em TFS 1.0+. as sources são 0.3.6 em qual arquivo d source eu preciso add pr compilar?
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.