diff --git a/build/built-jar.properties b/build/built-jar.properties index 544ef1d2b0..8f0c3b6a23 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Wed, 21 Jun 2017 00:41:12 -0300 +#Mon, 26 Jun 2017 01:21:39 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= diff --git a/build/classes/net/server/channel/handlers/AllianceOperationHandler.class b/build/classes/net/server/channel/handlers/AllianceOperationHandler.class index 074adff457..e40b4b887e 100644 Binary files a/build/classes/net/server/channel/handlers/AllianceOperationHandler.class and b/build/classes/net/server/channel/handlers/AllianceOperationHandler.class differ diff --git a/build/classes/scripting/AbstractPlayerInteraction.class b/build/classes/scripting/AbstractPlayerInteraction.class index 84288ec78e..20b610c522 100644 Binary files a/build/classes/scripting/AbstractPlayerInteraction.class and b/build/classes/scripting/AbstractPlayerInteraction.class differ diff --git a/build/classes/scripting/event/EventInstanceManager$1.class b/build/classes/scripting/event/EventInstanceManager$1.class index dd34b12862..0f4ed955cc 100644 Binary files a/build/classes/scripting/event/EventInstanceManager$1.class and b/build/classes/scripting/event/EventInstanceManager$1.class differ diff --git a/build/classes/scripting/event/EventInstanceManager$2.class b/build/classes/scripting/event/EventInstanceManager$2.class index 2c054d895f..276cb8f011 100644 Binary files a/build/classes/scripting/event/EventInstanceManager$2.class and b/build/classes/scripting/event/EventInstanceManager$2.class differ diff --git a/build/classes/scripting/event/EventInstanceManager$3.class b/build/classes/scripting/event/EventInstanceManager$3.class index 07a8dce64d..627b8dd738 100644 Binary files a/build/classes/scripting/event/EventInstanceManager$3.class and b/build/classes/scripting/event/EventInstanceManager$3.class differ diff --git a/build/classes/scripting/event/EventInstanceManager.class b/build/classes/scripting/event/EventInstanceManager.class index 2991e2c89f..f73011b3a8 100644 Binary files a/build/classes/scripting/event/EventInstanceManager.class and b/build/classes/scripting/event/EventInstanceManager.class differ diff --git a/build/classes/scripting/event/EventManager.class b/build/classes/scripting/event/EventManager.class index 3f56399939..77c59fdc04 100644 Binary files a/build/classes/scripting/event/EventManager.class and b/build/classes/scripting/event/EventManager.class differ diff --git a/build/classes/server/life/MapleMonsterInformationProvider.class b/build/classes/server/life/MapleMonsterInformationProvider.class index 284d110ec6..41af8e6a3f 100644 Binary files a/build/classes/server/life/MapleMonsterInformationProvider.class and b/build/classes/server/life/MapleMonsterInformationProvider.class differ diff --git a/build/classes/server/maps/MapleMap$1.class b/build/classes/server/maps/MapleMap$1.class index dc27b2a6f1..2897ccbe3e 100644 Binary files a/build/classes/server/maps/MapleMap$1.class and b/build/classes/server/maps/MapleMap$1.class differ diff --git a/build/classes/server/maps/MapleMap$10.class b/build/classes/server/maps/MapleMap$10.class index 41bcffb798..d251fe222f 100644 Binary files a/build/classes/server/maps/MapleMap$10.class and b/build/classes/server/maps/MapleMap$10.class differ diff --git a/build/classes/server/maps/MapleMap$11.class b/build/classes/server/maps/MapleMap$11.class index afd211bd37..2a0372c0b9 100644 Binary files a/build/classes/server/maps/MapleMap$11.class and b/build/classes/server/maps/MapleMap$11.class differ diff --git a/build/classes/server/maps/MapleMap$12.class b/build/classes/server/maps/MapleMap$12.class index 546c836638..f449046aa7 100644 Binary files a/build/classes/server/maps/MapleMap$12.class and b/build/classes/server/maps/MapleMap$12.class differ diff --git a/build/classes/server/maps/MapleMap$13.class b/build/classes/server/maps/MapleMap$13.class index b7fd82b212..bcaf02f56c 100644 Binary files a/build/classes/server/maps/MapleMap$13.class and b/build/classes/server/maps/MapleMap$13.class differ diff --git a/build/classes/server/maps/MapleMap$14.class b/build/classes/server/maps/MapleMap$14.class index 801ec51b4b..33391cc679 100644 Binary files a/build/classes/server/maps/MapleMap$14.class and b/build/classes/server/maps/MapleMap$14.class differ diff --git a/build/classes/server/maps/MapleMap$15.class b/build/classes/server/maps/MapleMap$15.class index d759e5236a..ba2985c513 100644 Binary files a/build/classes/server/maps/MapleMap$15.class and b/build/classes/server/maps/MapleMap$15.class differ diff --git a/build/classes/server/maps/MapleMap$16.class b/build/classes/server/maps/MapleMap$16.class index f5ad8f279d..7f976d1b78 100644 Binary files a/build/classes/server/maps/MapleMap$16.class and b/build/classes/server/maps/MapleMap$16.class differ diff --git a/build/classes/server/maps/MapleMap$17.class b/build/classes/server/maps/MapleMap$17.class index d42db5a472..70e0ca0e9b 100644 Binary files a/build/classes/server/maps/MapleMap$17.class and b/build/classes/server/maps/MapleMap$17.class differ diff --git a/build/classes/server/maps/MapleMap$18.class b/build/classes/server/maps/MapleMap$18.class index 52e068a714..da0cb77931 100644 Binary files a/build/classes/server/maps/MapleMap$18.class and b/build/classes/server/maps/MapleMap$18.class differ diff --git a/build/classes/server/maps/MapleMap$19.class b/build/classes/server/maps/MapleMap$19.class index 1a7061fbeb..776e202b5a 100644 Binary files a/build/classes/server/maps/MapleMap$19.class and b/build/classes/server/maps/MapleMap$19.class differ diff --git a/build/classes/server/maps/MapleMap$2.class b/build/classes/server/maps/MapleMap$2.class index d8253bcb82..2fcbc31d60 100644 Binary files a/build/classes/server/maps/MapleMap$2.class and b/build/classes/server/maps/MapleMap$2.class differ diff --git a/build/classes/server/maps/MapleMap$20.class b/build/classes/server/maps/MapleMap$20.class index ca5b8c0009..1e5b66ec8e 100644 Binary files a/build/classes/server/maps/MapleMap$20.class and b/build/classes/server/maps/MapleMap$20.class differ diff --git a/build/classes/server/maps/MapleMap$21.class b/build/classes/server/maps/MapleMap$21.class index aac832b60f..0fb2551e1b 100644 Binary files a/build/classes/server/maps/MapleMap$21.class and b/build/classes/server/maps/MapleMap$21.class differ diff --git a/build/classes/server/maps/MapleMap$22.class b/build/classes/server/maps/MapleMap$22.class index 946192eb72..286b3adbf8 100644 Binary files a/build/classes/server/maps/MapleMap$22.class and b/build/classes/server/maps/MapleMap$22.class differ diff --git a/build/classes/server/maps/MapleMap$23.class b/build/classes/server/maps/MapleMap$23.class index 9bf3be31f4..fae9a7558f 100644 Binary files a/build/classes/server/maps/MapleMap$23.class and b/build/classes/server/maps/MapleMap$23.class differ diff --git a/build/classes/server/maps/MapleMap$24.class b/build/classes/server/maps/MapleMap$24.class index 55bf7b9810..25410624d3 100644 Binary files a/build/classes/server/maps/MapleMap$24.class and b/build/classes/server/maps/MapleMap$24.class differ diff --git a/build/classes/server/maps/MapleMap$25.class b/build/classes/server/maps/MapleMap$25.class index a7ec54a02b..bd4c479304 100644 Binary files a/build/classes/server/maps/MapleMap$25.class and b/build/classes/server/maps/MapleMap$25.class differ diff --git a/build/classes/server/maps/MapleMap$26.class b/build/classes/server/maps/MapleMap$26.class index 98a4d5eea3..7cf203ddf8 100644 Binary files a/build/classes/server/maps/MapleMap$26.class and b/build/classes/server/maps/MapleMap$26.class differ diff --git a/build/classes/server/maps/MapleMap$27.class b/build/classes/server/maps/MapleMap$27.class index 1f0b9ab0e4..af9d9600a1 100644 Binary files a/build/classes/server/maps/MapleMap$27.class and b/build/classes/server/maps/MapleMap$27.class differ diff --git a/build/classes/server/maps/MapleMap$28$1.class b/build/classes/server/maps/MapleMap$28$1.class index 58167128c7..0cdb6d9645 100644 Binary files a/build/classes/server/maps/MapleMap$28$1.class and b/build/classes/server/maps/MapleMap$28$1.class differ diff --git a/build/classes/server/maps/MapleMap$28.class b/build/classes/server/maps/MapleMap$28.class index 7e2eb64bb1..3e844988bb 100644 Binary files a/build/classes/server/maps/MapleMap$28.class and b/build/classes/server/maps/MapleMap$28.class differ diff --git a/build/classes/server/maps/MapleMap$29.class b/build/classes/server/maps/MapleMap$29.class index 112c45ce6a..df32df3257 100644 Binary files a/build/classes/server/maps/MapleMap$29.class and b/build/classes/server/maps/MapleMap$29.class differ diff --git a/build/classes/server/maps/MapleMap$3.class b/build/classes/server/maps/MapleMap$3.class index e5de38b97d..29f5e89290 100644 Binary files a/build/classes/server/maps/MapleMap$3.class and b/build/classes/server/maps/MapleMap$3.class differ diff --git a/build/classes/server/maps/MapleMap$4.class b/build/classes/server/maps/MapleMap$4.class index e028fc962a..cc25878a69 100644 Binary files a/build/classes/server/maps/MapleMap$4.class and b/build/classes/server/maps/MapleMap$4.class differ diff --git a/build/classes/server/maps/MapleMap$5.class b/build/classes/server/maps/MapleMap$5.class index 5bab6e186e..c33abe923d 100644 Binary files a/build/classes/server/maps/MapleMap$5.class and b/build/classes/server/maps/MapleMap$5.class differ diff --git a/build/classes/server/maps/MapleMap$6.class b/build/classes/server/maps/MapleMap$6.class index e0a77acd83..e5375ea2de 100644 Binary files a/build/classes/server/maps/MapleMap$6.class and b/build/classes/server/maps/MapleMap$6.class differ diff --git a/build/classes/server/maps/MapleMap$7.class b/build/classes/server/maps/MapleMap$7.class index bc9f7fe1fc..94362c7f46 100644 Binary files a/build/classes/server/maps/MapleMap$7.class and b/build/classes/server/maps/MapleMap$7.class differ diff --git a/build/classes/server/maps/MapleMap$8.class b/build/classes/server/maps/MapleMap$8.class index 85031635b6..c8e670d597 100644 Binary files a/build/classes/server/maps/MapleMap$8.class and b/build/classes/server/maps/MapleMap$8.class differ diff --git a/build/classes/server/maps/MapleMap$9.class b/build/classes/server/maps/MapleMap$9.class index 69e3063902..f72bae4cd6 100644 Binary files a/build/classes/server/maps/MapleMap$9.class and b/build/classes/server/maps/MapleMap$9.class differ diff --git a/build/classes/server/maps/MapleMap$ActivateItemReactor$1.class b/build/classes/server/maps/MapleMap$ActivateItemReactor$1.class index 282bbc335a..33beda5b9e 100644 Binary files a/build/classes/server/maps/MapleMap$ActivateItemReactor$1.class and b/build/classes/server/maps/MapleMap$ActivateItemReactor$1.class differ diff --git a/build/classes/server/maps/MapleMap$ActivateItemReactor.class b/build/classes/server/maps/MapleMap$ActivateItemReactor.class index fb95d366b3..8ce37ac6f8 100644 Binary files a/build/classes/server/maps/MapleMap$ActivateItemReactor.class and b/build/classes/server/maps/MapleMap$ActivateItemReactor.class differ diff --git a/build/classes/server/maps/MapleMap$ExpireMapItemJob.class b/build/classes/server/maps/MapleMap$ExpireMapItemJob.class index 2244dbe9d1..ef43f9e5c0 100644 Binary files a/build/classes/server/maps/MapleMap$ExpireMapItemJob.class and b/build/classes/server/maps/MapleMap$ExpireMapItemJob.class differ diff --git a/build/classes/server/maps/MapleMap.class b/build/classes/server/maps/MapleMap.class index 07d58bdf8a..5e4d4d0875 100644 Binary files a/build/classes/server/maps/MapleMap.class and b/build/classes/server/maps/MapleMap.class differ diff --git a/build/classes/tools/MaplePacketCreator.class b/build/classes/tools/MaplePacketCreator.class index a3a9472dd1..0a63bb659e 100644 Binary files a/build/classes/tools/MaplePacketCreator.class and b/build/classes/tools/MaplePacketCreator.class differ diff --git a/dist/MapleSolaxia.jar b/dist/MapleSolaxia.jar index 9f9b60ca47..6fae4be884 100644 Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index 0a58c60003..1342b0b1b0 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -337,4 +337,7 @@ Definido um suporte para o esquema de expedi 21 Junho 2017, Corrigido vários aspectos de guilds e alliances, que operavam irregularmente no cliente. Corrigido "player logged in" aparecendo sempre que jogador troca de canal. -MGC do jogador agora está sincronizado com o MGC da guild, não o contrário. \ No newline at end of file +MGC do jogador agora está sincronizado com o MGC da guild, não o contrário. + +23 - 26 Junho 2017, +Diversas reimplementações de mecânicas da CWKPQ, ainda trabalho em progresso. \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 6644bb1bd7..9b5fde9858 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,21 +3,31 @@ - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AllianceOperationHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerLoggedinHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010009.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/GuildOperationHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuildCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010008.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/1092014.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/6109000.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/glpqPortal6.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201112.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/PortalFactory.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/AbstractPlayerInteraction.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerInteractionHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/portal/PortalPlayerInteraction.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/6102001.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleGenericPortal.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201107.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/CWKPQ.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/ChangeMapHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/glpqPortal7.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201110.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/glpqPortal3.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleJob.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/portal/PortalScriptManager.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/InnerPortalHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201115.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MaplePortal.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201108.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201109.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/party3_r6pt.js diff --git a/scripts/event/CWKPQ.js b/scripts/event/CWKPQ.js index 7e9fc41c01..3783046f9e 100644 --- a/scripts/event/CWKPQ.js +++ b/scripts/event/CWKPQ.js @@ -1,3 +1,5 @@ +var minPlayers = 1; + var mapz = Array(100, 200, 300, 400, 500, 510, 520, 521, 522, 530, 540, 550, 600, 700, 800); var a = Array("a", "b", "c", "d", "e", "f", "g", "h", "i"); /* @@ -23,31 +25,83 @@ function init() { function afterSetup(eim) {} -function setup(leaderid) { - em.setProperty("state", "1"); - em.setProperty("leader", "true"); - em.setProperty("current_instance", "0"); - em.setProperty("glpq1", "0"); - em.setProperty("glpq2", "0"); - em.setProperty("glpq3", "0"); - em.setProperty("glpq4", "0"); - em.setProperty("glpq5", "0"); - em.setProperty("glpq6", "0"); +function getNameFromList(index, array) { + return array[index]; +} + +function generateMapReactors(map) { + + var jobReactors = [ [0, 0, -1, -1, 0], + [-1, 4, 3, 3, 3], + [1, 3, 4, 2, 2], + [2, -1, 0, 1, -1], + [3, 2, 1, 0, -1], + [4, 1, -1, 4, 1], + [-1, 2, 4], + [-1, -1] + ]; + + var rndIndex; + var jobFound; + while(true) { + jobFound = {}; + rndIndex = []; + + for(var i = 0; i < jobReactors.length; i++) { + var jobReactorSlot = jobReactors[i]; + + var idx = Math.floor(Math.random() * jobReactorSlot.length); + jobFound["" + jobReactorSlot[idx]] = 1; + rndIndex.push(idx); + } + + if(Object.keys(jobFound).length == 6) break; + } + + var toDeploy = []; + + toDeploy.push(getNameFromList(rndIndex[0], ["4skill0a", "4skill0b", "4fake1c", "4fake1d", "4skill0e"])); + toDeploy.push(getNameFromList(rndIndex[1], ["4fake0a", "4skill4b", "4skill3c", "4skill3d", "4skill3e"])); + toDeploy.push(getNameFromList(rndIndex[2], ["4skill1a", "4skill3b", "4skill4c", "4skill2d", "4skill2e"])); + toDeploy.push(getNameFromList(rndIndex[3], ["4skill2a", "4fake1b", "4skill0c", "4skill1d", "4fake1e"])); + toDeploy.push(getNameFromList(rndIndex[4], ["4skill3a", "4skill2b", "4skill1c", "4skill0d", "4fake0e"])); + toDeploy.push(getNameFromList(rndIndex[5], ["4skill4a", "4skill1b", "4fake0c", "4skill4d", "4skill1e"])); + toDeploy.push(getNameFromList(rndIndex[6], ["4fake1a", "4skill2c", "4skill4e"])); + toDeploy.push(getNameFromList(rndIndex[7], ["4fake0b", "4fake0d"])); + + var toRandomize = new Array(); + + for(var i = 0; i < toDeploy.length; i++) { + var react = map.getReactorByName(toDeploy[i]); + + react.setState(1); + toRandomize.push(react); + } + + map.shuffleReactors(toRandomize); +} + +function setup(channel) { + var eim = em.newInstance("CWKPQ" + channel); + + eim.setProperty("state", "1"); + eim.setProperty("leader", "true"); + eim.setProperty("current_instance", "0"); + eim.setProperty("glpq1", "0"); + eim.setProperty("glpq2", "0"); + eim.setProperty("glpq3", "0"); + eim.setProperty("glpq3_p", "0"); + eim.setProperty("glpq4", "0"); + eim.setProperty("glpq5", "0"); + eim.setProperty("glpq5_room", "0"); + eim.setProperty("glpq6", "0"); - var eim = em.newInstance("CWKPQ" + leaderid); for (var i = 0; i < mapz.length; i++) { var map = eim.getInstanceMap(610030000 + mapz[i]); if (map != null) { map.resetFully(); if (map.getId() == 610030400) { - map.setReactorState(); //because everything is at 0 =[ - map.limitReactor(6109016, 1); - map.limitReactor(6109017, 1); - map.limitReactor(6109018, 1); - map.limitReactor(6109019, 1); - map.limitReactor(6109020, 1); - map.shuffleReactors(6109016, 6109020); - map.destroyReactors(6108000, 6108005); //destroy the fake ones, non-GMS like or is this necessary + generateMapReactors(map); //add environments for (var x = 0; x < a.length; x++) { @@ -86,18 +140,18 @@ function setup(leaderid) { function playerEntry(eim, player) { eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map."); - var map = eim.getMapInstance(610030100 + (parseInt(em.getProperty("current_instance")) * 100)); + var map = eim.getMapInstance(610030100 + (eim.getIntProperty("current_instance") * 100)); player.changeMap(map, map.getPortal(0)); } function spawnGuardians(eim) { - var map = eim.getMapInstance(0); + var map = eim.getMapInstance(610030100); if (map.countPlayers() <= 0) { return; } - eim.dropMessage(5, "The Master Guardians have detected you."); + map.broadcastStringMessage(5, "The Master Guardians have detected you."); for (var i = 0; i < 20; i++) { //spawn 20 guardians - var mob = em.getMonster(9400594); + var mob = eim.getMonster(9400594); eim.registerMonster(mob); map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(1000, 336)); } @@ -115,39 +169,39 @@ function changedMap(eim, player, mapid) { } else { switch(mapid) { case 610030200: - if (em.getProperty("current_instance").equals("0")) { + if (eim.getIntProperty("current_instance") == 0) { eim.restartEventTimer(600000); //10 mins - em.setProperty("current_instance", "1"); + eim.setIntProperty("current_instance", 1); } break; case 610030300: - if (em.getProperty("current_instance").equals("1")) { + if (eim.getIntProperty("current_instance") == 1) { eim.restartEventTimer(600000); //10 mins - em.setProperty("current_instance", "2"); + eim.setIntProperty("current_instance", 2); } break; case 610030400: - if (em.getProperty("current_instance").equals("2")) { + if (eim.getIntProperty("current_instance") == 2) { eim.restartEventTimer(600000); //10 mins - em.setProperty("current_instance", "3"); + eim.setIntProperty("current_instance", 3); } break; case 610030500: - if (em.getProperty("current_instance").equals("3")) { + if (eim.getIntProperty("current_instance") == 3) { eim.restartEventTimer(1200000); //20 mins - em.setProperty("current_instance", "4"); + eim.setIntProperty("current_instance", 4); } break; case 610030600: - if (em.getProperty("current_instance").equals("4")) { + if (eim.getIntProperty("current_instance") == 4) { eim.restartEventTimer(3600000); //1 hr - em.setProperty("current_instance", "5"); + eim.setIntProperty("current_instance", 5); } break; case 610030800: - if (em.getProperty("current_instance").equals("5")) { + if (eim.getIntProperty("current_instance") == 5) { eim.restartEventTimer(60000); //1 min - em.setProperty("current_instance", "6"); + eim.setIntProperty("current_instance", 6); } break; } @@ -182,7 +236,6 @@ function end(eim) { function clearPQ(eim) { eim.setEventCleared(); - end(eim); } function monsterKilled(mob, eim) {} @@ -191,4 +244,5 @@ function allMonstersDead(eim) {} function leftParty (eim, player) {} function disbandParty (eim) {} function playerDead(eim, player) {} -function cancelSchedule() {} \ No newline at end of file +function cancelSchedule() {} +function dispose(eim) {} \ No newline at end of file diff --git a/scripts/npc/9201107.js b/scripts/npc/9201107.js new file mode 100644 index 0000000000..1261a6e7e3 --- /dev/null +++ b/scripts/npc/9201107.js @@ -0,0 +1,33 @@ +/* @Author SharpAceX +*/ + +function start() { + if (cm.getPlayer().getMapId() == 610030500) { + cm.sendOk("Unbelievable strength and power, anyone can be achieve. But what makes a warrior special is their iron will. No matter the odds, a true warrior pushes through until victory is assured. Thus, the Warrior Chamber is a brutal road where the room itself is against you, as well as the ultra-strong monsters within. Use your skills to shake off the effects and defeat the monsters within to reach the Warrior Statue and claim the Master Sword. Good luck!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("A legendary family of heroes, the de Vrisiens are the original founders of the Stormcasters. The family is unique, as each son or daughter inherits the full fighting techniques of their ancestors. This ability has proven to be immensely useful; as it allows for nearly unlimited strategy, improvisation and tactics to defeat all enemies. A true family for the generations."); + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030510) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if(cm.canHold(4001259, 1)) { + cm.gainItem(4001259, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); + } else { + cm.sendOk("Make room on your ETC inventory first."); + } + } + } else { + cm.sendOk("Eliminate all Crimson Guardians."); + } + cm.dispose(); + } +} \ No newline at end of file diff --git a/scripts/npc/9201108.js b/scripts/npc/9201108.js new file mode 100644 index 0000000000..a8bb3049f0 --- /dev/null +++ b/scripts/npc/9201108.js @@ -0,0 +1,33 @@ +/* @Author SharpAceX +*/ + +function start() { + if (cm.getPlayer().getMapId() == 610030500) { + cm.sendOk("A legendary creature known as the Master Guardian awaits you. It was a Crimson Guardian that Ridley once experimented on, which resulted in its becoming highly resistant to magic attacks, spears, maces, everything--except arrows fired with exceptional power. Bowmen and women! As undisputed masters of the Bow and Arrow, you must use your most powerful attacks--everything from Strafe to Hurricane to Piercing Arrow to destroy this powerful creature and reach the Bowman Statue to claim The Ancestral Bow! Good luck!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("One of the only known Holy Archers, Lockewood is one of the Keep's most famous heroes. Of particular note is his custom white and gold battle barb, said to be blessed by a powerfull goddess. His aim was tremendously accurate over long distanes. Feared and respected for his 'Genesis Arrow' and 'Doom Phoenix', he once struck down six Typhons from the Valley of Heroes."); + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030540) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if(cm.canHold(4001258, 1)) { + cm.gainItem(4001258, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); + } else { + cm.sendOk("Make room on your ETC inventory first."); + } + } + } else { + cm.sendOk("Eliminate all Master Guardians."); + } + cm.dispose(); + } +} \ No newline at end of file diff --git a/scripts/npc/9201109.js b/scripts/npc/9201109.js new file mode 100644 index 0000000000..5fca62f2d7 --- /dev/null +++ b/scripts/npc/9201109.js @@ -0,0 +1,40 @@ +/* @Author SharpAceX +*/ + +function start() { + if (cm.getPlayer().getMapId() == 610030500) { + cm.sendOk("As a powerful Elite Mage, Ridly knew the value of intelligence, the hallmark quality of a wizard. Thus, the Mage Chamber is a twisting maze of devious conception--the Teleport skill is the only skill you can use inside to get around, and Magic Claw is the only skill that will break the statues. You must also kill numerous monsters within. After you solve the maze and defeat all the foes within it, deduce which Mage Statue hides the Staff of First Magic and break it open to claim it! Good luck!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("A name forever remembered, Rafael was an exceptionally skilled sorcerer, and the foremost master of mental magic powers, telekinesis and telepathy. In addition to that, he was one of the 'Elite Mages' who mastered all the elements. He was last seen looking for the 'Temple of the Elementals' to turn the tide against the invading Krakian Army..."); + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030521) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + cm.warp(610030522,0); + } else { + cm.sendOk("Eliminate all monsters."); + } + cm.dispose(); + } else if (cm.getPlayer().getMapId() == 610030522) { + if (cm.getPlayer().getMap().countMonsters() == 0) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if(cm.canHold(4001257, 1)) { + cm.gainItem(4001257, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); + } else { + cm.sendOk("Make room on your ETC inventory first."); + } + } + } else { + cm.sendOk("Eliminate all monsters."); + } + cm.dispose(); + } +} \ No newline at end of file diff --git a/scripts/npc/9201110.js b/scripts/npc/9201110.js new file mode 100644 index 0000000000..ef7b407c46 --- /dev/null +++ b/scripts/npc/9201110.js @@ -0,0 +1,35 @@ +/* @Author SharpAceX +*/ + +function start() { + switch(cm.getPlayer().getMapId()) { + case 610030500: + cm.sendOk("As every Thief knows, the best attack is the one you never see coming. So, to best illustrate this, you'll be in a chamber with platforms and ledges that you can only get to with Haste, as well as All-Seeing Eyes that your dagger or claw must close--permanently. After all the All-Seeing Eyes have been eliminated, get ti the Thief Statue and lay claim to the Primal Claw! Good luck!"); + break; + case 610030000: + cm.sendOk("Once known as the 'Prince of Shadows', Grandmaster Ryo possessed supreme speed and power with short-ranged daggers and longer chain-like Claw. A part-time memeber of the Bosshunters, he was reowned for unparalleled ability to blend into the very nigth itself. His legend grew during a battle with Crimson Balrog, where he moved so swiftly that Balrog's attacks only caught air. Ryo also performed occasional 'retrievals' for those less fortunate than himself."); + break; + case 610030530: + if (cm.isAllReactorState(6108004, 1) && !cm.haveItem(4001256, 1)) { + var eim = cm.getEventInstance(); + var stgStatus = eim.getIntProperty("glpq5_room"); + var jobNiche = cm.getPlayer().getJob().getJobNiche(); + + if ((stgStatus >> jobNiche) % 2 == 0) { + if(cm.canHold(4001256, 1)) { + cm.gainItem(4001256, 1); + cm.sendOk("Good job."); + + stgStatus += (1 << jobNiche); + eim.setIntProperty("glpq5_room", stgStatus); + } else { + cm.sendOk("Make room on your ETC inventory first."); + } + } + } else { + cm.sendOk("Go now, destroy all of the watchful eyes with your mobility skills, fellow Thief. Report back to me when you are done."); + } + break; + } + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/9201111.js b/scripts/npc/9201111.js new file mode 100644 index 0000000000..6fc3834fc7 --- /dev/null +++ b/scripts/npc/9201111.js @@ -0,0 +1,12 @@ +/* @Author SharpAceX +*/ + +function start() { + if (cm.getPlayer().getMap().getId() == 610030500) { + cm.sendOk("You're about to get wet and do what a Pirate does best--dig for booty! Be careful--that water beneath is known as Heavy Water, and it's so dense that I doubt you could swim through it! You'll have to make your way around....The relic you seek is known as the Forbidden Gun, which is an ancient weapon of the finest Pirate to grace the shores of Masteria--Steel Fist Jack! It's been buried in one of the many treasure chests you'll find below the sea. It won't be easy...Pirates were known for burying things in the most unlikely places, so dig deep and keep your guard up. There are sharks and much worse in those waters!"); + cm.dispose(); + } else if (cm.getPlayer().getMap().getId() == 610030000) { + cm.sendOk("Long ago, a strange warrior washed upon the shores of Masteria. This being claimed to be a member of a mysterious band of warriors that used claw-like weapons and projectile-based artillery to defeat foes. Known as 'Steel Fist Jack', his cunning and trickery in battle was devilishly effective. He eventually built a boat and left the Keep in search of his former crew and captain."); + cm.dispose(); + } +} \ No newline at end of file diff --git a/scripts/npc/9201112.js b/scripts/npc/9201112.js new file mode 100644 index 0000000000..cfd7c526a1 --- /dev/null +++ b/scripts/npc/9201112.js @@ -0,0 +1,86 @@ +var status = -1; + +function start() { + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (status == 1 && mode == 0) { + cm.dispose(); + return; + } + + if (mode == 1) { + status++; + } else { + status--; + } + var eim = cm.getEventInstance(); + if (eim == null) { + cm.sendNext("The event isn't started..."); + cm.dispose(); + return; + } + if (!cm.isEventLeader()) { + cm.sendNext("I wish for your leader to talk to me."); + cm.dispose(); + return; + } + switch(cm.getPlayer().getMapId()) { + case 610030100: + if (status == 0) { + cm.sendNext("Agh, you have made it in. Let me tell you real quick: they've caught us already. Master Guardians are about to come here in about a minute. We'd better hurry."); + } else if (status == 1) { + cm.sendNext("The portal to the Twisted Masters is busted. We have to find an alternate way, one that will take us through many death traps."); + } else if (status == 2) { + cm.sendNext("You can find the portal somewhere around here... you'd better find it, quick. I'll catch up."); + cm.dispose(); + eim.setProperty("glpq1", "1"); + } + break; + case 610030200: + if (status == 0) { + cm.sendNext("That was a success! Now, for this path, I do believe we need one of every Adventurer class to get past."); + } else if (status == 1) { + cm.sendNext("They need to use their skills on each of these things called Sigils. Once all five have been done, we can get past."); + cm.dispose(); + } + break; + case 610030300: + if (status == 0) { + cm.sendNext("Now what we have here are more Sigils. All five Adventurers have to climb to the very top and go through the portal."); + } else if (status == 1) { + cm.sendNext("Beware of these death traps: Menhirs. They really pack a punch."); + cm.dispose(); + } + break; + case 610030400: + if (status == 0) { + cm.sendNext("Now what we have here are more Sigils. However, some of them don't work. Here all jobs must fill their roles, as at least one of these Sigils are activated by their job skills, however there can be more than one per job, so be sure to test them all."); + } else if (status == 1) { + cm.sendNext("These Stirges will get in your way, but they're merely a distraction. Try every one of these Sigils until they work."); + cm.dispose(); + } + break; + case 610030500: + if (status == 0) { + cm.sendNext("Surprised you made it this far! What you see here is the statue of Crimsonwood Keep, but without any of it's weapons."); + } else if (status == 1) { + cm.sendNext("There are five rooms, marked by a statue near each of them, around the statue."); + } else if (status == 2) { + cm.sendNext("I suspect that each of these rooms have one of the statue's five weapons."); + } else if (status == 3) { + cm.sendNext("Bring back the weapons and restore them to the Relic of Mastery!"); + cm.dispose(); + } + break; + case 610030700: + cm.sendNext("That was some good work out there! This leads the way to the Twisted Masters' Armory."); + cm.dispose(); + break; + } + } +} \ No newline at end of file diff --git a/scripts/npc/9201115.js b/scripts/npc/9201115.js new file mode 100644 index 0000000000..9af3ee71cf --- /dev/null +++ b/scripts/npc/9201115.js @@ -0,0 +1,94 @@ +var status = -1; + +function start() { + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == 1) { + status++; + } else { + status--; + } + if (!cm.isEventLeader()) { + cm.sendNext("I wish for your leader to talk to me."); + cm.dispose(); + return; + } + + var eim = cm.getEventInstance(); + if (eim != null) { + if (eim.getIntProperty("glpq6") == 0) { + if (status == 0) { + cm.sendNext("Welcome to the Twisted Masters' Keep. I will be your host for this evening..."); + } else if (status == 1) { + cm.sendNext("Tonight, we have a feast of a squad of Maplers.. ahaha..."); + } else if (status == 2) { + cm.sendNext("Let our specially trained Master Guardians escort you!"); + cm.mapMessage(6, "Engarde! Master Guardians approach!"); + for (var i = 0; i < 10; i++) { + var mob = eim.getMonster(9400594); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (java.lang.Math.random() * 1337), 276)); + } + for (var i = 0; i < 20; i++) { + var mob = eim.getMonster(9400582); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (java.lang.Math.random() * 1337), 276)); + } + eim.setIntProperty("glpq6", 1); + cm.dispose(); + } + } else if (eim.getIntProperty("glpq6") == 1) { + if (cm.getMap().countMonsters() == 0) { + if (status == 0) { + cm.sendOk("Eh. What is this? You've defeated them?"); + } else if (status == 1) { + cm.sendNext("Well, no matter! The Twisted Masters will be glad to welcome you."); + cm.mapMessage(6, "Twisted Masters approach!"); + + //MV or Heron + var mob = eim.getMonster(9400589); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1000, 276)); + + //Margana + var mob = eim.getMonster(9400590); + cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-22, 1)); + + //Red Nirg + var mob2 = eim.getMonster(9400591); + cm.getMap().spawnMonsterOnGroundBelow(mob2, new java.awt.Point(-22, 276)); + + //Hsalf + var mob4 = eim.getMonster(9400593); + cm.getMap().spawnMonsterOnGroundBelow(mob4, new java.awt.Point(496, 276)); + + //Rellik + var mob3 = eim.getMonster(9400592); + cm.getMap().spawnMonsterOnGroundBelow(mob3, new java.awt.Point(-496, 276)); + + eim.setIntProperty("glpq6", 2); + cm.dispose(); + } + } else { + cm.sendOk("Pay no attention to me. The Master Guardians will escort you!"); + cm.dispose(); + } + } else if (eim.getIntProperty("glpq6") == 2) { + if (cm.getMap().countMonsters() == 0) { + cm.sendOk("WHAT? Ugh... this can't be happening."); + cm.mapMessage(5, "The portal to the next stage has opened!"); + eim.setIntProperty("glpq6", 3); + + eim.showClearEffect(true); + eim.clearPQ(); + cm.dispose(); + } else { + cm.sendOk("Pay no attention to me. The Twisted Masters will escort you!"); + cm.dispose(); + } + } else { + cm.dispose(); + } + } else { + cm.dispose(); + } +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal0.js b/scripts/portal/glpqPortal0.js new file mode 100644 index 0000000000..80c30c9ca1 --- /dev/null +++ b/scripts/portal/glpqPortal0.js @@ -0,0 +1,11 @@ +function enter(pi) { + if (pi.getEventInstance().getIntProperty("glpq1") == 0) { + pi.getEventInstance().dropMessage(5, "This path is currently blocked."); + return false; + + } else { + pi.warp(610030200, 0); + return true; + } +} + diff --git a/scripts/portal/glpqPortal00.js b/scripts/portal/glpqPortal00.js new file mode 100644 index 0000000000..d39e9eb87d --- /dev/null +++ b/scripts/portal/glpqPortal00.js @@ -0,0 +1,9 @@ +function enter(pi) { + if (pi.getPlayer().getJob().getJobNiche() == 1) { + pi.warp(610030510,0); + return true; + } else { + pi.playerMessage(5, "Only warriors may enter this portal."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal01.js b/scripts/portal/glpqPortal01.js new file mode 100644 index 0000000000..9a71c1e9ce --- /dev/null +++ b/scripts/portal/glpqPortal01.js @@ -0,0 +1,9 @@ +function enter(pi) { + if (pi.getPlayer().getJob().getJobNiche() == 3) { + pi.warp(610030540,0); + return true; + } else { + pi.playerMessage(5, "Only bowmen may enter this portal."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal02.js b/scripts/portal/glpqPortal02.js new file mode 100644 index 0000000000..2ee82b3dac --- /dev/null +++ b/scripts/portal/glpqPortal02.js @@ -0,0 +1,9 @@ +function enter(pi) { + if (pi.getPlayer().getJob().getJobNiche() == 2) { + pi.warp(610030521,0); + return true; + } else { + pi.playerMessage(5, "Only mages may enter this portal."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal03.js b/scripts/portal/glpqPortal03.js new file mode 100644 index 0000000000..0c0a05cd37 --- /dev/null +++ b/scripts/portal/glpqPortal03.js @@ -0,0 +1,9 @@ +function enter(pi) { + if (pi.getPlayer().getJob().getJobNiche() == 4) { + pi.warp(610030530,0); + return true; + } else { + pi.playerMessage(5, "Only thieves may enter this portal."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal04.js b/scripts/portal/glpqPortal04.js new file mode 100644 index 0000000000..5aa8a6ea39 --- /dev/null +++ b/scripts/portal/glpqPortal04.js @@ -0,0 +1,9 @@ +function enter(pi) { + if (pi.getPlayer().getJob().getJobNiche() == 5) { + pi.warp(610030550,0); + return true; + } else { + pi.playerMessage(5, "Only pirates may enter this portal."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal1.js b/scripts/portal/glpqPortal1.js new file mode 100644 index 0000000000..f0a620c232 --- /dev/null +++ b/scripts/portal/glpqPortal1.js @@ -0,0 +1,14 @@ +function enter(pi) { + var eim = pi.getEventInstance(); + if (eim != null) { + if (eim.getIntProperty("glpq2") == 5) { + pi.warp(610030300, 0); + return true; + } else { + pi.playerMessage(5, "The portal has not been activated yet!"); + return false; + } + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal2.js b/scripts/portal/glpqPortal2.js new file mode 100644 index 0000000000..0ac897a8bf --- /dev/null +++ b/scripts/portal/glpqPortal2.js @@ -0,0 +1,28 @@ +function enter(pi) { + var eim = pi.getEventInstance(); + if (eim != null) { + pi.warp(610030300, 0); + + if (eim.getIntProperty("glpq3") < 5 || eim.getIntProperty("glpq3_p") < 5) { + if(eim.getIntProperty("glpq3_p") == 5) { + pi.mapMessage(6, "Not all Sigils have been activated yet. Make sure they have all been activated to proceed to the next stage."); + } else { + eim.setIntProperty("glpq3_p", eim.getIntProperty("glpq3_p") + 1); + + if(eim.getIntProperty("glpq3_p") == 5) { + pi.mapMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030300, "3pt", 2); + } else { + pi.mapMessage(6, "An adventurer has passed through! " + (5 - eim.getIntProperty("glpq3_p")) + " to go."); + } + } + } + else { + pi.getPlayer().dropMessage(6, "The portal at the bottom has already been opened! Proceed there!"); + } + + return true; + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal3.js b/scripts/portal/glpqPortal3.js new file mode 100644 index 0000000000..6284f692b8 --- /dev/null +++ b/scripts/portal/glpqPortal3.js @@ -0,0 +1,14 @@ +function enter(pi) { + var eim = pi.getEventInstance(); + if (eim != null) { + if (eim.getIntProperty("glpq3") != 5 || eim.getIntProperty("glpq3_p") != 5) { + pi.playerMessage(5, "The portal is not opened yet."); + return false; + } else { + pi.warp(610030400, 0); + return true; + } + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal4.js b/scripts/portal/glpqPortal4.js new file mode 100644 index 0000000000..b90d26d87c --- /dev/null +++ b/scripts/portal/glpqPortal4.js @@ -0,0 +1,14 @@ +function enter(pi) { + var eim = pi.getEventInstance(); + if (eim != null) { + if (eim.getIntProperty("glpq4") < 5){ + pi.playerMessage(5, "The portal is not opened yet."); + return false; + } else { + pi.warp(610030500, 0); + return true; + } + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal5.js b/scripts/portal/glpqPortal5.js new file mode 100644 index 0000000000..d99b3a3353 --- /dev/null +++ b/scripts/portal/glpqPortal5.js @@ -0,0 +1,19 @@ +function enter(pi) { + var eim = pi.getEventInstance(); + if (eim != null) { + if (eim.getIntProperty("glpq5") < 5){ + pi.playerMessage(5, "The portal is not opened yet."); + return false; + } else { + pi.removeAll(4001256); + pi.removeAll(4001257); + pi.removeAll(4001258); + pi.removeAll(4001259); + pi.removeAll(4001260); + pi.warp(610030600, 0); + return true; + } + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal6.js b/scripts/portal/glpqPortal6.js new file mode 100644 index 0000000000..13ca38492f --- /dev/null +++ b/scripts/portal/glpqPortal6.js @@ -0,0 +1,14 @@ +function enter(pi) { + var eim = pi.getEventInstance(); + if (eim != null) { + if (eim.getIntProperty("glpq6") < 3){ + pi.playerMessage(5, "The portal is not opened yet."); + return false; + } else { + pi.warp(610030700, 0); + return true; + } + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortal7.js b/scripts/portal/glpqPortal7.js new file mode 100644 index 0000000000..95c9554050 --- /dev/null +++ b/scripts/portal/glpqPortal7.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(610030800, 0); + return true; +} \ No newline at end of file diff --git a/scripts/portal/glpqPortalDummy.js b/scripts/portal/glpqPortalDummy.js new file mode 100644 index 0000000000..c22054eeaa --- /dev/null +++ b/scripts/portal/glpqPortalDummy.js @@ -0,0 +1,16 @@ +function enter(pi) { + var react = pi.getMap().getReactorByName("mob0"); + + if (react.getState() < 1) { + react.forceHitReactor(1); + pi.getEventInstance().setIntProperty("glpq1", 1); + + pi.getEventInstance().dropMessage(5, "A strange force starts being emitted from the portal apparatus, showing a hidden path once blocked now open."); + pi.warp(610030100, 0); + pi.getEventInstance().showClearEffect(); + return true; + } + + pi.getEventInstance().dropMessage(5, "The portal apparatus is malfunctional, due to the last transportation. The finding another way through."); + return false; +} \ No newline at end of file diff --git a/scripts/portal/gotocastle.js b/scripts/portal/gotocastle.js index acd1a84654..b7f081efd5 100644 --- a/scripts/portal/gotocastle.js +++ b/scripts/portal/gotocastle.js @@ -2,7 +2,7 @@ function enter(pi) { if (pi.isQuestActive(2324)) { pi.forceCompleteQuest(2324); pi.removeAll(2430015); - pi.playerMessage("Quest complete."); + pi.playerMessage(5, "Quest complete."); } pi.warp(106020501,0); return true; diff --git a/scripts/reactor/6102001.js b/scripts/reactor/6102001.js new file mode 100644 index 0000000000..bbad6f2f1e --- /dev/null +++ b/scripts/reactor/6102001.js @@ -0,0 +1,3 @@ +function act() { + rm.dropItems(); +} diff --git a/scripts/reactor/6102002.js b/scripts/reactor/6102002.js new file mode 100644 index 0000000000..c9d7131fb8 --- /dev/null +++ b/scripts/reactor/6102002.js @@ -0,0 +1,29 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*@author Ronan + *6102002.js + *Drops CWKPQ chest bonuses... + */ + +function act() { + rm.dropItems(true, 1, 90, 360, 15); +} \ No newline at end of file diff --git a/scripts/reactor/6102003.js b/scripts/reactor/6102003.js new file mode 100644 index 0000000000..c47e6f39a6 --- /dev/null +++ b/scripts/reactor/6102003.js @@ -0,0 +1,29 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*@author Ronan + *6102003.js + *Drops CWKPQ chest bonuses... + */ + +function act() { + rm.dropItems(true, 1, 90, 360, 15); +} \ No newline at end of file diff --git a/scripts/reactor/6102004.js b/scripts/reactor/6102004.js new file mode 100644 index 0000000000..d65fbe829d --- /dev/null +++ b/scripts/reactor/6102004.js @@ -0,0 +1,29 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*@author Ronan + *6102004.js + *Drops CWKPQ chest bonuses... + */ + +function act() { + rm.dropItems(true, 1, 90, 360, 15); +} \ No newline at end of file diff --git a/scripts/reactor/6102005.js b/scripts/reactor/6102005.js new file mode 100644 index 0000000000..269ba15fc2 --- /dev/null +++ b/scripts/reactor/6102005.js @@ -0,0 +1,29 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +/*@author Ronan + *6102005.js + *Drops CWKPQ chest bonuses... + */ + +function act() { + rm.dropItems(true, 1, 90, 360, 15); +} \ No newline at end of file diff --git a/scripts/reactor/6109000.js b/scripts/reactor/6109000.js new file mode 100644 index 0000000000..337e880e9a --- /dev/null +++ b/scripts/reactor/6109000.js @@ -0,0 +1,27 @@ +function act() { + + var eim = rm.getEventInstance(); + if (eim != null) { + var mapId = rm.getMap().getId(); + + if (mapId == 610030200) { + eim.dropMessage(6, "The Warrior Sigil has been activated!"); + eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1); + if (eim.getIntProperty("glpq2") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "2pt", 2); + } + } else if (mapId == 610030300) { + eim.dropMessage(6, "The Warrior Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!"); + eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1); + rm.getMap().moveEnvironment("menhir0", 1); + if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) { + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "3pt", 2); + } + } + } + + + //rm.getMap().moveEnvironment("menhir0", 1); +} \ No newline at end of file diff --git a/scripts/reactor/6109001.js b/scripts/reactor/6109001.js new file mode 100644 index 0000000000..c0d15beb99 --- /dev/null +++ b/scripts/reactor/6109001.js @@ -0,0 +1,24 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + var mapId = rm.getMap().getId(); + + if (mapId == 610030200) { + eim.dropMessage(6, "The Archer Sigil has been activated!"); + eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1); + if (eim.getIntProperty("glpq2") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "2pt", 2); + } + } else if (mapId == 610030300) { + eim.dropMessage(6, "The Archer Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!"); + eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1); + rm.getMap().moveEnvironment("menhir1", 1); + rm.getMap().moveEnvironment("menhir2", 1); + if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) { + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "3pt", 2); + } + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109002.js b/scripts/reactor/6109002.js new file mode 100644 index 0000000000..f4abe6f19e --- /dev/null +++ b/scripts/reactor/6109002.js @@ -0,0 +1,23 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + var mapId = rm.getMap().getId(); + + if (mapId == 610030200) { + eim.dropMessage(6, "The Mage Sigil has been activated!"); + eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1); + if (eim.getIntProperty("glpq2") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "2pt", 2); + } + } else if (mapId == 610030300) { + eim.dropMessage(6, "The Mage Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!"); + eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1); + rm.getMap().moveEnvironment("menhir3", 1); + if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) { + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "3pt", 2); + } + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109003.js b/scripts/reactor/6109003.js new file mode 100644 index 0000000000..df85feac6b --- /dev/null +++ b/scripts/reactor/6109003.js @@ -0,0 +1,23 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + var mapId = rm.getMap().getId(); + + if (mapId == 610030200) { + eim.dropMessage(6, "The Thief Sigil has been activated!"); + eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1); + if (eim.getIntProperty("glpq2") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "2pt", 2); + } + } else if (mapId == 610030300) { + eim.dropMessage(6, "The Thief Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!"); + eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1); + rm.getMap().moveEnvironment("menhir4", 1); + if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) { + rm.mapMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "3pt", 2); + } + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109004.js b/scripts/reactor/6109004.js new file mode 100644 index 0000000000..b79b483442 --- /dev/null +++ b/scripts/reactor/6109004.js @@ -0,0 +1,23 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + var mapId = rm.getMap().getId(); + + if (mapId == 610030200) { + eim.dropMessage(6, "The Pirate Sigil has been activated!"); + eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1); + if (eim.getIntProperty("glpq2") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "2pt", 2); + } + } else if (mapId == 610030300) { + eim.dropMessage(6, "The Pirate Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!"); + eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1); + rm.getMap().moveEnvironment("menhir5", 1); + if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) { + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(mapId, "3pt", 2); + } + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109005.js b/scripts/reactor/6109005.js new file mode 100644 index 0000000000..c551d777ac --- /dev/null +++ b/scripts/reactor/6109005.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!"); + eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1); + if (eim.getIntProperty("glpq5") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030500, "5pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109006.js b/scripts/reactor/6109006.js new file mode 100644 index 0000000000..c551d777ac --- /dev/null +++ b/scripts/reactor/6109006.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!"); + eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1); + if (eim.getIntProperty("glpq5") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030500, "5pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109007.js b/scripts/reactor/6109007.js new file mode 100644 index 0000000000..c551d777ac --- /dev/null +++ b/scripts/reactor/6109007.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!"); + eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1); + if (eim.getIntProperty("glpq5") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030500, "5pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109008.js b/scripts/reactor/6109008.js new file mode 100644 index 0000000000..c551d777ac --- /dev/null +++ b/scripts/reactor/6109008.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!"); + eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1); + if (eim.getIntProperty("glpq5") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030500, "5pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109009.js b/scripts/reactor/6109009.js new file mode 100644 index 0000000000..c551d777ac --- /dev/null +++ b/scripts/reactor/6109009.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!"); + eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1); + if (eim.getIntProperty("glpq5") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030500, "5pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109016.js b/scripts/reactor/6109016.js new file mode 100644 index 0000000000..cdef3c0d06 --- /dev/null +++ b/scripts/reactor/6109016.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "The Warrior Sigil has been activated!"); + eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1); + if (eim.getIntProperty("glpq4") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030400, "4pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109017.js b/scripts/reactor/6109017.js new file mode 100644 index 0000000000..70dd3cecd3 --- /dev/null +++ b/scripts/reactor/6109017.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "The Archer Sigil has been activated!"); + eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1); + if (eim.getIntProperty("glpq4") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030400, "4pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109018.js b/scripts/reactor/6109018.js new file mode 100644 index 0000000000..9debd70260 --- /dev/null +++ b/scripts/reactor/6109018.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "The Mage Sigil has been activated!"); + eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1); + if (eim.getIntProperty("glpq4") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030400, "4pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109019.js b/scripts/reactor/6109019.js new file mode 100644 index 0000000000..21fc0254fd --- /dev/null +++ b/scripts/reactor/6109019.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "The Thief Sigil has been activated!"); + eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1); + if (eim.getIntProperty("glpq4") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030400, "4pt", 2); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/6109020.js b/scripts/reactor/6109020.js new file mode 100644 index 0000000000..d7aa2a24f9 --- /dev/null +++ b/scripts/reactor/6109020.js @@ -0,0 +1,11 @@ +function act() { + var eim = rm.getEventInstance(); + if (eim != null) { + eim.dropMessage(6, "The Pirate Sigil has been activated!"); + eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1); + if (eim.getIntProperty("glpq4") == 5) { //all 5 done + eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!"); + eim.showClearEffect(610030400, "4pt", 2); + } + } +} \ No newline at end of file diff --git a/src/scripting/AbstractPlayerInteraction.java b/src/scripting/AbstractPlayerInteraction.java index a2d48c435c..5fe7c2d4ae 100644 --- a/src/scripting/AbstractPlayerInteraction.java +++ b/src/scripting/AbstractPlayerInteraction.java @@ -674,6 +674,10 @@ public class AbstractPlayerInteraction { c.announce(MaplePacketCreator.disableMinimap()); } + public boolean isAllReactorState(final int reactorId, final int state) { + return c.getPlayer().getMap().isAllReactorState(reactorId, state); + } + public void resetMap(int mapid) { getMap(mapid).resetReactors(); getMap(mapid).killAllMonsters(); diff --git a/src/scripting/event/EventInstanceManager.java b/src/scripting/event/EventInstanceManager.java index 6016bc3773..c38cc236fe 100644 --- a/src/scripting/event/EventInstanceManager.java +++ b/src/scripting/event/EventInstanceManager.java @@ -24,6 +24,7 @@ package scripting.event; import java.io.File; import java.sql.PreparedStatement; import java.sql.SQLException; +import tools.Pair; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -103,7 +104,7 @@ public class EventInstanceManager { private Map playerGrid = new HashMap<>(); // registers all opened gates on the event. Will help late characters to encounter next stages gates already opened - private Set openedGates = new HashSet<>(); + private Map> openedGates = new HashMap<>(); // forces deletion of items not supposed to be held outside of the event, dealt on a player's leaving moment. private Set exclusiveItems = new HashSet<>(); @@ -698,6 +699,10 @@ public class EventInstanceManager { } } + public MapleMonster getMonster(int mid) { + return(MapleLifeFactory.getMonster(mid)); + } + private List convertToIntegerArray(List list) { List intList = new ArrayList<>(); for(Double d: list) intList.add(d.intValue()); @@ -981,14 +986,22 @@ public class EventInstanceManager { } public final void showClearEffect(boolean hasGate, int mapId) { + showClearEffect(hasGate, mapId, "gate", 2); + } + + public final void showClearEffect(int mapId, String mapObj, int newState) { + showClearEffect(true, mapId, mapObj, newState); + } + + public final void showClearEffect(boolean hasGate, int mapId, String mapObj, int newState) { MapleMap map = getMapInstance(mapId); map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear")); map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear")); if(hasGate) { - map.broadcastMessage(MaplePacketCreator.environmentChange("gate", 2)); + map.broadcastMessage(MaplePacketCreator.environmentChange(mapObj, newState)); wL.lock(); try { - openedGates.add(map.getId()); + openedGates.put(map.getId(), new Pair<>(mapObj, newState)); } finally { wL.unlock(); } @@ -998,8 +1011,9 @@ public class EventInstanceManager { public final void recoverOpenedGate(MapleCharacter chr, int thisMapId) { rL.lock(); try { - if(openedGates.contains(thisMapId)) { - chr.announce(MaplePacketCreator.environmentChange("gate", 2)); + if(openedGates.containsKey(thisMapId)) { + Pair gateData = openedGates.get(thisMapId); + chr.announce(MaplePacketCreator.environmentChange(gateData.getLeft(), gateData.getRight())); } } finally { rL.unlock(); diff --git a/src/scripting/event/EventManager.java b/src/scripting/event/EventManager.java index 8a6ac82646..4d8123fe76 100644 --- a/src/scripting/event/EventManager.java +++ b/src/scripting/event/EventManager.java @@ -184,15 +184,19 @@ public class EventManager { public void setProperty(String key, String value) { props.setProperty(key, value); } - - public String getProperty(String key) { - return props.getProperty(key); + + public void setIntProperty(String key, int value) { + setProperty(key, value); } public void setProperty(String key, int value) { props.setProperty(key, value + ""); } + public String getProperty(String key) { + return props.getProperty(key); + } + public int getIntProperty(String key) { return Integer.parseInt(props.getProperty(key)); } @@ -279,7 +283,7 @@ public class EventManager { startLobbyInstance(lobbyId); } - EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", leader.getId())); + EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", leader.getClient().getChannel())); if(eim == null) { if(lobbyId > -1) setLockLobby(lobbyId, false); return false; diff --git a/src/server/life/MapleMonsterInformationProvider.java b/src/server/life/MapleMonsterInformationProvider.java index d5d25658f7..630960b2cc 100644 --- a/src/server/life/MapleMonsterInformationProvider.java +++ b/src/server/life/MapleMonsterInformationProvider.java @@ -178,7 +178,12 @@ public class MapleMonsterInformationProvider { try { return MapleLifeFactory.getMonster(id).getName(); - } catch (Exception e) + } + catch (NullPointerException npe) + { + return null; //nonexistant mob + } + catch (Exception e) { e.printStackTrace(); System.err.println("Nonexistant mob id " + id); diff --git a/src/server/maps/MapleMap.java b/src/server/maps/MapleMap.java index 55011fab1b..bab5763e0f 100644 --- a/src/server/maps/MapleMap.java +++ b/src/server/maps/MapleMap.java @@ -276,6 +276,17 @@ public class MapleMap { } } + public boolean isAllReactorState(final int reactorId, final int state) { + for (MapleMapObject mo : getReactors()) { + MapleReactor r = (MapleReactor) mo; + + if (r.getId() == reactorId && r.getState() != state) { + return false; + } + } + return true; + } + public int getForcedReturnId() { return forcedReturnMap; } @@ -955,6 +966,41 @@ public class MapleMap { mr.setPosition(points.remove(points.size() - 1)); } } + + public final void shuffleReactors(List list) { + List points = new ArrayList<>(); + List listObjects = new ArrayList<>(); + + List reactors = getReactors(); + List targets = new LinkedList<>(); + + objectRLock.lock(); + try { + for (Object obj : list) { + if(obj instanceof MapleMapObject) { + MapleMapObject mmo = (MapleMapObject) obj; + + if(mapobjects.containsValue(mmo)) { + listObjects.add(mmo); + } + } + } + } finally { + objectRLock.unlock(); + } + + for (MapleMapObject obj : listObjects) { + MapleReactor mr = (MapleReactor) obj; + + points.add(mr.getPosition()); + targets.add(obj); + } + Collections.shuffle(points); + for (MapleMapObject obj : targets) { + MapleReactor mr = (MapleReactor) obj; + mr.setPosition(points.remove(points.size() - 1)); + } + } /** * Automagically finds a new controller for the given monster from the chars @@ -1480,6 +1526,10 @@ public class MapleMap { } } } + + public void changeEnvironment(String mapObj, int newState) { + broadcastMessage(MaplePacketCreator.environmentChange(mapObj, newState)); + } public void startMapEffect(String msg, int itemId) { startMapEffect(msg, itemId, 30000); @@ -2105,7 +2155,7 @@ public class MapleMap { } public final void moveEnvironment(final String ms, final int type) { - broadcastMessage(MaplePacketCreator.environmentChange(ms, type)); + broadcastMessage(MaplePacketCreator.environmentMove(ms, type)); environment.put(ms, type); } diff --git a/src/tools/MaplePacketCreator.java b/src/tools/MaplePacketCreator.java index 0e17cc1cbc..c68871b30c 100644 --- a/src/tools/MaplePacketCreator.java +++ b/src/tools/MaplePacketCreator.java @@ -3682,6 +3682,16 @@ public class MaplePacketCreator { mplew.writeMapleAsciiString(env); return mplew.getPacket(); } + + public static byte[] environmentMove(String env, int mode) { + MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); + + mplew.writeShort(SendOpcode.FIELD_EFFECT.getValue()); + mplew.write(mode); + mplew.writeMapleAsciiString(env); + + return mplew.getPacket(); + } public static byte[] startMapEffect(String msg, int itemid, boolean active) { final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); diff --git a/wz/Item.wz/Cash/0521.img.xml b/wz/Item.wz/Cash/0521.img.xml index 704708b144..36fe766f58 100644 --- a/wz/Item.wz/Cash/0521.img.xml +++ b/wz/Item.wz/Cash/0521.img.xml @@ -722,7 +722,7 @@ - + diff --git a/wz/Item.wz/Etc/0400.img.xml b/wz/Item.wz/Etc/0400.img.xml index f3f27a6945..bf66ffdc68 100644 --- a/wz/Item.wz/Etc/0400.img.xml +++ b/wz/Item.wz/Etc/0400.img.xml @@ -8752,6 +8752,7 @@ + @@ -8766,6 +8767,7 @@ + @@ -8780,6 +8782,7 @@ + @@ -8794,6 +8797,7 @@ + @@ -8808,6 +8812,7 @@ + diff --git a/wz/Map.wz/Map/Map6/610030100.img.xml b/wz/Map.wz/Map/Map6/610030100.img.xml index afe783bbec..7e22d4f67b 100644 --- a/wz/Map.wz/Map/Map6/610030100.img.xml +++ b/wz/Map.wz/Map/Map6/610030100.img.xml @@ -4380,6 +4380,15 @@ + + + + + + + + + diff --git a/wz/Map.wz/Map/Map6/610030700.img.xml b/wz/Map.wz/Map/Map6/610030700.img.xml index bfbfc31329..8f150c9638 100644 --- a/wz/Map.wz/Map/Map6/610030700.img.xml +++ b/wz/Map.wz/Map/Map6/610030700.img.xml @@ -1,3757 +1,25 @@ - - - - - - - - - + + + + + + + + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + @@ -3762,39 +30,3377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wz/Map.wz/Map/Map9/922010600.img.xml b/wz/Map.wz/Map/Map9/922010600.img.xml index bf7cb43c80..a691c9e39a 100644 --- a/wz/Map.wz/Map/Map9/922010600.img.xml +++ b/wz/Map.wz/Map/Map9/922010600.img.xml @@ -7840,7 +7840,6 @@ -