Ir para conteúdo

Vodkart

Héroi
  • Registro em

Tudo que Vodkart postou

  1. Fala galera, não sou de fazer muitos pedidos, mas como não é minha área, preciso de ajuda para montar um banner de restaurante!! Quem puder me ajudar serei eternamente grato, quem for me ajudar só postar aqui que eu chamo por PM/imbox
  2. @poko360 estranho... tenta separar os arquivos do movements, assim roomkick1.lua function onStepIn(cid, item, position, fromPosition) local getP = getPoints(cid) local minutos = 10 -- 10 minutos if not isPlayer(cid) then return true end if getPoints(cid) < 800 then doCreatureSay(cid, "Voce nao possui 800 online coins na sua account.", TALKTYPE_ORANGE_1) doTeleportThing(cid, fromPosition, true) return true end doTeleportThing(cid, {x=56, y=1463, z=7}) doPlayerRemovePoints(cid, 800) setPlayerStorageValue(cid, 982301, 1) setPlayerStorageValue(cid, 982300, os.time()+ minutos*60) doBroadcastMessage("["..getCreatureName(cid).."]: \ Iniciou uma hunt em Nishapur 1 [PVP] \n Gastou: 800x Online coins \n Account balance: [".. getP .."] online coins", 25) doBroadcastMessage("["..getCreatureName(cid).."]: \ Iniciou uma hunt em Nishapur 1 [PVP] \n Gastou: 800x Online coins \n Account balance: [".. getP .."] online coins", MESSAGE_STATUS_CONSOLE_BLUE) return true end roomkick2.lua function onStepOut(cid, item, position, lastPosition, fromPosition) if not isPlayer(cid) then return true end setPlayerStorageValue(cid, 982301, 0) return true end TAG <movevent type="StepIn" actionid="16530" event="script" value="roomkick1.lua"/> <movevent type="StepOut" actionid="16531" event="script" value="roomkick2.lua"/>
  3. function getPlayerLastLogout(cid) local check = db.getResult("SELECT `lastlogout` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) return check:getDataInt("lastlogout") <= 0 and 0 or check:getDataInt("lastlogout") end local time = 30 -- em minutos function onLogin(cid) if getPlayerLastLogout(cid) < os.time() - (time*60) then doPlayerPopupFYI(cid, "\nWelcome to back ") end return true end
  4. local time = 30 -- em minutos local storage = 1054823 function onLogin(cid) if getPlayerStorageValue(cid, storage) ~= -1 and getPlayerStorageValue(cid, storage) < os.time() - (time*60) then doPlayerPopupFYI(cid, "\nWelcome to back ") end return true end function onLogout(cid) setPlayerStorageValue(cid, storage, os.time()) return true end
  5. @subhe as position tem que ser sempre do MENOR para o MAIOR <?xml version="1.0" encoding="UTF-8"?> <mod name="Automatic Raids" version="1.0" author="Vodkart And xotservx" contact="xtibia.com" enabled="yes"> <config name="raids_func"><![CDATA[ days = { ["Monday"] = { ["20:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60}, ["21:30"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60} }, ["Tuesday"] = { ["19:30"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=408, z=11},toPosition = {x=476, y=410, z=11}}, m = {"1 Ghazbaran"}, Time = 60}, ["20:30"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=250, z=14},toPosition = {x=1271, y=256, z=14}}, m = {"1 Morgaroth"}, Time = 60} }, ["Wednesday"] = { ["20:40"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60}, ["21:40"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60} }, ["Thursday"] = { ["21:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=408, z=11},toPosition = {x=476, y=410, z=11}}, m = {"1 Ghazbaran"}, Time = 60}, ["22:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=250, z=14},toPosition = {x=1271, y=256, z=14}}, m = {"1 Morgaroth"}, Time = 60} }, ["Friday"] = { ["19:40"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60}, ["21:20"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60} }, ["Saturday"] = { ["18:00"] = {nome = "Ghazbaran", pos = {fromPosition = {x=473, y=408, z=11},toPosition = {x=476, y=410, z=11}}, m = {"1 Ghazbaran"}, Time = 60}, ["16:00"] = {nome = "Morgaroth", pos = {fromPosition = {x=1266, y=250, z=14},toPosition = {x=1271, y=256, z=14}}, m = {"1 Morgaroth"}, Time = 60} }, ["Sunday"] = { ["15:00"] = {nome = "Orshabaal", pos = {fromPosition = {x=2153, y=2389, z=7},toPosition = {x=2159, y=2392, z=7}},m = {"5 Demon", "1 Orshabaal"}, Time = 60}, ["17:30"] = {nome = "Ferumbras", pos = {fromPosition = {x=518, y=141, z=4},toPosition = {x=519, y=145, z=4}},m = {"5 Demon", "1 Ferumbras"}, Time = 60} } } ]]></config> <globalevent name="AutomaticRaids" interval="60" event="script"><![CDATA[ domodlib('raids_func') function onThink(interval, lastExecution) if days[os.date("%A")] then hours = tostring(os.date("%X")):sub(1, 5) tb = days[os.date("%A")][hours] if tb then function removeCreature(tb) for x = ((tb.pos.fromPosition.x)-10), ((tb.pos.toPosition.x)+10) do for y = ((tb.pos.fromPosition.y)-10), ((tb.pos.toPosition.y)+10) do local m = getTopCreature({x=x, y=y, z= tb.pos.fromPosition.z}).uid if m ~= 0 and isMonster(m) then doRemoveCreature(m) end end end end doBroadcastMessage("The invasion of " .. tb.nome .. " started") for _,x in pairs(tb.m) do for s = 1, tonumber(x:match("%d+")) do pos = {x = math.random(tb.pos.fromPosition.x, tb.pos.toPosition.x), y = math.random(tb.pos.fromPosition.y, tb.pos.toPosition.y), z = tb.pos.fromPosition.z} doSummonCreature(x:match("%s(.+)"), pos) end end addEvent(removeCreature, tb.Time*60*1000, tb) end end return true end ]]></globalevent> </mod> OBS: USA ESSA NOVA VERSÃO SEM BUGS https://tibiaking.com/forums/topic/94479-raid-automatica-mod-raid-automatica-edit-brunds/
  6. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    <globalevent name="ForBossEvent" interval="3600" script="nome do seu csript.lua" /> obs: se o seu servidor for em milesegundos trocar o "3600" por "360000"
  7. ------------- creaturescript roomkick.lua function onLogin(cid) registerCreatureEvent(cid, "RoomKickCheck") return true end function onThink(cid, interval) if getPlayerStorageValue(cid, 982301) > 0 and getPlayerStorageValue(cid, 982300) - os.time() <= 0 then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) setPlayerStorageValue(cid, 982301, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"seu tempo na sala acabou") end return true end TAG <event type="think" name="RoomKickCheck" script="roomkick.lua"/> <event type="login" name="RoomKickLogin" script="roomkick.lua"/>
  8. Se eu não me engano esse código já existe.
  9. Vodkart postou uma resposta no tópico em Suporte Tibia OTServer
    local config = { name = "Shuryu Boss", pos = {x = 60, y = 63, z = 3}, time = 20 } function onThink(interval, lastExecution) doCreateMonster(config.name, config.pos) broadcastMessage("O "..config.name.." apareceu, voce tem "..config.time.." para mata-lo", MESSAGE_STATUS_CONSOLE_ORANGE) addEvent(function() local creature = getCreatureByName(config.name) if creature ~= nil and not isPlayer(creature) then doRemoveCreature(getTopCreature(getCreaturePosition(creature)).uid) end end, config.time*60*1000) return true end
  10. @poko360 como que sai da sala manualmente? é algum comando ou teleporte pra sair da sala?
  11. faz uma função para checar se está na sala ainda, se estiver só jogar pra position inicial(configuravel)
  12. @OfWar Foi mexido? então tente voltar ao original...
  13. vc deu "oi" ou "hi" ? aqui funcionou de boa:
  14. Craft.xml <?xml version="1.0"?> <npc name="Craft" script="data/npc/scripts/craft.lua" walkinterval="50000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. I can craft some {items} for you, but I need specific items to do them." /> </parameters> </npc> craft.lua function getItemsFromList(items) local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end function doRemoveItemsFromList(cid,items) local count = 0 if table.maxn(items) > 0 then for i = 1, table.maxn(items) do if getPlayerItemCount(cid,items[i][1]) >= items[i][2] then count = count + 1 end end end if count == table.maxn(items) then for i = 1, table.maxn(items) do doPlayerRemoveItem(cid,items[i][1],items[i][2]) end else return false end return true end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower() local craft = { ["demon helmet"] = {reward = {{2493, 1}}, items = {{2173,1}, {8925,2}}}, ["magic plate armor"] = {reward = {{2472, 1}}, items = {{2173,1}, {2160,10}, {2493,2}}} } if isInArray({"item","craft","itens","items", "iten"}, msg) then local text = "" for i, v in pairs(craft) do text = text .. " {"..i.."}, " end npcHandler:say("I can make " .. text .. " which one do you want?", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then ret = craft[msg] if not ret then npcHandler:say("I am not crafting this item, perhaps I can consider your order later.", cid) return true end npcHandler:say("Oh, " .. msg .. " is a good choice. Let me see... I need " .. getItemsFromList(ret.items) .. ", do you have it?" , cid) talkState[talkUser] = 2 elseif talkState[talkUser] == 2 and isInArray({"yes","yeah","sim","si"}, msg) then if not doRemoveItemsFromList(cid, ret.items) then talkState[talkUser] = 0 npcHandler:say("Sorry, but you don't have the items that I need.", cid) return true end for _, i_i in ipairs(ret.reward) do local item, amount = i_i[1], i_i[2] if isItemStackable(item) or amount == 1 then doPlayerAddItem(cid, item, amount) else for i = 1, amount do doPlayerAddItem(cid, item, 1) end end end talkState[talkUser] = 0 doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) npcHandler:say("Thank you very much! Here is your item as I promised.", cid) return true elseif msg == "no" then selfSay("Ok... Bye!! Maybe on the next.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  15. @OfWar vou refazer esse npc ai e te mando, precisa do delay e tal? ou quer somente npc de troca na hora?
  16. @subhe troca essa parte if isInArray({"task","tasks","missao","mission"}, msg) then npcHandler:say("Me diga o nome do monstro que você deseja fazer a task!", cid) talkState[talkUser] = 1 por if isInArray({"task","tasks","missao","mission"}, msg) then local str = "" for a , b in pairs(tasktabble) do str = str .. " {" .. a .."}," end npcHandler:say("Lista de tasks:"..str.." Qual deseja fazer?", cid) talkState[talkUser] = 1
  17. @OfWar coloca para o jogador nao poder andar durante o craft. doCreatureSetNoMove(cid, true) addEvent(function() if isPlayer(cid) then for i = 1, #x.reward do doPlayerAddItem(cid, x.reward[1], x.reward[2]) end doCreatureSetNoMove(cid, false) end end, delay*1000)
  18. @subhe <?xml version="1.0" encoding="UTF-8"?> <mod name="Stones_Event Items" enabled="yes"> <config name="Stones_config"><![CDATA[ names = {'earth stone', 'icy stone', 'fire stone', 'wind stone'} stones_name = { [1] = {name="Earth Stone"}, [2] = {name="Icy Stone"}, [3] = {name="Fire Stone"}, [4] = {name="Wind Stone"} } pos = { {x=95, y=57, z=7}, {x=103, y=57, z=7}, {x=90, y=58, z=7}, {x=80, y=58, z=7} } days = {['Tuesday'] = {'05:29:00'}, ['Sunday'] = {'03:46:20'} } stones = { ["earth stone"] = { [90] = {m = {'carniphila','earth elemental','bog raider'}, n = {6, 7}}, [80] = {m = {'bog raider','earth elemental'}, n = {6, 7}}, [70] = {m = {'giant spider','bog raider'}, n = {6, 7}}, [60] = {m = {'hydra','lich','giant spider','bog raider'}, n = {6, 7}}, [50] = {m = {'hydra','bog raider','serpent spawn'}, n = {6, 7}}, [40] = {m = {'hydra','defiler','serpent spawn'}, n = {6, 7}}, [30] = {m = {'medusa','hydra','serpent spawn','defiler'}, n = {6, 7}}, [20] = {m = {'medusa','lost soul','hydra','serpent spawn'}, n = {6, 7}}, [10] = {m = {'juggernaut','son of verminor','medusa'}, n = {5, 6}}, [1] = {m = {'medusa','juggernaut'}, n = {5,7}} }, ["icy stone"] = { [90] = {m = {'ice golem','frost dragon'}, n = {6, 7}}, [80] = {m = {'frost dragon','frost dragon hatchling'}, n = {6, 7}}, [70] = {m = {'frost dragon','crystal spider'}, n = {6, 7}}, [60] = {m = {'frost dragon','crystal spider'}, n = {7, 7}}, [50] = {m = {'frost dragon','crystal spider'}, n = {7, 7}}, [40] = {m = {'frost dragon'}, n = {7, 7}}, [30] = {m = {'frost dragon'}, n = {7, 8}}, [20] = {m = {'frost dragon'}, n = {7, 8}}, [10] = {m = {'yeti','frost dragon'}, n = {5, 7}}, [1] = {m = {'yeti'}, n = {2,3}} }, ["fire stone"] = { [90] = {m = {'fire elemental','dragon','dragon lord',' dragon lord hatchling'}, n = {6, 7}}, [80] = {m = {'dragon lord hatchling','dragon lord'}, n = {6, 7}}, [70] = {m = {'dragon lord','diabolic imp'}, n = {6, 7}}, [60] = {m = {'dragon lord','diabolic imp'}, n = {6, 7}}, [50] = {m = {'dragon lord','demodras','diabolic imp'}, n = {6, 7}}, [40] = {m = {'dragon lord','diabolic imp','hellfire fighter'}, n = {5, 7}}, [30] = {m = {'diabolic imp','hellfire fighter','demon'}, n = {6, 7}}, [20] = {m = {'hellfire fighter','demon'}, n = {5, 6}}, [10] = {m = {'demon','hellhound'}, n = {5, 5}}, [1] = {m = {'demon'}, n = {5,5}} }, ["wind stone"] = { [90] = {m = {'gargoyle','stone golem','black knight'}, n = {6, 7}}, [80] = {m = {'black knight','behemoth'}, n = {5, 7}}, [70] = {m = {'black knight','behemoth'}, n = {6, 7}}, [60] = {m = {'behemoth','destroyer'}, n = {6, 7}}, [50] = {m = {'behemoth','destroyer','betrayed wraith'}, n = {6, 7}}, [40] = {m = {'behemoth','destroyer','betrayed wraith'}, n = {6, 7}}, [30] = {m = {'dark torturer','betrayed wraith'}, n = {3, 5}}, [20] = {m = {'dark torturer','grim reaper'}, n = {5, 6}}, [10] = {m = {'blightwalker','undead dragon','grim reaper'}, n = {5, 6}}, [1] = {m = {'undead dragon'}, n = {5,5}} } } function getPercent(number, all) return (number / all) * 100 end function choose(arg) return arg[math.random(#arg)] end ]]></config> <event type="combat" name="Kamulec" event="script"><![CDATA[ domodlib("Stones_config") function onCombat(cid, target) if isMonster(target) then registerCreatureEvent(target, 'Kamulec') end local t = getPercent(getCreatureHealth(target), getCreatureMaxHealth(target)) if isMonster(target) and isInArray(names, getCreatureName(target):lower()) then if t > 90 then doCreatureSetStorage(target, 1000, 91) end for k, v in pairs(stones[getCreatureName(target):lower()]) do if k >= t and getCreatureStorage(target, 1000) > k then local pos = getThingPos(target) for i = 1, math.random(v.n[1], v.n[2]) do local s = {x=pos.x,y=pos.y,z=pos.z} s.x = pos.x + math.random(-2,2) s.y = pos.y + math.random(-2,2) doCreateMonster(choose(v.m), pos, false, false, false) end return doCreatureSetStorage(target, 1000, k) end end end return TRUE end ]]></event> <talkaction log="yes" words="!metin" access="4" event="script"> <![CDATA[ domodlib("Stones_config") function onSay(cid,words,param,channel) local monst = stones_name[math.random(1, #stones_name)] local poss = pos[math.random(1, #pos)] doCreateMonster(monst.name,poss) doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22) return true end ]]> </talkaction> <globalevent name="metinStoneStart" interval="1000" event="script"><![CDATA[ domodlib("Stones_config") local daysOpen = {} local monst = stones_name[math.random(1, #stones_name)] local poss = pos[math.random(1, #pos)] for k, v in pairs(days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(days[os.date('%A')], os.date('%X', os.time())) then doCreateMonster(monst.name,poss) doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22) end end return true end ]]></globalevent> <event type="login" name="metinStoneLogin" event="buffer"><![CDATA[ registerCreatureEvent(cid, 'Kamulec') ]]></event> </mod>
  19. deleta essa parte de todos os monstros: <script> <event name="metinStoneCombat"/> </script> outra coisa, no tópico la do cara só tinha 3 monstros, não tinha o Wind Stone, você criou ele? names = {'earth stone', 'icy stone', 'fire stone', 'wind stone'}
  20. @subhe pode me passar o link do evento todo? alem desse mods? monstros, etc...
  21. @subhe isso não é do MODS, deve ter algum bug no seu distro, mal compilado, etc...
  22. <?xml version="1.0" encoding="UTF-8"?> <mod name="Stones_Event Items" enabled="yes"> <config name="Stones_config"><![CDATA[ names = {'earth stone', 'icy stone', 'fire stone', 'wind stone'} stones_name = { [1] = {name="Earth Stone"}, [2] = {name="Icy Stone"}, [3] = {name="Fire Stone"}, [4] = {name="Wind Stone"} } pos = { [1] = {{x=95, y=57, z=7}}, [2] = {{x=103, y=57, z=7}}, [3] = {{x=90, y=58, z=7}}, [4] = {{x=80, y=58, z=7}} } days = {['Tuesday'] = {'05:29:00'}, ['Sunday'] = {'03:46:20'} } stones = { ["earth stone"] = { [90] = {m = {'carniphila','earth elemental','bog raider'}, n = {6, 7}}, [80] = {m = {'bog raider','earth elemental'}, n = {6, 7}}, [70] = {m = {'giant spider','bog raider'}, n = {6, 7}}, [60] = {m = {'hydra','lich','giant spider','bog raider'}, n = {6, 7}}, [50] = {m = {'hydra','bog raider','serpent spawn'}, n = {6, 7}}, [40] = {m = {'hydra','defiler','serpent spawn'}, n = {6, 7}}, [30] = {m = {'medusa','hydra','serpent spawn','defiler'}, n = {6, 7}}, [20] = {m = {'medusa','lost soul','hydra','serpent spawn'}, n = {6, 7}}, [10] = {m = {'juggernaut','son of verminor','medusa'}, n = {5, 6}}, [1] = {m = {'medusa','juggernaut'}, n = {5,7}} }, ["icy stone"] = { [90] = {m = {'ice golem','frost dragon'}, n = {6, 7}}, [80] = {m = {'frost dragon','frost dragon hatchling'}, n = {6, 7}}, [70] = {m = {'frost dragon','crystal spider'}, n = {6, 7}}, [60] = {m = {'frost dragon','crystal spider'}, n = {7, 7}}, [50] = {m = {'frost dragon','crystal spider'}, n = {7, 7}}, [40] = {m = {'frost dragon'}, n = {7, 7}}, [30] = {m = {'frost dragon'}, n = {7, 8}}, [20] = {m = {'frost dragon'}, n = {7, 8}}, [10] = {m = {'yeti','frost dragon'}, n = {5, 7}}, [1] = {m = {'yeti'}, n = {2,3}} }, ["fire stone"] = { [90] = {m = {'fire elemental','dragon','dragon lord',' dragon lord hatchling'}, n = {6, 7}}, [80] = {m = {'dragon lord hatchling','dragon lord'}, n = {6, 7}}, [70] = {m = {'dragon lord','diabolic imp'}, n = {6, 7}}, [60] = {m = {'dragon lord','diabolic imp'}, n = {6, 7}}, [50] = {m = {'dragon lord','demodras','diabolic imp'}, n = {6, 7}}, [40] = {m = {'dragon lord','diabolic imp','hellfire fighter'}, n = {5, 7}}, [30] = {m = {'diabolic imp','hellfire fighter','demon'}, n = {6, 7}}, [20] = {m = {'hellfire fighter','demon'}, n = {5, 6}}, [10] = {m = {'demon','hellhound'}, n = {5, 5}}, [1] = {m = {'demon'}, n = {5,5}} }, ["wind stone"] = { [90] = {m = {'gargoyle','stone golem','black knight'}, n = {6, 7}}, [80] = {m = {'black knight','behemoth'}, n = {5, 7}}, [70] = {m = {'black knight','behemoth'}, n = {6, 7}}, [60] = {m = {'behemoth','destroyer'}, n = {6, 7}}, [50] = {m = {'behemoth','destroyer','betrayed wraith'}, n = {6, 7}}, [40] = {m = {'behemoth','destroyer','betrayed wraith'}, n = {6, 7}}, [30] = {m = {'dark torturer','betrayed wraith'}, n = {3, 5}}, [20] = {m = {'dark torturer','grim reaper'}, n = {5, 6}}, [10] = {m = {'blightwalker','undead dragon','grim reaper'}, n = {5, 6}}, [1] = {m = {'undead dragon'}, n = {5,5}} } } function getPercent(number, all) return (number / all) * 100 end function choose(arg) return arg[math.random(#arg)] end ]]></config> <event type="combat" name="Kamulec" event="script"><![CDATA[ domodlib("Stones_config") function onCombat(cid, target) if isMonster(target) then registerCreatureEvent(target, 'Kamulec') end local t = getPercent(getCreatureHealth(target), getCreatureMaxHealth(target)) if isMonster(target) and isInArray(names, getCreatureName(target):lower()) then if t > 90 then doCreatureSetStorage(target, 1000, 91) end for k, v in pairs(stones[getCreatureName(target):lower()]) do if k >= t and getCreatureStorage(target, 1000) > k then local pos = getThingPos(target) for i = 1, math.random(v.n[1], v.n[2]) do local s = {x=pos.x,y=pos.y,z=pos.z} s.x = pos.x + math.random(-2,2) s.y = pos.y + math.random(-2,2) doCreateMonster(choose(v.m), pos, false, false, false) end return doCreatureSetStorage(target, 1000, k) end end end return TRUE end ]]></event> <talkaction log="yes" words="!metin" access="4" event="script"> <![CDATA[ domodlib("Stones_config") function onSay() local monst = stones_name[math.random(1, #stones_name)] local poss = pos[math.random(1, #pos)] print(monst, poss) if not(monst) then return TRUE end doCreateMonster(monst.name,poss.pos) doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22) return TRUE end ]]> </talkaction> <globalevent name="metinStoneStart" interval="1000" event="script"><![CDATA[ domodlib("Stones_config") local daysOpen = {} local monst = stones_name[math.random(1, #stones_name)] local poss = pos[math.random(1, #pos)] for k, v in pairs(days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(days[os.date('%A')], os.date('%X', os.time())) then print(monst, poss) if not(monst) then return TRUE end doCreateMonster(monst.name,poss.pos) doBroadcastMessage('[Event Stones]\n '.. monst.name ..' have been spawn. Find and defeat it!', 22) end end return true end ]]></globalevent> <event type="login" name="metinStoneLogin" event="buffer"><![CDATA[ registerCreatureEvent(cid, 'Kamulec') ]]></event> </mod>
  23. @OfWar Verdade, esqueci de adicionar a linha. local storage, minutos = 48748, 10 -- 10 minutos local lvl = 130 local t = { {vocations = {1, 5}, Pos = {{x=1127, y=1155, z=6},{x=1114, y=1142, z=8}}}, --primeira pos é onde o jogador tem que estar e a segunda para onde ele vai ser teleportado {vocations = {2, 6}, Pos = {{x=1123, y=1157, z=6},{x=1114, y=1142, z=8}}}, {vocations = {3, 7}, Pos = {{x=1117, y=1150, z=6},{x=1114, y=1142, z=8}}}, {vocations = {4, 8}, Pos = {{x=1123, y=1147, z=6},{x=1114, y=1142, z=8}}} } function doTeleportTimer(pos, seconds) doSendAnimatedText(pos, seconds, 145) if seconds ~= 1 then addEvent(doTeleportTimer, 1000, pos, seconds-1) end end function onUse(cid, item, fromPosition, itemEx, toPosition) if getGlobalStorageValue(storage) - os.time() > 0 then doPlayerSendTextMessage(cid, 25, "Você não pode usar a alavanca agora.") return true end local check = {} for _, k in ipairs(t) do local x = getTopCreature(k.Pos[1]).uid if x == 0 or not isPlayer(x) then doPlayerSendCancel(cid, 'Não há jogadores suficientes.') return true elseif not isInArray(k.vocations, getPlayerVocation(x)) then doPlayerSendCancel(cid, 'Todos os jogadores devem estar em seus respectivos pisos!') return true elseif getPlayerLevel(x) < lvl then doPlayerSendCancel(cid, 'Todos os players devem ser level ' .. lvl .. ' ou maior.') return true end table.insert(check, x) end for k, tid in ipairs(check) do doSendMagicEffect(getCreaturePosition(tid), CONST_ME_POFF) doTeleportThing(tid, t[k].Pos[2]) doSendMagicEffect(getCreaturePosition(tid), CONST_ME_TELEPORT) end setGlobalStorageValue(storage, os.time() + minutos*60) doTeleportTimer(toPosition, minutos*60) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
  24. ------------------ local storage, minutos = 48748, 10 -- 10 minutos local lvl = 130 local t = { {vocations = {1, 5}, Pos = {{x=1127, y=1155, z=6},{x=1114, y=1142, z=8}}}, --primeira pos é onde o jogador tem que estar e a segunda para onde ele vai ser teleportado {vocations = {2, 6}, Pos = {{x=1123, y=1157, z=6},{x=1114, y=1142, z=8}}}, {vocations = {3, 7}, Pos = {{x=1117, y=1150, z=6},{x=1114, y=1142, z=8}}}, {vocations = {4, 8}, Pos = {{x=1123, y=1147, z=6},{x=1114, y=1142, z=8}}} } function convertTime(minutes,seconds) local hours = 0 repeat if seconds >= 60 then minutes = minutes + 1; seconds = seconds - 60 elseif minutes >= 60 then hours = hours + 1; minutes = minutes - 60 end until seconds < 60 and minutes < 60 return {hours = hours, seconds = seconds, minutes = minutes} end function doTeleportTimer(pos, seconds) local t = convertTime(0, seconds) doSendAnimatedText(pos, t.minutes > 0 and t.minutes..":"..t.seconds or t.seconds, 145) if seconds ~= 1 then addEvent(doTeleportTimer, 1000, pos, seconds-1) end end function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} for _, k in ipairs(t) do local x = getTopCreature(k.Pos[1]).uid if x == 0 or not isPlayer(x) then doPlayerSendCancel(cid, 'Não há jogadores suficientes.') return true elseif not isInArray(k.vocations, getPlayerVocation(x)) then doPlayerSendCancel(cid, 'Todos os jogadores devem estar em seus respectivos pisos!') return true elseif getPlayerLevel(x) < lvl then doPlayerSendCancel(cid, 'Todos os players devem ser level ' .. lvl .. ' ou maior.') return true end table.insert(check, x) end for k, tid in ipairs(check) do doSendMagicEffect(getCreaturePosition(tid), CONST_ME_POFF) doTeleportThing(tid, t[k].Pos[2]) doSendMagicEffect(getCreaturePosition(tid), CONST_ME_TELEPORT) end setGlobalStorageValue(storage, os.time() + minutos*60) doTeleportTimer(toPosition, minutos*60) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
  25. @OfWar mas não é da função que eu coloquei não, está dando erro na hora de teleportar os jogadores. na verdade eu vou refazer esse código ai que está bem feio e já te mando assim que tiver tempo kk

Informação Importante

Confirmação de Termo