Ir para conteúdo
  • Cadastre-se

Alienbear

Membro
  • Total de itens

    268
  • Registro em

  • Última visita

  • Dias Ganhos

    4

Histórico de Curtidas

  1. Gostei
    Alienbear recebeu reputação de Vodkart em [TFS 1.2+] Invite Players System!   
    @Vodkart Amigo estou testando o sistema, tfs 1.2 versão 10.96

    Eu consigo adicionar o jogador com o comando !invited Terra Nova

    mas quando eu upo o level que da a recompensa não aparece nenhuma mensagem.
  2. Gostei
    Alienbear recebeu reputação de Vodkart em [8.6] Invite Players System!   
    teria ele para tfs 1.2?
     
  3. Gostei
    Alienbear recebeu reputação de Striker Macabrus em Base de script   
    Fala galerinha do T.K
     
    Pode não ser muito útil oque vim trazer hoje, porem estou trazendo porque algumas pessoas tem duvidas de como criar um script com mais de um IF e um else para cada IF...
     
    Aprendi com meu amigão xWHITEWOLF
     
    Vamos lá...

     
    local lvl = 3300 local moeda = 9971 local stg = 97931 function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) >= lvl then if getPlayerItemCount(cid, moeda) >= 1 then if getPlayerStorageValue(cid, stg) >= 0 then doSendMagicEffect(getCreaturePosition(cid), 39) doCreatureSay(cid, "Você tem level, moeda e storage.", TALKTYPE_ORANGE_1) else doSendMagicEffect(getCreaturePosition(cid), 3) doCreatureSay(cid, "Você não tem STORAGE.", TALKTYPE_ORANGE_1) end else doSendMagicEffect(getCreaturePosition(cid), 3) doCreatureSay(cid, "Você não tem MOEDA.", TALKTYPE_ORANGE_1) end else doSendMagicEffect(getCreaturePosition(cid), 3) doCreatureSay(cid, "Você não tem LEVEL.", TALKTYPE_ORANGE_1) end return TRUE end

     
    "IF" representa "SE" "THEN" representa "ENTÃO" "ELSE" representa "SE NÃO ou OUTRO" "END" representa "FIM" explicação: if 1 if 2 if 3 else3 end else2 end else1 end Ou seja... if 3 esta dentro do if 2 e ambos estão dentro do if 1 Logo o primeiro else tem que fechar o if 3, o segundo else fecha o if 2 e o ultimo vai fechar o primeiro if Nessa ordem. Se tiverem mais alguma duvida só perguntar. Se alguém tiver duvidas por favor comente e eu tentarei ajudar. Abraços!
  4. Gostei
    Alienbear recebeu reputação de Striker Macabrus em Base de script   
    local lvl = 3300 local moeda = 9971 local stg = 97931 function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) >= lvl then if getPlayerItemCount(cid, moeda) >= 1 then if getPlayerStorageValue(cid, stg) >= 0 then doSendMagicEffect(getCreaturePosition(cid), 39) doCreatureSay(cid, "Você tem level, moeda e storage.", TALKTYPE_ORANGE_1) else doSendMagicEffect(getCreaturePosition(cid), 3) doCreatureSay(cid, "Você não tem STORAGE.", TALKTYPE_ORANGE_1) end else doSendMagicEffect(getCreaturePosition(cid), 3) doCreatureSay(cid, "Você não tem MOEDA.", TALKTYPE_ORANGE_1) end else doSendMagicEffect(getCreaturePosition(cid), 3) doCreatureSay(cid, "Você não tem LEVEL.", TALKTYPE_ORANGE_1) end return TRUE end "IF" representa "SE"
    "THEN" representa "ENTÃO"
    "ELSE" representa "SE NÃO ou OUTRO"
    "END" representa "FIM"

    explicação:
    if 1

      if 2

          if 3

          else3

          end

      else2

      end

    else1

    end

    Ou seja... if 3 esta dentro do if 2 e ambos estão dentro do if 1
    Logo o primeiro else tem que fechar o if 3, o segundo else fecha o if 2 e o ultimo vai fechar o primeiro if
     
    Nessa ordem.

    Se tiverem mais alguma duvida só perguntar.
  5. Gostei
    Alienbear deu reputação a psychonaut em (Resolvido)CreateAccount   
    1.0 Usa o mesmo
  6. Gostei
    Alienbear deu reputação a vankk em Distro 1.2 versão 10.82   
    Voce tem que colocar as coisas como está em vermelho. Simplificando, a parte da direita que voce precisa tirar, e tem que deixar igual a parte da esquerda. Não sei qual a melhor explicacao, HAHAHA.
  7. Gostei
    Alienbear deu reputação a vankk em Distro 1.2 versão 10.82   
    Nas sources do meu test server aqui, eu reverti os scripts, é funcionou perfeitamente. Recomendo melhor reverter os scripts que demora 2 minutos do que instalar o VS 2015 que é um ano para instalar.
  8. Gostei
    Alienbear deu reputação a vankk em Distro 1.2 versão 10.82   
    Exatamente.
  9. Gostei
    Alienbear deu reputação a vankk em Distro 1.2 versão 10.82   
    Provavelmente o optional.h já deve estar na pasta src, se não tiver, apenas crie um arquivo, renomeie para optional.h, e copia o código e coloca nele.
  10. Gostei
    Alienbear deu reputação a vankk em Distro 1.2 versão 10.82   
    Não, apenas os códigos. Sem -.
  11. Gostei
    Alienbear deu reputação a Qwizer em [v32] GlobalFull 11/12 - New Asuras, Falcons, Warzones 4,5,6 . (Updates Frequentes)   
    Global 11/12x [v32]
     

     
     
    - New Falcons
    - New Asuras
    - Warzone 4,5,6
    - Exercise Training
    - Raids 100%
    - Monstros 100%
    - Trainer Offline 100%
    - Trainer Online 100%
    - Taming system funcionando 100%;
    - Database completa
    - War System 100%
    - Global MAP Full
    - Store 100%
    - Imbuement
    - Prey System
    - Entre outros sistemas.
     
    Projeto no: GITHUB

    Scan Vírus Total
     
    IMAGES
     
    Créditos:
     
     











  12. Gostei
    Alienbear recebeu reputação de Morphred em [Ajuda] Adicionar balls   
    http://www.tibiaking.com/forum/topic/57507-tutoriais-para-pda/?view=findpost&p=337497 Criado pelo nosso amigo 
    TopllDanStar
  13. Gostei
    Alienbear recebeu reputação de Wend II em [Ajuda] Adicionar balls   
    http://www.tibiaking.com/forum/topic/57507-tutoriais-para-pda/?view=findpost&p=337497 Criado pelo nosso amigo 
    TopllDanStar
  14. Gostei
    Alienbear recebeu reputação de Vodkart em [Pedido] NPC de aluguel de montarias.   
    Foi o mais simples que encontrei, se precisar de ajuda para instalar basta me enviar uma mensagem. abraço.
  15. Gostei
    Alienbear recebeu reputação de Mdcrf em (Resolvido)Intervalo na execução da script   
    -- -- Stuffed Dragon (sid: 5791) -- -- TODO: -- Make "You... will.... burn!!" more rare. -- SOUNDS = {"Fchhhhhh!", "Zchhhhhh!", "Grooaaaaar*cough*", "Aaa... CHOO!", "You... will.... burn!!"} function onUse(cid, item, fromPosition, itemEx, toPosition) if (getPlayerStorageValue(cid, 11560) <= os.time()) then local random = math.random(1, table.maxn(SOUNDS)) if(fromPosition.x ~= CONTAINER_POSITION) then doCreatureSay(cid, SOUNDS[random], TALKTYPE_ORANGE_1, fromPosition) setPlayerStorageValue(cid,11560,os.time()+2) else doCreatureSay(cid, SOUNDS[random], TALKTYPE_ORANGE_1) setPlayerStorageValue(cid,11560,os.time()+2) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED,"Você só poderá usar este item novamente em " .. (getPlayerStorageValue(cid, 11560)-os.time()+(0)) .. " segundos.") end if(random == 5) then -- "You... will.... burn!!" doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -1, -1, CONST_ME_EXPLOSIONHIT) setPlayerStorageValue(cid,11560,os.time()+2) end return TRUE end
  16. Gostei
    Alienbear recebeu reputação de Caronte em [ACTION] Campainha V2 - funções extras   
    local time = 1 function onUse(cid, item, frompos, item2, topos) if exhaustion.check(cid, 23000000) == false then exhaustion.set(cid, 23000000, 4) else return doPlayerSendCancel(cid, "Campaínha já foi tocada, espere: " ..exhaustion.get(cid, 23000000).."") end doSendMagicEffect(frompos,18) doSendAnimatedText(frompos,"Tindon",107) addEvent(doSendAnimatedText, time*400, frompos,"Tindon", 107) end amigo n tem necessidade de usar:
     if exhaustion.check(cid, 23000000) == false then
    pode usar 
    if exhaustion.check(cid, 23000000) then
  17. Gostei
    Alienbear recebeu reputação de gbik em Error na hora de ativar o install.php   
    Amigo, não use xampp... use vertrigo.
  18. Gostei
    Alienbear recebeu reputação de cleitonblink em (Resolvido)Teleport que adicione Storages   
    pode ser colocado isso em um tile que ficará em baixo do teleport...

    quer q eu faça?

    function onStepIn(cid, item, pos) local storage = NUMERO DA STORAGE if getPlayerStorageValue(cid, storage) < 2 then setPlayerStorageValue(cid, storage, 2) end return true end
  19. Gostei
    Alienbear recebeu reputação de gacjogos em (Resolvido)[Error] Doors   
    local function checkStackpos(item, position) position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local thing = getThingFromPos(position) position.stackpos = STACKPOS_TOP_FIELD local field = getThingFromPos(position) return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0) end function onUse(cid, item, fromPosition, itemEx, toPosition) if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 189) then if(isPremium(cid) ~= TRUE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local gender = item.actionid - 186 if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender) == TRUE) then local playerGender = getPlayerSex(cid) if(playerGender ~= gender) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local skull = item.actionid - 180 if(skull >= 0 and skull < 6) then local playerSkull = getCreatureSkullType(cid) if(playerSkull ~= skull) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local group = item.actionid - 150 if(group >= 0 and group < 30) then local playerGroup = getPlayerGroupId(cid) if(playerGroup < group) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end local vocation = item.actionid - 100 if(vocation >= 0 and vocation < 50) then local playerVocationInfo = getVocationInfo(getPlayerVocation(cid)) if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return TRUE end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) return TRUE end if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return TRUE end if(isInArray(specialDoors, item.itemid) == TRUE) then if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.") end return TRUE end if(isInArray(keys, item.itemid) == TRUE) then if(itemEx.actionid > 0) then if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then doTransformItem(itemEx.uid, doors[itemEx.itemid]) return TRUE end doPlayerSendCancel(cid, "The key does not match.") return TRUE end return FALSE end if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.y = newPosition.y + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition, TRUE) if(isInArray(closingDoors, item.itemid) ~= TRUE) then doTransformItem(item.uid, item.itemid - 1) end end return TRUE end doTransformItem(item.uid, item.itemid - 1) return TRUE end if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.x = newPosition.x + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition, TRUE) if(isInArray(closingDoors, item.itemid) ~= TRUE) then doTransformItem(item.uid, item.itemid - 1) end end return TRUE end doTransformItem(item.uid, item.itemid - 1) return TRUE end if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then if(item.actionid == 0) then doTransformItem(item.uid, doors[item.itemid]) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.") end return TRUE end return FALSE end
  20. Gostei
    Alienbear deu reputação a Elwyn em getCreaturePathTo   
    Para TFS 0.4/0.3.6 e OTX2
     
    Em luascript.h depois de:
    static int32_t luaGetCreatureName(lua_State* L); Adicionar:
    static int32_t luaGetCreaturePathTo(lua_State* L); Em luascript.cpp depois de:
    //getCreatureName(cid) lua_register(m_luaState, "getCreatureName", LuaInterface::luaGetCreatureName); Adicionar:
    //getCreaturePathTo(cid, pos, maxSearchDist) lua_register(m_luaState, "getCreaturePathTo", LuaInterface::luaGetCreaturePathTo); Depois de:
    int32_t LuaInterface::luaGetCreatureName(lua_State* L) { //getCreatureName(cid)     ScriptEnviroment* env = getEnv();     if(Creature* creature = env->getCreatureByUID(popNumber(L)))         lua_pushstring(L, creature->getName().c_str());     else     {         errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));         lua_pushboolean(L, false);     }     return 1; } Adicionar:
    int32_t LuaInterface::luaGetCreaturePathTo(lua_State* L) { //getCreaturePathTo(cid, pos, maxSearchDist)     ScriptEnviroment* env = getEnv();     int32_t maxSearchDist = popNumber(L);     PositionEx position;     popPosition(L, position);     Creature* creature = env->getCreatureByUID(popNumber(L));     if (!creature) {         lua_pushnil(L);         return 1;     }     std::list<Direction> dirList;     lua_newtable(L);     if (g_game.getPathTo(creature, position, dirList, maxSearchDist)) {         std::list<Direction>::const_iterator it = dirList.begin();         for (int32_t index = 1; it != dirList.end(); ++it, ++index) {             lua_pushnumber(L, index);             lua_pushnumber(L, (*it));             pushTable(L);         }     } else {         lua_pushboolean(L, false);     }     return 1; } E sejam felizes!
     
    getCreaturePathTo(cid, position, maxSearchDist) retornará uma tabela com as direções que o jogador deve seguir para chegar no ponto position. Não contem as posições que ele deve passar por. maxSearchDist é o valor máximo de passos que ele vai dar em direção à essa position e na via das dúvidas coloque o maior valor de distancia entre as duas posições.
     
  21. Gostei
    Alienbear deu reputação a xWhiteWolf em Tibia está zerado + preview [GPS SYSTEM]   
    Graças ao nosso marvilhoso colega Elwyn o tibia foi zerado hoje dia 09/03/2015 haha.   Ele lançou uma função crucial pra fazer qualquer script relacionado à movimentação ao combinar o algoritmo de pathFinding da source à uma função Lua.
    Sei que muita gente não frequenta a seção de programming OU não entendeu nada doque eu falei mas pqp, deem uma rápida olhada noque dá pra criar:



    Isso é um GIF de um sistema que eu to tentando fazer desde novembro de 2014 e que agora eu finalmente consegui terminar graças à genialidade desse mito. Trata-se de uma talkaction que vc digita !Lugarquevcquerir e o personagem vai andando automaticamente até o local e quando chega ele manda uma msg avisando que vc chegou ao destino, semelhante a um GPS!!!!!11111
    Fora que com isso podemos controlar os movimentos do NPCS!!!!111 Dá pra fazer uma fucking quest que vc tem que seguir o npc até um altar secreto e seilá, ele é um npc normal que vende backpack/rope/shovel mas qnd dá 18h de um certo dia ele visita a tumba e volta pra cidade (e vc tem que seguir ele pra descobrir isso). SUCH RPG!!!!!
    Sei lá, eu animei demais com isso >.<     
    As possibilidades são tantas que eu não consigo nem me conter AUHIEUHIUHI dá pra fazer MUITA coisa cara, inclusive vou tentar trazer os scripts relacionados à essa função pra vocês.

    Se você gostou das idéias, sério, não clica em gostei no meu tópico, vai lá no tópico do elwyn e clica... ele é o verdadeiro mito que resolveu isso.


     
  22. Gostei
    Alienbear deu reputação a xBen em Ajuda em Magias Novas   
    @Alienbear já estou terminando, na de heal coloquei pra healar 20% do health

    local config = {
    soul = soul necessaria para usar a spell
    percent = porcentagem de health que vai healar
    effect = efeito que ira aparecer ao utilizar
    }
     
    heal_party
    function onCastSpell(cid, var) local config = { soul = 10, percent = 20, effect = 12, } if getPlayerSoul(cid) >= config.soul then if isInParty(cid) == true then for _, party in ipairs(getPartyMembers(cid)) do local health = math.ceil(getCreatureMaxHealth(party) * (config.percent / 100)) if getDistanceBetween(getThingPos(cid), getThingPos(party)) <= 4 then doSendMagicEffect(getThingPos(party), config.effect) doCreatureAddHealth(party, health) doPlayerAddSoul(cid, -config.soul) else doPlayerAddSoul(cid, -config.soul) doSendMagicEffect(getThingPos(cid), config.effect) doCreatureAddHealth(cid, health) end end else doPlayerSendCancel(cid, "you need in party to use this spell.") end else doPlayerSendCancel(cid, "don't have soul.") end return true end haste_party
     
    local condition = createConditionObject(CONDITION_HASTE) setConditionParam(condition, CONDITION_PARAM_TICKS, 22000) setConditionFormula(condition, 0.7, -56, 0.7, -56) function onCastSpell(cid, var) local config = { soul = 10, effect = 14, } if getPlayerSoul(cid) >= config.soul then if isInParty(cid) == true then for _, party in ipairs(getPartyMembers(cid)) do if getDistanceBetween(getThingPos(cid), getThingPos(party)) <= 5 then doSendMagicEffect(getThingPos(party), config.effect) doAddCondition(party, condition) doPlayerAddSoul(cid, -config.soul) else doPlayerAddSoul(cid, -config.soul) doSendMagicEffect(getThingPos(cid), config.effect) doAddCondition(cid, condition) end end else doPlayerSendCancel(cid, "you need in party to use this spell.") end else doPlayerSendCancel(cid, "don't have soul.") end return true end buff_party

     
    local condition = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(condition, CONDITION_PARAM_TICKS, 3000) setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, 15) function onCastSpell(cid, var) local config = { soul = 10, effect = 13, } if getPlayerSoul(cid) >= config.soul then if isInParty(cid) == true then for _, party in ipairs(getPartyMembers(cid)) do if getDistanceBetween(getThingPos(cid), getThingPos(party)) <= 3 then doSendMagicEffect(getThingPos(party), config.effect) doAddCondition(party, condition) doPlayerAddSoul(cid, -config.soul) else doPlayerAddSoul(cid, -config.soul) doSendMagicEffect(getThingPos(cid), config.effect) doAddCondition(cid, condition) end end else doPlayerSendCancel(cid, "you need in party to use this spell.") end else doPlayerSendCancel(cid, "don't have soul.") end return true end se ajudei rep+ , foi interessante fazer essas spells rs

    EDIT - não tinha visto a 4 e.e, vou fazer um minuto.

    Bom a 4 spell fiz por talkaction era o unico modo lembrando que só funciona (talkaction "parametro) se tu usar (talkaction parametro) não vai achar o jogador

    crie uma talkaction e coloque esse script

    4° spell
    function onSay(cid, words, param) local config = { percent = 60, -- % que o usuario irá perder de vida storage = 5890, -- storage usada effect = 13, -- efeito time = 5, -- tempo que o parceiro ira ficar protegido // segundos soul = 30, exaust = 10 -- tempo que o usuario ira poder usar de novo a spell } local health = math.ceil(getCreatureMaxHealth(cid) * (config.percent / 100)) local pos = getThingPos(cid) local t = string.explode(param, '"') if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local pid = getPlayerByNameWildcard(t[2]) if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end if(t[2]) then if(getPlayerStorageValue(cid, config.exaust) > os.time() and getPlayerStorageValue(cid, config.exaust) < 100+os.time()) then return doPlayerSendTextMessage(cid, 24, "You are exausted.") else if getPlayerSoul(cid) >= config.soul then doCreatureAddHealth(cid, -health) setPlayerStorageValue(pid, config.storage, os.time() + config.time) setPlayerStorageValue(cid, config.exaust, os.time() + config.exaust) doPlayerSendCancel(pid, ""..getPlayerName(cid).." bless you.") doSendMagicEffect(getThingPos(pid), 14) doPlayerAddSoul(cid, -config.soul) else doPlayerSendCancel(cid, "You don't have soul.") end end end return true end depois vá em creaturescript crie um arquivo .lua e renomeie para protect.lua e adicione esse script

     
    function onStatsChange(cid, attacker, type, combat, value) if isPlayer(cid) and type == STATSCHANGE_HEALTHLOSS and getPlayerStorageValue(cid, 5890) > os.time() then doSendMagicEffect(getThingPos(cid), 12) doSendAnimatedText(getThingPos(cid), "Protect ["..value.."]", COLOR_WHITE) return false else return true end return true end function onLogin(cid) registerCreatureEvent(cid, "protect") setPlayerStorageValue(cid, 5890, 0) return true end  depois adicione as tag no creaturescripts.xml
     
        <event type="statschange" name="protect" event="script" value="protect.lua"/>     <event type="login" name="registerProtect" event="script" value="protect.lua"/>
  23. Gostei
    Alienbear deu reputação a xWhiteWolf em (Resolvido)problema com tabelas   
    qnd falar !entrar seta um storage no player e coloca um onLogin pra se o storage for diferente de 0 setar pra 0 no caso deles falarem !entrar e sairem do server. Feito isso vc cria um método (função) getEventPlayers que vai retornar a tabela de todos os players online cujo storage seja 1.
    local function getEventPlayers() local players = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerStorageValue(pid, storagequalquer) == 1 then  table.insert(players, pid) end end return players end simples e fácil, daí vc pode colocar isso numa lib (vai ter que tirar o local) e só chamar essa função sempre que quiser a lista de players.
  24. Gostei
    Alienbear deu reputação a xWhiteWolf em (Resolvido)Como eu faço o Sistema Training igual ao NTO BR   
    local config = { number = 130, --- numero de salas firstPos = {x = 160, y = 54, z = 7}, --- pos da primeira sala (coloque a pos de onde o player irá ficar ao entrar) rangex = 11, --- distancia em X entre cada uma das pos de cada sala rangey = 12 --- distancia em Y entre cada uma das pos de cada sala } function onStepIn(cid, item, position, fromPosition) local room = nil for i = 0, (config.number - 1) do pos = {x = config.firstPos.x + (i * config.rangex), y = config.firstPos.y + (i * config.rangey), z = config.firstPos.z} if isWalkable(pos, true, true, true) then room = pos break end end if room ~= nil then doTeleportThing(cid, room) else doPlayerSendCancel(cid, "All rooms are full") doTeleportThing(cid, fromPosition) doSendMagicEffect(fromPosition, 2) end return true end coloca em movements por actionid/uniqueid e coloca esse action/unique no teleporte. Abraço
  25. Gostei
    Alienbear deu reputação a xWhiteWolf em Taunt   
    Taunt é uma magia bem simples que eu fiz me baseando na New Library, pra magia funcionar no seu servidor você vai precisar ter a New Lib instalada (veja esse tópico http://www.tibiaking.com/forum/topic/46015-new-library-v-10/)

    A magia em si não tira dano, ela apenas provoca um inimigo fazendo ele andar até a sua direção mas ela possui uns efeitos bem legais e acho que vai ser ótima pra um servidor com bastante foco em RPG;

    Aqui tem um pequeno GIF mostrando como a magia funciona.




    Bom, dito isso vamos para o código da spell.. como a função taunt já existe na new lib tudo que vc vai precisar adicionar no script da spell é isso daqui:
    local config = { walks = 4, -- qnts passos ele vai dar delay = 750, -- de qnts em qnts milisegundos ele dá cada passo speed = 100 -- velocidade que ele vai ficar enquanto estiver sob efeito do taunt } function onCastSpell(cid, var) Taunt(cid, variantToNumber(var), config.delay, config.walks) doChangeSpeed(variantToNumber(var), (config.speed - getCreatureBaseSpeed(variantToNumber(var)))) addEvent(function() if isCreature(variantToNumber(var)) then doChangeSpeed(variantToNumber(var), (-config.speed + getCreatureBaseSpeed(variantToNumber(var)))) end end, config.delay * (config.walks + 1)) return true end   
    e você configura ali no 300 que é o tempo em milisegundos entre cada passo e 4 é o número de passos que o monstro/player vai andar na sua direção.

    Agora é só adicionar isso daqui no spells.xml:
    <instant name="TK" words="taunt" lvl="8" mana="35" prem="0" exhaustion="1500" range="4" needtarget="1" needlearn="0" event="script" value="taunt.lua"> </instant> Espero que vocês gostem da spell e façam um bom proveito!

    Edit: Deixei o efeito do taunt mais bonito, espero que tenham gostado
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo