Albert José 0 #1 Postado 25 Março, 2009 (editado) Padrão de Postagem Nome: Sistema De Portas & Tiles Avançado! Versão: Não tenho certeza mais acho que de 8.0 para cima... Tipo do script: Action Servidor Testado: [8.4] The Forgotten Server v0.3.2 (Crying Damson) Autor: slawkens Comentario: Este pack ira adicionar novas features nas suas portas, e special tiles. Sistema de portas & tiles avançado. Créditos: slawkens Tive apenas o trabalho de traduzir e postar aqui para vocês e espero que gostem! :blush: Usos: Você pode usar em level doors ou tiles especiais (Isto pode ser usado nos tiles usados em depots -ex. id: 416) Coloque a actionid para isto: -100+vocationID - somente por vocações example - 104 - Somente Knight podem passar (Elite Knight também!), você deve colocar actionid = 108 para que somente Elite Knights possam passar. Isto funciona com vocações customizadas também! -200+groupID - somente por grupo Exemplo - 202 - Somente Tutores podem passar. -300+skullID - Somente players com Skull Exemplo - 304 - Somente players com RED_SKULL podem entrar -400 - somente mulheres podem entrar -401 - somente homens -500 - somente premium accounts Estes são somente para TILES: -501 - tile - somente para players -502 - tile - somente para monstros -503 - tile - somente para NPCs -506 - tile - não podem passar players -507 - tile - não podem passar monstros -508 - tile - não podem passar NPCs -504 - tile - não podem passar players (somente monstros & NPCs podem entrar) [Deprecated - NÃO use, prefira usar 506] OK Agora coloque isso! Troque em actions/scripts/other/doors.lua por isso: PLAYERSEX_FEMALE = 0 PLAYERSEX_MALE = 1 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) if(item.uid ~= thing.uid and thing.itemid >= 100 or field.itemid ~= 0) then return FALSE end return TRUE end local function doPlayerOpenDoor(cid, item, toPosition) doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, toPosition, TRUE) end function onUse(cid, item, fromPosition, itemEx, toPosition) if(getItemLevelDoor(item.itemid) > 0) then if(item.actionid == 500) then if(isPremium(cid) ~= TRUE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Premium account required to enter.") return TRUE end doPlayerOpenDoor(cid, item, toPosition) return TRUE end local gender = item.actionid - 400 if(gender == PLAYERSEX_FEMALE or gender == PLAYERSEX_MALE) then local playerSex = getPlayerSex(cid) if(playerSex ~= gender) then local tmp = {"females", "males"} doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Doors only for " .. tmp[gender+ 1] .. ".") return TRUE end doPlayerOpenDoor(cid, item, toPosition) return TRUE end local skull = item.actionid - 300 if(skull >= 0 and skull <= 50) then local playerSkull = getCreatureSkullType(cid) if(skull == 0 and playerSkull ~= SKULL_NONE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Doors only for players without skull.") return TRUE elseif(playerSkull ~= skull) then local skulls = {"yellow", "green", "white", "red"} doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Doors only for players with " .. skulls[playerSkull] .. " skulls.") return TRUE end doPlayerOpenDoor(cid, item, toPosition) return TRUE end local group = item.actionid - 200 if(group >= 0 and group <= 50) then local playerGroup = getPlayerGroupId(cid) if(playerGroup < group) then local tmp = getGroupInfo(group) if(tmp ~= FALSE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Doors only for " .. tmp.name .. "s.") end return TRUE end doPlayerOpenDoor(cid, item, toPosition) return TRUE end local vocation = item.actionid - 100 if(vocation >= 0 and vocation <= 50) then local playerVocation = getVocationInfo(getPlayerVocation(cid)) if(playerVocation.id ~= vocation and playerVocation.fromVocation ~= vocation) then local tmp = getVocationInfo(vocation) if(tmp ~= FALSE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Doors only for " .. tmp.name .. "s.") end return TRUE end doPlayerOpenDoor(cid, item, toPosition) return TRUE end if(item.actionid > 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid))) then doPlayerOpenDoor(cid, item, toPosition) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.") end return TRUE end if(isInArray(specialDoors, item.itemid) == TRUE) then if(item.actionid == 0 or getPlayerStorageValue(cid, item.actionid) ~= -1) then doPlayerOpenDoor(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) == TRUE) then if(itemEx.actionid > 0) then if(item.actionid == itemEx.actionid) then if doors[itemEx.itemid] ~= nil then doTransformItem(itemEx.uid, doors[itemEx.itemid]) return TRUE end end doPlayerSendCancel(cid, "The key does not match.") return TRUE end return FALSE end if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition) == TRUE) 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 if(getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition, TRUE) if(isInArray(closingDoors, item.itemid) ~= TRUE) 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) == TRUE and checkStackpos(item, fromPosition) == TRUE) 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(getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid) then doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE) else doTeleportThing(doorCreature.uid, newPosition, TRUE) if(isInArray(closingDoors, item.itemid) ~= TRUE) 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) == TRUE) 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 Troque em movements/scripts/tiles.lua por isto: PLAYERSEX_FEMALE = 0 PLAYERSEX_MALE = 1 local increasingItems = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215} local decreasingItems = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3217, [3215] = 3202} local depots = {2589, 2590, 2591, 2592} local function doPlayerMoveBack(cid, position, fromPosition) doTeleportThing(cid, fromPosition, FALSE) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) end local creatureFunc = {isPlayer, isMonster, isNpc} function onStepIn(cid, item, position, fromPosition) if(not increasingItems[item.itemid]) then return TRUE end if(isPlayer(cid) ~= TRUE or isPlayerGhost(cid) ~= TRUE) then doTransformItem(item.uid, increasingItems[item.itemid]) end if(item.actionid >= 501 and item.actionid <= 503) then local f = creatureFunc[item.actionid-500] if(f(cid) ~= TRUE) then doPlayerMoveBack(cid, position, fromPosition) end return TRUE end if(item.actionid == 504 and isPlayer(cid) == TRUE) then doPlayerMoveBack(cid, position, fromPosition) return TRUE end if(item.actionid >= 506 and item.actionid <= 508) then local f = creatureFunc[item.actionid-505] if(f(cid) == TRUE) then doPlayerMoveBack(cid, position, fromPosition) end return TRUE end --rest of the script is reserved only for players ) if(isPlayer(cid) ~= TRUE) then return TRUE end if(item.actionid == 500 and isPremium(cid) ~= TRUE) then doPlayerMoveBack(cid, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Premium account required to enter.") return TRUE end local gender = item.actionid - 400 if(gender == PLAYERSEX_FEMALE or gender == PLAYERSEX_MALE) then local playerSex = getPlayerSex(cid) if(playerSex ~= gender) then local tmp = {"females", "males"} doPlayerMoveBack(cid, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only " .. tmp[gender+ 1] .. " can enter.") end return TRUE end local skull = item.actionid - 300 if(skull >= 0 and skull <= 50) then local playerSkull = getCreatureSkullType(cid) if(skull == 0 and playerSkull ~= SKULL_NONE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only players without skull can enter.") doPlayerMoveBack(cid, position, fromPosition) elseif(playerSkull ~= skull) then local skulls = {"yellow", "green", "white", "red"} doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only players with " .. skulls[playerSkull] .. " skull can enter.") doPlayerMoveBack(cid, position, fromPosition) end return TRUE end local group = item.actionid - 200 if(group >= 0 and group <= 50) then local playerGroup = getPlayerGroupId(cid) if(playerGroup < group) then doPlayerMoveBack(cid, position, fromPosition) local tmp = getGroupInfo(group) if(tmp ~= FALSE) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only " .. tmp.name .. "s can enter.") end end return TRUE end local vocation = item.actionid - 100 if(vocation >= 0 and vocation <= 50) then local playerVocation = getVocationInfo(getPlayerVocation(cid)) if(playerVocation.id ~= vocation and playerVocation.fromVocation ~= vocation) then local tmp = getVocationInfo(vocation) if(tmp ~= FALSE) then doPlayerMoveBack(cid, position, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only " .. tmp.name .. "s can enter.") end end return TRUE end if(item.actionid > 1000) then if(getPlayerLevel(cid) < item.actionid - 1000) then doPlayerSendCancel(cid, "You need " .. item.actionid - 1000 .. " level to enter here.") doPlayerMoveBack(cid, position, fromPosition) end elseif(getTileInfo(position).protection) then local depotPos = getPlayerLookPos(cid) depotPos.stackpos = 3 -- ground = 0, table = 1, depot should be 2 --local depot = getThingFromPos(depotPos) local depot for i = 0, #depots do depot = getTileItemById(depotPos, depots[i]) if(depot.uid > 0) then break end end if(depot.uid > 0 and isInArray(depots, depot.itemid) == TRUE) then local depotItems = getPlayerDepotItems(cid, getDepotId(depot.uid)) if(depotItems < 2) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your depot contains 1 item.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " items.") end end end return TRUE end function onStepOut(cid, item, position, fromPosition) if(decreasingItems[item.itemid] ~= nil) then if(isPlayer(cid) ~= TRUE or isPlayerGhost(cid) ~= TRUE) then doTransformItem(item.uid, decreasingItems[item.itemid]) end end return TRUE end Não seja um (SS) Sangue-Suga... Comente e se puder doe OT$! Editado 25 Março, 2009 por Albert José Revisão do tópico. Compartilhar este post Link para o post
Mock 32 #2 Postado 27 Março, 2009 (editado) Comentario: <>Mals pensei q era o script q ja vinha do distro. (ps gostei da prota de sexo xD) da pra fazer banheiro masculino e feminino no tibia. Aprovado & Movido Editado 28 Março, 2009 por Mock Compartilhar este post Link para o post
Albert José 0 #3 Postado 29 Março, 2009 Obrigado por reconciderar e aprovar Mock!!! Se o pessoal que for testando puder comentar em que versões esta funcionando depois edito no tópico. Compartilhar este post Link para o post
KutyKutyx3 1 #4 Postado 29 Março, 2009 O script tá show, mas achei que ficou mal explicado e mal traduzido tbm.. Se puder editar o tópico ficaria melhor. Abraços. Compartilhar este post Link para o post
Albert José 0 #5 Postado 29 Março, 2009 O script tá show, mas achei que ficou mal explicado e mal traduzido tbm.. Se puder editar o tópico ficaria melhor. Abraços. Não acho que esteja mal explicado!? :style: Oque você não entendeu? Talvez possa lhe ajudar... E traduzi ao "pé da letra" :louco: Obrigado por comentar! (Y) Compartilhar este post Link para o post
Shyzoul 0 #8 Postado 30 Março, 2009 uma duvida tem que troca TUDO dos tiles e doors ? ou so add issu aee? Compartilhar este post Link para o post
surexx 0 #9 Postado 30 Março, 2009 na boa velho nao intendi nada nesse tua explicação ai :thumbsdown: da uma editada nesse topico ae valeu! Compartilhar este post Link para o post
Albert José 0 #10 Postado 30 Março, 2009 (editado) Oo' issu é bom tesaum ;D Ai, ai, ai... ui, ui, ui; :louco: uma duvida tem que troca TUDO dos tiles e doors ? ou so add issu aee? Tem que trocar tudo! :w00t: na boa velho nao intendi nada nesse tua explicação ai :thumbsdown:da uma editada nesse topico ae valeu! Se você pudesse me dizer oque você não intendeu!? Acredito que você precisa de ter o minimo de conhecimento possivel para frequentar essa area ja que não posso ensinar tudo... Quando você "instala" este sistema em seu ot (troca os arquivos), não é possivel que você não tenha intendido que após este procedimento só é preciso por exemplo adicionar o actionid: 400 em uma leveldoor para que somente mulheres possam passar pela mesma? Se você não intendeu isso... :louco: Obrigado por comentar... Editado 30 Março, 2009 por Albert José Compartilhar este post Link para o post
Zathao 0 #11 Postado 1 Abril, 2009 Íncrível , muito bom trabalho , vlw veio Compartilhar este post Link para o post
Needles ~ 0 #12 Postado 1 Abril, 2009 Muito bom, creio que irá ajudar bastante pessoas. Obrigado por trazer a OTNet. Att, NdS~ Compartilhar este post Link para o post
difernandes 0 #13 Postado 2 Abril, 2009 Eu uso e pega normal mas n peguei neste forum ou la ou akit em alguém ripando Compartilhar este post Link para o post
Masterious 0 #15 Postado 14 Abril, 2009 oO' caralho..muito bom...;D Obrigado Compartilhar este post Link para o post
chupetta 0 #16 Postado 24 Abril, 2009 Muito bom tópico esse seu ae eu tava precisando dele pro meu ot pq algumas doors q eu necessitava nao estavam funfando uns devidos scripts,mesmo assim vlwww Compartilhar este post Link para o post
mercav800 0 #17 Postado 28 Abril, 2009 fiko manero mtu diferente vlw Compartilhar este post Link para o post
Albert José 0 #18 Postado 1 Maio, 2009 Galera quero pedir desculpas por ter abandonado varios de meus tópicos aqui no forum mas é que estou muito ocupado e espero em breve voltar a participar ativamente do forum! Muito obrigado pelos comentarios e caso saia alguma atualização peço que postem porque estou meio sem tempo!!! Até mais. Compartilhar este post Link para o post
kaijr 0 #19 Postado 2 Maio, 2009 Script legal mais adiciona uns efeitos tambem tipo nos pisos com action que colocar no depot coloca praa subir: depot Compartilhar este post Link para o post
Insaend 0 #20 Postado 1 Agosto, 2011 opaa gosteiii tambem.. Aprovado... Da pra fazer um area de hunt ou ate cidade so pra redskull Compartilhar este post Link para o post