Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. Mas depois que clicar neste seu "boxevent" o que acontece? ele é teleportado da sala? porque se ele clicar neste box, poderá ficar na área por tempo indeterminado? porque se fosse o caso você poderia usar neste script essas linhas local function DoKickPlayerFromArea(cid) local exit = {x = 154, y = 160, z = 7} if not isCreature(cid) then return LUA_ERROR end if getPlayerStorageValue(cid, 209308) <= 0 then doTeleportThing(cid, exit) end return true end addEvent(DoKickPlayerFromArea, 5000, cid) -- e no script do box vc adicionaria esta linha por exemplo setPlayerStorageValue(cid, 209308, 1) enfim, só um esboço... não entendi muito bem esse evento.
  2. Não achou a lib! No tfs 1.3 já tem a pasta Lib? se tiver, não precisa colocar no "core", joga direto lá!
  3. ---------- CONFIGURE AQUI ---------- local tempo = 5 -- (1 = 1 minuto) Tempo que o script durará local expinicial = 2 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server. local expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal. local itemId = 7440 -- Aqui vai o ID do ITEM local texto = "Você receberá " .. expinicial .. "x de xp durante " .. tempo .. " minuto(s)" -- Texto que irá receber ao usar a potion. local textofinal = "Fim do efeito da potion." -- Texto que irá receber quando o efeito da potion acabar. local storage = 171717 -- Storage local level = 8 -- LEVEL para usar o item local rates = getPlayerRates(cid) ---------- FIM DA CONFIGURAÇÃO NÃO ALTERE NADA A BAIXO DISSO ------------- function onUse(cid, item, frompos, item2, topos) tempo = tempo*60*1000 if rates[SKILL__LEVEL] > 1 then rates = rates[SKILL__LEVEL] + expinicial else rates = (rates[SKILL__LEVEL] + expinicial) - 1 end if getPlayerLevel(cid) >= level then if getPlayerStorageValue(cid, storage) <= 0 then if item.itemid == itemId then doRemoveItem(item.uid,1) doPlayerSetExperienceRate(cid,rates) doSendMagicEffect(frompos,13) doPlayerSendTextMessage(cid,22,texto) addEvent(potion,tempo,cid) setPlayerStorageValue(uid, storage, 1) end else doPlayerSendCancel(cid, "Você já está sob efeito desse item.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Você não tem level suficiente, precisa ser level 1500.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end function potion(pos, cid) if not isCreature(cid) then return LUA_ERROR end if (rates - expinicial) >= 1 then doPlayerSetExperienceRate(pos,rates - expinicial) elseif (rates - expinicial) < 1 then doPlayerSetExperienceRate(pos,expfinal) end setPlayerStorageValue(uid, storage, 0) doPlayerSendTextMessage(pos,22,textofinal) doPlayerSendTextMessage(cid,22,"Bônus de xp: " .. rates .. "x") stopEvent(potion) end
  4. @Gnius @Gnius então tente usar return false ja que é uma action if getPlayerStorageValue(cid, 23233) - os.time() > 0 then doPlayerSendCancel(cid, "Voce nao pode usar um pokemon enquanto estiver com o guardiam") return false end
  5. if getPlayerStorageValue(cid, 23233) - os.time() > 0 then doPlayerSendCancel(cid, "Voce nao pode usar um pokemon enquanto estiver com o guardiam") return true end
  6. O certo é assim: o começo é o "from" e o final é o "to"
  7. @Zazeros Que estanho! <event type="PrepareDeath" name="noDeathArea" event="script" value="event12.lua"/> registerCreatureEvent(cid, "noDeathArea") colocou o registro antes do último "return true" né?
  8. @Zazeros O correto na função isInRange é sempre do MENOR pro MAIOR, tanto X, Y ou Z. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local from, to = {x = 1024, y = 998, z = 7},{x = 1414, y = 1008, z = 7} local pos = {x = 1044, y = 1026, z = 7} if isPlayer(cid) and isInRange(getCreaturePosition(cid), from, to) then doTeleportThing(cid, pos) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveConditions(cid, false) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Teste 3") return false end return true end
  9. Certo, posso ver como ficou seu script?
  10. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local from, to = {x = 256, y = 180, z = 7},{x = 360, y = 200, z = 7} local pos = {x = 154, y = 68, z = 7} if isPlayer(cid) and isInRange(getCreaturePosition(cid), from, to) then doTeleportThing(cid, pos) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doRemoveConditions(cid, false) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "sua mensagem.") return false end return true end
  11. Na próxima usa "isInArray" ao invés de "table.contains"
  12. Ideia bacana!! Coloca para fazer a marcação no mapa de onde estiverem os itens,,, e tbm dá para usar tabelas no código... Abraços.
  13. usa este: https://pastebin.com/raw/n81zm0H8
  14. se não me engano é problema no MODS, me manda ele ai...
  15. https://tibiaking.com/forums/topic/77212-86-talkactions-find-item/
  16. @tetheuscunha @Emanueldk vocês pode usar assim para bloquear areas que nao podera usar o teleporte:
  17. Instale o monstro que está no tópico no seu OT, diz que não está encontrando ele!
  18. vc copiou algo a mais, deve ter sido isso.. aqui está: https://pastebin.com/raw/hVCv9A9m
  19. https://tibiaking.com/files/file/47-86-exclusive-cave-system-by-account/
  20. https://tibiaking.com/forums/topic/12122-talk-comando-mutedesmute/
  21. function isWalkable(pos) -- by Nord / editado por Omega if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false elseif isCreature(getTopCreature(pos).uid) then return false elseif getTileInfo(pos).protection then return false elseif hasProperty(getThingFromPos(pos).uid, 3) or hasProperty(getThingFromPos(pos).uid, 7) then return false end return true end local positions = { [1] = {x=164,y=57,z=7}, [2] = {x=176,y=39,z=7}, [3] = {x=169,y=40,z=7}, [4] = {x=156,y=57,z=7}, [5] = {x=139,y=41,z=7}, [6] = {x=173,y=57,z=7}, [7] = {x=161,y=32,z=7}, [8] = {x=138,y=60,z=7}, [9] = {x=179,y=59,z=7}, [10] = {x=132,y=23,z=7}, [11] = {x=173,y=33,z=7}, [12] = {x=178,y=27,z=7}, [13] = {x=181,y=22,z=7}, [14] = {x=197,y=39,z=7}, [15] = {x=208,y=40,z=7}, [16] = {x=208,y=50,z=7}, [17] = {x=204,y=62,z=7}, [18] = {x=194,y=57,z=7}, [19] = {x=178,y=67,z=7}, [20] = {x=104,y=61,z=7}, [21] = {x=102,y=54,z=7}, [22] = {x=103,y=46,z=7}, [23] = {x=153,y=61,z=7}, [24] = {x=96,y=41,z=7}, [25] = {x=83,y=39,z=7}, [26] = {x=110,y=34,z=7}, [27] = {x=132,y=47,z=7}, [28] = {x=138,y=54,z=7} } function onUse(cid, item, frompos, item2, topos) print("itemUID:" .. item.uid) doBroadcastMessage("[AVISO] A cidade foi invadida por Monstros, venha proteger a cidade!") local monsterName if item.uid == 19000 then monsterName = 'Pha?ntom Lord' elseif item.uid == 19001 then monsterName = 'Finger Killer' elseif item.uid == 19002 then monsterName = 'Brimstone Bug' elseif item.uid == 19003 then monsterName = 'Green Phantom' end print("creature Name:" .. monsterName) for i = 1, #positions do if isWalkable(positions[i]) then doCreateMonster(monsterName, positions[i]) end end return true end
  22. function onLogin(cid) registerCreatureEvent(cid, "EffectOutLogin") registerCreatureEvent(cid, "OutfitEffects") return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}) end local events = {} function onOutfit(cid, old, current) local effect = {[897] = 6} -- looktype and effect local o, c= effect[old.lookType],effect[current.lookType] if getPlayerAccess(cid) > 2 then return true elseif (not o or not c) then stopEvent(events[getPlayerGUID(cid)]) end if c then function WalkEffect(cid, c, pos) if not isCreature(cid) then return LUA_ERROR end if c then frompos = getThingPos(cid) if frompos.x ~= pos.x or frompos.y ~= pos.y or frompos.z ~= pos.z then doSendMagicEffect(frompos, c) end events[getPlayerGUID(cid)] = addEvent(WalkEffect, 100, cid, c, frompos) end return true end WalkEffect(cid, c, {x=0, y=0, z=0}) end return true end TAG <event type="login" name="EffectOutLogin" event="script" value="nome do seu script.lua"/> <event type="outfit" name="OutfitEffects" event="script" value="nome do seu script.lua"/>
  23. local starterpokes = { ["Bulbasaur"] = {x = 972, y = 1028, z = 6}, ["Charmander"] = {x = 974, y = 1028, z = 6}, ["Squirtle"] = {x = 976, y = 1028, z = 6}, } local btype = "ultra" function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) > 8 then return true end local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then print("Nenhum pokemon") return true end doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.") doPlayerSendTextMessage(cid, 27, "Don't forget to use your pokedex on every undiscovered pokemon!") addPokeToPlayer(cid, pokemon, 0, nil, btype) doPlayerAddItem(cid, 2392, 40) doPlayerAddItem(cid, 2160, 5) doPlayerAddItem(cid, 12344, 10) doPlayerAddItem(cid, 11638, 1) doPlayerAddLevel(cid, 0) doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 27) doSendMagicEffect(getThingPos(cid), 29) return true end ve se retorna alguma mensagem no distro...

Informação Importante

Confirmação de Termo