diff --git a/MobBookUpdate/build/built-jar.properties b/MobBookUpdate/build/built-jar.properties
deleted file mode 100644
index 4ef345a406..0000000000
--- a/MobBookUpdate/build/built-jar.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-#Tue, 30 May 2017 23:02:51 -0300
-
-
-C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2\\MobBookUpdate=
diff --git a/MonsterDropCreator.bat b/MonsterDropCreator.bat
deleted file mode 100644
index 691fe58c74..0000000000
--- a/MonsterDropCreator.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-set CLASSPATH=.;dist\*;
-java -Dwzpath=wz\ tools.MonsterDropCreator false
-pause
\ No newline at end of file
diff --git a/README_wzchanges.txt b/README_wzchanges.txt
index 3bfc2a84c8..c7e809e0b0 100644
--- a/README_wzchanges.txt
+++ b/README_wzchanges.txt
@@ -8,15 +8,15 @@ Map.wz/MapX/*:
Item.wz/*:
Fixed lacking "slotMax" properties in some items.
- Set flag "Quest Item" for Springy Worm.
+ Set flag "Quest Item" for some items.
Quest.wz/*:
Fixed a bunch of quests, now giving the proper output. Added new quests.
String.wz/*:
Fixed some NPC speeches.
- Updated MonsterBook with current drop data on the sql's DB, using
-Ronan Lana's MobBookUpdate facility.
+ Updated MonsterBook with current drop data on the sql's DB, using Ronan's
+MobBookUpdate facility.
P.S.:
diff --git a/build/built-jar.properties b/build/built-jar.properties
index ebf4d7f97a..012cb85e32 100644
--- a/build/built-jar.properties
+++ b/build/built-jar.properties
@@ -1,4 +1,4 @@
-#Mon, 17 Jul 2017 14:21:39 -0300
+#Thu, 03 Aug 2017 23:09:50 -0300
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
diff --git a/build/classes/client/MapleBuffStat.class b/build/classes/client/MapleBuffStat.class
index 9b51cfe62c..ccdd55b24b 100644
Binary files a/build/classes/client/MapleBuffStat.class and b/build/classes/client/MapleBuffStat.class differ
diff --git a/build/classes/client/MapleCharacter$1.class b/build/classes/client/MapleCharacter$1.class
index 0505eb84cf..b5b2426667 100644
Binary files a/build/classes/client/MapleCharacter$1.class and b/build/classes/client/MapleCharacter$1.class differ
diff --git a/build/classes/client/MapleCharacter$10.class b/build/classes/client/MapleCharacter$10.class
index 10d9dcaa08..6c2a085eba 100644
Binary files a/build/classes/client/MapleCharacter$10.class and b/build/classes/client/MapleCharacter$10.class differ
diff --git a/build/classes/client/MapleCharacter$11.class b/build/classes/client/MapleCharacter$11.class
index af4aa3a79e..af607a7c46 100644
Binary files a/build/classes/client/MapleCharacter$11.class and b/build/classes/client/MapleCharacter$11.class differ
diff --git a/build/classes/client/MapleCharacter$12.class b/build/classes/client/MapleCharacter$12.class
index 8b58c1dc5a..c313f32d5a 100644
Binary files a/build/classes/client/MapleCharacter$12.class and b/build/classes/client/MapleCharacter$12.class differ
diff --git a/build/classes/client/MapleCharacter$13.class b/build/classes/client/MapleCharacter$13.class
index cf93b81839..975a14b350 100644
Binary files a/build/classes/client/MapleCharacter$13.class and b/build/classes/client/MapleCharacter$13.class differ
diff --git a/build/classes/client/MapleCharacter$14.class b/build/classes/client/MapleCharacter$14.class
index 10397fa014..d6561bafa6 100644
Binary files a/build/classes/client/MapleCharacter$14.class and b/build/classes/client/MapleCharacter$14.class differ
diff --git a/build/classes/client/MapleCharacter$15.class b/build/classes/client/MapleCharacter$15.class
index f4f5ff2226..efa4c97a5b 100644
Binary files a/build/classes/client/MapleCharacter$15.class and b/build/classes/client/MapleCharacter$15.class differ
diff --git a/build/classes/client/MapleCharacter$16.class b/build/classes/client/MapleCharacter$16.class
index 0209201d5c..ac068a98d2 100644
Binary files a/build/classes/client/MapleCharacter$16.class and b/build/classes/client/MapleCharacter$16.class differ
diff --git a/build/classes/client/MapleCharacter$17.class b/build/classes/client/MapleCharacter$17.class
index b6567ae405..c4eef43afe 100644
Binary files a/build/classes/client/MapleCharacter$17.class and b/build/classes/client/MapleCharacter$17.class differ
diff --git a/build/classes/client/MapleCharacter$18.class b/build/classes/client/MapleCharacter$18.class
index 7a42d4725b..846e797ca0 100644
Binary files a/build/classes/client/MapleCharacter$18.class and b/build/classes/client/MapleCharacter$18.class differ
diff --git a/build/classes/client/MapleCharacter$19.class b/build/classes/client/MapleCharacter$19.class
index d0806ddda6..196ca5c309 100644
Binary files a/build/classes/client/MapleCharacter$19.class and b/build/classes/client/MapleCharacter$19.class differ
diff --git a/build/classes/client/MapleCharacter$2.class b/build/classes/client/MapleCharacter$2.class
index db810ee408..c3e3c2bf03 100644
Binary files a/build/classes/client/MapleCharacter$2.class and b/build/classes/client/MapleCharacter$2.class differ
diff --git a/build/classes/client/MapleCharacter$20.class b/build/classes/client/MapleCharacter$20.class
new file mode 100644
index 0000000000..56589a900b
Binary files /dev/null and b/build/classes/client/MapleCharacter$20.class differ
diff --git a/build/classes/client/MapleCharacter$3.class b/build/classes/client/MapleCharacter$3.class
index 9600770849..d96db286d5 100644
Binary files a/build/classes/client/MapleCharacter$3.class and b/build/classes/client/MapleCharacter$3.class differ
diff --git a/build/classes/client/MapleCharacter$4.class b/build/classes/client/MapleCharacter$4.class
index c2887c186a..aaf7128a21 100644
Binary files a/build/classes/client/MapleCharacter$4.class and b/build/classes/client/MapleCharacter$4.class differ
diff --git a/build/classes/client/MapleCharacter$5.class b/build/classes/client/MapleCharacter$5.class
index 6f0f062a6e..777e117413 100644
Binary files a/build/classes/client/MapleCharacter$5.class and b/build/classes/client/MapleCharacter$5.class differ
diff --git a/build/classes/client/MapleCharacter$6.class b/build/classes/client/MapleCharacter$6.class
index d93fafaeba..acb0834439 100644
Binary files a/build/classes/client/MapleCharacter$6.class and b/build/classes/client/MapleCharacter$6.class differ
diff --git a/build/classes/client/MapleCharacter$7.class b/build/classes/client/MapleCharacter$7.class
index ad52d7a26c..4f72d84731 100644
Binary files a/build/classes/client/MapleCharacter$7.class and b/build/classes/client/MapleCharacter$7.class differ
diff --git a/build/classes/client/MapleCharacter$8.class b/build/classes/client/MapleCharacter$8.class
index f9c44ddd8f..43ab177661 100644
Binary files a/build/classes/client/MapleCharacter$8.class and b/build/classes/client/MapleCharacter$8.class differ
diff --git a/build/classes/client/MapleCharacter$9.class b/build/classes/client/MapleCharacter$9.class
index ac54f970b6..5719399944 100644
Binary files a/build/classes/client/MapleCharacter$9.class and b/build/classes/client/MapleCharacter$9.class differ
diff --git a/build/classes/client/MapleCharacter$CancelCooldownAction.class b/build/classes/client/MapleCharacter$CancelCooldownAction.class
index 42d625d2bd..b924e7599a 100644
Binary files a/build/classes/client/MapleCharacter$CancelCooldownAction.class and b/build/classes/client/MapleCharacter$CancelCooldownAction.class differ
diff --git a/build/classes/client/MapleCharacter$FameStatus.class b/build/classes/client/MapleCharacter$FameStatus.class
index 053bbb8a6c..612db1ebef 100644
Binary files a/build/classes/client/MapleCharacter$FameStatus.class and b/build/classes/client/MapleCharacter$FameStatus.class differ
diff --git a/build/classes/client/MapleCharacter$MapleBuffStatValueHolder.class b/build/classes/client/MapleCharacter$MapleBuffStatValueHolder.class
index 57823446a1..7035a5065d 100644
Binary files a/build/classes/client/MapleCharacter$MapleBuffStatValueHolder.class and b/build/classes/client/MapleCharacter$MapleBuffStatValueHolder.class differ
diff --git a/build/classes/client/MapleCharacter$MapleCoolDownValueHolder.class b/build/classes/client/MapleCharacter$MapleCoolDownValueHolder.class
index fad21f871d..66022be946 100644
Binary files a/build/classes/client/MapleCharacter$MapleCoolDownValueHolder.class and b/build/classes/client/MapleCharacter$MapleCoolDownValueHolder.class differ
diff --git a/build/classes/client/MapleCharacter$SkillEntry.class b/build/classes/client/MapleCharacter$SkillEntry.class
index 26db7907ce..8f63655b39 100644
Binary files a/build/classes/client/MapleCharacter$SkillEntry.class and b/build/classes/client/MapleCharacter$SkillEntry.class differ
diff --git a/build/classes/client/MapleCharacter.class b/build/classes/client/MapleCharacter.class
index cc1fdb292c..358e0f1564 100644
Binary files a/build/classes/client/MapleCharacter.class and b/build/classes/client/MapleCharacter.class differ
diff --git a/build/classes/client/MapleClient$1.class b/build/classes/client/MapleClient$1.class
index 7bb4ae622f..77502c8a71 100644
Binary files a/build/classes/client/MapleClient$1.class and b/build/classes/client/MapleClient$1.class differ
diff --git a/build/classes/client/MapleClient$CharNameAndId.class b/build/classes/client/MapleClient$CharNameAndId.class
index f62a072de8..6de564b57e 100644
Binary files a/build/classes/client/MapleClient$CharNameAndId.class and b/build/classes/client/MapleClient$CharNameAndId.class differ
diff --git a/build/classes/client/MapleClient.class b/build/classes/client/MapleClient.class
index cc4511e13d..c8daf85dc9 100644
Binary files a/build/classes/client/MapleClient.class and b/build/classes/client/MapleClient.class differ
diff --git a/build/classes/client/MapleDiseaseValueHolder.class b/build/classes/client/MapleDiseaseValueHolder.class
new file mode 100644
index 0000000000..1ddc7736e9
Binary files /dev/null and b/build/classes/client/MapleDiseaseValueHolder.class differ
diff --git a/build/classes/client/command/Commands$1.class b/build/classes/client/command/Commands$1.class
index 223ef8043b..cff43e3f86 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 67ce8b4a53..8af227dc25 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/MapleInventory.class b/build/classes/client/inventory/MapleInventory.class
index a1ed69522f..2d17a7e761 100644
Binary files a/build/classes/client/inventory/MapleInventory.class and b/build/classes/client/inventory/MapleInventory.class differ
diff --git a/build/classes/constants/ItemConstants.class b/build/classes/constants/ItemConstants.class
index 396a35dbeb..aa29dccc02 100644
Binary files a/build/classes/constants/ItemConstants.class and b/build/classes/constants/ItemConstants.class differ
diff --git a/build/classes/constants/ServerConstants.class b/build/classes/constants/ServerConstants.class
index b64defcd09..d0277361a1 100644
Binary files a/build/classes/constants/ServerConstants.class and b/build/classes/constants/ServerConstants.class differ
diff --git a/build/classes/net/server/channel/Channel$1.class b/build/classes/net/server/channel/Channel$1.class
new file mode 100644
index 0000000000..e18e610468
Binary files /dev/null and b/build/classes/net/server/channel/Channel$1.class differ
diff --git a/build/classes/net/server/channel/Channel$respawnMaps.class b/build/classes/net/server/channel/Channel$respawnMaps.class
index 314120eea4..90801e77f6 100644
Binary files a/build/classes/net/server/channel/Channel$respawnMaps.class and b/build/classes/net/server/channel/Channel$respawnMaps.class differ
diff --git a/build/classes/net/server/channel/Channel.class b/build/classes/net/server/channel/Channel.class
index 8870918038..254dbd39c9 100644
Binary files a/build/classes/net/server/channel/Channel.class and b/build/classes/net/server/channel/Channel.class differ
diff --git a/build/classes/net/server/channel/handlers/CancelChairHandler.class b/build/classes/net/server/channel/handlers/CancelChairHandler.class
index 9efdfbe404..e85c140d19 100644
Binary files a/build/classes/net/server/channel/handlers/CancelChairHandler.class and b/build/classes/net/server/channel/handlers/CancelChairHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/CashOperationHandler.class b/build/classes/net/server/channel/handlers/CashOperationHandler.class
index e451e18cdb..d1869aab1e 100644
Binary files a/build/classes/net/server/channel/handlers/CashOperationHandler.class and b/build/classes/net/server/channel/handlers/CashOperationHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/DoorHandler.class b/build/classes/net/server/channel/handlers/DoorHandler.class
index 88377230ce..8797672530 100644
Binary files a/build/classes/net/server/channel/handlers/DoorHandler.class and b/build/classes/net/server/channel/handlers/DoorHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/EnterMTSHandler.class b/build/classes/net/server/channel/handlers/EnterMTSHandler.class
index 8ae0c1cd15..30e714b28f 100644
Binary files a/build/classes/net/server/channel/handlers/EnterMTSHandler.class and b/build/classes/net/server/channel/handlers/EnterMTSHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/GeneralChatHandler.class b/build/classes/net/server/channel/handlers/GeneralChatHandler.class
index cb1d23ad90..7742d4f433 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/NPCTalkHandler.class b/build/classes/net/server/channel/handlers/NPCTalkHandler.class
index 7bb6f0aecf..297eee9ff9 100644
Binary files a/build/classes/net/server/channel/handlers/NPCTalkHandler.class and b/build/classes/net/server/channel/handlers/NPCTalkHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/SpecialMoveHandler.class b/build/classes/net/server/channel/handlers/SpecialMoveHandler.class
index 51d169d7f0..d7818b89cf 100644
Binary files a/build/classes/net/server/channel/handlers/SpecialMoveHandler.class and b/build/classes/net/server/channel/handlers/SpecialMoveHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/StorageHandler.class b/build/classes/net/server/channel/handlers/StorageHandler.class
index f2c95a8c77..9cad407088 100644
Binary files a/build/classes/net/server/channel/handlers/StorageHandler.class and b/build/classes/net/server/channel/handlers/StorageHandler.class differ
diff --git a/build/classes/net/server/channel/handlers/WhisperHandler.class b/build/classes/net/server/channel/handlers/WhisperHandler.class
index 2ca3e31d59..d2a582538e 100644
Binary files a/build/classes/net/server/channel/handlers/WhisperHandler.class and b/build/classes/net/server/channel/handlers/WhisperHandler.class differ
diff --git a/build/classes/net/server/world/MapleParty$1.class b/build/classes/net/server/world/MapleParty$1.class
new file mode 100644
index 0000000000..6a20d80984
Binary files /dev/null and b/build/classes/net/server/world/MapleParty$1.class differ
diff --git a/build/classes/net/server/world/MapleParty.class b/build/classes/net/server/world/MapleParty.class
index 878b354cb1..91de42acd5 100644
Binary files a/build/classes/net/server/world/MapleParty.class and b/build/classes/net/server/world/MapleParty.class differ
diff --git a/build/classes/scripting/AbstractPlayerInteraction.class b/build/classes/scripting/AbstractPlayerInteraction.class
index 256e7256f2..26fa34cd0b 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 bb957a29f1..1e39f0b70e 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 675d4a4b39..56fdf62635 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 5fa44e05bb..1517f53831 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 eb26cb6ef3..bfd16fa15a 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$1.class b/build/classes/scripting/event/EventManager$1.class
index f3690101a1..c7591f8263 100644
Binary files a/build/classes/scripting/event/EventManager$1.class and b/build/classes/scripting/event/EventManager$1.class differ
diff --git a/build/classes/scripting/event/EventManager$2.class b/build/classes/scripting/event/EventManager$2.class
index 3b6b461520..5586d9ff9a 100644
Binary files a/build/classes/scripting/event/EventManager$2.class and b/build/classes/scripting/event/EventManager$2.class differ
diff --git a/build/classes/scripting/event/EventManager$3.class b/build/classes/scripting/event/EventManager$3.class
index 14f26f70b6..b28630116a 100644
Binary files a/build/classes/scripting/event/EventManager$3.class and b/build/classes/scripting/event/EventManager$3.class differ
diff --git a/build/classes/scripting/event/EventManager$EventManagerWorker.class b/build/classes/scripting/event/EventManager$EventManagerWorker.class
new file mode 100644
index 0000000000..cd1c215d76
Binary files /dev/null and b/build/classes/scripting/event/EventManager$EventManagerWorker.class differ
diff --git a/build/classes/scripting/event/EventManager.class b/build/classes/scripting/event/EventManager.class
index d2beece16d..9a8a6c3938 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/npc/NPCConversationManager.class b/build/classes/scripting/npc/NPCConversationManager.class
index 28ef56950d..1c479857e2 100644
Binary files a/build/classes/scripting/npc/NPCConversationManager.class and b/build/classes/scripting/npc/NPCConversationManager.class differ
diff --git a/build/classes/scripting/reactor/ReactorActionManager$1.class b/build/classes/scripting/reactor/ReactorActionManager$1.class
index 7739b1e96f..d91aebff3f 100644
Binary files a/build/classes/scripting/reactor/ReactorActionManager$1.class and b/build/classes/scripting/reactor/ReactorActionManager$1.class differ
diff --git a/build/classes/scripting/reactor/ReactorActionManager$2.class b/build/classes/scripting/reactor/ReactorActionManager$2.class
index 387dafe4c0..8b8825b906 100644
Binary files a/build/classes/scripting/reactor/ReactorActionManager$2.class and b/build/classes/scripting/reactor/ReactorActionManager$2.class differ
diff --git a/build/classes/scripting/reactor/ReactorActionManager.class b/build/classes/scripting/reactor/ReactorActionManager.class
index df4fddabe3..cde02d0c19 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/MapleInventoryManipulator.class b/build/classes/server/MapleInventoryManipulator.class
index 384e991589..6243beaab3 100644
Binary files a/build/classes/server/MapleInventoryManipulator.class and b/build/classes/server/MapleInventoryManipulator.class differ
diff --git a/build/classes/server/MapleStatEffect$CancelEffectAction.class b/build/classes/server/MapleStatEffect$CancelEffectAction.class
index c7109f522e..210ab0012c 100644
Binary files a/build/classes/server/MapleStatEffect$CancelEffectAction.class and b/build/classes/server/MapleStatEffect$CancelEffectAction.class differ
diff --git a/build/classes/server/MapleStatEffect.class b/build/classes/server/MapleStatEffect.class
index 2b6e64f4d3..a61eea1b9e 100644
Binary files a/build/classes/server/MapleStatEffect.class and b/build/classes/server/MapleStatEffect.class differ
diff --git a/build/classes/server/MapleTrade.class b/build/classes/server/MapleTrade.class
index f1ca3fb5a1..87c6ef45f8 100644
Binary files a/build/classes/server/MapleTrade.class and b/build/classes/server/MapleTrade.class differ
diff --git a/build/classes/server/events/gm/MapleOxQuiz.class b/build/classes/server/events/gm/MapleOxQuiz.class
index 0dbee82509..4538c8bb70 100644
Binary files a/build/classes/server/events/gm/MapleOxQuiz.class and b/build/classes/server/events/gm/MapleOxQuiz.class differ
diff --git a/build/classes/server/expeditions/MapleExpedition$1.class b/build/classes/server/expeditions/MapleExpedition$1.class
index 7764991837..ac43df8126 100644
Binary files a/build/classes/server/expeditions/MapleExpedition$1.class and b/build/classes/server/expeditions/MapleExpedition$1.class differ
diff --git a/build/classes/server/expeditions/MapleExpedition.class b/build/classes/server/expeditions/MapleExpedition.class
index 2cb4ca5e37..d68d882bce 100644
Binary files a/build/classes/server/expeditions/MapleExpedition.class and b/build/classes/server/expeditions/MapleExpedition.class differ
diff --git a/build/classes/server/expeditions/MapleExpeditionType.class b/build/classes/server/expeditions/MapleExpeditionType.class
index ea4bf85e74..b12e901f3f 100644
Binary files a/build/classes/server/expeditions/MapleExpeditionType.class and b/build/classes/server/expeditions/MapleExpeditionType.class differ
diff --git a/build/classes/server/life/MapleMonster$1.class b/build/classes/server/life/MapleMonster$1.class
index dde1cb8422..5eba265f2e 100644
Binary files a/build/classes/server/life/MapleMonster$1.class and b/build/classes/server/life/MapleMonster$1.class differ
diff --git a/build/classes/server/life/MapleMonster$2.class b/build/classes/server/life/MapleMonster$2.class
index 375c34b4d8..618f519d78 100644
Binary files a/build/classes/server/life/MapleMonster$2.class and b/build/classes/server/life/MapleMonster$2.class differ
diff --git a/build/classes/server/life/MapleMonster$3.class b/build/classes/server/life/MapleMonster$3.class
index 9073f15ffc..788cc59f21 100644
Binary files a/build/classes/server/life/MapleMonster$3.class and b/build/classes/server/life/MapleMonster$3.class differ
diff --git a/build/classes/server/life/MapleMonster$4.class b/build/classes/server/life/MapleMonster$4.class
index 75c442b914..23fc9f55d1 100644
Binary files a/build/classes/server/life/MapleMonster$4.class and b/build/classes/server/life/MapleMonster$4.class differ
diff --git a/build/classes/server/life/MapleMonster$5.class b/build/classes/server/life/MapleMonster$5.class
index e18feb1c74..b6a2002be1 100644
Binary files a/build/classes/server/life/MapleMonster$5.class and b/build/classes/server/life/MapleMonster$5.class differ
diff --git a/build/classes/server/life/MapleMonster$6.class b/build/classes/server/life/MapleMonster$6.class
index a23534add4..f688c2755a 100644
Binary files a/build/classes/server/life/MapleMonster$6.class and b/build/classes/server/life/MapleMonster$6.class differ
diff --git a/build/classes/server/life/MapleMonster$DamageTask.class b/build/classes/server/life/MapleMonster$DamageTask.class
index 123400de1a..eb348b26c3 100644
Binary files a/build/classes/server/life/MapleMonster$DamageTask.class and b/build/classes/server/life/MapleMonster$DamageTask.class differ
diff --git a/build/classes/server/life/MapleMonster.class b/build/classes/server/life/MapleMonster.class
index d40737f96f..7b68b19c7a 100644
Binary files a/build/classes/server/life/MapleMonster.class and b/build/classes/server/life/MapleMonster.class differ
diff --git a/build/classes/server/maps/MapleDoor.class b/build/classes/server/maps/MapleDoor.class
index 9090f95fcd..c884928094 100644
Binary files a/build/classes/server/maps/MapleDoor.class and b/build/classes/server/maps/MapleDoor.class differ
diff --git a/build/classes/server/maps/MapleDoorObject.class b/build/classes/server/maps/MapleDoorObject.class
index fe32842745..4f91573cfb 100644
Binary files a/build/classes/server/maps/MapleDoorObject.class and b/build/classes/server/maps/MapleDoorObject.class differ
diff --git a/build/classes/server/maps/MapleMap$1.class b/build/classes/server/maps/MapleMap$1.class
index 900e2fdeb7..8897dab3a6 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 720ff0b49a..aaaf948484 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 95dee7959d..3a5a79f04f 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 53948d06d3..13c0392d25 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 8e8fba0361..865db71b2c 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 0cab912c92..7358ab1aab 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 23853cdcc1..d2e720f800 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 55f94acfc3..c6aaaf83f8 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 9f806727af..cf83f27c84 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 34f579c6ba..563fda4ecd 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 703521d58c..23afc5f1f2 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 5cd2385e60..cba9f21143 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 63687ca308..2cc51da1d4 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 c8e6dc0623..d781a1a22f 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 8f54b9cee0..109ce04921 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 a4e35be459..4757210001 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 7e6c9caea7..506c881cf8 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 eb3d7e3758..f412de4a0c 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 63a6802ab2..507fe89538 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 f7f3ecc1a2..49cc508eaa 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 b0d0ef5fca..227b5892ca 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 97c7fe0040..afab86635b 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 b503864958..e9dd9d30ec 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 8eb6a1abe5..d33ddf0d7e 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 c82dc5f68d..4fb84fb9e9 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 73a98bbe73..486d71a222 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 25c47a8cbb..8f50a93546 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 ef080846e5..e8d472bbb2 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 dd2696dcf2..f6e5018df0 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 c3ec8acd02..5f691c4a1d 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 7fc2ef7515..ba2913c473 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 c151440b42..1c4342ac47 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 13184ece7c..d65fa13a57 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 6081b2bb23..1ee0a529a3 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/MapleMapItem.class b/build/classes/server/maps/MapleMapItem.class
index 0ea1fdf518..e427e6ccc2 100644
Binary files a/build/classes/server/maps/MapleMapItem.class and b/build/classes/server/maps/MapleMapItem.class differ
diff --git a/build/classes/server/maps/MapleReactor.class b/build/classes/server/maps/MapleReactor.class
index 306e9ababc..8beb497148 100644
Binary files a/build/classes/server/maps/MapleReactor.class and b/build/classes/server/maps/MapleReactor.class differ
diff --git a/build/classes/server/quest/actions/ItemAction$1.class b/build/classes/server/quest/actions/ItemAction$1.class
new file mode 100644
index 0000000000..563093107b
Binary files /dev/null and b/build/classes/server/quest/actions/ItemAction$1.class differ
diff --git a/build/classes/server/quest/actions/ItemAction$ItemData.class b/build/classes/server/quest/actions/ItemAction$ItemData.class
index 5ef8e6638f..f784e631d7 100644
Binary files a/build/classes/server/quest/actions/ItemAction$ItemData.class and b/build/classes/server/quest/actions/ItemAction$ItemData.class differ
diff --git a/build/classes/server/quest/actions/ItemAction.class b/build/classes/server/quest/actions/ItemAction.class
index 0d1e1f4ad0..25a805a4ac 100644
Binary files a/build/classes/server/quest/actions/ItemAction.class and b/build/classes/server/quest/actions/ItemAction.class differ
diff --git a/build/classes/tools/MaplePacketCreator$2.class b/build/classes/tools/MaplePacketCreator$2.class
index e51e222455..c3a90e0387 100644
Binary files a/build/classes/tools/MaplePacketCreator$2.class and b/build/classes/tools/MaplePacketCreator$2.class differ
diff --git a/build/classes/tools/MaplePacketCreator.class b/build/classes/tools/MaplePacketCreator.class
index a6c147efd6..cb26ef2a22 100644
Binary files a/build/classes/tools/MaplePacketCreator.class and b/build/classes/tools/MaplePacketCreator.class differ
diff --git a/dist/MapleSolaxia.jar b/dist/MapleSolaxia.jar
index 829103af93..562c363851 100644
Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ
diff --git a/feature_list.txt b/feature_list.txt
index c1c6a1758c..2ac1466b52 100644
--- a/feature_list.txt
+++ b/feature_list.txt
@@ -10,7 +10,7 @@ Feature list:
PQs:
* HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ/HorntailPQ 100%.
* CWKPQ as Expedition-based event 100%.
-* Expeditions: Scarga/Horntail 100%.
+* Expeditions: Scarga/Horntail/Showa/Zakum/Pinkbean 100%.
* GuildPQ 100% + Guild queue with multi-lobby systems available.
* Brand-new PQ: Boss Rush PQ 100%.
* BalrogPQ semi-functional.
@@ -20,6 +20,8 @@ Quests:
* Doll house quest 100%.
* Quests can now reward properly items when matching a reward item with the player's job.
* Loads of quests have been patched.
+* Quest rewards according to jobs works properly.
+* Rewarding system now checks for stacking opportunities on the inventory before checking for new slots.
Player Social Network:
* Guild and Alliance system fully functional.
@@ -42,16 +44,24 @@ Server potentials:
* Gain fame by quests.
* Every monsterbook card is now droppable by overworld mobs.
* Monsterbook displays drop data info conformant with the underlying DB (needs custom wz). See more on the MobBookUpdate feature.
+* Mastery book announcer displaying droppers of needed books of a player, read underlying DB.
+* Inventory auto-gather and auto-sorting feature.
+* Enhanced AP auto-assigner: exactly matches AP with the needed for the player's current level, surplus assigned to the primary attribute.
* Added Boss HP Bar for dozens of bosses (needs provided custom wz).
+* If multiple bosses on the same area, client will prioritize Boss HP bar of the target of the player.
* Custom jail system (needs provided custom wz).
* Delete Character 100% (requires ENABLE_PIC activated).
+* Boats, elevator and other travelling mechanics fully working.
Admin/GM commands:
+* Server commands layered by GM levels.
* New commands.
-* Zakum/Horntail/Pinkbean 100%.
+* Spawn Zakum/Horntail/Pinkbean 100%.
Project:
* Organized project code.
-* Highly configurable server (see server flags at ServerConstants).
-* Fixed/added some missing packets for MoveEnvironment and summons.
+* Highly configurable server (see all server flags at ServerConstants).
+* Fixed/added some missing packets for MoveEnvironment, summons and others.
+* Reviewed some Java object aspects that needed concurrency protection.
+
---------------------------
\ No newline at end of file
diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt
index da671ce082..eeb0904e4f 100644
--- a/mychanges_ptbr.txt
+++ b/mychanges_ptbr.txt
@@ -381,4 +381,50 @@ Corrigido bugs com "buffmap" desconectando players em certos casos.
16 - 17 Julho 2017,
Adicionados HTPQ e expedição Horntail.
-Corrigido bugs com levelup de equipamentos provocando Integer overflow (stats negativos) nos clientes.
\ No newline at end of file
+Corrigido bugs com levelup de equipamentos provocando Integer overflow (stats negativos) nos clientes.
+Corrigido ataque de Octopus (summon) não revelando direção a clientes de terceiros.
+Corrigido caso onde player usando chair morre sem desequipar a chair, levando clientes a mostrar chairs ao lado do player.
+Nova feature: cura extra de chairs de mapa.
+
+18 - 19 Julho 2017,
+Corrigido varias falhas de concorrencia na classe dos players.
+Corrigido reator das portas do dojo as vezes lancando nulls.
+Adicionado sistema de lobbys pro Dojo (multiplas partys podendo acessar salas do Dojo concorrentemente, com limite).
+Adicionado proteção de acesso concorrente a certas propriedades dos players.
+
+21 Julho 2017,
+Corrigido scripts dojang_Eff (agora aplicando para todos) e dojang_1st (agora somente para o primeiro player entrando no mapa).
+Dojo agora funcional, com sistema de lobbys aplicado.
+Bosses no dojo agora dropam buffs e mobs poções.
+
+22 - 23 Julho 2017,
+Corrigido vários aspectos errôneos referente ao funcionamento das Mystic Doors.
+Comando adicionado: recharge.
+Adicionado/modificado alguns scripts de portais relacionados a mapas de skills de 4th job.
+
+24 Julho 2017,
+Adicionada mecânica permitindo quests entregarem itens mesmo que não haja slots vazios para garantir tal ação.
+
+25 Julho 2017,
+Adicionadas barras de HP para bosses da região de Zipangu/Showa.
+Adicionada expedição para bosses de Showa.
+Adicionados chairs a venda por NPCs ao longo de Maple World.
+
+26 - 27 Julho 2017,
+HP Bar de bosses agora aparecem de forma inteligente, de acordo com quem o jogador está alvejando.
+Adicionadas expedições para Zakum e Pinkbean.
+
+31 Julho 2017,
+Otimizado carregamento de skills ao iniciar o server.
+Workaround em bosses tais como Riche e Ice Witch, anteriormente inderrotáveis.
+
+01 Agosto 2017,
+Adicionado drop data para tais bosses anteriormente inderrotáveis.
+
+02 Agosto 2017,
+Consertado bug em alguns eventos, relacionado à função isEventLeader.
+Consertado quests não dando item certo apropriadamente, no caso de escolhas.
+
+03 Agosto 2017,
+Quests agora retiram itens antes de entregar recompensas.
+Após a primeira inicialização, PQs inicializarão mais rápido, uma vez que há um sistema preparador de EIMs ativo.
\ No newline at end of file
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
index a747e8fe02..6f49190395 100644
--- a/nbproject/private/private.xml
+++ b/nbproject/private/private.xml
@@ -3,10 +3,16 @@
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Equip.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/ItemFactory.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapFactory.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventScriptManager.java
file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java
file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/RankingWorker.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventManager.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/Channel.java
+ file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/reactor/ReactorActionManager.java
diff --git a/scripts/event/AreaBossBamboo.js b/scripts/event/AreaBossBamboo.js
new file mode 100644
index 0000000000..1ee03e8358
--- /dev/null
+++ b/scripts/event/AreaBossBamboo.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 .
+*/
+/**
+-- Odin JavaScript --------------------------------------------------------------------------------
+ Bamboo Warrior Spawner
+-- Edited by --------------------------------------------------------------------------------------
+ Ronan (based on xQuasar's King Clang spawner)
+
+**/
+function init() {
+ scheduleNew();
+}
+
+function scheduleNew() {
+ setupTask = em.schedule("start", 0); //spawns upon server start. Each 3 hours an server event checks if boss exists, if not spawns it instantly.
+}
+
+function cancelSchedule() {
+ if (setupTask != null)
+ setupTask.cancel(true);
+}
+
+function start() {
+ var mapObj = em.getChannelServer().getMapFactory().getMap(800020120);
+ var mobObj = Packages.server.life.MapleLifeFactory.getMonster(6090002);
+
+ if(mapObj.getMonsterById(6090002) != null) {
+ em.schedule("start", 3 * 60 *60 * 1000);
+ return;
+ }
+
+ mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(560, 50));
+ mapObj.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears."));
+ em.schedule("start", 3 * 60 *60 * 1000);
+}
\ No newline at end of file
diff --git a/scripts/event/AreaBossCentipede.js b/scripts/event/AreaBossCentipede.js
index 087077cb89..548d992507 100644
--- a/scripts/event/AreaBossCentipede.js
+++ b/scripts/event/AreaBossCentipede.js
@@ -21,9 +21,9 @@
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
- Deo Spawner
+ Centipede Spawner
-- Edited by --------------------------------------------------------------------------------------
- ThreeStep (based on xQuasar's King Clang spawner)
+ Ronan (based on xQuasar's King Clang spawner)
**/
function init() {
diff --git a/scripts/event/HorntailFight.js b/scripts/event/HorntailBattle.js
similarity index 99%
rename from scripts/event/HorntailFight.js
rename to scripts/event/HorntailBattle.js
index 1931ef04cd..15c4378bae 100644
--- a/scripts/event/HorntailFight.js
+++ b/scripts/event/HorntailBattle.js
@@ -6,7 +6,7 @@
importPackage(Packages.server.life);
var isPq = true;
-var minPlayers = 1, maxPlayers = 30;
+var minPlayers = 6, maxPlayers = 30;
var minLevel = 100, maxLevel = 255;
var entryMap = 240060000;
var exitMap = 240050600;
diff --git a/scripts/event/HorntailPQ.js b/scripts/event/HorntailPQ.js
index 8e466d81b2..b9db133635 100644
--- a/scripts/event/HorntailPQ.js
+++ b/scripts/event/HorntailPQ.js
@@ -4,7 +4,7 @@
*/
var isPq = true;
-var minPlayers = 1, maxPlayers = 6;
+var minPlayers = 6, maxPlayers = 6;
var minLevel = 120, maxLevel = 255;
var entryMap = 240050100;
var exitMap = 240050500;
diff --git a/scripts/event/OrbisPQ_old.js b/scripts/event/OrbisPQ_old.js
deleted file mode 100644
index 52b7c192e3..0000000000
--- a/scripts/event/OrbisPQ_old.js
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * 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 playerUnregistered(eim, player) {}
-
-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/PinkBeanBattle.js b/scripts/event/PinkBeanBattle.js
new file mode 100644
index 0000000000..e39b1fe2be
--- /dev/null
+++ b/scripts/event/PinkBeanBattle.js
@@ -0,0 +1,262 @@
+/**
+ * @author: Ronan
+ * @event: Pink Bean Battle
+*/
+
+importPackage(Packages.server.life);
+importPackage(Packages.client.inventory);
+
+var isPq = true;
+var minPlayers = 6, maxPlayers = 30;
+var minLevel = 120, maxLevel = 255;
+var entryMap = 270050100;
+var exitMap = 270050300;
+var recruitMap = 270050000;
+var clearMap = 270050300;
+
+var minMapId = 270050100;
+var maxMapId = 270050300;
+
+var eventTime = 100; // 100 minutes
+
+var lobbyRange = [0, 0];
+
+function init() {
+ setEventRequirements();
+}
+
+function setLobbyRange() {
+ return lobbyRange;
+}
+
+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 = [];
+ eim.setExclusiveItems(itemSet);
+}
+
+function setEventRewards(eim) {
+ var itemSet, itemQty, evLevel, expStages, mesoStages;
+
+ evLevel = 1; //Rewards at clear PQ
+ itemSet = [];
+ itemQty = [];
+ eim.setEventRewards(evLevel, itemSet, itemQty);
+
+ expStages = []; //bonus exp given on CLEAR stage signal
+ eim.setEventClearStageExp(expStages);
+
+ mesoStages = []; //bonus meso given on CLEAR stage signal
+ eim.setEventClearStageMeso(mesoStages);
+}
+
+function afterSetup(eim) {
+ eim.dropMessage(5, "The first wave will start within 15 seconds, prepare yourselves.");
+ eim.schedule("startWave", 15 * 1000);
+}
+
+function setup(channel) {
+ var eim = em.newInstance("PinkBean" + channel);
+ eim.setProperty("canJoin", 1);
+ eim.setProperty("defeatedBoss", 0);
+ eim.setProperty("fallenPlayers", 0);
+
+ eim.setProperty("stage", 1);
+ eim.setProperty("channel", channel);
+
+ var level = 1;
+ eim.getInstanceMap(270050100).resetPQ(level);
+ eim.getInstanceMap(270050200).resetPQ(level);
+ eim.getInstanceMap(270050300).resetPQ(level);
+
+ var mob = MapleLifeFactory.getMonster(8820000);
+ eim.getInstanceMap(270050100).spawnMonsterOnGroundBelow(mob, new java.awt.Point(0, -42));
+
+ eim.startEventTimer(eventTime * 60000);
+ setEventRewards(eim);
+ setEventExclusives(eim);
+
+ return eim;
+}
+
+function playerEntry(eim, player) {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
+ var map = eim.getMapInstance(entryMap);
+ player.changeMap(map, map.getPortal(0));
+}
+
+function scheduledTimeout(eim) {
+ end(eim);
+}
+
+function changedMap(eim, player, mapid) {
+ if (mapid < minMapId || mapid > maxMapId) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
+ }
+}
+
+function changedLeader(eim, leader) {}
+
+function playerDead(eim, player) {
+ var count = eim.getIntProperty("fallenPlayers");
+ count = count + 1;
+
+ eim.setIntProperty("fallenPlayers", count);
+
+ if(count == 5) {
+ eim.dropMessage(5, "[Expedition] Too much players have fallen, Pink Bean is now deemed undefeatable, the expedition is over.");
+ end(eim);
+ } else if(count == 4) {
+ eim.dropMessage(5, "[Expedition] Pink Bean is glowing stronger than ever, last stand mode everyone!");
+ } else if(count == 3) {
+ eim.dropMessage(5, "[Expedition] Casualty count is starting to get out of control. Take care folks.");
+ }
+}
+
+function playerRevive(eim, player) {
+ return true;
+}
+
+function playerDisconnected(eim, player) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
+}
+
+function leftParty (eim, player) {}
+
+function disbandParty (eim) {}
+
+function monsterValue(eim, mobId) {
+ return 1;
+}
+
+function playerUnregistered(eim, player) {}
+
+function playerExit(eim, player) {
+ eim.unregisterPlayer(player);
+ player.changeMap(exitMap, 0);
+}
+
+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) {
+ eim.stopEventTimer();
+ eim.setEventCleared();
+}
+
+function isPinkBean(mob) {
+ var mobid = mob.getId();
+ return (mobid == 8820001);
+}
+
+function isJrBoss(mob) {
+ var mobid = mob.getId();
+ return (mobid >= 8820002 && mobid <= 8820006);
+}
+
+function noJrBossesLeft(map) {
+ return map.countMonster(8820002, 8820006) == 0;
+}
+
+function spawnJrBoss(mobObj, gotKilled) {
+ if(gotKilled) {
+ spawnid = mobObj.getId() + 17;
+
+ } else {
+ mobObj.getMap().killMonster(mobObj.getId());
+ spawnid = mobObj.getId() - 17;
+ }
+
+ var mob = MapleLifeFactory.getMonster(spawnid);
+ mobObj.getMap().spawnMonsterOnGroundBelow(mob, mobObj.getPosition());
+}
+
+function monsterKilled(mob, eim) {
+ if(isPinkBean(mob)) {
+ eim.setIntProperty("defeatedBoss", 1);
+ eim.showClearEffect(mob.getMap().getId());
+ mob.getMap().killAllMonstersNotFriendly();
+ eim.clearPQ();
+
+ var ch = eim.getIntProperty("channel");
+ mob.getMap().broadcastPinkBeanVictory(ch);
+ } else if(isJrBoss(mob)) {
+ if(noJrBossesLeft(mob.getMap())) {
+ var stage = eim.getIntProperty("stage");
+
+ if(stage == 5) {
+ var iid = 4001193;
+ var itemObj = new Item(iid, 0, 1);
+ var mapObj = eim.getMapFactory().getMap(270050100);
+ var reactObj = mapObj.getReactorById(2708000);
+ var dropper = eim.getPlayers().get(0);
+ mapObj.spawnItemDrop(dropper, dropper, itemObj, reactObj.getPosition(), true, true);
+
+
+ eim.dropMessage(6, "With the last of his guardians' fall, Pink Bean loses his invulnerability. The real fight starts now!");
+ } else {
+ stage++;
+ eim.setIntProperty("stage", stage);
+
+ eim.dropMessage(5, "The next wave will start within 15 seconds, prepare yourselves.");
+ eim.schedule("startWave", 15 * 1000);
+ }
+ }
+ }
+}
+
+function startWave(eim) {
+ var mapObj = eim.getMapInstance(270050100);
+ var stage = eim.getProperty("stage");
+
+ for(var i = 1; i <= stage; i++) {
+ spawnJrBoss(mapObj.getMonsterById(8820019 + (i % 5)), false);
+ }
+}
+
+function allMonstersDead(eim) {}
+
+function cancelSchedule() {}
+
+function dispose(eim) {}
diff --git a/scripts/event/ScargaBattle.js b/scripts/event/ScargaBattle.js
index 0d8e7df0e6..99c6827366 100644
--- a/scripts/event/ScargaBattle.js
+++ b/scripts/event/ScargaBattle.js
@@ -5,7 +5,7 @@
var isPq = true;
var minPlayers = 6, maxPlayers = 30;
-var minLevel = 70, maxLevel = 255;
+var minLevel = 100, maxLevel = 255;
var entryMap = 551030200;
var exitMap = 551030100;
var recruitMap = 551030100;
@@ -52,8 +52,8 @@ function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages, mesoStages;
evLevel = 1; //Rewards at clear PQ
- itemSet = [];
- itemQty = [];
+ itemSet = [1102145, 1102084, 1102085, 1102086, 1102087, 1052165, 1052166, 1052167, 1402013, 1332030, 1032030, 1032070, 4003000, 4000030, 4006000, 4006001, 4005000, 4005001, 4005002, 4005003, 4005004, 2022016, 2022263, 2022264, 2022015, 2022306, 2022307, 2022306, 2022113];
+ itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 50, 50, 120, 120, 4, 4, 4, 4, 2, 125, 125, 125, 30, 30, 30, 30, 30];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = []; //bonus exp given on CLEAR stage signal
diff --git a/scripts/event/ShowaBattle.js b/scripts/event/ShowaBattle.js
new file mode 100644
index 0000000000..ec9d042fed
--- /dev/null
+++ b/scripts/event/ShowaBattle.js
@@ -0,0 +1,190 @@
+/**
+ * @author: Ronan
+ * @event: Showa Boss Battle
+*/
+
+var isPq = true;
+var minPlayers = 3, maxPlayers = 30;
+var minLevel = 100, maxLevel = 255;
+var entryMap = 801040100;
+var exitMap = 801040004;
+var recruitMap = 801040004;
+var clearMap = 801040101;
+
+var minMapId = 801040100;
+var maxMapId = 801040100;
+
+var eventTime = 60; // 60 minutes for boss stg
+
+var lobbyRange = [0, 0];
+
+function init() {
+ setEventRequirements();
+}
+
+function setLobbyRange() {
+ return lobbyRange;
+}
+
+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 = [];
+ eim.setExclusiveItems(itemSet);
+}
+
+function setEventRewards(eim) {
+ var itemSet, itemQty, evLevel, expStages, mesoStages;
+
+ evLevel = 1; //Rewards at clear PQ
+ itemSet = [1102145, 1102084, 1102085, 1102086, 1102087, 1052165, 1052166, 1052167, 1402013, 1332030, 1032030, 1032070, 4003000, 4000030, 4006000, 4006001, 4005000, 4005001, 4005002, 4005003, 4005004, 2022016, 2022263, 2022264, 2022015, 2022306, 2022307, 2022306, 2022113];
+ itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 40, 40, 100, 100, 2, 2, 2, 2, 1, 100, 100, 100, 40, 40, 40, 40, 40];
+ eim.setEventRewards(evLevel, itemSet, itemQty);
+
+ expStages = []; //bonus exp given on CLEAR stage signal
+ eim.setEventClearStageExp(expStages);
+
+ mesoStages = []; //bonus meso given on CLEAR stage signal
+ eim.setEventClearStageMeso(mesoStages);
+}
+
+function afterSetup(eim) {}
+
+function setup(channel) {
+ var eim = em.newInstance("Showa" + channel);
+ eim.setProperty("canJoin", 1);
+
+ var level = 1;
+ eim.getInstanceMap(801040100).resetPQ(level);
+
+ respawnStages(eim);
+ eim.startEventTimer(eventTime * 60000);
+ setEventRewards(eim);
+ setEventExclusives(eim);
+
+ return eim;
+}
+
+function respawnStages(eim) {
+ eim.getInstanceMap(801040100).instanceMapRespawn();
+
+ eim.schedule("respawnStages", 15 * 1000);
+}
+
+function playerEntry(eim, player) {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
+ var map = eim.getMapInstance(entryMap);
+ player.changeMap(map, map.getPortal(0));
+}
+
+function scheduledTimeout(eim) {
+ end(eim);
+}
+
+function changedMap(eim, player, mapid) {
+ if (mapid < minMapId || mapid > maxMapId) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
+ }
+}
+
+function changedLeader(eim, leader) {}
+
+function playerDead(eim, player) {}
+
+function playerRevive(eim, player) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
+}
+
+function playerDisconnected(eim, player) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
+}
+
+function leftParty (eim, player) {}
+
+function disbandParty (eim) {}
+
+function monsterValue(eim, mobId) {
+ return 1;
+}
+
+function playerUnregistered(eim, player) {}
+
+function playerExit(eim, player) {
+ eim.unregisterPlayer(player);
+ player.changeMap(exitMap, 0);
+}
+
+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) {
+ eim.getInstanceMap(801040100).killAllMonstersNotFriendly();
+
+ eim.stopEventTimer();
+ eim.setEventCleared();
+}
+
+function isTheBoss(mob) {
+ return mob.getId() == 9400300;
+}
+
+function monsterKilled(mob, eim) {
+ if(isTheBoss(mob)) {
+ eim.showClearEffect();
+ eim.clearPQ();
+ }
+}
+
+function allMonstersDead(eim) {}
+
+function cancelSchedule() {}
+
+function dispose(eim) {}
\ No newline at end of file
diff --git a/scripts/event/ZakumBattle.js b/scripts/event/ZakumBattle.js
index 800d0e073b..88c5448bdd 100644
--- a/scripts/event/ZakumBattle.js
+++ b/scripts/event/ZakumBattle.js
@@ -1,195 +1,192 @@
-/*
- * This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy
- Matthias Butz
- Jan Christian Meyer
+/**
+ * @author: Ronan
+ * @event: Zakum Battle
+*/
- 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.
+importPackage(Packages.server.life);
- 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 isPq = true;
+var minPlayers = 6, maxPlayers = 30;
+var minLevel = 50, maxLevel = 255;
+var entryMap = 280030000;
+var exitMap = 211042400;
+var recruitMap = 211042400;
+var clearMap = 211042400;
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
- */
+var minMapId = 280030000;
+var maxMapId = 280030000;
-/*
- * @Author Stereo
- * @Modified By XkelvinchiaX(Kelvin)
- * @Modified By Moogra
- * @Modified By SharpAceX(Alan)
- * Zakum Battle
- */
+var eventTime = 60; // 60 minutes
-var exitMap;
-var altarMap;
-var minPlayers = 1;
-var fightTime = 75;
-var altarTime = 15;
-var gate;
+var lobbyRange = [0, 0];
function init() {
- em.setProperty("shuffleReactors","false");
- exitMap = em.getChannelServer().getMapFactory().getMap(211042300);
- altarMap = em.getChannelServer().getMapFactory().getMap(280030000);// Last Mission: Zakum's Altar
- gate = exitMap.getReactorByName("gate");
- gate.setState(0);//Open gate
+ setEventRequirements();
}
-function setup() {
- var eim = em.newInstance("ZakumBattle_" + em.getProperty("channel"));
- var timer = 1000 * 60 * fightTime;
- eim.setProperty("summoned", "false");
- em.schedule("timeOut", eim, timer);
- em.schedule("altarTimeOut", eim, 1000 * 60 * altarTime);
- eim.startEventTimer(timer);
- gate.setState(1);//Close gate
- return eim;
+function setLobbyRange() {
+ return lobbyRange;
+}
+
+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 = [];
+ eim.setExclusiveItems(itemSet);
+}
+
+function setEventRewards(eim) {
+ var itemSet, itemQty, evLevel, expStages, mesoStages;
+
+ evLevel = 1; //Rewards at clear PQ
+ itemSet = [];
+ itemQty = [];
+ eim.setEventRewards(evLevel, itemSet, itemQty);
+
+ expStages = []; //bonus exp given on CLEAR stage signal
+ eim.setEventClearStageExp(expStages);
+
+ mesoStages = []; //bonus meso given on CLEAR stage signal
+ eim.setEventClearStageMeso(mesoStages);
}
function afterSetup(eim) {}
-function playerEntry(eim,player) {
- var altar = eim.getMapInstance(altarMap.getId());
- player.changeMap(altar, altar.getPortal(0));
+function setup(channel) {
+ var eim = em.newInstance("Zakum" + channel);
+ eim.setProperty("canJoin", 1);
+ eim.setProperty("defeatedBoss", 0);
- player.dropMessage(5, "The Zakum Shrine will close if you do not summon Zakum in " + altarTime + " minutes.");
- if (altarMap == null)
- debug(eim, "The altar map was not properly linked.");
+ var level = 1;
+ eim.getInstanceMap(280030000).resetPQ(level);
+
+ eim.startEventTimer(eventTime * 60000);
+ setEventRewards(eim);
+ setEventExclusives(eim);
+
+ return eim;
}
-function playerRevive(eim,player) {
- player.setHp(500);
- player.setStance(0);
- eim.unregisterPlayer(player);
- player.changeMap(exitMap, exitMap.getPortal(0));
- var exped = eim.getPlayers();
- if (exped.size() < minPlayers)
- end(eim,"There are not enough players remaining, the Zakum battle is over.");
- return false;
+function playerEntry(eim, player) {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
+ var map = eim.getMapInstance(entryMap);
+ player.changeMap(map, map.getPortal(0));
}
-function playerDead(eim,player) {
+function scheduledTimeout(eim) {
+ end(eim);
}
-function playerDisconnected(eim,player) {
- var exped = eim.getPlayers();
- if (player.getName().equals(eim.getProperty("leader"))) {
- var iter = exped.iterator();
- while (iter.hasNext()) {
- iter.next().getPlayer().dropMessage(6, "The leader of the expedition has disconnected.");
- }
- }
- //If the expedition is too small.
- if (exped.size() < minPlayers) {
- end(eim,"There are not enough players remaining. The Battle is over.");
+function changedMap(eim, player, mapid) {
+ if (mapid < minMapId || mapid > maxMapId) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
}
}
-function monsterValue(eim,mobId) { // potentially display time of death? does not seem to work
- if (mobId == 8800002) { // 3rd body
- var iter = eim.getPlayers().iterator();
- while (iter.hasNext()) {
- iter.next().dropMessage(6, "Congratulations on defeating Zakum!");
- }
- }
- return -1;
-}
+function changedLeader(eim, leader) {}
-function leftParty(eim,player) { // do nothing in Zakum
-}
+function playerDead(eim, player) {}
-function disbandParty(eim) { // do nothing in Zakum
-}
-
-function playerUnregistered(eim, player) {}
-
-function playerExit(eim,player) {
- eim.unregisterPlayer(player);
- player.changeMap(exitMap, exitMap.getPortal(0));
- if (eim.getPlayers().size() < minPlayers) {//not enough after someone left
- end(eim, "There are no longer enough players to continue, and those remaining shall be warped out.");
- }
-}
-
-function end(eim,msg) {
- var iter = eim.getPlayers().iterator();
- while (iter.hasNext()) {
- var player = iter.next();
- player.getPlayer().dropMessage(6,msg);
+function playerRevive(eim, player) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
- if (player != null){
- player.changeMap(exitMap, exitMap.getPortal(0));
- }
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ end(eim);
}
- gate.setState(0);//Open gate
- eim.dispose();
-}
-
-function removePlayer(eim,player) {
- eim.unregisterPlayer(player);
- player.getMap().removePlayer(player);
- player.setMap(exitMap);
-}
-
-function clearPQ(eim) { //When the hell does this get executed?
- end(eim,"As the sound of battle fades away, you feel strangely unsatisfied.");
-
-}
-
-function finish(eim) {
- var iter = eim.getPlayers().iterator();
- while (iter.hasNext()) {
- var player = iter.next();
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
eim.unregisterPlayer(player);
- player.changeMap(exitMap, exitMap.getPortal(0));
+ }
+}
+
+function playerDisconnected(eim, player) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else {
+ eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
+ eim.unregisterPlayer(player);
+ }
+}
+
+function leftParty (eim, player) {}
+
+function disbandParty (eim) {}
+
+function monsterValue(eim, mobId) {
+ return 1;
+}
+
+function playerUnregistered(eim, player) {
+ if(eim.isEventCleared()) {
+ em.completeQuest(player, 100200, 2030010);
+ }
+}
+
+function playerExit(eim, player) {
+ eim.unregisterPlayer(player);
+ player.changeMap(exitMap, 0);
+}
+
+function end(eim) {
+ var party = eim.getPlayers();
+ for (var i = 0; i < party.size(); i++) {
+ playerExit(eim, party.get(i));
}
eim.dispose();
}
-function monsterKilled(mob, eim) {}
+function giveRandomEventReward(eim, player) {
+ eim.giveEventReward(player);
+}
+
+function clearPQ(eim) {
+ eim.stopEventTimer();
+ eim.setEventCleared();
+}
+
+function isZakum(mob) {
+ var mobid = mob.getId();
+ return (mobid == 8800002);
+}
+
+function monsterKilled(mob, eim) {
+ if(isZakum(mob)) {
+ eim.setIntProperty("defeatedBoss", 1);
+ eim.showClearEffect(mob.getMap().getId());
+ eim.clearPQ();
+
+ mob.getMap().broadcastZakumVictory();
+ }
+}
function allMonstersDead(eim) {}
function cancelSchedule() {}
-function altarTimeOut(eim) {
- if (eim != null && eim.getProperty("summoned").equals("false")) {
- if (eim.getPlayerCount() > 0) {
- var pIter = eim.getPlayers().iterator();
- while (pIter.hasNext()){
- var player = pIter.next();
- player.dropMessage(6, "The Shrine has closed since you did not summon Zakum within " + altarTime + " minutes.");
- playerExit(eim, player);
- }
- }
- eim.dispose();
- }
-}
-
-function timeOut(eim) {
- if (eim != null) {
- if (eim.getPlayerCount() > 0) {
- var pIter = eim.getPlayers().iterator();
- while (pIter.hasNext()){
- var player = pIter.next();
- player.dropMessage(6, "You have run out of time to defeat Zakum!");
- playerExit(eim, player);
- }
- }
- eim.dispose();
- }
-}
-
-function debug(eim,msg) {
- var iter = eim.getPlayers().iterator();
- while (iter.hasNext()) {
- iter.next().getClient().getSession().write(Packages.tools.MaplePacketCreator.serverNotice(6,msg));
- }
-}
\ No newline at end of file
+function dispose(eim) {}
diff --git a/scripts/event/ZakumPQ.js b/scripts/event/ZakumPQ.js
index bb66cda5ca..689e307149 100644
--- a/scripts/event/ZakumPQ.js
+++ b/scripts/event/ZakumPQ.js
@@ -1,165 +1,227 @@
-/*
- * This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy
- Matthias Butz
- Jan Christian Meyer
+/**
+ * @author: Ronan
+ * @event: Zakum 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 = 1, maxPlayers = 6;
+var minLevel = 50, maxLevel = 255;
+var entryMap = 280010000;
+var exitMap = 211042300;
+var recruitMap = 211042300;
+var clearMap = 211042300;
- 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 = 280010000;
+var maxMapId = 280011006;
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
- */
+var eventTime = 30; // 30 minutes
-/*
- * @Author Lerk
- *
- * Zakum Party Quest
- */
-
-var exitMap;
-var instanceId;
+var lobbyRange = [0, 0];
function init() {
- instanceId = 1;
- em.setProperty("shuffleReactors","true");
+ setEventRequirements();
}
-function monsterValue(eim, mobId) {
- return 1;
+function setLobbyRange() {
+ return lobbyRange;
}
-function setup() {
- exitMap = em.getChannelServer().getMapFactory().getMap(280090000); //room of tragedy
- var instanceName = "ZakumPQ" + instanceId;
-
- //ZPQ maps, center area then 1-1 through 16-6 increasing gradually
- //var instanceMaps = new Array(280010000, 280010010, 280010011, 280010020, 280010030, 280010031, 280010040, 280010041, 280010050, 280010060,
- // 280010070, 280010071, 280010080, 280010081, 280010090, 280010091, 280010100, 280010101, 280010110, 280010120, 280010130, 280010140,
- // 280010150, 280011000, 280011001, 280011002, 280011003, 280011004, 280011005, 280011006);
- var eim = em.newInstance(instanceName);
-
- var mf = eim.getMapFactory();
-
- instanceId++;
-
- var map = mf.getMap(280010000);
- map.shuffleReactors();
-
- //no time limit yet until clock can be visible in all maps
- //em.schedule("timeOut", 30 * 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 = [4001015, 4001016, 4001018];
+ eim.setExclusiveItems(itemSet);
+}
+
+function setEventRewards(eim) {
+ var itemSet, itemQty, evLevel, expStages;
+
+ evLevel = 1; //Rewards at clear PQ
+ itemSet = [];
+ itemQty = [];
+ 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("PreZakum" + lobbyid);
+ eim.setProperty("level", level);
+ eim.setProperty("gotDocuments", 0);
+
+ eim.getInstanceMap(280010000).resetPQ(level);
+ eim.getInstanceMap(280010010).resetPQ(level);
+ eim.getInstanceMap(280010011).resetPQ(level);
+ eim.getInstanceMap(280010020).resetPQ(level);
+ eim.getInstanceMap(280010030).resetPQ(level);
+ eim.getInstanceMap(280010031).resetPQ(level);
+ eim.getInstanceMap(280010040).resetPQ(level);
+ eim.getInstanceMap(280010041).resetPQ(level);
+ eim.getInstanceMap(280010050).resetPQ(level);
+ eim.getInstanceMap(280010060).resetPQ(level);
+ eim.getInstanceMap(280010070).resetPQ(level);
+ eim.getInstanceMap(280010071).resetPQ(level);
+ eim.getInstanceMap(280010080).resetPQ(level);
+ eim.getInstanceMap(280010081).resetPQ(level);
+ eim.getInstanceMap(280010090).resetPQ(level);
+ eim.getInstanceMap(280010091).resetPQ(level);
+ eim.getInstanceMap(280010100).resetPQ(level);
+ eim.getInstanceMap(280010101).resetPQ(level);
+ eim.getInstanceMap(280010110).resetPQ(level);
+ eim.getInstanceMap(280010120).resetPQ(level);
+ eim.getInstanceMap(280010130).resetPQ(level);
+ eim.getInstanceMap(280010140).resetPQ(level);
+ eim.getInstanceMap(280010150).resetPQ(level);
+ eim.getInstanceMap(280011000).resetPQ(level);
+ eim.getInstanceMap(280011001).resetPQ(level);
+ eim.getInstanceMap(280011002).resetPQ(level);
+ eim.getInstanceMap(280011003).resetPQ(level);
+ eim.getInstanceMap(280011004).resetPQ(level);
+ eim.getInstanceMap(280011005).resetPQ(level);
+ eim.getInstanceMap(280011006).resetPQ(level);
+
+ respawnStages(eim);
+
+ eim.startEventTimer(eventTime * 60000);
+ setEventRewards(eim);
+ setEventExclusives(eim);
+
+ return eim;
}
function afterSetup(eim) {}
+function respawnStages(eim) {}
+
function playerEntry(eim, player) {
- var map = eim.getMapInstance(280010000);
- player.changeMap(map, map.getPortal(0));
-
-//TODO: hold time across map changes
-//player.getClient().getSession().write(tools.MaplePacketCreator.getClock(1800));
+ var map = eim.getMapInstance(entryMap);
+ player.changeMap(map, map.getPortal(0));
}
-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
- playerExit(eim, player);
- }
- return false; // don't execute the standard reviving code
-}
-
-function playerDead(eim, player) {
-}
-
-function playerDisconnected(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++) {
- if (party.get(i).equals(player)) {
- removePlayer(eim, player);
- }
- else {
- playerExit(eim, party.get(i));
- }
- }
- eim.dispose();
- }
- else { //boot d/ced player
- removePlayer(eim, player);
- }
-}
-
-function leftParty(eim, player) {
- 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 scheduledTimeout(eim) {
+ end(eim);
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
- eim.unregisterPlayer(player);
- player.changeMap(exitMap, exitMap.getPortal(0));
+ eim.unregisterPlayer(player);
+ player.changeMap(exitMap, 0);
}
-//for offline players
-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) {
- //ZPQ does nothing special with winners
- var party = eim.getPlayers();
- for (var i = 0; i < party.size(); i++) {
- playerExit(eim, party.get(i));
- }
- eim.dispose();
+ eim.stopEventTimer();
+ eim.setEventCleared();
}
function monsterKilled(mob, eim) {}
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();
- }
-}
\ No newline at end of file
+function dispose(eim) {}
diff --git a/scripts/map/onFirstUserEnter/dojang_1st.js b/scripts/map/onFirstUserEnter/dojang_1st.js
new file mode 100644
index 0000000000..3392697404
--- /dev/null
+++ b/scripts/map/onFirstUserEnter/dojang_1st.js
@@ -0,0 +1,50 @@
+/*
+ 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: Moogra, Traitor, Ronan
+ *@Map(s): All Dojo fighting maps
+ *@Function: Spawns dojo monsters and handles time
+*/
+
+
+function start(ms) {
+ ms.getPlayer().resetEnteredScript();
+ var stage = Math.floor(ms.getMapId() / 100) % 100;
+ var callBoss = false;
+
+ if (stage % 6 == 1) {
+ ms.getClient().getChannelServer().startDojoSchedule(ms.getMapId());
+ } else if(stage % 6 == 0) {
+ ms.getClient().getChannelServer().dismissDojoSchedule(ms.getMapId(), ms.getParty());
+ }
+
+ callBoss = ms.getClient().getChannelServer().setDojoProgress(ms.getMapId());
+
+ if (stage % 6 > 0) {
+ var realstage = stage - ((stage / 6) | 0);
+ var mob = ms.getMonsterLifeFactory(9300183 + realstage);
+ if (callBoss && mob != null && ms.getPlayer().getMap().getMonsterById(9300216) == null) {
+ mob.setBoss(false);
+ ms.getPlayer().getMap().spawnDojoMonster(mob);
+ }
+ }
+}
\ No newline at end of file
diff --git a/scripts/map/onUserEnter/babyPigMap.js b/scripts/map/onUserEnter/babyPigMap.js
index a9fe2589f0..21a5d69fe7 100644
--- a/scripts/map/onUserEnter/babyPigMap.js
+++ b/scripts/map/onUserEnter/babyPigMap.js
@@ -22,5 +22,5 @@
function start(ms) {
ms.unlockUI();
- ms.forceStartQuest(22015);
+ ms.getClient().getQM().forceStartQuest(22015);
}
\ No newline at end of file
diff --git a/scripts/map/onUserEnter/dojang_Eff.js b/scripts/map/onUserEnter/dojang_Eff.js
new file mode 100644
index 0000000000..8fc8cbd0ab
--- /dev/null
+++ b/scripts/map/onUserEnter/dojang_Eff.js
@@ -0,0 +1,42 @@
+/*
+ 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: Moogra, Traitor, Ronan
+ *@Map(s): All Dojo fighting maps
+ *@Function: Displays info for the player when entering a dojo map
+*/
+
+
+function start(ms) {
+ ms.getPlayer().resetEnteredScript();
+ var stage = Math.floor(ms.getPlayer().getMap().getId() / 100) % 100;
+
+ ms.getPlayer().showDojoClock();
+ if (stage % 6 > 0) {
+ var realstage = stage - ((stage / 6) | 0);
+ ms.dojoEnergy();
+
+ ms.playSound("Dojang/start");
+ ms.showEffect("dojang/start/stage");
+ ms.showEffect("dojang/start/number/" + realstage);
+ }
+}
\ No newline at end of file
diff --git a/scripts/map/onUserEnter/dojang_Msg.js b/scripts/map/onUserEnter/dojang_Msg.js
index 63f5220364..ee34234e9a 100644
--- a/scripts/map/onUserEnter/dojang_Msg.js
+++ b/scripts/map/onUserEnter/dojang_Msg.js
@@ -28,7 +28,9 @@ var messages = Array("Your courage for challenging the Mu Lung Dojo is commendab
function start(ms) {
if (ms.getPlayer().getMap().getId() == 925020000) {
- ms.getPlayer().startMapEffect(messages[(Math.random() * messages.length) | 0], 5120024);
+ if(ms.getPlayer().getMap().findClosestPlayerSpawnpoint(ms.getPlayer().getPosition()).getId() == 0) {
+ ms.getPlayer().startMapEffect(messages[(Math.random() * messages.length) | 0], 5120024);
+ }
} else {
ms.getPlayer().resetEnteredScript(); //in case the person dcs in here we set it at dojang_tuto portal
ms.getPlayer().startMapEffect("Ha! Let's see what you got! I won't let you leave unless you defeat me first!", 5120024);
diff --git a/scripts/npc/1052107.js b/scripts/npc/1052107.js
new file mode 100644
index 0000000000..a84188d257
--- /dev/null
+++ b/scripts/npc/1052107.js
@@ -0,0 +1,52 @@
+/*
+ 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 .
+*/
+/* Small Street Light
+ Kerning deep Subway areas
+ Nothing at all.
+ */
+
+var status;
+
+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(status == 0) {
+ cm.sendOk("A small focus of light lighting in the immersive darkness.");
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/1052115.js b/scripts/npc/1052115.js
index bdae086c92..43cc74e55d 100644
--- a/scripts/npc/1052115.js
+++ b/scripts/npc/1052115.js
@@ -65,8 +65,8 @@ function action(mode, type, selection) {
cm.sendOk("Please defeat at least 10,000 monsters in the Station and look for me again. Kills : " + mons);
} else if (cm.canHold(1142141) && !cm.haveItem(1142141)){
cm.gainItem(1142141,1);
- cm.forceStartQuest(29931);
- cm.forceCompleteQuest(29931);
+ cm.startQuest(29931);
+ cm.completeQuest(29931);
} else {
cm.sendOk("Please make room.");
}
diff --git a/scripts/npc/2020008.js b/scripts/npc/2020008.js
index 6c66f5a3d7..62004c3613 100644
--- a/scripts/npc/2020008.js
+++ b/scripts/npc/2020008.js
@@ -117,7 +117,7 @@ function action(mode, type, selection){
} else {
if (cm.getPlayer().getLevel() >= 50){
cm.sendNext("Ok, go.");
- cm.getPlayer().setPartyQuestItemObtained("z");
+ if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
}else
cm.sendNext("You're weak.");
cm.dispose();
diff --git a/scripts/npc/2020009.js b/scripts/npc/2020009.js
index 5c02d54df1..4977ef2c0d 100644
--- a/scripts/npc/2020009.js
+++ b/scripts/npc/2020009.js
@@ -105,7 +105,7 @@ function action(mode, type, selection){
} else {
if (cm.getPlayer().getLevel() >= 50){
cm.sendNext("Ok, go.");
- cm.getPlayer().setPartyQuestItemObtained("z");
+ if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
}else
cm.sendNext("You're weak.");
cm.dispose();
diff --git a/scripts/npc/2020010.js b/scripts/npc/2020010.js
index a61c043de1..b9c12ac882 100644
--- a/scripts/npc/2020010.js
+++ b/scripts/npc/2020010.js
@@ -106,7 +106,7 @@ function action(mode, type, selection){
} else {
if (cm.getPlayer().getLevel() >= 50){
cm.sendNext("Ok, go.");
- cm.getPlayer().setPartyQuestItemObtained("z");
+ if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
}else
cm.sendNext("You're weak.");
cm.dispose();
diff --git a/scripts/npc/2020011.js b/scripts/npc/2020011.js
index 6bf9b54ce9..36a00592a1 100644
--- a/scripts/npc/2020011.js
+++ b/scripts/npc/2020011.js
@@ -105,7 +105,7 @@ function action(mode, type, selection){
} else {
if (cm.getPlayer().getLevel() >= 50){
cm.sendNext("Ok, go.");
- cm.getPlayer().setPartyQuestItemObtained("z");
+ if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
}else
cm.sendNext("You're weak.");
cm.dispose();
diff --git a/scripts/npc/2020013.js b/scripts/npc/2020013.js
index 4cf617c2df..f782ed590f 100644
--- a/scripts/npc/2020013.js
+++ b/scripts/npc/2020013.js
@@ -104,7 +104,7 @@ function action(mode, type, selection){
} else {
if (cm.getPlayer().getLevel() >= 50){
cm.sendNext("Ok, go.");
- cm.getPlayer().setPartyQuestItemObtained("z");
+ if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
}else
cm.sendNext("You're weak.");
cm.dispose();
diff --git a/scripts/npc/2030008.js b/scripts/npc/2030008.js
index f6dc6f670c..b3ff9c82ee 100644
--- a/scripts/npc/2030008.js
+++ b/scripts/npc/2030008.js
@@ -1,14 +1,15 @@
/*
This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy
- Matthias Butz
- Jan Christian Meyer
+ 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.
+ 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
@@ -18,56 +19,31 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
-
/* Adobis
*
- * El Nath: The Door to Zakum (211042300)
+ * El Nath - The Door to Zakum (211042300)
*
- * Zakum Quest NPC
-
- * Custom Quest 100200 = whether you can do Zakum
- * Custom Quest 100201 = Collecting Gold Teeth <- indicates it's been started
- * Custom Quest 100203 = Collecting Gold Teeth <- indicates it's finished
- * 4031061 = Piece of Fire Ore - stage 1 reward
- * 4031062 = Breath of Fire - stage 2 reward
- * 4001017 = Eye of Fire - stage 3 reward
- * 4000082 = Zombie's Gold Tooth (stage 3 req)
+ * Vs Zakum Recruiter NPC
+ *
+ * Custom Quest 100200 = Whether you can start Zakum PQ
+ * Custom Quest 100201 = Whether you have done the trials
*/
var status;
-var mapId = 211042300;
-var stage;
-var teethmode;
-var minLevel = 50;
+var em;
+var selectedType;
+var gotAllDocs;
function start() {
- if (cm.getPlayer().getLevel() >= minLevel) {
- if (cm.isQuestCompleted(100200) && !cm.isQuestStarted(100200)) {
- cm.startQuest(100200);
- cm.sendOk("You want to be permitted to do the Zakum Dungeon Quest? Well, I, #bAdobis#k... judge you to be suitable. You should be safe roaming around the dungeon. Just be careful...");
- cm.dispose();
- return;
- }
- else if (cm.isQuestStarted(100201)) {
- teethmode = 1;
- cm.sendNext("Have you got the items I asked for? This ain't no charity.");
- }
- else
- cm.sendSimple("Beware, for the power of olde has not been forgotten... #b\r\n#L0#Enter the Unknown Dead Mine (Stage 1)#l\r\n#L1#Face the Breath of Lava (Stage 2)#l\r\n#L2#Forging the Eyes of Fire (Stage 3)#l");
- if (cm.isQuestCompleted(100201))
- teethmode = 2;
- }
- else {
- cm.sendOk("Please come back to me when you've become stronger. I've seen a few adventurers in my day, and you're far too weak to complete my tasks.");
- cm.dispose();
- }
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
- if (mode == 0 && status == 0) {
+ if (mode == 0) {
cm.dispose();
return;
}
@@ -75,117 +51,77 @@ function action(mode, type, selection) {
status++;
else
status--;
- if (status == 1) {
- if (teethmode == 1) {
- if (cm.haveItem(4031061,1) && cm.haveItem(4031062,1) && cm.haveItem(4000082,30)) {
- cm.gainItem(4031061,-1);
- cm.gainItem(4031062,-1);
- cm.gainItem(4000082,-30);
- cm.gainItem(4001017,5);
- cm.sendNext("Thank you for the teeth! Next time you see me, I'll be blinging harder than #rJaws#k! Goodbye and good luck!");
- cm.completeQuest(100201);
- cm.completeQuest(100200);
+
+ if(!cm.isQuestStarted(100200)) {
+ cm.sendOk("Beware, for the power of olde has not been forgotten... ");
+ cm.dispose();
+ return;
+ }
+
+ em = cm.getEventManager("ZakumPQ");
+ if(em == null) {
+ cm.sendOk("The Zakum PQ has encountered an error.");
+ cm.dispose();
+ return;
+ }
+
+ if (status == 0) {
+ cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nBeware, for the power of olde has not been forgotten... #b\r\n#L0#Enter the Unknown Dead Mine (Stage 1)#l\r\n#L1#Face the Breath of Lava (Stage 2)#l\r\n#L2#Forging the Eyes of Fire (Stage 3)#l");
+ }
+ 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 {
- cm.sendNext("You shtill didn't get me my teef! Howsh a man shupposhed to conshentrate wifout teef?");
+ } else if(!cm.isLeader()) {
+ cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
- }
- return;
- }
- if (selection == 0) { //ZPQ
- if (cm.getParty() == null) { //no party
- cm.sendNext("Please talk to me again when you have formed a party.");
- cm.dispose();
- }
- else if (!cm.isLeader()) { //not party leader
- cm.sendNext("Please have the leader of your party speak with me.");
- cm.dispose();
- }
- else {
- //TODO: add zakum variable to characters, check that instead; less hassle
- var party = cm.getParty().getMembers();
- mapId = cm.getPlayer().getMapId();
- var next = true;
- for (var i = 0; i < party.size(); i++)
- if ((party.get(i).getLevel() < 50) || (party.get(i).getMapid() != mapId))
- next = false;
- if (next) {
- //all requirements met, make an instance and start it up
- //cm.startPQ("ZakumPQ");
- var em = cm.getEventManager("ZakumPQ");
- if (em == null) {
- cm.sendOk("This trial is currently under construction.");
- } else {
- if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
- cm.sendOk("A party in your name is already registered in this event.");
- cm.dispose();
- return;
- }
- party = cm.getPlayer().getEventInstance().getPlayers();
- cm.removeFromParty(4001015, party);
- cm.removeFromParty(4001018, party);
- cm.removeFromParty(4001016, party);
+ } 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.");
}
- cm.dispose();
}
else {
- cm.sendNext("Please make sure all of your members are qualified to begin my trials...");
- cm.dispose();
+ 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) { //Zakum Jump Quest
- stage = 1;
+ } else if(selection == 1) {
if (cm.haveItem(4031061) && !cm.haveItem(4031062))
cm.sendYesNo("Would you like to attempt the #bBreath of Lava#k? If you fail, there is a very real chance you will die.");
else {
- if (cm.haveItem(4031062))
- cm.sendNext("You've already got the #bBreath of Lava#k, you don't need to do this stage.");
- else
- cm.sendNext("Please complete the earlier trials first.");
+ if (cm.haveItem(4031062)) cm.sendNext("You've already got the #bBreath of Lava#k, you don't need to do this stage.");
+ else cm.sendNext("Please complete the earlier trials first.");
+
cm.dispose();
}
- }
- else if (selection == 2) { //Golden Tooth Collection
- stage = 2;
- if (teethmode == 2 && cm.haveItem(4031061) && cm.haveItem(4031062))
- cm.sendYesNo("If you want more #bEyes of Fire#k, you need to bring me the same #b30 Zombie's Lost Gold Tooth#k. Turns out gold dentures don't last long, and I need a new one.\r\nDo you have those teeth for me?");
- else if (cm.haveItem(4031061) && cm.haveItem(4031062))
- cm.sendYesNo("Okay, you've completed the earlier trials. Now, with a little hard work I can get you the #bseeds of Zakum#k necessary to enter combat. But first, my teeths are not as good as they used to be. You ever seen a dentist in Maple Story? Well, I heard the Miner Zombies have gold teeth. I'd like you to collect #b30 Zombie's Lost Gold Tooth#k so I can build myself some dentures. Then I'll be able to get you the items you desire.\r\nRequired:\r\n#i4000082##b x 30");
- else {
- cm.sendNext("Please complete the earlier trials before attempting this one.");
+ } else {
+ if(cm.haveItem(4031061) && cm.haveItem(4031062)) {
+ if(!cm.haveItem(4000082, 30)) {
+ cm.sendOk("You have completed the trials, however there still the need of #b30 #t4000082##k to forge the #t4001017#.");
+ } else {
+ cm.completeQuest(100201);
+ cm.gainItem(4031061, -1);
+ cm.gainItem(4031062, -1);
+ cm.gainItem(4000082, -30);
+
+ cm.gainItem(4001017, 1);
+ cm.sendNext("You have completed the trials, from now on having my approval to challenge Zakum.");
+ }
+
+ cm.dispose();
+ } else {
+ cm.sendOk("You lack some of the required items to forge the #b#t4001017##k.");
cm.dispose();
}
}
}
else if (status == 2) {
- if (stage == 1) {
- cm.warp(280020000); // Breath of Lava I
- cm.dispose();
- }
- if (stage == 2) {
- if (teethmode == 2) {
- if (cm.haveItem(4031061,1) && cm.haveItem(4031062,1) && cm.haveItem(4000082,30)) { // take away items, give eyes of fire, complete quest
- cm.gainItem(4031061,-1);
- cm.gainItem(4031062,-1);
- cm.gainItem(4000082,-30);
- cm.gainItem(4001017,5);
- cm.sendNext("Thank you for the teeth! Next time you see me, I'll be blinging harder than #rJaws#k! Goodbye and good luck!");
- cm.completeQuest(100201);
- cm.completeQuest(100200);
- cm.dispose();
- }
- else {
- cm.sendNext("You don't have any teeth yet! Don't try to pull a fast one on me.");
- cm.dispose();
- }
- }
- else {
- cm.startQuest(100201);
- cm.dispose();
- }
- }
+ cm.warp(280020000);
+ cm.dispose();
}
}
}
diff --git a/scripts/npc/2030010.js b/scripts/npc/2030010.js
index f154b225b9..20fde5ea3e 100644
--- a/scripts/npc/2030010.js
+++ b/scripts/npc/2030010.js
@@ -31,26 +31,19 @@
importPackage(Packages.server.expeditions);
function start() {
- cm.sendYesNo("If you leave now, you'll have to start over. Are you sure you want to leave?");
+ if(cm.getMapId() == 280030000) {
+ if(!cm.getEventInstance().isEventCleared()) cm.sendYesNo("If you leave now, you'll have to start over. Are you sure you want to leave?");
+ else cm.sendYesNo("You guys finally overthrew Zakum, what a superb feat! Congratulations! Are you sure you want to leave now?");
+ } else {
+ cm.sendYesNo("If you leave now, you'll have to start over. Are you sure you want to leave?");
+ }
}
function action(mode, type, selection) {
- var zakum = MapleExpeditionType.ZAKUM;
- var expedition = cm.getExpedition(zakum);
if (mode < 1)
cm.dispose();
else {
- if (cm.getPlayer().getMap().getCharacters().size() < 2){
- cm.getPlayer().getMap().killAllMonsters();
- cm.getPlayer().getMap().resetReactors();
- if (expedition != null){
- cm.endExpedition(expedition);
- }
- }
- if (cm.getPlayer().getEventInstance() != null)
- cm.getPlayer().getEventInstance().removePlayer(cm.getPlayer());
- else
- cm.warp(211042300);
+ cm.warp(211042300);
cm.dispose();
}
}
\ No newline at end of file
diff --git a/scripts/npc/2030013.js b/scripts/npc/2030013.js
index ef1c4b0ca9..aa65cd80ee 100644
--- a/scripts/npc/2030013.js
+++ b/scripts/npc/2030013.js
@@ -21,6 +21,7 @@
/*Adobis
*
*@author SharpAceX (Alan)
+ *@author Ronan
*/
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
@@ -30,7 +31,12 @@ var status = 0;
var expedition;
var player;
var em;
-var zakum = MapleExpeditionType.ZAKUM;
+var exped = MapleExpeditionType.ZAKUM;
+var expedName = "Zakum";
+var expedBoss = "Zakum";
+var expedMap = "Zakum's Altar";
+var expedItem = 4001017;
+
var list = "What would you like to do?#b\r\n\r\n#L1#View current Expedition members#l\r\n#L2#Start the fight!#l\r\n#L3#Stop the expedition.#l";
function start() {
@@ -40,114 +46,140 @@ function start() {
function action(mode, type, selection) {
player = cm.getPlayer();
- expedition = cm.getExpedition(zakum);
+ expedition = cm.getExpedition(exped);
em = cm.getEventManager("ZakumBattle");
- if (mode < 1) {
+ if (mode == -1) {
cm.dispose();
- return;
- }
- if (status == 0) {
- //cm.removeExpedition(expedition);
- if (player.getClient().getChannel() != 1) { //Only channel 1
- cm.sendOk("Sorry, Zakum may only be challenged on #bChannel 1#k.");
- cm.dispose();
- } else if (player.getLevel() < zakum.getMinLevel() && player.getLevel() > zakum.getMaxLevel()) { //Don't fit requirement
- cm.sendOk("You do not meet the criteria to take on Zakum!");
- cm.dispose();
- } else if (expedition == null) { //Start an expedition
- cm.sendSimple("Would you like to assemble a team to take on the mighty #rZakum#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
- status = 1;
- } else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
- cm.sendSimple(list);
- status = 2;
- } else if (expedition.isRegistering()) { //If the expedition is registering
- if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
- cm.sendOk("You have already registered for the expedition. Please wait for " + expedition.getLeader().getName() + " to begin the expedition.");
- cm.dispose();
- } else { //If you aren't in it, you're going to get added
- cm.sendOk(expedition.addMember(cm.getPlayer()));
- cm.dispose();
- }
- } else if (expedition.isInProgress()) { //Only if the expedition is in progress
- if (expedition.contains(player)) { //If you're registered, warp you in
- em.getInstance("ZakumBattle_" + player.getClient().getChannel()).registerPlayer(player);
- cm.dispose();
- } else { //If you're not in by now, tough luck
- cm.sendOk("Another expedition has taken the initiative to fight Zakum, lets pray for those brave souls.");
- cm.dispose();
- }
- }
- } else if (status == 1) {
- if (selection == 1) {
- cm.createExpedition(zakum);
- cm.sendOk("The #rZakum Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
- cm.dispose();
- return;
- } else if (selection == 2) {
- cm.sendOk("Sure, not everyone's up to challenging the might of Zakum.");
+ } else {
+ if (mode == 0) {
cm.dispose();
return;
}
- } else if (status == 2) {
- if (selection == 1) {
- if (expedition == null) {
- cm.sendOk("The expedition could not be loaded.");
+
+ if (status == 0) {
+ if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
+ cm.dispose();
+ } else if (expedition == null) { //Start an expedition
+ cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
+ status = 1;
+ } else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
+ cm.sendSimple(list);
+ status = 2;
+ } else if (expedition.isRegistering()) { //If the expedition is registering
+ if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
+ cm.sendOk("You have already registered for the expedition. Please wait for #r" + expedition.getLeader().getName() + "#k to begin the expedition.");
+ cm.dispose();
+ } else { //If you aren't in it, you're going to get added
+ cm.sendOk(expedition.addMember(cm.getPlayer()));
+ cm.dispose();
+ }
+ } else if (expedition.isInProgress()) { //Only if the expedition is in progress
+ if (expedition.contains(player)) { //If you're registered, warp you in
+ var eim = em.getInstance(expedName + player.getClient().getChannel());
+ if(eim.getIntProperty("canJoin") == 1) {
+ eim.registerPlayer(player);
+ } else {
+ cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls.");
+ }
+
+ cm.dispose();
+ } else { //If you're not in by now, tough luck
+ cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
+ cm.dispose();
+ }
+ }
+ } else if (status == 1) {
+ if (selection == 1) {
+ if (!cm.haveItem(expedItem)) {
+ cm.sendOk("As the expedition leader, you must have on your inventory a #b#t" + expedItem + "##k to battle " + expedBoss + "!");
+ cm.dispose();
+ return;
+ }
+
+ expedition = cm.getExpedition(exped);
+ if(expedition != null) {
+ cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!");
+ cm.dispose();
+ return;
+ }
+
+ cm.createExpedition(exped);
+ cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
+ cm.dispose();
+ return;
+ } else if (selection == 2) {
+ cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + ".");
cm.dispose();
return;
}
- var size = expedition.getMembers().size();
- if (size == 1) {
- cm.sendOk("You are the only member of the expedition.");
+ } else if (status == 2) {
+ if (selection == 1) {
+ if (expedition == null) {
+ cm.sendOk("The expedition could not be loaded.");
+ cm.dispose();
+ return;
+ }
+ var size = expedition.getMembers().size();
+ if (size == 1) {
+ cm.sendOk("You are the only member of the expedition.");
+ cm.dispose();
+ return;
+ }
+ var text = "The following members make up your expedition (Click on them to expel them):\r\n";
+ text += "\r\n\t\t1." + expedition.getLeader().getName();
+ for (var i = 1; i < size; i++) {
+ text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
+ }
+ cm.sendSimple(text);
+ status = 6;
+ } else if (selection == 2) {
+ var min = exped.getMinSize();
+
+ var size = expedition.getMembers().size();
+ if (size < min) {
+ cm.sendOk("You need at least " + min + " players registered in your expedition.");
+ cm.dispose();
+ return;
+ }
+
+ cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
+ status = 4;
+ } else if (selection == 3) {
+ player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
+ cm.endExpedition(expedition);
+ cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
cm.dispose();
return;
}
- var text = "The following members make up your expedition (Click on them to expel them):\r\n";
- text += "\r\n\t\t1." + expedition.getLeader().getName();
- for (var i = 1; i < size; i++) {
- text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
+ } else if (status == 4) {
+ if (em == null) {
+ cm.sendOk("The event could not be initialized, please report this on the forum.");
+ cm.dispose();
+ return;
}
- cm.sendSimple(text);
- status = 6;
- } else if (selection == 2) {
- cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to Zakum Altar#k.");
- status = 4;
- } else if (selection == 3) {
- player.getMap().broadcastMessage(MaplePacketCreator.removeClock());
- player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
- cm.endExpedition(expedition);
- cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
- cm.dispose();
- return;
- }
- } else if (status == 4) {
- var min = 1; //zakum.getMinSize();
- var size = expedition.getMembers().size();
- if (size < min) {
- cm.sendOk("You need at least " + min + " players registered in your expedition.");
+
+ em.setProperty("leader", player.getName());
+ em.setProperty("channel", player.getClient().getChannel());
+ if(!em.startInstance(expedition)) {
+ cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
+ cm.dispose();
+ return;
+ }
+
cm.dispose();
return;
- }
- if (em == null) {
- cm.sendOk("The event could not be found, please report this on the forum.");
- cm.dispose();
- return;
- }
- cm.sendOk("Good luck! Zakum is a worthy foe!");
- em.setProperty("leader", player.getName());
- em.setProperty("channel", player.getClient().getChannel());
- em.startInstance(expedition);
- cm.dispose();
- return;
- } else if (status == 6) {
- if (selection > 0) {
- var banned = expedition.getMembers().get(selection);
- expedition.ban(banned);
- cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
- cm.dispose();
- } else {
- cm.sendSimple(list);
- status = 2;
+ } else if (status == 6) {
+ if (selection > 0) {
+ var banned = expedition.getMembers().get(selection - 1);
+ expedition.ban(banned);
+ cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
+ cm.dispose();
+ } else {
+ cm.sendSimple(list);
+ status = 2;
+ }
}
}
-}
\ No newline at end of file
+}
diff --git a/scripts/npc/2032002.js b/scripts/npc/2032002.js
index 79e79e605a..a5e9ffc5b8 100644
--- a/scripts/npc/2032002.js
+++ b/scripts/npc/2032002.js
@@ -28,17 +28,18 @@
var status;
var selectedType;
-var scrolls;
+var gotAllDocs;
function start() {
- cm.sendSimple("...#b\r\n#L0#What am I supposed to do here?#l\r\n#L1#I brought items!#l\r\n#L2#I want to get out!#l");
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
- if (mode == 0 && status == 0) {
+ if (mode == 0) {
cm.dispose();
return;
}
@@ -46,50 +47,95 @@ function action(mode, type, selection) {
status++;
else
status--;
- if (status == 1) {
- selectedType = selection;
- if (selection == 0) {
- cm.sendNext("To reveal the power of Zakum, you'll have to recreate its core. Hidden somewhere in this dungeon is a \"Fire Ore\" which is one of the necessary materials for that core. Find it, and bring it to me.\r\n\r\nOh, and could you do me a favour? There's also a number of Paper Documents lying under rocks around here. If you can get 30 of them, I can reward you for your efforts.")
- cm.dispose();
+
+ var eim = cm.getPlayer().getEventInstance();
+
+ if (status == 0) {
+ if(!eim.isEventCleared()) {
+ cm.sendSimple("...#b\r\n#L0#What am I supposed to do here?#l\r\n#L1#I brought items!#l\r\n#L2#I want to get out!#l");
+ } else {
+ cm.sendNext("You completed this ordeal, now receive your prize.");
}
- else if (selection == 1) {
- if (!cm.haveItem(4001018)) { //documents
- cm.sendNext("Please bring the Fire Ore with you.")
+ }
+ else if (status == 1) {
+ if(!eim.isEventCleared()) {
+ selectedType = selection;
+ if (selection == 0) {
+ cm.sendNext("To reveal the power of Zakum, you'll have to recreate its core. Hidden somewhere in this dungeon is a #b\"Fire Ore\"#k which is one of the necessary materials for that core. Find it, and bring it to me.\r\n\r\nOh, and could you do me a favour? There's also a number of #bPaper Documents#k lying under rocks around here. If you can get 30 of them, I can reward you for your efforts.");
cm.dispose();
+ return;
}
- else {
- if (!cm.haveItem(4001015, 30)) { //documents
- cm.sendYesNo("So, you brought the fire ore with you? In that case, I can give you and your party a piece of it that should be more than enough to make the core of Zakum. Make sure your whole party has room in their inventory before proceeding.");
- scrolls = false;
+ else if (selection == 1) {
+ if(!cm.isEventLeader()) {
+ cm.sendNext("Please let your leader bring the materials to me to complete this ordeal.");
+ cm.dispose();
+ return;
+ }
+
+ if (!cm.haveItem(4001018)) { //fire ore
+ cm.sendNext("Please bring the #bFire Ore#k with you.");
+ cm.dispose();
+ }
+ else {
+ gotAllDocs = cm.haveItem(4001015, 30);
+ if (!gotAllDocs) { //documents
+ cm.sendYesNo("So, you brought the fire ore with you? In that case, I can give you and your party a piece of it that should be more than enough to make the core of Zakum. Make sure your whole party has room in their inventory before proceeding.");
+ } else {
+ cm.sendYesNo("So, you brought the fire ore and the documents with you? In that case, I can give you and your party a piece of it that should be more than enough to make the core of Zakum. As well, since you brought the documents with you, I can also give you a special item which will #bbring you to the mine's entrance at any time#k. Make sure your whole party has room in their inventory before proceeding.");
+ }
+ }
+ } else if (selection == 2)
+ cm.sendYesNo("Are you sure you want to exit? If you're the party leader, your party will also be removed from the mines.");
+ } else {
+ if(eim.getProperty("gotDocuments") == 1) {
+ if(eim.gridCheck(cm.getPlayer()) == -1) {
+ if(cm.canHoldAll([2030007, 4031061], [5, 1])) {
+ cm.gainItem(2030007, 5);
+ cm.gainItem(4031061, 1);
+
+ eim.gridInsert(cm.getPlayer(), 1);
+ } else {
+ cm.sendOk("Make sure you have room in your inventory before proceeding.");
+ }
} else {
- cm.sendYesNo("So, you brought the fire ore and the documents with you? In that case, I can give you and your party a piece of it that should be more than enough to make the core of Zakum. As well, since you brought the documents with you, I can also give you a special item which will bring you to the mine's entrance at any time. Make sure your whole party has room in their inventory before proceeding.");
- scrolls = true;
+ cm.sendOk("You have already received your share. You can now exit the mines through the portal over there.");
+ }
+ } else {
+ if(eim.gridCheck(cm.getPlayer()) == -1) {
+ if(cm.canHold(4031061, 1)) {
+ cm.gainItem(4031061, 1);
+
+ eim.gridInsert(cm.getPlayer(), 1);
+ } else {
+ cm.sendOk("Make sure you have room in your inventory before proceeding.");
+ }
+ } else {
+ cm.sendOk("You have already received your share. You can now exit the mines through the portal over there.");
}
}
- } else if (selection == 2)
- cm.sendYesNo("Are you sure you want to exit? If you're the party leader, your party will also be removed from the mines.")
+
+ cm.dispose();
+ }
+
}
else if (status == 2) {
- var eim = cm.getPlayer().getEventInstance();
if (selectedType == 1) {
- var party = eim.getPlayers();
cm.gainItem(4001018, -1);
- if (scrolls)
+
+ if(gotAllDocs) {
cm.gainItem(4001015, -30);
- cm.givePartyItems(4031061, 1, party);
- if (scrolls) {
- cm.givePartyItems(2030007, 5, party);
- cm.givePartyExp(20000, party);
- } else
- cm.givePartyExp(12000, party);
+
+ eim.setProperty("gotDocuments", 1);
+ eim.giveEventPlayersExp(20000);
+ } else {
+ eim.giveEventPlayersExp(12000);
+ }
+
eim.clearPQ();
cm.dispose();
}
else if (selectedType == 2) {
- if (cm.isLeader())
- eim.disbandParty();
- else
- eim.leaveParty(cm.getPlayer());
+ cm.warp(211042300);
cm.dispose();
}
}
diff --git a/scripts/npc/2032003.js b/scripts/npc/2032003.js
index cbd145ae65..fc40ba717f 100644
--- a/scripts/npc/2032003.js
+++ b/scripts/npc/2032003.js
@@ -23,13 +23,12 @@
*
* Adobis's Mission I : Breath of Lava (280020001)
* Zakum Quest NPC
- * Custom Quest 100202 -> Done this stage once
*/
-var status;
+var status = -1;
function start() {
- cm.sendNext("Congratulations on getting this far! Well, I suppose I'd better give you your #bBreath of Fire#k. You've certainly earned it!");
+ action(1, 0, 0);
}
function action(mode, type, selection) {
@@ -37,16 +36,22 @@ function action(mode, type, selection) {
cm.dispose();
else {
status++;
- if (status == 1)
- cm.sendNextPrev("Well, time for you to head off.");
- else if (status == 2) {
- cm.gainItem(4031062,1);
- cm.warp(211042300);
- if (cm.isQuestCompleted(100202)) {
- cm.startQuest(100202);
- cm.completeQuest(100202);
- cm.gainExp(10000 * qm.getPlayer().getExpRate());
+
+ if (status == 0) {
+ cm.sendNext("Congratulations on getting this far! Well, I suppose I'd better give you your #bBreath of Fire#k. You've certainly earned it!");
+ } else if (status == 1) {
+ if(!cm.canHold(4031062)) {
+ cm.sendOk("Try freeing a slot to receive the #b#t4031062##k.");
+ cm.dispose();
+ return;
}
+
+ cm.sendNext("Well, time for you to head off.");
+ } else if (status == 2) {
+ cm.gainItem(4031062,1);
+ cm.gainExp(10000 * cm.getPlayer().getExpRate());
+ cm.warp(211042300);
+
cm.dispose();
}
}
diff --git a/scripts/npc/2040043.js b/scripts/npc/2040043.js
index 698fbda291..3af52cd084 100644
--- a/scripts/npc/2040043.js
+++ b/scripts/npc/2040043.js
@@ -122,7 +122,7 @@ function action(mode, type, selection) {
}
}
- if (playersOnCombo == 5 || cm.getPlayer().gmLevel() > 0) {
+ if (playersOnCombo == 5 || cm.getPlayer().gmLevel() > 1) {
var combo = eim.getProperty("stage" + stage + "combo").split(',');
var correctCombo = true;
for (i = 0; i < objset.length && correctCombo; i++)
@@ -130,7 +130,7 @@ function action(mode, type, selection) {
//cm.mapMessage(5, "Combo failed on " + (i + 1));
correctCombo = false;
}
- if (correctCombo || cm.getPlayer().gmLevel() > 0) {
+ if (correctCombo || cm.getPlayer().gmLevel() > 1) {
eim.setProperty("statusStg" + stage, 1);
clearStage(stage, eim, curMap);
cm.dispose();
diff --git a/scripts/npc/2081005.js b/scripts/npc/2081005.js
index d35c1771ab..f83fa8fd1f 100644
--- a/scripts/npc/2081005.js
+++ b/scripts/npc/2081005.js
@@ -33,7 +33,7 @@ function isTransformed(ch) {
function start() {
if(!(isTransformed(cm.getPlayer()) || cm.haveItem(4001086))) {
- cm.sendOk("This is the cave of the mighty Horntail, supreme ruler of the Leafre Canyons, outsiders are not welcome. Get lost!");
+ cm.sendOk("This is the cave of the mighty Horntail, supreme ruler of the Leafre Canyons. Only those #bdeemed worthy#k to meet him can pass here, #boutsiders#k are not welcome. Get lost!");
cm.dispose();
return;
}
diff --git a/scripts/npc/2081100.js b/scripts/npc/2081100.js
index 7463eb5930..767a9a63d0 100644
--- a/scripts/npc/2081100.js
+++ b/scripts/npc/2081100.js
@@ -25,62 +25,82 @@
*@Purpose: Handles 4th job.
*/
+var status;
+
function start() {
- if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 1) {
- cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
- cm.dispose();
- } else if (!cm.isQuestCompleted(6904)) {
- cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
- cm.dispose();
- } else if ( cm.getJobId() % 100 % 10 != 2) {
- cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
- } else {
- cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
- //cm.dispose();
- }
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
- cm.changeJobById(cm.getJobId() + 1);
- if(cm.getJobId() == 112) {
- cm.teachSkill(1121001, 0, 10, -1);
- cm.teachSkill(1120004, 0, 10, -1);
- cm.teachSkill(1121008, 0, 10, -1);
- } else if(cm.getJobId() == 122) {
- cm.teachSkill(1221001, 0, 10, -1);
- cm.teachSkill(1220005, 0, 10, -1);
- cm.teachSkill(1221009, 0, 10, -1);
- } else if(cm.getJobId() == 132) {
- cm.teachSkill(1321001, 0, 10, -1);
- cm.teachSkill(1320005, 0, 10, -1);
- cm.teachSkill(1321007, 0, 10, -1);
- }
- } else if(mode >= 0 && cm.getJobId() % 100 % 10 == 2) {
- // TEMP until I can get the quest fixed...
- if(cm.getJobId() == 112) {
- if(cm.getPlayer().getSkillLevel(1121010) == 0)
- cm.teachSkill(1121010 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(1120005) == 0)
- cm.teachSkill(1120005 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(1121002) == 0)
- cm.teachSkill(1121002 , 0, 10, -1);
- } else if(cm.getJobId() == 122) {
- if(cm.getPlayer().getSkillLevel(1221002) == 0)
- cm.teachSkill(1221002, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(1221003) == 0)
- cm.teachSkill(1221003, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(1221004) == 0)
- cm.teachSkill(1221004, 0, 10, -1);
- } else if(cm.getJobId() == 132) {
- if(cm.getPlayer().getSkillLevel(1321002) == 0)
- cm.teachSkill(1321002, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(1320008) == 0)
- cm.teachSkill(1320008, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(1320009) == 0)
- cm.teachSkill(1320009, 0, 10, -1);
- }
- cm.sendOk("It is done. Leave me now.");
- }
- cm.dispose();
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0 && status == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 1) {
+ cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
+ cm.dispose();
+ } else if (!cm.isQuestCompleted(6904)) {
+ cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
+ cm.dispose();
+ } else if ( cm.getJobId() % 100 % 10 != 2) {
+ cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
+ } else {
+ cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
+ }
+ } else if(status == 1) {
+ if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
+ cm.changeJobById(cm.getJobId() + 1);
+ if(cm.getJobId() == 112) {
+ cm.teachSkill(1121001, 0, 10, -1);
+ cm.teachSkill(1120004, 0, 10, -1);
+ cm.teachSkill(1121008, 0, 10, -1);
+ } else if(cm.getJobId() == 122) {
+ cm.teachSkill(1221001, 0, 10, -1);
+ cm.teachSkill(1220005, 0, 10, -1);
+ cm.teachSkill(1221009, 0, 10, -1);
+ } else if(cm.getJobId() == 132) {
+ cm.teachSkill(1321001, 0, 10, -1);
+ cm.teachSkill(1320005, 0, 10, -1);
+ cm.teachSkill(1321007, 0, 10, -1);
+ }
+ } else if(mode >= 0 && cm.getJobId() % 100 % 10 == 2) {
+ // TEMP until I can get the quest fixed...
+ if(cm.getJobId() == 112) {
+ if(cm.getPlayer().getSkillLevel(1121010) == 0)
+ cm.teachSkill(1121010 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(1120005) == 0)
+ cm.teachSkill(1120005 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(1121002) == 0)
+ cm.teachSkill(1121002 , 0, 10, -1);
+ } else if(cm.getJobId() == 122) {
+ if(cm.getPlayer().getSkillLevel(1221002) == 0)
+ cm.teachSkill(1221002, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(1221003) == 0)
+ cm.teachSkill(1221003, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(1221004) == 0)
+ cm.teachSkill(1221004, 0, 10, -1);
+ } else if(cm.getJobId() == 132) {
+ if(cm.getPlayer().getSkillLevel(1321002) == 0)
+ cm.teachSkill(1321002, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(1320008) == 0)
+ cm.teachSkill(1320008, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(1320009) == 0)
+ cm.teachSkill(1320009, 0, 10, -1);
+ }
+ cm.sendOk("It is done. Leave me now.");
+ }
+
+ cm.dispose();
+ }
+ }
}
\ No newline at end of file
diff --git a/scripts/npc/2081200.js b/scripts/npc/2081200.js
index 7ea1cc53f4..f18e4f8dde 100644
--- a/scripts/npc/2081200.js
+++ b/scripts/npc/2081200.js
@@ -25,59 +25,79 @@
*@Purpose: Handles 4th job.
*/
- function start() {
- if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 2) {
- cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
- cm.dispose();
- } else if (!cm.isQuestCompleted(6914)) {
- cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
- cm.dispose();
- } else if ( cm.getJobId() % 100 % 10 != 2) {
- cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
- } else {
- cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
- //cm.dispose();
- }
+var status;
+
+function start() {
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
- cm.changeJobById(cm.getJobId() + 1);
- if(cm.getJobId() == 212) {
- cm.teachSkill(2121001, 0, 10, -1);
- cm.teachSkill(2121002, 0, 10, -1);
- cm.teachSkill(2121006, 0, 10, -1);
- } else if(cm.getJobId() == 222) {
- cm.teachSkill(2221001, 0, 10, -1);
- cm.teachSkill(2221002, 0, 10, -1);
- cm.teachSkill(2221006, 0, 10, -1);
- } else if(cm.getJobId() == 232) {
- cm.teachSkill(2321001, 0, 10, -1);
- cm.teachSkill(2321002, 0, 10, -1);
- cm.teachSkill(2321005, 0, 10, -1);
- }
- } else if( mode >= 1 && cm.getJobId() % 100 % 10 == 2) {
- if(cm.getJobId() == 212) {
- if(cm.getPlayer().getSkillLevel(2121007) == 0)
- cm.teachSkill(2121007 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(2121005) == 0)
- cm.teachSkill(2121005 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(2121005) == 0)
- cm.teachSkill(2121005 , 0, 10, -1);
- } else if(cm.getJobId() == 222) {
- if(cm.getPlayer().getSkillLevel(2221007) == 0)
- cm.teachSkill(2221007 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(2221005) == 0)
- cm.teachSkill(2221005 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(2221003) == 0)
- cm.teachSkill(2221003 , 0, 10, -1);
- } else if(cm.getJobId() == 232) {
- if (cm.getPlayer().getSkillLevel(2321008) < 1)
- cm.teachSkill(2321008, 0, 10,-1); // Genesis
- if (cm.getPlayer().getSkillLevel(2321006) < 1)
- cm.teachSkill(2321006, 0, 10,-1); // res
- }
- cm.sendOk("It is done. Leave me now.");
- }
- cm.dispose();
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0 && status == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 2) {
+ cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
+ cm.dispose();
+ } else if (!cm.isQuestCompleted(6914)) {
+ cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
+ cm.dispose();
+ } else if ( cm.getJobId() % 100 % 10 != 2) {
+ cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
+ } else {
+ cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
+ //cm.dispose();
+ }
+ } else if(status == 1) {
+ if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
+ cm.changeJobById(cm.getJobId() + 1);
+ if(cm.getJobId() == 212) {
+ cm.teachSkill(2121001, 0, 10, -1);
+ cm.teachSkill(2121002, 0, 10, -1);
+ cm.teachSkill(2121006, 0, 10, -1);
+ } else if(cm.getJobId() == 222) {
+ cm.teachSkill(2221001, 0, 10, -1);
+ cm.teachSkill(2221002, 0, 10, -1);
+ cm.teachSkill(2221006, 0, 10, -1);
+ } else if(cm.getJobId() == 232) {
+ cm.teachSkill(2321001, 0, 10, -1);
+ cm.teachSkill(2321002, 0, 10, -1);
+ cm.teachSkill(2321005, 0, 10, -1);
+ }
+ } else if( mode >= 1 && cm.getJobId() % 100 % 10 == 2) {
+ if(cm.getJobId() == 212) {
+ if(cm.getPlayer().getSkillLevel(2121007) == 0)
+ cm.teachSkill(2121007 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(2121005) == 0)
+ cm.teachSkill(2121005 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(2121005) == 0)
+ cm.teachSkill(2121005 , 0, 10, -1);
+ } else if(cm.getJobId() == 222) {
+ if(cm.getPlayer().getSkillLevel(2221007) == 0)
+ cm.teachSkill(2221007 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(2221005) == 0)
+ cm.teachSkill(2221005 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(2221003) == 0)
+ cm.teachSkill(2221003 , 0, 10, -1);
+ } else if(cm.getJobId() == 232) {
+ if (cm.getPlayer().getSkillLevel(2321008) < 1)
+ cm.teachSkill(2321008, 0, 10,-1); // Genesis
+ if (cm.getPlayer().getSkillLevel(2321006) < 1)
+ cm.teachSkill(2321006, 0, 10,-1); // res
+ }
+ cm.sendOk("It is done. Leave me now.");
+ }
+ cm.dispose();
+ }
+ }
}
\ No newline at end of file
diff --git a/scripts/npc/2081300.js b/scripts/npc/2081300.js
index ea9934c0cd..2034be3293 100644
--- a/scripts/npc/2081300.js
+++ b/scripts/npc/2081300.js
@@ -25,50 +25,71 @@
*@Purpose: Handles 4th job.
*/
+var status;
+
function start() {
- if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 3) {
- cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
- cm.dispose();
- } else if (!cm.isQuestCompleted(6924)) {
- cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
- cm.dispose();
- } else if ( cm.getJobId() % 100 % 10 != 2) {
- cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
- } else {
- cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
- //cm.dispose();
- }
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
- cm.changeJobById(cm.getJobId() + 1);
- if(cm.getJobId() == 312) {
- cm.teachSkill(3121002, 0, 10, -1);
- cm.teachSkill(3120005, 0, 10, -1);
- cm.teachSkill(3121007, 0, 10, -1);
- } else if(cm.getJobId() == 322) {
- cm.teachSkill(3221002, 0, 10, -1);
- cm.teachSkill(3220004, 0, 10, -1);
- cm.teachSkill(3221006, 0, 10, -1);
- }
- } else if(mode >= 0 && cm.getJobId() % 100 % 10 == 2) {
- if(cm.getJobId() == 312) {
- if(cm.getPlayer().getSkillLevel(3121008) == 0)
- cm.teachSkill(3121008 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(3121006) == 0)
- cm.teachSkill(3121006 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(3121004) == 0)
- cm.teachSkill(3121004 , 0, 10, -1);
- } else if(cm.getJobId() == 322) {
- if(cm.getPlayer().getSkillLevel(3221007) == 0)
- cm.teachSkill(3221007 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(3221005) == 0)
- cm.teachSkill(3221005 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(3221001) == 0)
- cm.teachSkill(3221001 , 0, 10, -1);
- }
- cm.sendOk("It is done. Leave me now.");
- }
- cm.dispose();
-}
\ No newline at end of file
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0 && status == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 3) {
+ cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
+ cm.dispose();
+ } else if (!cm.isQuestCompleted(6924)) {
+ cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
+ cm.dispose();
+ } else if ( cm.getJobId() % 100 % 10 != 2) {
+ cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
+ } else {
+ cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
+ //cm.dispose();
+ }
+ } else if(status == 1) {
+ if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
+ cm.changeJobById(cm.getJobId() + 1);
+ if(cm.getJobId() == 312) {
+ cm.teachSkill(3121002, 0, 10, -1);
+ cm.teachSkill(3120005, 0, 10, -1);
+ cm.teachSkill(3121007, 0, 10, -1);
+ } else if(cm.getJobId() == 322) {
+ cm.teachSkill(3221002, 0, 10, -1);
+ cm.teachSkill(3220004, 0, 10, -1);
+ cm.teachSkill(3221006, 0, 10, -1);
+ }
+ } else if(mode >= 0 && cm.getJobId() % 100 % 10 == 2) {
+ if(cm.getJobId() == 312) {
+ if(cm.getPlayer().getSkillLevel(3121008) == 0)
+ cm.teachSkill(3121008 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(3121006) == 0)
+ cm.teachSkill(3121006 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(3121004) == 0)
+ cm.teachSkill(3121004 , 0, 10, -1);
+ } else if(cm.getJobId() == 322) {
+ if(cm.getPlayer().getSkillLevel(3221007) == 0)
+ cm.teachSkill(3221007 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(3221005) == 0)
+ cm.teachSkill(3221005 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(3221001) == 0)
+ cm.teachSkill(3221001 , 0, 10, -1);
+ }
+ cm.sendOk("It is done. Leave me now.");
+ }
+
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/2081400.js b/scripts/npc/2081400.js
index 37c3fca857..244faaa34b 100644
--- a/scripts/npc/2081400.js
+++ b/scripts/npc/2081400.js
@@ -25,46 +25,67 @@
*@Purpose: Handles 4th job.
*/
+var status;
+
function start() {
- if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 4) {
- cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
- cm.dispose();
- } else if (!cm.isQuestCompleted(6934)) {
- cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
- cm.dispose();
- } else if ( cm.getJobId() % 100 % 10 != 2) {
- cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
- } else {
- cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
- //cm.dispose();
- }
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
- cm.changeJobById(cm.getJobId() + 1);
- if(cm.getJobId() == 412) {
- cm.teachSkill(4120002, 0, 10, -1);
- cm.teachSkill(4120005, 0, 10, -1);
- cm.teachSkill(4121006, 0, 10, -1);
- } else if(cm.getJobId() == 422) {
- cm.teachSkill(4220002, 0, 10, -1);
- cm.teachSkill(4220005, 0, 10, -1);
- cm.teachSkill(4221007, 0, 10, -1);
- }
- } else if(mode >= 1 && cm.getJobId() % 100 % 10 == 2) {
- if(cm.getJobId() == 412) {
- if(cm.getPlayer().getSkillLevel(4121008) == 0)
- cm.teachSkill(4121008 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(4121004) == 0)
- cm.teachSkill(4121004 , 0, 10, -1);
- } else if(cm.getJobId() == 422) {
- if(cm.getPlayer().getSkillLevel(4221004) == 0)
- cm.teachSkill(4221004 , 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(4221001) == 0)
- cm.teachSkill(4221001 , 0, 10, -1);
- }
- cm.sendOk("It is done. Leave me now.");
- }
- cm.dispose();
-}
\ No newline at end of file
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0 && status == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 4) {
+ cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
+ cm.dispose();
+ } else if (!cm.isQuestCompleted(6934)) {
+ cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
+ cm.dispose();
+ } else if ( cm.getJobId() % 100 % 10 != 2) {
+ cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
+ } else {
+ cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
+ //cm.dispose();
+ }
+ } else if(status == 1) {
+ if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
+ cm.changeJobById(cm.getJobId() + 1);
+ if(cm.getJobId() == 412) {
+ cm.teachSkill(4120002, 0, 10, -1);
+ cm.teachSkill(4120005, 0, 10, -1);
+ cm.teachSkill(4121006, 0, 10, -1);
+ } else if(cm.getJobId() == 422) {
+ cm.teachSkill(4220002, 0, 10, -1);
+ cm.teachSkill(4220005, 0, 10, -1);
+ cm.teachSkill(4221007, 0, 10, -1);
+ }
+ } else if(mode >= 1 && cm.getJobId() % 100 % 10 == 2) {
+ if(cm.getJobId() == 412) {
+ if(cm.getPlayer().getSkillLevel(4121008) == 0)
+ cm.teachSkill(4121008 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(4121004) == 0)
+ cm.teachSkill(4121004 , 0, 10, -1);
+ } else if(cm.getJobId() == 422) {
+ if(cm.getPlayer().getSkillLevel(4221004) == 0)
+ cm.teachSkill(4221004 , 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(4221001) == 0)
+ cm.teachSkill(4221001 , 0, 10, -1);
+ }
+ cm.sendOk("It is done. Leave me now.");
+ }
+
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/2081500.js b/scripts/npc/2081500.js
index 13383190a8..a6e24d36ab 100644
--- a/scripts/npc/2081500.js
+++ b/scripts/npc/2081500.js
@@ -25,58 +25,79 @@
*@Purpose: Handles 4th job.
*/
+var status;
+
function start() {
- if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 5) {
- cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
- cm.dispose();
- } else if (!cm.isQuestCompleted(6944)) {
- cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
- cm.dispose();
- } else if ( cm.getJobId() % 100 % 10 != 2) {
- cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
- } else {
- cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
- //cm.dispose();
- }
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
- cm.changeJobById(cm.getJobId() + 1);
- if(cm.getJobId() == 512) {
- cm.teachSkill(5121001, 0, 10, -1);
- cm.teachSkill(5121002, 0, 10, -1);
- cm.teachSkill(5121007, 0, 10, -1);
- cm.teachSkill(5121009, 0, 10, -1);
- } else if(cm.getJobId() == 522) {
- cm.teachSkill(5220001, 0, 10, -1);
- cm.teachSkill(5220002, 0, 10, -1);
- cm.teachSkill(5221004, 0, 10, -1);
- cm.teachSkill(5220011, 0, 10, -1);
- }
- } else if(mode >= 1 && cm.getJobId() % 100 % 10 == 2) {
- if(cm.getJobId() == 512) {
- if(cm.getPlayer().getSkillLevel(5121003) == 0)
- cm.teachSkill(5121003, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5121004) == 0)
- cm.teachSkill(5121004, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5121005) == 0)
- cm.teachSkill(5121005, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5121010) == 0)
- cm.teachSkill(5121010, 0, 10, -1);
- } else if(cm.getJobId() == 522) {
- if(cm.getPlayer().getSkillLevel(5221006) == 0)
- cm.teachSkill(5221006, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5221007) == 0)
- cm.teachSkill(5221007, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5221008) == 0)
- cm.teachSkill(5221008, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5221009) == 0)
- cm.teachSkill(5221009, 0, 10, -1);
- if(cm.getPlayer().getSkillLevel(5221003) == 0)
- cm.teachSkill(5221003, 0, 10, -1);
- }
- cm.sendOk("It is done. Leave me now.");
- }
- cm.dispose();
-}
\ No newline at end of file
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0 && status == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 5) {
+ cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
+ cm.dispose();
+ } else if (!cm.isQuestCompleted(6944)) {
+ cm.sendOk("You have not yet passed my trials. I can not advance you until you do so.");
+ cm.dispose();
+ } else if ( cm.getJobId() % 100 % 10 != 2) {
+ cm.sendYesNo("You did a marvellous job passing my test. Are you ready to advance to your 4th job?");
+ } else {
+ cm.sendSimple("If I must, I can teach you the art of your class.\r\n#b#L0#Teach me the skills of my class.#l");
+ //cm.dispose();
+ }
+ } else if(status == 1) {
+ if (mode >= 1 && cm.getJobId() % 100 % 10 != 2) {
+ cm.changeJobById(cm.getJobId() + 1);
+ if(cm.getJobId() == 512) {
+ cm.teachSkill(5121001, 0, 10, -1);
+ cm.teachSkill(5121002, 0, 10, -1);
+ cm.teachSkill(5121007, 0, 10, -1);
+ cm.teachSkill(5121009, 0, 10, -1);
+ } else if(cm.getJobId() == 522) {
+ cm.teachSkill(5220001, 0, 10, -1);
+ cm.teachSkill(5220002, 0, 10, -1);
+ cm.teachSkill(5221004, 0, 10, -1);
+ cm.teachSkill(5220011, 0, 10, -1);
+ }
+ } else if(mode >= 1 && cm.getJobId() % 100 % 10 == 2) {
+ if(cm.getJobId() == 512) {
+ if(cm.getPlayer().getSkillLevel(5121003) == 0)
+ cm.teachSkill(5121003, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5121004) == 0)
+ cm.teachSkill(5121004, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5121005) == 0)
+ cm.teachSkill(5121005, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5121010) == 0)
+ cm.teachSkill(5121010, 0, 10, -1);
+ } else if(cm.getJobId() == 522) {
+ if(cm.getPlayer().getSkillLevel(5221006) == 0)
+ cm.teachSkill(5221006, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5221007) == 0)
+ cm.teachSkill(5221007, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5221008) == 0)
+ cm.teachSkill(5221008, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5221009) == 0)
+ cm.teachSkill(5221009, 0, 10, -1);
+ if(cm.getPlayer().getSkillLevel(5221003) == 0)
+ cm.teachSkill(5221003, 0, 10, -1);
+ }
+ cm.sendOk("It is done. Leave me now.");
+ }
+
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/2083004.js b/scripts/npc/2083004.js
index de3553b9c3..ad98d3336c 100644
--- a/scripts/npc/2083004.js
+++ b/scripts/npc/2083004.js
@@ -45,7 +45,7 @@ function action(mode, type, selection) {
player = cm.getPlayer();
expedition = cm.getExpedition(exped);
- em = cm.getEventManager("HorntailFight");
+ em = cm.getEventManager("HorntailBattle");
if (mode == -1) {
cm.dispose();
@@ -127,8 +127,8 @@ function action(mode, type, selection) {
cm.sendSimple(text);
status = 6;
} else if (selection == 2) {
- //var min = exped.getMinSize();
- var min = 1;
+ var min = exped.getMinSize();
+
var size = expedition.getMembers().size();
if (size < min) {
cm.sendOk("You need at least " + min + " players registered in your expedition.");
diff --git a/scripts/npc/2091005.js b/scripts/npc/2091005.js
index 6e77b61afe..e8014c8a26 100644
--- a/scripts/npc/2091005.js
+++ b/scripts/npc/2091005.js
@@ -20,7 +20,7 @@
along with this program. If not, see .
*/
/*
-* @Author: Moogra, XxOsirisxX
+* @Author: Moogra, XxOsirisxX, Ronan
* @NPC: 2091005
* @Name: So Gong
* @Map(s): Dojo Hall
@@ -36,261 +36,342 @@ var belt_points = Array(10, 90, 200, 460, 850); /* Watered down version */
var status = -1;
var selectedMenu = -1;
+var dojoWarp = 0;
function start() {
- if(disabled) {
- cm.sendOk("My master has requested that the dojo be #rclosed#k at this time so I can't let you in.");
- cm.dispose();
- return;
- }
-
- if (isRestingSpot(cm.getPlayer().getMap().getId())) {
- var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n";
- if (!cm.getPlayer().getDojoParty()) {
- text += "#L2#I want to record my score up to this point#l";
- }
- cm.sendSimple(text);
- } else if (cm.getPlayer().getLevel() >= 25) {
- if (cm.getPlayer().getMap().getId() == 925020001) {
- cm.sendSimple("My master is the strongest person in Mu Lung, and you want to challenge him? Fine, but you'll regret it later.\r\n\r\n#b#L0#I want to challenge him alone.#l\r\n#L1#I want to challenge him with a party.#l\r\n\r\n#L2#I want to receive a belt.#l\r\n#L3#I want to reset my training points.#l\r\n#L4#I want to receive a medal.#l\r\n#L5#What is a Mu Lung Dojo?#l");
- } else {
- cm.sendYesNo("What, you're giving up? You just need to get to the next level! Do you really want to quit and leave?");
- }
- } else {
- cm.sendOk("Hey! Are you mocking my master? Who do you think you are to challenge him? This is a joke! You should at least be level #b25#k.");
+ if(disabled) {
+ cm.sendOk("My master has requested that the dojo be #rclosed#k at this time so I can't let you in.");
cm.dispose();
- return;
+ return;
}
+
+ action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
+ cm.getPlayer().setDojoStage(dojoWarp);
cm.dispose();
- } else if (cm.getPlayer().getMap().getId() == 925020001) {
- if (mode >= 0) {
- if (status == -1)
- selectedMenu = selection;
- status++; //there is no prev.
- if (selectedMenu == 0) { //I want to challenge him alone.
- if (!cm.getPlayer().hasEntered("dojang_Msg") && !cm.getPlayer().getFinishedDojoTutorial()) { //kind of hackish...
- if (status == 0) {
- cm.sendYesNo("Hey there! You! This is your first time, huh? Well, my master doesn't just meet with anyone. He's a busy man. And judging by your looks, I don't think he'd bother. Ha! But, today's your lucky day... I tell you what, if you can defeat me, I'll allow you to see my Master. So what do you say?");
- } else if (status == 1) {
- if (mode == 0) {
- cm.sendNext("Haha! Who are you trying to impress with a heart like that?\r\nGo back home where you belong!");
- cm.dispose();
- return;
- } else {
- if(cm.getClient().getChannelServer().getMapFactory().getMap(925020010).getCharacters().size() > 0) {
- cm.sendOk("Someone is already in Dojo");
- }
- else {
- cm.warp(925020010, 0);
- cm.getPlayer().setFinishedDojoTutorial();
- }
-
- cm.dispose();
- return;
- }
- }
- } else if (cm.getPlayer().getDojoStage() > 0) {
- if (status == 0) {
- cm.sendYesNo("The last time you took the challenge by yourself, you went up to level " + cm.getPlayer().getDojoStage() + ". I can take you there right now. Do you want to go there?");
- } else {
- cm.warp(mode == 1 ? 925020000 + cm.getPlayer().getDojoStage() * 100 : 925020100, 0);
- cm.dispose();
- }
+ } else {
+ if (mode == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+
+ if(status == 0) {
+ if (isRestingSpot(cm.getPlayer().getMap().getId())) {
+ var text = "I'm surprised you made it this far! But it won't be easy from here on out. You still want the challenge?\r\n\r\n#b#L0#I want to continue#l\r\n#L1#I want to leave#l\r\n";
+ if (!cm.getPlayer().getDojoParty()) {
+ text += "#L2#I want to record my score up to this point#l";
+ }
+ cm.sendSimple(text);
+ } else if (cm.getPlayer().getLevel() >= 25) {
+ if (cm.getPlayer().getMap().getId() == 925020001) {
+ cm.sendSimple("My master is the strongest person in Mu Lung, and you want to challenge him? Fine, but you'll regret it later.\r\n\r\n#b#L0#I want to challenge him alone.#l\r\n#L1#I want to challenge him with a party.#l\r\n\r\n#L2#I want to receive a belt.#l\r\n#L3#I want to reset my training points.#l\r\n#L4#I want to receive a medal.#l\r\n#L5#What is a Mu Lung Dojo?#l");
} else {
- for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps
- if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) {
- cm.sendOk("Someone is already in the Dojo." + i);
- cm.dispose();
- return;
- }
- }
- cm.getClient().getChannelServer().getMapFactory().getMap(925020100).resetReactors();
- cm.getClient().getChannelServer().getMapFactory().getMap(925020100).killAllMonsters();
- cm.warp(925020100, 0);
- cm.dispose();
- return;
+ cm.sendYesNo("What, you're giving up? You just need to get to the next level! Do you really want to quit and leave?");
}
- } else if (selectedMenu == 1) { //I want to challenge him with a party.
- var party = cm.getPlayer().getParty();
- if (party == null) {
- cm.sendNext("Where do you think you're going? You're not even the party leader! Go tell your party leader to talk to me.");
- cm.dispose();
- return;
- }
- var lowest = cm.getPlayer().getLevel();
- var highest = lowest;
- for (var x = 0; x < party.getMembers().size(); x++) {
- var lvl = party.getMembers().get(x).getLevel();
- if (lvl > highest)
- highest = lvl;
- else if (lvl < lowest)
- lowest = lvl;
- }
- var isBetween30 = highest - lowest < 30;
- if (party.getLeader().getId() != cm.getPlayer().getId()) {
- cm.sendNext("Where do you think you're going? You're not even the party leader! Go tell your party leader to talk to me.");
- cm.dispose();
- return;
- }
-
- //else if (party.getMembers().size() == 1) {
- // cm.sendNext("You're going to take on the challenge as a one-man party?");
- //}
-
- else if (!isBetween30) {
- cm.sendNext("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r30 levels#k of each other.");
- cm.dispose();
- return;
- } else {
- for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps
- if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) {
- cm.sendOk("Someone is already in the Dojo.");
- cm.dispose();
- return;
- }
- }
- cm.getClient().getChannelServer().getMapFactory().getMap(925020100).resetReactors();
- cm.getClient().getChannelServer().getMapFactory().getMap(925020100).killAllMonsters();
- cm.warpParty(925020100);
- cm.dispose();
- return;
- }
-
- } else if (selectedMenu == 2) { //I want to receive a belt.
- if (!cm.canHold(belts[0])) {
- cm.sendNext("Make room in your EQUIP inventory before trying to claim a belt!");
- cm.dispose();
- return;
- }
- if (mode < 1) {
- cm.dispose();
- return;
- }
- if (status == 0) {
- var selStr = "You have #b" + cm.getPlayer().getDojoPoints() + "#k training points. Master prefers those with great talent. If you obtain more points than the average, you can receive a belt depending on your score.\r\n";
- for (var i = 0; i < belts.length; i++) {
- if (cm.getPlayer().getItemQuantity(belts[i], true) > 0) {
- selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "# (Obtained)";
- } else
- selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "#";
- }
- cm.sendSimple(selStr);
- } else if (status == 1) {
- var belt = belts[selection];
- var level = belt_level[selection];
- var points = belt_points[selection];
- if (cm.getPlayer().getDojoPoints() > points) {
- if (cm.getPlayer().getLevel() > level) {
- cm.gainItem(belt, 1);
- cm.sendNext("There is the #i" + belt + "# #b#t" + belt + "##k. You have proven your valor to ascend on the Dojo ranks. Well done!");
- }
- else
- cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k, you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points.");
- } else
- cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k, you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points.");
-
- cm.dispose();
- return;
- }
- } else if (selectedMenu == 3) { //I want to reset my training points.
- if (status == 0) {
- cm.sendYesNo("You do know that if you reset your training points, it returns to 0, right? Although, that's not always a bad thing. If you can start earning training points again after you reset, you can receive the belts once more. Do you want to reset your training points now?");
- } else if (status == 1) {
- if (mode == 0) {
- cm.sendNext("Do you need to gather yourself or something? Come back after you take a deep breath.");
- } else {
- cm.getPlayer().setDojoPoints(0);
- cm.sendNext("There! All your training points have been reset. Think of it as a new beginning and train hard!");
- }
- cm.dispose();
- return;
- }
- } else if (selectedMenu == 4) { //I want to receive a medal.
- if (status == 0 && cm.getPlayer().getVanquisherStage() <= 0) {
- cm.sendYesNo("You haven't attempted the medal yet? If you defeat one type of monster in Mu Lung Dojo #b100 times#k you can receive a title called #b#t" + (1142033 + cm.getPlayer().getVanquisherStage()) + "##k. It looks like you haven't even earned the #b#t" + (1142033 + cm.getPlayer().getVanquisherStage()) + "##k... Do you want to try out for the #b#t" + (1142033 + cm.getPlayer().getVanquisherStage()) + "##k?");
- } else if (status == 1 || cm.getPlayer().getVanquisherStage() > 0) {
- if (mode == 0) {
- cm.sendNext("If you don't want to, that's fine.");
- } else {
- if (cm.getPlayer().getDojoStage() > 37) {
- cm.sendNext("You have completed all medals challenges.");
- } else if (cm.getPlayer().getVanquisherKills() < 100 && cm.getPlayer().getVanquisherStage() > 0)
- cm.sendNext("You still need #b" + (100 - cm.getPlayer().getVanquisherKills()) + "#k in order to obtain the #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k. Please try a little harder. As a reminder, only the mosnters that have been summoned by our Master in Mu Lung Dojo are considered. Oh, and make sure you're not hunting the monsters and exiting!#r If you don't go to the next level after defeating the monster, it doesn't count as a win#k.");
- else if (cm.getPlayer().getVanquisherStage() <= 0) {
- cm.getPlayer().setVanquisherStage(1);
- } else {
- cm.sendNext("You have obtained #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k.");
- cm.gainItem(1142033 + cm.getPlayer().getVanquisherStage(), 1);
- cm.getPlayer().setVanquisherStage(cm.c.getPlayer().getVanquisherStage() + 1);
- cm.getPlayer().setVanquisherKills(0);
- }
- }
-
- cm.dispose();
- return;
- }
- else {
- cm.dispose();
- return;
- }
- } else if (selectedMenu == 5) { //What is a Mu Lung Dojo?
- cm.sendNext("Our master is the strongest person in Mu Lung. The place he built is called the Mu Lung Dojo, a building that is 38 stories tall! You can train yourself as you go up each level. Of course, it'll be hard for someone at your level to reach the top.");
+ } else {
+ cm.sendOk("Hey! Are you mocking my master? Who do you think you are to challenge him? This is a joke! You should at least be level #b25#k.");
cm.dispose();
return;
}
} else {
- cm.dispose();
- return;
- }
- } else if (isRestingSpot(cm.getPlayer().getMap().getId())) {
- if (selectedMenu == -1)
- selectedMenu = selection;
- status++;
- if (selectedMenu == 0) {
- cm.warp(cm.getPlayer().getMap().getId() + 100, 0);
- cm.dispose();
- return;
- } else if (selectedMenu == 1) { //I want to leave
- if (status == 0) {
- cm.sendAcceptDecline("So, you're giving up? You're really going to leave?");
- } else {
- if (mode == 1) {
- cm.warp(925020002);
+ if (cm.getPlayer().getMap().getId() == 925020001) {
+ if (mode >= 0) {
+ if (status == 1)
+ selectedMenu = selection;
+ if (selectedMenu == 0) { //I want to challenge him alone.
+ if (!cm.getPlayer().hasEntered("dojang_Msg") && !cm.getPlayer().getFinishedDojoTutorial()) { //kind of hackish...
+ if (status == 1) {
+ cm.sendYesNo("Hey there! You! This is your first time, huh? Well, my master doesn't just meet with anyone. He's a busy man. And judging by your looks, I don't think he'd bother. Ha! But, today's your lucky day... I tell you what, if you can defeat me, I'll allow you to see my Master. So what do you say?");
+ } else if (status == 2) {
+ if (mode == 0) {
+ cm.sendNext("Haha! Who are you trying to impress with a heart like that?\r\nGo back home where you belong!");
+ cm.dispose();
+ return;
+ } else {
+ var avDojo = cm.getClient().getChannelServer().getAvailableDojo(true);
+
+ if(avDojo < 0) {
+ if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
+ else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
+ }
+ else {
+ cm.getClient().getChannelServer().getMapFactory().getMap(925020010 + avDojo).resetMapObjects();
+ cm.getClient().getChannelServer().resetDojo(925020010 + avDojo);
+ cm.warp(925020010 + avDojo, 0);
+ }
+
+ cm.dispose();
+ return;
+ }
+ }
+ } else if (cm.getPlayer().getDojoStage() > 0) {
+ if (status == 1) {
+ dojoWarp = cm.getPlayer().getDojoStage();
+ cm.getPlayer().setDojoStage(0);
+ cm.sendYesNo("The last time you took the challenge by yourself, you went up to level " + dojoWarp + ". I can take you there right now. Do you want to go there?");
+ } else {
+ var avDojo = cm.getClient().getChannelServer().getAvailableDojo(false);
+
+ if(avDojo < 0) {
+ if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
+ else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
+ cm.getPlayer().setDojoStage(dojoWarp);
+ }
+ else {
+ var warpDojoMap = ((mode == 1) ? 925020000 + (dojoWarp + 1) * 100 + avDojo : 925020100 + avDojo);
+ cm.getClient().getChannelServer().resetDojoMap(warpDojoMap);
+ cm.getClient().getChannelServer().resetDojo(warpDojoMap);
+ cm.warp(warpDojoMap, 0);
+ }
+
+ cm.dispose();
+ }
+ } else {
+ var avDojo = cm.getClient().getChannelServer().getAvailableDojo(false);
+
+ if(avDojo < 0) {
+ if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
+ else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
+ }
+ else {
+ cm.getClient().getChannelServer().resetDojoMap(925020100 + avDojo);
+ cm.getClient().getChannelServer().resetDojo(925020100 + avDojo);
+ cm.warp(925020100 + avDojo, 0);
+ }
+
+ cm.dispose();
+ return;
+ }
+ } else if (selectedMenu == 1) { //I want to challenge him with a party.
+ var party = cm.getPlayer().getParty();
+ if (party == null) {
+ cm.sendNext("Where do you think you're going? You're not even the party leader! Go tell your party leader to talk to me.");
+ cm.dispose();
+ return;
+ }
+
+ if (party.getLeader().getId() != cm.getPlayer().getId()) {
+ cm.sendNext("Where do you think you're going? You're not even the party leader! Go tell your party leader to talk to me.");
+ cm.dispose();
+ return;
+ }
+
+ //else if (party.getMembers().size() == 1) {
+ // cm.sendNext("You're going to take on the challenge as a one-man party?");
+ //}
+
+ else if (!isBetween(party, 30)) {
+ cm.sendNext("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r30 levels#k of each other.");
+ cm.dispose();
+ return;
+ } else {
+ var avDojo = cm.getClient().getChannelServer().getAvailableDojo(true, cm.getParty());
+
+ if(avDojo < 0) {
+ if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
+ else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
+ }
+ else {
+ cm.getClient().getChannelServer().resetDojoMap(925030100 + avDojo);
+ cm.getClient().getChannelServer().resetDojo(925030100 + avDojo);
+ cm.warpParty(925030100 + avDojo);
+ }
+
+ cm.dispose();
+ return;
+ }
+
+ } else if (selectedMenu == 2) { //I want to receive a belt.
+ if (!cm.canHold(belts[0])) {
+ cm.sendNext("Make room in your EQUIP inventory before trying to claim a belt!");
+ cm.dispose();
+ return;
+ }
+ if (mode < 1) {
+ cm.dispose();
+ return;
+ }
+ if (status == 1) {
+ var selStr = "You have #b" + cm.getPlayer().getDojoPoints() + "#k training points. Master prefers those with great talent. If you obtain more points than the average, you can receive a belt depending on your score.\r\n";
+ for (var i = 0; i < belts.length; i++) {
+ if (cm.getPlayer().getItemQuantity(belts[i], true) > 0) {
+ selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "# (Obtained)";
+ } else
+ selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "#";
+ }
+ cm.sendSimple(selStr);
+ } else if (status == 2) {
+ var belt = belts[selection];
+ var level = belt_level[selection];
+ var points = belt_points[selection];
+ if (cm.getPlayer().getDojoPoints() > points) {
+ if (cm.getPlayer().getLevel() > level) {
+ cm.gainItem(belt, 1);
+ cm.sendNext("There is the #i" + belt + "# #b#t" + belt + "##k. You have proven your valor to ascend on the Dojo ranks. Well done!");
+ }
+ else
+ cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k, you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points.");
+ } else
+ cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "##k, you have to be at least over level #b" + level + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (points - cm.getPlayer().getDojoPoints()) + "#k more training points.");
+
+ cm.dispose();
+ return;
+ }
+ } else if (selectedMenu == 3) { //I want to reset my training points.
+ if (status == 1) {
+ cm.sendYesNo("You do know that if you reset your training points, it returns to 0, right? Although, that's not always a bad thing. If you can start earning training points again after you reset, you can receive the belts once more. Do you want to reset your training points now?");
+ } else if (status == 2) {
+ if (mode == 0) {
+ cm.sendNext("Do you need to gather yourself or something? Come back after you take a deep breath.");
+ } else {
+ cm.getPlayer().setDojoPoints(0);
+ cm.sendNext("There! All your training points have been reset. Think of it as a new beginning and train hard!");
+ }
+ cm.dispose();
+ return;
+ }
+ } else if (selectedMenu == 4) { //I want to receive a medal.
+ if (status == 1 && cm.getPlayer().getVanquisherStage() <= 0) {
+ cm.sendYesNo("You haven't attempted the medal yet? If you defeat one type of monster in Mu Lung Dojo #b100 times#k you can receive a title called #b#t" + (1142033 + cm.getPlayer().getVanquisherStage()) + "##k. It looks like you haven't even earned the #b#t" + (1142033 + cm.getPlayer().getVanquisherStage()) + "##k... Do you want to try out for the #b#t" + (1142033 + cm.getPlayer().getVanquisherStage()) + "##k?");
+ } else if (status == 2 || cm.getPlayer().getVanquisherStage() > 0) {
+ if (mode == 0) {
+ cm.sendNext("If you don't want to, that's fine.");
+ } else {
+ if (cm.getPlayer().getDojoStage() > 37) {
+ cm.sendNext("You have completed all medals challenges.");
+ } else if (cm.getPlayer().getVanquisherKills() < 100 && cm.getPlayer().getVanquisherStage() > 0)
+ cm.sendNext("You still need #b" + (100 - cm.getPlayer().getVanquisherKills()) + "#k in order to obtain the #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k. Please try a little harder. As a reminder, only the mosnters that have been summoned by our Master in Mu Lung Dojo are considered. Oh, and make sure you're not hunting the monsters and exiting!#r If you don't go to the next level after defeating the monster, it doesn't count as a win#k.");
+ else if (cm.getPlayer().getVanquisherStage() <= 0) {
+ cm.getPlayer().setVanquisherStage(1);
+ } else {
+ cm.sendNext("You have obtained #b#t" + (1142032 + cm.getPlayer().getVanquisherStage()) + "##k.");
+ cm.gainItem(1142033 + cm.getPlayer().getVanquisherStage(), 1);
+ cm.getPlayer().setVanquisherStage(cm.c.getPlayer().getVanquisherStage() + 1);
+ cm.getPlayer().setVanquisherKills(0);
+ }
+ }
+
+ cm.dispose();
+ return;
+ }
+ else {
+ cm.dispose();
+ return;
+ }
+ } else if (selectedMenu == 5) { //What is a Mu Lung Dojo?
+ cm.sendNext("Our master is the strongest person in Mu Lung. The place he built is called the Mu Lung Dojo, a building that is #r38 stories#k tall! You can train yourself as you go up each level. Of course, it'll be hard for someone at your level to reach the top.");
+ cm.dispose();
+ return;
+ }
+ } else {
+ cm.dispose();
+ return;
+ }
+ } else if (isRestingSpot(cm.getPlayer().getMap().getId())) {
+ if (selectedMenu == -1)
+ selectedMenu = selection;
+
+ if (selectedMenu == 0) {
+ var hasParty = (cm.getParty() != null);
+
+ var firstEnter = false;
+ var avDojo = cm.getClient().getChannelServer().lookupPartyDojo(cm.getParty());
+ if(avDojo < 0) {
+ if(hasParty) {
+ if(!cm.isPartyLeader()) {
+ cm.sendOk("You are not the leader! Call your party leader to talk to me if you wish to continue.");
+ cm.dispose();
+ return;
+ }
+
+ if(!isBetween(cm.getParty(), 35)) {
+ cm.sendOk("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r35 levels#k of each other.");
+ cm.dispose();
+ return;
+ }
+ }
+
+ avDojo = cm.getClient().getChannelServer().getAvailableDojo(hasParty, cm.getParty());
+ firstEnter = true;
+ }
+
+ if(avDojo < 0) {
+ if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
+ else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
+ }
+ else {
+ var baseStg = hasParty ? 925030000 : 925020000;
+ var nextStg = Math.floor((cm.getPlayer().getMap().getId() + 100) / 100) % 100;
+
+ var dojoWarpMap = baseStg + (nextStg * 100) + avDojo;
+ if(firstEnter) {
+ cm.getClient().getChannelServer().resetDojoMap(dojoWarpMap);
+ cm.getClient().getChannelServer().resetDojo(dojoWarpMap, nextStg - 1);
+ }
+
+ if(!hasParty || !cm.isLeader()) cm.warp(dojoWarpMap, 0);
+ else cm.warpParty(dojoWarpMap, 0);
+ }
+
+ cm.dispose();
+ return;
+ } else if (selectedMenu == 1) { //I want to leave
+ if (status == 1) {
+ cm.sendYesNo("So, you're giving up? You're really going to leave?");
+ } else {
+ if (mode == 1) {
+ cm.warp(925020002);
+ }
+ cm.dispose();
+ return;
+ }
+ } else if (selectedMenu == 2) { //I want to record my score up to this point
+ if (status == 1) {
+ cm.sendYesNo("If you record your score, you can start where you left off the next time. Isn't that convenient? Do you want to record your current score?");
+ } else {
+ if (mode == 0) {
+ cm.sendNext("You think you can go even higher? Good luck!");
+ } else if (cm.getPlayer().getDojoStage() == Math.floor(cm.getMapId() / 100) % 100) {
+ cm.sendOk("Looks like you came all the way up here without recording your score. Sorry, but you can't record now.");
+ } else {
+ cm.sendNext("I recorded your score. If you tell me the next time you go up, you'll be able to start where you left off.");
+ cm.getPlayer().setDojoStage(Math.floor(cm.getMapId() / 100) % 100);
+ }
+ cm.dispose();
+ return;
+ }
}
- cm.dispose();
- return;
- }
- } else if (selectedMenu == 2) { //I want to record my score up to this point
- if (status == 0) {
- cm.sendYesNo("If you record your score, you can start where you left off the next time. Isn't that convenient? Do you want to record your current score?");
} else {
if (mode == 0) {
- cm.sendNext("You think you can go even higher? Good luck!");
- } else if (925020000 + cm.getPlayer().getDojoStage() * 100 == cm.getMapId()) {
- cm.sendOk("Looks like you came all the way up here without recording your score. Sorry, but you can't record now.");
- } else {
- cm.sendNext("I recorded your score. If you tell me the next time you go up, you'll be able to start where you left off.");
- cm.getPlayer().setDojoStage((cm.getMapId() - 925020000) / 100);
+ cm.sendNext("Stop changing your mind! Soon, you'll be crying, begging me to go back.");
+ } else if (mode == 1) {
+ cm.warp(925020002, 0);
+ cm.getPlayer().message("Can you make up your mind please?");
}
cm.dispose();
- return;
}
}
- } else {
- if (mode == 0) {
- cm.sendNext("Stop changing your mind! Soon, you'll be crying, begging me to go back.");
- } else if (mode == 1) {
- cm.warp(925020002, 0);
- cm.getPlayer().message("Can you make up your mind please?");
- }
- cm.dispose();
}
}
function isRestingSpot(id) {
- return (id / 100 - 9250200) % 6 == 0;
+ return (Math.floor(id / 100) % 100) % 6 == 0 && id != 925020001;
+}
+
+function isBetween(party, range) {
+ var lowest = cm.getPlayer().getLevel();
+ var highest = lowest;
+ for (var x = 0; x < party.getMembers().size(); x++) {
+ var lvl = party.getMembers().get(x).getLevel();
+ if (lvl > highest)
+ highest = lvl;
+ else if (lvl < lowest)
+ lowest = lvl;
+ }
+ return (highest - lowest) <= range;
}
diff --git a/scripts/npc/2096000.js b/scripts/npc/2096000.js
new file mode 100644
index 0000000000..86f90bbffb
--- /dev/null
+++ b/scripts/npc/2096000.js
@@ -0,0 +1,52 @@
+/*
+ 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 .
+*/
+/* Practice Chart
+ Practice Field : Beginner (250020000)
+ Nothing at all.
+ */
+
+var status;
+
+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(status == 0) {
+ cm.sendOk("Amateurs train on this map. Adepts train on the next. Professionals train on the last, where the boss will be awaiting.");
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/2141001.js b/scripts/npc/2141001.js
index 5038397643..210faf5fa7 100644
--- a/scripts/npc/2141001.js
+++ b/scripts/npc/2141001.js
@@ -1,216 +1,180 @@
/*
- NPC Name: The Forgotten Temple Manager
- Map(s): Deep in the Shrine - Forgotten Twilight
- Description: Pink Bean battle starter
+ 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 .
*/
-var status = -1;
+/* The Forgotten Temple Manager
+ *
+ * Deep Place of Temple - Forgotten Twilight (270050000)
+ * Vs Pink Bean Recruiter NPC
+ *
+ * @author Ronan
+ */
+importPackage(Packages.server.expeditions);
+importPackage(Packages.tools);
+importPackage(Packages.scripting.event);
+
+var status = 0;
+var expedition;
+var player;
+var em;
+var exped = MapleExpeditionType.PINKBEAN;
+var expedName = "Twilight of the Gods";
+var expedBoss = "Pink Bean";
+var expedMap = "Twilight of Gods";
+
+var list = "What would you like to do?#b\r\n\r\n#L1#View current Expedition members#l\r\n#L2#Start the fight!#l\r\n#L3#Stop the expedition.#l";
function start() {
- if (cm.getPlayer().getLevel() < 120) {
- cm.sendOk("There is a level requirement of 120 to attempt Pink Bean.");
- cm.dispose();
- return;
- }
- if (cm.getPlayer().getClient().getChannel() != 5) {
- cm.sendOk("Pink Bean may only be attempted on channel 5.");
- cm.dispose();
- return;
- }
- var em = cm.getEventManager("PinkBeanBattle");
-
- if (em == null) {
- cm.sendOk("The event isn't started, please contact a GM.");
- cm.dispose();
- return;
- }
- var eim_status = em.getProperty("state");
- var marr = cm.getQuestRecord(160104);
- var data = marr.getCustomData();
- if (data == null) {
- marr.setCustomData("0");
- data = "0";
- }
- var time = parseInt(data);
- if (eim_status == null || eim_status.equals("0")) {
-
- var squadAvailability = cm.getSquadAvailability("PinkBean");
- if (squadAvailability == -1) {
- status = 0;
- if (time + (12 * 3600000) >= cm.getCurrentTime() && !cm.getPlayer().isGM()) {
- cm.sendOk("You have already went to PinkBean in the past 12 hours. Time left: " + cm.getReadableMillis(cm.getCurrentTime(), time + (12 * 3600000)));
- cm.dispose();
- return;
- }
- cm.sendYesNo("Are you interested in becoming the leader of the expedition Squad?");
-
- } else if (squadAvailability == 1) {
- if (time + (12 * 3600000) >= cm.getCurrentTime() && !cm.getPlayer().isGM()) {
- cm.sendOk("You have already went to PinkBean in the past 12 hours. Time left: " + cm.getReadableMillis(cm.getCurrentTime(), time + (12 * 3600000)));
- cm.dispose();
- return;
- }
- // -1 = Cancelled, 0 = not, 1 = true
- var type = cm.isSquadLeader("PinkBean");
- if (type == -1) {
- cm.sendOk("The squad has ended, please re-register.");
- cm.dispose();
- } else if (type == 0) {
- var memberType = cm.isSquadMember("PinkBean");
- if (memberType == 2) {
- cm.sendOk("You been banned from the squad.");
- cm.dispose();
- } else if (memberType == 1) {
- status = 5;
- cm.sendSimple("What would you like to do? \r\n#b#L0#Join the squad to Twilight of the Gods#l \r\n#b#L1#Leave the squad to Twilight of the Gods#l \r\n#b#L2#See the list of members on the squad#l");
- } else if (memberType == -1) {
- cm.sendOk("The squad has ended, please re-register.");
- cm.dispose();
- } else {
- status = 5;
- cm.sendSimple("What would you like to do? \r\n#b#L0#Join the squad to Twilight of the Gods#l \r\n#b#L1#Leave the squad to Twilight of the Gods#l \r\n#b#L2#See the list of members on the squad#l");
- }
- } else { // Is leader
- status = 10;
- cm.sendSimple("What do you want to do, expedition leader? \r\n#b#L0#View expedition list#l \r\n#b#L1#Kick from expedition#l \r\n#b#L2#Remove user from ban list#l \r\n#r#L3#Select expedition team and enter#l");
- // TODO viewing!
- }
- } else {
- var eim = cm.getDisconnected("PinkBeanBattle");
- if (eim == null) {
- var squd = cm.getSquad("PinkBean");
- if (squd != null) {
- if (time + (12 * 3600000) >= cm.getCurrentTime() && !cm.getPlayer().isGM()) {
- cm.sendOk("You have already went to PinkBean in the past 12 hours. Time left: " + cm.getReadableMillis(cm.getCurrentTime(), time + (12 * 3600000)));
- cm.dispose();
- return;
- }
- cm.sendYesNo("The squad's battle against the boss has already begun.\r\n" + squd.getNextPlayer());
- status = 3;
- } else {
- cm.sendOk("The squad's battle against the boss has already begun.");
- cm.safeDispose();
- }
- } else {
- cm.sendYesNo("Ah, you have returned. Would you like to join your squad in the fight again?");
- status = 2;
- }
- }
- } else {
- var eim = cm.getDisconnected("PinkBeanBattle");
- if (eim == null) {
- var squd = cm.getSquad("PinkBean");
- if (squd != null) {
- if (time + (12 * 3600000) >= cm.getCurrentTime() && !cm.getPlayer().isGM()) {
- cm.sendOk("You have already went to PinkBean in the past 12 hours. Time left: " + cm.getReadableMillis(cm.getCurrentTime(), time + (12 * 3600000)));
- cm.dispose();
- return;
- }
- cm.sendYesNo("The squad's battle against the boss has already begun.\r\n" + squd.getNextPlayer());
- status = 3;
- } else {
- cm.sendOk("The squad's battle against the boss has already begun.");
- cm.safeDispose();
- }
- } else {
- cm.sendYesNo("Ah, you have returned. Would you like to join your squad in the fight again?");
- status = 2;
- }
- }
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- switch (status) {
- case 0:
- if (mode == 1) {
- if (cm.registerSquad("PinkBean", 5, " has been named the Leader of the squad. If you would you like to join please register for the Expedition Squad within the time period.")) {
- cm.sendOk("You have been named the Leader of the Squad. For the next 5 minutes, you can add the members of the Expedition Squad.");
- } else {
- cm.sendOk("An error has occurred adding your squad.");
- }
- }
- cm.dispose();
- break;
- case 2:
- if (!cm.reAdd("PinkBeanBattle", "PinkBean")) {
- cm.sendOk("Error... please try again.");
- }
- cm.safeDispose();
- break;
- case 3:
- if (mode == 1) {
- var squd = cm.getSquad("PinkBean");
- if (squd != null && !squd.getAllNextPlayer().contains(cm.getPlayer().getName())) {
- squd.setNextPlayer(cm.getPlayer().getName());
- cm.sendOk("You have reserved the spot.");
- }
- }
- cm.dispose();
- break;
- case 5:
- if (selection == 0) { // join
- var ba = cm.addMember("PinkBean", true);
- if (ba == 2) {
- cm.sendOk("The squad is currently full, please try again later.");
- } else if (ba == 1) {
- cm.sendOk("You have joined the squad successfully");
- } else {
- cm.sendOk("You are already part of the squad.");
- }
- } else if (selection == 1) {// withdraw
- var baa = cm.addMember("PinkBean", false);
- if (baa == 1) {
- cm.sendOk("You have withdrawed from the squad successfully");
- } else {
- cm.sendOk("You are not part of the squad.");
- }
- } else if (selection == 2) {
- if (!cm.getSquadList("PinkBean", 0)) {
- cm.sendOk("Due to an unknown error, the request for squad has been denied.");
- }
- }
- cm.dispose();
- break;
- case 10:
- if (mode == 1) {
- if (selection == 0) {
- if (!cm.getSquadList("PinkBean", 0)) {
- cm.sendOk("Due to an unknown error, the request for squad has been denied.");
- }
- cm.dispose();
- } else if (selection == 1) {
- status = 11;
- if (!cm.getSquadList("PinkBean", 1)) {
- cm.sendOk("Due to an unknown error, the request for squad has been denied.");
- cm.dispose();
- }
- } else if (selection == 2) {
- status = 12;
- if (!cm.getSquadList("PinkBean", 2)) {
- cm.sendOk("Due to an unknown error, the request for squad has been denied.");
- cm.dispose();
- }
- } else if (selection == 3) { // get inside
- if (cm.getSquad("PinkBean") != null) {
- var dd = cm.getEventManager("PinkBeanBattle");
- dd.startInstance(cm.getSquad("PinkBean"), cm.getMap(), 160104);
- } else {
- cm.sendOk("Due to an unknown error, the request for squad has been denied.");
- }
- cm.dispose();
- }
- } else {
- cm.dispose();
- }
- break;
- case 11:
- cm.banMember("PinkBean", selection);
- cm.dispose();
- break;
- case 12:
- if (selection != -1) {
- cm.acceptMember("PinkBean", selection);
- }
- cm.dispose();
- break;
+
+ player = cm.getPlayer();
+ expedition = cm.getExpedition(exped);
+ em = cm.getEventManager("PinkBeanBattle");
+
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0) {
+ cm.dispose();
+ return;
+ }
+
+ if (status == 0) {
+ if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
+ cm.dispose();
+ } else if (expedition == null) { //Start an expedition
+ cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
+ status = 1;
+ } else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
+ cm.sendSimple(list);
+ status = 2;
+ } else if (expedition.isRegistering()) { //If the expedition is registering
+ if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
+ cm.sendOk("You have already registered for the expedition. Please wait for #r" + expedition.getLeader().getName() + "#k to begin the expedition.");
+ cm.dispose();
+ } else { //If you aren't in it, you're going to get added
+ cm.sendOk(expedition.addMember(cm.getPlayer()));
+ cm.dispose();
+ }
+ } else if (expedition.isInProgress()) { //Only if the expedition is in progress
+ if (expedition.contains(player)) { //If you're registered, warp you in
+ var eim = em.getInstance(expedName + player.getClient().getChannel());
+ if(eim.getIntProperty("canJoin") == 1) {
+ eim.registerPlayer(player);
+ } else {
+ cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls.");
+ }
+
+ cm.dispose();
+ } else { //If you're not in by now, tough luck
+ cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
+ cm.dispose();
+ }
+ }
+ } else if (status == 1) {
+ if (selection == 1) {
+ expedition = cm.getExpedition(exped);
+ if(expedition != null) {
+ cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!");
+ cm.dispose();
+ return;
+ }
+
+ cm.createExpedition(exped);
+ cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
+ cm.dispose();
+ return;
+ } else if (selection == 2) {
+ cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + ".");
+ cm.dispose();
+ return;
+ }
+ } else if (status == 2) {
+ if (selection == 1) {
+ if (expedition == null) {
+ cm.sendOk("The expedition could not be loaded.");
+ cm.dispose();
+ return;
+ }
+ var size = expedition.getMembers().size();
+ if (size == 1) {
+ cm.sendOk("You are the only member of the expedition.");
+ cm.dispose();
+ return;
+ }
+ var text = "The following members make up your expedition (Click on them to expel them):\r\n";
+ text += "\r\n\t\t1." + expedition.getLeader().getName();
+ for (var i = 1; i < size; i++) {
+ text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
+ }
+ cm.sendSimple(text);
+ status = 6;
+ } else if (selection == 2) {
+ var min = exped.getMinSize();
+
+ var size = expedition.getMembers().size();
+ if (size < min) {
+ cm.sendOk("You need at least " + min + " players registered in your expedition.");
+ cm.dispose();
+ return;
+ }
+
+ cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
+ status = 4;
+ } else if (selection == 3) {
+ player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
+ cm.endExpedition(expedition);
+ cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
+ cm.dispose();
+ return;
+ }
+ } else if (status == 4) {
+ if (em == null) {
+ cm.sendOk("The event could not be initialized, please report this on the forum.");
+ cm.dispose();
+ return;
+ }
+
+ em.setProperty("leader", player.getName());
+ em.setProperty("channel", player.getClient().getChannel());
+ if(!em.startInstance(expedition)) {
+ cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
+ cm.dispose();
+ return;
+ }
+
+ cm.dispose();
+ return;
+ } else if (status == 6) {
+ if (selection > 0) {
+ var banned = expedition.getMembers().get(selection - 1);
+ expedition.ban(banned);
+ cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
+ cm.dispose();
+ } else {
+ cm.sendSimple(list);
+ status = 2;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/scripts/npc/2141002.js b/scripts/npc/2141002.js
index 48bc242e36..6bb9fcc3d6 100644
--- a/scripts/npc/2141002.js
+++ b/scripts/npc/2141002.js
@@ -4,13 +4,50 @@
Description: Pink Bean
*/
+var status;
+
function start() {
- cm.sendYesNo("Do you want to get out now?");
+ status = -1;
+ action(1, 0, 0);
}
function action(mode, type, selection) {
- if (mode == 1) {
- cm.warp(270050000, 0);
+ if (mode == -1)
+ cm.dispose();
+ else {
+ if (mode == 0) {
+ cm.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ var eim = cm.getEventInstance();
+ if(!eim.isEventCleared()) {
+ if (status == 0) {
+ cm.sendYesNo("Do you want to get out now?");
+ }
+ else if (status == 1) {
+ cm.warp(270050000, 0);
+ cm.dispose();
+ }
+
+ } else {
+ if (status == 0) {
+ cm.sendYesNo("Pink Bean has been defeated! You guys sure are true heroes of this land! In no time, Temple of Time will shine again as bright as ever, all thanks to your efforts! Hooray to our heroes!! Are you ready to go now?");
+ }
+ else if (status == 1) {
+ if(eim.giveEventReward(cm.getPlayer(), 1)) {
+ cm.warp(270050000);
+ }
+ else {
+ cm.sendOk("You cannot receive an event prize without having an empty room in your EQUIP, USE, SET-UP or ETC inventory.");
+ }
+
+ cm.dispose();
+ }
+ }
}
- cm.dispose();
}
\ No newline at end of file
diff --git a/scripts/npc/9000037.js b/scripts/npc/9000037.js
index 8ca5cc7821..b0e26cb84c 100644
--- a/scripts/npc/9000037.js
+++ b/scripts/npc/9000037.js
@@ -126,7 +126,7 @@ function action(mode, type, selection) {
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.isEventLeader()) {
+ } else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
diff --git a/scripts/npc/9010022.js b/scripts/npc/9010022.js
index 08ae2c97e9..ea4f8fdb8b 100644
--- a/scripts/npc/9010022.js
+++ b/scripts/npc/9010022.js
@@ -59,7 +59,7 @@ function action(mode, type, selection) {
cm.warp(980010000, 3);
break;
case 1:
- cm.warp(925020000);
+ cm.warp(925020000, 0);
break;
case 2:
cm.warp(980000000, 3);
diff --git a/scripts/npc/9020000.js b/scripts/npc/9020000.js
index ca6204f1a1..b60eee316e 100644
--- a/scripts/npc/9020000.js
+++ b/scripts/npc/9020000.js
@@ -51,7 +51,7 @@ function action(mode, type, selection) {
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.isEventLeader()) {
+ } else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
diff --git a/scripts/npc/9110002.js b/scripts/npc/9110002.js
new file mode 100644
index 0000000000..55f90f51b6
--- /dev/null
+++ b/scripts/npc/9110002.js
@@ -0,0 +1,63 @@
+/*
+ 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 .
+*/
+
+/**
+-- Odin JavaScript --------------------------------------------------------------------------------
+ Kino Konoko - Zipangu - Mushroom Shrine(800000000)
+-- By ---------------------------------------------------------------------------------------------
+ Ronan
+-- Version Info -----------------------------------------------------------------------------------
+ 1.0 - First Version by Ronan
+---------------------------------------------------------------------------------------------------
+**/
+
+var status;
+
+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(status == 0) {
+ if(cm.isQuestCompleted(8074)) {
+ cm.openNpc(9110002);
+ } else {
+ cm.sendOk("Musssshhhhroooom Shrine~~~");
+ }
+
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/9120201.js b/scripts/npc/9120201.js
index a4863d8156..09e41bf0db 100644
--- a/scripts/npc/9120201.js
+++ b/scripts/npc/9120201.js
@@ -1,15 +1,14 @@
/*
This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy
- Matthias Butz
- Jan Christian Meyer
+ 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.
+ 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
@@ -19,13 +18,167 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
-/* Konpei (9120201)
-* Bain Armory Version
-*/
+/*Konpei
+ *
+ *@author Ronan
+ */
+importPackage(Packages.server.expeditions);
+importPackage(Packages.tools);
+importPackage(Packages.scripting.event);
+
+var status = 0;
+var expedition;
+var player;
+var em;
+var exped = MapleExpeditionType.SHOWA;
+var expedName = "Showa Gang";
+var expedBoss = "The Boss";
+var expedMap = "Nightmarish Last Days";
+var expedItem = 4000138;
+
+var list = "What would you like to do?#b\r\n\r\n#L1#View current Expedition members#l\r\n#L2#Start the fight!#l\r\n#L3#Stop the expedition.#l";
function start() {
- if (cm.getPlayerCount(801040100) == 0)
- cm.resetMap(801040100);
- cm.warp(801040100);
- cm.dispose();
-}
+ action(1, 0, 0);
+}
+
+function action(mode, type, selection) {
+
+ player = cm.getPlayer();
+ expedition = cm.getExpedition(exped);
+ em = cm.getEventManager("ShowaBattle");
+
+ if (mode == -1) {
+ cm.dispose();
+ } else {
+ if (mode == 0) {
+ cm.dispose();
+ return;
+ }
+
+ if (status == 0) {
+ if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
+ cm.dispose();
+ } else if (expedition == null) { //Start an expedition
+ cm.sendSimple("#e#b\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
+ status = 1;
+ } else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
+ cm.sendSimple(list);
+ status = 2;
+ } else if (expedition.isRegistering()) { //If the expedition is registering
+ if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
+ cm.sendOk("You have already registered for the expedition. Please wait for #r" + expedition.getLeader().getName() + "#k to begin the expedition.");
+ cm.dispose();
+ } else { //If you aren't in it, you're going to get added
+ cm.sendOk(expedition.addMember(cm.getPlayer()));
+ cm.dispose();
+ }
+ } else if (expedition.isInProgress()) { //Only if the expedition is in progress
+ if (expedition.contains(player)) { //If you're registered, warp you in
+ var eim = em.getInstance(expedName + player.getClient().getChannel());
+ if(eim.getIntProperty("canJoin") == 1) {
+ eim.registerPlayer(player);
+ } else {
+ cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls.");
+ }
+
+ cm.dispose();
+ } else { //If you're not in by now, tough luck
+ cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
+ cm.dispose();
+ }
+ }
+ } else if (status == 1) {
+ if (selection == 1) {
+ if (!cm.haveItem(expedItem)) {
+ cm.sendOk("As the expedition leader, you must have on your inventory a #b#t" + expedItem + "##k to battle " + expedBoss + "!");
+ cm.dispose();
+ return;
+ }
+
+ expedition = cm.getExpedition(exped);
+ if(expedition != null) {
+ cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!");
+ cm.dispose();
+ return;
+ }
+
+ cm.createExpedition(exped);
+ cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
+ cm.dispose();
+ return;
+ } else if (selection == 2) {
+ cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + ".");
+ cm.dispose();
+ return;
+ }
+ } else if (status == 2) {
+ if (selection == 1) {
+ if (expedition == null) {
+ cm.sendOk("The expedition could not be loaded.");
+ cm.dispose();
+ return;
+ }
+ var size = expedition.getMembers().size();
+ if (size == 1) {
+ cm.sendOk("You are the only member of the expedition.");
+ cm.dispose();
+ return;
+ }
+ var text = "The following members make up your expedition (Click on them to expel them):\r\n";
+ text += "\r\n\t\t1." + expedition.getLeader().getName();
+ for (var i = 1; i < size; i++) {
+ text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
+ }
+ cm.sendSimple(text);
+ status = 6;
+ } else if (selection == 2) {
+ var min = exped.getMinSize();
+
+ var size = expedition.getMembers().size();
+ if (size < min) {
+ cm.sendOk("You need at least " + min + " players registered in your expedition.");
+ cm.dispose();
+ return;
+ }
+
+ cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
+ status = 4;
+ } else if (selection == 3) {
+ player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
+ cm.endExpedition(expedition);
+ cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
+ cm.dispose();
+ return;
+ }
+ } else if (status == 4) {
+ if (em == null) {
+ cm.sendOk("The event could not be initialized, please report this on the forum.");
+ cm.dispose();
+ return;
+ }
+
+ em.setProperty("leader", player.getName());
+ em.setProperty("channel", player.getClient().getChannel());
+ if(!em.startInstance(expedition)) {
+ cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
+ cm.dispose();
+ return;
+ }
+
+ cm.dispose();
+ return;
+ } else if (status == 6) {
+ if (selection > 0) {
+ var banned = expedition.getMembers().get(selection - 1);
+ expedition.ban(banned);
+ cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
+ cm.dispose();
+ } else {
+ cm.sendSimple(list);
+ status = 2;
+ }
+ }
+ }
+}
diff --git a/scripts/npc/9120202.js b/scripts/npc/9120202.js
index 92e3518ec8..0135fc7197 100644
--- a/scripts/npc/9120202.js
+++ b/scripts/npc/9120202.js
@@ -19,7 +19,54 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
+/* Konpei
+ *
+ * @Author Ronan
+ */
+
+var status;
+
function start() {
- cm.warp(801040004, 0);
- cm.dispose();
+ 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--;
+
+ var eim = cm.getEventInstance();
+ if(!eim.isEventCleared()) {
+ if (status == 0) {
+ cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?");
+ } else if (status == 1) {
+ cm.warp(801040004, 1);
+ cm.dispose();
+ }
+ } else {
+ if(status == 0) {
+ cm.sendNext("You guys did it, great job! Now our city is free from the tyranny of their mobs! As representative of the city, please accept this as a prize for your efforts, as I get you back to town.");
+ }
+
+ if(status == 1) {
+ var eim = cm.getEventInstance();
+ if(!eim.giveEventReward(cm.getPlayer())) {
+ cm.sendNext("Please make room on your inventory first...");
+ } else {
+ cm.warp(801040101);
+ }
+
+ cm.dispose();
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/scripts/npc/9120203.js b/scripts/npc/9120203.js
new file mode 100644
index 0000000000..69c77ad353
--- /dev/null
+++ b/scripts/npc/9120203.js
@@ -0,0 +1,60 @@
+/*
+ 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 .
+*/
+
+/**
+-- Odin JavaScript --------------------------------------------------------------------------------
+ Konpei - Near the Hideout (Beautiful Sky)(801040101)
+-- By ---------------------------------------------------------------------------------------------
+ Ronan
+-- Version Info -----------------------------------------------------------------------------------
+ 1.0 - First Version by Ronan
+---------------------------------------------------------------------------------------------------
+**/
+
+var status;
+
+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 (status == 0) {
+ cm.sendNext("Ah, The Boss has been defeated. What a happy day this turns out to be! Congratulations, everyone. Follow this way back to town.");
+ } else if (status == 1) {
+ cm.warp(801000000);
+ cm.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/9201097.js b/scripts/npc/9201097.js
index 40d205aef9..0f3929af13 100644
--- a/scripts/npc/9201097.js
+++ b/scripts/npc/9201097.js
@@ -21,6 +21,7 @@ eQuestPrizes[0] = new Array ([1002801,1], // Raven Ninja Bandana
[1472031,1], // Black Mamba
[2044701,1], // Claw for ATT 60%
[2044501,1], // Bow for ATT 60%
+ [3010041,1], // Skull Throne
[0, 750000]); // Mesos
eQuestPrizes[1] = new Array ([1332077,1], // Raven's Beak
@@ -31,6 +32,7 @@ eQuestPrizes[1] = new Array ([1332077,1], // Raven's Beak
[2043201,1], // One Handed BW for Att 60%
[2044401,1], // Polearm for Att 60%
[2044301,1], // Spear for Att 60%
+ [3010041,1], // Skull Throne
[0,1250000]); // Mesos
eQuestPrizes[2] = new Array ([1472072,1], //Raven's Claw
@@ -42,6 +44,7 @@ eQuestPrizes[2] = new Array ([1472072,1], //Raven's Claw
[2043023,1], // One-Handed Sword for Att 100%[2]
[2043101,1], // One-Handed Axe for Att 60%
[2043301,1], // Dagger for Att 60%
+ [3010040,1], // The Stirge Seat
[0,2500000]); // Mesos
eQuestPrizes[3] = new Array ([1002801,1], //Raven Ninja Bandana
@@ -51,6 +54,7 @@ eQuestPrizes[3] = new Array ([1002801,1], //Raven Ninja Bandana
[4032015,1], // Tao of Shadows
[2043701,1], // Wand for Magic Att 60%
[2043801,1], // Staff for Magic Att 60%
+ [3010040,1], // The Stirge Seat
[0,1750000]); // Mesos
eQuestPrizes[4] = new Array ([0,3500000]); // Mesos
@@ -96,7 +100,7 @@ function action(mode, type, selection) {
requiredItem = eQuestChoices[selection];
if(selection < 4) qnt = 50;
- else qnt=25;
+ else qnt = 25;
cm.sendYesNo("Let's see, you want to trade your #b" + qnt + " #t" + requiredItem + "##k with my stuff, right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?");
}else if (status == 4){
diff --git a/scripts/npc/9201134.js b/scripts/npc/9201134.js
index a6ae74e252..d1ff985863 100644
--- a/scripts/npc/9201134.js
+++ b/scripts/npc/9201134.js
@@ -44,11 +44,26 @@ function action(mode, type, selection) {
else
status--;
- if (status == 0) {
- cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?");
- } else if (status == 1) {
- cm.warp(551030100, 2);
- cm.dispose();
+ var eim = cm.getEventInstance();
+ if(!eim.isEventCleared()) {
+ if (status == 0) {
+ cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?");
+ } else if (status == 1) {
+ cm.warp(551030100, 2);
+ cm.dispose();
+ }
+ } else {
+ if (status == 0) {
+ cm.sendNext("You guys defeated both Scarlion and Targa! Wonderful! Take this memento as a prize for your bravery.");
+ } else if (status == 1) {
+ if(!eim.giveEventReward(cm.getPlayer())) {
+ cm.sendNext("Please make room on your inventory first!");
+ } else {
+ cm.warp(551030100, 2);
+ }
+
+ cm.dispose();
+ }
}
}
}
\ No newline at end of file
diff --git a/scripts/npc/9201143.js b/scripts/npc/9201143.js
index e0944456e0..0258f48c65 100644
--- a/scripts/npc/9201143.js
+++ b/scripts/npc/9201143.js
@@ -1,11 +1,249 @@
-/* @Author SharpAceX
- Name: Steward
- Map(s): Foyer
- Info: Steward
- NPC ID: 9201143.js
-*/
+/* @Author SharpAceX / Ronan
+ Name: Steward
+ Map(s): Foyer
+ Info: Steward / Commands
+ NPC ID: 9201143.js
+*/
-function start() {
- cm.sendNext("At your service, my friend.");
- cm.dispose();
-}
\ No newline at end of file
+var status;
+
+var comm_lv6 = [];
+var desc_lv6 = [];
+
+var comm_lv5 = [];
+var desc_lv5 = [];
+
+var comm_lv4 = [];
+var desc_lv4 = [];
+
+var comm_lv3 = [];
+var desc_lv3 = [];
+
+var comm_lv2 = [];
+var desc_lv2 = [];
+
+var comm_lv1 = [];
+var desc_lv1 = [];
+
+var levels = ["Common", "Donator", "JrGM", "GM", "SuperGM", "Developer", "Admin"];
+
+var comm_cursor, desc_cursor;
+
+function addCommand(comm, desc) {
+ comm_cursor.add(comm);
+ desc_cursor.add(desc);
+}
+
+function writeSolaxiaCommandsLv6() { //Admin
+ comm_cursor = comm_lv6;
+ desc_cursor = desc_lv6;
+
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+}
+
+function writeSolaxiaCommandsLv5() { //Developer
+ comm_cursor = comm_lv5;
+ desc_cursor = desc_lv5;
+
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+}
+
+function writeSolaxiaCommandsLv4() { //SuperGM
+ comm_cursor = comm_lv4;
+ desc_cursor = desc_lv4;
+
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+}
+
+function writeSolaxiaCommandsLv3() { //GM
+ comm_cursor = comm_lv3;
+ desc_cursor = desc_lv3;
+
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+ addCommand("", "");
+}
+
+function writeSolaxiaCommandsLv2() { //JrGM
+ comm_cursor = comm_lv2;
+ desc_cursor = desc_lv2;
+
+ addCommand("hide", "");
+ addCommand("unhide", "");
+ addCommand("sp", "");
+ addCommand("ap", "");
+ addCommand("empowerme", "");
+ addCommand("buffmap", "");
+ addCommand("buff", "");
+ addCommand("bomb", "");
+ addCommand("dc", "");
+ addCommand("cleardrops", "");
+ addCommand("clearslot", "");
+ addCommand("warp", "");
+ addCommand("warpto", "");
+ addCommand("summon", "");
+ addCommand("gmshop", "");
+ addCommand("heal", "");
+ addCommand("item", "");
+ addCommand("level", "");
+ addCommand("levelpro", "");
+ addCommand("setstat", "");
+ addCommand("maxstat", "");
+ addCommand("maxskill", "");
+ addCommand("mesos", "");
+ addCommand("search", "");
+ addCommand("jail", "");
+ addCommand("unjail", "");
+ addCommand("unbug", "");
+}
+
+function writeSolaxiaCommandsLv1() { //Donator
+ comm_cursor = comm_lv1;
+ desc_cursor = desc_lv1;
+
+ addCommand("buffme", "");
+ addCommand("goto", "");
+ addCommand("recharge", "");
+ addCommand("whereami", "");
+}
+
+function writeSolaxiaCommandsLv0() { //Common
+ comm_cursor = comm_lv0;
+ desc_cursor = desc_lv0;
+
+ addCommand("commands", "");
+ addCommand("time", "");
+ addCommand("staff", "");
+ addCommand("uptime", "");
+ addCommand("gacha", "");
+ addCommand("whatdropsfrom", "");
+ addCommand("whodrops", "");
+ addCommand("dispose", "");
+ addCommand("equiplv", "");
+ addCommand("rates", "");
+ addCommand("online", "");
+ addCommand("gm", "");
+ addCommand("bug", "");
+ addCommand("joinevent", "");
+ addCommand("leaveevent", "");
+ addCommand("bosshp", "");
+ addCommand("ranks", "");
+
+
+}
+
+function writeSolaxiaCommands() {
+ writeSolaxiaCommandsLv0(); //Common
+ writeSolaxiaCommandsLv1(); //Donator
+ writeSolaxiaCommandsLv2(); //JrGM
+ writeSolaxiaCommandsLv3(); //GM
+ writeSolaxiaCommandsLv4(); //Developer
+ writeSolaxiaCommandsLv5(); //SuperGM
+ writeSolaxiaCommandsLv6(); //Admin
+}
+
+function start() {
+ if(cm.getPlayer.getCS()) {
+ writeSolaxiaCommands();
+ action(1, 0, 0);
+ } else {
+ cm.sendNext("At your service, my friend.");
+ cm.dispose();
+ }
+}
+
+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 (status == 0) {
+ var sendStr = "There are all available commands for you:\r\n\r\n#b";
+ for(var i = 0; i < cm.getGmLevel(); i++) {
+ sendStr += "#L" + i + "#" + levels[i] + "#l\r\n";
+ }
+
+ cm.sendSimple(sendStr);
+ } else if(status == 1) {
+ var lvComm, lvDesc;
+
+ if(selection == 0) {
+ lvComm = comm_lv1;
+ lvDesc = desc_lv1;
+ } else if(selection == 1) {
+ lvComm = comm_lv2;
+ lvDesc = desc_lv2;
+ } else if(selection == 2) {
+ lvComm = comm_lv3;
+ lvDesc = desc_lv3;
+ } else if(selection == 3) {
+ lvComm = comm_lv4;
+ lvDesc = desc_lv4;
+ } else if(selection == 4) {
+ lvComm = comm_lv5;
+ lvDesc = desc_lv5;
+ } else {
+ lvComm = comm_lv6;
+ lvDesc = desc_lv6;
+ }
+
+ var sendStr = "The following commands are available for #b" + levels[selection] + "#k:\r\n\r\n";
+ for(var i = 0; i < lvComm.length; i++) {
+ sendStr += " #L" + i + "# " + lvComm[i] + " - " + lvDesc[i];
+ sendStr += "#l\r\n";
+ }
+
+ cm.sendPrev(sendStr);
+ }
+ }
+}
diff --git a/scripts/npc/9220004.js b/scripts/npc/9220004.js
index 95821dd009..f53a81360d 100644
--- a/scripts/npc/9220004.js
+++ b/scripts/npc/9220004.js
@@ -4,13 +4,7 @@ By Ronan
**/
var status = -1;
function start() {
- if(cm.getMap().getMonsters().size() > 1) { //reactor as a monster? wtf
- cm.sendOk("Defeat all monsters before talking to me.");
- cm.dispose();
- return;
- }
-
- action(1, 0, 0);
+ action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
@@ -26,11 +20,23 @@ function action(mode, type, selection) {
status--;
if (status == 0) {
- cm.sendSimple("#b#k\r\nA raid is nothing but joining many people in an attempt to defeat extremely powerful creatures. Here is no different. Here, everyone can take part in defeating the spawned creature. At the moment the are none, what will you do?\r\n#b\r\n#L0#Spawn Kid Snowman.\r\n#L1#Spawn Lost Rudolph.\r\n#L2#Nothing, just chilling.#k");
+ cm.sendSimple("#b#k\r\nA raid is nothing but many people joining up in an attempt to defeat extremely powerful creatures. Here is no different. Here, everyone can take part in defeating the spawned creature. What will you do?\r\n#b\r\n#L0#Spawn Kid Snowman.\r\n#L1#Spawn Lost Rudolph.\r\n#L2#Nothing, just chilling.#k");
} else if(status == 1) {
if(selection == 0) {
+ if(cm.getMap().getMonsters().size() > 1) { //reactor as a monster? wtf
+ cm.sendOk("Eliminate all mobs in the area to call Kid Snowman.");
+ cm.dispose();
+ return;
+ }
+
cm.getMap().spawnMonsterOnGroundBelow(9500317, 1700, 80);
} else if(selection == 1) {
+ if(cm.getMap().getMonsters().size() > 6) { //reactor as a monster? wtf
+ cm.sendOk("The place is too crowded right now. Eliminate some mobs before trying again.");
+ cm.dispose();
+ return;
+ }
+
cm.getMap().spawnMonsterOnGroundBelow(9500320, 1700, 80);
} else {
cm.sendOk("Fine then.");
diff --git a/scripts/portal/PPinkOut.js b/scripts/portal/PPinkOut.js
new file mode 100644
index 0000000000..aa4a80a505
--- /dev/null
+++ b/scripts/portal/PPinkOut.js
@@ -0,0 +1,30 @@
+/*
+ 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 .
+*/
+
+/*
+Vs Pink Bean - Clear stage portal
+@author Ronan
+*/
+
+function enter(pi) {
+ pi.warp(270050000);
+ return true;
+}
\ No newline at end of file
diff --git a/scripts/portal/Pinkin.js b/scripts/portal/Pinkin.js
new file mode 100644
index 0000000000..d0903ce2b5
--- /dev/null
+++ b/scripts/portal/Pinkin.js
@@ -0,0 +1,30 @@
+/*
+ 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 .
+*/
+
+/*
+Vs Pink Bean - Ressurection stage portal
+@author Ronan
+*/
+
+function enter(pi) {
+ pi.warp(270050100);
+ return true;
+}
\ No newline at end of file
diff --git a/scripts/portal/Zakum03.js b/scripts/portal/Zakum03.js
new file mode 100644
index 0000000000..06e377c765
--- /dev/null
+++ b/scripts/portal/Zakum03.js
@@ -0,0 +1,39 @@
+/*
+ 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 .
+*/
+/*
+ Zakum PQ portal
+*/
+
+function enter(pi) {
+ if (!pi.getEventInstance().isEventCleared()) {
+ pi.getPlayer().dropMessage(5,"Your team has not yet completed the trials. Fetch the Fire Ore and give it to Aura first.");
+ return false;
+ }
+
+ if (pi.getEventInstance().gridCheck(pi.getPlayer()) == -1) {
+ pi.getPlayer().dropMessage(5,"Your have yet to claim your prize. Talk to Aura.");
+ return false;
+ }
+
+ pi.warp(211042300);
+ return true;
+}
\ No newline at end of file
diff --git a/scripts/portal/Zakum05.js b/scripts/portal/Zakum05.js
index cf43e34f71..5fc6b8f106 100644
--- a/scripts/portal/Zakum05.js
+++ b/scripts/portal/Zakum05.js
@@ -24,15 +24,16 @@
*/
function enter(pi) {
- if (!pi.haveItem(4001017)) {
- pi.getPlayer().dropMessage(6,"You do not have the Eye of Fire. You may not face the boss.");
+ if (!pi.isQuestStarted(100200)) {
+ pi.getPlayer().dropMessage(5,"You need approval from the masters to battle. You may not attempt the boss right now.");
return false;
- }
- //var exped = pi.getEventManager("ZakumBattle").getInstance("ZakumBattle_" + pi.getPlayer().getClient().getChannel());
- //if (exped != null) {
- // pi.getPlayer().dropMessage(6,"The battle at Zakum's Altar is currently underway.");
- // return false;
- //}
+ }
+
+ if (!pi.isQuestCompleted(100201)) {
+ pi.getPlayer().dropMessage(5,"You do not have completed all the trials yet. You may not attempt the boss right now.");
+ return false;
+ }
+
pi.warp(211042400,"west00");
return true;
}
\ No newline at end of file
diff --git a/scripts/portal/dojang_exit.js b/scripts/portal/dojang_exit.js
index 4a39b0e11e..5c58a3db64 100644
--- a/scripts/portal/dojang_exit.js
+++ b/scripts/portal/dojang_exit.js
@@ -20,15 +20,15 @@
along with this program. If not, see .
*/
/*
- * @author: kevintjuh93/moogra
+ * @author: kevintjuh93, moogra
* @portal: dojang_exit
* @purpose: warps user out
*/
function enter(pi) {
- var map = pi.getPlayer().getSavedLocation("MIRROR");
- if(map == -1)
- map = 100000000;
+ var map = pi.getPlayer().getSavedLocation("MIRROR");
+ if(map == -1) map = 100000000;
+
pi.warp(map);
return true;
}
\ No newline at end of file
diff --git a/scripts/portal/dojang_next.js b/scripts/portal/dojang_next.js
index 09dfab4091..47ab1df13a 100644
--- a/scripts/portal/dojang_next.js
+++ b/scripts/portal/dojang_next.js
@@ -20,16 +20,24 @@
along with this program. If not, see .
*/
/**
- * @Author Moogra
+ * @Author Moogra, Ronan
*/
function enter(pi) {
- if (pi.getPlayer().getMap().getReactorByName("door").getState() == 1) {
- if ((pi.getPlayer().getMapId() / 100) % 100 != 38) {
- if (pi.getPlayer().getMap().getCharacters().size() == 1) {
- pi.resetMap(pi.getPlayer().getMapId());
- }
+ var gate = pi.getPlayer().getMap().getReactorByName("door");
+
+ if ((gate != null && gate.getState() == 1) || pi.getMap().countMonsters() == 0) {
+ if (Math.floor(pi.getPlayer().getMapId() / 100) % 100 < 38) {
pi.getPlayer().message("You received " + pi.getPlayer().addDojoPointsByMap() + " training points. Your total training points score is now " + pi.getPlayer().getDojoPoints() + ".");
- pi.warp(pi.getPlayer().getMap().getId() + 100, 0);
+
+ if(((Math.floor((pi.getPlayer().getMap().getId() + 100) / 100)) % 100) % 6 == 0) {
+ if(Math.floor(pi.getPlayer().getMapId() / 10000) == 92503) {
+ pi.warpParty(pi.getPlayer().getMap().getId() + 100, 925030100, 925033804);
+ } else {
+ pi.warp(pi.getPlayer().getMap().getId() + 100, 0);
+ }
+ } else {
+ pi.warp(pi.getPlayer().getMap().getId() + 100, 0);
+ }
} else {
pi.warp(925020003, 0);
pi.getPlayer().gainExp(2000 * pi.getPlayer().getDojoPoints(), true, true, true);
diff --git a/scripts/portal/dojang_tuto.js b/scripts/portal/dojang_tuto.js
index f18a85401a..b28d114f18 100644
--- a/scripts/portal/dojang_tuto.js
+++ b/scripts/portal/dojang_tuto.js
@@ -28,9 +28,11 @@
function enter(pi) {
if (pi.getPlayer().getMap().getMonsterById(9300216) != null) {
pi.getPlayer().enteredScript("dojang_Msg", pi.getPlayer().getMap().getId());
+ pi.getPlayer().setFinishedDojoTutorial();
pi.warp(925020001, 0);
+ return true;
} else {
pi.getPlayer().message("So Gong: Haha! You're going to run away like a coward? I won't let you get away that easily!");
+ return false;
}
- return true;
}
\ No newline at end of file
diff --git a/scripts/portal/dojang_up.js b/scripts/portal/dojang_up.js
index 704e229086..776510f547 100644
--- a/scripts/portal/dojang_up.js
+++ b/scripts/portal/dojang_up.js
@@ -28,17 +28,17 @@
function enter(pi) {
try {
- if (pi.getPlayer().getMap().getMonsterById(9300216) != null) {
- pi.goDojoUp();
- pi.getPlayer().getMap().setReactorState();
- var stage = (pi.getPlayer().getMapId() / 100) % 100;
- if ((stage - (stage / 6) | 0) == pi.getPlayer().getVanquisherStage() && !pi.getPlayer().getDojoParty()) // we can also try 5 * stage / 6 | 0 + 1
- pi.getPlayer().setVanquisherKills(pi.getPlayer().getVanquisherKills() + 1);
- } else {
- pi.getPlayer().message("There are still some monsters remaining.");
- }
- pi.enableActions();
- return true;
+ if (pi.getPlayer().getMap().getMonsterById(9300216) != null) {
+ pi.goDojoUp();
+ pi.getPlayer().getMap().setReactorState();
+ var stage = Math.floor(pi.getPlayer().getMapId() / 100) % 100;
+ if ((stage - (stage / 6) | 0) == pi.getPlayer().getVanquisherStage() && !pi.getPlayer().getDojoParty()) // we can also try 5 * stage / 6 | 0 + 1
+ pi.getPlayer().setVanquisherKills(pi.getPlayer().getVanquisherKills() + 1);
+ } else {
+ pi.getPlayer().message("There are still some monsters remaining.");
+ }
+ pi.enableActions();
+ return true;
} catch(err) {
pi.getPlayer().dropMessage(err);
}
diff --git a/scripts/portal/hontale_morph2.js b/scripts/portal/hontale_morph2.js
index eee7a92738..447ab087f8 100644
--- a/scripts/portal/hontale_morph2.js
+++ b/scripts/portal/hontale_morph2.js
@@ -24,6 +24,6 @@ Leave the Cave of Life - Entrance Map and go back to the Peak of the Big Nest (2
*/
function enter(pi) {
- pi.warp(240040600, "st00");
+ pi.warp(240040600, 4);
return true;
}
diff --git a/scripts/portal/s4berserk.js b/scripts/portal/s4berserk.js
index 5b61db9cc2..30aad2558a 100644
--- a/scripts/portal/s4berserk.js
+++ b/scripts/portal/s4berserk.js
@@ -25,8 +25,15 @@
*/
function enter(pi) {
if(pi.isQuestStarted(6153)) {
- pi.warp(910500200, 0);
- return true;
+ if(pi.getWarpMap(910500200).countPlayers() == 0) {
+ pi.resetMapObjects(910500200);
+ pi.warp(910500200, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
} else {
pi.getPlayer().message("A mysterious force won't let you in.");
return false;
diff --git a/scripts/portal/s4berserk_move.js b/scripts/portal/s4berserk_move.js
index b3bed0629b..347f761d2c 100644
--- a/scripts/portal/s4berserk_move.js
+++ b/scripts/portal/s4berserk_move.js
@@ -20,7 +20,7 @@
along with this program. If not, see .
*/
function enter(pi) {
- if (pi.getPlayer().getEventInstance().getProperty("canWarp")) {
+ if (pi.getPlayer().getMap().countMonsters() == 0) {
pi.warp(910500200, "out01");
return true;
}
diff --git a/scripts/portal/s4firehawk.js b/scripts/portal/s4firehawk.js
index d0ee73cd38..e77061440b 100644
--- a/scripts/portal/s4firehawk.js
+++ b/scripts/portal/s4firehawk.js
@@ -25,8 +25,15 @@
*/
function enter(pi) {
if(pi.isQuestStarted(6240)) {
- pi.warp(921100200, 0);
- return true;
+ if(pi.getWarpMap(921100200).countPlayers() == 0) {
+ pi.resetMapObjects(921100200);
+ pi.warp(921100200, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
} else {
pi.getPlayer().message("A mysterious force won't let you in.");
return false;
diff --git a/scripts/portal/s4hitman.js b/scripts/portal/s4hitman.js
index 558c9d041b..164d1afda0 100644
--- a/scripts/portal/s4hitman.js
+++ b/scripts/portal/s4hitman.js
@@ -25,9 +25,17 @@
*/
function enter(pi) {
if(pi.isQuestStarted(6202)) {
- pi.getPlayer().getClient().getChannelServer().getMapFactory().getMap(910200000).resetReactors(); // Make sure they actually can do what they need...
- pi.warp(910200000, 0);
- return true;
+ if(pi.getWarpMap(910200000).countPlayers() == 0) {
+ pi.resetMapObjects(910200000);
+ pi.warp(910200000, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
}
+
+ pi.getPlayer().message("A mysterious force won't let you in.");
return false;
}
\ No newline at end of file
diff --git a/scripts/portal/s4iceeagle.js b/scripts/portal/s4iceeagle.js
index 6400c1f3a0..1fd1f06a0c 100644
--- a/scripts/portal/s4iceeagle.js
+++ b/scripts/portal/s4iceeagle.js
@@ -25,8 +25,15 @@
*/
function enter(pi) {
if(pi.isQuestStarted(6242)) {
- pi.warp(921100210, 0);
- return true;
+ if(pi.getWarpMap(921100210).countPlayers() == 0) {
+ pi.resetMapObjects(921100210);
+ pi.warp(921100210, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
} else {
pi.getPlayer().message("A mysterious force won't let you in.");
return false;
diff --git a/scripts/portal/s4nest.js b/scripts/portal/s4nest.js
index d3262f3e3e..3443a1c32d 100644
--- a/scripts/portal/s4nest.js
+++ b/scripts/portal/s4nest.js
@@ -24,6 +24,18 @@
* @purpose Warps to the Junior Balrog map for the Rush Skill.
*/
function enter(pi) {
- pi.warp(924000100, 0);
- return true;
+ if(pi.isQuestStarted(6241) || pi.isQuestStarted(6243)) {
+ if(pi.getWarpMap(924000100).countPlayers() == 0) {
+ pi.resetMapObjects(924000100);
+ pi.warp(924000100, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
+ }
+
+ pi.getPlayer().message("A mysterious force won't let you in.");
+ return false;
}
\ No newline at end of file
diff --git a/scripts/portal/s4resur_enter.js b/scripts/portal/s4resur_enter.js
index 70e8e19b8a..27823bbcbf 100644
--- a/scripts/portal/s4resur_enter.js
+++ b/scripts/portal/s4resur_enter.js
@@ -27,8 +27,8 @@ function enter(pi) {
if(pi.isQuestStarted(6134)) {
pi.warp(922020000, 0);
return true;
- } else {
- pi.getPlayer().message("A mysterious force won't let you in.");
- return false;
}
+
+ pi.getPlayer().message("A mysterious force won't let you in.");
+ return false;
}
\ No newline at end of file
diff --git a/scripts/portal/s4resur_out.js b/scripts/portal/s4resur_out.js
index 37a08be4f1..0a5a4b6736 100644
--- a/scripts/portal/s4resur_out.js
+++ b/scripts/portal/s4resur_out.js
@@ -21,13 +21,19 @@
*/
/**
* @author DiscoveryMS (Twdtwd)
- * @purpose Warps to the Forgotten Passage and gives you the needed item for the resurection.
+ * @purpose Warps to the Forgotten Passage and gives you the needed item for the resurrection.
*/
function enter(pi) {
if(pi.isQuestStarted(6134)) {
- pi.warp(220070400, 3);
- pi.gainItem(4031448, 1);
- return true;
+ if(pi.canHold(4031448)) {
+ pi.gainItem(4031448, 1);
+ pi.warp(220070400, 3);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Make room on your ETC to receive the quest item.");
+ return false;
+ }
} else {
pi.warp(220070400, 3);
return true;
diff --git a/scripts/portal/s4resurrection.js b/scripts/portal/s4resurrection.js
index 72b6c61044..ef20aff809 100644
--- a/scripts/portal/s4resurrection.js
+++ b/scripts/portal/s4resurrection.js
@@ -20,10 +20,22 @@
along with this program. If not, see .
*/
/**
- * @author DiscoveryMS (Twdtwd)
+ * @author DiscoveryMS (Twdtwd), Ronan
* @purpose Warps to the Cold Cave for Resurection.
*/
function enter(pi) {
- pi.warp(923000100, 0);
- return true;
+ if(pi.haveItem(4001108)) {
+ if(pi.getWarpMap(923000100).countPlayers() == 0) {
+ pi.resetMapObjects(923000100);
+ pi.warp(923000100, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
+ }
+
+ pi.getPlayer().message("A mysterious force won't let you in.");
+ return false;
}
\ No newline at end of file
diff --git a/scripts/portal/s4rush.js b/scripts/portal/s4rush.js
index c0e6465301..8b7f7b748c 100644
--- a/scripts/portal/s4rush.js
+++ b/scripts/portal/s4rush.js
@@ -25,8 +25,15 @@
*/
function enter(pi) {
if(pi.isQuestStarted(6110)) {
- pi.warp(910500100, 0);
- return true;
+ if(pi.getWarpMap(910500100).countPlayers() == 0) {
+ pi.resetMapObjects(910500100);
+ pi.warp(910500100, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
} else {
pi.getPlayer().message("A mysterious force won't let you in.");
return false;
diff --git a/scripts/portal/s4tornado_enter.js b/scripts/portal/s4tornado_enter.js
index 39ae8177ac..e56b134e1a 100644
--- a/scripts/portal/s4tornado_enter.js
+++ b/scripts/portal/s4tornado_enter.js
@@ -25,8 +25,17 @@
*/
function enter(pi) {
if(pi.isQuestStarted(6230) || pi.haveItem(4001110)) {
- pi.warp(922020200, 1);
- return true;
+ if(pi.getWarpMap(922020200).countPlayers() == 0) {
+ pi.resetMapObjects(922020200);
+ pi.warp(922020200, 0);
+
+ return true;
+ } else {
+ pi.getPlayer().message("Some other player is currently inside.");
+ return false;
+ }
}
+
+ pi.getPlayer().message("A mysterious force won't let you in.");
return false;
}
\ No newline at end of file
diff --git a/scripts/reactor/1052000.js b/scripts/reactor/1052000.js
new file mode 100644
index 0000000000..c06753da3b
--- /dev/null
+++ b/scripts/reactor/1052000.js
@@ -0,0 +1,3 @@
+function act() {
+ rm.dropItems();
+}
\ No newline at end of file
diff --git a/scripts/reactor/1052002.js b/scripts/reactor/1052002.js
new file mode 100644
index 0000000000..c06753da3b
--- /dev/null
+++ b/scripts/reactor/1052002.js
@@ -0,0 +1,3 @@
+function act() {
+ rm.dropItems();
+}
\ No newline at end of file
diff --git a/scripts/reactor/2119000.js b/scripts/reactor/2119000.js
index f321108de8..1349013a15 100644
--- a/scripts/reactor/2119000.js
+++ b/scripts/reactor/2119000.js
@@ -19,6 +19,8 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
-function act() {
- rm.spawnMonster(9400711, 1);
-}
\ No newline at end of file
+function hit() {
+ rm.hitMonsterWithReactor(6090000, 14);
+}
+
+function act() {}
\ No newline at end of file
diff --git a/scripts/reactor/2119001.js b/scripts/reactor/2119001.js
new file mode 100644
index 0000000000..1349013a15
--- /dev/null
+++ b/scripts/reactor/2119001.js
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090000, 14);
+}
+
+function act() {}
\ No newline at end of file
diff --git a/scripts/reactor/2119002.js b/scripts/reactor/2119002.js
new file mode 100644
index 0000000000..1349013a15
--- /dev/null
+++ b/scripts/reactor/2119002.js
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090000, 14);
+}
+
+function act() {}
\ No newline at end of file
diff --git a/scripts/reactor/2119003.js b/scripts/reactor/2119003.js
new file mode 100644
index 0000000000..1349013a15
--- /dev/null
+++ b/scripts/reactor/2119003.js
@@ -0,0 +1,26 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090000, 14);
+}
+
+function act() {}
\ No newline at end of file
diff --git a/scripts/reactor/2119004.js b/scripts/reactor/2119004.js
new file mode 100644
index 0000000000..ce19e0bf7f
--- /dev/null
+++ b/scripts/reactor/2119004.js
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090001, 4);
+ rm.getReactor().setEventState(Math.floor(Math.random() * 3));
+}
\ No newline at end of file
diff --git a/scripts/reactor/2119005.js b/scripts/reactor/2119005.js
new file mode 100644
index 0000000000..ce19e0bf7f
--- /dev/null
+++ b/scripts/reactor/2119005.js
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090001, 4);
+ rm.getReactor().setEventState(Math.floor(Math.random() * 3));
+}
\ No newline at end of file
diff --git a/scripts/reactor/2119006.js b/scripts/reactor/2119006.js
new file mode 100644
index 0000000000..ce19e0bf7f
--- /dev/null
+++ b/scripts/reactor/2119006.js
@@ -0,0 +1,25 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090001, 4);
+ rm.getReactor().setEventState(Math.floor(Math.random() * 3));
+}
\ No newline at end of file
diff --git a/scripts/reactor/2229009.js b/scripts/reactor/2229009.js
new file mode 100644
index 0000000000..999646a0e0
--- /dev/null
+++ b/scripts/reactor/2229009.js
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+function hit() {
+ rm.hitMonsterWithReactor(6090003, 1);
+}
\ No newline at end of file
diff --git a/scripts/reactor/2708000.js b/scripts/reactor/2708000.js
new file mode 100644
index 0000000000..73c35f07fd
--- /dev/null
+++ b/scripts/reactor/2708000.js
@@ -0,0 +1,43 @@
+/*
+ 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 .
+*/
+
+importPackage(Packages.server.life);
+
+function spawnJrBoss(mobObj) {
+ mobObj.getMap().killMonster(mobObj.getId());
+ var spawnid = mobObj.getId() - 17;
+
+ var mob = MapleLifeFactory.getMonster(spawnid);
+ mobObj.getMap().spawnMonsterOnGroundBelow(mob, mobObj.getPosition());
+}
+
+function hit() {
+ var mapObj = rm.getMap();
+
+ //spawnJrBoss(mapObj.getMonsterById(8820019));
+ //spawnJrBoss(mapObj.getMonsterById(8820020));
+ //spawnJrBoss(mapObj.getMonsterById(8820021));
+ //spawnJrBoss(mapObj.getMonsterById(8820022));
+ //spawnJrBoss(mapObj.getMonsterById(8820023));
+
+ mapObj.killMonster(8820000);
+}
\ No newline at end of file
diff --git a/scripts/reactor/8001000.js b/scripts/reactor/8001000.js
new file mode 100644
index 0000000000..f4f08d7db5
--- /dev/null
+++ b/scripts/reactor/8001000.js
@@ -0,0 +1,24 @@
+/*
+ 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 .
+*/
+function act(){
+ rm.spawnMonster(9400112);
+}
\ No newline at end of file
diff --git a/sql/db_database.sql b/sql/db_database.sql
index afa7d5ea81..2c08aad984 100644
--- a/sql/db_database.sql
+++ b/sql/db_database.sql
@@ -8,7 +8,8 @@ SET time_zone = "+00:00";
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
-CREATE DATABASE IF NOT EXISTS `maplesolaxia` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
+DROP DATABASE IF EXISTS `maplesolaxia`;
+CREATE DATABASE `maplesolaxia` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `maplesolaxia`;
CREATE TABLE IF NOT EXISTS `accounts` (
@@ -12872,14 +12873,6 @@ CREATE TABLE IF NOT EXISTS `gifts` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-CREATE TABLE IF NOT EXISTS `gmlog` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `cid` int(11) NOT NULL DEFAULT '0',
- `command` tinytext NOT NULL,
- `when` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-
CREATE TABLE IF NOT EXISTS `guilds` (
`guildid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`leader` int(10) unsigned NOT NULL DEFAULT '0',
@@ -16227,7 +16220,7 @@ INSERT INTO `monstercarddata` (`id`, `cardid`, `mobid`) VALUES
(287, 2388040, 8220004),
(288, 2388041, 8220005),
(289, 2388042, 8220006),
-(290, 2388043, 8820000),
+(290, 2388043, 8820001),
(291, 2380013, 9300274),
(292, 2388055, 8830000),
(293, 2380014, 1110130),
@@ -20267,17 +20260,17 @@ INSERT INTO `shopitems` (`shopitemid`, `shopid`, `itemid`, `price`, `pitch`, `po
(2976, 9270022, 2000002, 320, 0, 208),
(2977, 9270022, 2000001, 160, 0, 212),
(2978, 9270022, 2000000, 50, 0, 216),
-(2979, 9270027, 2022215, 6800, 0, 104),
-(2980, 9270027, 2022214, 3200, 0, 108),
-(2981, 9270027, 2022211, 6400, 0, 112),
-(2982, 9270027, 2022210, 3200, 0, 116),
-(2983, 9270027, 2022209, 1600, 0, 120),
-(2984, 9270027, 2022208, 1000, 0, 124),
-(2985, 9270027, 2022207, 2600, 0, 128),
-(2986, 9270027, 2022206, 2200, 0, 132),
-(2987, 9270027, 2022205, 1800, 0, 136),
-(2988, 9270027, 2022204, 1200, 0, 140),
-(2989, 9270027, 2022203, 800, 0, 144),
+(2979, 9270027, 2022215, 6800, 0, 112),
+(2980, 9270027, 2022214, 3200, 0, 116),
+(2981, 9270027, 2022211, 6400, 0, 120),
+(2982, 9270027, 2022210, 3200, 0, 124),
+(2983, 9270027, 2022209, 1600, 0, 128),
+(2984, 9270027, 2022208, 1000, 0, 132),
+(2985, 9270027, 2022207, 2600, 0, 136),
+(2986, 9270027, 2022206, 2200, 0, 140),
+(2987, 9270027, 2022205, 1800, 0, 144),
+(2988, 9270027, 2022204, 1200, 0, 148),
+(2989, 9270027, 2022203, 800, 0, 152),
(2990, 9999992, 1812006, 1, 0, 112),
(2991, 9999992, 1832000, 1, 0, 114),
(2992, 9999992, 1812005, 1, 0, 116),
@@ -20928,7 +20921,6 @@ INSERT INTO `shopitems` (`shopitemid`, `shopid`, `itemid`, `price`, `pitch`, `po
(20227, 9270056, 1040085, 200000, 0, 436),
(20228, 9270056, 1040000, 200000, 0, 440),
(20229, 9270056, 1002004, 160000, 0, 444),
-
(20230, 9270065, 2061000, 1, 0, 1),
(20231, 9270065, 2060000, 1, 0, 2),
(20232, 9270065, 2030000, 400, 0, 3),
@@ -20938,20 +20930,22 @@ INSERT INTO `shopitems` (`shopitemid`, `shopid`, `itemid`, `price`, `pitch`, `po
(20236, 9270065, 2050000, 200, 0, 7),
(20237, 9270065, 2022215, 6800, 0, 8),
(20238, 9270065, 2022214, 3200, 0, 9),
-(20239, 9270065, 2022211, 6400, 0, 10),
-(20240, 9270065, 2022210, 3200, 0, 11),
-(20241, 9270065, 2022209, 1600, 0, 12),
-(20242, 9270065, 2022208, 1000, 0, 13),
-(20243, 9270065, 2022207, 2600, 0, 14),
-(20244, 9270065, 2022206, 2200, 0, 15),
-(20245, 9270065, 2022205, 1800, 0, 16),
-(20246, 9270065, 2022204, 1200, 0, 17),
-(20247, 9270065, 2022203, 800, 0, 18),
-(20248, 9270065, 2022480, 12000, 0, 19),
-(20249, 9270065, 2022479, 3800, 0, 20),
-(20250, 9270065, 2022478, 3200, 0, 21),
-(20251, 9270065, 2022477, 9200, 0, 22),
-(20252, 9270065, 2022476, 4200, 0, 23);
+(20239, 9270065, 2022213, 6800, 0, 10),
+(20240, 9270065, 2022212, 3200, 0, 11),
+(20241, 9270065, 2022211, 6400, 0, 12),
+(20242, 9270065, 2022210, 3200, 0, 13),
+(20243, 9270065, 2022209, 1600, 0, 14),
+(20244, 9270065, 2022208, 1000, 0, 15),
+(20245, 9270065, 2022207, 2600, 0, 16),
+(20246, 9270065, 2022206, 2200, 0, 17),
+(20247, 9270065, 2022205, 1800, 0, 18),
+(20248, 9270065, 2022204, 1200, 0, 19),
+(20249, 9270065, 2022203, 800, 0, 20),
+(20250, 9270065, 2022480, 12000, 0, 21),
+(20251, 9270065, 2022479, 3800, 0, 22),
+(20252, 9270065, 2022478, 3200, 0, 23),
+(20253, 9270065, 2022477, 9200, 0, 24),
+(20254, 9270065, 2022476, 4200, 0, 25);
CREATE TABLE IF NOT EXISTS `shops` (
`shopid` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -21183,7 +21177,11 @@ INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `position`) VALUES
( 57, 3992035, 500, 112),
( 57, 3992036, 500, 113),
( 57, 3992037, 500, 114),
-( 57, 3992038, 500, 115);
+( 57, 3992038, 500, 115),
+
+-- missing CBD shop data
+(9270027, 2022213, 6800, 0, 104),
+(9270027, 2022212, 3200, 0, 108);
CREATE TABLE IF NOT EXISTS `skillmacros` (
`id` int(11) NOT NULL AUTO_INCREMENT,
diff --git a/sql/db_drops.sql b/sql/db_drops.sql
index f71568d294..4355a482cb 100644
--- a/sql/db_drops.sql
+++ b/sql/db_drops.sql
@@ -10626,7 +10626,8 @@
(6130204, 1040107, 1, 1, 0, 700),
(6130204, 1060095, 1, 1, 0, 700),
(6130204, 1052119, 1, 1, 0, 700),
-(6090001, 2384037, 1, 4, 0, 20000),
+(6090001, 3010045, 1, 1, 0, 100000),
+(6090001, 2384037, 1, 1, 0, 20000),
(6300000, 4000049, 1, 1, 0, 200000),
(9300258, 4000049, 1, 1, 0, 200000),
(6300000, 4000021, 1, 1, 0, 200000),
@@ -19154,7 +19155,49 @@
(9300076, 4001082, 1, 1, 7302, 40000),
(9300078, 4001080, 1, 1, 7302, 40000),
(9300078, 4001081, 1, 1, 7302, 40000),
-(9300078, 4001082, 1, 1, 7302, 40000);
+(9300078, 4001082, 1, 1, 7302, 40000),
+(6090000, 1032042, 1, 1, 0, 8000),
+(6090000, 1122001, 1, 1, 0, 8000),
+(6090000, 1112407, 1, 1, 0, 8000),
+(6090000, 1302026, 1, 1, 0, 8000),
+(6090000, 1442054, 1, 1, 0, 8000),
+(6090001, 1032045, 1, 1, 0, 8000),
+(6090001, 1122002, 1, 1, 0, 8000),
+(6090001, 1112407, 1, 1, 0, 8000),
+(6090001, 1302028, 1, 1, 0, 8000),
+(6090001, 1442018, 1, 1, 0, 8000),
+(6090002, 1032021, 1, 1, 0, 8000),
+(6090002, 1122003, 1, 1, 0, 8000),
+(6090002, 1112408, 1, 1, 0, 8000),
+(6090002, 1302025, 1, 1, 0, 8000),
+(6090002, 1442030, 1, 1, 0, 8000),
+(6090003, 1032050, 1, 1, 0, 8000),
+(6090003, 1122004, 1, 1, 0, 8000),
+(6090003, 1112408, 1, 1, 0, 8000),
+(6090003, 1302027, 1, 1, 0, 8000),
+(6090003, 1442050, 1, 1, 0, 8000),
+(6090004, 1032026, 1, 1, 0, 8000),
+(6090004, 1122005, 1, 1, 0, 8000),
+(6090004, 1112408, 1, 1, 0, 8000),
+(6090004, 1302017, 1, 1, 0, 8000),
+(6090004, 1442055, 1, 1, 0, 8000),
+(5090000, 1032044, 1, 1, 0, 8000),
+(5090000, 1122006, 1, 1, 0, 8000),
+(5090000, 1112407, 1, 1, 0, 8000),
+(5090000, 1302029, 1, 1, 0, 8000),
+(5090000, 1442066, 1, 1, 0, 8000),
+(5090001, 1092052, 1, 1, 0, 8000),
+(5090001, 1102026, 1, 1, 0, 8000),
+(5090001, 1052166, 1, 1, 0, 8000),
+(5090001, 1082150, 1, 1, 0, 8000),
+(5090001, 1132009, 1, 1, 0, 8000),
+(6090000, 0, 1500, 2000, 0, 400000),
+(6090001, 0, 700, 777, 0, 400000),
+(6090002, 0, 1500, 1700, 0, 400000),
+(6090003, 0, 600, 800, 0, 400000),
+(6090004, 0, 1000, 1100, 0, 400000),
+(5090000, 0, 800, 920, 0, 400000),
+(5090001, 0, 1700, 1750, 0, 400000);
# (dropperid, itemid, minqty, maxqty, questid, chance)
@@ -19162,6 +19205,10 @@
DELETE FROM temp_data WHERE dropperid=9300090;
DELETE FROM temp_data WHERE dropperid=9420501;
+ # delete item drops from clones of Pink Bean
+ DELETE FROM temp_data WHERE dropperid=8820000;
+ DELETE FROM temp_data WHERE dropperid>=8820010 AND dropperid<=8820014;
+
# reinsert other Freezer's data
INSERT IGNORE INTO temp_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
(9420501, 0, 92, 138, 0, 400000),
@@ -19189,15 +19236,18 @@
(9420501, 1072297, 1, 1, 0, 2000),
(9420501, 1482001, 1, 1, 0, 2000),
(9420501, 1482005, 1, 1, 0, 2000),
-(9420501, 1492005, 1, 1, 0, 2000);
-
- INSERT IGNORE INTO temp_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
-(9300090, 0, 1500, 4000, 0, 400000),
-(9300090, 4001114, 1, 1, 0, 400000);
+(9420501, 1492005, 1, 1, 0, 2000),
+(8820001, 2388043, 1, 1, 0, 24000);
# delete item drops from Seruf in inactive form
DELETE FROM temp_data WHERE dropperid=4220001;
+ # delete item drops from summoned Slimes
+ DELETE FROM temp_data WHERE dropperid=9500100;
+
+# delete item drops from Dojo summoned mobs
+ DELETE FROM temp_data WHERE dropperid>=9300217 AND dropperid<=9300270;
+
UPDATE IGNORE temp_data SET chance=700 WHERE itemid=1302056;
UPDATE IGNORE temp_data SET dropperid=9000002 WHERE dropperid=9000000;
@@ -19249,7 +19299,6 @@
UPDATE drop_data SET chance=24000 WHERE (itemid >= 2388000 AND itemid < 2390000);
#update quest mob items
- UPDATE drop_data SET questid=8255 WHERE itemid=4032133;
UPDATE drop_data SET questid=3232 WHERE itemid=4031098;
UPDATE drop_data SET questid=3452 WHERE itemid=4001125;
UPDATE drop_data SET questid=28248 WHERE itemid=4001360;
@@ -19285,16 +19334,534 @@
DELETE FROM drop_data WHERE dropperid >= 9300061 AND dropperid <= 9300064;
DELETE FROM drop_data WHERE dropperid >= 9300081 AND dropperid <= 9300083;
+ # remove items being dropped from summoned mobs in PQs
+
+ DELETE FROM drop_data WHERE dropperid >= 9300015 AND dropperid <= 9300017;
+ DELETE FROM drop_data WHERE dropperid >= 9300054 AND dropperid <= 9300056;
+ DELETE FROM drop_data WHERE dropperid >= 9300143 AND dropperid <= 9300144;
+ DELETE FROM drop_data WHERE dropperid >= 8810019 AND dropperid <= 8810023;
+ DELETE FROM drop_data WHERE dropperid = 9500100;
+
# remove key of dimension dropping outside PQ
DELETE FROM drop_data WHERE itemid=4001023 AND dropperid!=9300012;
# make Sword Earrings not drop by normal means, just like Shield Earrings
DELETE FROM drop_data WHERE itemid=1032030;
- # remove every not-card drop from bosses out of their natural habitat
+ # remove every non-card drop from bosses out of their natural habitat
DELETE FROM drop_data WHERE dropperid >= 9300184 AND dropperid < 9300215 AND (itemid < 2380000 OR itemid >= 2390000);
DELETE FROM drop_data WHERE dropperid >= 9500337 AND dropperid < 9500364 AND (itemid < 2380000 OR itemid >= 2390000);
+ # reinsert dojo loot
+ INSERT IGNORE INTO drop_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
+(9300184, 2022359, 1, 1, 0, 200000),
+(9300184, 2022360, 1, 1, 0, 200000),
+(9300184, 2022361, 1, 1, 0, 200000),
+(9300184, 2022362, 1, 1, 0, 200000),
+(9300184, 2022363, 1, 1, 0, 200000),
+(9300184, 2022364, 1, 1, 0, 200000),
+(9300184, 2022365, 1, 1, 0, 200000),
+(9300184, 2022366, 1, 1, 0, 200000),
+(9300184, 2022367, 1, 1, 0, 200000),
+(9300185, 2022359, 1, 1, 0, 200000),
+(9300185, 2022360, 1, 1, 0, 200000),
+(9300185, 2022361, 1, 1, 0, 200000),
+(9300185, 2022362, 1, 1, 0, 200000),
+(9300185, 2022363, 1, 1, 0, 200000),
+(9300185, 2022364, 1, 1, 0, 200000),
+(9300185, 2022365, 1, 1, 0, 200000),
+(9300185, 2022366, 1, 1, 0, 200000),
+(9300185, 2022367, 1, 1, 0, 200000),
+(9300186, 2022359, 1, 1, 0, 200000),
+(9300186, 2022360, 1, 1, 0, 200000),
+(9300186, 2022361, 1, 1, 0, 200000),
+(9300186, 2022362, 1, 1, 0, 200000),
+(9300186, 2022363, 1, 1, 0, 200000),
+(9300186, 2022364, 1, 1, 0, 200000),
+(9300186, 2022365, 1, 1, 0, 200000),
+(9300186, 2022366, 1, 1, 0, 200000),
+(9300186, 2022367, 1, 1, 0, 200000),
+(9300187, 2022359, 1, 1, 0, 200000),
+(9300187, 2022360, 1, 1, 0, 200000),
+(9300187, 2022361, 1, 1, 0, 200000),
+(9300187, 2022362, 1, 1, 0, 200000),
+(9300187, 2022363, 1, 1, 0, 200000),
+(9300187, 2022364, 1, 1, 0, 200000),
+(9300187, 2022365, 1, 1, 0, 200000),
+(9300187, 2022366, 1, 1, 0, 200000),
+(9300187, 2022367, 1, 1, 0, 200000),
+(9300188, 2022359, 1, 1, 0, 200000),
+(9300188, 2022360, 1, 1, 0, 200000),
+(9300188, 2022361, 1, 1, 0, 200000),
+(9300188, 2022362, 1, 1, 0, 200000),
+(9300188, 2022363, 1, 1, 0, 200000),
+(9300188, 2022364, 1, 1, 0, 200000),
+(9300188, 2022365, 1, 1, 0, 200000),
+(9300188, 2022366, 1, 1, 0, 200000),
+(9300188, 2022367, 1, 1, 0, 200000),
+(9300189, 2022368, 1, 1, 0, 200000),
+(9300189, 2022369, 1, 1, 0, 200000),
+(9300189, 2022370, 1, 1, 0, 200000),
+(9300189, 2022371, 1, 1, 0, 200000),
+(9300189, 2022372, 1, 1, 0, 200000),
+(9300189, 2022373, 1, 1, 0, 200000),
+(9300189, 2022374, 1, 1, 0, 200000),
+(9300189, 2022375, 1, 1, 0, 200000),
+(9300189, 2022376, 1, 1, 0, 200000),
+(9300190, 2022368, 1, 1, 0, 200000),
+(9300190, 2022369, 1, 1, 0, 200000),
+(9300190, 2022370, 1, 1, 0, 200000),
+(9300190, 2022371, 1, 1, 0, 200000),
+(9300190, 2022372, 1, 1, 0, 200000),
+(9300190, 2022373, 1, 1, 0, 200000),
+(9300190, 2022374, 1, 1, 0, 200000),
+(9300190, 2022375, 1, 1, 0, 200000),
+(9300190, 2022376, 1, 1, 0, 200000),
+(9300191, 2022368, 1, 1, 0, 200000),
+(9300191, 2022369, 1, 1, 0, 200000),
+(9300191, 2022370, 1, 1, 0, 200000),
+(9300191, 2022371, 1, 1, 0, 200000),
+(9300191, 2022372, 1, 1, 0, 200000),
+(9300191, 2022373, 1, 1, 0, 200000),
+(9300191, 2022374, 1, 1, 0, 200000),
+(9300191, 2022375, 1, 1, 0, 200000),
+(9300191, 2022376, 1, 1, 0, 200000),
+(9300192, 2022368, 1, 1, 0, 200000),
+(9300192, 2022369, 1, 1, 0, 200000),
+(9300192, 2022370, 1, 1, 0, 200000),
+(9300192, 2022371, 1, 1, 0, 200000),
+(9300192, 2022372, 1, 1, 0, 200000),
+(9300192, 2022373, 1, 1, 0, 200000),
+(9300192, 2022374, 1, 1, 0, 200000),
+(9300192, 2022375, 1, 1, 0, 200000),
+(9300192, 2022376, 1, 1, 0, 200000),
+(9300193, 2022368, 1, 1, 0, 200000),
+(9300193, 2022369, 1, 1, 0, 200000),
+(9300193, 2022370, 1, 1, 0, 200000),
+(9300193, 2022371, 1, 1, 0, 200000),
+(9300193, 2022372, 1, 1, 0, 200000),
+(9300193, 2022373, 1, 1, 0, 200000),
+(9300193, 2022374, 1, 1, 0, 200000),
+(9300193, 2022375, 1, 1, 0, 200000),
+(9300193, 2022376, 1, 1, 0, 200000),
+(9300194, 2022377, 1, 1, 0, 200000),
+(9300194, 2022378, 1, 1, 0, 200000),
+(9300194, 2022379, 1, 1, 0, 200000),
+(9300194, 2022380, 1, 1, 0, 200000),
+(9300194, 2022381, 1, 1, 0, 200000),
+(9300194, 2022382, 1, 1, 0, 200000),
+(9300194, 2022383, 1, 1, 0, 200000),
+(9300194, 2022384, 1, 1, 0, 200000),
+(9300194, 2022385, 1, 1, 0, 200000),
+(9300195, 2022377, 1, 1, 0, 200000),
+(9300195, 2022378, 1, 1, 0, 200000),
+(9300195, 2022379, 1, 1, 0, 200000),
+(9300195, 2022380, 1, 1, 0, 200000),
+(9300195, 2022381, 1, 1, 0, 200000),
+(9300195, 2022382, 1, 1, 0, 200000),
+(9300195, 2022383, 1, 1, 0, 200000),
+(9300195, 2022384, 1, 1, 0, 200000),
+(9300195, 2022385, 1, 1, 0, 200000),
+(9300196, 2022377, 1, 1, 0, 200000),
+(9300196, 2022378, 1, 1, 0, 200000),
+(9300196, 2022379, 1, 1, 0, 200000),
+(9300196, 2022380, 1, 1, 0, 200000),
+(9300196, 2022381, 1, 1, 0, 200000),
+(9300196, 2022382, 1, 1, 0, 200000),
+(9300196, 2022383, 1, 1, 0, 200000),
+(9300196, 2022384, 1, 1, 0, 200000),
+(9300196, 2022385, 1, 1, 0, 200000),
+(9300197, 2022377, 1, 1, 0, 200000),
+(9300197, 2022378, 1, 1, 0, 200000),
+(9300197, 2022379, 1, 1, 0, 200000),
+(9300197, 2022380, 1, 1, 0, 200000),
+(9300197, 2022381, 1, 1, 0, 200000),
+(9300197, 2022382, 1, 1, 0, 200000),
+(9300197, 2022383, 1, 1, 0, 200000),
+(9300197, 2022384, 1, 1, 0, 200000),
+(9300197, 2022385, 1, 1, 0, 200000),
+(9300198, 2022377, 1, 1, 0, 200000),
+(9300198, 2022378, 1, 1, 0, 200000),
+(9300198, 2022379, 1, 1, 0, 200000),
+(9300198, 2022380, 1, 1, 0, 200000),
+(9300198, 2022381, 1, 1, 0, 200000),
+(9300198, 2022382, 1, 1, 0, 200000),
+(9300198, 2022383, 1, 1, 0, 200000),
+(9300198, 2022384, 1, 1, 0, 200000),
+(9300198, 2022385, 1, 1, 0, 200000),
+(9300199, 2022386, 1, 1, 0, 200000),
+(9300199, 2022387, 1, 1, 0, 200000),
+(9300199, 2022388, 1, 1, 0, 200000),
+(9300199, 2022389, 1, 1, 0, 200000),
+(9300199, 2022390, 1, 1, 0, 200000),
+(9300199, 2022391, 1, 1, 0, 200000),
+(9300199, 2022392, 1, 1, 0, 200000),
+(9300199, 2022393, 1, 1, 0, 200000),
+(9300199, 2022394, 1, 1, 0, 200000),
+(9300200, 2022386, 1, 1, 0, 200000),
+(9300200, 2022387, 1, 1, 0, 200000),
+(9300200, 2022388, 1, 1, 0, 200000),
+(9300200, 2022389, 1, 1, 0, 200000),
+(9300200, 2022390, 1, 1, 0, 200000),
+(9300200, 2022391, 1, 1, 0, 200000),
+(9300200, 2022392, 1, 1, 0, 200000),
+(9300200, 2022393, 1, 1, 0, 200000),
+(9300200, 2022394, 1, 1, 0, 200000),
+(9300201, 2022386, 1, 1, 0, 200000),
+(9300201, 2022387, 1, 1, 0, 200000),
+(9300201, 2022388, 1, 1, 0, 200000),
+(9300201, 2022389, 1, 1, 0, 200000),
+(9300201, 2022390, 1, 1, 0, 200000),
+(9300201, 2022391, 1, 1, 0, 200000),
+(9300201, 2022392, 1, 1, 0, 200000),
+(9300201, 2022393, 1, 1, 0, 200000),
+(9300201, 2022394, 1, 1, 0, 200000),
+(9300202, 2022386, 1, 1, 0, 200000),
+(9300202, 2022387, 1, 1, 0, 200000),
+(9300202, 2022388, 1, 1, 0, 200000),
+(9300202, 2022389, 1, 1, 0, 200000),
+(9300202, 2022390, 1, 1, 0, 200000),
+(9300202, 2022391, 1, 1, 0, 200000),
+(9300202, 2022392, 1, 1, 0, 200000),
+(9300202, 2022393, 1, 1, 0, 200000),
+(9300202, 2022394, 1, 1, 0, 200000),
+(9300203, 2022386, 1, 1, 0, 200000),
+(9300203, 2022387, 1, 1, 0, 200000),
+(9300203, 2022388, 1, 1, 0, 200000),
+(9300203, 2022389, 1, 1, 0, 200000),
+(9300203, 2022390, 1, 1, 0, 200000),
+(9300203, 2022391, 1, 1, 0, 200000),
+(9300203, 2022392, 1, 1, 0, 200000),
+(9300203, 2022393, 1, 1, 0, 200000),
+(9300203, 2022394, 1, 1, 0, 200000),
+(9300204, 2022395, 1, 1, 0, 200000),
+(9300204, 2022396, 1, 1, 0, 200000),
+(9300204, 2022397, 1, 1, 0, 200000),
+(9300204, 2022398, 1, 1, 0, 200000),
+(9300204, 2022399, 1, 1, 0, 200000),
+(9300204, 2022400, 1, 1, 0, 200000),
+(9300204, 2022401, 1, 1, 0, 200000),
+(9300204, 2022402, 1, 1, 0, 200000),
+(9300204, 2022403, 1, 1, 0, 200000),
+(9300205, 2022395, 1, 1, 0, 200000),
+(9300205, 2022396, 1, 1, 0, 200000),
+(9300205, 2022397, 1, 1, 0, 200000),
+(9300205, 2022398, 1, 1, 0, 200000),
+(9300205, 2022399, 1, 1, 0, 200000),
+(9300205, 2022400, 1, 1, 0, 200000),
+(9300205, 2022401, 1, 1, 0, 200000),
+(9300205, 2022402, 1, 1, 0, 200000),
+(9300205, 2022403, 1, 1, 0, 200000),
+(9300206, 2022395, 1, 1, 0, 200000),
+(9300206, 2022396, 1, 1, 0, 200000),
+(9300206, 2022397, 1, 1, 0, 200000),
+(9300206, 2022398, 1, 1, 0, 200000),
+(9300206, 2022399, 1, 1, 0, 200000),
+(9300206, 2022400, 1, 1, 0, 200000),
+(9300206, 2022401, 1, 1, 0, 200000),
+(9300206, 2022402, 1, 1, 0, 200000),
+(9300206, 2022403, 1, 1, 0, 200000),
+(9300207, 2022395, 1, 1, 0, 200000),
+(9300207, 2022396, 1, 1, 0, 200000),
+(9300207, 2022397, 1, 1, 0, 200000),
+(9300207, 2022398, 1, 1, 0, 200000),
+(9300207, 2022399, 1, 1, 0, 200000),
+(9300207, 2022400, 1, 1, 0, 200000),
+(9300207, 2022401, 1, 1, 0, 200000),
+(9300207, 2022402, 1, 1, 0, 200000),
+(9300207, 2022403, 1, 1, 0, 200000),
+(9300208, 2022395, 1, 1, 0, 200000),
+(9300208, 2022396, 1, 1, 0, 200000),
+(9300208, 2022397, 1, 1, 0, 200000),
+(9300208, 2022398, 1, 1, 0, 200000),
+(9300208, 2022399, 1, 1, 0, 200000),
+(9300208, 2022400, 1, 1, 0, 200000),
+(9300208, 2022401, 1, 1, 0, 200000),
+(9300208, 2022402, 1, 1, 0, 200000),
+(9300208, 2022403, 1, 1, 0, 200000),
+(9300209, 2022404, 1, 1, 0, 200000),
+(9300209, 2022405, 1, 1, 0, 200000),
+(9300209, 2022406, 1, 1, 0, 200000),
+(9300209, 2022407, 1, 1, 0, 200000),
+(9300209, 2022408, 1, 1, 0, 200000),
+(9300209, 2022409, 1, 1, 0, 200000),
+(9300209, 2022410, 1, 1, 0, 200000),
+(9300209, 2022411, 1, 1, 0, 200000),
+(9300209, 2022412, 1, 1, 0, 200000),
+(9300210, 2022404, 1, 1, 0, 200000),
+(9300210, 2022405, 1, 1, 0, 200000),
+(9300210, 2022406, 1, 1, 0, 200000),
+(9300210, 2022407, 1, 1, 0, 200000),
+(9300210, 2022408, 1, 1, 0, 200000),
+(9300210, 2022409, 1, 1, 0, 200000),
+(9300210, 2022410, 1, 1, 0, 200000),
+(9300210, 2022411, 1, 1, 0, 200000),
+(9300210, 2022412, 1, 1, 0, 200000),
+(9300211, 2022404, 1, 1, 0, 200000),
+(9300211, 2022405, 1, 1, 0, 200000),
+(9300211, 2022406, 1, 1, 0, 200000),
+(9300211, 2022407, 1, 1, 0, 200000),
+(9300211, 2022408, 1, 1, 0, 200000),
+(9300211, 2022409, 1, 1, 0, 200000),
+(9300211, 2022410, 1, 1, 0, 200000),
+(9300211, 2022411, 1, 1, 0, 200000),
+(9300211, 2022412, 1, 1, 0, 200000),
+(9300212, 2022404, 1, 1, 0, 200000),
+(9300212, 2022405, 1, 1, 0, 200000),
+(9300212, 2022406, 1, 1, 0, 200000),
+(9300212, 2022407, 1, 1, 0, 200000),
+(9300212, 2022408, 1, 1, 0, 200000),
+(9300212, 2022409, 1, 1, 0, 200000),
+(9300212, 2022410, 1, 1, 0, 200000),
+(9300212, 2022411, 1, 1, 0, 200000),
+(9300212, 2022412, 1, 1, 0, 200000),
+(9300213, 2022404, 1, 1, 0, 200000),
+(9300213, 2022405, 1, 1, 0, 200000),
+(9300213, 2022406, 1, 1, 0, 200000),
+(9300213, 2022407, 1, 1, 0, 200000),
+(9300213, 2022408, 1, 1, 0, 200000),
+(9300213, 2022409, 1, 1, 0, 200000),
+(9300213, 2022410, 1, 1, 0, 200000),
+(9300213, 2022411, 1, 1, 0, 200000),
+(9300213, 2022412, 1, 1, 0, 200000),
+(9300214, 2022413, 1, 1, 0, 200000),
+(9300214, 2022414, 1, 1, 0, 200000),
+(9300214, 2022415, 1, 1, 0, 200000),
+(9300214, 2022416, 1, 1, 0, 200000),
+(9300214, 2022417, 1, 1, 0, 200000),
+(9300214, 2022418, 1, 1, 0, 200000),
+(9300214, 2022419, 1, 1, 0, 200000),
+(9300214, 2022420, 1, 1, 0, 200000),
+(9300214, 2022421, 1, 1, 0, 200000),
+(9300215, 2022413, 1, 1, 0, 200000),
+(9300215, 2022414, 1, 1, 0, 200000),
+(9300215, 2022415, 1, 1, 0, 200000),
+(9300215, 2022416, 1, 1, 0, 200000),
+(9300215, 2022417, 1, 1, 0, 200000),
+(9300215, 2022418, 1, 1, 0, 200000),
+(9300215, 2022419, 1, 1, 0, 200000),
+(9300215, 2022420, 1, 1, 0, 200000),
+(9300215, 2022421, 1, 1, 0, 200000);
+
+ INSERT IGNORE INTO drop_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
+(9300217, 2022430, 1, 1, 0, 200000),
+(9300217, 2022431, 1, 1, 0, 200000),
+(9300217, 2022432, 1, 1, 0, 200000),
+(9300217, 2022433, 1, 1, 0, 200000),
+(9300218, 2022430, 1, 1, 0, 200000),
+(9300218, 2022431, 1, 1, 0, 200000),
+(9300218, 2022432, 1, 1, 0, 200000),
+(9300218, 2022433, 1, 1, 0, 200000),
+(9300219, 2022430, 1, 1, 0, 200000),
+(9300219, 2022431, 1, 1, 0, 200000),
+(9300219, 2022432, 1, 1, 0, 200000),
+(9300219, 2022433, 1, 1, 0, 200000),
+(9300220, 2022430, 1, 1, 0, 200000),
+(9300220, 2022431, 1, 1, 0, 200000),
+(9300220, 2022432, 1, 1, 0, 200000),
+(9300220, 2022433, 1, 1, 0, 200000),
+(9300221, 2022430, 1, 1, 0, 200000),
+(9300221, 2022431, 1, 1, 0, 200000),
+(9300221, 2022432, 1, 1, 0, 200000),
+(9300221, 2022433, 1, 1, 0, 200000),
+(9300222, 2022430, 1, 1, 0, 200000),
+(9300222, 2022431, 1, 1, 0, 200000),
+(9300222, 2022432, 1, 1, 0, 200000),
+(9300222, 2022433, 1, 1, 0, 200000),
+(9300223, 2022430, 1, 1, 0, 200000),
+(9300223, 2022431, 1, 1, 0, 200000),
+(9300223, 2022432, 1, 1, 0, 200000),
+(9300223, 2022433, 1, 1, 0, 200000),
+(9300224, 2022430, 1, 1, 0, 200000),
+(9300224, 2022431, 1, 1, 0, 200000),
+(9300224, 2022432, 1, 1, 0, 200000),
+(9300224, 2022433, 1, 1, 0, 200000),
+(9300225, 2022430, 1, 1, 0, 200000),
+(9300225, 2022431, 1, 1, 0, 200000),
+(9300225, 2022432, 1, 1, 0, 200000),
+(9300225, 2022433, 1, 1, 0, 200000),
+(9300226, 2022430, 1, 1, 0, 200000),
+(9300226, 2022431, 1, 1, 0, 200000),
+(9300226, 2022432, 1, 1, 0, 200000),
+(9300226, 2022433, 1, 1, 0, 200000),
+(9300227, 2022430, 1, 1, 0, 200000),
+(9300227, 2022431, 1, 1, 0, 200000),
+(9300227, 2022432, 1, 1, 0, 200000),
+(9300227, 2022433, 1, 1, 0, 200000),
+(9300228, 2022430, 1, 1, 0, 200000),
+(9300228, 2022431, 1, 1, 0, 200000),
+(9300228, 2022432, 1, 1, 0, 200000),
+(9300228, 2022433, 1, 1, 0, 200000),
+(9300229, 2022430, 1, 1, 0, 200000),
+(9300229, 2022431, 1, 1, 0, 200000),
+(9300229, 2022432, 1, 1, 0, 200000),
+(9300229, 2022433, 1, 1, 0, 200000),
+(9300230, 2022430, 1, 1, 0, 200000),
+(9300230, 2022431, 1, 1, 0, 200000),
+(9300230, 2022432, 1, 1, 0, 200000),
+(9300230, 2022433, 1, 1, 0, 200000),
+(9300231, 2022430, 1, 1, 0, 200000),
+(9300231, 2022431, 1, 1, 0, 200000),
+(9300231, 2022432, 1, 1, 0, 200000),
+(9300231, 2022433, 1, 1, 0, 200000),
+(9300232, 2022430, 1, 1, 0, 200000),
+(9300232, 2022431, 1, 1, 0, 200000),
+(9300232, 2022432, 1, 1, 0, 200000),
+(9300232, 2022433, 1, 1, 0, 200000),
+(9300233, 2022430, 1, 1, 0, 200000),
+(9300233, 2022431, 1, 1, 0, 200000),
+(9300233, 2022432, 1, 1, 0, 200000),
+(9300233, 2022433, 1, 1, 0, 200000),
+(9300234, 2022430, 1, 1, 0, 200000),
+(9300234, 2022431, 1, 1, 0, 200000),
+(9300234, 2022432, 1, 1, 0, 200000),
+(9300234, 2022433, 1, 1, 0, 200000),
+(9300235, 2022430, 1, 1, 0, 200000),
+(9300235, 2022431, 1, 1, 0, 200000),
+(9300235, 2022432, 1, 1, 0, 200000),
+(9300235, 2022433, 1, 1, 0, 200000),
+(9300236, 2022430, 1, 1, 0, 200000),
+(9300236, 2022431, 1, 1, 0, 200000),
+(9300236, 2022432, 1, 1, 0, 200000),
+(9300236, 2022433, 1, 1, 0, 200000),
+(9300237, 2022430, 1, 1, 0, 200000),
+(9300237, 2022431, 1, 1, 0, 200000),
+(9300237, 2022432, 1, 1, 0, 200000),
+(9300237, 2022433, 1, 1, 0, 200000),
+(9300238, 2022430, 1, 1, 0, 200000),
+(9300238, 2022431, 1, 1, 0, 200000),
+(9300238, 2022432, 1, 1, 0, 200000),
+(9300238, 2022433, 1, 1, 0, 200000),
+(9300239, 2022430, 1, 1, 0, 200000),
+(9300239, 2022431, 1, 1, 0, 200000),
+(9300239, 2022432, 1, 1, 0, 200000),
+(9300239, 2022433, 1, 1, 0, 200000),
+(9300240, 2022430, 1, 1, 0, 200000),
+(9300240, 2022431, 1, 1, 0, 200000),
+(9300240, 2022432, 1, 1, 0, 200000),
+(9300240, 2022433, 1, 1, 0, 200000),
+(9300241, 2022430, 1, 1, 0, 200000),
+(9300241, 2022431, 1, 1, 0, 200000),
+(9300241, 2022432, 1, 1, 0, 200000),
+(9300241, 2022433, 1, 1, 0, 200000),
+(9300242, 2022430, 1, 1, 0, 200000),
+(9300242, 2022431, 1, 1, 0, 200000),
+(9300242, 2022432, 1, 1, 0, 200000),
+(9300242, 2022433, 1, 1, 0, 200000),
+(9300243, 2022430, 1, 1, 0, 200000),
+(9300243, 2022431, 1, 1, 0, 200000),
+(9300243, 2022432, 1, 1, 0, 200000),
+(9300243, 2022433, 1, 1, 0, 200000),
+(9300244, 2022430, 1, 1, 0, 200000),
+(9300244, 2022431, 1, 1, 0, 200000),
+(9300244, 2022432, 1, 1, 0, 200000),
+(9300244, 2022433, 1, 1, 0, 200000),
+(9300245, 2022430, 1, 1, 0, 200000),
+(9300245, 2022431, 1, 1, 0, 200000),
+(9300245, 2022432, 1, 1, 0, 200000),
+(9300245, 2022433, 1, 1, 0, 200000),
+(9300246, 2022430, 1, 1, 0, 200000),
+(9300246, 2022431, 1, 1, 0, 200000),
+(9300246, 2022432, 1, 1, 0, 200000),
+(9300246, 2022433, 1, 1, 0, 200000),
+(9300247, 2022430, 1, 1, 0, 200000),
+(9300247, 2022431, 1, 1, 0, 200000),
+(9300247, 2022432, 1, 1, 0, 200000),
+(9300247, 2022433, 1, 1, 0, 200000),
+(9300248, 2022430, 1, 1, 0, 200000),
+(9300248, 2022431, 1, 1, 0, 200000),
+(9300248, 2022432, 1, 1, 0, 200000),
+(9300248, 2022433, 1, 1, 0, 200000),
+(9300249, 2022430, 1, 1, 0, 200000),
+(9300249, 2022431, 1, 1, 0, 200000),
+(9300249, 2022432, 1, 1, 0, 200000),
+(9300249, 2022433, 1, 1, 0, 200000),
+(9300250, 2022430, 1, 1, 0, 200000),
+(9300250, 2022431, 1, 1, 0, 200000),
+(9300250, 2022432, 1, 1, 0, 200000),
+(9300250, 2022433, 1, 1, 0, 200000),
+(9300251, 2022430, 1, 1, 0, 200000),
+(9300251, 2022431, 1, 1, 0, 200000),
+(9300251, 2022432, 1, 1, 0, 200000),
+(9300251, 2022433, 1, 1, 0, 200000),
+(9300252, 2022430, 1, 1, 0, 200000),
+(9300252, 2022431, 1, 1, 0, 200000),
+(9300252, 2022432, 1, 1, 0, 200000),
+(9300252, 2022433, 1, 1, 0, 200000),
+(9300253, 2022430, 1, 1, 0, 200000),
+(9300253, 2022431, 1, 1, 0, 200000),
+(9300253, 2022432, 1, 1, 0, 200000),
+(9300253, 2022433, 1, 1, 0, 200000),
+(9300254, 2022430, 1, 1, 0, 200000),
+(9300254, 2022431, 1, 1, 0, 200000),
+(9300254, 2022432, 1, 1, 0, 200000),
+(9300254, 2022433, 1, 1, 0, 200000),
+(9300255, 2022430, 1, 1, 0, 200000),
+(9300255, 2022431, 1, 1, 0, 200000),
+(9300255, 2022432, 1, 1, 0, 200000),
+(9300255, 2022433, 1, 1, 0, 200000),
+(9300256, 2022430, 1, 1, 0, 200000),
+(9300256, 2022431, 1, 1, 0, 200000),
+(9300256, 2022432, 1, 1, 0, 200000),
+(9300256, 2022433, 1, 1, 0, 200000),
+(9300257, 2022430, 1, 1, 0, 200000),
+(9300257, 2022431, 1, 1, 0, 200000),
+(9300257, 2022432, 1, 1, 0, 200000),
+(9300257, 2022433, 1, 1, 0, 200000),
+(9300258, 2022430, 1, 1, 0, 200000),
+(9300258, 2022431, 1, 1, 0, 200000),
+(9300258, 2022432, 1, 1, 0, 200000),
+(9300258, 2022433, 1, 1, 0, 200000),
+(9300259, 2022430, 1, 1, 0, 200000),
+(9300259, 2022431, 1, 1, 0, 200000),
+(9300259, 2022432, 1, 1, 0, 200000),
+(9300259, 2022433, 1, 1, 0, 200000),
+(9300260, 2022430, 1, 1, 0, 200000),
+(9300260, 2022431, 1, 1, 0, 200000),
+(9300260, 2022432, 1, 1, 0, 200000),
+(9300260, 2022433, 1, 1, 0, 200000),
+(9300261, 2022430, 1, 1, 0, 200000),
+(9300261, 2022431, 1, 1, 0, 200000),
+(9300261, 2022432, 1, 1, 0, 200000),
+(9300261, 2022433, 1, 1, 0, 200000),
+(9300262, 2022430, 1, 1, 0, 200000),
+(9300262, 2022431, 1, 1, 0, 200000),
+(9300262, 2022432, 1, 1, 0, 200000),
+(9300262, 2022433, 1, 1, 0, 200000),
+(9300263, 2022430, 1, 1, 0, 200000),
+(9300263, 2022431, 1, 1, 0, 200000),
+(9300263, 2022432, 1, 1, 0, 200000),
+(9300263, 2022433, 1, 1, 0, 200000),
+(9300264, 2022430, 1, 1, 0, 200000),
+(9300264, 2022431, 1, 1, 0, 200000),
+(9300264, 2022432, 1, 1, 0, 200000),
+(9300264, 2022433, 1, 1, 0, 200000),
+(9300265, 2022430, 1, 1, 0, 200000),
+(9300265, 2022431, 1, 1, 0, 200000),
+(9300265, 2022432, 1, 1, 0, 200000),
+(9300265, 2022433, 1, 1, 0, 200000),
+(9300266, 2022430, 1, 1, 0, 200000),
+(9300266, 2022431, 1, 1, 0, 200000),
+(9300266, 2022432, 1, 1, 0, 200000),
+(9300266, 2022433, 1, 1, 0, 200000),
+(9300267, 2022430, 1, 1, 0, 200000),
+(9300267, 2022431, 1, 1, 0, 200000),
+(9300267, 2022432, 1, 1, 0, 200000),
+(9300267, 2022433, 1, 1, 0, 200000),
+(9300268, 2022430, 1, 1, 0, 200000),
+(9300268, 2022431, 1, 1, 0, 200000),
+(9300268, 2022432, 1, 1, 0, 200000),
+(9300268, 2022433, 1, 1, 0, 200000),
+(9300269, 2022430, 1, 1, 0, 200000),
+(9300269, 2022431, 1, 1, 0, 200000),
+(9300269, 2022432, 1, 1, 0, 200000),
+(9300269, 2022433, 1, 1, 0, 200000),
+(9300270, 2022430, 1, 1, 0, 200000),
+(9300270, 2022431, 1, 1, 0, 200000),
+(9300270, 2022432, 1, 1, 0, 200000),
+(9300270, 2022433, 1, 1, 0, 200000),
+(6090002, 4000414, 1, 1, 0, 400000);
+
# update quest reactor items
UPDATE reactordrops SET questid=2086 WHERE itemid=4031165;
UPDATE reactordrops SET questid=3407 WHERE itemid=4031141;
@@ -19463,7 +20030,15 @@
(2001013, 4001045, 1, -1),
(2001014, 4001045, 1, -1),
(2001015, 4001045, 1, -1),
- (2402006, 4001093, 1, -1);
+ (2402006, 4001093, 1, -1),
+ (6102002, 1102205, 50, -1),
+ (6102003, 1102205, 50, -1),
+ (6102004, 1102205, 50, -1),
+ (6102005, 1102205, 50, -1),
+ (6102002, 2022277, 5, -1),
+ (6102003, 2022277, 5, -1),
+ (6102004, 2022277, 5, -1),
+ (6102005, 2022277, 5, -1);
# updates info for all cards on monster book
DROP TABLE `monstercarddata`;
diff --git a/sql/db_shopupdate.sql b/sql/db_shopupdate.sql
index aa77d42c0a..081779f836 100644
--- a/sql/db_shopupdate.sql
+++ b/sql/db_shopupdate.sql
@@ -4,8 +4,9 @@ UPDATE shopitems SET itemid=2120000, price=100 WHERE shopitemid=20;
UPDATE shopitems SET itemid=1812000, price=1000 WHERE shopitemid=21;
UPDATE shopitems SET itemid=1812001, price=1000 WHERE shopitemid=22;
-# Scroll shop at Spindle
+# Scroll shop at Spindle, chair shop at Kino Konoko
INSERT INTO `shops` (`shopid`,`npcid`) VALUES
+(9110002,9110002),
(9201082,9201082);
INSERT IGNORE INTO `shopitems` (`shopitemid`, `shopid`, `itemid`, `price`, `pitch`, `position`) VALUES
@@ -81,4 +82,23 @@ INSERT IGNORE INTO `shopitems` (`shopitemid`, `shopid`, `itemid`, `price`, `pitc
(994782, 9201082, 2030007, 1800000, 0, 70),
(994783, 9201082, 4001017, 60000000, 0, 71);
-UPDATE shopitems SET price = 11*price WHERE (`position` >= 27 and `position` <= 67 and `shopid` = 9201082);
\ No newline at end of file
+UPDATE shopitems SET price = 11*price WHERE (`position` >= 27 and `position` <= 67 and `shopid` = 9201082);
+
+INSERT IGNORE INTO `shopitems` (`shopid`, `itemid`, `price`, `pitch`, `position`) VALUES
+(9120002, 3010005, 5000, 0, 80),
+(9120002, 3010004, 5000, 0, 84),
+(9120002, 3010006, 5000, 0, 88),
+(9120002, 3010003, 5000, 0, 92),
+(9120002, 3010002, 5000, 0, 96),
+(9120002, 2061003, 40, 0, 100),
+(9201020, 3010011, 1200, 0, 92),
+(9201020, 3010009, 4200, 0, 96),
+(9201020, 3010014, 15000, 0, 100),
+(1031100, 3010015, 20000, 0, 100),
+(1081000, 3010013, 100000, 0, 100),
+(9110002, 3010019, 200000, 0, 80),
+(9110002, 3010017, 1000000, 0, 84),
+(9110002, 3010016, 1000000, 0, 88),
+(9110002, 3010008, 1000000, 0, 92),
+(9110002, 3010007, 1000000, 0, 96),
+(9110002, 3011000, 4200000, 0, 100);
diff --git a/src/client/MapleBuffStat.java b/src/client/MapleBuffStat.java
index 206a2c9e2b..a6c930aeda 100644
--- a/src/client/MapleBuffStat.java
+++ b/src/client/MapleBuffStat.java
@@ -41,9 +41,9 @@ public enum MapleBuffStat {
HAMSTRING(0x800L),
BLIND(0x1000L),
CONCENTRATE(0x2000L),
- //4000L
+ HPREC(0x4000L),
ECHO_OF_HERO(0x8000L),
- //10000L
+ MPREC(0x10000L),
GHOST_MORPH(0x20000L),
AURA(0x40000L),
CONFUSE(0x80000L),
@@ -63,7 +63,7 @@ public enum MapleBuffStat {
BERSERK_FURY(0x8000000L),
DIVINE_BODY(0x10000000L),
SPARK(0x20000000L),
- //40000000L
+ //0x40000000L
FINALATTACK(0x80000000L),
BATTLESHIP(0xA00000040L), // weird one
WATK(0x100000000L),
diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java
index 227a9397a6..c233f8fef7 100644
--- a/src/client/MapleCharacter.java
+++ b/src/client/MapleCharacter.java
@@ -54,7 +54,6 @@ import java.util.regex.Pattern;
import net.server.PlayerBuffValueHolder;
import net.server.PlayerCoolDownValueHolder;
-import net.server.PlayerDiseaseValueHolder;
import net.server.Server;
import net.server.channel.Channel;
import net.server.guild.MapleAlliance;
@@ -182,7 +181,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private int mapid;
private int gender;
private int currentPage, currentType = 0, currentTab = 1;
- private int chair;
private int itemEffect;
private int guildid, guildRank, allianceRank;
private int messengerposition = 4;
@@ -202,7 +200,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1;
private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses;
private int married;
- private long dojoFinish, lastfametime, lastUsedCashItem, lastHealed, lastMesoDrop = -1, jailExpiration = -1;
+ private long lastfametime, lastUsedCashItem, lastHealed, lastMesoDrop = -1, jailExpiration = -1;
private transient int localmaxhp, localmaxmp, localstr, localdex, localluk, localint_, magic, watk;
private boolean hidden, canDoor = true, Berserk, hasMerchant, whiteChat = false;
private int linkedLevel = 0;
@@ -215,6 +213,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private AtomicInteger exp = new AtomicInteger();
private AtomicInteger gachaexp = new AtomicInteger();
private AtomicInteger meso = new AtomicInteger();
+ private AtomicInteger chair = new AtomicInteger();
private int merchantmeso;
private BuddyList buddylist;
private EventInstanceManager eventInstance = null;
@@ -224,7 +223,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private MaplePartyCharacter mpc = null;
private MapleInventory[] inventory;
private MapleJob job = MapleJob.BEGINNER;
- private MapleMap map, dojoMap;//Make a Dojo pq instance
+ private MapleMap map;
private MapleMessenger messenger = null;
private MapleMiniGame miniGame;
private MapleMount maplemount;
@@ -235,6 +234,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private MapleSkinColor skinColor = MapleSkinColor.NORMAL;
private MapleStorage storage = null;
private MapleTrade trade = null;
+ private MonsterBook monsterbook;
+ private MapleRing marriageRing;
+ private CashShop cashshop;
private SavedLocation savedLocations[];
private SkillMacro[] skillMacros = new SkillMacro[5];
private List lastmonthfameids;
@@ -249,34 +251,32 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private Map keymap = new LinkedHashMap<>();
private Map summons = new LinkedHashMap<>();
private Map coolDowns = new LinkedHashMap<>(50);
- private EnumMap diseases = new EnumMap<>(MapleDisease.class);
+ private EnumMap diseases = new EnumMap<>(MapleDisease.class);
private Map doors = new LinkedHashMap<>();
private ScheduledFuture> dragonBloodSchedule;
- private ScheduledFuture> mapTimeLimitTask = null;
private ScheduledFuture>[] fullnessSchedule = new ScheduledFuture>[3];
private ScheduledFuture> hpDecreaseTask;
private ScheduledFuture> beholderHealingSchedule, beholderBuffSchedule, BerserkSchedule;
private ScheduledFuture> expiretask;
- private ScheduledFuture> recoveryTask;
+ private ScheduledFuture> recoveryTask = null;
+ private ScheduledFuture> extraRecoveryTask = null;
+ private ScheduledFuture> chairRecoveryTask = null;
+ private ScheduledFuture> pendantOfSpirit = null; //1122017
private List> timers = new ArrayList<>();
- private Lock couponLock = new ReentrantLock();
+ private Lock chrLock = new ReentrantLock();
private NumberFormat nf = new DecimalFormat("#,###,###,###");
private ArrayList excluded = new ArrayList<>();
- private MonsterBook monsterbook;
private List crushRings = new ArrayList<>();
private List friendshipRings = new ArrayList<>();
- private MapleRing marriageRing;
private static String[] ariantroomleader = new String[3];
private static int[] ariantroomslot = new int[3];
- private CashShop cashshop;
private long portaldelay = 0, lastcombo = 0;
private short combocounter = 0;
private List blockedPortals = new ArrayList<>();
private Map area_info = new LinkedHashMap<>();
private AutobanManager autoban;
private boolean isbanned = false;
- private ScheduledFuture> pendantOfSpirit = null; //1122017
- private byte pendantExp = 0, lastmobcount = 0;
+ private byte pendantExp = 0, lastmobcount = 0, doorSlot = -1;
private List trockmaps = new ArrayList<>();
private List viptrockmaps = new ArrayList<>();
private Map events = new LinkedHashMap<>();
@@ -290,6 +290,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private int newWarpMap = -1;
private boolean canWarpMap = true; //only one "warp" must be used per call, and this will define the right one.
private int canWarpCounter = 0; //counts how many times "inner warps" have been called.
+ private byte extraHpRec = 0, extraMpRec = 0;
+ private short extraRecInterval;
+ private int targetHpBarHash = 0;
+ private long targetHpBarTime = 0;
private MapleCharacter() {
useCS = false;
@@ -456,7 +460,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
int pts = 0;
if (dojoPoints < 17000) {
pts = 1 + ((getMap().getId() - 1) / 100 % 100) / 6;
- if (!dojoParty) {
+ if (!getDojoParty()) {
pts++;
}
this.dojoPoints += pts;
@@ -465,11 +469,21 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void addDoor(Integer owner, MapleDoor door) {
- doors.put(owner, door);
+ chrLock.lock();
+ try {
+ doors.put(owner, door);
+ } finally {
+ chrLock.unlock();
+ }
}
public void removeDoor(Integer owner) {
- doors.remove(owner);
+ chrLock.lock();
+ try {
+ doors.remove(owner);
+ } finally {
+ chrLock.unlock();
+ }
}
public void addExcluded(int x) {
@@ -699,9 +713,23 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public void cancelAllBuffs(boolean disconnect) {
if (disconnect) {
- effects.clear();
+ chrLock.lock();
+ try {
+ effects.clear();
+ } finally {
+ chrLock.unlock();
+ }
} else {
- for (MapleBuffStatValueHolder mbsvh : new ArrayList<>(effects.values())) {
+ List mbsvhList;
+
+ chrLock.lock();
+ try {
+ mbsvhList = new ArrayList<>(effects.values());
+ } finally {
+ chrLock.unlock();
+ }
+
+ for (MapleBuffStatValueHolder mbsvh : mbsvhList) {
cancelEffect(mbsvh.effect, false, mbsvh.startTime);
}
}
@@ -757,10 +785,15 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void cancelBuffEffects() {
- for (MapleBuffStatValueHolder mbsvh : effects.values()) {
- mbsvh.schedule.cancel(false);
+ chrLock.lock();
+ try {
+ for (MapleBuffStatValueHolder mbsvh : effects.values()) {
+ mbsvh.schedule.cancel(false);
+ }
+ this.effects.clear();
+ } finally {
+ chrLock.unlock();
}
- this.effects.clear();
}
public String getMedalText() {
@@ -816,11 +849,16 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
}
if (effect.isMagicDoor()) {
- MapleDoor destroyDoor = doors.remove(this.getId());
+ MapleDoor destroyDoor;
+
+ chrLock.lock();
+ try {
+ destroyDoor = doors.remove(this.getId());
+ } finally {
+ chrLock.unlock();
+ }
if (destroyDoor != null) {
- destroyDoor.freeAllocatedPortal();
-
destroyDoor.getTarget().removeMapObject(destroyDoor.getAreaDoor());
destroyDoor.getTown().removeMapObject(destroyDoor.getTownDoor());
@@ -864,7 +902,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void cancelEffectFromBuffStat(MapleBuffStat stat) {
- MapleBuffStatValueHolder effect = effects.get(stat);
+ MapleBuffStatValueHolder effect;
+
+ chrLock.lock();
+ try {
+ effect = effects.get(stat);
+ } finally {
+ chrLock.unlock();
+ }
if (effect != null) {
cancelEffect(effect.effect, false, -1);
}
@@ -919,19 +964,22 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void cancelMagicDoor() {
- for (MapleBuffStatValueHolder mbsvh : new ArrayList<>(effects.values())) {
+ List mbsvhList;
+
+ chrLock.lock();
+ try {
+ mbsvhList = new ArrayList<>(effects.values());
+ } finally {
+ chrLock.unlock();
+ }
+
+ for (MapleBuffStatValueHolder mbsvh : mbsvhList) {
if (mbsvh.effect.isMagicDoor()) {
cancelEffect(mbsvh.effect, false, mbsvh.startTime);
}
}
}
- public void cancelMapTimeLimitTask() {
- if (mapTimeLimitTask != null) {
- mapTimeLimitTask.cancel(false);
- }
- }
-
private void cancelPlayerBuffs(List buffstats) {
if (client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null) {
recalcLocalStats();
@@ -1198,7 +1246,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
changeMap(to, to.getPortal(0));
}
- // not always the MapleMap target will be the map the player will be inserted, why would this even exist? Whatever.
public void changeMap(final MapleMap target, final MaplePortal pto) {
canWarpCounter++;
@@ -1223,21 +1270,26 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if(canWarpCounter == 0) canWarpMap = true;
}
- private boolean buffMapProtection() {
- for(Entry mbs : effects.entrySet()) {
- if(mbs.getKey() == MapleBuffStat.MAP_PROTECTION) {
- byte value = (byte)mbs.getValue().value;
- MapleMap map = client.getChannelServer().getMapFactory().getMap(mapid);
-
- if(value == 1 && map.getReturnMapId() == 211000000) return(true); //protection from cold
- else if(value == 2 && map.getReturnMapId() == 230000000) return(true); //breathing underwater
-
- else return(false);
- }
+ private boolean buffMapProtection() {
+ chrLock.lock();
+ try {
+ MapleMap thisMap = client.getChannelServer().getMapFactory().getMap(mapid);
+
+ for(Entry mbs : effects.entrySet()) {
+ if(mbs.getKey() == MapleBuffStat.MAP_PROTECTION) {
+ byte value = (byte)mbs.getValue().value;
+
+ if(value == 1 && thisMap.getReturnMapId() == 211000000) return true; //protection from cold
+ else if(value == 2 && thisMap.getReturnMapId() == 230000000) return true; //breathing underwater
+ else return false;
+ }
+ }
+ } finally {
+ chrLock.unlock();
}
for(Item it: this.getInventory(MapleInventoryType.EQUIPPED).list()) {
- if((it.getFlag() & ItemConstants.COLD) == ItemConstants.COLD && map.getReturnMapId() == 211000000) return(true); //protection from cold
+ if((it.getFlag() & ItemConstants.COLD) == ItemConstants.COLD && map.getReturnMapId() == 211000000) return true; //protection from cold
}
return false;
@@ -1247,6 +1299,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if(!canWarpMap) return;
this.closePlayerInteractions();
+ this.resetPlayerAggro();
+
client.announce(warpPacket);
map.removePlayer(this);
if (client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null) {
@@ -1800,54 +1854,152 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
private List deregisterBuffStats(List stats) {
- List effectsToCancel = new ArrayList<>(stats.size());
- for (MapleBuffStat stat : stats) {
- MapleBuffStatValueHolder mbsvh = effects.get(stat);
- if (mbsvh != null) {
- effects.remove(stat);
- boolean addMbsvh = true;
- for (MapleBuffStatValueHolder contained : effectsToCancel) {
- if (mbsvh.startTime == contained.startTime && contained.effect == mbsvh.effect) {
- addMbsvh = false;
- }
- }
- if (addMbsvh) {
- effectsToCancel.add(mbsvh);
- }
- if (stat == MapleBuffStat.RECOVERY) {
- if (recoveryTask != null) {
- recoveryTask.cancel(false);
- recoveryTask = null;
- }
- } else if (stat == MapleBuffStat.SUMMON || stat == MapleBuffStat.PUPPET) {
- int summonId = mbsvh.effect.getSourceId();
-
- MapleSummon summon = summons.get(summonId);
- if (summon != null) {
- getMap().broadcastMessage(MaplePacketCreator.removeSummon(summon, true), summon.getPosition());
- getMap().removeMapObject(summon);
- removeVisibleMapObject(summon);
- summons.remove(summonId);
-
- if (summon.getSkill() == DarkKnight.BEHOLDER) {
- if (beholderHealingSchedule != null) {
- beholderHealingSchedule.cancel(false);
- beholderHealingSchedule = null;
- }
- if (beholderBuffSchedule != null) {
- beholderBuffSchedule.cancel(false);
- beholderBuffSchedule = null;
- }
+ chrLock.lock();
+ try {
+ List effectsToCancel = new ArrayList<>(stats.size());
+ for (MapleBuffStat stat : stats) {
+ MapleBuffStatValueHolder mbsvh = effects.get(stat);
+ if (mbsvh != null) {
+ effects.remove(stat);
+ boolean addMbsvh = true;
+ for (MapleBuffStatValueHolder contained : effectsToCancel) {
+ if (mbsvh.startTime == contained.startTime && contained.effect == mbsvh.effect) {
+ addMbsvh = false;
+ }
+ }
+ if (addMbsvh) {
+ effectsToCancel.add(mbsvh);
+ }
+ if (stat == MapleBuffStat.RECOVERY) {
+ if (recoveryTask != null) {
+ recoveryTask.cancel(false);
+ recoveryTask = null;
+ }
+ } else if (stat == MapleBuffStat.SUMMON || stat == MapleBuffStat.PUPPET) {
+ int summonId = mbsvh.effect.getSourceId();
+
+ MapleSummon summon = summons.get(summonId);
+ if (summon != null) {
+ getMap().broadcastMessage(MaplePacketCreator.removeSummon(summon, true), summon.getPosition());
+ getMap().removeMapObject(summon);
+ removeVisibleMapObject(summon);
+ summons.remove(summonId);
+
+ if (summon.getSkill() == DarkKnight.BEHOLDER) {
+ if (beholderHealingSchedule != null) {
+ beholderHealingSchedule.cancel(false);
+ beholderHealingSchedule = null;
+ }
+ if (beholderBuffSchedule != null) {
+ beholderBuffSchedule.cancel(false);
+ beholderBuffSchedule = null;
+ }
+ }
+ }
+ } else if (stat == MapleBuffStat.DRAGONBLOOD) {
+ dragonBloodSchedule.cancel(false);
+ dragonBloodSchedule = null;
+ } else if (stat == MapleBuffStat.HPREC || stat == MapleBuffStat.MPREC) {
+ if(stat == MapleBuffStat.HPREC) {
+ extraHpRec = 0;
+ } else {
+ extraMpRec = 0;
+ }
+
+ if (extraRecoveryTask != null) {
+ extraRecoveryTask.cancel(false);
+ extraRecoveryTask = null;
+ }
+
+ if(extraHpRec > 0 || extraMpRec > 0) {
+ startExtraTaskInternal(extraHpRec, extraMpRec, extraRecInterval);
}
}
- } else if (stat == MapleBuffStat.DRAGONBLOOD) {
- dragonBloodSchedule.cancel(false);
- dragonBloodSchedule = null;
}
}
- }
- return effectsToCancel;
+ return effectsToCancel;
+ } finally {
+ chrLock.unlock();
+ }
+ }
+
+ public void stopChairTask() {
+ chrLock.lock();
+ try {
+ if (chairRecoveryTask != null) {
+ chairRecoveryTask.cancel(false);
+ chairRecoveryTask = null;
+ }
+ } finally {
+ chrLock.unlock();
+ }
+ }
+
+ public void startChairTask() {
+ if(!ServerConstants.USE_CHAIR_EXTRAHEAL || chair.get() == 0) return;
+
+ final int healInterval = 5000;
+ final byte healHP = (byte) Math.max(ServerConstants.CHAIR_EXTRA_HEAL_HP, 1);
+ final byte healMP = (byte) Math.max(ServerConstants.CHAIR_EXTRA_HEAL_MP, 0);
+
+ chrLock.lock();
+ try {
+ chairRecoveryTask = TimerManager.getInstance().register(new Runnable() {
+ @Override
+ public void run() {
+ if(hp < localmaxhp) {
+ client.announce(MaplePacketCreator.showOwnRecovery(healHP));
+ getMap().broadcastMessage(MapleCharacter.this, MaplePacketCreator.showRecovery(id, healHP), false);
+ }
+
+ addHP(healHP);
+ addMP(healMP);
+ }
+ }, healInterval, healInterval);
+ } finally {
+ chrLock.unlock();
+ }
+ }
+
+ private void stopExtraTask() {
+ chrLock.lock();
+ try {
+ if (extraRecoveryTask != null) {
+ extraRecoveryTask.cancel(false);
+ extraRecoveryTask = null;
+ }
+ } finally {
+ chrLock.unlock();
+ }
+ }
+
+ private void startExtraTask(final byte healHP, final byte healMP, final short healInterval) {
+ chrLock.lock();
+ try {
+ startExtraTaskInternal(healHP, healMP, healInterval);
+ } finally {
+ chrLock.unlock();
+ }
+ }
+
+ private void startExtraTaskInternal(final byte healHP, final byte healMP, final short healInterval) {
+ extraRecInterval = healInterval;
+
+ extraRecoveryTask = TimerManager.getInstance().register(new Runnable() {
+ @Override
+ public void run() {
+ if(hp < localmaxhp) {
+ if(healHP > 0) {
+ client.announce(MaplePacketCreator.showOwnRecovery(healHP));
+ getMap().broadcastMessage(MapleCharacter.this, MaplePacketCreator.showRecovery(id, healHP), false);
+ }
+ }
+
+ addHP(healHP);
+ addMP(healMP);
+ }
+ }, healInterval, healInterval);
}
public void disableDoor() {
@@ -1872,42 +2024,48 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void dispel() {
- for (MapleBuffStatValueHolder mbsvh : new ArrayList<>(effects.values())) {
+ List mbsvhList;
+
+ chrLock.lock();
+ try {
+ mbsvhList = new ArrayList<>(effects.values());
+ } finally {
+ chrLock.unlock();
+ }
+
+ for (MapleBuffStatValueHolder mbsvh : mbsvhList) {
if (mbsvh.effect.isSkill()) {
cancelEffect(mbsvh.effect, false, mbsvh.startTime);
}
}
}
- public final List getAllDiseases() {
- final List ret = new ArrayList<>(5);
-
- DiseaseValueHolder vh;
- for (Entry disease : diseases.entrySet()) {
- vh = disease.getValue();
- ret.add(new PlayerDiseaseValueHolder(disease.getKey(), vh.startTime, vh.length));
- }
- return ret;
- }
-
public final boolean hasDisease(final MapleDisease dis) {
- for (final MapleDisease disease : diseases.keySet()) {
- if (disease == dis) {
- return true;
- }
+ chrLock.lock();
+ try {
+ return diseases.containsKey(dis);
+ } finally {
+ chrLock.unlock();
+ }
+ }
+
+ public final int getDiseasesSize() {
+ chrLock.lock();
+ try {
+ return diseases.size();
+ } finally {
+ chrLock.unlock();
}
- return false;
}
public void giveDebuff(final MapleDisease disease, MobSkill skill) {
- final List> debuff = Collections.singletonList(new Pair<>(disease, Integer.valueOf(skill.getX())));
-
- if (!hasDisease(disease) && diseases.size() < 2) {
+ if (!hasDisease(disease) && getDiseasesSize() < 2) {
if (!(disease == MapleDisease.SEDUCE || disease == MapleDisease.STUN)) {
if (isActiveBuffedValue(Bishop.HOLY_SHIELD)) {
return;
}
}
+
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
@@ -1915,7 +2073,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
}, skill.getDuration());
- diseases.put(disease, new DiseaseValueHolder(System.currentTimeMillis(), skill.getDuration()));
+ chrLock.lock();
+ try {
+ diseases.put(disease, new MapleDiseaseValueHolder(System.currentTimeMillis(), skill.getDuration()));
+ } finally {
+ chrLock.unlock();
+ }
+
+ final List> debuff = Collections.singletonList(new Pair<>(disease, Integer.valueOf(skill.getX())));
client.announce(MaplePacketCreator.giveDebuff(debuff, skill));
map.broadcastMessage(this, MaplePacketCreator.giveForeignDebuff(id, debuff, skill), false);
}
@@ -1927,7 +2092,12 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
announce(MaplePacketCreator.cancelDebuff(mask));
map.broadcastMessage(this, MaplePacketCreator.cancelForeignDebuff(id, mask), false);
- diseases.remove(debuff);
+ chrLock.lock();
+ try {
+ diseases.remove(debuff);
+ } finally {
+ chrLock.unlock();
+ }
}
}
@@ -1940,11 +2110,23 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void cancelAllDebuffs() {
- diseases.clear();
+ chrLock.lock();
+ try {
+ diseases.clear();
+ } finally {
+ chrLock.unlock();
+ }
}
public void dispelSkill(int skillid) {
- LinkedList allBuffs = new LinkedList<>(effects.values());
+ LinkedList allBuffs;
+ chrLock.lock();
+ try {
+ allBuffs = new LinkedList<>(effects.values());
+ } finally {
+ chrLock.unlock();
+ }
+
for (MapleBuffStatValueHolder mbsvh : allBuffs) {
if (skillid == 0) {
if (mbsvh.effect.isSkill() && (mbsvh.effect.getSourceId() % 10000000 == 1004 || dispelSkills(mbsvh.effect.getSourceId()))) {
@@ -2237,20 +2419,30 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public List getAllBuffs() {
- List ret = new ArrayList<>();
- for (MapleBuffStatValueHolder mbsvh : effects.values()) {
- ret.add(new PlayerBuffValueHolder(mbsvh.startTime, mbsvh.effect));
+ chrLock.lock();
+ try {
+ List ret = new ArrayList<>();
+ for (MapleBuffStatValueHolder mbsvh : effects.values()) {
+ ret.add(new PlayerBuffValueHolder(mbsvh.startTime, mbsvh.effect));
+ }
+ return ret;
+ } finally {
+ chrLock.unlock();
}
- return ret;
}
public List> getAllStatups() {
- List> ret = new ArrayList<>();
- for (MapleBuffStat mbs : effects.keySet()) {
- MapleBuffStatValueHolder mbsvh = effects.get(mbs);
- ret.add(new Pair<>(mbs, mbsvh.value));
+ chrLock.lock();
+ try {
+ List> ret = new ArrayList<>();
+ for (MapleBuffStat mbs : effects.keySet()) {
+ MapleBuffStatValueHolder mbsvh = effects.get(mbs);
+ ret.add(new Pair<>(mbs, mbsvh.value));
+ }
+ return ret;
+ } finally {
+ chrLock.unlock();
}
- return ret;
}
public List getAllCooldowns() {
@@ -2311,52 +2503,77 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public Long getBuffedStarttime(MapleBuffStat effect) {
- MapleBuffStatValueHolder mbsvh = effects.get(effect);
- if (mbsvh == null) {
- return null;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(effect);
+ if (mbsvh == null) {
+ return null;
+ }
+ return Long.valueOf(mbsvh.startTime);
+ } finally {
+ chrLock.unlock();
}
- return Long.valueOf(mbsvh.startTime);
}
public Integer getBuffedValue(MapleBuffStat effect) {
- MapleBuffStatValueHolder mbsvh = effects.get(effect);
- if (mbsvh == null) {
- return null;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(effect);
+ if (mbsvh == null) {
+ return null;
+ }
+ return Integer.valueOf(mbsvh.value);
+ } finally {
+ chrLock.unlock();
}
- return Integer.valueOf(mbsvh.value);
}
public int getBuffSource(MapleBuffStat stat) {
- MapleBuffStatValueHolder mbsvh = effects.get(stat);
- if (mbsvh == null) {
- return -1;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(stat);
+ if (mbsvh == null) {
+ return -1;
+ }
+ return mbsvh.effect.getSourceId();
+ } finally {
+ chrLock.unlock();
}
- return mbsvh.effect.getSourceId();
}
public MapleStatEffect getBuffEffect(MapleBuffStat stat) {
- MapleBuffStatValueHolder mbsvh = effects.get(stat);
- if (mbsvh == null) {
- return null;
- } else {
- return mbsvh.effect;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(stat);
+ if (mbsvh == null) {
+ return null;
+ } else {
+ return mbsvh.effect;
+ }
+ } finally {
+ chrLock.unlock();
}
}
private List getBuffStats(MapleStatEffect effect, long startTime) {
- List stats = new ArrayList<>();
- for (Entry stateffect : effects.entrySet()) {
- if(stateffect.getValue() == null) continue;
-
- if (stateffect.getValue().effect.sameSource(effect) && (startTime == -1 || startTime == stateffect.getValue().startTime)) {
- stats.add(stateffect.getKey());
+ chrLock.lock();
+ try {
+ List stats = new ArrayList<>();
+ for (Entry stateffect : effects.entrySet()) {
+ if(stateffect.getValue() == null) continue;
+
+ if (stateffect.getValue().effect.sameSource(effect) && (startTime == -1 || startTime == stateffect.getValue().startTime)) {
+ stats.add(stateffect.getKey());
+ }
}
+ return stats;
+ } finally {
+ chrLock.unlock();
}
- return stats;
}
public int getChair() {
- return chair;
+ return chair.get();
}
public String getChalkboard() {
@@ -2422,7 +2639,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public boolean getDojoParty() {
- return dojoParty;
+ return mapid >= 925030100 && mapid < 925040000;
}
public int getDojoPoints() {
@@ -2434,7 +2651,12 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public Map getDoors() {
- return Collections.unmodifiableMap(doors);
+ chrLock.lock();
+ try {
+ return Collections.unmodifiableMap(doors);
+ } finally {
+ chrLock.unlock();
+ }
}
public int getEnergyBar() {
@@ -2788,6 +3010,40 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public void setMPC(MaplePartyCharacter mpc) {
this.mpc = mpc;
}
+
+ public int getTargetHpBarHash() {
+ return this.targetHpBarHash;
+ }
+
+ public void setTargetHpBarHash(int mobHash) {
+ this.targetHpBarHash = mobHash;
+ }
+
+ public long getTargetHpBarTime() {
+ return this.targetHpBarTime;
+ }
+
+ public void setTargetHpBarTime(long timeNow) {
+ this.targetHpBarTime = timeNow;
+ }
+
+ public void setPlayerAggro(int mobHash) {
+ setTargetHpBarHash(mobHash);
+ setTargetHpBarTime(System.currentTimeMillis());
+ }
+
+ public void resetPlayerAggro() {
+ setTargetHpBarHash(0);
+ setTargetHpBarTime(0);
+ }
+
+ public int getDoorSlot() {
+ if(doorSlot == -1) {
+ doorSlot = (party == null) ? 0 : party.getPartyDoor(this.getId());
+ }
+
+ return doorSlot;
+ }
public MapleMiniGame getMiniGame() {
return miniGame;
@@ -3207,11 +3463,16 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public MapleStatEffect getStatForBuff(MapleBuffStat effect) {
- MapleBuffStatValueHolder mbsvh = effects.get(effect);
- if (mbsvh == null) {
- return null;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(effect);
+ if (mbsvh == null) {
+ return null;
+ }
+ return mbsvh.effect;
+ } finally {
+ chrLock.unlock();
}
- return mbsvh.effect;
}
public MapleStorage getStorage() {
@@ -3422,7 +3683,15 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public boolean isActiveBuffedValue(int skillid) {
- LinkedList allBuffs = new LinkedList<>(effects.values());
+ LinkedList allBuffs;
+
+ chrLock.lock();
+ try {
+ allBuffs = new LinkedList<>(effects.values());
+ } finally {
+ chrLock.unlock();
+ }
+
for (MapleBuffStatValueHolder mbsvh : allBuffs) {
if (mbsvh.effect.isSkill() && mbsvh.effect.getSourceId() == skillid) {
return true;
@@ -3436,11 +3705,16 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public boolean isBuffFrom(MapleBuffStat stat, Skill skill) {
- MapleBuffStatValueHolder mbsvh = effects.get(stat);
- if (mbsvh == null) {
- return false;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(stat);
+ if (mbsvh == null) {
+ return false;
+ }
+ return mbsvh.effect.isSkill() && mbsvh.effect.getSourceId() == skill.getId();
+ } finally {
+ chrLock.unlock();
}
- return mbsvh.effect.isSkill() && mbsvh.effect.getSourceId() == skill.getId();
}
public boolean isCygnus() {
@@ -3456,7 +3730,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public boolean isGM() {
- return gmLevel > 0;
+ return gmLevel > 1;
}
public boolean isHidden() {
@@ -3478,9 +3752,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public void leaveMap() {
controlled.clear();
visibleMapObjects.clear();
- if (chair != 0) {
- chair = 0;
- }
+ chair.set(0);
if (hpDecreaseTask != null) {
hpDecreaseTask.cancel(false);
}
@@ -3672,7 +3944,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} else if (level == 85) {
yellowMessage("Did you know? The majority of people who hit level 85 in Solaxia don't live to be 85 years old?");
} else if (level == 90) {
- yellowMessage("Hey do you like the amusement park? I heard Spooky Wood is the best theme park around. I heard they sell cute teddy-bears.");
+ yellowMessage("Hey do you like the amusement park? I heard Spooky World is the best theme park around. I heard they sell cute teddy-bears.");
} else if (level == 95) {
yellowMessage("100% of people who hit level 95 in Solaxia don't live to be 95 years old.");
} else if (level == 100) {
@@ -3762,13 +4034,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void updateCouponRates() {
- try {
- couponLock.lock();
- revertCouponRates();
- setCouponRates();
- } finally {
- couponLock.unlock();
- }
+ revertCouponRates();
+ setCouponRates();
}
public void resetPlayerRates() {
@@ -3855,22 +4122,27 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
private void setActiveCoupons() {
- activeCoupons.clear();
- activeCouponRates.clear();
-
- Map coupons = Server.getInstance().getCouponRates();
- List active = Server.getInstance().getActiveCoupons();
-
- for(Item it: this.getInventory(MapleInventoryType.CASH).list()) {
- if(MapleItemInformationProvider.getInstance().isRateCoupon(it.getItemId()) && active.contains(it.getItemId())) {
- Integer count = activeCoupons.get(it.getItemId());
-
- if(count != null) activeCoupons.put(it.getItemId(), count + 1);
- else {
- activeCoupons.put(it.getItemId(), 1);
- activeCouponRates.put(it.getItemId(), coupons.get(it.getItemId()));
+ chrLock.lock();
+ try {
+ activeCoupons.clear();
+ activeCouponRates.clear();
+
+ Map coupons = Server.getInstance().getCouponRates();
+ List active = Server.getInstance().getActiveCoupons();
+
+ for(Item it: this.getInventory(MapleInventoryType.CASH).list()) {
+ if(MapleItemInformationProvider.getInstance().isRateCoupon(it.getItemId()) && active.contains(it.getItemId())) {
+ Integer count = activeCoupons.get(it.getItemId());
+
+ if(count != null) activeCoupons.put(it.getItemId(), count + 1);
+ else {
+ activeCoupons.put(it.getItemId(), 1);
+ activeCouponRates.put(it.getItemId(), coupons.get(it.getItemId()));
+ }
}
}
+ } finally {
+ chrLock.unlock();
}
}
@@ -3882,7 +4154,15 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void dispelBuffCoupons() {
- LinkedList allBuffs = new LinkedList<>(effects.values());
+ LinkedList allBuffs;
+
+ chrLock.lock();
+ try {
+ allBuffs = new LinkedList<>(effects.values());
+ } finally {
+ chrLock.unlock();
+ }
+
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
for (MapleBuffStatValueHolder mbsvh : allBuffs) {
@@ -4431,7 +4711,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
cancelEffectFromBuffStat(MapleBuffStat.MONSTER_RIDING);
}
- if (getChair() == -1) {
+ if (getChair() != 0) {
setChair(0);
client.announce(MaplePacketCreator.cancelChair(-1));
getMap().broadcastMessage(this, MaplePacketCreator.showChair(getId(), 0), false);
@@ -4646,17 +4926,40 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
getMap().broadcastMessage(MapleCharacter.this, MaplePacketCreator.showRecovery(id, heal), false);
}
}, healInterval, healInterval);
+ } else if (effect.isDojoBuff()) {
+ boolean isRecoveryBuff = false;
+ if(effect.getHpRRate() > 0) {
+ extraHpRec = effect.getHpR();
+ extraRecInterval = effect.getHpRRate();
+ isRecoveryBuff = true;
+ }
+
+ if(effect.getMpRRate() > 0) {
+ extraMpRec = effect.getMpR();
+ extraRecInterval = effect.getMpRRate();
+ isRecoveryBuff = true;
+ }
+
+ if(isRecoveryBuff) {
+ stopExtraTask();
+ startExtraTask(extraHpRec, extraMpRec, extraRecInterval); // HP & MP sharing the same task holder
+ }
}
- //is it possible to maintain a list of statup effects of the same type concurrently? Pair
- for (Pair statup : effect.getStatups()) {
- effects.put(statup.getLeft(), new MapleBuffStatValueHolder(effect, starttime, schedule, statup.getRight()));
+ chrLock.lock();
+ try {
+ for (Pair statup : effect.getStatups()) {
+ effects.put(statup.getLeft(), new MapleBuffStatValueHolder(effect, starttime, schedule, statup.getRight()));
+ }
+ } finally {
+ chrLock.unlock();
}
+
recalcLocalStats();
}
public void removeAllCooldownsExcept(int id, boolean packet) {
- for (MapleCoolDownValueHolder mcvh : coolDowns.values()) {
+ for (MapleCoolDownValueHolder mcvh : Collections.unmodifiableCollection(coolDowns.values())) {
if (mcvh.skillId != id) {
coolDowns.remove(mcvh.skillId);
if (packet) {
@@ -5274,15 +5577,20 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public void setBuffedValue(MapleBuffStat effect, int value) {
- MapleBuffStatValueHolder mbsvh = effects.get(effect);
- if (mbsvh == null) {
- return;
+ chrLock.lock();
+ try {
+ MapleBuffStatValueHolder mbsvh = effects.get(effect);
+ if (mbsvh == null) {
+ return;
+ }
+ mbsvh.value = value;
+ } finally {
+ chrLock.unlock();
}
- mbsvh.value = value;
}
public void setChair(int chair) {
- this.chair = chair;
+ this.chair.set(chair);
}
public void setChalkboard(String text) {
@@ -5298,10 +5606,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
this.dojoEnergy = x;
}
- public void setDojoParty(boolean b) {
- this.dojoParty = b;
- }
-
public void setDojoPoints(int x) {
this.dojoPoints = x;
}
@@ -5310,12 +5614,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
this.dojoStage = x;
}
- public void setDojoStart() {
- this.dojoMap = map;
- int stage = (map.getId() / 100) % 100;
- this.dojoFinish = System.currentTimeMillis() + (stage > 36 ? 15 : stage / 6 + 5) * 60000;
- }
-
public void setEnergyBar(int set) {
energybar = set;
}
@@ -5597,8 +5895,13 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public void setParty(MapleParty party) {
if (party == null) {
this.mpc = null;
+ doorSlot = -1;
+
+ this.party = null;
+ //cancelMagicDoor(); // cancel magic doors if kicked out / quitted from party.
+ } else {
+ this.party = party;
}
- this.party = party;
}
public void setPlayerShop(MaplePlayerShop playerShop) {
@@ -5749,31 +6052,20 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
}
+ private long getDojoTimeLeft() {
+ return client.getChannelServer().getDojoFinishTime(map.getId()) - System.currentTimeMillis();
+ }
+
public void showDojoClock() {
- int stage = (map.getId() / 100) % 100;
- long time;
- if (stage % 6 == 1) {
- time = (stage > 36 ? 15 : stage / 6 + 5) * 60;
- } else {
- time = (dojoFinish - System.currentTimeMillis()) / 1000;
+ if (map.isDojoFightMap()) {
+ client.announce(MaplePacketCreator.getClock((int) (getDojoTimeLeft() / 1000)));
}
- if (stage % 6 > 0) {
- client.announce(MaplePacketCreator.getClock((int) time));
+ }
+
+ public void timeoutFromDojo() {
+ if(map.isDojoMap()) {
+ client.getPlayer().changeMap(client.getChannelServer().getMapFactory().getMap(925020000));
}
- boolean rightmap = true;
- int clockid = (dojoMap.getId() / 100) % 100;
- if (map.getId() > clockid / 6 * 6 + 6 || map.getId() < clockid / 6 * 6) {
- rightmap = false;
- }
- final boolean rightMap = rightmap; // lol
- TimerManager.getInstance().schedule(new Runnable() {
- @Override
- public void run() {
- if (rightMap) {
- client.getPlayer().changeMap(client.getChannelServer().getMapFactory().getMap(925020000));
- }
- }
- }, time * 1000 + 3000); // let the TIMES UP display for 3 seconds, then warp
}
public void showNote() {
@@ -6042,7 +6334,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
@Override
public void sendSpawnData(MapleClient client) {
- if (!this.isHidden() || client.getPlayer().gmLevel() > 0) {
+ if (!this.isHidden() || client.getPlayer().gmLevel() > 1) {
client.announce(MaplePacketCreator.spawnPlayerMapobject(this));
}
@@ -6407,6 +6699,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if (recoveryTask != null) {
recoveryTask.cancel(false);
}
+ if (extraRecoveryTask != null) {
+ extraRecoveryTask.cancel(false);
+ }
cancelExpirationTask();
for (ScheduledFuture> sf : timers) {
sf.cancel(false);
diff --git a/src/client/MapleClient.java b/src/client/MapleClient.java
index 74fde4ba5d..5b316c2782 100644
--- a/src/client/MapleClient.java
+++ b/src/client/MapleClient.java
@@ -69,6 +69,7 @@ import scripting.quest.QuestActionManager;
import scripting.quest.QuestScriptManager;
import server.MapleMiniGame;
import server.MaplePlayerShop;
+import server.life.MapleMonster;
import server.MapleTrade;
import server.TimerManager;
import server.maps.*;
@@ -1165,6 +1166,25 @@ public class MapleClient {
e.printStackTrace();
}
}
+
+ public synchronized void announceBossHpBar(MapleMonster mm, final int mobHash, final byte[] packet) {
+ long timeNow = System.currentTimeMillis();
+ int targetHash = player.getTargetHpBarHash();
+
+ if(mobHash != targetHash) {
+ if(timeNow - player.getTargetHpBarTime() >= 5 * 1000) {
+ // is there a way to INTERRUPT this annoying thread running on the client that drops the boss bar after some time at every attack?
+ announce(packet);
+
+ player.setTargetHpBarHash(mobHash);
+ player.setTargetHpBarTime(timeNow);
+ }
+ } else {
+ announce(packet);
+
+ player.setTargetHpBarTime(timeNow);
+ }
+ }
public synchronized void announce(final byte[] packet) {//MINA CORE IS A FUCKING BITCH AND I HATE IT <3
session.write(packet);
diff --git a/src/client/MapleDiseaseValueHolder.java b/src/client/MapleDiseaseValueHolder.java
new file mode 100644
index 0000000000..a7feab5530
--- /dev/null
+++ b/src/client/MapleDiseaseValueHolder.java
@@ -0,0 +1,34 @@
+/*
+ This file is part of the OdinMS Maple Story Server
+ Copyright (C) 2008 ~ 2010 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 .
+*/
+package client;
+
+/**
+ *
+ * @author anybody can do this
+ */
+public class MapleDiseaseValueHolder {
+ public long startTime, length;
+
+ public MapleDiseaseValueHolder(long start, long length) {
+ this.startTime = start;
+ this.length = length;
+ }
+}
diff --git a/src/client/command/Commands.java b/src/client/command/Commands.java
index a4af539440..097df28cb1 100644
--- a/src/client/command/Commands.java
+++ b/src/client/command/Commands.java
@@ -9,7 +9,7 @@
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.te
+ License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -100,24 +100,17 @@ import client.inventory.MapleInventoryType;
import client.inventory.MaplePet;
import constants.GameConstants;
import constants.ItemConstants;
-import constants.ServerConstants;
-import constants.skills.Assassin;
-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();
private static String[] tips = {
- "Please only use @gm in emergencies or to report somebody.",
+ "Please only use /gm in emergencies or to report somebody.",
"To report a bug or make a suggestion, use the forum.",
- "Please do not use @gm to ask if a GM is online.",
+ "Please do not use /gm to ask if a GM is online.",
"Do not ask if you can receive help, just state your issue.",
"Do not say 'I have a bug to report', just state it.",
};
@@ -338,48 +331,24 @@ public class Commands {
flag |= ItemConstants.UNTRADEABLE;
equip.setFlag(flag);
}
-
- public static boolean executePlayerCommand(MapleClient c, String[] sub, char heading) {
- MapleCharacter player = c.getPlayer();
- if (heading == '!' && player.gmLevel() == 0) {
- player.yellowMessage("You may not use !" + sub[0] + ", please try @" + sub[0] + ". For a full list of commands, try @help.");
- return false;
- }
- switch (sub[0]) {
+
+ public static boolean executeSolaxiaCommandLv0(Channel cserv, Server srv, MapleClient c, String[] sub) { //Player
+ MapleCharacter player = c.getPlayer();
+
+ switch(sub[0]) {
case "help":
case "commands":
case "playercommands":
- player.message("============================================================");
- player.message("MapleSolaxiaV2 Player Commands");
- player.message("============================================================");
- player.message("@dispose: Fixes your character if it is stuck.");
- player.message("@online: Displays a list of all online players.");
- player.message("@time: Displays the current server time.");
- player.message("@rates: Displays your current DROP, MESO and EXP rates.");
- player.message("@points: Tells you how many unused vote points you have and when/if you can vote.");
- player.message("@gm : Sends a message to all online GMs in the case of an emergency.");
- player.message("@bug : Sends a bug report to all developers.");
- player.message("@joinevent: If an event is in progress, use this to warp to the event map.");
- player.message("@leaveevent: If an event has ended, use this to warp to your original map.");
- player.message("@staff: Lists the staff of Solaxia.");
- player.message("@uptime: Shows how long Solaxia has been online.");
- player.message("@whatdropsfrom : Displays a list of drops and chances for a specified monster.");
- player.message("@whodrops - : Displays monsters that drop an item given an item name.");
- player.message("@uptime: Shows how long Solaxia has been online.");
- player.message("@bosshp: Displays the remaining HP of the bosses on your map.");
- player.message("@equiplv: Displays relations of level and experience of every item you have equipped.");
- if(ServerConstants.USE_DEBUG) {
- player.message("@debugpos: Displays the coordinates on the map the player is currently located.");
- player.message("@debugmap: Displays info about the current map the player is located.");
- player.message("@debugevent: Displays the name of the event in which the player is currently registered.");
- player.message("@debugreactors: Displays current info for all reactors on the map the player is currently located.");
- }
- break;
+ player.setCS(true);
+ c.getAbstractPlayerInteraction().openNpc(9201143);
+ break;
+
case "time":
DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
- dateFormat.setTimeZone(TimeZone.getTimeZone("EST"));
+ dateFormat.setTimeZone(TimeZone.getTimeZone("-GMT3"));
player.yellowMessage("Solaxia Server Time: " + dateFormat.format(new Date()));
break;
+
case "staff":
player.yellowMessage("MapleSolaxia Staff");
player.yellowMessage("Aria - Administrator");
@@ -394,6 +363,7 @@ public class Commands {
player.yellowMessage("Ronan - Freelance Developer");
player.yellowMessage("Vcoc - Freelance Developer");
break;
+
case "lastrestart":
case "uptime":
long milliseconds = System.currentTimeMillis() - Server.uptime;
@@ -401,8 +371,9 @@ public class Commands {
int minutes = (int) ((milliseconds / (1000*60)) % 60);
int hours = (int) ((milliseconds / (1000*60*60)) % 24);
int days = (int) ((milliseconds / (1000*60*60*24)));
- player.yellowMessage("Solaxia has been online for " + days + " days " + hours + " hours " + minutes + " minutes and " + seconds + " seconds.");
+ player.yellowMessage("Server has been online for " + days + " days " + hours + " hours " + minutes + " minutes and " + seconds + " seconds.");
break;
+
case "gacha":
Gachapon gacha = null;
String search = joinStringFrom(sub, 1);
@@ -416,11 +387,11 @@ public class Commands {
}
}
if (gacha == null){
- player.yellowMessage("Please use @gacha where name corresponds to one of the below:");
+ player.yellowMessage("Please use /gacha where name corresponds to one of the below:");
for (String name : names){
player.yellowMessage(name);
}
- break;
+ break;
}
String output = "The #b" + gachaName + "#k Gachapon contains the following items.\r\n\r\n";
for (int i = 0; i < 2; i++){
@@ -431,10 +402,11 @@ public class Commands {
output += "\r\nPlease keep in mind that there are items that are in all gachapons and are not listed here.";
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
break;
+
case "whatdropsfrom":
if (sub.length < 2) {
- player.dropMessage(5, "Please do @whatdropsfrom ");
- break;
+ player.dropMessage(5, "Please do /whatdropsfrom ");
+ break;
}
String monsterName = joinStringFrom(sub, 1);
output = "";
@@ -464,10 +436,11 @@ public class Commands {
}
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
break;
+
case "whodrops":
if (sub.length < 2) {
- player.dropMessage(5, "Please do @whodrops
- ");
- break;
+ player.dropMessage(5, "Please do /whodrops
- ");
+ break;
}
String searchString = joinStringFrom(sub, 1);
output = "";
@@ -492,17 +465,18 @@ public class Commands {
} catch (Exception e) {
player.dropMessage("There was a problem retreiving the required data. Please try again.");
e.printStackTrace();
- return true;
+ break;
}
output += "\r\n\r\n";
count++;
}
} else {
player.dropMessage(5, "The item you searched for doesn't exist.");
- break;
+ break;
}
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
break;
+
case "dispose":
NPCScriptManager.getInstance().dispose(c);
c.announce(MaplePacketCreator.enableActions());
@@ -549,6 +523,7 @@ public class Commands {
player.message("Players under level 10 always have 1x exp.");
}*/
break;
+
case "online":
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
player.yellowMessage("Players in Channel " + ch.getId() + ":");
@@ -559,6 +534,7 @@ public class Commands {
}
}
break;
+
case "gm":
if (sub.length < 3) { // #goodbye 'hi'
player.dropMessage(5, "Your message was too short. Please provide as much detail as possible.");
@@ -571,9 +547,11 @@ public class Commands {
player.dropMessage(5, "Your message '" + message + "' was sent to GMs.");
player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]);
break;
+
case "bug":
+
if (sub.length < 2) {
- player.dropMessage(5, "Message too short and not sent. Please do @bug ");
+ player.dropMessage(5, "Message too short and not sent. Please do /bug ");
break;
}
message = joinStringFrom(sub, 1);
@@ -624,6 +602,7 @@ public class Commands {
player.dropMessage(5, "You are currently in a map where you can't join an event.");
}
break;
+
case "leaveevent":
int returnMap = player.getSavedLocation("EVENT");
if(returnMap != -1) {
@@ -644,6 +623,7 @@ public class Commands {
player.dropMessage(5, "You are not currently in an event.");
}
break;
+
case "bosshp":
for(MapleMonster monster : player.getMap().getMonsters()) {
if(monster != null && monster.isBoss() && monster.getHp() > 0) {
@@ -658,6 +638,7 @@ public class Commands {
}
}
break;
+
case "ranks":
PreparedStatement ps = null;
ResultSet rs = null;
@@ -683,149 +664,19 @@ 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() + "' Type: " + portal.getType() + " --> 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 mob spawn point: " + " Position: x " + sp.getPosition().getX() + " y " + sp.getPosition().getY() + " Spawns mobid: '" + sp.getMonsterId() + "' --> 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() + ").");
- }
- break;
-
- 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() + ", Items: " + player.getMap().countItems() + ", Objects: " + player.getMap().getMapObjects().size() + ".");
- }
- break;
-
- case "debugmobsp":
- if(ServerConstants.USE_DEBUG) {
- player.getMap().reportMonsterSpawnPoints(player);
- }
- break;
-
- case "debugevent":
- if(ServerConstants.USE_DEBUG) {
- if(player.getEventInstance() == null) player.dropMessage(6, "Player currently not in an event.");
- else player.dropMessage(6, "Current event name: " + player.getEventInstance().getName() + ".");
- }
- break;
-
- case "debugareas":
- if(ServerConstants.USE_DEBUG) {
- player.dropMessage(6, "Configured areas on map " + player.getMapId() + ":");
- byte index = 0;
- for(Rectangle rect: player.getMap().getAreas()) {
- player.dropMessage(6, "Id: " + index + " -> posX: " + rect.getX() + " posY: '" + rect.getY() + "' dX: " + rect.getWidth() + " dY: " + rect.getHeight() + ".");
- index++;
- }
- }
- break;
-
- case "debugreactors":
- if(ServerConstants.USE_DEBUG) {
- player.dropMessage(6, "Current reactor states on map " + player.getMapId() + ":");
-
- for(MapleMapObject mmo: player.getMap().getReactors()) {
- MapleReactor mr = (MapleReactor) mmo;
- player.dropMessage(6, "Id: " + mr.getId() + " Oid: " + mr.getObjectId() + " name: '" + mr.getName() + "' -> Type: " + mr.getReactorType() + " State: " + mr.getState() + " Event State: " + mr.getEventState() + " Position: x " + mr.getPosition().getX() + " y " + mr.getPosition().getY() + ".");
- }
- }
- break;
-
- case "debugservercoupons":
- case "debugcoupons":
- if(ServerConstants.USE_DEBUG) {
- String s = "Currently active SERVER coupons: ";
- for(Integer i : Server.getInstance().getActiveCoupons()) {
- s += (i + " ");
- }
-
- player.dropMessage(6, s);
- }
- break;
-
- case "debugplayercoupons":
- if(ServerConstants.USE_DEBUG) {
- String s = "Currently active PLAYER coupons: ";
- for(Integer i : player.getActiveCoupons()) {
- s += (i + " ");
- }
-
- player.dropMessage(6, s);
- }
- break;
-
- default:
- if (player.gmLevel() == 0) {
- player.yellowMessage("Player Command " + heading + sub[0] + " does not exist, see @playercommands for a list of commands.");
- }
- return false;
- }
- return true;
- }
-
- public static boolean executeGMCommand(MapleClient c, String[] sub, char heading) {
- MapleCharacter player = c.getPlayer();
- Channel cserv = c.getChannelServer();
- Server srv = Server.getInstance();
-
- if (sub[0].equals("commands")) {
- player.message("============================================================");
- player.message("MapleSolaxiaV2 GM/Admin Commands Available");
- player.message("============================================================");
+ default:
+ return false;
}
- else if (sub[0].equals("sp")) {
- if (sub.length < 2){
- player.yellowMessage("Syntax: !sp [] ");
- return true;
- }
-
- if (sub.length == 2) {
- player.setRemainingSp(Integer.parseInt(sub[1]));
- player.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
- } else {
- MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]);
- victim.setRemainingSp(Integer.parseInt(sub[2]));
- victim.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
- }
- } else if (sub[0].equals("ap")) {
- if (sub.length < 2){
- player.yellowMessage("Syntax: !ap [] ");
- return true;
- }
-
- if (sub.length < 3) {
- player.setRemainingAp(Integer.parseInt(sub[1]));
- player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
- } else {
- MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(sub[1]);
- victim.setRemainingAp(Integer.parseInt(sub[2]));
- victim.updateSingleStat(MapleStat.AVAILABLEAP, victim.getRemainingAp());
- }
- } else if (sub[0].equals("empowerme")) {
- final int[] array = {2311003, 2301004, 1301007, 4101004, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002};
- for (int i : array) {
- SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player);
- }
-
- } else if (sub[0].equals("buffme")) {
+
+ return true;
+ }
+
+ public static boolean executeSolaxiaCommandLv1(Channel cserv, Server srv, MapleClient c, String[] sub) { //Donator
+ MapleCharacter player = c.getPlayer();
+
+ switch(sub[0]) {
+ case "buffme":
//GM Skills : Haste(Super) - Holy Symbol - Bless - Hyper Body - Echo of Hero
SkillFactory.getSkill(4101004).getEffect(SkillFactory.getSkill(4101004).getMaxLevel()).applyTo(player);
SkillFactory.getSkill(2311003).getEffect(SkillFactory.getSkill(2311003).getMaxLevel()).applyTo(player);
@@ -836,144 +687,12 @@ public class Commands {
player.updateSingleStat(MapleStat.HP, player.getMaxHp());
player.setMp(player.getMaxMp());
player.updateSingleStat(MapleStat.MP, player.getMaxMp());
- } else if (sub[0].equals("buffmap")) {
- SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player, true);
- SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player, true);
- SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player, true);
- SkillFactory.getSkill(9101008).getEffect(SkillFactory.getSkill(9101008).getMaxLevel()).applyTo(player, true);
- SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(player, true);
- } else if (sub[0].equals("buff")) {
+ break;
+
+ case "goto":
if (sub.length < 2){
- player.yellowMessage("Syntax: !buff ");
- return true;
- }
- int skillid=Integer.parseInt(sub[1]);
-
- Skill skill = SkillFactory.getSkill(skillid);
- if(skill != null) skill.getEffect(skill.getMaxLevel()).applyTo(player);
- } else if (sub[0].equals("proitem")) {
- if (sub.length < 3) {
- player.yellowMessage("Syntax: !proitem ");
- return true;
- }
-
- int itemid = 0;
- short multiply = 0;
-
- itemid = Integer.parseInt(sub[1]);
- multiply = Short.parseShort(sub[2]);
-
- MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
- Item item = ii.getEquipById(itemid);
- MapleInventoryType type = ii.getInventoryType(itemid);
- if (type.equals(MapleInventoryType.EQUIP)) {
- hardsetItemStats((Equip) item, multiply);
- MapleInventoryManipulator.addFromDrop(c, item);
-
- } else {
- player.dropMessage("Make sure it's an equippable item.");
- }
-
- } else if (sub[0].equals("seteqstat")) {
- if (sub.length < 2) {
- player.yellowMessage("Syntax: !seteqstat ");
- return true;
- }
-
- int newStat = Integer.parseInt(sub[1]);
- MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP);
-
- for (byte i = 1; i <= equip.getSlotLimit(); i++) {
- try {
- Equip eu = (Equip) equip.getItem(i);
- if(eu == null) continue;
-
- short incval = (short)newStat;
- eu.setWdef(incval);
- eu.setAcc(incval);
- eu.setAvoid(incval);
- eu.setJump(incval);
- eu.setMatk(incval);
- eu.setMdef(incval);
- eu.setHp(incval);
- eu.setMp(incval);
- eu.setSpeed(incval);
- eu.setWatk(incval);
- eu.setDex(incval);
- 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();
- }
- }
- //c.getSession().write(MaplePacketCreator.getCharInfo(player));
- //player.getMap().removePlayer(player);
- //player.getMap().addPlayer(player);
- } else if (sub[0].equals("spawn")) {
- if (sub.length < 2) {
- player.yellowMessage("Syntax: !spawn ");
- return true;
- }
-
- MapleMonster monster = MapleLifeFactory.getMonster(Integer.parseInt(sub[1]));
- if (monster == null) {
- return true;
- }
- if (sub.length > 2) {
- for (int i = 0; i < Integer.parseInt(sub[2]); i++) {
- player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(Integer.parseInt(sub[1])), player.getPosition());
- }
- } else {
- player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(Integer.parseInt(sub[1])), player.getPosition());
- }
- } else if (sub[0].equals("bomb")) {
- if (sub.length > 1){
- MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(sub[1]);
- victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
- Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));
- } else {
- player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), player.getPosition());
- }
- } else if (sub[0].equals("mutemap")) {
- if(player.getMap().isMuted()) {
- player.getMap().setMuted(false);
- player.dropMessage(5, "The map you are in has been un-muted.");
- } else {
- player.getMap().setMuted(true);
- player.dropMessage(5, "The map you are in has been muted.");
- }
- } 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);
- Integer matkBuff = victim.getBuffedValue(MapleBuffStat.MATK);
- Integer blessing = victim.getSkillLevel(10000000 * player.getJobType() + 12);
- if(watkBuff == null) watkBuff = 0;
- if(matkBuff == null) matkBuff = 0;
-
- player.dropMessage(5, "Cur Str: " + victim.getTotalStr() + " Cur Dex: " + victim.getTotalDex() + " Cur Int: " + victim.getTotalInt() + " Cur Luk: " + victim.getTotalLuk());
- player.dropMessage(5, "Cur WATK: " + victim.getTotalWatk() + " Cur MATK: " + victim.getTotalMagic());
- player.dropMessage(5, "Cur WATK Buff: " + watkBuff + " Cur MATK Buff: " + matkBuff + " Cur Blessing Level: " + blessing);
- player.dropMessage(5, victim.getName() + "'s maximum base damage (before skills) is " + maxBase);
- } else if (sub[0].equals("inmap")) {
- String s = "";
- for (MapleCharacter chr : player.getMap().getCharacters()) {
- s += chr.getName() + " ";
- }
- player.message(s);
- } else if (sub[0].equals("cleardrops")) {
- player.getMap().clearDrops(player);
- } else if (sub[0].equals("go")) {
- if (sub.length < 2){
- player.yellowMessage("Syntax: !go ");
- return true;
+ player.yellowMessage("Syntax: /goto