Ir para conteúdo

MaXwEllDeN

Héroi
  • Registro em

  • Última visita

Tudo que MaXwEllDeN postou

  1. MaXwEllDeN postou uma resposta no tópico em Suporte Tibia OTServer
    Passa o script que você tá usando. Esse que dava o erro da imagem.
  2. MaXwEllDeN postou uma resposta no tópico em Suporte Tibia OTServer
    time não é uma função, mas a variável com identificador time, que está dentro da tabela os, sim, é uma função. E independente de já existir algum valor, no caso uma função, o valor dela pode sem problemas ser redefinido. O erro, estava acontecendo por causa desse trecho aqui do script: getPlayerStorageValue(cid, storage) - os.time Onde ele tentava subtrair a função os.time, de um valor numérico, essa operação é impossível. Código revisado: local config = { wait_time = 5, -- Tempo para usar novamente[Em minutos] storage = 91831, } function onUse(cid, item, frompos, item2, topos) if os.time() - getPlayerStorageValue(cid, config.storage) < config.wait_time * 60 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Aguarde 5 minutos para usar novamente.") end if getPlayerLevel(cid) < 500 then return doPlayerSendCancel(cid, "Você precisa estar no mínimo no level 500 para usar esse item.") end if doPlayerRemoveMoney(cid, 500000) then doSendMagicEffect(topos, 14) doPlayerSay(cid, "Level desbloqueado", 16) addLevel(cid, 1) setPlayerStorageValue(cid, config.storage, os.time()) else doPlayerSendCancel(cid, "Você precisa de 500000 de Gold.") end return true end
  3. Max.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Max" script="max_viagem.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="278" head="58" body="95" legs="95" feet="95" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|, gostaria de ir para {rio de janeiro}?"/> <parameter key="message_farewell" value="Good bye."/> </parameters> </npc> max_viagem.lua local pos = {x = 160, y = 54, z = 7} -- DESTINO local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, "sim") or msgcontains(msg, "yes") then npcHandler:releaseFocus(cid) doTeleportThing(cid, pos) doSendMagicEffect(pos, 10) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. MaXwEllDeN postou uma resposta no tópico em Portal
    Tô dentro! Ótima iniciativa, Renato.
  5. Ai você teria que fazer uma modificaçãozinha no script, até que não é difícil se você der uma boa lida no código em sí. Tenta ai (:
  6. Poderia postar o conteúdo do seu creaturescripts.xml?
  7. MaXwEllDeN postou uma resposta no tópico em Suporte Tibia OTServer
    provavelmente tem um script em movements nomeado walkback.lua, que por padrão já veio registrado com esse evento. É só tirar o id da sua porta da tag desse script.
  8. MaXwEllDeN postou uma resposta no tópico em Suporte Tibia OTServer
    O erro ocorre porque em alguma dessas posições não há tile, portanto o script não consegue criar o item lá.
  9. MaXwEllDeN postou uma resposta no tópico em Xeno Bot
    Vlw Edson. Tava mt afim dessa HUD aehuaheuae. Tankss
  10. Que tal testar? Provavelmente sim. Faz tanto tempo que postei isso que não lembro mais.
  11. MaXwEllDeN postou uma resposta no tópico em Suporte & Pedidos
    creasturescript \/ talkaction \/ Simples, não pode. Já fiz assim para evitar algum bug, como comprar o mesmo item duas vezes...
  12. Não entendi qual seu problema. Se puder explicar melhor e postar o xml do npc, seria ótimo.
  13. Obrigado por trazer este ótimo conteúdo para nós! Dei uma editada no teu tópico para deixar as imagens maiores, espero que não se importe.
  14. Arquivo otserv.cpp
  15. Uma opção, é colocar um item invisível em cima dele. É mais prático que criar um script somente para isso..
  16. local config = { loginMessage = getConfigValue('loginMessage') } function onLogin(cid) local loss = getConfigValue('deathLostPercent') if (loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if (accountManager == MANAGER_NONE) then local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if (lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else str = str .. " Please choose your outfit." doPlayerSendOutfitWindow(cid) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif (accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif (accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if (not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "killer") registerCreatureEvent(cid, "Idle") registerCreatureEvent(cid, "attackguild") registerCreatureEvent(cid, "advance") registerCreatureEvent(cid, "FimVip") registerCreatureEvent(cid, "forever amulet") registerCreatureEvent(cid, "SkullCheck") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "PlayerKill") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "ZombieAttack") if (InitArenaScript ~= 0) then InitArenaScript = 1 -- make arena rooms free for i = 42300, 42309 do setGlobalStorageValue(i, 0) setGlobalStorageValue(i+100, 0) end end -- if he did not make full arena 1 he must start from zero if getPlayerStorageValue(cid, 42309) < 1 then for i = 42300, 42309 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 2 he must start from zero if getPlayerStorageValue(cid, 42319) < 1 then for i = 42310, 42319 do setPlayerStorageValue(cid, i, 0) end end -- if he did not make full arena 3 he must start from zero if getPlayerStorageValue(cid, 42329) < 1 then for i = 42320, 42329 do setPlayerStorageValue(cid, i, 0) end end if getPlayerStorageValue(cid, 42355) == -1 then setPlayerStorageValue(cid, 42355, 0) -- did not arena level end setPlayerStorageValue(cid, 42350, 0) -- time to kick 0 setPlayerStorageValue(cid, 42352, 0) -- is not in arena return true end
  17. Não estava funcionando porque skill possuía um valor nulo, já que não foi declarado. Tenta assim: local function getTop() -- função by vodkart local query = db.getResult("SELECT `name`, `level` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `level` DESC, `name` ASC;") if (query:getID() ~= -1) then return {query:getDataString("name"),query:getDataInt("level")} end return false end function onAdvance(cid, skill, oldLevel, newLevel) local top = getTop() if skill == 8 then if newLevel > top[2] and getCreatureName(cid) ~= top[1] then doBroadcastMessage(getCreatureName(cid).." é o novo TOP do servidor, ele está no level " .. newLevel .. ".", 22) end end return true end
  18. Tem sim. Movement onAddItem... Se você pudesse falar qual o erro, seria de grande ajuda. Ainda não aprendi a ler mentes, sabe. Huahuahuaha,Usa getTileItemById em vez do getThingfrompos. Esse negócio de stacks sempre muda e.e. Dá uma olhada nos tutoriais que eu poste, podem te ajudar bastante
  19. local pos_certa = {x = 1884, y = 1034, z = 11} -- Quando as alavancas estiverem na posição correta local pos_errada = {x = 1834, y = 1017, z = 11} -- Quando as alavancas não estiverem na posição correta local alavancas = { [1] = {x = 160, y = 54, z = 7}, [2] = {x = 160, y = 54, z = 7}, [3] = {x = 160, y = 54, z = 7}, [4] = {x = 160, y = 54, z = 7}, [5] = {x = 160, y = 54, z = 7}, } local levers = { -- Estado inicial [1] = "e", [2] = "e", [3] = "e", [4] = "e", [5] = "e", } local aux = {"e", "d"} function onStepIn(cid) for id, pos in ipairs(alavancas) do local itemid = levers[id] == "e" and 1945 or 1946 if getTileItemById(pos, itemid).uid < 100 then doSendMagicEffect(getThingPos(cid), 10) doTeleportThing(cid, pos_errada) doSendMagicEffect(getThingPos(cid), 10) return true end end doSendMagicEffect(getThingPos(cid), 10) doTeleportThing(cid, pos_certa, true) doSendMagicEffect(getThingPos(cid), 10) for id, pos in ipairs(alavancas) do local itemid = levers[id] == "e" and 1945 or 1946 local lv = getTileItemById(pos, itemid).uid if lv > 100 then doTransformItem(lv, math.random(1945, 1946)) end end return true end
  20. HM, pera. Então as alavancas vão SEMPRE ter que ser puxadas todas pra esquerda, só que quando entra no teleport ele reseta e elas ficam mudadas(só o item) pra um lado aleatório?
  21. local config = { storage = 27364, exhauststorage = 20932, days = { ["Monday"] = {itemid = 2476, count = 1, storagevalue = 1}, ["Tuesday"] = {itemid = 2488, count = 1, storagevalue = 2}, ["Wednesday"] = {itemid = 2195, count = 1, storagevalue = 3}, ["Thursday"] = {itemid = 2497, count = 1, storagevalue = 4}, ["Friday"] = {itemid = 2270, count = 1, storagevalue = 5}, ["Saturday"] = {itemid = 2141, count = 1, storagevalue = 6}, ["Sunday"] = {itemid = 2656, count = 1, storagevalue = 7} }, } function onUse(cid, item, fromPosition, itemEx, toPosition) local x = config.days[os.date("%A",os.time())] if(getPlayerStorageValue(cid, config.storage) == x.storagevalue and os.time() - getPlayerStorageValue(cid, config.exhauststorage) < 86400) then return doPlayerSendCancel(cid, "The chest is empty, come back tomorrow for a new reward.") end local info = getItemInfo(x.itemid) if(x.count > 1) then text = x.count .. " " .. info.plural else text = info.article .. " " .. info.name end local item = doCreateItemEx(x.itemid, x.count) if(doPlayerAddItemEx(cid, item, false) ~= RETURNVALUE_NOERROR) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) text = "You have found a reward weighing " .. getItemWeight(item) .. " oz. It is too heavy or you have not enough space." else text = "You have received " .. text .. "." setPlayerStorageValue(cid, config.storage, x.storagevalue) setPlayerStorageValue(cid, config.exhauststorage, os.time()) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, text) return true end
  22. local pos_certa = {x = 1884, y = 1034, z = 11} -- Quando as alavancas estiverem na posição correta local pos_errada = {x = 1834, y = 1017, z = 11} -- Quando as alavancas não estiverem na posição correta local alavancas = { [1] = {x = 160, y = 54, z = 7}, [2] = {x = 160, y = 54, z = 7}, [3] = {x = 160, y = 54, z = 7}, [4] = {x = 160, y = 54, z = 7}, [5] = {x = 160, y = 54, z = 7}, } _GLOBAL_LEVERS = { -- Estado inicial [1] = "e", [2] = "e", [3] = "e", [4] = "e", [5] = "e", } local aux = {"e", "d"} function onStepIn(cid) for id, pos in ipairs(alavancas) do local itemid = _GLOBAL_LEVERS[id] == "e" and 1945 or 1946 if getTileItemById(pos, itemid).uid < 100 then doSendMagicEffect(getThingPos(cid), 10) doTeleportThing(cid, pos_errada) doSendMagicEffect(getThingPos(cid), 10) return true end end doSendMagicEffect(getThingPos(cid), 10) doTeleportThing(cid, pos_certa, true) doSendMagicEffect(getThingPos(cid), 10) for id = 1, #alavancas do _GLOBAL_LEVERS[id] = aux[math.random(2)] end return true end
  23. <action actionid="5010" event="script" value="alavancahelmet.lua"/> Coloque a actionid 5010 na alavanca

Informação Importante

Confirmação de Termo