Dennyz Dias 9 Postado Novembro 25, 2015 Share Postado Novembro 25, 2015 alguem me ajuda num script, estou fasendo uma quest o script consiste em player Pisa Tal piso e teleportado para lugar X e sumona com ele 8 monstro soq depois de 2 minutos os monstro sumonados sejao retirados Obrigado REP++ Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/ Compartilhar em outros sites More sharing options...
0 MatheusGlad 424 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 (editado) data\movements\scripts\nomedoscript.lua: local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < ) local sq = 3 -- Area 3x3 usar somente numeros impares > 2 local monster = "Demon" local time = 2 -- Tempo em minutos pra desaparecer function getUidsInArea(extr1, extr2) local dat = {} for y = extr1.y, extr2.y do for x = extr1.x, extr2.x do if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) end end end return dat end function summonAndRemove(monster, pos, t) local function removeCreatureEvent(uid) if isCreature(uid) then doRemoveCreature(uid) end end local uid = doSummonCreature(monster, pos) addEvent(removeCreatureEvent, t*1000, uid) end function onStepIn(cid, item, pos, frompos) if sq < 3 or sq%2 == 0 then return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2") end local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z}) if #uids == 0 then for y = tilepos.y, tilepos.y+sq-1 do for x = tilepos.x, tilepos.x+sq-1 do if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then doTeleportThing(cid, {x=x, y=y, z=tilepos.z}) else summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60) end end end else doTeleportThing(cid,frompos,true) return doPlayerSendCancel(cid, "There are people inside right now.") end end xml: <movevent type="StepIn" actionid="2930" event="script" value="nomedoscript.lua"/> Editado Novembro 26, 2015 por MatheusMkalo Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1676649 Compartilhar em outros sites More sharing options...
0 Dennyz Dias 9 Postado Novembro 26, 2015 Autor Share Postado Novembro 26, 2015 (editado) data\movements\scripts\nomedoscript.lua: local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < ) local sq = 3 -- Area 3x3 usar somente numeros impares > 2 local monster = "Demon" local time = 2 -- Tempo em minutos pra desaparecer function getUidsInArea(extr1, extr2) local dat = {} for y = extr1.y, extr2.y do for x = extr1.x, extr2.x do if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) end end end return dat end function summonAndRemove(monster, pos, t) local function removeCreatureEvent(uid) if isCreature(uid) then doRemoveCreature(uid) end end local uid = doSummonCreature(monster, pos) addEvent(removeCreatureEvent, t*1000, uid) end function onStepIn(cid, item, pos, frompos) if sq < 3 or sq%2 == 0 then return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2") end local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z}) if #uids == 0 then for y = tilepos.y, tilepos.y+sq-1 do for x = tilepos.x, tilepos.x+sq-1 do if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then doTeleportThing(cid, {x=x, y=y, z=tilepos.z}) else summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60) end end end else doTeleportThing(cid,frompos,true) return doPlayerSendCancel(cid, "There are people inside right now.") end end xml: <movevent type="StepIn" actionid="2930" event="script" value="nomedoscript.lua"/> @ vlw manooow shoow , era isso mesmo! Rep++ Editado Novembro 26, 2015 por Dennyz Dias Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1676657 Compartilhar em outros sites More sharing options...
0 Nickbhz 15 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 data\movements\scripts\nomedoscript.lua: local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < ) local sq = 3 -- Area 3x3 usar somente numeros impares > 2 local monster = "Demon" local time = 2 -- Tempo em minutos pra desaparecer function getUidsInArea(extr1, extr2) local dat = {} for y = extr1.y, extr2.y do for x = extr1.x, extr2.x do if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) end end end return dat end function summonAndRemove(monster, pos, t) local function removeCreatureEvent(uid) if isCreature(uid) then doRemoveCreature(uid) end end local uid = doSummonCreature(monster, pos) addEvent(removeCreatureEvent, t*1000, uid) end function onStepIn(cid, item, pos, frompos) if sq < 3 or sq%2 == 0 then return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2") end local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z}) if #uids == 0 then for y = tilepos.y, tilepos.y+sq-1 do for x = tilepos.x, tilepos.x+sq-1 do if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then doTeleportThing(cid, {x=x, y=y, z=tilepos.z}) else summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60) end end end else doTeleportThing(cid,frompos,true) return doPlayerSendCancel(cid, "There are people inside right now.") end end xml: <movevent type="StepIn" actionid="2930" event="script" value="nomedoscript.lua"/> Parabens pelo script... Teria como adicionar uma funçao? Quando se passar esses 2 minutos e os monstros for retirados aparecer um teleporte por 10 segundos para x lugar? Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1676659 Compartilhar em outros sites More sharing options...
0 MatheusGlad 424 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 (editado) Parabens pelo script... Teria como adicionar uma funçao? Quando se passar esses 2 minutos e os monstros for retirados aparecer um teleporte por 10 segundos para x lugar? local tilepos = {x=136, y=48, z=7} -- Posiçao do tile noroeste ( /\ < ) local sq = 3 -- Area 3x3 usar somente numeros impares > 2 local monster = "Demon" local time = 2 -- Tempo em minutos pra desaparecer local tptime = 10 -- tempo em segundos pra desaparecer tp local tppos = {x=135, y=48, z=7} -- lugar do tp local tpdest = {x=134,y=55, z=7} -- destino do tp function getUidsInArea(extr1, extr2) local dat = {} for y = extr1.y, extr2.y do for x = extr1.x, extr2.x do if isCreature(getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) then table.insert(dat, getThingFromPos({x=x, y=y, z=extr1.z, stackpos=255}).uid) end end end return dat end function summonAndRemove(monster, pos, t) local function removeCreatureEvent(uid) if isCreature(uid) then doRemoveCreature(uid) end end local uid = doSummonCreature(monster, pos) addEvent(removeCreatureEvent, t*1000, uid) end function createTpAndRemove(pos, topos, t) local function removeTp(pos) pos.stackpos = 1 local thing = getThingFromPos(pos) if thing.itemid == 1387 then doRemoveItem(thing.uid) end end doCreateTeleport(1387, topos, pos) addEvent(removeTp, t*1000, pos) end function onStepIn(cid, item, pos, frompos) if sq < 3 or sq%2 == 0 then return error("SOMENTE NUMEROS IMPARES MAIORES QUE 2") end local uids = getUidsInArea(tilepos, {x=tilepos.x+sq-1, y=tilepos.y+sq-1, z=tilepos.z}) if #uids == 0 then tppos.stackpos = 1 local tpthing = getThingFromPos(tppos) if tpthing.itemid == 1387 then doRemoveItem(tpthing.uid) end for y = tilepos.y, tilepos.y+sq-1 do for x = tilepos.x, tilepos.x+sq-1 do if y == tilepos.y+(sq-1)/2 and x == tilepos.x+(sq-1)/2 then doTeleportThing(cid, {x=x, y=y, z=tilepos.z}) else summonAndRemove(monster, {x=x, y=y, z=tilepos.z}, time*60) end end end addEvent(createTpAndRemove, time*60*1000, tppos, tpdest, tptime) else doTeleportThing(cid,frompos,true) return doPlayerSendCancel(cid, "There is people inside right now.") end end Editado Novembro 26, 2015 por MatheusMkalo Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1676682 Compartilhar em outros sites More sharing options...
0 Nickbhz 15 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 Caso os bixos morram antes desses 2 minutos, o tp aparece tb? Ou so vai aparecer dps dos 2 minutos mesmo? Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1676736 Compartilhar em outros sites More sharing options...
0 MatheusGlad 424 Postado Novembro 26, 2015 Share Postado Novembro 26, 2015 (editado) Vai aparecer, depois de 2 minutos sempre. Editado Novembro 26, 2015 por MatheusMkalo Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1676755 Compartilhar em outros sites More sharing options...
0 SkyLigh 453 Postado Novembro 29, 2015 Share Postado Novembro 29, 2015 Tópico movido para dúvidas / pedidos resolvidos. Link para o comentário https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/#findComment-1677013 Compartilhar em outros sites More sharing options...
Pergunta
Dennyz Dias 9
alguem me ajuda num script, estou fasendo uma quest
o script consiste em
player Pisa Tal piso e teleportado para lugar X e sumona com ele 8 monstro soq depois de 2 minutos os monstro sumonados sejao retirados
Obrigado REP++
Link para o comentário
https://xtibia.com/forum/topic/238005-piso-que-teleporta-player-e-sumona-monstro-depois-2-minutos-monstros-summonados-sao-removidos/Compartilhar em outros sites
7 respostass a esta questão
Posts Recomendados