Postado Julho 21, 2016 8 anos Galera vou ser bem objetivo no problema. Consegui montar a Yalahar Quest no server. E está funcionando normal, as waves, o sqm no void, só poder clicar 1x no globo, os portais fechando... O que não funcionou é que em certo momento o Azerus da sala DEVERIA ser removido, para entrar o Azerus1. Mas isso não funciona e ficam dois Azerus na sala. Bem como o clear da room também não funciona e os próximos a fazer já começam com bixos que sobraram. movements/scripts function onStepIn(cid, item, position, fromPosition) --Config--> local queststatus = getPlayerStorageValue(cid, 50001) --EndConfig--> if item.actionid == 1974 and queststatus == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "It seems by defeating Azerus you have stoped this army from entering your world! Better leave this ghastly place forever.") setPlayerStorageValue(cid, 4765, 1) return TRUE end if item.actionid == 1973 and queststatus == -1 then -- Here is the code start: starting={x = 480, y = 178, z = 7, stackpos = 253} checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos} ending={x = 500, y = 199, z = 7, stackpos = 253} players=0 totalmonsters=0 monster = {} repeat creature= getThingfromPos(checking) if creature.itemid > 0 then if getPlayerAccess(creature.uid) == 0 then players=players+1 end if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then totalmonsters=totalmonsters+1 monster[totalmonsters]=creature.uid end end checking.x=checking.x+1 if checking.x>ending.x then checking.x=starting.x checking.y=checking.y+1 end until checking.y>ending.y if players==0 then trash= {x = 470, y = 188, z = 7} current=0 repeat current=current+1 doTeleportThing(monster[current],trash) until current>=totalmonsters end -- Here is the end of it doTeleportThing(cid, player_pos_entrada) doSendMagicEffect(player_pos_entrada, 10) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You already done this quest!') end end action/scripts function onUse(cid, item, frompos, item2, topos) --Config--> local statue_pos = {x = 490, y = 188, z = 7} local new_portal_pos = {x = 490, y = 189, z = 7, stackpos = 1} local new_pos = {x = 542, y = 196, z = 5} local crystal_pos = {x = 490, y = 197, z = 7} --End Config--> function Potwoory1() 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(Potwoory2, 7 * 700) end function Potwoory2() 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 function Potwoory3() 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 Potwoory4() 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 function NewPortal() doCreateTeleport(1387, new_pos, new_portal_pos) addEvent(RemoveAll, 30 * 1000) end function RemoveAll() doRemoveItem(getThingfromPos(new_portal_pos).uid,1) doItemSetAttribute(getTileItemById(crystal_pos, 7493).uid, "aid", 57500) end if item.aid == 57500 and getThingfromPos(new_portal_pos).itemid ~= 17668 then doCreateItem(17668,1,new_portal_pos) addEvent(Potwoory1, 0) doItemSetAttribute(getTileItemById(crystal_pos, 7493).uid, "aid", 57501) else doPlayerSendTextMessage(cid,18,"Sorry, not possible.") end return TRUE end Agradeço quem puder ajudar. Editado Julho 21, 2016 8 anos por Felipe Lotz (veja o histórico de edições)
Postado Julho 22, 2016 8 anos @Felipe Lotz Teste isso Spoiler function onUse(cid, item, frompos, item2, topos) local statue_pos = {x = 490, y = 188, z = 7} local new_portal_pos = {x = 490, y = 189, z = 7, stackpos = 1} local new_pos = {x = 542, y = 196, z = 5} local crystal_pos = {x = 490, y = 197, z = 7} local room = { fromX = 1648, fromY = 1786, fromZ = 6, toX = 1655, toY = 1794, toZ = 6 } function Potwoory1() 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(Potwoory2, 7 * 700) end function Potwoory2() 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 function Potwoory3() 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 Potwoory4() 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 function NewPortal() doCreateTeleport(1387, new_pos, new_portal_pos) addEvent(RemoveAll, 30 * 1000) end if item.aid == 57500 and getThingfromPos(new_portal_pos).itemid ~= 17668 then doCreateItem(17668,1,new_portal_pos) addEvent(Potwoory1, 0) doItemSetAttribute(getTileItemById(crystal_pos, 7493).uid, "aid", 57501) else doPlayerSendTextMessage(cid,18,"Sorry, not possible.") end local thing = getThingfromPos(room) if thing.itemid > 0 then doRemoveCreature(thing.uid) end return TRUE end Em local room, altere para a posição inferior direito, ao superior esquerdo, que enquadram a sala onde acontece os summons.
Postado Julho 22, 2016 8 anos Autor @VictorTasquinTestei aqui, ele manda a primeira wave e para. Isso é movements/scripts/azerus.lua function onStepIn(cid, item, position, fromPosition) --Config--> local queststatus = getPlayerStorageValue(cid, 50001) --EndConfig--> if item.actionid == 1974 and queststatus == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "It seems by defeating Azerus you have stoped this army from entering your world! Better leave this ghastly place forever.") setPlayerStorageValue(cid, 4765, 1) return TRUE end if item.actionid == 1973 and queststatus == -1 then -- Here is the code start: starting={x = 478, y = 178, z = 7, stackpos = 253} checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos} ending={x = 499, y = 199, z = 7, stackpos = 253} players=0 totalmonsters=0 monster = {} repeat creature= getThingfromPos(checking) if creature.itemid > 0 then if getPlayerAccess(creature.uid) == 0 then players=players+1 end if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then totalmonsters=totalmonsters+1 monster[totalmonsters]=creature.uid end end checking.x=checking.x+1 if checking.x>ending.x then checking.x=starting.x checking.y=checking.y+1 end until checking.y>ending.y if players==0 then trash= {x = 537, y = 181, z = 6} current=0 repeat current=current+1 doTeleportThing(monster[current],trash) until current>=totalmonsters end -- Here is the end of it doTeleportThing(cid, player_pos_entrada) doSendMagicEffect(player_pos_entrada, 10) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You already done this quest!') end end Substitui algumas coisas mas agora não aparece nem a primeira wave. Editado Julho 22, 2016 8 anos por Felipe Lotz (veja o histórico de edições)
Postado Julho 22, 2016 8 anos Hoje estou meio apertado pra estudar o script a fundo. Se puder aguardar até amanhã eu vejo pra você. Mas vou precisar de todos os scripts do sistema, se possivel.
Postado Julho 23, 2016 8 anos Autor @Ragnar Lothbrook actions.xml <!-- Yalaharian 10th --> <action actionid="58261" event="script" value="quests/azerus.lua"/> <action actionid="58263" event="script" value="quests/azerus.lua"/> <action actionid="58267" event="script" value="quests/azeruschest.lua"/> <action actionid="58268" event="script" value="quests/azeruschest.lua"/> <action actionid="58269" event="script" value="quests/azeruschest.lua"/> actions/scripts/azerus.lua local BlindField = {x = 488, y = 179, z = 7, stackpos=1} function mapArea(fromPos, toPos, stack) local pos = {x=fromPos.x, y=fromPos.y-1, z=fromPos.z} return function() if (pos.y < toPos.y) then pos.y = pos.y+1 elseif (pos.x <= toPos.x) then pos.y = fromPos.y pos.x = pos.x+1 else pos.x = fromPos.x pos.y = fromPos.y pos.z = pos.z+1 end if (pos.x <= toPos.x and pos.y <= toPos.y or pos.z < toPos.z) then if (stack == nil) then return pos else pos.stackpos = stack return pos, getThingfromPos(pos) end end end end function getMonstersfromArea(fromPos, toPos) local monsters = {} for _, thing in mapArea(fromPos, toPos, 253) do if isMonster(thing.uid) == TRUE then table.insert(monsters, thing.uid) end end local bfm = getThingfromPos(BlindField) if isMonster(bfm.uid) == TRUE then table.insert(monsters, bfm.uid) end return monsters end function onUse(cid, item, fromPosition, itemEx, toPosition) local topLeft = {x = 480, y = 178, z = 7} local buttomRight = {x = 499, y = 198, z = 7} local monsters = getMonstersfromArea(topLeft, buttomRight) local monsters1 = getMonstersfromArea(topLeft, buttomRight) local tp = {x = 490, y = 197, z = 7} local glo = {x = 490, y = 188, z = 7} local function FirstWave() doSummonCreature("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z}) doSummonCreature("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z}) doSummonCreature("Azerus", {x=glo.x,y=glo.y - 5,z=glo.z}) end local function FifthWave() doSummonCreature("Rift Worm", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Worm", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 4,z=glo.z}) doSummonCreature("Rift Worm", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("Rift Worm", {x=glo.x,y=glo.y + 5,z=glo.z}) end local function SecondWave() local monsters1 = getMonstersfromArea(topLeft, buttomRight) for _, monster in pairs(monsters1) do if getCreatureName(monster) == "Azerus" then doRemoveCreature(monster) end end doSummonCreature("Azerus1", {x=glo.x,y=glo.y - 5,z=glo.z}) doSummonCreature("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z}) doSummonCreature("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z}) end local function SixthWave() doSummonCreature("Rift Brood", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Brood", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 4,z=glo.z}) doSummonCreature("Rift Brood", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("Rift Brood", {x=glo.x,y=glo.y + 5,z=glo.z}) end local function ThirdWave() local monsters1 = getMonstersfromArea(topLeft, buttomRight) for _, monster in pairs(monsters1) do if getCreatureName(monster) == "Azerus" then doRemoveCreature(monster) end end doSummonCreature("Azerus2", {x= glo.x - 5,y=glo.y,z=glo.z}) doSummonCreature("Rift Scythe", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Scythe", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z}) end local function ThirdWave1() -- with 2s delay doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 4,z=glo.z}) doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("Rift Scythe", {x=glo.x,y=glo.y + 5,z=glo.z}) end local function FourthWave() doSummonCreature("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z}) end local function SevenWave() local monsters1 = getMonstersfromArea(topLeft, buttomRight) for _, monster in pairs(monsters1) do if getCreatureName(monster) == "Azerus" then doRemoveCreature(monster) end end doSummonCreature("Azerus3", {x= glo.x - 5,y=glo.y,z=glo.z}) doSummonCreature("War Golem", {x= glo.x - 4,y=glo.y,z=glo.z}) doSummonCreature("War Golem", {x= glo.x + 4,y=glo.y,z=glo.z}) doSummonCreature("War Golem", {x=glo.x,y=glo.y - 4,z=glo.z}) doSummonCreature("War Golem", {x=glo.x,y=glo.y + 4,z=glo.z}) end local function Glllobe() local monst = getMonstersfromArea(topLeft, buttomRight) for i = 1, #monst do doRemoveCreature(monst[i]) end local item1 = getTileItemById(glo, 9767) doItemSetAttribute(item1.uid, "aid", 58261) end local function createWall(p) local janek = doCreateItem(1387,1,{x = 491, y = 199, z = 6}) doItemSetAttribute(janek, "aid", 9105) end local function createWalll(i) local ela = doCreateItem(1387,1,{x = 490, y = 197, z = 7}) doItemSetAttribute(ela, "aid", 9106) end local wall0 = {x = 491, y = 199, z = 6, stackpos=1} local getwall0 = getThingfromPos(wall0) local wall1 = {x = 490, y = 197, z = 7, stackpos=1} local getwall1 = getThingfromPos(wall1) local monsters = getMonstersfromArea(topLeft, buttomRight) local monsters1 = getMonstersfromArea(topLeft, buttomRight) local tele_chk = getTileItemById(tp, 1387) if item.actionid == 58261 then doItemSetAttribute(item.uid, "aid", 58263) end if tele_chk.uid > 0 then doRemoveItem(getTileItemById(tp,1387).uid) doRemoveItem(getwall0.uid,1) addEvent(FirstWave, 0) addEvent(FifthWave, 30000) addEvent(SecondWave, 60000) addEvent(SixthWave, 90000) addEvent(ThirdWave, 120000) addEvent(ThirdWave1, 150000) addEvent(FourthWave, 180000) addEvent(SevenWave, 210000) addEvent(Glllobe, 400000) p = {wallid = getwall0.itemid} addEvent(createWall, 300*1000, p) i = {wallid = getwall1.itemid} addEvent(createWalll, 300*1000, i) end if item.actionid == 58263 then doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1) end return TRUE end movements.xml <!-- Yalahar 10th --> <movevent type="StepIn" itemid="9738" event="script" value="azerusdeath.lua"/> <movevent type="StepIn" actionid="58262" event="script" value="azerusarmy.lua"/> movements/scripts/azerusdeath.lua function onStepIn(cid, item, position, fromPosition) local yalahar = {x = 543, y = 185, z = 5, stackpos=253} if item.itemid == 9738 then doTeleportThing(cid, yalahar, TRUE) doSendMagicEffect(yalahar,12) end return TRUE end movements/scripts/azerusarmy.lua function onStepIn(cid, item, position, fromPosition) if item.actionid == 58262 then if getPlayerStorageValue(cid, 10510) == -1 then doCreatureSay(cid, "It seems by defating Azerus you have stopped this army from entering your world! Better leave this gastly place forever.", TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 10510, 1) end return TRUE end end Obs.: Lembrando que o script está funcionando, o problema é que no final ele não faz o clean dos monstros na sala para o próximo time a fazer... E os portais de entrada e saída quando voltam a aparecer não funcionam.
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.