Ir para conteúdo

Vabrindox

Membro
  • Registro em

  • Última visita

Tudo que Vabrindox postou

  1. Modifiquei um script que achei na net mas não testei. local btype = "normal" local pokemon = "nome do poke" local pokemon2 = "nome do outro poke" local storage = 40009 function onUse(cid, item, frompos, item2, topos) if pokemon == "" or pokemon2 == "" then return true end if getPlayerStorageValue(cid, storage) <= 0 then addPokeToPlayer(cid, pokemon, 0, nil, btype) addPokeToPlayer(cid, pokemon2, 0, nil, btype) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce terminou a quest e pegou um "..pokemon.." e um "..pokemon2.." !!") doSendMagicEffect(getThingPos(cid), 29) doSendMagicEffect(getThingPos(cid), 27) doSendMagicEffect(getThingPos(cid), 29) setPlayerStorageValue(cid, storage, 1) else doPlayerSendCancel(cid, "Voce ja fez essa quest!") end return TRUE end
  2. Quebrei a cabeça aqui e fiz um script para vc, o jogador vai colocar os 3 itens e vai receber no msm local o item configurado, qualquer outro item colocado a mais junto com os 3 itens em cima da bancada vai ser removido. E sim só funciona somente com os 3 itens configurados. Actions.xml Coloque sempre 1 ActionID diferente para cada alavanca que usar esse msm script, colocando eles agrupadamente na tag: <action actionid="3001;3002;3003" event="script" value="craft.lua"/> Scripts/craft.lua Crie um arquivo .lua chamado "craft" e cole o codigo: Aqui estão alguma explicações para vc configurar pos_bancada1 = {x=105,y=121,z=7}, --> posição da 1ª bancada só trocar o x,y e z e assim por diante no pos_bancada2 e 3 item1_craft = {item1=2466, item2=2455,item3=2454,premio=2674, nome_do_item='Apple'}, --> Aqui está toda a informação do 1º item que vc quer fazer, o item1,item2,item3 são os ids dos 3 itens necessários para criar o "premio" que tbm é só trocar o id, e o nome do item vc tem que colocar dentro das ' ' isso ae é só para ficar legal msm haha, o resto e tudo a msm coisa é só trocar. function onUse(cid, item, fromPosition, itemEx, toPosition) local Configs = { pos_bancada1 = {x=105,y=121,z=7}, pos_bancada2 = {x=107,y=121,z=7}, pos_bancada3 = {x=109,y=121,z=7}, item1_craft = {item1=2466, item2=2455,item3=2454,premio=2674, nome_do_item='Apple'}, item2_craft = {item1=2643, item2=2642,item3=2641,premio=2640, nome_do_item='Soft Boots'}, item3_craft = {item1=2634, item2=2635,item3=2636,premio=2637, nome_do_item='Black King'}, } local Script = { stack1 = getItemStackpos(Configs.pos_bancada1,Configs.item1_craft.item1), stack2 = getItemStackpos(Configs.pos_bancada1,Configs.item1_craft.item2), stack3 = getItemStackpos(Configs.pos_bancada1,Configs.item1_craft.item3), stack4 = getItemStackpos(Configs.pos_bancada2,Configs.item2_craft.item1), stack5 = getItemStackpos(Configs.pos_bancada2,Configs.item2_craft.item2), stack6 = getItemStackpos(Configs.pos_bancada2,Configs.item2_craft.item3), stack7 = getItemStackpos(Configs.pos_bancada3,Configs.item3_craft.item1), stack8 = getItemStackpos(Configs.pos_bancada3,Configs.item3_craft.item2), stack9 = getItemStackpos(Configs.pos_bancada3,Configs.item3_craft.item3), } if Script.stack1 and Script.stack2 and Script.stack3 then doCleanTile(Configs.pos_bancada1) addEvent(doCreateItem, 100, Configs.item1_craft.premio, 1, Configs.pos_bancada1) doPlayerSendTextMessage(cid, 22, "Parabens, Voce Forjou "..Configs.item1_craft.nome_do_item.." .") doSendMagicEffect(Configs.pos_bancada1, NST_ME_FIREWORK_BLUE) doSendMagicEffect(Configs.pos_bancada1, CONST_ME_FIREWORK_YELLOW) doSendMagicEffect(Configs.pos_bancada1, CONST_ME_FIREWORK_RED) return true end if Script.stack4 and Script.stack5 and Script.stack6 then doCleanTile(Configs.pos_bancada2) addEvent(doCreateItem, 100, Configs.item2_craft.premio, 1, Configs.pos_bancada2) doPlayerSendTextMessage(cid, 22, "Parabens, Voce Forjou "..Configs.item2_craft.nome_do_item.." .") doSendMagicEffect(Configs.pos_bancada2, NST_ME_FIREWORK_BLUE) doSendMagicEffect(Configs.pos_bancada2, CONST_ME_FIREWORK_YELLOW) doSendMagicEffect(Configs.pos_bancada2, CONST_ME_FIREWORK_RED) return true end if Script.stack7 and Script.stack8 and Script.stack9 then doCleanTile(Configs.pos_bancada3) addEvent(doCreateItem, 100, Configs.item3_craft.premio, 1, Configs.pos_bancada3) doPlayerSendTextMessage(cid, 22, "Parabens, Voce Forjou "..Configs.item3_craft.nome_do_item.." .") doSendMagicEffect(Configs.pos_bancada3, NST_ME_FIREWORK_BLUE) doSendMagicEffect(Configs.pos_bancada3, CONST_ME_FIREWORK_YELLOW) doSendMagicEffect(Configs.pos_bancada3, CONST_ME_FIREWORK_RED) return true end doPlayerSendTextMessage(cid, 28, "Voce nao tem os 3 itens, para Craftar!") return true end function getItemStackpos(position, id) if getTileItemById(position, id).itemid == 0 then return nil end for i = 0, 255 do local pos = getThingFromPos({x=position.x, y=position.y, z=position.z, stackpos=i}) if pos.itemid == id then return i end end end @Zzyzx Ah foi mal eu botei tudo em 1 só bancada e vc queria de baixo da bancada de cada item né..erro meu, mas não vou arrumar agora não só amanha pq to sem tempo.
  3. Vabrindox postou uma resposta no tópico em Suporte Tibia OTServer
    local combat0_Brush = createCombatObject() setCombatParam(combat0_Brush, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat0_Brush, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatArea(combat0_Brush,createCombatArea({{1, 0, 0, 0, 0, 0, 1}, {0, 1, 0, 0, 0, 1, 0}, {0, 0, 1, 0, 1, 0, 0}, {0, 0, 0, 2, 0, 0, 0}, {0, 0, 1, 0, 1, 0, 0}, {0, 1, 0, 0, 0, 1, 0}, {1, 0, 0, 0, 0, 0, 1}})) function getDmg_Brush(cid, level, maglevel) return (10)*-1,(20)*-1 end setCombatCallback(combat0_Brush, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush")local combat0_Brush_2 = createCombatObject() setCombatParam(combat0_Brush_2, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_PURPLE) setCombatParam(combat0_Brush_2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatArea(combat0_Brush_2,createCombatArea({{0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {1, 1, 1, 2, 1, 1, 1}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}})) function getDmg_Brush_2(cid, level, maglevel) return (10)*-1,(20)*-1 end setCombatCallback(combat0_Brush_2, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_2")local combat0_Brush_3 = createCombatObject() setCombatParam(combat0_Brush_3, COMBAT_PARAM_EFFECT, CONST_ME_PURPLEENERGY) setCombatParam(combat0_Brush_3, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatArea(combat0_Brush_3,createCombatArea({{0, 1, 1, 0, 1, 1, 0}, {1, 0, 1, 0, 1, 0, 1}, {1, 1, 0, 0, 0, 1, 1}, {0, 0, 0, 2, 0, 0, 0}, {1, 1, 0, 0, 0, 1, 1}, {1, 0, 1, 0, 1, 0, 1}, {0, 1, 1, 0, 1, 1, 0}})) function getDmg_Brush_3(cid, level, maglevel) return (10)*-1,(20)*-1 end setCombatCallback(combat0_Brush_3, CALLBACK_PARAM_LEVELMAGICVALUE, "getDmg_Brush_3") -- =============== CORE FUNCTIONS =============== local function RunPart(c,cid,var,dirList,dirEmitPos) -- Part if (isCreature(cid)) then doCombat(cid, c, var) if (dirList ~= nil) then -- Emit distance effects local i = 2; while (i < #dirList) do doSendDistanceShoot(dirEmitPos,{x=dirEmitPos.x-dirList,y=dirEmitPos.y-dirList[i+1],z=dirEmitPos.z},dirList[1]) i = i + 2 end end end end function onCastSpell(cid, var) if getPlayerStorageValue(cid, 378378) >=5 then RunPart(combat0_Brush,cid,var) RunPart(combat0_Brush_2,cid,var) RunPart(combat0_Brush_3,cid,var) return true else doPlayerSendCancel(cid, "You need to have at least 5 resets to cast this spell.") return false end end Testa ae, eu botei com 5 resets pq vc tinha me falado com 5 mas se quiser trocar só trocar isso: if getPlayerStorageValue(cid, 378378) >=5 then por isso: if getPlayerStorageValue(cid, 378378) >=3 then e a msg vc troca o 5 pelo 3 doPlayerSendCancel(cid, "You need to have at least 3 resets to cast this spell.")
  4. Blz eu fiz no msm estilo ele vai no npc o npc da missao para ele e depois que o player acabar ele volta ao npc e o npc da uma nova missao e assim por diante quantos vc quiser. Creaturescripts.xml Lembra que vc botou o kill_task.lua agora toda vez que vc quiser uma nova task vc coloca as tag assim como eu botei abaixo e vc configura separadamente cada uma da maneira que vc quiser <event type="kill" name="kill_task" event="script" value="kill_task3.lua"/> <event type="kill" name="kill_task" event="script" value="kill_task2.lua"/> creaturescripts/scripts Ae vc precisa criar o arquivo .lua com os nomes novos "kill_task2.lua" e "kill_task3.lua" eu vou te mandar os 2 logo para vc nao ficar com duvida de como ta a configuração. Lembrando que eu mudei umas coisinhas só para ficar mais facil na hr de configurar e n precisar mudar o nome do bicho na msg só na config. kill_task2.lua storage = 2501, Tem que ta igual a storage da missao 2 do npc pq a 1 foi a que eu te mandei antes e a 3 é a task_kill3 monster = 'Troll', Nome do monstro premio = 2160, Id do premio qtd = 1, Quantidade de itens do premio exp = 100, Exp que ganha mas vc pode botar 0 caso n queira nenhuma local Configs = { storage = 2501, monster = 'Troll', premio = 2160, qtd = 1, exp = 100, } function onKill(cid, target, lastHit) if isMonster(target) and getCreatureName(target) == Configs.monster then local get = getPlayerStorageValue(cid, Configs.storage) if get >=0 and get <=5 then setPlayerStorageValue(cid, Configs.storage, (get+1)) local gett = getPlayerStorageValue(cid, Configs.storage) doCreatureSay(cid, 'Voce matou '..gett..' '..Configs.monster..' ate agora.', TALKTYPE_ORANGE_1) if gett == 5 then doPlayerAddItem(cid, Configs.premio, Configs.qtd) doPlayerAddExp(cid,Configs.exp) doCreatureSay(cid, 'Voce acabou a missao!.', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, Configs.storage, (gett+1)) end end end return true end kill_task3.lua local Configs = { storage = 2502, monster = 'Sheep', premio = 2160, qtd = 1, exp = 100, } function onKill(cid, target, lastHit) if isMonster(target) and getCreatureName(target) == Configs.monster then local get = getPlayerStorageValue(cid, Configs.storage) if get >=0 and get <=5 then setPlayerStorageValue(cid, Configs.storage, (get+1)) local gett = getPlayerStorageValue(cid, Configs.storage) doCreatureSay(cid, 'Voce matou '..gett..' '..Configs.monster..' ate agora.', TALKTYPE_ORANGE_1) if gett == 5 then doPlayerAddItem(cid, Configs.premio, Configs.qtd) doPlayerAddExp(cid,Configs.exp) doCreatureSay(cid, 'Voce acabou a missao!.', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, Configs.storage, (gett+1)) end end end return true end Npc/scripts o Npc "task.lua" ficou assim: storage_1 = 2500, É a storage da primeira task(missao) storage_2 = 2501, msm coisa só que da 2 storage_3 = 2502, e da 3 qtd_kill1 = 5, Aqui é a quantidade de bichos que o player precisa matar da 1 missao qtd_kill2 = 5, msm coisa só que da 2 qtd_kill3 = 5, da 3 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 = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local Configs = { storage_1 = 2500, storage_2 = 2501, storage_3 = 2502, qtd_kill1 = 5, qtd_kill2 = 5, qtd_kill3 = 5, } local get1 = getPlayerStorageValue(cid, Configs.storage_1) local get2 = getPlayerStorageValue(cid, Configs.storage_2) local get3 = getPlayerStorageValue(cid, Configs.storage_3) if(msgcontains(msg, 'missao') and (get1 == -1)) then selfSay('Para ganhar o premio mate '..Configs.qtd_kill1..' Rabbit! Voce ira receber automaticamente.', cid) setPlayerStorageValue(cid, Configs.storage_1, 0) return true elseif get1 >=0 and get1 <=Configs.qtd_kill1 then selfSay('Voce precisa matar '..(Configs.qtd_kill1-get1)..' Rabbits!', cid) return true end if(msgcontains(msg, 'missao') and (get2 == -1)) then selfSay('Para ganhar o premio mate '..Configs.qtd_kill2..' Troll! Voce ira receber automaticamente.', cid) setPlayerStorageValue(cid, Configs.storage_2, 0) return true elseif get2 >=0 and get2 <=Configs.qtd_kill2 then selfSay('Voce precisa matar '..(Configs.qtd_kill2-get2)..' Troll!', cid) return true end if(msgcontains(msg, 'missao') and (get3 == -1)) then selfSay('Para ganhar o premio mate '..Configs.qtd_kill3..' Sheep! Voce ira receber automaticamente.', cid) setPlayerStorageValue(cid, Configs.storage_3, 0) return true elseif get3 >=0 and get3 <=Configs.qtd_kill3 then selfSay('Voce precisa matar '..(Configs.qtd_kill3-get3)..' Sheep!', cid) end if get1>Configs.qtd_kill1 and get2>Configs.qtd_kill2 and get3>Configs.qtd_kill3 then selfSay('Voce ja fez todas as missoes!', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Qualquer coisa só falar, e eu sei que outras pessoas vão dizer que o código não esta perfeito e que da para fazer de alguma outra maneira mas eu fui fazendo para treinar msm faz muito tempo que não programo para otserv e estou voltando agora e lembrando aos poucos. @igorcano1 Para vc botar mais recompensas vc pode ir fazendo assim: local Configs = { storage = 2502, monster = 'Sheep', premio = 2160, premio2= 2152, qtd = 1, qtd_2 = 1, exp = 100, } function onKill(cid, target, lastHit) if isMonster(target) and getCreatureName(target) == Configs.monster then local get = getPlayerStorageValue(cid, Configs.storage) if get >=0 and get <=5 then setPlayerStorageValue(cid, Configs.storage, (get+1)) local gett = getPlayerStorageValue(cid, Configs.storage) doCreatureSay(cid, 'Voce matou '..gett..' '..Configs.monster..' ate agora.', TALKTYPE_ORANGE_1) if gett == 5 then doPlayerAddItem(cid, Configs.premio, Configs.qtd) doPlayerAddItem(cid, Configs.premio2, Configs.qtd_2) doPlayerAddExp(cid,Configs.exp) doCreatureSay(cid, 'Voce acabou a missao!.', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, Configs.storage, (gett+1)) end end end return true end
  5. Vabrindox postou uma resposta no tópico em Suporte Tibia OTServer
    Mas o npc te leva para varios lugares diferentes para vc usar itens diferentes e depois precisa voltar a falar com ele para ser teletransportado novamente?
  6. Mas elas vão ser teletransportadas ao usar algum item ou apenas por chegar no local? Pq se for assim elas irão ser teletransportadas 1 por 1 só pq passou por cima de algum x y z configurado. Acho que ta faltando algo ae para ficar legal.
  7. Fiz um bem simples ve se resolve seu problema. O jogador precisa ir até o npc falar "missao" e ae depois é só ele ir caçar e matar a quantidade certa de bichos para ganhar item/exp automaticamente. E se ele for no npc o npc indica para ele que não pode mais fazer aquela "missao" novamente. creaturescripts.xml <event type="kill" name="kill_task" event="script" value="kill_task.lua"/> creaturescripts/login.lua Antes do return true la do final bota isso. registerCreatureEvent(cid, "kill_task") creaturescripts/scripts Cria um arquivo .lua com o nome "kill_task" e cola isso dentro. local Configs = { storage = 2427, monster = 'Rabbit', premio = 2160, qtd = 1, exp = 100, } function onKill(cid, target, lastHit) if isMonster(target) and getCreatureName(target) == Configs.monster then local get = getPlayerStorageValue(cid, Configs.storage) if get >=0 and get <=5 then setPlayerStorageValue(cid, Configs.storage, (get+1)) local gett = getPlayerStorageValue(cid, Configs.storage) doCreatureSay(cid, 'Voce matou '..gett..' Rabbits ate agora.', TALKTYPE_ORANGE_1) if gett == 5 then doPlayerAddItem(cid, Configs.premio, Configs.qtd) doPlayerAddExp(cid,Configs.exp) doCreatureSay(cid, 'Voce acabou a missao!.', TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, Configs.storage, (gett+1)) end end end return true end Npc Na pasta npc crie um arquivo .xml com o nome "Task" e cole isso <?xml version="1.0" encoding="UTF-8"?> <npc name="Task" script="task.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|, eu tenho uma missao para voce!"/> </parameters> </npc> Npc/scripts Crie um arquivo .lua com o nome "task" e cole isso 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 = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local storage = 2427 local get = getPlayerStorageValue(cid, storage) if(msgcontains(msg, 'missao') and (get == -1)) then selfSay('Para ganhar o premio mate 5 Rabbits! Voce ira receber automaticamente.', cid) setPlayerStorageValue(cid, storage, 0) elseif get >=5 then selfSay('Voce acabou a missao de matar Rabbits!', cid) else selfSay('Voce precisa matar '..(5-get)..' Rabbits!', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  8. explica melhor isso ae pq não entendi, a pessoa vende 1 item e ganha 2 moedas ao puxar uma alavanca? o que seria essas quantidades junto com esses outros itens?
  9. Vabrindox postou uma resposta no tópico em Formação de Equipe
    Tenho quase certeza que já joguei no seu servidor antigo, pq era uma mulher quem criou e tbm era SAO, lembro que o servidor estava ok e no outro dia boom offline 4ever. Vc tinha colocado uma box como corpo dos bichos não foi?(O que achei bem interessante visto que não existem muitas sprites por ae completa). Ah e só para avisar que o link do face que vc botou ae ta dando erro!
  10. Galera, eu tava querendo tirar esse lance do player mover as janelas para qualquer lugar, sejam elas backpack ou janelas de skill, itens, lista vip e etc, eu queria deixar igual ao client normal, ou seja, apenas no lado direito sendo impossível colocar a janela de backpack por exemplo em cima de um player. Tentei procurar por isso na source etc e n achei, me ajudem!
  11. Acho que o erro ae é a virgula.
  12. Então eu nunca usei um sistema de reset de level mas creio que para vc fazer o que vc quer nesse caso ae do script que vc tava usando talvez armazenando a vida max do player em uma variável e dps fazer ele ir para o lv 8 e setar após o lv 8 a nova vida dele que é a que foi armazenada, assim ele ira para o lv 8 e vai ficar com o life que tava antes de resetar, mas nao sei se teria algum bug ao upar o lv 9 só testando msm.
  13. Ve assim
  14. Eu n entendi o que você quer que aconteça, seria quando o personagem que desse reset a vida dele seja a de um lv 8? Explique melhor.
  15. Eu n li o script mas vi que vc postou uma copia do script do Kamiz errado, copia e cola dnv pq o seu ta faltando um "end" no final.

Informação Importante

Confirmação de Termo