Postado Novembro 4, 2014 10 anos bom a minha yalahar esta com um probleminha ela nao remove os monstros quando algum more ai quando o player volta ele pode ficar entrando e saindo do portal atacando o azerus asim que o azerus more ele e teleportado para a sala de itens aki ta o script da yalahar local config = { fromPos = {x=178,y=411,z=10}, -- posição superior esquerda do mapa, da area em que esta mapeado a area. toPos = {x=201,y=433,z=10} -- posição inferior direita do mapa, da area em que esta mapeado a area. } --Config--> local statue_pos = {x = 190, y = 423, z = 10} -- posição do globo local portal_quest01_pos = {x = 190, y = 432, z = 10, stackpos = 2} -- posição do tp no andar do globo local portal_quest02_pos = {x = 191, y = 434, z = 9, stackpos = 2} -- posição do tp no andar de cima do globo local removeFields = {1487,1492,1493,1494} -- tiles que são removidos ao sumonar os monsters. --End Config--> function removeFieldsTile() -- by jhon992 local positionsCheck = {} local cFromPos = config.fromPos local cToPos = config.toPos for i = cFromPos.x, cToPos.x do positionsCheck[#positionsCheck+1] = {x=i, y = cFromPos.y, z = cFromPos.z, stackpos = 0} for j = cFromPos.y+1, cToPos.y do positionsCheck[#positionsCheck+1] = {x=i, y = j, z = cFromPos.z, stackpos = 0} end end for j=1, #positionsCheck do for i = 1, 5 do positionsCheck[j].stackpos = i local tile = getTileThingByPos(positionsCheck[j]) if isInArray(removeFields, tile.itemid) then doRemoveItem(tile.uid) end end end end function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 102504) > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você ja completou esta quest!") return true elseif getMonsterInAreaAz() > 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não pode usar isto, existe monstros na área!") return true end function Potwory1() removeFieldsTile() if math.random (1,8) == 4 then doCreateMonster('Rift Brood', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster("Azerus", {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) addEvent(Potwory2, 30 * 1000) else doCreateMonster('Rift Brood', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster("Azerus", {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) addEvent(Potwory2, 30 * 1000) end addEvent(RemovePortalAz, 240*1000) end function Potwory2() removeFieldsTile() removeAzerusMonstersInArea() doCreateMonster('Rift Brood', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Brood', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Worm', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster("Azerus1", {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) addEvent(Potwory3, 35 * 1000) end function Potwory3() removeFieldsTile() removeAzerusMonstersInArea() doCreateMonster('Rift Scythe', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Scythe', {x = statue_pos.x+1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Scythe', {x = statue_pos.x+1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('Rift Scythe', {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster("Azerus2", {x = statue_pos.x-1, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) addEvent(Potwory4, 40 * 1000) end function Potwory4() removeFieldsTile() removeAzerusMonstersInArea() doCreateMonster('Azerus', {x = statue_pos.x, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('War Golem', {x = statue_pos.x+1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('War Golem', {x = statue_pos.x-1, y = statue_pos.y+1, z = statue_pos.z, stackpos = 253}) doCreateMonster('War Golem', {x = statue_pos.x, y = statue_pos.y-1, z = statue_pos.z, stackpos = 253}) doCreateMonster('War Golem', {x = statue_pos.x-1, y = statue_pos.y, z = statue_pos.z, stackpos = 253}) end if item.uid == 11223 and getThingfromPos(portal_quest01_pos).itemid ~= 9772 then doCreateItem(9772,1,portal_quest01_pos) doCreateItem(9772,1,portal_quest02_pos) addEvent(Potwory1, 0) else doPlayerSendTextMessage(cid,22,"Sorry, not possible.") end return true end function RemovePortalAz() if #getPlayerInAreaAz(config.fromPos, config.toPos) <= 0 then doRemoveItem(getThingfromPos(portal_quest01_pos).uid,1) doRemoveItem(getThingfromPos(portal_quest02_pos).uid,1) else addEvent(RemovePortalAz, 10000) end end function getPlayerInAreaAz(fromPos, toPos) -- by jami local online = getPlayersOnline() local players = {} for i=1, #online do if isInArea(getPlayerPosition(online[i]), fromPos, toPos) then players[#players+1] = online[i] end end return players end function getMonsterInAreaAz() -- by jami local positionsCheck = {} local quantMonster = 0 for i = config.fromPos.x, config.toPos.x do positionsCheck[#positionsCheck+1] = {x=i, y = config.fromPos.y, z = config.fromPos.z, stackpos = 0} for j = config.fromPos.y+1, config.toPos.y do positionsCheck[#positionsCheck+1] = {x=i, y = j, z = config.fromPos.z, stackpos = 0} end end for j=1, #positionsCheck do for i = 0, 255 do positionsCheck[j].stackpos = i local tile = getTileThingByPos(positionsCheck[j]) if isMonster(tile.uid) then if isMonster(tile.uid) and not isSummon(tile.uid) then quantMonster = quantMonster + 1 end end end end return quantMonster end function removeAzerusMonstersInArea() -- by jhon992 local positionsCheck = {} for i = config.fromPos.x, config.toPos.x do positionsCheck[#positionsCheck+1] = {x=i, y = config.fromPos.y, z = config.fromPos.z, stackpos = 0} for j = config.fromPos.y+1, config.toPos.y do positionsCheck[#positionsCheck+1] = {x=i, y = j, z = config.fromPos.z, stackpos = 0} end end for j=1, #positionsCheck do for i = 0, 255 do positionsCheck[j].stackpos = i local tile = getTileThingByPos(positionsCheck[j]) if isMonster(tile.uid) then if getCreatureName(tile.uid) == "Azerus" then doRemoveCreature(tile.uid) end end end end end se nao der se alguem puder me ajuda pode ser um portal que remove todos os monstros asim quando o portal estiver liberado e ele entra todos os monstro da quela area serao removidos se alguem puder me ajuda de alguma forma agradeço desde ja!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.