diff --git a/build/built-jar.properties b/build/built-jar.properties index 5be08aa22e..544ef1d2b0 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Mon, 19 Jun 2017 14:48:35 -0300 +#Wed, 21 Jun 2017 00:41:12 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= diff --git a/build/classes/client/MapleCharacter$13.class b/build/classes/client/MapleCharacter$13.class index 415f1f76a2..e16a658ebc 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 21c363f261..b46543447d 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 0d2deb02ac..62e5abb710 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 8d78cf8a4d..cbdbdb62dd 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 e349edd109..48879d1fcc 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 c5a3194125..eca1c2ea42 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$SkillEntry.class b/build/classes/client/MapleCharacter$SkillEntry.class index 56019cf7c1..b534dc5c48 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 bc39a3a957..1148ab2a16 100644 Binary files a/build/classes/client/MapleCharacter.class and b/build/classes/client/MapleCharacter.class differ diff --git a/build/classes/net/server/Server$1.class b/build/classes/net/server/Server$1.class index f933d5ed48..b11ad5eae6 100644 Binary files a/build/classes/net/server/Server$1.class and b/build/classes/net/server/Server$1.class differ diff --git a/build/classes/net/server/Server.class b/build/classes/net/server/Server.class index b9e2c777da..f4e83e57a1 100644 Binary files a/build/classes/net/server/Server.class and b/build/classes/net/server/Server.class differ diff --git a/build/classes/net/server/channel/handlers/AllianceOperationHandler.class b/build/classes/net/server/channel/handlers/AllianceOperationHandler.class index feaf8fd115..074adff457 100644 Binary files a/build/classes/net/server/channel/handlers/AllianceOperationHandler.class and b/build/classes/net/server/channel/handlers/AllianceOperationHandler.class differ diff --git a/build/classes/net/server/channel/handlers/GuildOperationHandler$Invited.class b/build/classes/net/server/channel/handlers/GuildOperationHandler$Invited.class index dd1e4b6e7d..517861173e 100644 Binary files a/build/classes/net/server/channel/handlers/GuildOperationHandler$Invited.class and b/build/classes/net/server/channel/handlers/GuildOperationHandler$Invited.class differ diff --git a/build/classes/net/server/channel/handlers/GuildOperationHandler.class b/build/classes/net/server/channel/handlers/GuildOperationHandler.class index 7fa6382f58..f5210279e9 100644 Binary files a/build/classes/net/server/channel/handlers/GuildOperationHandler.class and b/build/classes/net/server/channel/handlers/GuildOperationHandler.class differ diff --git a/build/classes/net/server/channel/handlers/PlayerLoggedinHandler.class b/build/classes/net/server/channel/handlers/PlayerLoggedinHandler.class index d13119fa5c..24c2863cf4 100644 Binary files a/build/classes/net/server/channel/handlers/PlayerLoggedinHandler.class and b/build/classes/net/server/channel/handlers/PlayerLoggedinHandler.class differ diff --git a/build/classes/net/server/guild/MapleAlliance.class b/build/classes/net/server/guild/MapleAlliance.class index 60cc0121e3..58407c52ec 100644 Binary files a/build/classes/net/server/guild/MapleAlliance.class and b/build/classes/net/server/guild/MapleAlliance.class differ diff --git a/build/classes/net/server/guild/MapleGuild.class b/build/classes/net/server/guild/MapleGuild.class index 8d99550387..da8d12e1ab 100644 Binary files a/build/classes/net/server/guild/MapleGuild.class and b/build/classes/net/server/guild/MapleGuild.class differ diff --git a/build/classes/net/server/guild/MapleGuildCharacter.class b/build/classes/net/server/guild/MapleGuildCharacter.class index d809ec1d7c..fb8b8cbb3d 100644 Binary files a/build/classes/net/server/guild/MapleGuildCharacter.class and b/build/classes/net/server/guild/MapleGuildCharacter.class differ diff --git a/build/classes/net/server/world/World$1.class b/build/classes/net/server/world/World$1.class index 26812bbc32..97fa97b0eb 100644 Binary files a/build/classes/net/server/world/World$1.class and b/build/classes/net/server/world/World$1.class differ diff --git a/build/classes/net/server/world/World.class b/build/classes/net/server/world/World.class index 673bb0e52a..b89946e959 100644 Binary files a/build/classes/net/server/world/World.class and b/build/classes/net/server/world/World.class differ diff --git a/build/classes/scripting/event/EventInstanceManager$1.class b/build/classes/scripting/event/EventInstanceManager$1.class index f899a45771..dd34b12862 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 fd3ed07051..2c054d895f 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 cae9603442..07a8dce64d 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 92fc130936..2991e2c89f 100644 Binary files a/build/classes/scripting/event/EventInstanceManager.class and b/build/classes/scripting/event/EventInstanceManager.class differ diff --git a/build/classes/scripting/event/EventManager.class b/build/classes/scripting/event/EventManager.class index 1b5cab9d04..3f56399939 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 c4b17f7b1d..058fd8e17d 100644 Binary files a/build/classes/scripting/npc/NPCConversationManager.class and b/build/classes/scripting/npc/NPCConversationManager.class differ diff --git a/build/classes/server/expeditions/MapleExpedition.class b/build/classes/server/expeditions/MapleExpedition.class index 5614dff290..21bf6e0631 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/maps/MapleMap$1.class b/build/classes/server/maps/MapleMap$1.class index 5ff03ed892..dc27b2a6f1 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 9f7b023c79..41bcffb798 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 67f2a13649..afd211bd37 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 a7f19cf2ef..546c836638 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 2197c3bcf1..b7fd82b212 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 0c5ad5f479..801ec51b4b 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 5425774b7a..d759e5236a 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 b38aabf3fd..f5ad8f279d 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 4a8ee2964c..d42db5a472 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 f7caf0518a..52e068a714 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 a07608d038..1a7061fbeb 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 26d41b891d..d8253bcb82 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 3abb87449c..ca5b8c0009 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 5edf33374e..aac832b60f 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 0b8b861685..946192eb72 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 3decbf69c2..9bf3be31f4 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 d5c866da29..55bf7b9810 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 14d3ff85d4..a7ec54a02b 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 f67c821e95..98a4d5eea3 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 809f0b6465..1f0b9ab0e4 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 76776741e5..58167128c7 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 22d1d0c16c..7e2eb64bb1 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 18a955dc7a..112c45ce6a 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 4cd1edc447..e5de38b97d 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 b49086ca0c..e028fc962a 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 06c7600487..5bab6e186e 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 edb6cc7d67..e0a77acd83 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 b297c9dae6..bc9f7fe1fc 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 9d01a1ba7a..85031635b6 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 1c4503ebe9..69e3063902 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 c000c48f1d..282bbc335a 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 49a530c3e5..fb95d366b3 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 bfb6ced6d5..2244dbe9d1 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 16f27e5ff5..07d58bdf8a 100644 Binary files a/build/classes/server/maps/MapleMap.class and b/build/classes/server/maps/MapleMap.class differ diff --git a/build/classes/tools/MaplePacketCreator.class b/build/classes/tools/MaplePacketCreator.class index e464d333f1..a3a9472dd1 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 e390a4315e..9f9b60ca47 100644 Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index e64525620d..0a58c60003 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -329,4 +329,12 @@ Consertado bugs referentes ao comando "level", n 19 Junho 2017, Consertado cupons não aparecendo apropriadamente na região de buffs. Consertado alguns problemas de concorrência com cupons. -Consertado alguns problemas de concorrência com character buffs. \ No newline at end of file +Consertado alguns problemas de concorrência com character buffs. + +20 Junho 2017, +Definido um suporte para o esquema de expedições, tal como pode ser visto na CWKPQ. + +21 Junho 2017, +Corrigido vários aspectos de guilds e alliances, que operavam irregularmente no cliente. +Corrigido "player logged in" aparecendo sempre que jogador troca de canal. +MGC do jogador agora está sincronizado com o MGC da guild, não o contrário. \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 225a2093d8..6644bb1bd7 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -1,29 +1,23 @@ - - - src/tools/MaplePacketCreator.java - - - 5937 - - - - + - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/TimerManager.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AllianceOperationHandler.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerLoggedinHandler.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleStatEffect.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/CouponWorker.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleBuffStat.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleItemInformationProvider.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/MapleInventory.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010009.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/GuildOperationHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuildCharacter.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010008.js + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java diff --git a/scripts/event/CWKPQ.js b/scripts/event/CWKPQ.js index 374f779e71..7e9fc41c01 100644 --- a/scripts/event/CWKPQ.js +++ b/scripts/event/CWKPQ.js @@ -17,84 +17,85 @@ var pos_y = Array(-204,-384,-504,-384,-204); var pos_y2 = Array(-144, -444, -744, -1044, -1344, -1644); function init() { -em.setProperty("state", "0"); - em.setProperty("leader", "true"); + em.setProperty("state", "0"); + em.setProperty("leader", "true"); } function afterSetup(eim) {} -function setup(eim, leaderid) { -em.setProperty("state", "1"); - em.setProperty("leader", "true"); - em.setProperty("current_instance", "0"); - em.setProperty("glpq1", "0"); - em.setProperty("glpq2", "0"); - em.setProperty("glpq3", "0"); - em.setProperty("glpq4", "0"); - em.setProperty("glpq5", "0"); - em.setProperty("glpq6", "0"); - var eim = em.newInstance("CWKPQ" + leaderid); - for (var i = 0; i < mapz.length; i++) { - var map = eim.getInstanceMap(610030000 + mapz[i]); - if (map != null) { - map.resetFully(); - if (map.getId() == 610030400) { - map.setReactorState(); //because everything is at 0 =[ - map.limitReactor(6109016, 1); - map.limitReactor(6109017, 1); - map.limitReactor(6109018, 1); - map.limitReactor(6109019, 1); - map.limitReactor(6109020, 1); - map.shuffleReactors(6109016, 6109020); - map.destroyReactors(6108000, 6108005); //destroy the fake ones, non-GMS like or is this necessary +function setup(leaderid) { + em.setProperty("state", "1"); + em.setProperty("leader", "true"); + em.setProperty("current_instance", "0"); + em.setProperty("glpq1", "0"); + em.setProperty("glpq2", "0"); + em.setProperty("glpq3", "0"); + em.setProperty("glpq4", "0"); + em.setProperty("glpq5", "0"); + em.setProperty("glpq6", "0"); - //add environments - for (var x = 0; x < a.length; x++) { - for (var y = 1; y <= 7; y++) { - if (x == 1 || x == 3 || x == 4 || x == 6 || x == 8) { - if (y != 2 && y != 4 && y != 5 && y != 7) { - map.moveEnvironment(a[x] + "" + y, 1); - } - } else { - map.moveEnvironment(a[x] + "" + y, 1); - } - } - } - } else if (map.getId() == 610030510) { //warrior room, crimson guardians - for (var z = 0; z < pos_y2.length; z++) { - var mob = em.getMonster(9400582); - eim.registerMonster(mob); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(0, pos_y2[z])); - } - //skipping mage room, ehh - } else if (map.getId() == 610030540) { //bowman room, spawn master guardians - for (var z = 0; z < pos_x.length; z++) { - var mob = em.getMonster(9400594); - eim.registerMonster(mob); - map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(pos_x[z], pos_y[z])); - } - } else if (map.getId() == 610030550) { - map.shuffleReactors(); //pirate room - } - } - } + var eim = em.newInstance("CWKPQ" + leaderid); + for (var i = 0; i < mapz.length; i++) { + var map = eim.getInstanceMap(610030000 + mapz[i]); + if (map != null) { + map.resetFully(); + if (map.getId() == 610030400) { + map.setReactorState(); //because everything is at 0 =[ + map.limitReactor(6109016, 1); + map.limitReactor(6109017, 1); + map.limitReactor(6109018, 1); + map.limitReactor(6109019, 1); + map.limitReactor(6109020, 1); + map.shuffleReactors(6109016, 6109020); + map.destroyReactors(6108000, 6108005); //destroy the fake ones, non-GMS like or is this necessary + + //add environments + for (var x = 0; x < a.length; x++) { + for (var y = 1; y <= 7; y++) { + if (x == 1 || x == 3 || x == 4 || x == 6 || x == 8) { + if (y != 2 && y != 4 && y != 5 && y != 7) { + map.moveEnvironment(a[x] + "" + y, 1); + } + } else { + map.moveEnvironment(a[x] + "" + y, 1); + } + } + } + } else if (map.getId() == 610030510) { //warrior room, crimson guardians + for (var z = 0; z < pos_y2.length; z++) { + var mob = em.getMonster(9400582); + eim.registerMonster(mob); + map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(0, pos_y2[z])); + } + //skipping mage room, ehh + } else if (map.getId() == 610030540) { //bowman room, spawn master guardians + for (var z = 0; z < pos_x.length; z++) { + var mob = em.getMonster(9400594); + eim.registerMonster(mob); + map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(pos_x[z], pos_y[z])); + } + } else if (map.getId() == 610030550) { + map.shuffleReactors(); //pirate room + } + } + } eim.startEventTimer(120000); //2 MIN for first stg eim.schedule("spawnGuardians", 60000); return eim; } function playerEntry(eim, player) { - eim.broadcastPlayerMsg(5, "[Expedition] " + player.getName() + " has entered the map."); + eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map."); var map = eim.getMapInstance(610030100 + (parseInt(em.getProperty("current_instance")) * 100)); player.changeMap(map, map.getPortal(0)); } function spawnGuardians(eim) { var map = eim.getMapInstance(0); - if (map.getCharactersSize() <= 0) { + if (map.countPlayers() <= 0) { return; } - eim.broadcastPlayerMsg(5, "The Master Guardians have detected you."); + eim.dropMessage(5, "The Master Guardians have detected you."); for (var i = 0; i < 20; i++) { //spawn 20 guardians var mob = em.getMonster(9400594); eim.registerMonster(mob); @@ -102,8 +103,7 @@ function spawnGuardians(eim) { } } -function playerRevive(eim, player) { -} +function playerRevive(eim, player) {} function scheduledTimeout(eim) { end(eim); @@ -165,33 +165,30 @@ function monsterValue(eim, mobId) { function playerUnregistered(eim, player) {} function playerExit(eim, player) { - eim.broadcastPlayerMsg(5, "[Expedition] " + player.getName() + " has left the map."); + eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event."); eim.unregisterPlayer(player); if (eim.disposeIfPlayerBelow(minPlayers, 610030010)) { - em.setProperty("state", "0"); - em.setProperty("leader", "true"); - } + em.setProperty("state", "0"); + em.setProperty("leader", "true"); + } } function end(eim) { eim.disposeIfPlayerBelow(100, 610030010); - em.setProperty("state", "0"); - em.setProperty("leader", "true"); + em.setProperty("state", "0"); + em.setProperty("leader", "true"); } function clearPQ(eim) { + eim.setEventCleared(); end(eim); } function monsterKilled(mob, eim) {} +function allMonstersDead(eim) {} -function allMonstersDead(eim) { -} - -function leftParty (eim, player) { -} -function disbandParty (eim) { -} +function leftParty (eim, player) {} +function disbandParty (eim) {} function playerDead(eim, player) {} function cancelSchedule() {} \ No newline at end of file diff --git a/scripts/npc/9201113.js b/scripts/npc/9201113.js index 7eef263655..f3ed1d962a 100644 --- a/scripts/npc/9201113.js +++ b/scripts/npc/9201113.js @@ -48,10 +48,7 @@ function action(mode, type, selection) { return; } if (status == 0) { - if (player.getClient().getChannel() != 1) { //Only channel 1 - cm.sendOk("Sorry, Crimsonwood Keep Party Quest may only be attempted on #bChannel 1#k."); - cm.dispose(); - } else if (player.getLevel() < cwkpq.getMinLevel() && player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement + if (player.getLevel() < cwkpq.getMinLevel() && player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement cm.sendOk("You do not meet the criteria to take attempt Crimsonwood Keep Party Quest!"); cm.dispose(); } else if (expedition == null) { //Start an expedition @@ -109,14 +106,14 @@ function action(mode, type, selection) { 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 cwkpq Altar#k."); + cm.sendOk("The expedition will begin and you will now be escorted to the #bEntrance to CWKPQ 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); + 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(); + cm.dispose(); return; } } else if (status == 4) { @@ -132,15 +129,15 @@ function action(mode, type, selection) { cm.dispose(); return; } - cm.sendOk("Good luck! Crimsonwood Keep Party Quest is a worthy challenge!"); - em.setProperty("leader", player.getName()); + + 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); + var banned = expedition.getMembers().get(selection - 1); expedition.ban(banned); cm.sendOk("You have banned " + banned.getName() + " from the expedition."); cm.dispose(); diff --git a/scripts/npc/9201114.js b/scripts/npc/9201114.js index fb4f7b4b67..f5f6c28945 100644 --- a/scripts/npc/9201114.js +++ b/scripts/npc/9201114.js @@ -26,5 +26,5 @@ function start() { cm.warp(610030020); - cm.dispose(); + cm.dispose(); } \ No newline at end of file diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java index 71526e444f..f7b9de5639 100644 --- a/src/client/MapleCharacter.java +++ b/src/client/MapleCharacter.java @@ -3922,7 +3922,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { ret.dojoPoints = rs.getInt("dojoPoints"); ret.dojoStage = rs.getInt("lastDojoStage"); ret.dataString = rs.getString("dataString"); - if (ret.guildid > 0) ret.mgc = new MapleGuildCharacter(ret); + ret.mgc = new MapleGuildCharacter(ret); int buddyCapacity = rs.getInt("buddyCapacity"); ret.buddylist = new BuddyList(buddyCapacity); ret.getInventory(MapleInventoryType.EQUIP).setSlotLimit(rs.getByte("equipslots")); @@ -5295,17 +5295,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { public void setGuildId(int _id) { guildid = _id; - if (guildid > 0) { - if (mgc == null) { - mgc = new MapleGuildCharacter(this); - } else { - mgc.setGuildId(guildid); - } - } else { - mgc = null; - guildRank = 5; - allianceRank = 5; - } } public void setGuildRank(int _rank) { diff --git a/src/net/server/Server.java b/src/net/server/Server.java index 7bb5624a84..b3ac9633d2 100644 --- a/src/net/server/Server.java +++ b/src/net/server/Server.java @@ -498,7 +498,9 @@ public class Server implements Runnable { } if(mc != null) { - g.addGuildMember(mc.getMGC()); // i really REALLY must make player MGC the same as the guild MGC + mc.setMGC(g.getMGC(mc.getId())); + if(g.getMGC(mc.getId()) == null) System.out.println("null for " + mc.getName() + " when loading " + id); + g.getMGC(mc.getId()).setCharacter(mc); g.setOnline(mc.getId(), true, mc.getClient().getChannel()); } @@ -520,10 +522,10 @@ public class Server implements Runnable { g.setOnline(mc.getId(), bOnline, channel); } - public int addGuildMember(MapleGuildCharacter mgc) { + public int addGuildMember(MapleGuildCharacter mgc, MapleCharacter chr) { MapleGuild g = guilds.get(mgc.getGuildId()); if (g != null) { - return g.addGuildMember(mgc); + return g.addGuildMember(mgc, chr); } return 0; } diff --git a/src/net/server/channel/handlers/AllianceOperationHandler.java b/src/net/server/channel/handlers/AllianceOperationHandler.java index 0f2e8aae8f..99cf50efb4 100644 --- a/src/net/server/channel/handlers/AllianceOperationHandler.java +++ b/src/net/server/channel/handlers/AllianceOperationHandler.java @@ -98,7 +98,7 @@ public final class AllianceOperationHandler extends AbstractMaplePacketHandler { Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.addGuildToAlliance(alliance, guildid, c), -1, -1); Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.updateAllianceInfo(alliance, c), -1, -1); Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1); - victim.getGuild().dropMessage("Your guild has joined in the [" + alliance.getName() + "] union."); + victim.getGuild().dropMessage("Your guild has joined the [" + alliance.getName() + "] union."); } } } @@ -164,6 +164,8 @@ public final class AllianceOperationHandler extends AbstractMaplePacketHandler { String notice = slea.readMapleAsciiString(); Server.getInstance().setAllianceNotice(alliance.getId(), notice); Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), notice), -1, -1); + + alliance.dropMessage(5, "* Alliance Notice : " + notice); break; default: c.getPlayer().dropMessage("Feature not available"); diff --git a/src/net/server/channel/handlers/GuildOperationHandler.java b/src/net/server/channel/handlers/GuildOperationHandler.java index 7248626da9..57d376be1d 100644 --- a/src/net/server/channel/handlers/GuildOperationHandler.java +++ b/src/net/server/channel/handlers/GuildOperationHandler.java @@ -31,6 +31,7 @@ import java.util.Iterator; import tools.MaplePacketCreator; import client.MapleCharacter; import net.server.Server; +import net.server.guild.MapleAlliance; public final class GuildOperationHandler extends AbstractMaplePacketHandler { private boolean isGuildNameAcceptable(String name) { @@ -115,21 +116,22 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler { c.getPlayer().dropMessage(1, "The Guild name you have chosen is not accepted."); return; } - int gid; - gid = Server.getInstance().createGuild(mc.getId(), guildName); + int gid = Server.getInstance().createGuild(mc.getId(), guildName); if (gid == 0) { c.announce(MaplePacketCreator.genericGuildMessage((byte) 0x1c)); return; } mc.gainMeso(-MapleGuild.CREATE_GUILD_COST, true, false, true); - Server.getInstance().getWorld(mc.getWorld()).setGuildAndRank(mc.getId(), gid, 1); - Server.getInstance().setGuildMemberOnline(mc, true, mc.getClient().getChannel()); + mc.getMGC().setGuildId(gid); + Server.getInstance().getGuild(mc.getGuildId(), mc.getWorld(), mc); // initialize guild structure + Server.getInstance().changeRank(gid, mc.getId(), 1); c.announce(MaplePacketCreator.showGuildInfo(mc)); c.getPlayer().dropMessage(1, "You have successfully created a Guild."); + respawnPlayer(mc); break; case 0x05: if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) { @@ -172,15 +174,14 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler { System.out.println("[hax] " + mc.getName() + " is trying to join a guild that never invited him/her (or that the invitation has expired)"); return; } - mc.setGuildId(gid); // joins the guild - mc.setGuildRank(5); // start at lowest rank - mc.setAllianceRank(5); - int s; + mc.getMGC().setGuildId(gid); // joins the guild + mc.getMGC().setGuildRank(5); // start at lowest rank + mc.getMGC().setAllianceRank(5); - s = Server.getInstance().addGuildMember(mc.getMGC()); + int s = Server.getInstance().addGuildMember(mc.getMGC(), mc); if (s == 0) { c.getPlayer().dropMessage(1, "The Guild you are trying to join is already full."); - mc.setGuildId(0); + mc.getMGC().setGuildId(0); return; } @@ -207,7 +208,7 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler { c.announce(MaplePacketCreator.showGuildInfo(null)); if(allianceId > 0) Server.getInstance().getAlliance(allianceId).updateAlliancePackets(mc); - mc.setGuildId(0); + mc.getMGC().setGuildId(0); mc.saveGuildStatus(); respawnPlayer(mc); break; @@ -262,12 +263,18 @@ public final class GuildOperationHandler extends AbstractMaplePacketHandler { short logo = slea.readShort(); byte logocolor = slea.readByte(); Server.getInstance().setGuildEmblem(mc.getGuildId(), bg, bgcolor, logo, logocolor); + + if (mc.getGuild() != null && mc.getGuild().getAllianceId() > 0) { + MapleAlliance alliance = mc.getAlliance(); + Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.getGuildAlliances(alliance, c.getWorld()), -1, -1); + } + mc.gainMeso(-MapleGuild.CHANGE_EMBLEM_COST, true, false, true); respawnPlayer(mc); break; case 0x10: if (mc.getGuildId() <= 0 || mc.getGuildRank() > 2) { - System.out.println("[hax] " + mc.getName() + " tried to change guild notice while not in a guild."); + if(mc.getGuildId() <= 0) System.out.println("[hax] " + mc.getName() + " tried to change guild notice while not in a guild."); return; } String notice = slea.readMapleAsciiString(); diff --git a/src/net/server/channel/handlers/PlayerLoggedinHandler.java b/src/net/server/channel/handlers/PlayerLoggedinHandler.java index 94a2cb8718..e5c0735c07 100644 --- a/src/net/server/channel/handlers/PlayerLoggedinHandler.java +++ b/src/net/server/channel/handlers/PlayerLoggedinHandler.java @@ -51,6 +51,7 @@ import client.inventory.MaplePet; import client.inventory.PetDataFactory; import constants.GameConstants; import constants.ServerConstants; +import java.lang.ref.WeakReference; import java.util.concurrent.ScheduledFuture; import server.TimerManager; @@ -187,12 +188,10 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler { MapleGuild playerGuild = server.getGuild(player.getGuildId(), player.getWorld(), player); if (playerGuild == null) { player.deleteGuild(player.getGuildId()); - player.setMGC(null); - player.setGuildId(0); + player.getMGC().setGuildId(0); } else { playerGuild.getMGC(player.getId()).setCharacter(player); player.setMGC(playerGuild.getMGC(player.getId())); - server.setGuildMemberOnline(player, true, c.getChannel()); c.announce(MaplePacketCreator.showGuildInfo(player)); int allianceId = player.getGuild().getAllianceId(); @@ -206,12 +205,13 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler { player.getGuild().setAllianceId(0); } } - if (newAlliance != null) { c.announce(MaplePacketCreator.updateAllianceInfo(newAlliance, c)); c.announce(MaplePacketCreator.allianceNotice(newAlliance.getId(), newAlliance.getNotice())); - server.allianceMessage(allianceId, MaplePacketCreator.allianceMemberOnline(player, true), player.getId(), -1); + if (newcomer) { + server.allianceMessage(allianceId, MaplePacketCreator.allianceMemberOnline(player, true), player.getId(), -1); + } } } } diff --git a/src/net/server/guild/MapleAlliance.java b/src/net/server/guild/MapleAlliance.java index dbb9e30d54..2c5df5c9d3 100644 --- a/src/net/server/guild/MapleAlliance.java +++ b/src/net/server/guild/MapleAlliance.java @@ -121,10 +121,13 @@ public class MapleAlliance { MapleCharacter chr = guildMasters.get(i); chr.getMGC().setAllianceRank((i == 0) ? 1 : 2); + Server.getInstance().getGuild(chr.getGuildId()).getMGC(chr.getId()).setAllianceRank((i == 0) ? 1 : 2); chr.saveGuildStatus(); } Server.getInstance().addAlliance(id, alliance); + + System.out.println("\n\n\n\n----"); Server.getInstance().allianceMessage(id, MaplePacketCreator.updateAllianceInfo(alliance, guildMasters.get(0).getClient()), -1, -1); } catch (Exception e) { e.printStackTrace(); @@ -304,7 +307,7 @@ public class MapleAlliance { Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1); Server.getInstance().guildMessage(guildId, MaplePacketCreator.disbandAlliance(alliance.getId())); - alliance.dropMessage("[" + Server.getInstance().getGuild(guildId, worldId) + "] guild has left the union."); + alliance.dropMessage("[" + Server.getInstance().getGuild(guildId, worldId).getName() + "] guild has left the union."); } public void updateAlliancePackets(MapleCharacter chr) { diff --git a/src/net/server/guild/MapleGuild.java b/src/net/server/guild/MapleGuild.java index f972d38ef3..0caf005bd5 100644 --- a/src/net/server/guild/MapleGuild.java +++ b/src/net/server/guild/MapleGuild.java @@ -372,13 +372,14 @@ public class MapleGuild { } } - public int addGuildMember(MapleGuildCharacter mgc) { + public int addGuildMember(MapleGuildCharacter mgc, MapleCharacter chr) { synchronized (members) { if (members.size() >= capacity) { return 0; } for (int i = members.size() - 1; i >= 0; i--) { if (members.get(i).getGuildRank() < 5 || members.get(i).getName().compareTo(mgc.getName()) < 0) { + mgc.setCharacter(chr); members.add(i + 1, mgc); bDirty = true; break; @@ -439,23 +440,30 @@ public class MapleGuild { public void changeRank(int cid, int newRank) { for (MapleGuildCharacter mgc : members) { if (cid == mgc.getId()) { - try { - if (mgc.isOnline()) { - Server.getInstance().getWorld(mgc.getWorld()).setGuildAndRank(cid, this.id, newRank); - } else { - Server.getInstance().getWorld(mgc.getWorld()).setOfflineGuildStatus((short) this.id, (byte) newRank, cid); - } - } catch (Exception re) { - re.printStackTrace(); - return; - } - mgc.setGuildRank(newRank); - this.broadcast(MaplePacketCreator.changeRank(mgc)); + changeRank(mgc, newRank); return; } } } - + + public void changeRank(MapleGuildCharacter mgc, int newRank) { + try { + if (mgc.isOnline()) { + Server.getInstance().getWorld(mgc.getWorld()).setGuildAndRank(mgc.getId(), this.id, newRank); + mgc.setGuildRank(newRank); + } else { + Server.getInstance().getWorld(mgc.getWorld()).setOfflineGuildStatus((short) this.id, (byte) newRank, mgc.getId()); + mgc.setOfflineGuildRank(newRank); + } + } catch (Exception re) { + re.printStackTrace(); + return; + } + + this.broadcast(MaplePacketCreator.changeRank(mgc)); + return; + } + public void setGuildNotice(String notice) { this.notice = notice; writeToDB(false); @@ -594,7 +602,11 @@ public class MapleGuild { public void resetAllianceGuildPlayersRank() { try { - for(MapleGuildCharacter mgc: members) mgc.setAllianceRank(5); + for(MapleGuildCharacter mgc: members) { + if(mgc.isOnline()) { + mgc.setAllianceRank(5); + } + } try (PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("UPDATE characters SET allianceRank = ? WHERE guildid = ?")) { ps.setInt(1, 5); diff --git a/src/net/server/guild/MapleGuildCharacter.java b/src/net/server/guild/MapleGuildCharacter.java index 5f199a96c0..41e12ca42b 100644 --- a/src/net/server/guild/MapleGuildCharacter.java +++ b/src/net/server/guild/MapleGuildCharacter.java @@ -111,15 +111,20 @@ public class MapleGuildCharacter { public void setGuildId(int gid) { guildid = gid; + character.setGuildId(gid); } public int getGuildRank() { return guildrank; } + public void setOfflineGuildRank(int rank) { + guildrank = rank; + } + public void setGuildRank(int rank) { guildrank = rank; - if(character != null) character.setGuildRank(rank); + character.setGuildRank(rank); } public int getAllianceRank() { @@ -128,7 +133,7 @@ public class MapleGuildCharacter { public void setAllianceRank(int rank) { allianceRank = rank; - if(character != null) character.setAllianceRank(rank); + character.setAllianceRank(rank); } public boolean isOnline() { diff --git a/src/net/server/world/World.java b/src/net/server/world/World.java index f9416881d5..812f63b028 100644 --- a/src/net/server/world/World.java +++ b/src/net/server/world/World.java @@ -206,8 +206,7 @@ public class World { if(mgc == null) return null; int gid = mgc.getGuildId(); - MapleGuild g; - g = Server.getInstance().getGuild(gid, mgc.getWorld(), mgc.getCharacter()); + MapleGuild g = Server.getInstance().getGuild(gid, mgc.getWorld(), mgc.getCharacter()); if (gsStore.get(gid) == null) { gsStore.put(gid, new MapleGuildSummary(g)); } @@ -274,13 +273,10 @@ public class World { bDifferentGuild = true; } else { bDifferentGuild = guildid != mc.getGuildId(); - mc.setGuildId(guildid); + mc.getMGC().setGuildId(guildid); + mc.getMGC().setGuildRank(rank); - MapleGuildCharacter mgc = mc.getMGC(); - if(mgc != null) { - mgc.setGuildRank(rank); - if(bDifferentGuild) mgc.setAllianceRank(5); - } + if(bDifferentGuild) mc.getMGC().setAllianceRank(5); mc.saveGuildStatus(); } diff --git a/src/scripting/event/EventInstanceManager.java b/src/scripting/event/EventInstanceManager.java index 9c6c8e7060..6016bc3773 100644 --- a/src/scripting/event/EventInstanceManager.java +++ b/src/scripting/event/EventInstanceManager.java @@ -235,7 +235,18 @@ public class EventInstanceManager { ex.printStackTrace(); } } + + public void dropMessage(int type, String message) { + for (MapleCharacter chr : getPlayers()) { + chr.dropMessage(type, message); + } + } + public void restartEventTimer(long time) { + stopEventTimer(); + startEventTimer(time); + } + public void startEventTimer(long time) { timeStarted = System.currentTimeMillis(); eventTime = time; diff --git a/src/scripting/event/EventManager.java b/src/scripting/event/EventManager.java index f992ab3010..8a6ac82646 100644 --- a/src/scripting/event/EventManager.java +++ b/src/scripting/event/EventManager.java @@ -279,7 +279,7 @@ public class EventManager { startLobbyInstance(lobbyId); } - EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null)); + EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", leader.getId())); if(eim == null) { if(lobbyId > -1) setLockLobby(lobbyId, false); return false; diff --git a/src/scripting/npc/NPCConversationManager.java b/src/scripting/npc/NPCConversationManager.java index 37cf70e74f..04fff22d0e 100644 --- a/src/scripting/npc/NPCConversationManager.java +++ b/src/scripting/npc/NPCConversationManager.java @@ -352,7 +352,9 @@ public class NPCConversationManager extends AbstractPlayerInteraction { public void upgradeAlliance() { MapleAlliance alliance = Server.getInstance().getAlliance(c.getPlayer().getGuild().getAllianceId()); alliance.increaseCapacity(1); - c.announce(MaplePacketCreator.updateAllianceInfo(alliance, c)); + + Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.getGuildAlliances(alliance, c.getWorld()), -1, -1); + Server.getInstance().allianceMessage(alliance.getId(), MaplePacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1); } public void disbandAlliance(MapleClient c, int allianceId) { diff --git a/src/server/expeditions/MapleExpedition.java b/src/server/expeditions/MapleExpedition.java index 21f41c5f21..30ee4963f1 100644 --- a/src/server/expeditions/MapleExpedition.java +++ b/src/server/expeditions/MapleExpedition.java @@ -80,8 +80,8 @@ public class MapleExpedition { private MapleMap startMap; private ArrayList bossLogs; private ScheduledFuture schedule; - private List members = new ArrayList(); - private List banned = new ArrayList(); + private List members = new ArrayList<>(); + private List banned = new ArrayList<>(); private long startTime; public MapleExpedition(MapleCharacter player, MapleExpeditionType met) { @@ -126,7 +126,7 @@ public class MapleExpedition { public void start(){ registering = false; startMap.broadcastMessage(MaplePacketCreator.removeClock()); - broadcastExped(MaplePacketCreator.serverNotice(6, "The expedition has started! The expedition leader is waiting inside!")); + broadcastExped(MaplePacketCreator.serverNotice(6, "The expedition has started! Good luck, brave heroes!")); startTime = System.currentTimeMillis(); Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(6, type.toString() + " Expedition started with leader: " + leader.getName())); } @@ -135,7 +135,7 @@ public class MapleExpedition { if (!registering){ return "Sorry, this expedition is already underway. Registration is closed!"; } - if (banned.contains(player)){ + if (banned.contains(player.getId())){ return "Sorry, you've been banned from this expedition by #b" + leader.getName() + "#k."; } if (members.size() >= type.getMaxSize()){ //Would be a miracle if anybody ever saw this @@ -155,7 +155,13 @@ public class MapleExpedition { } public boolean removeMember(MapleCharacter chr) { - return members.remove(chr); + if(members.remove(chr)) { + broadcastExped(MaplePacketCreator.serverNotice(6, chr.getName() + " has left the expedition.")); + chr.dropMessage(6, "You have left this expedition."); + return true; + } + + return false; } public MapleExpeditionType getType() { @@ -192,9 +198,14 @@ public class MapleExpedition { } public void ban(MapleCharacter player) { - if (!banned.contains(player)) { - banned.add(player); + if (!banned.contains(player.getId())) { + banned.add(player.getId()); members.remove(player); + + broadcastExped(MaplePacketCreator.serverNotice(6, player.getName() + " has been banned from the expedition.")); + + player.announce(MaplePacketCreator.removeClock()); + player.dropMessage(6, "You have been banned from this expedition."); } } diff --git a/src/server/maps/MapleMap.java b/src/server/maps/MapleMap.java index f01d71da50..55011fab1b 100644 --- a/src/server/maps/MapleMap.java +++ b/src/server/maps/MapleMap.java @@ -93,6 +93,7 @@ public class MapleMap { private Collection characters = new LinkedHashSet<>(); private Map portals = new HashMap<>(); private Map backgroundTypes = new HashMap<>(); + private Map environment = new LinkedHashMap(); private List areas = new ArrayList<>(); private MapleFootholdTree footholds = null; private int mapid; @@ -252,6 +253,28 @@ public class MapleMap { objectRLock.unlock(); } } + + public final void limitReactor(final int rid, final int num) { + List toDestroy = new ArrayList<>(); + Map contained = new LinkedHashMap<>(); + + for (MapleMapObject obj : getReactors()) { + MapleReactor mr = (MapleReactor) obj; + if (contained.containsKey(mr.getId())) { + if (contained.get(mr.getId()) >= num) { + toDestroy.add(mr); + } else { + contained.put(mr.getId(), contained.get(mr.getId()) + 1); + } + } else { + contained.put(mr.getId(), 1); + } + } + + for (MapleReactor mr : toDestroy) { + destroyReactor(mr.getObjectId()); + } + } public int getForcedReturnId() { return forcedReturnMap; @@ -837,6 +860,22 @@ public class MapleMap { killMonster(monster, null, false, 1); } } + + public final void destroyReactors(final int first, final int last) { + List toDestroy = new ArrayList<>(); + List reactors = getReactors(); + + for (MapleMapObject obj : reactors) { + MapleReactor mr = (MapleReactor) obj; + if (mr.getId() >= first && mr.getId() <= last) { + toDestroy.add(mr); + } + } + + for (MapleReactor mr : toDestroy) { + destroyReactor(mr.getObjectId()); + } + } public void destroyReactor(int oid) { final MapleReactor reactor = getReactorByOid(oid); @@ -897,6 +936,25 @@ public class MapleMap { objectRLock.unlock(); } } + + public final void shuffleReactors(int first, int last) { + List points = new ArrayList<>(); + List reactors = getReactors(); + List targets = new LinkedList<>(); + + for (MapleMapObject obj : reactors) { + MapleReactor mr = (MapleReactor) obj; + if (mr.getId() >= first && mr.getId() <= last) { + points.add(mr.getPosition()); + targets.add(obj); + } + } + Collections.shuffle(points); + for (MapleMapObject obj : targets) { + MapleReactor mr = (MapleReactor) obj; + mr.setPosition(points.remove(points.size() - 1)); + } + } /** * Automagically finds a new controller for the given monster from the chars @@ -2035,6 +2093,27 @@ public class MapleMap { } } } + + // \/\/\/\/\/\/ CWKPQ things \/\/\/\/\/\/ + + public final void toggleEnvironment(final String ms) { + if (environment.containsKey(ms)) { + moveEnvironment(ms, environment.get(ms) == 1 ? 2 : 1); + } else { + moveEnvironment(ms, 1); + } + } + + public final void moveEnvironment(final String ms, final int type) { + broadcastMessage(MaplePacketCreator.environmentChange(ms, type)); + environment.put(ms, type); + } + + public final Map getEnvironment() { + return environment; + } + + // /\/\/\/\/\/\/\ CWKPQ things /\/\/\/\/\/\ public String getMapName() { return mapName; diff --git a/src/tools/MaplePacketCreator.java b/src/tools/MaplePacketCreator.java index c6cde6b4ab..0e17cc1cbc 100644 --- a/src/tools/MaplePacketCreator.java +++ b/src/tools/MaplePacketCreator.java @@ -5939,7 +5939,7 @@ public class MaplePacketCreator { mplew.writeInt(alliance.getCapacity()); // probably capacity mplew.writeShort(0); for (Integer guildd : alliance.getGuilds()) { - getGuildInfo(mplew, Server.getInstance().getGuild(guildd, c.getWorld(), c.getPlayer())); + getGuildInfo(mplew, Server.getInstance().getGuild(guildd, c.getWorld())); } return mplew.getPacket(); } @@ -5950,7 +5950,7 @@ public class MaplePacketCreator { mplew.write(0x0D); mplew.writeInt(alliance.getGuilds().size()); for (Integer guild : alliance.getGuilds()) { - getGuildInfo(mplew, Server.getInstance().getGuild(guild, worldId, null)); + getGuildInfo(mplew, Server.getInstance().getGuild(guild, worldId)); } return mplew.getPacket(); }