up
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Duel System Error
[Encerrado] Duel System Error
Por lucasmourahere, 10 de ago. de 2016 em Tópicos Sem Resposta
info
Grupo: Campones
Registrado: 08/03/16
Posts: 94
Reputação: +4
Gênero: Masculino

Isso acontece porque o sistema de duelo é escrito usando canais de chat, e, por meio do creatureevent que os manipula, é passada a impressão que são janelas de opção. Para contornar o problema que você citou e reforçar a ideia pretendida, retorna-se falso ao final do bloco de código responsável por esse sistema no creatureevent que citei. Você poderia me informar se este erro ocorre no client C++ (o original)? Se a resposta for afirmativa, saberia informar o servidor que você baixou?
info
Grupo: Campones
Registrado: 08/03/16
Posts: 94
Reputação: +4
Gênero: Masculino

Em 11/08/2016 at 15:02, zipter98 disse:Isso acontece porque o sistema de duelo é escrito usando canais de chat, e, por meio do creatureevent que os manipula, é passada a impressão que são janelas de opção. Para contornar o problema que você citou e reforçar a ideia pretendida, retorna-se falso ao final do bloco de código responsável por esse sistema no creatureevent que citei. Você poderia me informar se este erro ocorre no client C++ (o original)? Se a resposta for afirmativa, saberia informar o servidor que você baixou?
Boa tarde zipter98. Fico grato pelo suporte meu caro!!
Entao cara, eu tenho apenas a Source do servidor, nao sei te informar se seria algo em C++ ligado ao Client. sei que este codigo em creaturescripts esta ligado a um arquivo chamado Tvsys.lua em creaturescripts, nesse arquivo contem a configuracao dos canais. E o sevidor baixado como base foi o "PDA Advanced 2015 Open Source".
Arquivo responsável pelos canais:
function onJoinChannel(cid, channelId, users, isTv) if channelId == 10 then doShowPokemonStatistics(cid) return false end if channelId == 11 then if reloadHighscoresWhenUsingPc then doReloadHighscores() end doPlayerPopupFYI(cid, getHighscoreString(8)) return false end if channelId == 12 then if reloadHighscoresWhenUsingPc then doReloadHighscores() end doPlayerPopupFYI(cid, getHighscoreString(6)) return false end --////////////////////////////////////////////////////////////////////////////////////////-- if channelId >= 19 and channelId <= 21 then --alterado v2.8 \/ setPlayerStorageValue(cid, 52480, (channelId-18)) setPlayerStorageValue(cid, 52484, ((channelId-18)*2)-1) doSendAnimatedText(getThingPosWithDebug(cid), (channelId-18).."x"..(channelId-18), COLOR_BURN) doPlayerSetVocation(cid, 8) openChannelDialog(cid) return false end if channelId >= 13 and channelId <= 18 then local sid = getPlayerByName(getPlayerStorageValue(cid, 52483):match("(.*),")) ---------------- Proteçao para ter um oponente valido! if not isCreature(sid) then doPlayerSendTextMessage(cid, 20, "The other player isn't online! Duel is canceled!") doPlayerSetVocation(cid, 1) for i = 1, #storagesDuel do setPlayerStorageValue(cid, storagesDuel[i], -1) end doCreatureSetSkullType(cid, 0) return false end ---------------- Proteçao para os 2 players terem a qntdade de pokes pro duel local pokes1 = getLivePokeballs(cid, getPlayerSlotItem(cid, 3).uid, true) local pokes2 = getLivePokeballs(sid, getPlayerSlotItem(sid, 3).uid, true) if #pokes1 < (channelId-12) or #pokes2 < (channelId-12) then local tpw = getPlayerStorageValue(cid, 52480) > 1 and "ally" or "opponent" doPlayerSendTextMessage(cid, 20, "You or your "..tpw.." doesn't have that amount of pokemons in their bags! Duel are canceled!") doPlayerSetVocation(cid, 1) for i = 1, #storagesDuel do setPlayerStorageValue(cid, storagesDuel[i], -1) end doCreatureSetSkullType(cid, 0) return false end ---------------- if getPlayerStorageValue(cid, 52480) > 1 then setPlayerStorageValue(cid, 52482, getPlayerStorageValue(cid, 52482).. getCreatureName(sid)..",") setPlayerStorageValue(cid, 52483, "") end ---------------- doSendAnimatedText(getThingPos(cid), (channelId-12).." Poke"..(channelId > 13 and "s" or ""), COLOR_BURN) setPlayerStorageValue(cid, 52481, (channelId-12)) setPlayerStorageValue(sid, 52485, getCreatureName(cid)) setPlayerStorageValue(sid, 52481, (channelId-12)) local players, pokes = getPlayerStorageValue(cid, 52480), getPlayerStorageValue(cid, 52481) local str = {} --alterado v2.9 \/ table.insert(str, getCreatureName(cid).." is inviting you to a duel! Use order in him to accept it!\n") table.insert(str, "Info Battle: Duel "..players.."x"..players.." - "..pokes.." pokes.") doPlayerSendTextMessage(sid, 20, table.concat(str)) addEvent(doSendAnimatedText, 1000, getThingPos(cid), "BATTLE", COLOR_ELECTRIC) doPlayerSetVocation(cid, 1) return false end --////////////////////////////////////////////////////////////////////////////////////////-- if channelId >= 100 and channelId <= 10000 then local owner = getPlayerByGUID(getChannelOwner(channelId)) if isChannelTv(channelId) then if isCreature(owner) then if owner ~= cid then doPlayerWatchOther(cid, owner) local plural = #users == 1 and "" or "s" doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is now watching your channel (currently '..#users..' player'..plural..' watching this channel).', 15, channelId) else setPlayerStorageValue(cid, 99284, 1) end end elseif owner == cid then setPlayerStorageValue(cid, 99284, 2) end return true endreturn trueendfunction onLeaveChannel(cid, channelId, users) if channelId >= 100 and channelId <= 10000 then local owner = getPlayerByGUID(getChannelOwner(channelId)) if isChannelTv(channelId) then if owner ~= cid and getCreatureOutfit(cid).lookType == 814 then doPlayerStopWatching(cid) local plural = #users == 2 and "" or "s" doPlayerSendChannelMessage(owner, "TV Channel", getCreatureName(cid)..' is not watching your channel anymore (currently '..#users - (1)..' player'..plural..' watching this channel).', 15, channelId) elseif owner == cid then setPlayerStorageValue(cid, 99284, -1) doSendAnimatedText(getThingPos(cid), "CAM OFF", 180) for stops = 1, #users do if users[stops] ~= owner then doPlayerStopWatching(users[stops]) end end end elseif owner == cid then setPlayerStorageValue(cid, 99284, -1) end return true endreturn trueendfunction onMove(cid, fromPosition, toPosition) -- Código não é mais necessário, feito em c++ -- Code deprecated, made in c++ --if not canWalkOnPos(toPosition, false, false, false, true, false) and getPlayerStorageValue(cid, 17000) >= 1 then -- doTeleportThing(cid, fromPosition, false) -- doPlayerSendCancel(cid, "Sorry, not possible.") --end if getPlayerStorageValue(cid, 99284) <= 0 then return true end local speed = getCreatureSpeed(cid) local a = getWatchingPlayersFromPos(cid, fromPosition) for b = 1, #a do if getCreatureSpeed(a[b]) ~= speed then doChangeSpeed(a[b], - getCreatureSpeed(a[b])) doChangeSpeed(a[b], speed) end doTeleportThing(a[b], toPosition, true) endreturn trueendlocal permited = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s","t", "u", "v", "x", "w", ",", "'", '"',"y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ".", "!", "@", "#", "$", "%", "&", "*", "(", ")","-", "_", "+", "/", ";", ":", "?", "^", "~", "{", "[", "}", ]", ">", "<", "£", "¢", "¬"}function onTextEdit(cid, item, newText) if item.itemid == 12330 then if getPlayerStorageValue(cid, 99284) >= 1 then doPlayerSendCancel(cid, "You are already on air!") return false end local channelName = getCreatureName(cid).."'s TV Channel" if string.len(newText) <= 0 then doPlayerSendCancel(cid, "Your channel is going to be shown as \""..getCreatureName(cid).."'s TV Channel\".") elseif string.len(newText) > 25 then doPlayerSendCancel(cid, "Your channel name can't have more than 25 characters.") return false else channelName = newText end setPlayerStorageValue(cid, 99284, 1) setPlayerStorageValue(cid, 99285, "") setPlayerStorageValue(cid, 99285, channelName) doPlayerCreatePrivateChannel(cid, channelName) doSendAnimatedText(getThingPos(cid), "ON AIR!", COLOR_GRASS) return false endreturn trueend
Editado Agosto 12 por lucasmourahere
Ao que tudo indica, o problema não está nesse código. Anteriormente, me referi ao uso do client original da CipSoft (que é o client C++). Nas imagens que você postou, você apenas usou o OTClient.
Eu preciso confirmar se o problema ocorre em ambos os clients. Na hipótese destes canais de duelo aparecerem apenas no OTClient, tenho certeza de que a causa se encontra em algum arquivo do OTC (o que, para mim, seriam novas águas, já que nunca me aventurei neste client).
Editado Agosto 12 por zipter98
info
Grupo: Campones
Registrado: 08/03/16
Posts: 94
Reputação: +4
Gênero: Masculino

1 hora atrás, zipter98 disse:Ao que tudo indica, o problema não está nesse código. Anteriormente, me referi ao uso do client original da CipSoft (que é o client C++). Nas imagens que você postou, você apenas usou o OTClient.
Eu preciso confirmar se o problema ocorre em ambos os clients. Na hipótese destes canais de duelo aparecerem apenas no OTClient, tenho certeza de que a causa se encontra em algum arquivo do OTC (o que, para mim, serias novas águas, já que nunca me aventurei neste client).
Boa noite meu caro Zipter98.
Cara, agradeço imensamente pelo suporte dado a mim no decorrer destes problemas acima. vou dar o tópico como encerrado e tentar fuçar diversas formas para corrigir tal problema, que por sinal está me deixando louco kk. Mas obrigado mesmo assim!
Podem fechar o tópico.
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.



info
Grupo: Campones
Registrado: 08/03/16
Posts: 94
Reputação: +4
Gênero: Masculino
Eai pessoal do xTibia. Estou com um grande problema aqui no meu Duelo System de PDA.. quando chamo um jogador para Duelo abre uma janela no chat mostrando a quantidade de players, exemplo: 1 x 1 e também abre uma janela mostrando a quantidade de pokemons que vai ser no duelo, exemplo: 6 x 6.. eu queria que ao chamar não abrisse janela alguma no chat. Alguem poderia me ajudar? segue uma foto mostrando o erro.
INFO: TFS 0.3.6
Imagem 1 do Erro:
Imagem 2 do Erro:
Imagem 3 do Erro:
up
Editado Agosto 10 por lucasmourahere