Bepovi 0 Postado Outubro 28, 2015 Share Postado Outubro 28, 2015 boa noite. gostaria de saber como fazer uma porta ter um level mínimo e um level máximo para passar. ex: porta do LVL 30-60 Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/ Compartilhar em outros sites More sharing options...
0 Antharaz 93 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 Bepo, para não ficarmos lotando esse tópico de menssagens, me passe um contato seu, (skype ou qualquer coisa) para resolvermos isto o mais rápido possível, pode passar por MP ou por aqui, você quem sabe. Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674420 Compartilhar em outros sites More sharing options...
0 Antharaz 93 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 (editado) Isto vai variar de acordo com a porta que você irá usar, eu alterei o doors.lua supondo que você usaria uma das portas de quests que tem o level mínimo. Abra o arquivo doors.lua localizado em data\actions\scripts\other e substitua esta parte: if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid > 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid))) then doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return TRUE end Por esta: if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid > 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid))) then if item.uniqueid > 80000 and getPlayerLevel(cid) > (item.uniqueid - 80000) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You should have level "..(item.actionid - getItemLevelDoor(item.itemid)).."+ and "..(item.uniqueid - 80000).."-.") return true end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return TRUE end Agora para configurar qual o level máximo e mínimo da porta você faz assim, no actionid da porta você coloca 1000 + o level mínimo e no uniqueid da porta você coloca 80000 + o level máximo da porta. Ex: se você quiser uma porta que passe players entre os leveis 100 e 300 ficaria assim: actionid = 1100 e uniqueid = 80300. Como você não informou o seu tfs, eu testei no 1.0, caso dê algum erro deixe um link para o server base que você usa. Resultado: Editado Outubro 29, 2015 por Antharaz Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674317 Compartilhar em outros sites More sharing options...
0 Bepovi 0 Postado Outubro 29, 2015 Autor Share Postado Outubro 29, 2015 muito obrigado, vou testar jaja e te falo! estou usando o kpdo.. grato! Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674364 Compartilhar em outros sites More sharing options...
0 Bepoviown 0 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 (editado) Olá amigo, fiz o teste do seu script. Estou usando a base do KPDO. tentei usar o UniqueID 80000, porem no meu rme só aceita até 65535, então alterei seu script para usar o uniqueID 60000,porém quando abro o servidor recebo a seguinte mensagem:[Error - LuaScriptInterface : : LoadFile] data/actions/scripts/others/doors.lua:94:'<eof>' expected near 'end'Vale a pena ressaltar, que coloquei o seu script na seguinte linha: if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 189) then if(not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true endpois era a mais similar ao que você me falou no meu script.Segue script original abaixo:local function checkStackpos(item, position) position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local thing = getThingFromPos(position) position.stackpos = STACKPOS_TOP_FIELD local field = getThingFromPos(position) return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0) end local function doorEnter(cid, item, toPosition) doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition) end function onUse(cid, item, fromPosition, itemEx, toPosition) if(fromPosition.x ~= CONTAINER_POSITION and isPlayerPzLocked(cid) and getTileInfo(fromPosition).protection) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 189) then if(not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local gender = item.actionid - 186 if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender)) then if(gender ~= getPlayerSex(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local skull = item.actionid - 180 if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then if(skull ~= getCreatureSkullType(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local group = item.actionid - 150 if(group >= 0 and group < 30) then if(group > getPlayerGroupId(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local vocation = item.actionid - 100 if(vocation >= 0 and vocation < 50) then local playerVocationInfo = getVocationInfo(getPlayerVocation(cid)) if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return true end if(isInArray(specialDoors, item.itemid)) then if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.") end return true end if(isInArray(keys, item.itemid)) then if(itemEx.actionid > 0) then if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then doTransformItem(itemEx.uid, doors[itemEx.itemid]) return true end doPlayerSendCancel(cid, "The key does not match.") return true end return false end if(isInArray(horizontalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.y = newPosition.y + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then local pzDoorPosition = getTileInfo(doorPosition).protection local pzNewPosition = getTileInfo(newPosition).protection if((pzDoorPosition and not pzNewPosition and doorCreature.uid ~= cid) or (not pzDoorPosition and pzNewPosition and doorCreature.uid == cid and isPlayerPzLocked(cid))) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition) if(not isInArray(closingDoors, item.itemid)) then doTransformItem(item.uid, item.itemid - 1) end end return true end doTransformItem(item.uid, item.itemid - 1) return true end if(isInArray(verticalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.x = newPosition.x + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition) if(not isInArray(closingDoors, item.itemid)) then doTransformItem(item.uid, item.itemid - 1) end end return true end doTransformItem(item.uid, item.itemid - 1) return true end if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then if(item.actionid == 0) then doTransformItem(item.uid, doors[item.itemid]) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.") end return true end return false end Gostaria de saber se é necessário criar um actionID e UniqueID para a porta no actions.xmlDesde já agradeço a sua atenção! Muito obrigado. Editado Outubro 29, 2015 por Bepoviown Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674367 Compartilhar em outros sites More sharing options...
0 Antharaz 93 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 (editado) Odeio OTs pokemon, mas vamos lá, já que comecei a ajudar, vamos até o final. Não é necessário mudar o XML. Segue abaixo seu script modificado: local function checkStackpos(item, position) position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local thing = getThingFromPos(position) position.stackpos = STACKPOS_TOP_FIELD local field = getThingFromPos(position) return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0) end local function doorEnter(cid, item, toPosition) doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition) end function onUse(cid, item, fromPosition, itemEx, toPosition) if(fromPosition.x ~= CONTAINER_POSITION and isPlayerPzLocked(cid) and getTileInfo(fromPosition).protection) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) return true end if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 189) then if(not isPremium(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local gender = item.actionid - 186 if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender)) then if(gender ~= getPlayerSex(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local skull = item.actionid - 180 if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then if(skull ~= getCreatureSkullType(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local group = item.actionid - 150 if(group >= 0 and group < 30) then if(group > getPlayerGroupId(cid)) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end local vocation = item.actionid - 100 if(vocation >= 0 and vocation < 50) then local playerVocationInfo = getVocationInfo(getPlayerVocation(cid)) if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") return true end doorEnter(cid, item, toPosition) return true end if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then if item.uniqueid > 60000 and getPlayerLevel(cid) > (item.uniqueid - 60000) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You should have level "..(item.actionid - getItemLevelDoor(item.itemid)).."+ and "..(item.uniqueid - 60000).."-.") return true end doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return true end if(isInArray(specialDoors, item.itemid)) then if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then doorEnter(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.") end return true end if(isInArray(keys, item.itemid)) then if(itemEx.actionid > 0) then if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then doTransformItem(itemEx.uid, doors[itemEx.itemid]) return true end doPlayerSendCancel(cid, "The key does not match.") return true end return false end if(isInArray(horizontalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.y = newPosition.y + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then local pzDoorPosition = getTileInfo(doorPosition).protection local pzNewPosition = getTileInfo(newPosition).protection if((pzDoorPosition and not pzNewPosition and doorCreature.uid ~= cid) or (not pzDoorPosition and pzNewPosition and doorCreature.uid == cid and isPlayerPzLocked(cid))) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition) if(not isInArray(closingDoors, item.itemid)) then doTransformItem(item.uid, item.itemid - 1) end end return true end doTransformItem(item.uid, item.itemid - 1) return true end if(isInArray(verticalOpenDoors, item.itemid) and checkStackpos(item, fromPosition)) then local newPosition = toPosition newPosition.x = newPosition.x + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local doorCreature = getThingfromPos(doorPosition) if(doorCreature.itemid ~= 0) then if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition) if(not isInArray(closingDoors, item.itemid)) then doTransformItem(item.uid, item.itemid - 1) end end return true end doTransformItem(item.uid, item.itemid - 1) return true end if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then if(item.actionid == 0) then doTransformItem(item.uid, doors[item.itemid]) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.") end return true end return false end Caso dê algum erro, me passe o link do tópico com o ot para download e cliente. Editado Outubro 29, 2015 por Antharaz Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674370 Compartilhar em outros sites More sharing options...
0 Bepoviown 0 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 Peço desculpas pelo trabalho que te dei..Estou testando seu script, minha duvida é se no script que você fez agora por ultimo, eu devo manter oactionid da porta 1000 + o level mínimo já que você alterou a seguinte linha "if(item.actionid == 190"estou testando de varias formas aqui, e caso não der certo eu postarei aqui jajá.Grato!! Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674393 Compartilhar em outros sites More sharing options...
0 Antharaz 93 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 Peço desculpas pelo trabalho que te dei.. Estou testando seu script, minha duvida é se no script que você fez agora por ultimo, eu devo manter o actionid da porta 1000 + o level mínimo já que você alterou a seguinte linha "if(item.actionid == 190" estou testando de varias formas aqui, e caso não der certo eu postarei aqui jajá. Grato!! Eu não mechi nesta parte, pois já havia no script original, eu inseri mais abaixo o meu script ocm algumas modificações, o actionid você mantém 1000 + level mínimo Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674394 Compartilhar em outros sites More sharing options...
0 Bepoviown 0 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 O servidor abriu sem erros no doors.Porém ao clicar na porta recebo o erro: [Error - Action Interface] data/actuin/scripts/others/doors.lua:onUse Description: data/actuin/scripts/others/doors.lua:80: attempt to compare number with nil stack traceback: data/actuin/scripts/others/doors.lua:80 in function <data/actions/scripts/others/doors.lua:16>--------------------------------quando dou look na porta: 14:41 You see a gate of expertise for level 70.O servidor é esse:http://www.tibiaking.com/forum/topic/47080-pokemon-kpdopokemon-kpdo-exaioros-by-cater/#comment-272355Muito grato pela ajuda! Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674397 Compartilhar em outros sites More sharing options...
0 Bepoviown 0 Postado Outubro 29, 2015 Share Postado Outubro 29, 2015 OK! agradeço.. te mandei uma mensagem, porém esse forum tá meio loucão e não sei se enviou, então segue meu facebook:https://www.facebook.com/daniel.bredercruzGrato! Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674423 Compartilhar em outros sites More sharing options...
0 Danihcv 335 Postado Novembro 2, 2015 Share Postado Novembro 2, 2015 Tópico movido para dúvidas / pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/#findComment-1674704 Compartilhar em outros sites More sharing options...
Pergunta
Bepovi 0
boa noite. gostaria de saber como fazer uma porta ter um level mínimo e um level máximo para passar. ex: porta do LVL 30-60
Link para o comentário
https://xtibia.com/forum/topic/237596-pedido-porta-com-lvl-m%C3%A1ximo-poketibia/Compartilhar em outros sites
10 respostass a esta questão
Posts Recomendados