Ir para conteúdo

Emosolitario

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Emosolitario deu reputação a MySticaL em [0.3.6] Função doPlayerOpenChannel   
    EDITADO REMOVIDO A VERSÃO 0.4 QUE CONTIA!
    SE QUISER A VERSÃO 0.4 SÓ VER NO PERFIL DO ALEXY.
     
    Oi, vim trazer a função doPlayerOpenChannel para tfs 0.3.6
    Essa função nada mais é que quando o player loga abre os chat selecionado no login.lua automaticamente
     
    Essa função é para 0.3.6
    Versões testada: 8.54
     
    Vamos ao código
    em LuaScript.cpp
     
    Procure:
    //getChannelUsers(channelId) lua_register(m_luaState, "getChannelUsers", LuaScriptInterface::luaGetChannelUsers); Adicione em baixo:
    //doPlayerOpenChannel(cid, channelId) lua_register(m_luaState, "doPlayerOpenChannel", LuaScriptInterface::luaDoPlayerOpenChannel); Continuando procure:
    int32_t LuaScriptInterface::internalGetPlayerInfo(lua_State* L, PlayerInfo_t info) Acima adicione:
    int32_t LuaScriptInterface::luaDoPlayerOpenChannel(lua_State* L) { //doPlayerOpenChannel(cid, channelId) uint32_t channelId = popNumber(L); uint32_t cid = popNumber(L); ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(cid); if(player) lua_pushnumber(L, g_game.playerOpenChannel(cid, channelId) ? true : false); else { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushnumber(L, false); } return 1; } Agora em LuaScript.h
    Procure por:
    static int32_t luaGetChannelUsers(lua_State* L); abaixo adicione:
    static int32_t luaDoPlayerOpenChannel(lua_State* L); Agora em data/creaturescripts/scripts/login.lua
    Antes do último
    return true Adicione:
    doPlayerOpenChannel(cid, 7) -- 7 é o número do channel para ver é em data/xml/channels.xml  
    Rep não cai o dedo
  2. Gostei
    Emosolitario deu reputação a Wolf Admin em [PEDIDO] COMO CRIAR MAGIAS PARA POKETIBIA   
    Para Criar magias, vc vai no pokemon moves.lua, Abre o procura por uma spell que você deseja "imitar" (Você só ira copiar, colar e trocar o efeito). Irei usar de Exemplo a "Earthquake":
     
    elseif spell == "Earthquake" then   local eff = getSubName(cid, target) == "Shiny Onix" and 175 or 118  --alterado v2.6.1   local function doQuake(cid) if not isCreature(cid) then return false end if isSleeping(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return false end if isWithFear(cid) and getPlayerStorageValue(cid, 3644587) >= 1 then return true end    doMoveInArea2(cid, eff, confusion, GROUNDDAMAGE, min, max, spell) end   times = {0, 500, 1000, 1500, 2300, 2800, 3300, 3800, 4600, 5100, 5600, 6100, 6900, 7400, 7900, 8400, 9200, 10000}   setPlayerStorageValue(cid, 3644587, 1) addEvent(setPlayerStorageValue, 10000, cid, 3644587, -1) for i = 1, #times do                   --alterado v1.4     addEvent(doQuake, times, cid) end   - Azul: Nome da Spell Vermelho: ID do efeito da spell Ciano: Tipo do Dano que a spell irá causar (DARKDAMAGE, PSYCHICDAMAGE, WATERDAMAGE ....)   ~~ Você terá q copiar a spell e colar abaixo, em Seguida troque o nome da spell em Azul pelo nome que você preferir. ~~Logo Após, onde está Vermelho, Coloque o id do Efeito do Spell (Você pode escolher o Efeito por game fazendo /z 1, /z 2, /z 3, /z 4, etc. ou Abrindo seu Dat Editor ou Object Builder e veja o ID do efeito lá. ~~Mude o efeito da parte em Ciano para o efeito que a spell ira causar(FLYINGDAMAGE, FIGHTINGDAMAGE, ROCKDAMAGE, FIREDAMAGE, GRASSDAMAGE, GHOSTDAMAGE, etc...)   Agora Vá na pasta spells/scripts/ps e Crie um arquivo em lua com o nome da spell que você criou no pokemon moves.lua e adicione isso:  
     
    Coloque o mesmo  nome da spell lá na parte Verde.
     
    ~~Agora, abra o spells.xml e Adicione isso lá nas ultimas linhas:
      <instant name="Nome Da Spell" words="spell301" lvl="1000" mana="0" event="script" value="ps/Nome da spell.lua"></instant>     Espero ter ajudado, Postem suas duvidas sobre o assunto aqui, se houver..  

Informação Importante

Confirmação de Termo