Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''iunix fodao''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 2 registros

  1. Essa função é do MOCK e ele me autorizou a postar aqui. Ela cria um .txt na pasta do OT (onde fica o .exe) com TODAS as funções do teu server. TODAS mesmo. function onUse(cid, item) local k = getLuaFunctions() --- Create file content your server function list local file__ = io.open('Your Server Function List.txt','w') table.sort(k) for i=1,#k do if k[i] ~= "" then file__:write((i-1)..' - '..k[i]..'\n') end end file__:close() return true end function getLuaFunctions()-- by Mock local str = "" for f,k in pairs(_G) do if type(k) == 'function' then str = str..f..',' elseif type(k) == 'table' then for d,o in pairs(k) do if type(o) == 'function' then if f ~= '_G' and d ~= "_G" and f ~= 'package' then str = str..f.."."..d..',' end elseif type(o) == 'table' then for m,n in pairs(o) do if type(n) == 'function' then if d == "_M" and m ~= "_M" and f ~= "_G" and f ~= 'package' then str = str..f.."."..m.."," elseif f ~= '_G' and m ~= "_G" and d ~= "_G" and f ~= 'package' then str = str..f.."."..d..'.'..m..',' end elseif type(n) == 'table' then for x,p in pairs(n) do if type(p) == 'function' then if m == "_M" and d ~= "_M" and f ~= "_G" and f ~= 'package' then str = str..f.."."..d..'.'..x..',' elseif m == "_M" and d == "_M" and f ~= "_G" and f ~= 'package' then str = str..f.."."..x..',' elseif m ~= "_M" and d == "_M" and f ~= "_G" and f ~= 'package' then str = str..f..'.'..m..'.'..x..',' elseif f ~= '_G' and m ~= "_G" and d ~= "_G" and f ~= 'package' then str = str..f.."."..d..'.'..m..'.'..x..',' end end end end end end end end end return string.explode(str,',') end Bom, só criar uma tag de um item qualquer e dar use nele e pronto. Tua lista está pronta. É uma função extremamente avançada, se você não sabe como funciona ou como instalar. Nem se de o trabalho de perguntar porque não vou ficar respondendo.
  2. doCreatureCastSpell

    Introdução: Bom eu vi que aqui no fórum tem o doPlayerCastSpell. E como isso as vezes pode não ser o que precisam. Vamos ao código. Explicação: Basicamente é uma função que força uma criatura a usar uma spell. Ignorando mana, vocação, level e tudo mais. Instalando: Abra o teu Arquivo luascript.cpp e procure por: //getCreatureHealth(cid) lua_register(m_luaState, "getCreatureHealth", LuaInterface::luaGetCreatureHealth); abaixo disso coloque: //doCreatureCastSpell(cid, spellname) lua_register(m_luaState, "doCreatureCastSpell", LuaInterface::luaDoCreatureCastSpell); Agora procure por: int32_t LuaInterface::luaDoPlayerJoinParty(lua_State* L) { //doPlayerJoinParty(cid, lid) ScriptEnviroment* env = getEnv(); Player* leader = env->getPlayerByUID(popNumber(L)); if(!leader) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); } Player* player = env->getPlayerByUID(popNumber(L)); if(!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); } g_game.playerJoinParty(player->getID(), leader->getID()); lua_pushboolean(L, true); return 1; } E coloque isso antes (pule umas duas linhas de espaço para não confundir e deixar organizado) int32_t LuaInterface::luaDoCreatureCastSpell(lua_State * L) { //DoCreatureCastSpell (uid, spell) std::string spell_name = popString(L); ScriptEnviroment* env = getEnv(); Creature * creature = env-> getCreatureByUID (popNumber (L)); if (! creature) { errorEx (getError (LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean (L, false); return 1; } InstantSpell* spell = g_spells->getInstantSpellByName (spell_name); if(spell) { if (spell-> castSpell(creature)) { lua_pushboolean (L, true); return 1; } } lua_pushboolean (L, false); return 1; } Agora vá em luascript.h e procure por: static int32_t luaDoPlayerAddMoney(lua_State* L); e coloque isso abaixo: static int32_t luaDoCreatureCastSpell(lua_State* L); Utilização: function onSay(cid, words, param, channel) local su = getCreatureSummons(cid)[1] doCreatureCastSpell(su, param) doPlayerSay(cid, getCreatureName(su) .. ", use " .. param .. "!") doSendAnimatedText(getCreaturePosition(su), param, math.random(255)) return true end Agradecimentos: Obrigado ao Kydrai pela ajuda com alguns erros. E ao vyctor17 pela base que ele me deu.
×