Tony Araujo 282 Postado Julho 15, 2013 Share Postado Julho 15, 2013 (editado) Olá galerinha, eu tava sem fazer nada, e resolvi trazer um sistema de duelo, que conta vitorias e derrotas. Eu achei que seria bem legal, os jogadores chamando os outros para um duelo limpo e talz. , SISTEMA 100% Meu. Testado no TFS By OrochiElf v1.0 Bom, no sistema tem as seguintes funçoes : Invite, -- Convida para o duelo Accept, -- Aceita o convite Recuse, -- Recusa o Convite Cancel, -- Cancela o convite Check, -- Verifica quem voce convidou ou quem te convidou Status -- Checa a vitoria e a derrota Como usar : /duel comado, player Exemplo : /duel invite, Tony /duel accept, Tony /duel recuse, Tony /duel cancel, Tony /duel check /duel status, Tony Bom, vamos a instalaçao. primeiro, vá em data/talkaction/script, crie um arquivo chamado : duel.lua e adicione dentro http://pastebin.com/3HUMPCYs TAG <talkaction words="/duel" hide="yes" event="script" value="duel.lua"/> Agora vamos em creaturescript/scripts e dentro crie um arquivo chamado dueldie.lua e dentro adicione http://pastebin.com/QH2UeQTR Em login.lua, antes do ultimo return true, adicione registerCreatureEvent(cid, "DuelDie") TAG <event type="death" name="DuelDie" event="script" value="dueldie.lua"/> Qualquer bug, avise. Editado Julho 15, 2013 por OrochiElf Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/ Compartilhar em outros sites More sharing options...
BrunooMaciell 85 Postado Julho 15, 2013 Share Postado Julho 15, 2013 (editado) nossa parece ser um exelente systema ^^ logo mais estarei testando ^^ mais Curti+ por trazer o conteudo ^^ Obs: so uma coisa cade as linhas do talkaction.xml 0.o ?? Editado Julho 15, 2013 por Brunnoo Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1539726 Compartilhar em outros sites More sharing options...
Tony Araujo 282 Postado Julho 15, 2013 Autor Share Postado Julho 15, 2013 Estou editando o topico, está com um limite de conteudo, e estou tentando comprimir o meu topico. Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1539727 Compartilhar em outros sites More sharing options...
Slicer 1070 Postado Julho 15, 2013 Share Postado Julho 15, 2013 eh... eu se fosse tu colocava os 'isCreature(player)' sempre no inicio das funçoes... por exemplo, na funçao addInvite(cid, player), doq adianta por isCreature la embaixo se caso n for criatura ja vai da erro no console no getCreatureStorage... e x1 eh facil kk' quero ver fazer 2x2, 3x3 '---' Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1539737 Compartilhar em outros sites More sharing options...
Tony Araujo 282 Postado Julho 15, 2013 Autor Share Postado Julho 15, 2013 Esse ai slicer, eu ja comecei a fazer. E obrigado pela dica... E ta um poquinho dificil, mais eu consigo HUEUHEHUHUEUHEUHEUHEUHE Voce ainda vai se orgulhar de min *-* e vai parar com akelas suas criticas chatas =/ UHEHUEHUEHUEUHEUHEUHEUHEUHEUHU Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1539753 Compartilhar em outros sites More sharing options...
BrunooMaciell 85 Postado Julho 15, 2013 Share Postado Julho 15, 2013 Eu tentei testa no meu server de poketibia !! deu o seguinte erro: [15/07/2013 20:22:24] [Error - TalkAction Interface][15/07/2013 20:22:24] data/talkactions/scripts/duel.lua:onSay[15/07/2013 20:22:24] Description:[15/07/2013 20:22:24] data/lib/032-position.lua:48: attempt to index local 'toPosition' (a boolean value)[15/07/2013 20:22:24] stack traceback:[15/07/2013 20:22:24] data/lib/032-position.lua:48: in function 'getDistanceBetween'[15/07/2013 20:22:24] data/talkactions/scripts/duel.lua:18: in function 'addInvite'[15/07/2013 20:22:24] data/talkactions/scripts/duel.lua:215: in function se puder arruma pra min ^^ Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1539925 Compartilhar em outros sites More sharing options...
Tony Araujo 282 Postado Julho 16, 2013 Autor Share Postado Julho 16, 2013 (editado) Teste assim, para pokemon -- FUNÇOES -- function addInvite(cid, player) local playerinvite = nil for _, func in ipairs(getPlayersOnline()) do if getCreatureStorage(func, 15215) == getCreatureName(player) then playerinvite = tostring(getCreatureName(func)) end end if getCreatureStorage(cid, 15215) == getCreatureName(player) then doPlayerSendTextMessage(cid, 27, "Voce ja convidou "..getCreatureName(player).." para duelar, aguarde a resposta.") return true end if getDistanceToCreature(player) > 3 then doPlayerSendTextMessage(cid, 27, "Voce precisa chegar perto desse jogador para convida-lo.") return true end if playerinvite ~= nil then doPlayerSendTextMessage(cid, 27, "Esse jogador ja foi convidado por outro jogador.") return true end if not isCreature(player) then doPlayerSendTextMessage(cid, 27, "Esse jogador nao é valido.") return true end if getCreatureStorage(cid, 15215) ~= -1 then doPlayerSendTextMessage(cid, 27, "Voce nao pode convidar outro jogador, voce ja convidou o jogador "..getPlayerStorageValue(cid, 15215)) return true end if getTilePzInfo(getThingPos(cid)) then doPlayerSendTextMessage(cid, 27, "Voce nao pode convidar outro jogador para o duelo, estando em Protection Zone.") return true end setPlayerStorageValue(cid, 15215, getCreatureName(player)) doPlayerSendTextMessage(cid, 27, "Voce está convidando "..getCreatureName(player).." Para duelar.") doSendAnimatedText(getThingPos(player), "INVITED", 120) doPlayerSendTextMessage(player, 27, "Voce foi convidado para duelo por "..getCreatureName(cid)) return true end local tempo = 5 function doStartDuel(cid, cid2) if tempo == 0 then doCreatureSetSkullType(cid, SKULL_GREEN) doCreatureSetSkullType(cid2, SKULL_GREEN) doSendAnimatedText(getThingPos(cid), "BATTLE", 120) doSendAnimatedText(getThingPos(cid2), "BATTLE", 120) return true else doSendAnimatedText(getThingPos(cid), tempo, 120) doSendAnimatedText(getThingPos(cid2), tempo, 120) tempo = tempo - 1 return addEvent(doStartDuel, 1000, cid, cid2) end return true end function doSalvePosition(cid) local p = getThingPos(cid) if isCreature(cid) then setPlayerStorageValue(cid, 18210, p.x) setPlayerStorageValue(cid, 18211, p.y) setPlayerStorageValue(cid, 18212, p.z) end return true end function acceptInvite(cid, player) if getCreatureStorage(player, 15215) ~= getCreatureName(cid) then doPlayerSendTextMessage(cid, 27, "Voce nao foi convidado por esse jogador.") return true end if getDistanceToCreature(player) > 3 then doPlayerSendTextMessage(cid, 27, "Voce precisa chegar perto desse jogador para aceitar o seu pedido.") return true end if getTilePzInfo(getThingPos(cid)) then doPlayerSendTextMessage(cid, 27, "Voce nao pode aceitar o pedido de duelo, estando em Protection Zone.") return true end if getPlayerStorageValue(cid, 12577) <= 0 then setPlayerStorageValue(cid, 12577, 0) end if getPlayerStorageValue(cid, 12578) <= 0 then setPlayerStorageValue(cid, 12578, 0) end doPlayerSendTextMessage(player, 27, "O Jogador "..getCreatureStorage(player, 15215).." aceitou o seu pedido.") doSendAnimatedText(getThingPos(cid), "ACCEPTED", 120) setPlayerStorageValue(cid, 15122, 1) setPlayerStorageValue(player, 15122, 1) doSalvePosition(cid) doSalvePosition(player) addEvent(doStartDuel,1000,cid, player) return true end function recuseInvite(cid, player) if getCreatureStorage(player, 15215) ~= getCreatureName(cid) then doPlayerSendTextMessage(cid, 27, "Voce nao foi convidado por esse jogador.") return true end setPlayerStorageValue(player, 15215, -1) doPlayerSendTextMessage(player, 27, "O Jogador "..getCreatureName(cid).." Cancelou seu pedido de duelo.") doPlayerSendTextMessage(cid, 27, "Voce cancelou o pedido do jogador "..getCreatureName(player)) doSendAnimatedText(getThingPos(cid), "RECUSED", 120) return true end function cancelInvite(cid) local player_cancel = nil for _, players in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, 15215) == getCreatureName(players) then player_cancel = tostring(getCreatureName(players)) end end if player_cancel == nil then doPlayerSendTextMessage(cid, 27, "Voce nao convidou ninquem, para cancelar.") return true end setPlayerStorageValue(cid, 15215, -1) doPlayerSendTextMessage(cid, 27, "Voce cancelou o seu pedido para "..player_cancel) doPlayerSendTextMessage(getPlayerByName(player_cancel), 27, "O Jogador "..getCreatureName(cid).." cancelou o seu convite de duelo.") doSendAnimatedText(getThingPos(cid), "RECUSED", 120) return true end function checkMeInvite(cid) local invites = nil for _, players in ipairs(getPlayersOnline()) do if getCreatureStorage(players, 15215) == getCreatureName(cid) then invites = tostring(getCreatureName(players)) end end if invites ~= nil and getCreatureStorage(cid, 15215) == -1 then doPlayerSendTextMessage(cid, 27, "Voce tem invites de "..invites) elseif getCreatureStorage(cid, 15215) ~= -1 then doPlayerSendTextMessage(cid, 27, "Voce invitou o jogador "..getCreatureStorage(cid, 15215)) else doPlayerSendTextMessage(cid, 27, "Voce nao convidou ninquem , e nem foi convidado.") end return true end function checkStatus(cid, player) if not isCreature(player) then doPlayerSendCancel(cid, "Creature Not found.") return true end doShowTextDialog(cid, 2160, " "..getCreatureName(player).." Status\n\nVitórias : "..getPlayerStorageValue(player, 12578).."\nDerrotas : "..getPlayerStorageValue(player, 12577).."") return true end -- FUNÇOES -- function onSay(cid, words, param) function showCommands(cid) if isCreature(cid) then local msg = "Comandos:\n-Invite\n-Accept\n-Recuse\n-Cancel\n-Status\n-Check\n\nModo de Uso:\n"..words.." comando, NomedoJogador" doShowTextDialog(cid, 2160, msg) end return true end local txt = string.explode(param, ",") local pid = getPlayerByNameWildcard(txt[2]) if txt[1] == "invite" then addInvite(cid, pid) elseif txt[1] == "accept" then acceptInvite(cid, pid) elseif txt[1] == "recuse" then recuseInvite(cid, pid) elseif txt[1] == "commands" then showCommands(cid) elseif txt[1] == "cancel" then cancelInvite(cid) elseif txt[1] == "status" then checkStatus(cid, pid) elseif txt[1] == "check" then checkMeInvite(cid) else doPlayerSendTextMessage(cid, 27, "Comando nao valido, para saber os comandos use: "..words.." commands") end return true end Editado Julho 16, 2013 por OrochiElf Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1540106 Compartilhar em outros sites More sharing options...
wesleyt10 67 Postado Julho 17, 2013 Share Postado Julho 17, 2013 Slicer Calma é dos 1x1 que começa depois passa pros 2x2, 3x3 o carinha ai vai longe rlx tu ja é foda ele ta ficando kkk vamo incentivar mt bom cara parabens e obrigado por postar pra galera ai @Slicer, e tbm eu agradeço por ele por mostrar como comerçar a script e mostrar os possiveis erros , sua atitude foi mais doq correta VLW!!! Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1540374 Compartilhar em outros sites More sharing options...
Tony Araujo 282 Postado Julho 20, 2013 Autor Share Postado Julho 20, 2013 Obrigado ai galera (;, espero que faça bom uso HEHUEUHE Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1541612 Compartilhar em outros sites More sharing options...
tcbrj 0 Postado Julho 23, 2013 Share Postado Julho 23, 2013 Muito massa, excelente trabalho! Aprovo e recomendo! Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1543009 Compartilhar em outros sites More sharing options...
XkillerW 0 Postado Julho 25, 2018 Share Postado Julho 25, 2018 O meu esta dando o seguinte erro: [Error - LuaScriptInterface::loadFile] cannot open datapack/creaturescripts/scripts/dueldie.lua: No such file or directory [25/07/2018 11:49:36] [Warning - Event::loadScript] Cannot load script (datapack/creaturescripts/scripts/dueldie.lua) [25/07/2018 11:49:36] cannot open datapack/creaturescripts/scripts/dueldie.lua: No such file or directory Algm sabe arrumar ? Link para o comentário https://xtibia.com/forum/topic/217654-duel-system-v10-by-orochielf/#findComment-1742276 Compartilhar em outros sites More sharing options...
Posts Recomendados