diff --git a/MapleIdRetriever/build/built-jar.properties b/MapleIdRetriever/build/built-jar.properties index 1065d03f17..db62d79b3b 100644 --- a/MapleIdRetriever/build/built-jar.properties +++ b/MapleIdRetriever/build/built-jar.properties @@ -1,4 +1,4 @@ -#Tue, 30 May 2017 01:29:33 -0300 +#Wed, 07 Jun 2017 16:23:20 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2\\MapleIdRetriever= diff --git a/MapleIdRetriever/dist/MapleIdRetriever.jar b/MapleIdRetriever/dist/MapleIdRetriever.jar index 62c293bf47..47dff62a31 100644 Binary files a/MapleIdRetriever/dist/MapleIdRetriever.jar and b/MapleIdRetriever/dist/MapleIdRetriever.jar differ diff --git a/MapleIdRetriever/lib/fetch.txt b/MapleIdRetriever/lib/fetch.txt index 6989d4b708..ab02c7cbdf 100644 --- a/MapleIdRetriever/lib/fetch.txt +++ b/MapleIdRetriever/lib/fetch.txt @@ -1,50 +1,26 @@ -Heaven's Hammer +Dark Crystal Ore +DEX Crystal Ore +LUK Crystal Ore +Power Crystal Ore +Wisdom Crystal Ore +Dark Crystal +DEX Crystal +LUK Crystal +Power Crystal +Wisdom Crystal -Blue Potion -White Potion -Elixir Mana Elixir +Elixir Power Elixir -Pure Water -Ice Cream Pop -Red Bean Sundae -Unagi -Watermelon + +Reindeer Milk Sunrise Dew Sunset Dew -Screw - -White Napoleon -Black Napoleon -Green Napoleon -Red Napoleon -Blue Napoleon -Blue Justice Cape -Red Justice Cape -White Justice Cape -Black Justice Cape -Blue Moon -Skull Earrings -Red-Hearted Earrings -Sapphire Earrings -Cat's Eye -Blue Moon -Maple Throwing-Stars - -Adamantium Ore -Bronze Ore -Gold Ore -Mithril Ore -Orihalcon Ore -Silver Ore -Steel Ore -Amethyst Ore -Aquamarine Ore -Black Crystal Ore -Diamond Ore -Emerald Ore -Garnet Ore -Opal Ore -Sapphire Ore -Topaz Ore \ No newline at end of file +Silver Rover +Mithril Husk +Gold Eyes +Blue Lorin +Brown Lorin +Steel Pow +Black Bisk \ No newline at end of file diff --git a/MapleIdRetriever/lib/result.txt b/MapleIdRetriever/lib/result.txt index 8aa3145534..8cf519cca7 100644 --- a/MapleIdRetriever/lib/result.txt +++ b/MapleIdRetriever/lib/result.txt @@ -1,50 +1,26 @@ -1221011 +4004004 +4004002 +4004003 +4004000 +4004001 +4005004 +4005002 +4005003 +4005000 +4005001 -2000003 2000017 -2000002 2000016 2022174 -2000004 2000012 2002012 2022175 2022456 2000006 2000018 2022177 +2000004 2000012 2002012 2022175 2022456 2000005 2000019 2002013 2022176 2022457 -2022000 -2001001 -2001002 -2022003 3994092 -2001000 + +2020013 2020014 2020015 -4003000 +1082096 +1082104 +1082107 +1082099 +1082098 -1102003 -1102004 -1102000 -1102002 -1102001 -1102011 -1102012 -1102013 -1102014 -1032011 1041078 -1032012 -1032013 -1032002 -1032008 4031568 -1032011 1041078 -2070011 - -4010003 -4010000 -4010006 -4010002 -4010005 -4010004 -4010001 -4020001 -4020002 -4020008 -4020007 -4020003 -4020000 -4020004 -4020005 -4020006 +1082204 diff --git a/build/built-jar.properties b/build/built-jar.properties index 472a03fe1e..80ce4c53a0 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Tue, 06 Jun 2017 11:24:55 -0300 +#Sat, 10 Jun 2017 23:52:41 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= diff --git a/build/classes/client/MapleCharacter.class b/build/classes/client/MapleCharacter.class index 4a1f176933..7d7e200152 100644 Binary files a/build/classes/client/MapleCharacter.class and b/build/classes/client/MapleCharacter.class differ diff --git a/build/classes/client/command/Commands$1.class b/build/classes/client/command/Commands$1.class index f9489108a0..e00ce41e0f 100644 Binary files a/build/classes/client/command/Commands$1.class and b/build/classes/client/command/Commands$1.class differ diff --git a/build/classes/client/command/Commands.class b/build/classes/client/command/Commands.class index 307ff1db86..59dab23829 100644 Binary files a/build/classes/client/command/Commands.class and b/build/classes/client/command/Commands.class differ diff --git a/build/classes/client/inventory/Equip.class b/build/classes/client/inventory/Equip.class index c2596cc156..861599c61f 100644 Binary files a/build/classes/client/inventory/Equip.class and b/build/classes/client/inventory/Equip.class differ diff --git a/build/classes/net/server/channel/handlers/GeneralChatHandler.class b/build/classes/net/server/channel/handlers/GeneralChatHandler.class index eabb3b1eea..cb1d23ad90 100644 Binary files a/build/classes/net/server/channel/handlers/GeneralChatHandler.class and b/build/classes/net/server/channel/handlers/GeneralChatHandler.class differ diff --git a/build/classes/net/server/channel/handlers/UseCashItemHandler.class b/build/classes/net/server/channel/handlers/UseCashItemHandler.class index 3412f1c724..dd79cb0060 100644 Binary files a/build/classes/net/server/channel/handlers/UseCashItemHandler.class and b/build/classes/net/server/channel/handlers/UseCashItemHandler.class differ diff --git a/build/classes/scripting/AbstractPlayerInteraction.class b/build/classes/scripting/AbstractPlayerInteraction.class index 6555782e56..09fd139343 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 435c687831..3134159c26 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 d57db27050..5c6a3897c7 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 33d650348d..c3f99bea73 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 0a2799e432..d8348a07f1 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 2ec2add60e..098144df1c 100644 Binary files a/build/classes/scripting/event/EventManager.class and b/build/classes/scripting/event/EventManager.class differ diff --git a/build/classes/scripting/reactor/ReactorActionManager.class b/build/classes/scripting/reactor/ReactorActionManager.class index fd85c69a9a..d428a60617 100644 Binary files a/build/classes/scripting/reactor/ReactorActionManager.class and b/build/classes/scripting/reactor/ReactorActionManager.class differ diff --git a/build/classes/server/maps/MapleMap$1.class b/build/classes/server/maps/MapleMap$1.class index a4366d4984..5ff03ed892 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 3ded41b7ec..947cd0e213 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 74d2cdb6f2..973cba5190 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 3d9fbfd830..50ece27697 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 5bbd57c0a7..8cacf2754d 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 c679003891..e1cd23bb83 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 42d843f6dc..bb8f0b24e6 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 3ae4e07fed..ea578f65f4 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 381f1e80de..cb47683f05 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 37d9583577..8b918e0138 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 f3a51a2047..ccc95a4734 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 83acdbddb0..26d41b891d 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 5880184393..0733fcdecc 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 0cc3b2ba08..1996ac3a49 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 84de93a8b5..bcb9824a75 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 2d69d9c14a..206daa1a03 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 d6e509f7c9..f05af4cd02 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 92b9d9cc3d..dba447ac61 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 5af5c209db..4a45b894de 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 1356e7ae01..80920b5bd6 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 dbef0c488e..d8f6056ee4 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 63ecb08deb..7c073ef345 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 5964cd80e3..ffd7186e3e 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 7e55973d7e..c54ef7d508 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 4a6621f176..7086b3e869 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 e35981ebbf..a0cfcd292f 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 f84022349d..92de3ff904 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 ce47bb222a..df8446ac8b 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 55527d4aee..1ace036bd7 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 a0f7294e98..c705ead7b6 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 3ead24de8f..f4d69b6827 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 9e18d04e41..9f8bdbeaf2 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 65d53d84ec..069f846fea 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 70e4236d0b..0e2a60b9eb 100644 Binary files a/build/classes/server/maps/MapleMap.class and b/build/classes/server/maps/MapleMap.class differ diff --git a/build/classes/server/maps/MapleReactor$1.class b/build/classes/server/maps/MapleReactor$1.class index 68d931a332..2a85c8e6be 100644 Binary files a/build/classes/server/maps/MapleReactor$1.class and b/build/classes/server/maps/MapleReactor$1.class differ diff --git a/build/classes/server/maps/MapleReactor.class b/build/classes/server/maps/MapleReactor.class index ca45d6c4fb..2205a8cec3 100644 Binary files a/build/classes/server/maps/MapleReactor.class and b/build/classes/server/maps/MapleReactor.class differ diff --git a/dist/MapleSolaxia.jar b/dist/MapleSolaxia.jar index eec1fdd48f..d5d15ea421 100644 Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index 886b26a6de..4a9ce0f5a9 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -299,4 +299,7 @@ Consertada a fun 06 Junho 2016, Corrigido command empowerme. Corrigidos exploits relacionados a algumas das skills do empowerme. -Corrigido possivel loop infinito no sistema de EXP. \ No newline at end of file +Corrigido possivel loop infinito no sistema de EXP. + +07 - 10 Junho 2016, +Implementação da OPQ. \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 1fce9d1dba..9911a7db4b 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -12,17 +12,31 @@ + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/party3_room8.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/party3_jailin.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2013001.js file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleStatEffect.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/GameConstants.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/Skill.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/handlers/login/CharlistRequestHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AbstractDealDamageHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/CloseRangeDamageHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/2001002.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/2002017.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/AreaBossDyle.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/AbstractPlayerInteraction.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/2006001.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/2002014.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2040044.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2013002.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/1012005.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2040045.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/party3_gardenin.js file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/OrbisPQ.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/2001016.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/LudiPQ.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/BossRushPQ.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2013000.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/PiratePQ.js diff --git a/scripts/event/4jberserk.js b/scripts/event/4jberserk.js index 114960b820..f53862519d 100644 --- a/scripts/event/4jberserk.js +++ b/scripts/event/4jberserk.js @@ -51,6 +51,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { var map = eim.getMapInstance(910500200); player.changeMap(map, map.getPortal(0)); diff --git a/scripts/event/4jrush.js b/scripts/event/4jrush.js index 629942683b..ae337d0ab4 100644 --- a/scripts/event/4jrush.js +++ b/scripts/event/4jrush.js @@ -50,6 +50,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { var map = eim.getMapInstance(910500100); player.changeMap(map, map.getPortal(0)); diff --git a/scripts/event/BossRushPQ.js b/scripts/event/BossRushPQ.js index 2241c7bb44..e4bd7e0075 100644 --- a/scripts/event/BossRushPQ.js +++ b/scripts/event/BossRushPQ.js @@ -111,6 +111,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { var map = eim.getMapInstance(entryMap + eim.getIntProperty("lobby")); player.changeMap(map, map.getPortal(0)); diff --git a/scripts/event/CWKPQ.js b/scripts/event/CWKPQ.js index 01b7d9d9b4..8eb68edb2e 100644 --- a/scripts/event/CWKPQ.js +++ b/scripts/event/CWKPQ.js @@ -21,6 +21,8 @@ em.setProperty("state", "0"); em.setProperty("leader", "true"); } +function afterSetup(eim) {} + function setup(eim, leaderid) { em.setProperty("state", "1"); em.setProperty("leader", "true"); diff --git a/scripts/event/CathedralWedding.js b/scripts/event/CathedralWedding.js index bf9a06fe79..f6c4768617 100644 --- a/scripts/event/CathedralWedding.js +++ b/scripts/event/CathedralWedding.js @@ -69,6 +69,8 @@ function setup(eim) { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { var map = eim.getMapInstance(680000200); player.changeMap(map, map.getPortal(0)); diff --git a/scripts/event/EllinPQ.js b/scripts/event/EllinPQ.js index 9a87733b00..46daee1c11 100644 --- a/scripts/event/EllinPQ.js +++ b/scripts/event/EllinPQ.js @@ -93,6 +93,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function respawnStg2(eim) { if(!eim.getMapInstance(930000200).getAllPlayer().isEmpty()) eim.getMapInstance(930000200).instanceMapRespawn(); eim.schedule("respawnStg2", 4 * 1000); diff --git a/scripts/event/GuildQuest.js b/scripts/event/GuildQuest.js index ebc48f38d0..f685fc4ce0 100644 --- a/scripts/event/GuildQuest.js +++ b/scripts/event/GuildQuest.js @@ -87,6 +87,8 @@ function begin(eim) { //} } +function afterSetup(eim) {} + function timeOut(eim) { end(eim, "Your allotted time to finish the quest has passed."); } diff --git a/scripts/event/Hak.js b/scripts/event/Hak.js index bbb1d24f36..24c52a347f 100644 --- a/scripts/event/Hak.js +++ b/scripts/event/Hak.js @@ -19,6 +19,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { if (player.getMapId() == returnTo[0]) { myRide = 0; diff --git a/scripts/event/HenesysPQ.js b/scripts/event/HenesysPQ.js index 509d65bb33..4510d49cf0 100644 --- a/scripts/event/HenesysPQ.js +++ b/scripts/event/HenesysPQ.js @@ -52,7 +52,7 @@ function setEventRewards(eim) { var itemSet, itemQty, evLevel, expStages; evLevel = 1; //Rewards at clear PQ - itemSet = [4001129]; + itemSet = [4001158]; itemQty = [1]; eim.setEventRewards(evLevel, itemSet, itemQty); @@ -98,6 +98,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function respawnStages(eim) { eim.getInstanceMap(910010000).instanceMapRespawn(); eim.getInstanceMap(910010200).instanceMapRespawn(); diff --git a/scripts/event/HorntailFight.js b/scripts/event/HorntailFight.js index ceecb12b8f..4e4e48c143 100644 --- a/scripts/event/HorntailFight.js +++ b/scripts/event/HorntailFight.js @@ -54,6 +54,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim,player) { var map = eim.getMapInstance(trial1.getId()); player.changeMap(map,map.getPortal(0)); diff --git a/scripts/event/KerningPQ.js b/scripts/event/KerningPQ.js index d011f3a41a..c3bba270ba 100644 --- a/scripts/event/KerningPQ.js +++ b/scripts/event/KerningPQ.js @@ -92,6 +92,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function respawnStages(eim) { eim.getMapInstance(103000800).instanceMapRespawn(); eim.getMapInstance(103000805).instanceMapRespawn(); diff --git a/scripts/event/KerningTrain.js b/scripts/event/KerningTrain.js index 30c0ff1207..1e87ef4278 100644 --- a/scripts/event/KerningTrain.js +++ b/scripts/event/KerningTrain.js @@ -18,6 +18,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { if (player.getMapId() == returnTo[0]) { myRide = 0; diff --git a/scripts/event/LudiMazePQ.js b/scripts/event/LudiMazePQ.js index 9924c47eb4..7b3b380d87 100644 --- a/scripts/event/LudiMazePQ.js +++ b/scripts/event/LudiMazePQ.js @@ -97,6 +97,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function respawnStages(eim) {} function playerEntry(eim, player) { diff --git a/scripts/event/LudiPQ.js b/scripts/event/LudiPQ.js index 6872891635..b01c54eaf7 100644 --- a/scripts/event/LudiPQ.js +++ b/scripts/event/LudiPQ.js @@ -127,6 +127,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function respawnStages(eim) {} function playerEntry(eim, player) { @@ -136,11 +138,11 @@ function playerEntry(eim, player) { function scheduledTimeout(eim) { if(eim.getProperty("9stageclear") != null) { - var curStage = 922011000, toStage = 922011100; - eim.warpEventTeam(curStage, toStage); + var curStage = 922011000, toStage = 922011100; + eim.warpEventTeam(curStage, toStage); } else { - end(eim); + end(eim); } } diff --git a/scripts/event/OrbisPQ.js b/scripts/event/OrbisPQ.js index 25d9f76ec3..2e7b9856b1 100644 --- a/scripts/event/OrbisPQ.js +++ b/scripts/event/OrbisPQ.js @@ -1,294 +1,248 @@ -/* - * This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer +/** + * @author: Ronan + * @event: Orbis PQ +*/ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License 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. +var isPq = true; +var minPlayers = 5, maxPlayers = 6; +var minLevel = 51, maxLevel = 70; +var entryMap = 920010000; +var exitMap = 920011200; +var recruitMap = 200080101; +var clearMap = 920011300; - 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. +var minMapId = 920010000; +var maxMapId = 920011300; - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - - THIS FILE WAS MADE BY JVLAPLE. REMOVING THIS NOTICE MEANS YOU CAN'T USE THIS SCRIPT OR ANY OTHER SCRIPT PROVIDED BY JVLAPLE. - */ +var eventTime = 45; // 45 minutes -/* - * @Author Jvlaple - * - * Orbis Party Quest - */ - -importPackage(java.lang); -importPackage(Packages.world); -importPackage(Packages.client); -importPackage(Packages.server.maps); -importPackage(Packages.server.life); -importPackage(Packages.scripting.npc); - -var exitMap; -var instanceId; -var minPlayers = 1; +var lobbyRange = [0, 0]; function init() { - instanceId = 1; + setEventRequirements(); } - - -function monsterValue(eim, mobId) { - return 1; +function setLobbyRange() { + return lobbyRange; } -function setup() { - instanceId = em.getChannelServer().getInstanceId(); - exitMap = em.getChannelServer().getMapFactory().getMap(920011200); //Teh exit map :) <---------t - var instanceName = "OrbisPQ" + instanceId; - var eim = em.newInstance(instanceName); - var mf = eim.getMapFactory(); - em.getChannelServer().addInstanceId(); - var map = mf.getMap(920010000);//wutt - //map.shuffleReactors(); - // eim.addMapInstance(920010000,map); - //var firstPortal = eim.getMapInstance(920010000).getPortal("in00"); - //firstPortal.setScriptName("hontale_BtoB1"); - //Fuck this timer - //eim.setProperty("bulbWay", 0); - //Define all Maps and PortalScripts - var centerMap = eim.getMapInstance(920010100); - centerMap.getPortal(13).setScriptName("orbisPQSealedRoom"); - centerMap.getPortal(4).setScriptName("orbisPQWalkway"); - centerMap.getPortal(12).setScriptName("orbisPQStorage"); - centerMap.getPortal(5).setScriptName("orbisPQLobby"); - centerMap.getPortal(14).setScriptName("orbisPQOnTheWayUp"); - centerMap.getPortal(15).setScriptName("orbisPQLounge"); - centerMap.getPortal(16).setScriptName("orbisPQRoomOfDarkness"); - var walkwayMap = eim.getMapInstance(920010200); - var storageMap = eim.getMapInstance(920010300); - var lobbyMap = eim.getMapInstance(920010400); - var sealedRoomMap = eim.getMapInstance(920010500); - var loungeMap = eim.getMapInstance(920010600); - var onTheWayUpMap = eim.getMapInstance(920010700); - var bossMap = eim.getMapInstance(920010800); - var jailMap = eim.getMapInstance(920010900); - var roomOfDarknessMap = eim.getMapInstance(920011000); - var bonusMap = eim.getMapInstance(920011100); - var endMap = eim.getMapInstance(920011300); - walkwayMap.getPortal(13).setScriptName("orbisPQWalkwayExit"); - storageMap.getPortal(1).setScriptName("orbisPQStorageExit"); - lobbyMap.getPortal(8).setScriptName("orbisPQLobbyExit"); - sealedRoomMap.getPortal(3).setScriptName("orbisPQSRExit"); - loungeMap.getPortal(17).setScriptName("orbisPQLoungeExit"); - onTheWayUpMap.getPortal(23).setScriptName("orbisPQOnTheWayUpExit"); - bossMap.getPortal(1).setScriptName("orbisPQGardenExit"); - roomOfDarknessMap.getPortal(1).setScriptName("orbisPQRoomOfDarknessExit"); - //-->Fuck we are done with portals -.- - eim.setProperty("killedCellions", "0"); - eim.setProperty("papaSpawned", "no"); - em.schedule("timeOut", 60 * 60000); - em.schedule("broadcastClock", 1500); - eim.setProperty("entryTimestamp",System.currentTimeMillis() + (60 * 60000)); - - return eim; +function setEventRequirements() { + var reqStr = ""; + + reqStr += "\r\n Number of players: "; + if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers; + else reqStr += minPlayers; + + reqStr += "\r\n Level range: "; + if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel; + else reqStr += minLevel; + + reqStr += "\r\n Time limit: "; + reqStr += eventTime + " minutes"; + + em.setProperty("party", reqStr); } +function setEventExclusives(eim) { + var itemSet = [4001044, 4001045, 4001046, 4001047, 4001048, 4001049, 4001050, 4001051, 4001052, 4001053, 4001054, 4001055, 4001056, 4001057, 4001058, 4001059, 4001060, 4001061, 4001062, 4001063]; + eim.setExclusiveItems(itemSet); +} + +function setEventRewards(eim) { + var itemSet, itemQty, evLevel, expStages; + + evLevel = 1; //Rewards at clear PQ + itemSet = [2040602, 2040802, 2040002, 2040402, 2040505, 2040502, 2040601, 2044501, 2044701, 2044601, 2041019, 2041016, 2041022, 2041013, 2041007, 2043301, 2040301, 2040801, 2040001, 2040004, 2040504, 2040501, 2040513, 2043101, 2044201, 2044401, 2040701, 2044301, 2043801, 2040401, 2043701, 2040803, 2000003, 2000002, 2000004, 2000006, 2000005, 2022000, 2001001, 2001002, 2022003, 2001000, 2020014, 2020015, 4003000, 1102015, 1102016, 1102017, 1102018, 1102021, 1102022, 1102023, 1102024, 1102084, 1102085, 1102086, 1032019, 1032020, 1032021, 1032014, 2070011, 4010003, 4010000, 4010006, 4010002, 4010005, 4010004, 4010001, 4020001, 4020002, 4020008, 4020007, 4020003, 4020000, 4020004, 4020005, 4020006, 2210000, 2210001, 2210002, 2070006, 2070005, 2070007, 2070004, 2061003, 2060003, 2060004, 2061004, 2100000, 2100001, 2100002, 2100003, 2100004, 2100005]; + itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 100, 100, 15, 80, 5, 25, 20, 20, 25, 20, 15, 10, 45, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 15, 10, 15, 15, 15, 15, 15, 15, 10, 10, 15, 15, 15, 15, 15, 5, 5, 5, 1, 1, 1, 1, 2000, 2000, 2000, 2000, 1, 1, 1, 1, 1, 1]; + eim.setEventRewards(evLevel, itemSet, itemQty); + + expStages = []; //bonus exp given on CLEAR stage signal + eim.setEventClearStageExp(expStages); +} + +function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event + var eligible = []; + var hasLeader = false; + + if(party.size() > 0) { + var partyList = party.toArray(); + + for(var i = 0; i < party.size(); i++) { + var ch = partyList[i]; + + if(ch.getMapId() == recruitMap && ch.getLevel() >= minLevel && ch.getLevel() <= maxLevel) { + if(ch.isLeader()) hasLeader = true; + eligible.push(ch); + } + } + } + + if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = []; + return eligible; +} + +function setup(level, lobbyid) { + var eim = em.newInstance("Orbis" + lobbyid); + eim.setProperty("level", level); + + eim.setProperty("statusStg1", -1); + eim.setProperty("statusStg2", -1); + eim.setProperty("statusStg3", -1); + eim.setProperty("statusStg4", -1); + eim.setProperty("statusStg5", -1); + eim.setProperty("statusStg6", -1); + eim.setProperty("statusStg7", -1); + eim.setProperty("statusStg8", -1); + eim.setProperty("statusStg7_c", 0); + eim.setProperty("statusStgBonus", 0); + + + eim.getInstanceMap(920010000).resetPQ(level); + eim.getInstanceMap(920010100).resetPQ(level); + eim.getInstanceMap(920010200).resetPQ(level); + eim.getInstanceMap(920010300).resetPQ(level); + eim.getInstanceMap(920010400).resetPQ(level); + eim.getInstanceMap(920010500).resetPQ(level); + eim.getInstanceMap(920010600).resetPQ(level); + eim.getInstanceMap(920010601).resetPQ(level); + eim.getInstanceMap(920010602).resetPQ(level); + eim.getInstanceMap(920010603).resetPQ(level); + eim.getInstanceMap(920010604).resetPQ(level); + eim.getInstanceMap(920010700).resetPQ(level); + eim.getInstanceMap(920010800).resetPQ(level); + eim.getInstanceMap(920010900).resetPQ(level); + eim.getInstanceMap(920010910).resetPQ(level); + eim.getInstanceMap(920010911).resetPQ(level); + eim.getInstanceMap(920010912).resetPQ(level); + eim.getInstanceMap(920010920).resetPQ(level); + eim.getInstanceMap(920010921).resetPQ(level); + eim.getInstanceMap(920010922).resetPQ(level); + eim.getInstanceMap(920010930).resetPQ(level); + eim.getInstanceMap(920010931).resetPQ(level); + eim.getInstanceMap(920010932).resetPQ(level); + eim.getInstanceMap(920011000).resetPQ(level); + eim.getInstanceMap(920011100).resetPQ(level); + eim.getInstanceMap(920011200).resetPQ(level); + eim.getInstanceMap(920011300).resetPQ(level); + + respawnStages(eim); + + var d = new Date(); + eim.getInstanceMap(920010400).getReactorByName("music").setEventState(d.getDay()); + + eim.startEventTimer(eventTime * 60000); + setEventRewards(eim); + setEventExclusives(eim); + + return eim; +} + +function afterSetup(eim) { + var rnd = Math.floor(Math.random() * 4); + eim.applyEventPlayersItemBuff(2022090 + rnd); +} + +function respawnStages(eim) {} + function playerEntry(eim, player) { - var map = eim.getMapInstance(920010000); - player.changeMap(map, map.getPortal(0)); - player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock((Long.parseLong(eim.getProperty("entryTimestamp")) - System.currentTimeMillis()) / 1000)); - var texttt = "Hi, my name is Eak, the Chamberlain of the Goddess. Don't be alarmed; you won't be able to see me right now. Back when the Goddess turned into a block of stone, I simultaneously lost my own power. If you gather up the power of the Magic Cloud of Orbis, however, then I'll be able to recover my body and re-transform back to my original self. Please collect #b20#k Magic Clouds and bring them back to me. Right now, you'll only see me as a tiny, flickering light." - player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getNPCTalk(2013001, /*(byte)*/ 0, texttt, "00 00")); -//player.getClient().getSession().write(net.sf.odinms.scripting.npc.NPCScriptManager.dispose(eim.getClient())); -//THE CLOCK IS SHIT -//player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(1800)); + var map = eim.getMapInstance(entryMap); + player.changeMap(map, map.getPortal(0)); + + var texttt = "Hi, my name is Eak, the Chamberlain of the Goddess. Don't be alarmed; you won't be able to see me right now. Back when the Goddess turned into a block of stone, I simultaneously lost my own power. If you gather up the power of the Magic Cloud of Orbis, however, then I'll be able to recover my body and re-transform back to my original self. Please collect #b20#k Magic Clouds and bring them back to me. Right now, you'll only see me as a tiny, flickering light."; + player.getClient().getSession().write(Packages.tools.MaplePacketCreator.getNPCTalk(2013001, /*(byte)*/ 0, texttt, "00 00", /*(byte)*/ 0)); } -function playerDead(eim, player) { -} - -function playerRevive(eim, player) { - if (eim.isLeader(player)) { //check for party leader - //boot whole party and end - var party = eim.getPlayers(); - for (var i = 0; i < party.size(); i++) { - playerExit(eim, party.get(i)); +function scheduledTimeout(eim) { + if(eim.getIntProperty("statusStg8") == 1) { + eim.warpEventTeam(920011300); } - eim.dispose(); - } - else { //boot dead player - // If only 5 players are left, uncompletable: - var party = eim.getPlayers(); - if (party.size() <= minPlayers) { - for (var i = 0; i < party.size(); i++) { - playerExit(eim,party.get(i)); - } - eim.dispose(); + else { + end(eim); } - else - playerExit(eim, player); - } -} - -function playerDisconnected(eim, player) { - if (eim.isLeader(player)) { //check for party leader - //PWN THE PARTY (KICK OUT) - var party = eim.getPlayers(); - for (var i = 0; i < party.size(); i++) { - if (party.get(i).equals(player)) { - removePlayer(eim, player); - } - else { - playerExit(eim, party.get(i)); - } - } - eim.dispose(); - } - else { //KICK THE D/CED CUNT - // If only 5 players are left, uncompletable: - var party = eim.getPlayers(); - if (party.size() < minPlayers) { - for (var i = 0; i < party.size(); i++) { - playerExit(eim,party.get(i)); - } - eim.dispose(); - } - else - playerExit(eim, player); - } -} - -function leftParty(eim, player) { - // If only 5 players are left, uncompletable: - var party = eim.getPlayers(); - if (party.size() <= minPlayers) { - for (var i = 0; i < party.size(); i++) { - playerExit(eim,party.get(i)); - } - eim.dispose(); - } - else - playerExit(eim, player); -} - -function disbandParty(eim) { - //boot whole party and end - var party = eim.getPlayers(); - for (var i = 0; i < party.size(); i++) { - playerExit(eim, party.get(i)); - } - eim.dispose(); } function playerExit(eim, player) { - eim.unregisterPlayer(player); - player.cancelAllBuffs(); //We don't want people going out with wonky blessing >=( - player.changeMap(exitMap, exitMap.getPortal(0)); + eim.unregisterPlayer(player); + player.changeMap(exitMap, 0); } -//Those offline cuntts -function removePlayer(eim, player) { - eim.unregisterPlayer(player); - player.getMap().removePlayer(player); - player.setMap(exitMap); +function changedMap(eim, player, mapid) { + if (mapid < minMapId || mapid > maxMapId) { + if (eim.isEventTeamLackingNow(true, minPlayers, player)) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); + } +} + +function changedLeader(eim, leader) { + var mapid = leader.getMapId(); + if (!eim.isEventCleared() && (mapid < minMapId || mapid > maxMapId)) { + end(eim); + } +} + +function playerDead(eim, player) {} + +function playerRevive(eim, player) { // player presses ok on the death pop up. + if (eim.isEventTeamLackingNow(true, minPlayers, player)) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); +} + +function playerDisconnected(eim, player) { + if (eim.isEventTeamLackingNow(true, minPlayers, player)) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); +} + +function leftParty(eim, player) { + if (eim.isEventTeamLackingNow(false, minPlayers, player)) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); +} + +function disbandParty(eim) { + end(eim); +} + +function monsterValue(eim, mobId) { + return 1; +} + +function end(eim) { + var party = eim.getPlayers(); + for (var i = 0; i < party.size(); i++) { + playerExit(eim, party.get(i)); + } + eim.dispose(); +} + +function giveRandomEventReward(eim, player) { + eim.giveEventReward(player); } function clearPQ(eim) { - // W00t! Bonus!! - var iter = eim.getPlayers().iterator(); - var bonusMap = eim.getMapInstance(920011100); - while (iter.hasNext()) { - var player = iter.next(); - player.changeMap(bonusMap, bonusMap.getPortal(0)); - eim.setProperty("entryTimestamp",System.currentTimeMillis() + (1 * 60000)); - player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(60)); - } - eim.schedule("finish", 60000) -} - -function finish(eim) { - var dMap = eim.getMapInstance(920011300); - var iter = eim.getPlayers().iterator(); - while (iter.hasNext()) { - var player = iter.next(); - eim.unregisterPlayer(player); - player.changeMap(dMap, dMap.getPortal(0)); - } - eim.dispose(); + eim.stopEventTimer(); + eim.setEventCleared(); } function monsterKilled(mob, eim) {} -function allMonstersDead(eim) {} //Open Portal? o.O +function allMonstersDead(eim) {} -function cancelSchedule() { -} +function cancelSchedule() {} -function timeOut() { - var iter = em.getInstances().iterator(); - while (iter.hasNext()) { - var eim = iter.next(); - if (eim.getPlayerCount() > 0) { - var pIter = eim.getPlayers().iterator(); - while (pIter.hasNext()) { - playerExit(eim, pIter.next()); - } - } - eim.dispose(); - } -} +function dispose(eim) {} -function playerClocks(eim, player) { - if (player.getMap().hasTimer() == false){ - player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock((Long.parseLong(eim.getProperty("entryTimestamp")) - System.currentTimeMillis()) / 1000)); - //player.getMap().setTimer(true); - } -} - -function playerTimer(eim, player) { - if (player.getMap().hasTimer() == false) { - player.getMap().setTimer(true); - } -} - -function broadcastClock(eim, player) { - //var party = eim.getPlayers(); - var iter = em.getInstances().iterator(); - while (iter.hasNext()) { - var eim = iter.next(); - if (eim.getPlayerCount() > 0) { - var pIter = eim.getPlayers().iterator(); - while (pIter.hasNext()) { - playerClocks(eim, pIter.next()); - } - } - //em.schedule("broadcastClock", 1600); - } - // for (var kkl = 0; kkl < party.size(); kkl++) { - // party.get(kkl).getMap().setTimer(true); - // } - var iterr = em.getInstances().iterator(); - while (iterr.hasNext()) { - var eim = iterr.next(); - if (eim.getPlayerCount() > 0) { - var pIterr = eim.getPlayers().iterator(); - while (pIterr.hasNext()) { - //playerClocks(eim, pIter.next()); - playerTimer(eim, pIterr.next()); - } - } - //em.schedule("broadcastClock", 1600); - } - em.schedule("broadcastClock", 1600); -} - -function dispose() { - -} \ No newline at end of file diff --git a/scripts/event/OrbisPQ_old.js b/scripts/event/OrbisPQ_old.js new file mode 100644 index 0000000000..88451adc45 --- /dev/null +++ b/scripts/event/OrbisPQ_old.js @@ -0,0 +1,296 @@ +/* + * 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 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 . + + THIS FILE WAS MADE BY JVLAPLE. REMOVING THIS NOTICE MEANS YOU CAN'T USE THIS SCRIPT OR ANY OTHER SCRIPT PROVIDED BY JVLAPLE. + */ + +/* + * @Author Jvlaple + * + * Orbis Party Quest + */ + +importPackage(java.lang); +importPackage(Packages.world); +importPackage(Packages.client); +importPackage(Packages.server.maps); +importPackage(Packages.server.life); +importPackage(Packages.scripting.npc); + +var exitMap; +var instanceId; +var minPlayers = 1; + +function init() { + instanceId = 1; +} + + + +function monsterValue(eim, mobId) { + return 1; +} + +function setup() { + instanceId = em.getChannelServer().getInstanceId(); + exitMap = em.getChannelServer().getMapFactory().getMap(920011200); //Teh exit map :) <---------t + var instanceName = "OrbisPQ" + instanceId; + var eim = em.newInstance(instanceName); + var mf = eim.getMapFactory(); + em.getChannelServer().addInstanceId(); + var map = mf.getMap(920010000);//wutt + //map.shuffleReactors(); + // eim.addMapInstance(920010000,map); + //var firstPortal = eim.getMapInstance(920010000).getPortal("in00"); + //firstPortal.setScriptName("hontale_BtoB1"); + //Fuck this timer + //eim.setProperty("bulbWay", 0); + //Define all Maps and PortalScripts + var centerMap = eim.getMapInstance(920010100); + centerMap.getPortal(13).setScriptName("orbisPQSealedRoom"); + centerMap.getPortal(4).setScriptName("orbisPQWalkway"); + centerMap.getPortal(12).setScriptName("orbisPQStorage"); + centerMap.getPortal(5).setScriptName("orbisPQLobby"); + centerMap.getPortal(14).setScriptName("orbisPQOnTheWayUp"); + centerMap.getPortal(15).setScriptName("orbisPQLounge"); + centerMap.getPortal(16).setScriptName("orbisPQRoomOfDarkness"); + var walkwayMap = eim.getMapInstance(920010200); + var storageMap = eim.getMapInstance(920010300); + var lobbyMap = eim.getMapInstance(920010400); + var sealedRoomMap = eim.getMapInstance(920010500); + var loungeMap = eim.getMapInstance(920010600); + var onTheWayUpMap = eim.getMapInstance(920010700); + var bossMap = eim.getMapInstance(920010800); + var jailMap = eim.getMapInstance(920010900); + var roomOfDarknessMap = eim.getMapInstance(920011000); + var bonusMap = eim.getMapInstance(920011100); + var endMap = eim.getMapInstance(920011300); + walkwayMap.getPortal(13).setScriptName("orbisPQWalkwayExit"); + storageMap.getPortal(1).setScriptName("orbisPQStorageExit"); + lobbyMap.getPortal(8).setScriptName("orbisPQLobbyExit"); + sealedRoomMap.getPortal(3).setScriptName("orbisPQSRExit"); + loungeMap.getPortal(17).setScriptName("orbisPQLoungeExit"); + onTheWayUpMap.getPortal(23).setScriptName("orbisPQOnTheWayUpExit"); + bossMap.getPortal(1).setScriptName("orbisPQGardenExit"); + roomOfDarknessMap.getPortal(1).setScriptName("orbisPQRoomOfDarknessExit"); + //-->Fuck we are done with portals -.- + eim.setProperty("killedCellions", "0"); + eim.setProperty("papaSpawned", "no"); + em.schedule("timeOut", 60 * 60000); + em.schedule("broadcastClock", 1500); + eim.setProperty("entryTimestamp",System.currentTimeMillis() + (60 * 60000)); + + return eim; +} + +function afterSetup(eim) {} + +function playerEntry(eim, player) { + var map = eim.getMapInstance(920010000); + player.changeMap(map, map.getPortal(0)); + player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock((Long.parseLong(eim.getProperty("entryTimestamp")) - System.currentTimeMillis()) / 1000)); + var texttt = "Hi, my name is Eak, the Chamberlain of the Goddess. Don't be alarmed; you won't be able to see me right now. Back when the Goddess turned into a block of stone, I simultaneously lost my own power. If you gather up the power of the Magic Cloud of Orbis, however, then I'll be able to recover my body and re-transform back to my original self. Please collect #b20#k Magic Clouds and bring them back to me. Right now, you'll only see me as a tiny, flickering light." + player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getNPCTalk(2013001, /*(byte)*/ 0, texttt, "00 00")); +//player.getClient().getSession().write(net.sf.odinms.scripting.npc.NPCScriptManager.dispose(eim.getClient())); +//THE CLOCK IS SHIT +//player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(1800)); +} + +function playerDead(eim, player) { +} + +function playerRevive(eim, player) { + if (eim.isLeader(player)) { //check for party leader + //boot whole party and end + var party = eim.getPlayers(); + for (var i = 0; i < party.size(); i++) { + playerExit(eim, party.get(i)); + } + eim.dispose(); + } + else { //boot dead player + // If only 5 players are left, uncompletable: + var party = eim.getPlayers(); + if (party.size() <= minPlayers) { + for (var i = 0; i < party.size(); i++) { + playerExit(eim,party.get(i)); + } + eim.dispose(); + } + else + playerExit(eim, player); + } +} + +function playerDisconnected(eim, player) { + if (eim.isLeader(player)) { //check for party leader + //PWN THE PARTY (KICK OUT) + var party = eim.getPlayers(); + for (var i = 0; i < party.size(); i++) { + if (party.get(i).equals(player)) { + removePlayer(eim, player); + } + else { + playerExit(eim, party.get(i)); + } + } + eim.dispose(); + } + else { //KICK THE D/CED CUNT + // If only 5 players are left, uncompletable: + var party = eim.getPlayers(); + if (party.size() < minPlayers) { + for (var i = 0; i < party.size(); i++) { + playerExit(eim,party.get(i)); + } + eim.dispose(); + } + else + playerExit(eim, player); + } +} + +function leftParty(eim, player) { + // If only 5 players are left, uncompletable: + var party = eim.getPlayers(); + if (party.size() <= minPlayers) { + for (var i = 0; i < party.size(); i++) { + playerExit(eim,party.get(i)); + } + eim.dispose(); + } + else + playerExit(eim, player); +} + +function disbandParty(eim) { + //boot whole party and end + var party = eim.getPlayers(); + for (var i = 0; i < party.size(); i++) { + playerExit(eim, party.get(i)); + } + eim.dispose(); +} + +function playerExit(eim, player) { + eim.unregisterPlayer(player); + player.cancelAllBuffs(); //We don't want people going out with wonky blessing >=( + player.changeMap(exitMap, exitMap.getPortal(0)); +} + +//Those offline cuntts +function removePlayer(eim, player) { + eim.unregisterPlayer(player); + player.getMap().removePlayer(player); + player.setMap(exitMap); +} + +function clearPQ(eim) { + // W00t! Bonus!! + var iter = eim.getPlayers().iterator(); + var bonusMap = eim.getMapInstance(920011100); + while (iter.hasNext()) { + var player = iter.next(); + player.changeMap(bonusMap, bonusMap.getPortal(0)); + eim.setProperty("entryTimestamp",System.currentTimeMillis() + (1 * 60000)); + player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(60)); + } + eim.schedule("finish", 60000) +} + +function finish(eim) { + var dMap = eim.getMapInstance(920011300); + var iter = eim.getPlayers().iterator(); + while (iter.hasNext()) { + var player = iter.next(); + eim.unregisterPlayer(player); + player.changeMap(dMap, dMap.getPortal(0)); + } + eim.dispose(); +} + +function monsterKilled(mob, eim) {} + +function allMonstersDead(eim) {} //Open Portal? o.O + +function cancelSchedule() { +} + +function timeOut() { + var iter = em.getInstances().iterator(); + while (iter.hasNext()) { + var eim = iter.next(); + if (eim.getPlayerCount() > 0) { + var pIter = eim.getPlayers().iterator(); + while (pIter.hasNext()) { + playerExit(eim, pIter.next()); + } + } + eim.dispose(); + } +} + +function playerClocks(eim, player) { + if (player.getMap().hasTimer() == false){ + player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock((Long.parseLong(eim.getProperty("entryTimestamp")) - System.currentTimeMillis()) / 1000)); + //player.getMap().setTimer(true); + } +} + +function playerTimer(eim, player) { + if (player.getMap().hasTimer() == false) { + player.getMap().setTimer(true); + } +} + +function broadcastClock(eim, player) { + //var party = eim.getPlayers(); + var iter = em.getInstances().iterator(); + while (iter.hasNext()) { + var eim = iter.next(); + if (eim.getPlayerCount() > 0) { + var pIter = eim.getPlayers().iterator(); + while (pIter.hasNext()) { + playerClocks(eim, pIter.next()); + } + } + //em.schedule("broadcastClock", 1600); + } + // for (var kkl = 0; kkl < party.size(); kkl++) { + // party.get(kkl).getMap().setTimer(true); + // } + var iterr = em.getInstances().iterator(); + while (iterr.hasNext()) { + var eim = iterr.next(); + if (eim.getPlayerCount() > 0) { + var pIterr = eim.getPlayers().iterator(); + while (pIterr.hasNext()) { + //playerClocks(eim, pIter.next()); + playerTimer(eim, pIterr.next()); + } + } + //em.schedule("broadcastClock", 1600); + } + em.schedule("broadcastClock", 1600); +} + +function dispose() { + +} \ No newline at end of file diff --git a/scripts/event/PiratePQ.js b/scripts/event/PiratePQ.js index 135b886438..4182dcfbb4 100644 --- a/scripts/event/PiratePQ.js +++ b/scripts/event/PiratePQ.js @@ -167,6 +167,8 @@ function setup(level, lobbyid) { return eim; } +function afterSetup(eim) {} + function respawnStg4(eim) { eim.getMapInstance(925100400).instanceMapRespawn(); eim.schedule("respawnStg4", 10 * 1000); diff --git a/scripts/event/RockSpirit.js b/scripts/event/RockSpirit.js index 1634c255d8..1c32a64862 100644 --- a/scripts/event/RockSpirit.js +++ b/scripts/event/RockSpirit.js @@ -38,6 +38,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function respawn(eim) { var map = eim.getMapInstance(startMap.getId()); var map2 = eim.getMapInstance(otherMap.getId()); diff --git a/scripts/event/ScargaBattle.js b/scripts/event/ScargaBattle.js index ef923bd3aa..45e8251c61 100644 --- a/scripts/event/ScargaBattle.js +++ b/scripts/event/ScargaBattle.js @@ -44,7 +44,7 @@ function setup() { return eim; } - +function afterSetup(eim) {} function playerEntry(eim,player) { var battle = eim.getMapInstance(battleMap.getId()); diff --git a/scripts/event/VIPRockSpirit.js b/scripts/event/VIPRockSpirit.js index 383fc20352..400458b53a 100644 --- a/scripts/event/VIPRockSpirit.js +++ b/scripts/event/VIPRockSpirit.js @@ -38,6 +38,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function respawn(eim) { var map = eim.getMapInstance(startMap.getId()); var map2 = eim.getMapInstance(otherMap.getId()); diff --git a/scripts/event/ZakumBattle.js b/scripts/event/ZakumBattle.js index 874802136f..66798beaf1 100644 --- a/scripts/event/ZakumBattle.js +++ b/scripts/event/ZakumBattle.js @@ -53,7 +53,7 @@ function setup() { return eim; } - +function afterSetup(eim) {} function playerEntry(eim,player) { var altar = eim.getMapInstance(altarMap.getId()); diff --git a/scripts/event/ZakumPQ.js b/scripts/event/ZakumPQ.js index f54ae1515d..2e14c3c4c4 100644 --- a/scripts/event/ZakumPQ.js +++ b/scripts/event/ZakumPQ.js @@ -60,6 +60,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { var map = eim.getMapInstance(280010000); player.changeMap(map, map.getPortal(0)); diff --git a/scripts/event/s4aWorld.js b/scripts/event/s4aWorld.js index ad3bacd9e4..7c141e8148 100644 --- a/scripts/event/s4aWorld.js +++ b/scripts/event/s4aWorld.js @@ -23,6 +23,8 @@ function setup() { return eim; } +function afterSetup(eim) {} + function playerEntry(eim, player) { var map = eim.getMapFactory().getMap(910500000); player.changeMap(map, map.getPortal(0)); diff --git a/scripts/npc/1012112.js b/scripts/npc/1012112.js index 7658922a3c..c5e9747f6b 100644 --- a/scripts/npc/1012112.js +++ b/scripts/npc/1012112.js @@ -83,17 +83,17 @@ function action(mode, type, selection) { cm.sendOk("#e#b#k#n\r\nCollect primrose seeds from the flowers at the bottom part of the map and drop them by the platforms above the stage. Primrose seed color must match to grow the seeds, so test until you find the correct combination. When all the seeds have been planted, that is, starting second part of the mission, scout the Moon Bunny while it prepares Rice Cakes for the hungry Growlie. Once Growlie becomes satisfied, your mission is complete."); cm.dispose(); } else { - cm.sendYesNo("So you want to exchange #b20 #b#t4001129##k for the event-designed hat?"); + cm.sendYesNo("So you want to exchange #b20 #b#t4001158##k for the event-designed hat?"); } } else { - if(cm.hasItem(4001129, 20)) { + if(cm.hasItem(4001158, 20)) { if(cm.canHold(1002798)) { - cm.gainItem(4001129, -20); + cm.gainItem(4001158, -20); cm.gainItem(1002798, 20); cm.sendNext("Here it is. Enjoy!"); } } else { - cm.sendNext("You don't have enough #t4001129# to buy it yet!"); + cm.sendNext("You don't have enough #t4001158# to buy it yet!"); } cm.dispose(); diff --git a/scripts/npc/2013000.js b/scripts/npc/2013000.js new file mode 100644 index 0000000000..54eecd98c6 --- /dev/null +++ b/scripts/npc/2013000.js @@ -0,0 +1,91 @@ +/** + * @author: Ronan + * @npc: Wonky + * @map: 200080101 - Orbis - The Unknown Tower + * @func: Orbis PQ +*/ + +var status = 0; +var em = null; + +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } + if (mode == 1) + status++; + else + status--; + + if(cm.getMapId() == 200080101) { + if (status == 0) { + em = cm.getEventManager("OrbisPQ"); + if(em == null) { + cm.sendOk("The Orbis PQ has encountered an error."); + cm.dispose(); + return; + } + + cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bTower of Goddess#k? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.\r\n#L3#I would like to reclaim a prize."); + } else if (status == 1) { + if (selection == 0) { + if (cm.getParty() == null) { + cm.sendOk("You can participate in the party quest only if you are in a party."); + cm.dispose(); + } else if(!cm.isLeader()) { + cm.sendOk("Your party leader must talk to me to start this party quest."); + cm.dispose(); + } else { + var eli = em.getEligibleParty(cm.getParty()); + if(eli.size() > 0) { + if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) { + cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish."); + } + } + else { + cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search."); + } + + cm.dispose(); + } + } else if (selection == 1) { + cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!"); + cm.dispose(); + } else if (selection == 2) { + cm.sendOk("#e#b#k#n\r\nOur goddess has been missing since some time ago, rumor has it She has been seen last time inside the Tower of Goddess. Furthermore, our sanctuary has been seized by the overwhelming forces of the pixies, those beings that are recently wandering at the outskirts of Orbis. Their leader, Papa Pixie, currently holds the throne and may know Her whereabouts, so we urge to find a composition of brave heroes to charge into and claim back our sanctuary and rescue Her. Will you join us?\r\n"); + cm.dispose(); + } + else { + cm.sendSimple("So, what prize do you want to obtain?\r\n#b#L0#Give me Goddess Wristband.\r\n"); + } + } else if (status == 2) { + if (selection == 0) { + if (!cm.haveItem(1082232) && cm.haveItem(4001158, 10)) { + cm.gainItem(1082232, 1); + cm.gainItem(4001158, -10); + cm.dispose(); + } else { + cm.sendOk("You either have Goddess Wristband already or you do not have 10 #t4001158#."); + cm.dispose(); + } + } + } + } else { + if(status == 0) { + cm.sendYesNo("Are you going to drop out from this rescue mission?"); + } else if(status == 1) { + cm.warp(920011200); + cm.dispose(); + } + } + } +} \ No newline at end of file diff --git a/scripts/npc/2013001.js b/scripts/npc/2013001.js new file mode 100644 index 0000000000..40eea68279 --- /dev/null +++ b/scripts/npc/2013001.js @@ -0,0 +1,289 @@ +/** + * @author: Ronan + * @npc: Chamberlain Eak + * @map: Orbis - Tower of Goddess + * @func: Orbis PQ +*/ + +var status = 0; +var em = null; + +function isStatueComplete() { + for(var i = 1; i <= 6; i++) { + if(cm.getMap().getReactorByName("scar" + i).getState() < 1) return false; + } + + return true; +} + +function clearStage(stage, eim) { + eim.setProperty("statusStg" + stage, "1"); + eim.showClearEffect(true); +} + +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } + if (mode == 1) + status++; + else + status--; + + if (cm.getPlayer().getMapId() == 920011200) { //exit + cm.warp(200080101); + cm.dispose(); + return; + } + if (!cm.isLeader()) { + if(cm.getPlayer().getMapId() == 920010000) { + cm.warp(920010000, 2); + cm.dispose(); + return; + } + + cm.sendOk("I only wish to speak to your leader!"); + cm.dispose(); + return; + } + + var eim = cm.getEventInstance(); + + switch(cm.getPlayer().getMapId()) { + case 920010000: + if(eim.getIntProperty("statusStg0") != 1) { + eim.warpEventTeamToMapSpawnPoint(920010000, 2); + eim.giveEventPlayersExp(3500); + clearStage(0, eim); + + cm.sendNext("Please save Minerva, She've been trapped in the seal by Papa Pixie, the terror of our tower! He misplaced all of our Minerva Statue's parts and we have to get it all back! Oh pardon me, I am the tower's Chamberlain, Eak. I am Minerva's royal servant."); + } + else { + cm.warp(920010000, 2); + } + cm.dispose(); + break; + case 920010100: + if (isStatueComplete()) { + if (eim.getIntProperty("statusStg7") == -1) { + eim.warpEventTeam(920010800); + } else if(eim.getIntProperty("statusStg8") == -1) { + cm.sendOk("Oh! You brought the #t4001055#! Please, drop it at the base of the statue to bring Minerva back!"); + } else { + cm.sendOk("Thank you for saving Minerva! Please, talk to her..."); + } + } else { + cm.sendOk("Please, save Minerva! Gather the six pieces of her statue and then talk to me to retrieve the final piece!"); + } + break; + case 920010200: //walkway + if (!cm.haveItem(4001050,30)) { + cm.sendOk("Gather the 30 Statue Pieces from the monsters in this stage, and please bring them to me so I can put them together!"); + } else { + cm.sendOk("You got them all! Here, the 1st statue piece."); + cm.removeAll(4001050); + cm.gainItem(4001044,1); //first piece + eim.giveEventPlayersExp(3500); + clearStage(1, eim); + } + break; + case 920010300: //storage + if(eim.getIntProperty("statusStg2") != 1) { + if(cm.getMap().countMonsters() == 0 && cm.getMap().countItems() == 0) { + if(cm.canHold(4001045)) { + cm.sendOk("Oh, I've found the 2nd Piece of Statue. Here, take it."); + cm.gainItem(4001045, 1); + eim.giveEventPlayersExp(3500); + clearStage(2, eim); + eim.setProperty("statusStg2", "1"); + } else { + cm.sendOk("I've found the 2nd Piece of Statue. Get a slot available on your inventory to take it."); + } + } else { + cm.sendOk("Find the 2nd Piece of Statue that is hidden in this room."); + } + } else { + cm.sendOk("Well done. Go find the other statue pieces."); + } + + break; + case 920010400: //lobby + if (eim.getIntProperty("statusStg3") == -1) { + cm.sendOk("Please, find the LP for the current day of week and place it on the music player.\r\n#v4001056# Sunday\r\n#v4001057# Monday\r\n#v4001058# Tuesday\r\n#v4001059# Wednesday\r\n#v4001060# Thursday\r\n#v4001061# Friday\r\n#v4001062# Saturday\r\n"); + } else if (eim.getIntProperty("statusStg3") == 0) { + cm.getMap().getReactorByName("stone3").forceHitReactor(1); + cm.sendOk("Ooh, the music... It sounds so fitting with the ambient. Nicely done, a box has appeared on the field. Retrieve the statue part from it!"); + eim.giveEventPlayersExp(3500); + clearStage(3, eim); + eim.setProperty("statusStg3", "2"); + + } else { + cm.sendOk("Thank you so much!"); + } + break; + case 920010500: //sealed + if (eim.getIntProperty("statusStg4") == -1) { + var total = 3; + for(var i = 0; i < 2; i++) { + var rnd = Math.round(Math.random() * total); + total -= rnd; + + eim.setProperty("stage4_" + i, rnd); + } + eim.setProperty("stage4_2", "" + total); + + eim.setProperty("statusStg4", "0"); + } + if (eim.getIntProperty("statusStg4") == 0) { + var players = Array(); + var total = 0; + for (var i = 0; i < 3; i++) { + var z = cm.getMap().getNumPlayersItemsInArea(i); + players.push(z); + total += z; + } + if (total != 3) { + cm.sendOk("There needs to be 3 players OR items on the platforms."); + } else { + var num_correct = 0; + for (var i = 0; i < 3; i++) { + if (eim.getProperty("stage4_" + i).equals("" + players[i])) { + num_correct++; + } + } + if (num_correct == 3) { + cm.sendOk("You found the right combination! A box has appeared on the top of this map, go retrieve the statue piece from it!"); + cm.getMap().getReactorByName("stone4").forceHitReactor(1); + eim.giveEventPlayersExp(3500); + clearStage(4, eim); + } else { + eim.showWrongEffect(); + if (num_correct > 0) { + cm.sendOk("One of the platforms has the right number of players."); + } else { + cm.sendOk("All of the platforms have the wrong amount of players."); + } + } + } + } else { + cm.sendOk("Well done! Please, go fetch the other pieces and save Minerva!"); + } + cm.dispose(); + break; + case 920010600: //lounge + if(eim.getIntProperty("statusStg5") == -1) { + if (!cm.haveItem(4001052,40)) { + cm.sendOk("Gather the 40 Statue Pieces from the monsters in this stage, and please bring them to me so I can put them together!"); + } else { + cm.sendOk("You got them all! Here, the 5th statue piece."); + cm.removeAll(4001052); + cm.gainItem(4001048,1); //fifth piece + eim.giveEventPlayersExp(3500); + clearStage(5, eim); + eim.setIntProperty("statusStg5", 1); + } + } else { + cm.sendOk("You got them all here. Go search the others rooms of the tower."); + } + break; + case 920010700: //on the way up + if (eim.getIntProperty("statusStg6") == -1) { + var rnd1 = Math.floor(Math.random() * 5); + + var rnd2 = Math.floor(Math.random() * 5); + while(rnd2 == rnd1) { + rnd2 = Math.floor(Math.random() * 5); + } + + if(rnd1 > rnd2) { + rnd1 = rnd1 ^ rnd2; + rnd2 = rnd1 ^ rnd2; + rnd1 = rnd1 ^ rnd2; + } + + var comb = ""; + for(var i = 0; i < rnd1; i++) comb += "0"; + comb += "1"; + for(var i = rnd1 + 1; i < rnd2; i++) comb += "0"; + comb += "1"; + for(var i = rnd2 + 1; i < 5; i++) comb += "0"; + + eim.setProperty("stage6_c", "" + comb); + + eim.setProperty("statusStg6", "0"); + } + + var comb = eim.getProperty("stage6_c"); + + if (eim.getIntProperty("statusStg6") == 0) { + var react = ""; + var total = 0; + for(var i = 1; i <= 5; i++) { + if (cm.getMap().getReactorByName("" + i).getState() > 0) { + react += "1"; + total += 1; + } else { + react += "0"; + } + } + + if (total != 2) { + cm.sendOk("There needs to be exactly 2 levers at the top of the map pushed on."); + } else { + var num_correct = 0; + var psh_correct = 0; + for (var i = 0; i < 5; i++) { + if (react.charCodeAt(i) == comb.charCodeAt(i)) { + num_correct++; + if(react.charAt(i) == '1') psh_correct++; + } + } + if (num_correct == 5) { + cm.sendOk("You found the right combination! Retrieve the statue piece from inside it!"); + cm.getMap().getReactorByName("stone6").forceHitReactor(1); + eim.giveEventPlayersExp(3500); + clearStage(6, eim); + } else { + eim.showWrongEffect(); + if (psh_correct >= 1) { + cm.sendOk("One of the pushed levers is correct."); + } else { + cm.sendOk("Both of the pushed levers are wrong."); + } + } + } + } else { + cm.sendOk("Nicely done!! Go check out the rest of the pieces."); + } + break; + case 920010800: + cm.sendNext("Please, find a way to defeat Papa Pixie! Once you've found the Dark Nependeath by placing seeds, you've found Papa Pixie! Defeat it, and get the Root of Life to save Minerva!!!"); + break; + case 920010900: + cm.sendNext("This is the jail of the tower. You may find some goodies here, just be sure to clear the puzzles ahead as fast as possible."); + break; + case 920011000: + if(cm.getMap().countMonsters() > 0) { + cm.sendNext("This is the hidden room of the tower. After eliminating all monsters on this room, talk to me to gain access to the treasure room, leaving the center tower access behind."); + } else { + cm.warp(920011100); + } + break; + } + cm.dispose(); + } +} + +function clear() { + cm.showEffect(true, "quest/party/clear"); + cm.playSound(true, "Party1/Clear"); +} \ No newline at end of file diff --git a/scripts/npc/2013002.js b/scripts/npc/2013002.js index 2386140397..6ae2dc47ef 100644 --- a/scripts/npc/2013002.js +++ b/scripts/npc/2013002.js @@ -24,10 +24,6 @@ *@author Jvlaple */ var status = 0; -var itemArray = Array(2000004, 2000005, 2000006, 2002020, 2002021, 2002022, 2002023, 2002024, 2002025, 2002026, 2001000, 2001002, 2002015, 2050005, 2022179, 2020014, 2020015 /*End of Pots*/, 2100000, 2100001, 2100002, 2100003, 2100004, 2100005, /*End of Sacks*/ - 2061003, 2060003, 2060004, 2061004 /*End of Arrows*/, 2070006, 2070005, 2070007, 2070004 /*End of Stars*/, 2210000, 2210001, 2210002 /*End of Morph items*/ ); -var itemQuan = Array(50, 20, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 5, 30, 2, 100, 50, 1, 1, 1, 1, 1, 1, 2000, 2000, 2000, 2000, 1, 1, 1, 1, 5, 5, 5); -var PQItems = new Array(4001022, 4001023); function start() { status = -1; @@ -38,27 +34,36 @@ function action(mode, type, selection) { if (mode < 1) cm.dispose(); else { - status++; + status++; if (cm.getPlayer().getMapId() == 920010100) { //Center tower if (status == 0) - cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end..."); + cm.sendYesNo("I have lifted the spell that was blocking the access to the tower's jail storages. You may find some goodies down there... Alternatively, you may want to be leaving now. Are you ready to exit?"); else if (status == 1) { - var eim = cm.getPlayer().getEventInstance(); - eim.clearPQ(); + cm.warp(920011300, 0); cm.dispose(); } + + } else if (cm.getPlayer().getMapId() == 920011100) { + if (status == 0) + cm.sendYesNo("So, are you ready to exit?"); + else if (status == 1) { + cm.warp(920011300, 0); + cm.dispose(); + } + } else if (cm.getPlayer().getMapId() == 920011300) { if (status == 0) - cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end..."); + cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end... As a token of gratitude, please accept this memento for your bravery."); else if (status == 1) { - for (var i = 0; i < PQItems.length; i++) - cm.removeAll(PQItems[i]); // Remove All PQ Items :D - var randmm = (Math.random() * itemArray.length) | 0; - cm.gainItem(itemArray[randmm], itemQuan[randmm]); - cm.warp(200080101, 0); - cm.dispose(); + if(cm.getEventInstance().giveEventReward(cm.getPlayer())) { + cm.warp(200080101, 0); + cm.dispose(); + } + else { + cm.sendOk("Please make room on your inventory first."); + cm.dispose(); + } } } } -} - \ No newline at end of file +} \ No newline at end of file diff --git a/scripts/npc/2094001.js b/scripts/npc/2094001.js index 9a436438b6..f3536c2f73 100644 --- a/scripts/npc/2094001.js +++ b/scripts/npc/2094001.js @@ -61,53 +61,53 @@ function action(mode, type, selection) { cm.sendSimple("Thank you for saving me! How can I help you?\r\n#b#L0#Get me out of here.\r\n#L1#Give me Pirate Hat."); } else if (status == 1) { if (selection == 0) { - if (!cm.canHold(4001129, 1)) { + if (!cm.canHold(4001158, 1)) { cm.sendOk("Please make room in ETC."); cm.dispose(); return; } - cm.gainItem(4001129, 1); + cm.gainItem(4001158, 1); cm.warp(251010404,0); } else { if (cm.haveItem(1003267, 1)) { cm.sendOk("You have the best hat."); } else if (cm.haveItem(1002573, 1)) { - if (cm.haveItem(4001129, 20)) { + if (cm.haveItem(4001158, 20)) { if (cm.canHold(1003267,1)) { cm.gainItem(1002573, -1); - cm.gainItem(4001129, -20); + cm.gainItem(4001158, -20); cm.gainItem(1003267,1); cm.sendOk("I have given you the hat."); } else { cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); } } else { - cm.sendOk("You need 20 #t4001129# to get the next hat."); + cm.sendOk("You need 20 #t4001158# to get the next hat."); } } else if (cm.haveItem(1002572, 1)) { - if (cm.haveItem(4001129, 20)) { + if (cm.haveItem(4001158, 20)) { if (cm.canHold(1002573,1)) { cm.gainItem(1002572, -1); - cm.gainItem(4001129, -20); + cm.gainItem(4001158, -20); cm.gainItem(1002573,1); cm.sendOk("I have given you the hat."); } else { cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); } } else { - cm.sendOk("You need 20 #t4001129# to get the next hat."); + cm.sendOk("You need 20 #t4001158# to get the next hat."); } } else { - if (cm.haveItem(4001129, 20)) { + if (cm.haveItem(4001158, 20)) { if (cm.canHold(1002572,1)) { - cm.gainItem(4001129, -20); + cm.gainItem(4001158, -20); cm.gainItem(1002572,1); cm.sendOk("I have given you the hat."); } else { cm.sendOk("Please make room in your EQUIP inventory before receiving the hat."); } } else { - cm.sendOk("You need 20 #t4001129# to get the next hat."); + cm.sendOk("You need 20 #t4001158# to get the next hat."); } } } diff --git a/scripts/npc/9020002.js b/scripts/npc/9020002.js index fa43ab07d9..f202542c42 100644 --- a/scripts/npc/9020002.js +++ b/scripts/npc/9020002.js @@ -48,7 +48,7 @@ function action(mode, type, selection){ if (status == 0) { cm.sendNext("To return back to the city, follow this way."); } else { - cm.getPlayer().changeMap(103000000, cm.getClient().getChannelServer().getMapFactory().getMap(103000000).getRandomSpawnpoint()); + cm.getPlayer().warp(103000000, cm.getClient().getChannelServer().getMapFactory().getMap(103000000).getRandomPlayerSpawnpoint()); cm.dispose(); } } else { diff --git a/scripts/portal/party3_gardenin.js b/scripts/portal/party3_gardenin.js new file mode 100644 index 0000000000..dfee2e3dd0 --- /dev/null +++ b/scripts/portal/party3_gardenin.js @@ -0,0 +1,9 @@ +function enter(pi) { + if (pi.getPlayer().getParty() != null && pi.isLeader() && pi.haveItem(4001055,1)) { + pi.getEventInstance().warpEventTeam(920010100); + return true; + } else { + pi.playerMessage(5,"Please get the leader in this portal, make sure you have the Root of Life."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/party3_jail1.js b/scripts/portal/party3_jail1.js new file mode 100644 index 0000000000..084b93632b --- /dev/null +++ b/scripts/portal/party3_jail1.js @@ -0,0 +1,10 @@ +function enter(pi) { + if(pi.getEventInstance().getIntProperty("statusStg8") == 1) { + pi.warp(920010910,0); + return true; + } + else { + pi.playerMessage(5, "The storage is currently inaccessible, as the powers of the Pixies remains active within the tower."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/party3_jail2.js b/scripts/portal/party3_jail2.js new file mode 100644 index 0000000000..37e981c6fa --- /dev/null +++ b/scripts/portal/party3_jail2.js @@ -0,0 +1,10 @@ +function enter(pi) { + if(pi.getEventInstance().getIntProperty("statusStg8") == 1) { + pi.warp(920010920,0); + return true; + } + else { + pi.playerMessage(5, "The storage is currently inaccessible, as the powers of the Pixies remains active within the tower."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/party3_jail3.js b/scripts/portal/party3_jail3.js new file mode 100644 index 0000000000..346a0bb6c9 --- /dev/null +++ b/scripts/portal/party3_jail3.js @@ -0,0 +1,10 @@ +function enter(pi) { + if(pi.getEventInstance().getIntProperty("statusStg8") == 1) { + pi.warp(920010930,0); + return true; + } + else { + pi.playerMessage(5, "The storage is currently inaccessible, as the powers of the Pixies remains active within the tower."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/party3_jailin.js b/scripts/portal/party3_jailin.js new file mode 100644 index 0000000000..69d22c354d --- /dev/null +++ b/scripts/portal/party3_jailin.js @@ -0,0 +1,46 @@ +importPackage(Packages.tools); + +function enter(pi) { + var map = pi.getMap(); + + var jailn = (pi.getMap().getId() / 10) % 10; + var maxToggles = (jailn == 1) ? 7 : 6; + + var mapProp = pi.getEventInstance().getProperty("jail" + jailn); + + if(mapProp == null) { + var seq = 0; + + for(var i = 1; i <= maxToggles; i++) { + if(Math.random() < 0.5) seq += (1 << i); + } + + pi.getEventInstance().setProperty("jail" + jailn, seq); + mapProp = seq; + } + + mapProp = Number(mapProp); + if(mapProp != 0) { + var countMiss = 0; + for(var i = 1; i <= maxToggles; i++) { + if(!(pi.getMap().getReactorByName("lever" + i).getState() == (mapProp >> i) % 2)) { + countMiss++; + } + } + + if(countMiss > 0) { + map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/wrong_kor")); + map.broadcastMessage(MaplePacketCreator.playSound("Party1/Failed")); + + pi.playerMessage(5, "The right combination of levers is needed to pass. " + countMiss + " lever(s) are misplaced."); + return false; + } + + map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear")); + map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear")); + pi.getEventInstance().setProperty("jail" + jailn, "0"); + } + + pi.warp(pi.getMapId() + 2,0); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_r4pt.js b/scripts/portal/party3_r4pt.js index 83a5f8761c..4b98206d27 100644 --- a/scripts/portal/party3_r4pt.js +++ b/scripts/portal/party3_r4pt.js @@ -3,28 +3,51 @@ 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 Jvlaple + *@author Ronan *party3_r4pt */ function enter(pi) { - pi.warp(920010600, Math.random() * 3 > 1 ? 14 : 2); - return true; + var eim = pi.getEventInstance(); + if(eim.getProperty("stage4_comb") == null) { + var r = Math.floor((Math.random() * 3)) + 1; + var s = Math.floor((Math.random() * 3)) + 1; + + eim.setProperty("stage4_comb", "" + r + s); + } + + var pname = Number(pi.getPortal().getName().substring(4, 6)); + var cname = Number(eim.getProperty("stage4_comb")); + + var secondPt = true; + if(pi.getPortal().getId() < 14) { + cname = Math.floor(cname / 10); + secondPt = false; + } + + if ((pname % 10) == (cname % 10)) { //climb + var nextPortal; + if(secondPt) nextPortal = 1; + else nextPortal = pi.getPortal().getId() + 3; + + pi.warp(pi.getMapId(), nextPortal); + } else { //fail + pi.warp(pi.getMapId(), 2); + } + + return false; } \ No newline at end of file diff --git a/scripts/portal/party3_r6pt.js b/scripts/portal/party3_r6pt.js new file mode 100644 index 0000000000..2647b8ed39 --- /dev/null +++ b/scripts/portal/party3_r6pt.js @@ -0,0 +1,54 @@ +/* + 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 + *party3_r4pt + */ + +function enter(pi) { + var eim = pi.getEventInstance(); + if(eim.getProperty("stage6_comb") == null) { + var comb = "0"; + + for(var i = 0; i < 16; i++) { + var r = Math.floor((Math.random() * 4)) + 1; + comb += r.toString(); + } + + eim.setProperty("stage6_comb", comb); + } + + var comb = eim.getProperty("stage6_comb"); + + var name = pi.getPortal().getName().substring(2, 5); + var portalId = parseInt(name, 10); + + + var pRow = Math.floor(portalId / 10); + var pCol = portalId % 10; + + + if (pCol == parseInt(comb.substring(pRow, pRow + 1), 10)) { //climb + pi.warp(pi.getMapId(), (pRow % 4 != 0) ? pi.getPortal().getId() + 4 : (pRow / 4)); + } else { //fail + pi.warp(pi.getMapId(), 5); + } + + return false; +} \ No newline at end of file diff --git a/scripts/portal/party3_room1.js b/scripts/portal/party3_room1.js new file mode 100644 index 0000000000..c8270682ee --- /dev/null +++ b/scripts/portal/party3_room1.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(920010200, 13); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_room2.js b/scripts/portal/party3_room2.js new file mode 100644 index 0000000000..4ca237e0bf --- /dev/null +++ b/scripts/portal/party3_room2.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(920010300, 1); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_room3.js b/scripts/portal/party3_room3.js new file mode 100644 index 0000000000..cc5733f6a4 --- /dev/null +++ b/scripts/portal/party3_room3.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(920010400, 8); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_room4.js b/scripts/portal/party3_room4.js new file mode 100644 index 0000000000..7f6c977a6a --- /dev/null +++ b/scripts/portal/party3_room4.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(920010500, 3); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_room5.js b/scripts/portal/party3_room5.js new file mode 100644 index 0000000000..4897ea9782 --- /dev/null +++ b/scripts/portal/party3_room5.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(920010600, 17); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_room6.js b/scripts/portal/party3_room6.js new file mode 100644 index 0000000000..1d81c5328b --- /dev/null +++ b/scripts/portal/party3_room6.js @@ -0,0 +1,4 @@ +function enter(pi) { + pi.warp(920010700, 23); + return true; +} \ No newline at end of file diff --git a/scripts/portal/party3_room8.js b/scripts/portal/party3_room8.js new file mode 100644 index 0000000000..d8e7eda6d9 --- /dev/null +++ b/scripts/portal/party3_room8.js @@ -0,0 +1,10 @@ +function enter(pi) { + if(pi.getEventInstance().getIntProperty("statusStg8") == 1) { + pi.warp(920011000,0); + return true; + } + else { + pi.playerMessage(5, "The storage is currently inaccessible, as the powers of the Pixies remains active within the tower."); + return false; + } +} \ No newline at end of file diff --git a/scripts/portal/party3_roomout.js b/scripts/portal/party3_roomout.js new file mode 100644 index 0000000000..bbbc941cbd --- /dev/null +++ b/scripts/portal/party3_roomout.js @@ -0,0 +1,36 @@ +function enter(pi) { + var exitPortal = 0; + + switch(pi.getMapId()) { + case 920010200: + exitPortal = 4; + break; + + case 920010300: + exitPortal = 12; + break; + + case 920010400: + exitPortal = 5; + break; + + case 920010500: + exitPortal = 13; + break; + + case 920010600: + exitPortal = 15; + break; + + case 920010700: + exitPortal = 14; + break; + + case 920011000: + exitPortal = 16; + break; + } + + pi.warp(920010100, exitPortal); + return true; +} \ No newline at end of file diff --git a/scripts/reactor/200.js b/scripts/reactor/200.js new file mode 100644 index 0000000000..c06753da3b --- /dev/null +++ b/scripts/reactor/200.js @@ -0,0 +1,3 @@ +function act() { + rm.dropItems(); +} \ No newline at end of file diff --git a/scripts/reactor/2001000.js b/scripts/reactor/2001000.js index 1c474cc07a..fa582deb93 100644 --- a/scripts/reactor/2001000.js +++ b/scripts/reactor/2001000.js @@ -19,10 +19,22 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -/*@author Jvlaple - *Nependath Pot - Spawns Nependath or Dark Nependath +/*@author Ronan + *Nependeath Pot - Spawns Nependeath or Dark Nependeath */ function act() { - rm.spawnMonster(Math.random() > .6 ? 9300049 : 9300048); + if(rm.getMap().getSummonState()) { + var count = Number(rm.getEventInstance().getIntProperty("statusStg7_c")); + + if(count < 7) { + var nextCount = (count + 1); + + rm.spawnMonster(Math.random() >= .6 ? 9300049 : 9300048); + rm.getEventInstance().setProperty("statusStg7_c", nextCount); + } + else { + rm.spawnMonster(9300049); + } + } } \ No newline at end of file diff --git a/scripts/reactor/2001001.js b/scripts/reactor/2001001.js new file mode 100644 index 0000000000..fa582deb93 --- /dev/null +++ b/scripts/reactor/2001001.js @@ -0,0 +1,40 @@ +/* + 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 + *Nependeath Pot - Spawns Nependeath or Dark Nependeath + */ + +function act() { + if(rm.getMap().getSummonState()) { + var count = Number(rm.getEventInstance().getIntProperty("statusStg7_c")); + + if(count < 7) { + var nextCount = (count + 1); + + rm.spawnMonster(Math.random() >= .6 ? 9300049 : 9300048); + rm.getEventInstance().setProperty("statusStg7_c", nextCount); + } + else { + rm.spawnMonster(9300049); + } + } +} \ No newline at end of file diff --git a/scripts/reactor/2001002.js b/scripts/reactor/2001002.js new file mode 100644 index 0000000000..a9528cf884 --- /dev/null +++ b/scripts/reactor/2001002.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.max(Math.floor(Math.random() * 14), 4); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001003.js b/scripts/reactor/2001003.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001003.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001004.js b/scripts/reactor/2001004.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001004.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001005.js b/scripts/reactor/2001005.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001005.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001006.js b/scripts/reactor/2001006.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001006.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001007.js b/scripts/reactor/2001007.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001007.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001008.js b/scripts/reactor/2001008.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001008.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001009.js b/scripts/reactor/2001009.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001009.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001010.js b/scripts/reactor/2001010.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001010.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001011.js b/scripts/reactor/2001011.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001011.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001012.js b/scripts/reactor/2001012.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001012.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001013.js b/scripts/reactor/2001013.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001013.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001014.js b/scripts/reactor/2001014.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001014.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001015.js b/scripts/reactor/2001015.js new file mode 100644 index 0000000000..d213aa7513 --- /dev/null +++ b/scripts/reactor/2001015.js @@ -0,0 +1,55 @@ +/* + 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 + * + * 2001002.js: Either spawns a PQ mob or drops the Statue piece. +*/ + +function act() { + if(rm.getEventInstance().getIntProperty("statusStg2") == -1) { + var rnd = Math.floor(Math.random() * 14); + + rm.getEventInstance().setProperty("statusStg2", "" + rnd); + rm.getEventInstance().setProperty("statusStg2_c", "0"); + } + + var limit = rm.getEventInstance().getIntProperty("statusStg2"); + var count = rm.getEventInstance().getIntProperty("statusStg2_c"); + if(count >= limit) { + rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + + eim.setProperty("statusStg2", "1"); + eim.showClearEffect(true); + } + else { + count++; + rm.getEventInstance().setProperty("statusStg2_c", count); + + var nextHashed = (11 * (count)) % 14; + + var nextPos = rm.getMap().getReactorById(2001002 + nextHashed).getPosition(); + rm.spawnMonster(9300040, 1, nextPos); + } +} \ No newline at end of file diff --git a/scripts/reactor/2001016.js b/scripts/reactor/2001016.js new file mode 100644 index 0000000000..feb254b9d6 --- /dev/null +++ b/scripts/reactor/2001016.js @@ -0,0 +1,31 @@ +/* + 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 + *Nependeath Pot - Spawns Papa Pixie + */ + +function act() { + rm.getMap().killAllMonstersNotFriendly(); + rm.getMap().allowSummonState(false); + rm.spawnMonster(9300039, 260, 490); + rm.mapMessage(5, "As the air on the tower outskirts starts to become more dense, Papa Pixie appears."); +} \ No newline at end of file diff --git a/scripts/reactor/2002003.js b/scripts/reactor/2002003.js index 3772693a1b..3d23911aac 100644 --- a/scripts/reactor/2002003.js +++ b/scripts/reactor/2002003.js @@ -25,4 +25,9 @@ function act() { rm.dropItems(); + + var eim = rm.getEventInstance(); + eim.giveEventPlayersExp(3500); + eim.setProperty("statusStg7", "1"); + eim.showClearEffect(true); } \ No newline at end of file diff --git a/scripts/reactor/2002013.js b/scripts/reactor/2002013.js new file mode 100644 index 0000000000..fb841259af --- /dev/null +++ b/scripts/reactor/2002013.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 + * + * 2002013.js: Drops the Statue piece. +*/ + +function act() { + rm.dropItems(); +} \ No newline at end of file diff --git a/scripts/reactor/2002014.js b/scripts/reactor/2002014.js index 4e6bb3b5b5..7a0da6b7de 100644 --- a/scripts/reactor/2002014.js +++ b/scripts/reactor/2002014.js @@ -19,16 +19,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -/*@author Jvlaple - *Reactor : Orbis PQ Bonus Reactor - 2002014.js +/*@author Ronan + *Reactor : OrbisPQ Bonus Reactor - 2002014.js * Drops all the Bonus Items */ function act() { - rand = Math.floor(Math.random() * 4); - if (rand < 1) rand = 1; - //We'll make it drop a lot of crap :D - for (var i = 0; i + 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 + *Reactor : OrbisPQ Bonus Reactor - 2202004.js + * Drops all the Bonus Items + */ + +function act() { + rm.dropItems(true, 1, 100, 400, 15); +} \ No newline at end of file diff --git a/scripts/reactor/2006001.js b/scripts/reactor/2006001.js index c5adf0fd0f..e572925ff0 100644 --- a/scripts/reactor/2006001.js +++ b/scripts/reactor/2006001.js @@ -20,10 +20,14 @@ along with this program. If not, see . */ /** - *2006001.js - Spawns Minevra + *2006001.js - Spawns Minerva *@author Jvlaple */ function act() { rm.spawnNpc(2013002); + + rm.getEventInstance().clearPQ(); + rm.getEventInstance().setProperty("statusStg8", "1"); + rm.getEventInstance().startEventTimer(10 * 60000); //bonus time } \ No newline at end of file diff --git a/scripts/reactor/2008006.js b/scripts/reactor/2008006.js new file mode 100644 index 0000000000..818969475a --- /dev/null +++ b/scripts/reactor/2008006.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 + *Reactor : Orbis PQ LP Player - 2008006.js + * Makes Chamberlain Eak spawn box. + */ + +function act() { + rm.getEventInstance().setProperty("statusStg3", "0"); +} \ No newline at end of file diff --git a/sql/db_drops.sql b/sql/db_drops.sql index f9a34a638d..c843f2e88e 100644 --- a/sql/db_drops.sql +++ b/sql/db_drops.sql @@ -19026,7 +19026,16 @@ (5110300, 2383016, 1, 1, 0, 8000), (5110301, 2383028, 1, 1, 0, 8000), (8143000, 2386010, 1, 1, 0, 8000), -(2220000, 2388000, 1, 1, 0, 8000); +(2220000, 2388000, 1, 1, 0, 8000), +(9300045, 4001050, 1, 1, 0, 999999), +(9300046, 4001050, 1, 1, 0, 999999), +(9300047, 4001050, 1, 1, 0, 999999), +(9300041, 4001052, 1, 1, 0, 999999), +(9300042, 4001052, 1, 1, 0, 999999), +(9300043, 4001052, 1, 1, 0, 999999), +(9300040, 4001074, 1, 1, 0, 999999), +(9300048, 4001053, 1, 1, 0, 999999), +(9300049, 4001074, 1, 1, 0, 999999); # (dropperid, itemid, minqty, maxqty, questid, chance) @@ -19209,7 +19218,92 @@ (9102004, 4001097, 3, -1), (9102005, 4001098, 3, -1), (9102006, 4001099, 3, -1), - (9102007, 4001100, 3, -1); + (9102007, 4001100, 3, -1), + (2002017, 1302012, 25, -1), + (2002017, 1402015, 25, -1), + (2002017, 1312010, 25, -1), + (2002017, 1412032, 25, -1), + (2002017, 1322028, 25, -1), + (2002017, 1422010, 25, -1), + (2002017, 1452011, 25, -1), + (2002017, 1462009, 25, -1), + (2002017, 1472028, 25, -1), + (2002017, 1332018, 25, -1), + (2002017, 1432007, 25, -1), + (2002017, 1442008, 25, -1), + (2002017, 1372015, 25, -1), + (2002017, 1382008, 25, -1), + (2002017, 1482009, 25, -1), + (2002017, 1492010, 25, -1), + (2002017, 2001000, 5, -1), + (2002017, 2001001, 5, -1), + (2002017, 2001002, 5, -1), + (2002017, 2010005, 10, -1), + (2002017, 2020007, 10, -1), + (2002017, 2020009, 10, -1), + (2002017, 2020011, 15, -1), + (2002017, 2020012, 15, -1), + (2002017, 2020013, 15, -1), + (2002018, 4004004, 1, -1), + (2002018, 4004002, 1, -1), + (2002018, 4004003, 1, -1), + (2002018, 4004000, 1, -1), + (2002018, 4004001, 1, -1), + (2002018, 4005004, 5, -1), + (2002018, 4005002, 5, -1), + (2002018, 4005003, 5, -1), + (2002018, 4005000, 5, -1), + (2002018, 4005001, 5, -1), + (2002018, 2000006, 1, -1), + (2002018, 2000004, 2, -1), + (2002018, 2000005, 2, -1), + (2002018, 2020013, 5, -1), + (2002018, 2020014, 5, -1), + (2002018, 2020015, 5, -1), + (2002018, 1082096, 25, -1), + (2002018, 1082104, 25, -1), + (2002018, 1082107, 25, -1), + (2002018, 1082099, 25, -1), + (2002018, 1082098, 25, -1), + (2002018, 1082093, 25, -1), + (2002018, 1082204, 25, -1), + (2002014, 4004004, 1, -1), + (2002014, 4004002, 1, -1), + (2002014, 4004003, 1, -1), + (2002014, 4004000, 1, -1), + (2002014, 4004001, 1, -1), + (2002014, 4005004, 5, -1), + (2002014, 4005002, 5, -1), + (2002014, 4005003, 5, -1), + (2002014, 4005000, 5, -1), + (2002014, 4005001, 5, -1), + (2002014, 2000006, 1, -1), + (2002014, 2000004, 2, -1), + (2002014, 2000005, 2, -1), + (2002014, 2020013, 5, -1), + (2002014, 2020014, 5, -1), + (2002014, 2020015, 5, -1), + (2002014, 1082096, 25, -1), + (2002014, 1082104, 25, -1), + (2002014, 1082107, 25, -1), + (2002014, 1082099, 25, -1), + (2002014, 1082098, 25, -1), + (2002014, 1082093, 25, -1), + (2002014, 1082204, 25, -1), + (2001002, 4001045, 1, -1), + (2001003, 4001045, 1, -1), + (2001004, 4001045, 1, -1), + (2001005, 4001045, 1, -1), + (2001006, 4001045, 1, -1), + (2001007, 4001045, 1, -1), + (2001008, 4001045, 1, -1), + (2001009, 4001045, 1, -1), + (2001010, 4001045, 1, -1), + (2001011, 4001045, 1, -1), + (2001012, 4001045, 1, -1), + (2001013, 4001045, 1, -1), + (2001014, 4001045, 1, -1), + (2001015, 4001045, 1, -1); # updates info for all cards on monster book DROP TABLE `monstercarddata`; diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java index 5823177669..9770ef0b52 100644 --- a/src/client/MapleCharacter.java +++ b/src/client/MapleCharacter.java @@ -743,7 +743,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { this.loggedIn = true; c.setAccountName(this.client.getAccountName());//No null's for accountName this.client = c; - MaplePortal portal = map.findClosestSpawnpoint(getPosition()); + MaplePortal portal = map.findClosestPlayerSpawnpoint(getPosition()); if (portal == null) { portal = map.getPortal(0); } @@ -4814,7 +4814,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { if (map == null || map.getId() == 610020000 || map.getId() == 610020001) { ps.setInt(24, 0); } else { - MaplePortal closest = map.findClosestSpawnpoint(getPosition()); + MaplePortal closest = map.findClosestPlayerSpawnpoint(getPosition()); if (closest != null) { ps.setInt(24, closest.getId()); } else { diff --git a/src/client/command/Commands.java b/src/client/command/Commands.java index 437b9849a1..7109b60d25 100644 --- a/src/client/command/Commands.java +++ b/src/client/command/Commands.java @@ -72,6 +72,7 @@ import server.maps.MapleMap; import server.maps.MapleMapItem; import server.maps.MapleMapObject; import server.maps.MapleMapObjectType; +import server.maps.MapleReactor; import server.quest.MapleQuest; import tools.DatabaseConnection; import tools.FilePrinter; @@ -104,7 +105,10 @@ import constants.skills.Cleric; import constants.skills.Priest; import constants.skills.Spearman; import java.util.ArrayList; +import server.life.SpawnPoint; import server.maps.FieldLimit; +import server.movement.LifeMovementFragment; +import server.movement.TeleportMovement; public class Commands { private static HashMap gotomaps = new HashMap(); @@ -328,6 +332,10 @@ public class Commands { equip.setMdef(stat); equip.setHp(stat); equip.setMp(stat); + + byte flag = equip.getFlag(); + flag |= ItemConstants.UNTRADEABLE; + equip.setFlag(flag); } public static boolean executePlayerCommand(MapleClient c, String[] sub, char heading) { @@ -673,6 +681,22 @@ public class Commands { break; //debug only + case "debugnearestportal": + if(ServerConstants.USE_DEBUG) { + MaplePortal portal = player.getMap().findClosestPortal(player.getPosition()); + if(portal != null) player.dropMessage(6, "Closest portal: " + portal.getId() + " '" + portal.getName() + "' --> toMap: " + portal.getTargetMapId() + " scriptname: '" + portal.getScriptName() + "' state: " + portal.getPortalState() + "."); + else player.dropMessage(6, "There is no portal on this map."); + } + break; + + case "debugnearestspawnpoint": + if(ServerConstants.USE_DEBUG) { + SpawnPoint sp = player.getMap().findClosestSpawnpoint(player.getPosition()); + if(sp != null) player.dropMessage(6, "Closest spawn point: " + " Position: x " + sp.getPosition().getX() + " y " + sp.getPosition().getY() + " Spawns mobid: '" + ((sp.getMonster() != null) ? sp.getMonster().getId() : "null") + "' --> canSpawn: " + !sp.getDenySpawn() + " canSpawnRightNow: " + sp.shouldSpawn() + "."); + else player.dropMessage(6, "There is no mob spawn point on this map."); + } + break; + case "debugpos": if(ServerConstants.USE_DEBUG) { player.dropMessage(6, "Current map position: (" + player.getPosition().getX() + ", " + player.getPosition().getY() + ")."); @@ -681,7 +705,7 @@ public class Commands { case "debugmap": if(ServerConstants.USE_DEBUG) { - player.dropMessage(6, "Current map id " + player.getMap().getId() + ", event: '" + ((player.getMap().getEventInstance() != null) ? player.getMap().getEventInstance().getName() : "null") + "'; Players: " + player.getMap().getAllPlayers().size() + ", Mobs: " + player.getMap().countMonsters() + ", Reactors: " + player.getMap().countReactors() + "."); + player.dropMessage(6, "Current map id " + player.getMap().getId() + ", event: '" + ((player.getMap().getEventInstance() != null) ? player.getMap().getEventInstance().getName() : "null") + "'; Players: " + player.getMap().getAllPlayers().size() + ", Mobs: " + player.getMap().countMonsters() + ", Reactors: " + player.getMap().countReactors() + ", Items: " + player.getMap().countItems() + "."); } break; @@ -695,8 +719,10 @@ public class Commands { case "debugreactors": if(ServerConstants.USE_DEBUG) { player.dropMessage(6, "Current reactor states on map " + player.getMapId() + ":"); - for(Pair p: player.getMap().reportReactorStates()) { - player.dropMessage(6, "Reactor id: " + p.getLeft() + " -> State: " + p.getRight() + "."); + + for(MapleMapObject mmo: player.getMap().getReactors()) { + MapleReactor mr = (MapleReactor) mmo; + player.dropMessage(6, "Reactor id: " + mr.getId() + " name: '" + mr.getName() + "' -> Type: " + mr.getReactorType() + " State: " + mr.getState() + " Event State: " + mr.getEventState() + " Position: x " + mr.getPosition().getX() + " y " + mr.getPosition().getY() + "."); } } break; @@ -863,6 +889,11 @@ public class Commands { eu.setInt(incval); eu.setStr(incval); eu.setLuk(incval); + + byte flag = eu.getFlag(); + flag |= ItemConstants.UNTRADEABLE; + eu.setFlag(flag); + player.forceUpdateItem(eu); } catch(Exception e){ e.printStackTrace(); @@ -904,7 +935,7 @@ public class Commands { player.getMap().setMuted(true); player.dropMessage(5, "The map you are in has been muted."); } - } else if (sub[0].equals("checkdmg")) { + } else if (sub[0].equals("checkdmg")) { MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(sub[1]); int maxBase = victim.calculateMaxBaseDamage(victim.getTotalWatk()); Integer watkBuff = victim.getBuffedValue(MapleBuffStat.WATK); diff --git a/src/client/inventory/Equip.java b/src/client/inventory/Equip.java index 158e5d7e73..fdefc5f195 100644 --- a/src/client/inventory/Equip.java +++ b/src/client/inventory/Equip.java @@ -460,6 +460,10 @@ public class Equip extends Item { } private double normalizedMasteryExp(int reqLevel) { + // Trivia: at equips requiring level 200, one gaining MAX INTEGER exp points will have their equip + // exp gain normalized to roughly 5.752 points (1/3 of the needed to pass the equipment to lvl 2)! + // Good thing there is not much lvl 140+ equipments in the game! + return Math.max((2622.71 * Math.exp(reqLevel * 0.0733649)) - 6000.0, 15); } diff --git a/src/net/server/channel/handlers/AbstractMovementPacketHandler.java b/src/net/server/channel/handlers/AbstractMovementPacketHandler.java index 5b29855302..405bf21ece 100644 --- a/src/net/server/channel/handlers/AbstractMovementPacketHandler.java +++ b/src/net/server/channel/handlers/AbstractMovementPacketHandler.java @@ -66,10 +66,10 @@ public abstract class AbstractMovementPacketHandler extends AbstractMaplePacketH case 12: case 13: // Shot-jump-back thing case 16: // Float - case 18: - case 19: // Springs on maps + case 18: + case 19: // Springs on maps case 20: // Aran Combat Step - case 22: { + case 22: { short xpos = lea.readShort(); short ypos = lea.readShort(); byte newstate = lea.readByte(); @@ -83,7 +83,7 @@ public abstract class AbstractMovementPacketHandler extends AbstractMaplePacketH case 7: // assaulter case 8: // assassinate case 9: // rush - case 11: //chair + case 11: //chair { // case 14: { short xpos = lea.readShort(); @@ -138,7 +138,7 @@ public abstract class AbstractMovementPacketHandler extends AbstractMaplePacketH break; } default: - System.out.println("Unhandled Case:" + command); + System.out.println("Unhandled Case:" + command); return null; } } diff --git a/src/net/server/channel/handlers/GeneralChatHandler.java b/src/net/server/channel/handlers/GeneralChatHandler.java index 561c0de3bc..b0ee0923ec 100644 --- a/src/net/server/channel/handlers/GeneralChatHandler.java +++ b/src/net/server/channel/handlers/GeneralChatHandler.java @@ -61,7 +61,7 @@ public final class GeneralChatHandler extends net.AbstractMaplePacketHandler { } SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm"); - FilePrinter.print(FilePrinter.USED_COMMANDS + ".txt", c.getPlayer().getName() + " used: " + heading + command + "on " + sdf.format(Calendar.getInstance().getTime()) + "\r\n"); + FilePrinter.print(FilePrinter.USED_COMMANDS, c.getPlayer().getName() + " used: " + heading + command + "on " + sdf.format(Calendar.getInstance().getTime()) + "\r\n"); } } } else { diff --git a/src/net/server/channel/handlers/UseCashItemHandler.java b/src/net/server/channel/handlers/UseCashItemHandler.java index 87b2ce556a..4c250bc870 100644 --- a/src/net/server/channel/handlers/UseCashItemHandler.java +++ b/src/net/server/channel/handlers/UseCashItemHandler.java @@ -411,7 +411,7 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler { if (c.getChannelServer().getMapFactory().getMap(victim.getMapId()).getForcedReturnId() == 999999999 || victim.getMapId() < 100000000) { if (victim.gmLevel() <= player.gmLevel()) { if (itemId == 5041000 || victim.getMapId() / player.getMapId() == 1) { //viprock & same continent - player.changeMap(target, target.findClosestSpawnpoint(victim.getPosition())); + player.changeMap(target, target.findClosestPlayerSpawnpoint(victim.getPosition())); success = true; } else { player.dropMessage(1, "You cannot teleport between continents with this teleport rock."); diff --git a/src/scripting/AbstractPlayerInteraction.java b/src/scripting/AbstractPlayerInteraction.java index 8b662f81a8..268da7fbb6 100644 --- a/src/scripting/AbstractPlayerInteraction.java +++ b/src/scripting/AbstractPlayerInteraction.java @@ -88,9 +88,10 @@ public class AbstractPlayerInteraction { public MapleMap getMap() { return c.getPlayer().getMap(); } - - public void warp(int map) { - getPlayer().changeMap(map, 0); + + public void warp(int mapid) { + MapleMap map = getWarpMap(mapid); + getPlayer().changeMap(map, map.getRandomPlayerSpawnpoint()); } public void warp(int map, int portal) { diff --git a/src/scripting/event/EventInstanceManager.java b/src/scripting/event/EventInstanceManager.java index 6a074b0424..d59c5ede0b 100644 --- a/src/scripting/event/EventInstanceManager.java +++ b/src/scripting/event/EventInstanceManager.java @@ -43,12 +43,15 @@ import net.server.world.MaplePartyCharacter; import provider.MapleDataProviderFactory; import server.MaplePortal; import server.TimerManager; +import server.MapleStatEffect; import server.expeditions.MapleExpedition; import server.life.MapleMonster; import server.maps.MapleMap; import server.maps.MapleMapFactory; import tools.DatabaseConnection; import client.MapleCharacter; +import client.SkillFactory; +import client.Skill; import constants.ItemConstants; import constants.ServerConstants; import java.awt.Point; @@ -56,6 +59,7 @@ import java.util.concurrent.ScheduledFuture; import java.util.logging.Level; import java.util.logging.Logger; import scripting.AbstractPlayerInteraction; +import server.MapleItemInformationProvider; import server.life.MapleLifeFactory; import server.life.MapleNPC; import tools.MaplePacketCreator; @@ -113,6 +117,35 @@ public class EventInstanceManager { return em; } + public void applyEventPlayersItemBuff(int itemId) { + List players = getPlayerList(); + MapleStatEffect mse = MapleItemInformationProvider.getInstance().getItemEffect(itemId); + + if(mse != null) { + for (MapleCharacter player: players) { + mse.applyTo(player); + } + } + } + + public void applyEventPlayersSkillBuff(int skillId) { + applyEventPlayersSkillBuff(skillId, Integer.MAX_VALUE); + } + + public void applyEventPlayersSkillBuff(int skillId, int skillLv) { + List players = getPlayerList(); + Skill skill = SkillFactory.getSkill(skillId); + + if(skill != null) { + MapleStatEffect mse = skill.getEffect(Math.min(skillLv, skill.getMaxLevel())); + if(mse != null) { + for (MapleCharacter player: players) { + mse.applyTo(player); + } + } + } + } + public void giveEventPlayersExp(int gain) { giveEventPlayersExp(gain, -1); } @@ -193,6 +226,7 @@ public class EventInstanceManager { timeStarted = System.currentTimeMillis(); eventTime = time; + for(MapleCharacter chr: getPlayers()) chr.announce(MaplePacketCreator.getClock((int) (time / 1000))); event_schedule = TimerManager.getInstance().schedule(new Runnable() { public void run() { try { @@ -496,6 +530,14 @@ public class EventInstanceManager { return map; } + public void setIntProperty(String key, Integer value) { + setProperty(key, value); + } + + public void setProperty(String key, Integer value) { + setProperty(key, "" + value); + } + public void setProperty(String key, String value) { props.setProperty(key, value); } @@ -512,8 +554,12 @@ public class EventInstanceManager { return props; } - public int getIntProperty(String key) { - return Integer.parseInt(props.getProperty(key)); + public Integer getIntProperty(String key) { + try { + return Integer.parseInt(props.getProperty(key)); + } catch(Exception e) { + return null; + } } public void leftParty(MapleCharacter chr) { @@ -811,6 +857,23 @@ public class EventInstanceManager { } } + public final void warpEventTeamToMapSpawnPoint(int warpFrom, int warpTo, int toSp) { + List players = getPlayerList(); + + for (MapleCharacter chr : players) { + if(chr.getMapId() == warpFrom) + chr.changeMap(warpTo, toSp); + } + } + + public final void warpEventTeamToMapSpawnPoint(int warpTo, int toSp) { + List players = getPlayerList(); + + for (MapleCharacter chr : players) { + chr.changeMap(warpTo, toSp); + } + } + public final MapleCharacter getLeader() { rL.lock(); try { diff --git a/src/scripting/event/EventManager.java b/src/scripting/event/EventManager.java index 61d25bc41e..866d0c0fc8 100644 --- a/src/scripting/event/EventManager.java +++ b/src/scripting/event/EventManager.java @@ -272,6 +272,7 @@ public class EventManager { eim.registerExpedition(exped); exped.start(); + iv.invokeFunction("afterSetup", eim); } catch (ScriptException | NoSuchMethodException ex) { Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex); } @@ -303,6 +304,7 @@ public class EventManager { instanceLocks.put(eim.getName(), lobbyId); eim.registerPlayer(chr); + iv.invokeFunction("afterSetup", eim); } catch (ScriptException | NoSuchMethodException ex) { Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex); } @@ -335,6 +337,7 @@ public class EventManager { eim.registerParty(party, map); party.setEligibleMembers(null); + iv.invokeFunction("afterSetup", eim); } catch (ScriptException | NoSuchMethodException ex) { Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex); } @@ -367,6 +370,7 @@ public class EventManager { eim.registerParty(party, map); party.setEligibleMembers(null); + iv.invokeFunction("afterSetup", eim); } catch (ScriptException | NoSuchMethodException ex) { Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex); } @@ -398,6 +402,7 @@ public class EventManager { iv.invokeFunction("setup", eim); eim.setProperty("leader", leader); + iv.invokeFunction("afterSetup", eim); } catch (ScriptException | NoSuchMethodException ex) { Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/src/scripting/reactor/ReactorActionManager.java b/src/scripting/reactor/ReactorActionManager.java index ba0d5de672..a2735514ac 100644 --- a/src/scripting/reactor/ReactorActionManager.java +++ b/src/scripting/reactor/ReactorActionManager.java @@ -101,7 +101,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction { } else { drop = ii.randomizeStats((Equip) ii.getEquipById(d.itemId)); } - reactor.getMap().spawnItemDrop(reactor, getPlayer(), drop, reactor.getMap().calcDropPos(dropPos, reactor.getPosition()), false, false); + reactor.getMap().spawnItemDrop(reactor, getPlayer(), drop, reactor.getMap().calcDropPos(dropPos, reactor.getPosition()), (byte)(getPlayer().getParty() != null ? 1 : 0), false); } dropPos.x += 25; } @@ -127,7 +127,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction { spawnMonster(id, qty, new Point(x, y)); } - private void spawnMonster(int id, int qty, Point pos) { + public void spawnMonster(int id, int qty, Point pos) { for (int i = 0; i < qty; i++) { reactor.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(id), pos); } diff --git a/src/server/maps/MapleGenericPortal.java b/src/server/maps/MapleGenericPortal.java index eb5f0f9726..22b1b6714c 100644 --- a/src/server/maps/MapleGenericPortal.java +++ b/src/server/maps/MapleGenericPortal.java @@ -121,7 +121,7 @@ public class MapleGenericPortal implements MaplePortal { } else if (getTargetMapId() != 999999999) { MapleMap to = c.getPlayer().getEventInstance() == null ? c.getChannelServer().getMapFactory().getMap(getTargetMapId()) : c.getPlayer().getEventInstance().getMapInstance(getTargetMapId()); MaplePortal pto = to.getPortal(getTarget()); - if (pto == null) {// fallback for missing portals - no real life case anymore - intresting for not implemented areas + if (pto == null) {// fallback for missing portals - no real life case anymore - interesting for not implemented areas pto = to.getPortal(0); } c.getPlayer().changeMap(to, pto); //late resolving makes this harder but prevents us from loading the whole world at once diff --git a/src/server/maps/MapleMap.java b/src/server/maps/MapleMap.java index 87a6a981ae..e61fca0dc7 100644 --- a/src/server/maps/MapleMap.java +++ b/src/server/maps/MapleMap.java @@ -45,6 +45,7 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; +import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Random; @@ -530,16 +531,6 @@ public class MapleMap { return count; } - public List reportReactorStates() { - List list = new LinkedList<>(); - - for (MapleMapObject m : getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.REACTOR))) { - MapleReactor mr = (MapleReactor) m; - list.add(new Pair(mr.getId(), mr.getState())); - } - return list; - } - public int countMonsters() { return getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER)).size(); } @@ -551,6 +542,14 @@ public class MapleMap { public final List getReactors() { return getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.REACTOR)); } + + public int countItems() { + return getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM)).size(); + } + + public final List getItems() { + return getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM)); + } public boolean damageMonster(final MapleCharacter chr, final MapleMonster monster, final int damage) { if (monster.getId() == 8800000) { @@ -886,22 +885,6 @@ public class MapleMap { } } - public MapleReactor getReactorById(int Id) { - objectRLock.lock(); - try { - for (MapleMapObject obj : mapobjects.values()) { - if (obj.getType() == MapleMapObjectType.REACTOR) { - if (((MapleReactor) obj).getId() == Id) { - return (MapleReactor) obj; - } - } - } - return null; - } finally { - objectRLock.unlock(); - } - } - /** * Automagically finds a new controller for the given monster from the chars * on the map... @@ -1002,6 +985,22 @@ public class MapleMap { MapleMapObject mmo = getMapObject(oid); return (mmo != null && mmo.getType() == MapleMapObjectType.REACTOR) ? (MapleReactor) mmo : null; } + + public MapleReactor getReactorById(int Id) { + objectRLock.lock(); + try { + for (MapleMapObject obj : mapobjects.values()) { + if (obj.getType() == MapleMapObjectType.REACTOR) { + if (((MapleReactor) obj).getId() == Id) { + return (MapleReactor) obj; + } + } + } + return null; + } finally { + objectRLock.unlock(); + } + } public MapleReactor getReactorByName(String name) { objectRLock.lock(); @@ -1327,10 +1326,14 @@ public class MapleMap { } }, duration); } - + public final void spawnItemDrop(final MapleMapObject dropper, final MapleCharacter owner, final Item item, Point pos, final boolean ffaDrop, final boolean playerDrop) { + spawnItemDrop(dropper, owner, item, pos, (byte)(ffaDrop ? 2 : 0), playerDrop); + } + + public final void spawnItemDrop(final MapleMapObject dropper, final MapleCharacter owner, final Item item, Point pos, final byte dropType, final boolean playerDrop) { final Point droppos = calcDropPos(pos, pos); - final MapleMapItem drop = new MapleMapItem(item, droppos, dropper, owner, (byte) (ffaDrop ? 2 : 0), playerDrop); + final MapleMapItem drop = new MapleMapItem(item, droppos, dropper, owner, dropType, playerDrop); drop.setDropTime(System.currentTimeMillis()); spawnAndAddRangedMapObject(drop, new DelayedPacketCreation() { @@ -1396,7 +1399,7 @@ public class MapleMap { final MapleReactor react = (MapleReactor) o; if (react.getReactorType() == 100) { - if (react.getReactItem((byte) 0).getLeft() == item.getItemId() && react.getReactItem((byte) 0).getRight() == item.getQuantity()) { + if (react.getReactItem(react.getEventState()).getLeft() == item.getItemId() && react.getReactItem(react.getEventState()).getRight() == item.getQuantity()) { if (react.getArea().contains(drop.getPosition())) { TimerManager.getInstance().schedule(new ActivateItemReactor(drop, react, c), 5000); @@ -1634,6 +1637,30 @@ public class MapleMap { chr.receivePartyMemberHP(); } + public MaplePortal getRandomPlayerSpawnpoint() { + List spawnPoints = new ArrayList<>(); + for (MaplePortal portal : portals.values()) { + if (portal.getType() >= 0 && portal.getType() <= 2) { + spawnPoints.add(portal); + } + } + MaplePortal portal = spawnPoints.get(new Random().nextInt(spawnPoints.size())); + return portal != null ? portal : getPortal(0); + } + + public MaplePortal findClosestPlayerSpawnpoint(Point from) { + MaplePortal closest = null; + double shortestDistance = Double.POSITIVE_INFINITY; + for (MaplePortal portal : portals.values()) { + double distance = portal.getPosition().distanceSq(from); + if (portal.getType() >= 0 && portal.getType() <= 2 && distance < shortestDistance && portal.getTargetMapId() == 999999999) { + closest = portal; + shortestDistance = distance; + } + } + return closest; + } + public MaplePortal findClosestPortal(Point from) { MaplePortal closest = null; double shortestDistance = Double.POSITIVE_INFINITY; @@ -1647,15 +1674,8 @@ public class MapleMap { return closest; } - public MaplePortal getRandomSpawnpoint() { - List spawnPoints = new ArrayList<>(); - for (MaplePortal portal : portals.values()) { - if (portal.getType() >= 0 && portal.getType() <= 2) { - spawnPoints.add(portal); - } - } - MaplePortal portal = spawnPoints.get(new Random().nextInt(spawnPoints.size())); - return portal != null ? portal : getPortal(0); + public Collection getPortals() { + return Collections.unmodifiableCollection(portals.values()); } public void removePlayer(MapleCharacter chr) { @@ -2003,23 +2023,6 @@ public class MapleMap { } } - public MaplePortal findClosestSpawnpoint(Point from) { - MaplePortal closest = null; - double shortestDistance = Double.POSITIVE_INFINITY; - for (MaplePortal portal : portals.values()) { - double distance = portal.getPosition().distanceSq(from); - if (portal.getType() >= 0 && portal.getType() <= 2 && distance < shortestDistance && portal.getTargetMapId() == 999999999) { - closest = portal; - shortestDistance = distance; - } - } - return closest; - } - - public Collection getPortals() { - return Collections.unmodifiableCollection(portals.values()); - } - public String getMapName() { return mapName; } @@ -2244,6 +2247,19 @@ public class MapleMap { } } } + + public SpawnPoint findClosestSpawnpoint(Point from) { + SpawnPoint closest = null; + double shortestDistance = Double.POSITIVE_INFINITY; + for (SpawnPoint sp : monsterSpawn) { + double distance = sp.getPosition().distanceSq(from); + if (distance < shortestDistance) { + closest = sp; + shortestDistance = distance; + } + } + return closest; + } public void respawn() { if(!allowSummons) return; @@ -2284,6 +2300,38 @@ public class MapleMap { } } } + + public final int getNumPlayersInArea(final int index) { + return getNumPlayersInRect(getArea(index)); + } + + public final int getNumPlayersInRect(final Rectangle rect) { + int ret = 0; + + chrRLock.lock(); + try { + final Iterator ltr = characters.iterator(); + while (ltr.hasNext()) { + if (rect.contains(ltr.next().getPosition())) { + ret++; + } + } + } finally { + chrRLock.unlock(); + } + return ret; + } + + public final int getNumPlayersItemsInArea(final int index) { + return getNumPlayersItemsInRect(getArea(index)); + } + + public final int getNumPlayersItemsInRect(final Rectangle rect) { + int retP = getNumPlayersInRect(rect); + int retI = getMapObjectsInBox(rect, Arrays.asList(MapleMapObjectType.ITEM)).size(); + + return retP + retI; + } private static interface DelayedPacketCreation { diff --git a/src/server/maps/MapleReactor.java b/src/server/maps/MapleReactor.java index 72cf9e8fd9..faad95f1d2 100644 --- a/src/server/maps/MapleReactor.java +++ b/src/server/maps/MapleReactor.java @@ -43,6 +43,7 @@ public class MapleReactor extends AbstractMapleMapObject { private int rid; private MapleReactorStats stats; private byte state; + private byte evstate; private int delay; private MapleMap map; private String name; @@ -51,6 +52,7 @@ public class MapleReactor extends AbstractMapleMapObject { private Lock reactorLock = new ReentrantLock(true); public MapleReactor(MapleReactorStats stats, int rid) { + this.evstate = (byte)0; this.stats = stats; this.rid = rid; alive = true; @@ -75,11 +77,19 @@ public class MapleReactor extends AbstractMapleMapObject { public void setState(byte state) { this.state = state; } - + public byte getState() { return state; } + public void setEventState(byte substate) { + this.evstate = substate; + } + + public byte getEventState() { + return evstate; + } + public MapleReactorStats getStats() { return stats; } diff --git a/wz/Map.wz/Map/Map9/920010900.img.xml b/wz/Map.wz/Map/Map9/920010900.img.xml index e915fc5c2f..53ec1dc29b 100644 --- a/wz/Map.wz/Map/Map9/920010900.img.xml +++ b/wz/Map.wz/Map/Map9/920010900.img.xml @@ -3077,7 +3077,7 @@ - + diff --git a/wz/Reactor.wz/2006000.img.xml b/wz/Reactor.wz/2006000.img.xml index 4fe7e7adbc..00b3a83a4e 100644 --- a/wz/Reactor.wz/2006000.img.xml +++ b/wz/Reactor.wz/2006000.img.xml @@ -52,6 +52,16 @@ + + + + + + + + + + diff --git a/wz/Reactor.wz/2006001.img.xml b/wz/Reactor.wz/2006001.img.xml index 8102b86f86..9352cb632f 100644 --- a/wz/Reactor.wz/2006001.img.xml +++ b/wz/Reactor.wz/2006001.img.xml @@ -3,42 +3,20 @@ + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -46,19 +24,9 @@ - - - - - - + + - - - - - -