Boss Rush PQ Rewarding System + minor patches

Introducing BRPQ rewarding system (KPQ/LPQ clear-like) and patched
issues regarding "no apparent party leader" after party leader
disconnects and reconnects.
This commit is contained in:
ronancpl
2017-04-29 12:05:26 -03:00
parent 7942dde1a1
commit 1d8caff63f
35 changed files with 644 additions and 391 deletions
+1
View File
@@ -1,2 +1,3 @@
/build/ /build/
/dist/ /dist/
/logs/
+2
View File
@@ -74,6 +74,8 @@ Configure the IP you want to use for your MapleStory server in "configuration.in
Now open NetBeans, and choose to Open a project... Select then the "MapleSolaxia" folder, that should already be a project recognizable by NetBeans. If it doesn't, you have a problem. Now open NetBeans, and choose to Open a project... Select then the "MapleSolaxia" folder, that should already be a project recognizable by NetBeans. If it doesn't, you have a problem.
Inside the project, you may encounter some code errors. These happens because you have not set yet the "cores" of the project. From the project hierarchy, right-click the project and select "Resolve Project Problems". Locate the "cores" folder inside the root directory of this project and manually configure the missing files with the files that are there.
Finally, select "Clean and Build project" to build the JAR file for the MapleStory server. Once done, make sure both WampServer and Hamachi are on and functioning, and then execute "launch.bat" on the root of the project. If no errors were raised from this action, your MapleStory server is now online. Finally, select "Clean and Build project" to build the JAR file for the MapleStory server. Once done, make sure both WampServer and Hamachi are on and functioning, and then execute "launch.bat" on the root of the project. If no errors were raised from this action, your MapleStory server is now online.
---- Installing the CLIENT ---- ---- Installing the CLIENT ----
+4 -4
View File
@@ -1,10 +1,10 @@
compile.on.save=true compile.on.save=true
do.depend=false do.depend=false
do.jar=true do.jar=true
file.reference.mina-core-2.0.7.jar=C:\\Nexon\\MapleSolaxia\\cores\\mina-core-2.0.7.jar file.reference.mina-core-2.0.7.jar=C:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2\\cores\\mina-core-2.0.7.jar
file.reference.mysql-connector-java-bin.jar=C:\\Nexon\\MapleSolaxia\\cores\\mysql-connector-java-bin.jar file.reference.mysql-connector-java-bin.jar=C:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2\\cores\\mysql-connector-java-bin.jar
file.reference.slf4j-api-1.6.6.jar=C:\\Nexon\\MapleSolaxia\\cores\\slf4j-api-1.6.6.jar file.reference.slf4j-api-1.6.6.jar=C:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2\\cores\\slf4j-api-1.6.6.jar
file.reference.slf4j-jdk14-1.7.5.jar=C:\\Nexon\\MapleSolaxia\\cores\\slf4j-jdk14-1.7.5.jar file.reference.slf4j-jdk14-1.7.5.jar=C:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2\\cores\\slf4j-jdk14-1.7.5.jar
javac.debug=true javac.debug=true
javadoc.preview=true javadoc.preview=true
user.properties.file=C:\\Users\\RonanLana\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties user.properties.file=C:\\Users\\RonanLana\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
+20 -5
View File
@@ -3,11 +3,26 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group>
<file>file:/C:/Nexon/MapleSolaxia/scripts/npc/world0/2133000.js</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/MapleCharacter.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/expeditions/MapleExpedition.java</file>
<file>file:/C:/Nexon/MapleSolaxia/scripts/npc/world0/9020000.js</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/raid_stage.js</file>
<file>file:/C:/Nexon/MapleSolaxia/src/constants/ServerConstants.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/AbstractPlayerInteraction.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/server/maps/MapleReactor.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PartyOperationHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/MapleParty.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/raid_rest.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/MaplePartyCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/BossRushPQ.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/9000037.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/raidout.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/PiratePQ.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventManager.java</file>
</group> </group>
</open-files> </open-files>
</project-private> </project-private>
+54 -21
View File
@@ -11,6 +11,40 @@ function init() {
em.setProperty("leader", "true"); em.setProperty("leader", "true");
} }
function setEventRewards(eim) {
var itemSet, itemQty, evLevel;
evLevel = 6; //Rewards at event completion
itemSet = [1122018, 1122005, 1022088, 1402013, 1032048, 1032070, 1102046, 2330004, 2041013, 2041016, 2041019, 2041022, 2049100, 2049003, 2020012, 2020013, 2020014, 2020015, 2022029, 2022045, 2022068, 2022069, 2022179, 2022180, 4004000, 4004001, 4004002, 4004003, 4004004, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 25, 25, 25, 25, 25, 25, 25, 25, 4, 12, 12, 12, 12, 12, 25];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 5; //Rewards at Rest Spot V
itemSet = [1122018, 1122005, 1022088, 1402013, 1032048, 1032070, 1102046, 2330004, 2041013, 2041016, 2041019, 2041022, 2049100, 2049003, 2020012, 2020013, 2020014, 2020015, 2022029, 2022045, 2022068, 2022069, 2022179, 2022180, 4004000, 4004001, 4004002, 4004003, 4004004, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 2, 8, 8, 8, 8, 8, 12];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 4; //Rewards at Rest Spot IV
itemSet = [1122001, 1122006, 1022103, 1442065, 1032042, 1032021, 1102168, 2070005, 2040025, 2040029, 2040301, 2040413, 2040701, 2040817, 2002028, 2020009, 2020010, 2020011, 2022004, 2022005, 2022025, 2022027, 2022048, 2022049, 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 3; //Rewards at Rest Spot III
itemSet = [1122002, 1022088, 1012076, 1402029, 1032041, 1032044, 1102167, 2070011, 2040026, 2040030, 2040302, 2040412, 2040702, 2040818, 2002028, 2020009, 2020010, 2020011, 2022004, 2022005, 2022025, 2022027, 2022048, 2022049, 4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 2; //Rewards at Rest Spot II
itemSet = [1122003, 1012077, 1012079, 1432014, 1032059, 1032002, 1102191, 2330002, 2040001, 2040311, 2040401, 2040601, 2040824, 2040901, 2010000, 2010001, 2010002, 2010003, 2010004, 2020001, 2020002, 2020003, 2022020, 2022022, 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 1; //Rewards at Rest Spot I
itemSet = [1122004, 1012078, 1432008, 1432009, 1032040, 1032009, 1102166, 2070001, 2040002, 2040310, 2040400, 2040600, 2040825, 2040902, 2010000, 2010001, 2010002, 2010003, 2010004, 2020001, 2020002, 2020003, 2022020, 2022022, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2];
eim.setEventRewards(evLevel, itemSet, itemQty);
}
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
var eligible = []; var eligible = [];
var hasLeader = false; var hasLeader = false;
@@ -28,6 +62,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
} }
} }
if(!hasLeader) print("no leader");
else if(eligible.length < minPlayers) print("no min");
else if(eligible.length < minPlayers) print("no max");
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = []; if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible; return eligible;
} }
@@ -39,6 +77,7 @@ function setup(level, leaderid) {
em.setProperty("level", level); em.setProperty("level", level);
eim.startEventTimer(45 * 60000); //45 mins eim.startEventTimer(45 * 60000); //45 mins
setEventRewards(eim);
return eim; return eim;
} }
@@ -51,26 +90,21 @@ function scheduledTimeout(eim) {
end(eim); end(eim);
} }
function removePlayer(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function playerExit(eim, player) { function playerExit(eim, player) {
eim.unregisterPlayer(player); eim.unregisterPlayer(player);
player.changeMap(exitMap, 0); player.changeMap(exitMap, 0);
} }
function changedMap(eim, player, mapid) { function changedMap(eim, player, mapid) {
if (mapid < 970030001 || mapid > 970042711) { if (mapid < 970030001 || mapid > 970042711) {
var party = eim.getPlayers(); var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) { if (eim.isLeader(player) || party.size() <= minPlayers) {
eim.unregisterPlayer(player); eim.unregisterPlayer(player);
end(eim); end(eim);
} }
else else
eim.unregisterPlayer(player); eim.unregisterPlayer(player);
} }
} }
function playerDead(eim, player) {} function playerDead(eim, player) {}
@@ -88,12 +122,10 @@ function playerRevive(eim, player) { // player presses ok on the death pop up.
function playerDisconnected(eim, player) { function playerDisconnected(eim, player) {
var party = eim.getPlayers(); var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) { if (eim.isLeader(player) || party.size() <= minPlayers)
eim.unregisterPlayer(player);
end(eim); end(eim);
}
else else
removePlayer(eim, player); playerExit(eim, player);
} }
function leftParty(eim, player) { function leftParty(eim, player) {
@@ -122,9 +154,6 @@ function end(eim) {
function playerClear(eim, player, toMap) { function playerClear(eim, player, toMap) {
eim.unregisterPlayer(player); eim.unregisterPlayer(player);
if(toMap != null) player.changeMap(toMap);
else player.changeMap(clearMap, 0);
} }
function complete(eim, toMap) { function complete(eim, toMap) {
@@ -139,6 +168,10 @@ function clearPQ(eim, toMap) {
complete(eim, toMap); complete(eim, toMap);
} }
function giveRandomEventReward(eim, player) {
eim.giveEventReward(player);
}
function monsterKilled(mob, eim) {} function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {} function allMonstersDead(eim) {}
+26
View File
@@ -0,0 +1,26 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
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 <http://www.gnu.org/licenses/>.
*/
function start() {
cm.sendOk("Should you have a locked box you want to open, bring it to me.");
cm.dispose();
}
+59 -3
View File
@@ -12,9 +12,17 @@ var minPartySize = 1;
var maxPartySize = 6; var maxPartySize = 6;
var state; var state;
function onRestingSpot() {
return cm.getMapId() >= 970030001 && cm.getMapId() <= 970030010;
}
function isFinalBossDone() {
return cm.getMapId() >= 970032700 && cm.getMapId() < 970032800 && cm.getMap().getMonsters().isEmpty();
}
function start() { function start() {
status = -1; status = -1;
state = (cm.getMapId() >= 970030001 && cm.getMapId() <= 970042711) ? 1 : 0; state = (cm.getMapId() >= 970030001 && cm.getMapId() <= 970042711) ? (!onRestingSpot() ? (isFinalBossDone() ? 3 : 1) : 2) : 0;
action(1, 0, 0); action(1, 0, 0);
} }
@@ -32,14 +40,62 @@ function action(mode, type, selection) {
status--; status--;
if (status == 0) { if (status == 0) {
if(state) { if(state == 3) {
if(cm.getPlayer().getEventInstance() != null) {
if(!cm.isLeader()) {
cm.sendOk("Your party leader has not spoken to me yet, please wait him/her talk to me.");
cm.dispose();
return;
}
else {
cm.getPlayer().getEventInstance().finishPQ();
}
}
if(cm.isLeader()) {
cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now, tell your party I will be warping everyone out and rewarding them as they talk to me.");
}
else {
cm.sendOk("For completing all stages in this event, congratulations! Now you will receive a prize that matches your performance here as I warp you out.");
}
}
else if(state == 2) {
if(cm.isLeader()) {
if(cm.getPlayer().getEventInstance().isEventTeamTogether()) {
cm.sendYesNo("Is your party ready to proceed to the next stages? Walk through the portal if you think you're done, the time is now.. Now, do you guys REALLY want to proceed?");
}
else {
cm.sendOk("Please wait for your party to reassemble before proceeding.");
cm.dispose();
return;
}
}
else {
cm.sendOk("Wait for your party leader to give me the signal to proceed. If you're not feeling too well and want to quit, walk through the portal and you will be transported out, you will receive a prize for coming this far.");
cm.dispose();
return;
}
} else if(state == 1) {
cm.sendYesNo("Do you wish to abandon this event?"); cm.sendYesNo("Do you wish to abandon this event?");
} }
else { else {
cm.sendSimple("#b<Party Quest: Boss Rush>#k\r\n\r\nWould you like to collaborate with party members to complete the expedition, or are you brave enough to take it on all by yourself? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details."); cm.sendSimple("#b<Party Quest: Boss Rush>#k\r\n\r\nWould you like to collaborate with party members to complete the expedition, or are you brave enough to take it on all by yourself? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
} }
} else if (status == 1) { } else if (status == 1) {
if(state) { if(state == 3) {
if(!cm.getPlayer().getEventInstance().giveEventReward(cm.getPlayer(), 6)) {
cm.sendOk("Please arrange a slot in all tabs of your inventory beforehand.");
cm.dispose();
return;
}
cm.warp(970030000);
cm.dispose();
} else if(state == 2) {
var restSpot = ((cm.getMapId() - 1) % 5) + 1;
cm.getPlayer().getEventInstance().warpEventTeam(970030100 + (500 * restSpot)); //oh well, other maps won't be used anyway
cm.dispose();
} else if(state == 1) {
cm.warp(970030000); cm.warp(970030000);
cm.dispose(); cm.dispose();
} }
+38
View File
@@ -0,0 +1,38 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
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 <http://www.gnu.org/licenses/>.
*/
/*
BossRushPQ - Rest Spot portal
@author Ronan
*/
function enter(pi) {
var evLevel = ((pi.getMapId() - 1) % 5) + 1;
if(pi.getPlayer().getEventInstance().giveEventReward(pi.getPlayer(), evLevel)) {
pi.warp(970030000);
return true;
}
else {
pi.message("You cannot receive an event prize without having an empty room in your EQUIP, USE, SET-UP or ETC inventory.");
return false;
}
}
+3 -3
View File
@@ -25,11 +25,11 @@ BossRushPQ - Next Stage
*/ */
function enter(pi) { function enter(pi) {
if(pi.getMap().getMonsters().size() == 0) { if(pi.getMap().getMonsters().isEmpty()) {
var nextStage; var nextStage;
if(pi.getMapId() % 5 == 0) nextStage = pi.getMapId() + 100; if(pi.getMapId() % 500 != 0) nextStage = pi.getMapId() + 100;
else nextStage = 970030001 + (pi.getMapId() - 970030100 / 500); else nextStage = 970030001 + ((pi.getMapId() - 970030100) / 500);
pi.warp(nextStage); pi.warp(nextStage);
return true; return true;
+200 -200
View File
@@ -18798,206 +18798,206 @@
(9500355, 2388015, 1, 1, 0, 24000), (9500355, 2388015, 1, 1, 0, 24000),
(9500356, 2388032, 1, 1, 0, 24000), (9500356, 2388032, 1, 1, 0, 24000),
(9500357, 2388016, 1, 1, 0, 24000), (9500357, 2388016, 1, 1, 0, 24000),
(9500357, 4003000, 5, 20, 0, 40000), (9500317, 4003000, 5, 20, 0, 40000),
(9500357, 4003001, 5, 20, 0, 40000), (9500317, 4003001, 5, 20, 0, 40000),
(9500357, 4003002, 5, 20, 0, 40000), (9500317, 4003002, 5, 20, 0, 40000),
(9500357, 4003003, 5, 20, 0, 40000), (9500317, 4003003, 5, 20, 0, 40000),
(9500357, 4004000, 5, 20, 0, 40000), (9500317, 4004000, 5, 20, 0, 40000),
(9500357, 4004001, 5, 20, 0, 40000), (9500317, 4004001, 5, 20, 0, 40000),
(9500357, 4004002, 5, 20, 0, 40000), (9500317, 4004002, 5, 20, 0, 40000),
(9500357, 4004003, 5, 20, 0, 40000), (9500317, 4004003, 5, 20, 0, 40000),
(9500357, 4004004, 5, 20, 0, 40000), (9500317, 4004004, 5, 20, 0, 40000),
(9500357, 4010000, 5, 20, 0, 40000), (9500317, 4010000, 5, 20, 0, 40000),
(9500357, 4010001, 5, 20, 0, 40000), (9500317, 4010001, 5, 20, 0, 40000),
(9500357, 4010002, 5, 20, 0, 40000), (9500317, 4010002, 5, 20, 0, 40000),
(9500357, 4010003, 5, 20, 0, 40000), (9500317, 4010003, 5, 20, 0, 40000),
(9500357, 4010004, 5, 20, 0, 40000), (9500317, 4010004, 5, 20, 0, 40000),
(9500357, 4010005, 5, 20, 0, 40000), (9500317, 4010005, 5, 20, 0, 40000),
(9500357, 4010006, 5, 20, 0, 40000), (9500317, 4010006, 5, 20, 0, 40000),
(9500357, 4010007, 5, 20, 0, 40000), (9500317, 4010007, 5, 20, 0, 40000),
(9500357, 4020000, 5, 20, 0, 40000), (9500317, 4020000, 5, 20, 0, 40000),
(9500357, 4020001, 5, 20, 0, 40000), (9500317, 4020001, 5, 20, 0, 40000),
(9500357, 4020002, 5, 20, 0, 40000), (9500317, 4020002, 5, 20, 0, 40000),
(9500357, 4020003, 5, 20, 0, 40000), (9500317, 4020003, 5, 20, 0, 40000),
(9500357, 4020004, 5, 20, 0, 40000), (9500317, 4020004, 5, 20, 0, 40000),
(9500357, 4020005, 5, 20, 0, 40000), (9500317, 4020005, 5, 20, 0, 40000),
(9500357, 4020006, 5, 20, 0, 40000), (9500317, 4020006, 5, 20, 0, 40000),
(9500357, 4020007, 5, 20, 0, 40000), (9500317, 4020007, 5, 20, 0, 40000),
(9500357, 4020008, 5, 20, 0, 40000), (9500317, 4020008, 5, 20, 0, 40000),
(9500357, 2020001, 5, 20, 0, 40000), (9500317, 2020001, 5, 20, 0, 40000),
(9500357, 2020002, 5, 20, 0, 40000), (9500317, 2020002, 5, 20, 0, 40000),
(9500357, 2020003, 5, 20, 0, 40000), (9500317, 2020003, 5, 20, 0, 40000),
(9500357, 2020004, 5, 20, 0, 40000), (9500317, 2020004, 5, 20, 0, 40000),
(9500357, 2020005, 5, 20, 0, 40000), (9500317, 2020005, 5, 20, 0, 40000),
(9500357, 2020006, 5, 20, 0, 40000), (9500317, 2020006, 5, 20, 0, 40000),
(9500357, 2020007, 5, 20, 0, 40000), (9500317, 2020007, 5, 20, 0, 40000),
(9500357, 2020008, 5, 20, 0, 40000), (9500317, 2020008, 5, 20, 0, 40000),
(9500357, 2020009, 5, 20, 0, 40000), (9500317, 2020009, 5, 20, 0, 40000),
(9500357, 2020010, 5, 20, 0, 40000), (9500317, 2020010, 5, 20, 0, 40000),
(9500357, 2020011, 5, 20, 0, 40000), (9500317, 2020011, 5, 20, 0, 40000),
(9500357, 2020012, 5, 20, 0, 40000), (9500317, 2020012, 5, 20, 0, 40000),
(9500357, 2020013, 5, 20, 0, 40000), (9500317, 2020013, 5, 20, 0, 40000),
(9500357, 2020014, 5, 20, 0, 40000), (9500317, 2020014, 5, 20, 0, 40000),
(9500357, 2020015, 5, 20, 0, 40000), (9500317, 2020015, 5, 20, 0, 40000),
(9500357, 2020016, 5, 20, 0, 40000), (9500317, 2020016, 5, 20, 0, 40000),
(9500357, 2020017, 5, 20, 0, 40000), (9500317, 2020017, 5, 20, 0, 40000),
(9500357, 2020018, 5, 20, 0, 40000), (9500317, 2020018, 5, 20, 0, 40000),
(9500357, 2020019, 5, 20, 0, 40000), (9500317, 2020019, 5, 20, 0, 40000),
(9500357, 2020020, 5, 20, 0, 40000), (9500317, 2020020, 5, 20, 0, 40000),
(9500357, 1092022, 1, 1, 0, 4000), (9500317, 1092022, 1, 1, 0, 4000),
(9500357, 1092030, 1, 1, 0, 4000), (9500317, 1092030, 1, 1, 0, 4000),
(9500357, 1092045, 1, 1, 0, 4000), (9500317, 1092045, 1, 1, 0, 4000),
(9500357, 1092046, 1, 1, 0, 4000), (9500317, 1092046, 1, 1, 0, 4000),
(9500357, 1092047, 1, 1, 0, 4000), (9500317, 1092047, 1, 1, 0, 4000),
(9500357, 1112407, 1, 1, 0, 4000), (9500317, 1112407, 1, 1, 0, 4000),
(9500357, 1112408, 1, 1, 0, 4000), (9500317, 1112408, 1, 1, 0, 4000),
(9500358, 4003000, 5, 20, 0, 40000), (9500318, 4003000, 5, 20, 0, 40000),
(9500358, 4003001, 5, 20, 0, 40000), (9500318, 4003001, 5, 20, 0, 40000),
(9500358, 4003002, 5, 20, 0, 40000), (9500318, 4003002, 5, 20, 0, 40000),
(9500358, 4003003, 5, 20, 0, 40000), (9500318, 4003003, 5, 20, 0, 40000),
(9500358, 4004000, 5, 20, 0, 40000), (9500318, 4004000, 5, 20, 0, 40000),
(9500358, 4004001, 5, 20, 0, 40000), (9500318, 4004001, 5, 20, 0, 40000),
(9500358, 4004002, 5, 20, 0, 40000), (9500318, 4004002, 5, 20, 0, 40000),
(9500358, 4004003, 5, 20, 0, 40000), (9500318, 4004003, 5, 20, 0, 40000),
(9500358, 4004004, 5, 20, 0, 40000), (9500318, 4004004, 5, 20, 0, 40000),
(9500358, 4010000, 5, 20, 0, 40000), (9500318, 4010000, 5, 20, 0, 40000),
(9500358, 4010001, 5, 20, 0, 40000), (9500318, 4010001, 5, 20, 0, 40000),
(9500358, 4010002, 5, 20, 0, 40000), (9500318, 4010002, 5, 20, 0, 40000),
(9500358, 4010003, 5, 20, 0, 40000), (9500318, 4010003, 5, 20, 0, 40000),
(9500358, 4010004, 5, 20, 0, 40000), (9500318, 4010004, 5, 20, 0, 40000),
(9500358, 4010005, 5, 20, 0, 40000), (9500318, 4010005, 5, 20, 0, 40000),
(9500358, 4010006, 5, 20, 0, 40000), (9500318, 4010006, 5, 20, 0, 40000),
(9500358, 4010007, 5, 20, 0, 40000), (9500318, 4010007, 5, 20, 0, 40000),
(9500358, 4020000, 5, 20, 0, 40000), (9500318, 4020000, 5, 20, 0, 40000),
(9500358, 4020001, 5, 20, 0, 40000), (9500318, 4020001, 5, 20, 0, 40000),
(9500358, 4020002, 5, 20, 0, 40000), (9500318, 4020002, 5, 20, 0, 40000),
(9500358, 4020003, 5, 20, 0, 40000), (9500318, 4020003, 5, 20, 0, 40000),
(9500358, 4020004, 5, 20, 0, 40000), (9500318, 4020004, 5, 20, 0, 40000),
(9500358, 4020005, 5, 20, 0, 40000), (9500318, 4020005, 5, 20, 0, 40000),
(9500358, 4020006, 5, 20, 0, 40000), (9500318, 4020006, 5, 20, 0, 40000),
(9500358, 4020007, 5, 20, 0, 40000), (9500318, 4020007, 5, 20, 0, 40000),
(9500358, 4020008, 5, 20, 0, 40000), (9500318, 4020008, 5, 20, 0, 40000),
(9500358, 2020001, 5, 20, 0, 40000), (9500318, 2020001, 5, 20, 0, 40000),
(9500358, 2020002, 5, 20, 0, 40000), (9500318, 2020002, 5, 20, 0, 40000),
(9500358, 2020003, 5, 20, 0, 40000), (9500318, 2020003, 5, 20, 0, 40000),
(9500358, 2020004, 5, 20, 0, 40000), (9500318, 2020004, 5, 20, 0, 40000),
(9500358, 2020005, 5, 20, 0, 40000), (9500318, 2020005, 5, 20, 0, 40000),
(9500358, 2020006, 5, 20, 0, 40000), (9500318, 2020006, 5, 20, 0, 40000),
(9500358, 2020007, 5, 20, 0, 40000), (9500318, 2020007, 5, 20, 0, 40000),
(9500358, 2020008, 5, 20, 0, 40000), (9500318, 2020008, 5, 20, 0, 40000),
(9500358, 2020009, 5, 20, 0, 40000), (9500318, 2020009, 5, 20, 0, 40000),
(9500358, 2020010, 5, 20, 0, 40000), (9500318, 2020010, 5, 20, 0, 40000),
(9500358, 2020011, 5, 20, 0, 40000), (9500318, 2020011, 5, 20, 0, 40000),
(9500358, 2020012, 5, 20, 0, 40000), (9500318, 2020012, 5, 20, 0, 40000),
(9500358, 2020013, 5, 20, 0, 40000), (9500318, 2020013, 5, 20, 0, 40000),
(9500358, 2020014, 5, 20, 0, 40000), (9500318, 2020014, 5, 20, 0, 40000),
(9500358, 2020015, 5, 20, 0, 40000), (9500318, 2020015, 5, 20, 0, 40000),
(9500358, 2020016, 5, 20, 0, 40000), (9500318, 2020016, 5, 20, 0, 40000),
(9500358, 2020017, 5, 20, 0, 40000), (9500318, 2020017, 5, 20, 0, 40000),
(9500358, 2020018, 5, 20, 0, 40000), (9500318, 2020018, 5, 20, 0, 40000),
(9500358, 2020019, 5, 20, 0, 40000), (9500318, 2020019, 5, 20, 0, 40000),
(9500358, 2020020, 5, 20, 0, 40000), (9500318, 2020020, 5, 20, 0, 40000),
(9500358, 1052166, 1, 1, 0, 4000), (9500318, 1052166, 1, 1, 0, 4000),
(9500358, 2330002, 1, 1, 0, 4000), (9500318, 2330002, 1, 1, 0, 4000),
(9500358, 2070011, 1, 1, 0, 4000), (9500318, 2070011, 1, 1, 0, 4000),
(9500358, 1102021, 1, 1, 0, 4000), (9500318, 1102021, 1, 1, 0, 4000),
(9500358, 1102022, 1, 1, 0, 4000), (9500318, 1102022, 1, 1, 0, 4000),
(9500358, 1102023, 1, 1, 0, 4000), (9500318, 1102023, 1, 1, 0, 4000),
(9500358, 1102024, 1, 1, 0, 4000), (9500318, 1102024, 1, 1, 0, 4000),
(9500358, 1102078, 1, 1, 0, 4000), (9500318, 1102078, 1, 1, 0, 4000),
(9500358, 1122001, 1, 1, 0, 4000), (9500318, 1122001, 1, 1, 0, 4000),
(9500358, 1122002, 1, 1, 0, 4000), (9500318, 1122002, 1, 1, 0, 4000),
(9500358, 1122003, 1, 1, 0, 4000), (9500318, 1122003, 1, 1, 0, 4000),
(9500358, 1122004, 1, 1, 0, 4000), (9500318, 1122004, 1, 1, 0, 4000),
(9500358, 1122005, 1, 1, 0, 4000), (9500318, 1122005, 1, 1, 0, 4000),
(9500358, 1122006, 1, 1, 0, 4000), (9500318, 1122006, 1, 1, 0, 4000),
(9500358, 1082175, 1, 1, 0, 4000), (9500318, 1082175, 1, 1, 0, 4000),
(9500358, 1082176, 1, 1, 0, 4000), (9500318, 1082176, 1, 1, 0, 4000),
(9500358, 1082177, 1, 1, 0, 4000), (9500318, 1082177, 1, 1, 0, 4000),
(9500358, 1082178, 1, 1, 0, 4000), (9500318, 1082178, 1, 1, 0, 4000),
(9500358, 1082179, 1, 1, 0, 4000), (9500318, 1082179, 1, 1, 0, 4000),
(9500359, 4003000, 5, 20, 0, 40000), (9500319, 4003000, 5, 20, 0, 40000),
(9500359, 4003001, 5, 20, 0, 40000), (9500319, 4003001, 5, 20, 0, 40000),
(9500359, 4003002, 5, 20, 0, 40000), (9500319, 4003002, 5, 20, 0, 40000),
(9500359, 4003003, 5, 20, 0, 40000), (9500319, 4003003, 5, 20, 0, 40000),
(9500359, 4004000, 5, 20, 0, 40000), (9500319, 4004000, 5, 20, 0, 40000),
(9500359, 4004001, 5, 20, 0, 40000), (9500319, 4004001, 5, 20, 0, 40000),
(9500359, 4004002, 5, 20, 0, 40000), (9500319, 4004002, 5, 20, 0, 40000),
(9500359, 4004003, 5, 20, 0, 40000), (9500319, 4004003, 5, 20, 0, 40000),
(9500359, 4004004, 5, 20, 0, 40000), (9500319, 4004004, 5, 20, 0, 40000),
(9500359, 4010000, 5, 20, 0, 40000), (9500319, 4010000, 5, 20, 0, 40000),
(9500359, 4010001, 5, 20, 0, 40000), (9500319, 4010001, 5, 20, 0, 40000),
(9500359, 4010002, 5, 20, 0, 40000), (9500319, 4010002, 5, 20, 0, 40000),
(9500359, 4010003, 5, 20, 0, 40000), (9500319, 4010003, 5, 20, 0, 40000),
(9500359, 4010004, 5, 20, 0, 40000), (9500319, 4010004, 5, 20, 0, 40000),
(9500359, 4010005, 5, 20, 0, 40000), (9500319, 4010005, 5, 20, 0, 40000),
(9500359, 4010006, 5, 20, 0, 40000), (9500319, 4010006, 5, 20, 0, 40000),
(9500359, 4010007, 5, 20, 0, 40000), (9500319, 4010007, 5, 20, 0, 40000),
(9500359, 4020000, 5, 20, 0, 40000), (9500319, 4020000, 5, 20, 0, 40000),
(9500359, 4020001, 5, 20, 0, 40000), (9500319, 4020001, 5, 20, 0, 40000),
(9500359, 4020002, 5, 20, 0, 40000), (9500319, 4020002, 5, 20, 0, 40000),
(9500359, 4020003, 5, 20, 0, 40000), (9500319, 4020003, 5, 20, 0, 40000),
(9500359, 4020004, 5, 20, 0, 40000), (9500319, 4020004, 5, 20, 0, 40000),
(9500359, 4020005, 5, 20, 0, 40000), (9500319, 4020005, 5, 20, 0, 40000),
(9500359, 4020006, 5, 20, 0, 40000), (9500319, 4020006, 5, 20, 0, 40000),
(9500359, 4020007, 5, 20, 0, 40000), (9500319, 4020007, 5, 20, 0, 40000),
(9500359, 4020008, 5, 20, 0, 40000), (9500319, 4020008, 5, 20, 0, 40000),
(9500359, 2020001, 5, 20, 0, 40000), (9500319, 2020001, 5, 20, 0, 40000),
(9500359, 2020002, 5, 20, 0, 40000), (9500319, 2020002, 5, 20, 0, 40000),
(9500359, 2020003, 5, 20, 0, 40000), (9500319, 2020003, 5, 20, 0, 40000),
(9500359, 2020004, 5, 20, 0, 40000), (9500319, 2020004, 5, 20, 0, 40000),
(9500359, 2020005, 5, 20, 0, 40000), (9500319, 2020005, 5, 20, 0, 40000),
(9500359, 2020006, 5, 20, 0, 40000), (9500319, 2020006, 5, 20, 0, 40000),
(9500359, 2020007, 5, 20, 0, 40000), (9500319, 2020007, 5, 20, 0, 40000),
(9500359, 2020008, 5, 20, 0, 40000), (9500319, 2020008, 5, 20, 0, 40000),
(9500359, 2020009, 5, 20, 0, 40000), (9500319, 2020009, 5, 20, 0, 40000),
(9500359, 2020010, 5, 20, 0, 40000), (9500319, 2020010, 5, 20, 0, 40000),
(9500359, 2020011, 5, 20, 0, 40000), (9500319, 2020011, 5, 20, 0, 40000),
(9500359, 2020012, 5, 20, 0, 40000), (9500319, 2020012, 5, 20, 0, 40000),
(9500359, 2020013, 5, 20, 0, 40000), (9500319, 2020013, 5, 20, 0, 40000),
(9500359, 2020014, 5, 20, 0, 40000), (9500319, 2020014, 5, 20, 0, 40000),
(9500359, 2020015, 5, 20, 0, 40000), (9500319, 2020015, 5, 20, 0, 40000),
(9500359, 2020016, 5, 20, 0, 40000), (9500319, 2020016, 5, 20, 0, 40000),
(9500359, 2020017, 5, 20, 0, 40000), (9500319, 2020017, 5, 20, 0, 40000),
(9500359, 2020018, 5, 20, 0, 40000), (9500319, 2020018, 5, 20, 0, 40000),
(9500359, 2020019, 5, 20, 0, 40000), (9500319, 2020019, 5, 20, 0, 40000),
(9500359, 2020020, 5, 20, 0, 40000), (9500319, 2020020, 5, 20, 0, 40000),
(9500359, 1052166, 1, 1, 0, 4000), (9500319, 1052166, 1, 1, 0, 4000),
(9500359, 2280000, 1, 1, 0, 4000), (9500319, 2280000, 1, 1, 0, 4000),
(9500359, 2280001, 1, 1, 0, 4000), (9500319, 2280001, 1, 1, 0, 4000),
(9500359, 2280002, 1, 1, 0, 4000), (9500319, 2280002, 1, 1, 0, 4000),
(9500359, 2280003, 1, 1, 0, 4000), (9500319, 2280003, 1, 1, 0, 4000),
(9500359, 2280004, 1, 1, 0, 4000), (9500319, 2280004, 1, 1, 0, 4000),
(9500359, 2280005, 1, 1, 0, 4000), (9500319, 2280005, 1, 1, 0, 4000),
(9500359, 2280006, 1, 1, 0, 4000), (9500319, 2280006, 1, 1, 0, 4000),
(9500359, 2280007, 1, 1, 0, 4000), (9500319, 2280007, 1, 1, 0, 4000),
(9500359, 2280008, 1, 1, 0, 4000), (9500319, 2280008, 1, 1, 0, 4000),
(9500359, 2280009, 1, 1, 0, 4000), (9500319, 2280009, 1, 1, 0, 4000),
(9500359, 2280010, 1, 1, 0, 4000), (9500319, 2280010, 1, 1, 0, 4000),
(9500359, 2280011, 1, 1, 0, 4000), (9500319, 2280011, 1, 1, 0, 4000),
(9500359, 2280012, 1, 1, 0, 4000), (9500319, 2280012, 1, 1, 0, 4000),
(9500359, 2044712, 1, 1, 0, 4000), (9500319, 2044712, 1, 1, 0, 4000),
(9500359, 2044612, 1, 1, 0, 4000), (9500319, 2044612, 1, 1, 0, 4000),
(9500359, 2044512, 1, 1, 0, 4000), (9500319, 2044512, 1, 1, 0, 4000),
(9500359, 2044417, 1, 1, 0, 4000), (9500319, 2044417, 1, 1, 0, 4000),
(9500359, 2044317, 1, 1, 0, 4000), (9500319, 2044317, 1, 1, 0, 4000),
(9500359, 2044217, 1, 1, 0, 4000), (9500319, 2044217, 1, 1, 0, 4000),
(9500359, 2044117, 1, 1, 0, 4000), (9500319, 2044117, 1, 1, 0, 4000),
(9500359, 2044025, 1, 1, 0, 4000), (9500319, 2044025, 1, 1, 0, 4000),
(9500359, 2043812, 1, 1, 0, 4000), (9500319, 2043812, 1, 1, 0, 4000),
(9500359, 2043712, 1, 1, 0, 4000), (9500319, 2043712, 1, 1, 0, 4000),
(9500359, 2043312, 1, 1, 0, 4000), (9500319, 2043312, 1, 1, 0, 4000),
(9500359, 2043217, 1, 1, 0, 4000), (9500319, 2043217, 1, 1, 0, 4000),
(9500359, 2043117, 1, 1, 0, 4000), (9500319, 2043117, 1, 1, 0, 4000),
(9500359, 2043023, 1, 1, 0, 4000), (9500319, 2043023, 1, 1, 0, 4000),
(9500359, 1132005, 1, 1, 0, 4000), (9500319, 1132005, 1, 1, 0, 4000),
(9500359, 1132006, 1, 1, 0, 4000), (9500319, 1132006, 1, 1, 0, 4000),
(9500359, 1132007, 1, 1, 0, 4000), (9500319, 1132007, 1, 1, 0, 4000),
(9500359, 1132008, 1, 1, 0, 4000), (9500319, 1132008, 1, 1, 0, 4000),
(9500359, 1132009, 1, 1, 0, 4000), (9500319, 1132009, 1, 1, 0, 4000),
(9500359, 1422011, 1, 1, 0, 4000), (9500319, 1422011, 1, 1, 0, 4000),
(9500359, 1432046, 1, 1, 0, 4000), (9500319, 1432046, 1, 1, 0, 4000),
(9500359, 1332030, 1, 1, 0, 4000); (9500319, 1332030, 1, 1, 0, 4000);
# (dropperid, itemid, minqty, maxqty, questid, chance) # (dropperid, itemid, minqty, maxqty, questid, chance)
+13 -1
View File
@@ -1668,6 +1668,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
updateSingleStat(MapleStat.GACHAEXP, gachaexp.addAndGet(gain)); updateSingleStat(MapleStat.GACHAEXP, gachaexp.addAndGet(gain));
} }
public void gainExp(int gain) {
gainExp(gain, true, true);
}
public void gainExp(int gain, boolean show, boolean inChat) { public void gainExp(int gain, boolean show, boolean inChat) {
gainExp(gain, 0, show, inChat, true); gainExp(gain, 0, show, inChat, true);
} }
@@ -2731,6 +2735,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
return getItemQuantity(itemid, false) > 0; return getItemQuantity(itemid, false) > 0;
} }
public boolean hasEmptySlot(int itemId) {
return getInventory(MapleItemInformationProvider.getInstance().getInventoryType(itemId)).getNextFreeSlot() > -1;
}
public boolean hasEmptySlot(byte invType) {
return getInventory(MapleInventoryType.getByType(invType)).getNextFreeSlot() > -1;
}
public void increaseGuildCapacity() { //hopefully nothing is null public void increaseGuildCapacity() { //hopefully nothing is null
if (getMeso() < getGuild().getIncreaseGuildCost(getGuild().getCapacity())) { if (getMeso() < getGuild().getIncreaseGuildCost(getGuild().getCapacity())) {
dropMessage(1, "You don't have enough mesos."); dropMessage(1, "You don't have enough mesos.");
@@ -2787,7 +2799,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public boolean isPartyLeader() { public boolean isPartyLeader() {
return party.getLeader() == party.getMemberById(getId()); return party.getLeaderId() == getId();
} }
public void leaveMap() { public void leaveMap() {
+6 -4
View File
@@ -803,10 +803,12 @@ public class MapleClient {
if (messengerid > 0) { if (messengerid > 0) {
worlda.leaveMessenger(messengerid, chrm); worlda.leaveMessenger(messengerid, chrm);
} }
/* if (fid > 0) { /*
final MapleFamily family = worlda.getFamily(fid); if (fid > 0) {
family. final MapleFamily family = worlda.getFamily(fid);
}*/ family.
}
*/
for (MapleQuestStatus status : player.getStartedQuests()) { //This is for those quests that you have to stay logged in for a certain amount of time for (MapleQuestStatus status : player.getStartedQuests()) { //This is for those quests that you have to stay logged in for a certain amount of time
MapleQuest quest = status.getQuest(); MapleQuest quest = status.getQuest();
if (quest.getTimeLimit() > 0) { if (quest.getTimeLimit() > 0) {
+2 -2
View File
@@ -37,6 +37,7 @@ public class ServerConstants {
public static final boolean USE_REFRESH_RANK_MOVE = true; public static final boolean USE_REFRESH_RANK_MOVE = true;
public static final int MAX_AP = 999; public static final int MAX_AP = 999;
public static final int MAX_EVENT_LEVELS = 8; //event has different levels of rewarding system
public static final long BLOCK_DUEY_RACE_COND = (long)(0.5 * 1000); public static final long BLOCK_DUEY_RACE_COND = (long)(0.5 * 1000);
public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //time the pet must wait before trying to pick items up. public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //time the pet must wait before trying to pick items up.
@@ -57,8 +58,7 @@ public class ServerConstants {
public static final double PET_AUTOHP_RATIO = 0.99; //will automatically consume potions until given ratio of the MaxHP/MaxMP is reached. public static final double PET_AUTOHP_RATIO = 0.99; //will automatically consume potions until given ratio of the MaxHP/MaxMP is reached.
public static final double PET_AUTOMP_RATIO = 0.99; public static final double PET_AUTOMP_RATIO = 0.99;
//Should bosses really use 1HP,1MP attacks in dojo? public static final boolean USE_DEADLY_DOJO = false; //Should bosses really use 1HP,1MP attacks in dojo?
public static final boolean USE_DEADLY_DOJO = false;
//Rates //Rates
public static final int EXP_RATE = 10; public static final int EXP_RATE = 10;
+15 -5
View File
@@ -27,14 +27,14 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
public class MapleParty { public class MapleParty {
private MaplePartyCharacter leader; private int leaderId;
private List<MaplePartyCharacter> members = new LinkedList<MaplePartyCharacter>(); private List<MaplePartyCharacter> members = new LinkedList<MaplePartyCharacter>();
private List<MaplePartyCharacter> pqMembers = null; private List<MaplePartyCharacter> pqMembers = null;
private int id; private int id;
public MapleParty(int id, MaplePartyCharacter chrfor) { public MapleParty(int id, MaplePartyCharacter chrfor) {
this.leader = chrfor; this.leaderId = chrfor.getId();
this.members.add(this.leader); this.members.add(chrfor);
this.id = id; this.id = id;
} }
@@ -51,7 +51,7 @@ public class MapleParty {
} }
public void setLeader(MaplePartyCharacter victim) { public void setLeader(MaplePartyCharacter victim) {
this.leader = victim; this.leaderId = victim.getId();
} }
public void updateMember(MaplePartyCharacter member) { public void updateMember(MaplePartyCharacter member) {
@@ -96,8 +96,18 @@ public class MapleParty {
this.id = id; this.id = id;
} }
public int getLeaderId() {
return leaderId;
}
public MaplePartyCharacter getLeader() { public MaplePartyCharacter getLeader() {
return leader; for(MaplePartyCharacter mpc: members) {
if(mpc.getId() == leaderId) {
return mpc;
}
}
return null;
} }
@Override @Override
+1 -1
View File
@@ -531,7 +531,7 @@ public class AbstractPlayerInteraction {
if(getParty() == null) if(getParty() == null)
return false; return false;
return getParty().getLeader().equals(getPlayer().getMPC()); return getParty().getLeaderId() == getPlayer().getId();
} }
public void givePartyItems(int id, short quantity, List<MapleCharacter> party) { public void givePartyItems(int id, short quantity, List<MapleCharacter> party) {
+157 -12
View File
@@ -46,13 +46,16 @@ import server.maps.MapleMap;
import server.maps.MapleMapFactory; import server.maps.MapleMapFactory;
import tools.DatabaseConnection; import tools.DatabaseConnection;
import client.MapleCharacter; import client.MapleCharacter;
import constants.ItemConstants;
import constants.ServerConstants;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import scripting.AbstractPlayerInteraction;
/** /**
* *
* @author Matze * @author Matze, Ronan
*/ */
public class EventInstanceManager { public class EventInstanceManager {
private List<MapleCharacter> chars = new ArrayList<>(); private List<MapleCharacter> chars = new ArrayList<>();
@@ -73,6 +76,11 @@ public class EventInstanceManager {
private ScheduledFuture<?> event_schedule = null; private ScheduledFuture<?> event_schedule = null;
private boolean disposed = false; private boolean disposed = false;
// multi-leveled PQ rewards!
private Map<Integer, List<Integer>> collectionSet = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
private Map<Integer, List<Integer>> collectionQty = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
private Map<Integer, Integer> collectionExp = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
public EventInstanceManager(EventManager em, String name) { public EventInstanceManager(EventManager em, String name) {
this.em = em; this.em = em;
this.name = name; this.name = name;
@@ -144,16 +152,51 @@ public class EventInstanceManager {
eventTime = time; eventTime = time;
event_schedule = TimerManager.getInstance().schedule(new Runnable() { event_schedule = TimerManager.getInstance().schedule(new Runnable() {
public void run() { public void run() {
try { try {
em.getIv().invokeFunction("scheduledTimeout", EventInstanceManager.this); em.getIv().invokeFunction("scheduledTimeout", EventInstanceManager.this);
} catch (ScriptException | NoSuchMethodException ex) { dismissEventTimer();
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex); } catch (ScriptException | NoSuchMethodException ex) {
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
}
} }
}
}, time); }, time);
} }
public void addEventTimer(long time) {
if(event_schedule != null) {
if(event_schedule.cancel(false)) {
long nextTime = getTimeLeft() + time;
eventTime += time;
event_schedule = TimerManager.getInstance().schedule(new Runnable() {
public void run() {
try {
em.getIv().invokeFunction("scheduledTimeout", EventInstanceManager.this);
dismissEventTimer();
} catch (ScriptException | NoSuchMethodException ex) {
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
}
}
}, nextTime);
}
}
else {
startEventTimer(time);
}
}
public void cancelEventTimer() {
if(event_schedule != null) event_schedule.cancel(false);
dismissEventTimer();
}
private void dismissEventTimer() {
event_schedule = null;
eventTime = 0;
timeStarted = 0;
}
public boolean isTimerStarted() { public boolean isTimerStarted() {
return eventTime > 0 && timeStarted > 0; return eventTime > 0 && timeStarted > 0;
} }
@@ -318,7 +361,7 @@ public class EventInstanceManager {
wL.unlock(); wL.unlock();
} }
if(event_schedule != null) event_schedule.cancel(true); if(event_schedule != null) event_schedule.cancel(false);
mobs.clear(); mobs.clear();
killCount.clear(); killCount.clear();
@@ -388,9 +431,9 @@ public class EventInstanceManager {
return props.getProperty(key); return props.getProperty(key);
} }
public Properties getProperties(){ public Properties getProperties(){
return props; return props;
} }
public void leftParty(MapleCharacter chr) { public void leftParty(MapleCharacter chr) {
try { try {
@@ -425,7 +468,7 @@ public class EventInstanceManager {
} }
public boolean isLeader(MapleCharacter chr) { public boolean isLeader(MapleCharacter chr) {
return (chr.getParty().getLeader().getId() == chr.getId()); return (chr.getParty().getLeaderId() == chr.getId());
} }
public final MapleMap setInstanceMap(final int mapid) { //gets instance map from the channelserv public final MapleMap setInstanceMap(final int mapid) { //gets instance map from the channelserv
@@ -468,4 +511,106 @@ public class EventInstanceManager {
} }
return false; return false;
} }
private List<Integer> convertToIntegerArray(List<Double> list) {
List<Integer> intList = new ArrayList<>();
for(Double d: list) intList.add(d.intValue());
return intList;
}
public final void setEventRewards(List<Double> rwds, List<Double> qtys) {
setEventRewards(1, rwds, qtys);
}
public final void setEventRewards(int eventLevel, List<Double> rwds, List<Double> qtys) {
setEventRewards(eventLevel, rwds, qtys, 0);
}
public final void setEventRewards(int eventLevel, List<Double> rwds, List<Double> qtys, int expGiven) {
// fixed EXP will be rewarded at the same time the random item is given
if(eventLevel <= 0 || eventLevel > ServerConstants.MAX_EVENT_LEVELS) return;
eventLevel--; //event level starts from 1
List<Integer> rewardIds = convertToIntegerArray(rwds);
List<Integer> rewardQtys = convertToIntegerArray(qtys);
//rewardsSet and rewardsQty hold temporary values
collectionSet.put(eventLevel, rewardIds);
collectionQty.put(eventLevel, rewardQtys);
collectionExp.put(eventLevel, expGiven);
}
private byte getRewardListRequirements(int level) {
if(level >= collectionSet.size()) return 0;
byte rewardTypes = 0;
List<Integer> list = collectionSet.get(level);
for (Integer itemId : list) {
rewardTypes |= (1 << ItemConstants.getInventoryType(itemId).getType());
}
return rewardTypes;
}
private boolean hasRewardSlot(MapleCharacter player, int eventLevel) {
byte listReq = getRewardListRequirements(eventLevel); //gets all types of items present in the event reward list
//iterating over all valid inventory types
for(byte type = 1; type <= 5; type++) {
if((listReq >> type) % 2 == 1 && !player.hasEmptySlot(type))
return false;
}
return true;
}
public final boolean giveEventReward(MapleCharacter player) {
return giveEventReward(player, 1);
}
//gives out EXP & a random item in a similar fashion of when clearing KPQ, LPQ, etc.
public final boolean giveEventReward(MapleCharacter player, int eventLevel) {
eventLevel--; //event level starts counting from 1
if(eventLevel >= collectionSet.size()) return true;
List<Integer> rewardsSet = collectionSet.get(eventLevel);
List<Integer> rewardsQty = collectionQty.get(eventLevel);
Integer rewardExp = collectionExp.get(eventLevel);
if(rewardExp == null) rewardExp = 0;
if(rewardsSet == null || rewardsSet.isEmpty()) {
if(rewardExp > 0) player.gainExp(rewardExp);
return true;
}
if(!hasRewardSlot(player, eventLevel)) return false;
AbstractPlayerInteraction api = new AbstractPlayerInteraction(player.getClient());
int rnd = (int)Math.floor(Math.random() * rewardsSet.size());
api.gainItem(rewardsSet.get(rnd), rewardsQty.get(rnd).shortValue());
if(rewardExp > 0) player.gainExp(rewardExp);
return true;
}
public final boolean isEventTeamTogether() {
if(chars.size() <= 1) return true;
int mapId = chars.get(0).getMapId();
for(int i = 1; i < chars.size(); i++) {
if(chars.get(i).getMapId() != mapId) return false;
}
return true;
}
public final void warpEventTeam(int warpTo) {
for (MapleCharacter chr : chars) {
chr.changeMap(warpTo);
}
}
} }
+1 -1
View File
@@ -92,7 +92,7 @@ public class EventManager {
public void cancelSchedule() { public void cancelSchedule() {
if(schedule != null) if(schedule != null)
schedule.cancel(true); schedule.cancel(false);
} }
public ScheduledFuture<?> scheduleAtTimestamp(final String methodName, long timestamp) { public ScheduledFuture<?> scheduleAtTimestamp(final String methodName, long timestamp) {
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="731"/> <int name="x" value="731"/>
<int name="y" value="2199"/> <int name="y" value="2199"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -4
View File
@@ -946,12 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="731"/> <int name="x" value="731"/>
<int name="y" value="2202"/> <int name="y" value="2202"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value=""/> <string name="script" value="raid_rest"/>
<int name="hideTooltip" value="0"/> <int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/> <int name="onlyOnce" value="0"/>
<int name="delay" value="0"/> <int name="delay" value="0"/>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="723"/> <int name="x" value="723"/>
<int name="y" value="2201"/> <int name="y" value="2201"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="724"/> <int name="x" value="724"/>
<int name="y" value="2202"/> <int name="y" value="2202"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="727"/> <int name="x" value="727"/>
<int name="y" value="2203"/> <int name="y" value="2203"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="726"/> <int name="x" value="726"/>
<int name="y" value="2203"/> <int name="y" value="2203"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="728"/> <int name="x" value="728"/>
<int name="y" value="2202"/> <int name="y" value="2202"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="731"/> <int name="x" value="731"/>
<int name="y" value="2202"/> <int name="y" value="2202"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="731"/> <int name="x" value="731"/>
<int name="y" value="2203"/> <int name="y" value="2203"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+4 -3
View File
@@ -946,11 +946,12 @@
</imgdir> </imgdir>
<imgdir name="1"> <imgdir name="1">
<string name="pn" value="out00"/> <string name="pn" value="out00"/>
<int name="pt" value="2"/> <int name="pt" value="7"/>
<int name="x" value="729"/> <int name="x" value="729"/>
<int name="y" value="2204"/> <int name="y" value="2204"/>
<int name="tm" value="970030000"/> <int name="tm" value="999999999"/>
<string name="tn" value="out00"/> <string name="tn" value=""/>
<string name="script" value="raid_rest"/>
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
-12
View File
@@ -1534,17 +1534,5 @@
<int name="tm" value="999999999"/> <int name="tm" value="999999999"/>
<string name="tn" value=""/> <string name="tn" value=""/>
</imgdir> </imgdir>
<imgdir name="4">
<string name="pn" value="clear"/>
<int name="pt" value="7"/>
<int name="x" value="-505"/>
<int name="y" value="165"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="raid_stage"/>
<int name="hideTooltip" value="0"/>
<int name="onlyOnce" value="0"/>
<int name="delay" value="0"/>
</imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>