Adjusted AP gains, to get it to work following the AP Reset check method. Fixed usage of inexistent itemids on CPQ and fishing. Fixed one-of-a-kind items being lost in player trades due to missing inventory checks. Implemented matching system for the guild creation phase. All players intending to join the new guild must be on the Guild Headquartes and accept the creation of the guild. Fixed changing jobs not properly updating info on the party tab. Fixed double tooltip information on CPQ actions UI. Fixed CPQ not disbanding after a player leaves the party/instance. Fixed checks for "in-progress" CPQ instances. Fixed changing maps on CPQ not leading players back to the starting battlefield. Reviewed login system, now preventing non-local IP connecting on local server and local IP on non-local server. Reviewed login system, now cherrypicking sessions in transition state when trying to disconnect them due to a failed login (avoiding possible mishaps due to duplicate sessions of a same account). Adjusted PiratePQ stage 2, now mobs respawn rather than making party leader request for new waves. Adjusted Prime Minister, its spawn is no longer related to starting the quest. It should also allow party fights. Fixed "forcevac" command not properly applying, rather sending to inventory, "consume-on-pickup" items. Fixed (probably) accId = 0 issue on login, that was occurring due to client accountid's being set to 0 a while before being checked once again on finishLogin(). Fixed an issue with extended time on CPQ not properly showing the end-match's visual effect.
93 lines
3.7 KiB
JavaScript
93 lines
3.7 KiB
JavaScript
/**
|
|
-- Version Info -----------------------------------------------------------------------------------
|
|
1.0 - First Version by Drago (MapleStorySA)
|
|
2.0 - Second Version by Jayd - translated CPQ contents to English
|
|
---------------------------------------------------------------------------------------------------
|
|
**/
|
|
|
|
var cpqMinLvl = 51;
|
|
var cpqMaxLvl = 69;
|
|
var cpqMinAmt = 2;
|
|
var cpqMaxAmt = 6;
|
|
|
|
function start() {
|
|
status = -1;
|
|
action(1, 0, 0);
|
|
}
|
|
|
|
function action(mode, type, selection) {
|
|
if (mode == -1) {
|
|
cm.dispose();
|
|
} else {
|
|
if (mode == 0 && status == 0) {
|
|
cm.dispose();
|
|
return;
|
|
}
|
|
if (mode == 1)
|
|
status++;
|
|
else
|
|
status--;
|
|
if (status == 0) {
|
|
if (cm.getParty() == null) {
|
|
status = 10;
|
|
cm.sendOk("You need to create a party before you can participate in Monster Carnival!");
|
|
} else if (!cm.isLeader()) {
|
|
status = 10;
|
|
cm.sendOk("If you want to start the battle, let the #bleader#k come and speak to me.");
|
|
} else {
|
|
var leaderMapid = cm.getMapId();
|
|
var party = cm.getParty().getMembers();
|
|
var inMap = cm.partyMembersInMap();
|
|
var lvlOk = 0;
|
|
var isOutMap = 0;
|
|
for (var i = 0; i < party.size(); i++) {
|
|
if (party.get(i).getLevel() >= cpqMinLvl && party.get(i).getLevel() <= cpqMaxLvl) {
|
|
lvlOk++;
|
|
|
|
if (party.get(i).getPlayer().getMapId() != leaderMapid) {
|
|
isOutMap++;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (party >= 1) {
|
|
status = 10;
|
|
cm.sendOk("You do not have enough people in your party. You need a party with #b" + cpqMinAmt + "#k - #r" + cpqMaxAmt + "#k members and they should be on the map with you.");
|
|
} else if (lvlOk != inMap) {
|
|
status = 10;
|
|
cm.sendOk("Make sure everyone in your party is among the correct levels (" + cpqMinLvl + "~" + cpqMaxLvl + ")!");
|
|
} else if (isOutMap > 0) {
|
|
status = 10;
|
|
cm.sendOk("There are some of the party members that is not on the map!");
|
|
} else {
|
|
if (!cm.sendCPQMapLists2()) {
|
|
cm.sendOk("All Monster Carnival fields are currently in use! Try again later.");
|
|
cm.dispose();
|
|
}
|
|
}
|
|
}
|
|
} else if (status == 1) {
|
|
if (cm.fieldTaken2(selection)) {
|
|
if (cm.fieldLobbied2(selection)) {
|
|
cm.challengeParty2(selection);
|
|
cm.dispose();
|
|
} else {
|
|
cm.sendOk("The room is currently full.");
|
|
cm.dispose();
|
|
}
|
|
} else {
|
|
var party = cm.getParty().getMembers();
|
|
if ((selection === 0 || selection === 1 ) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 2)) {
|
|
cm.sendOk("You need at least 2 players to participate in the battle!");
|
|
} else if ((selection === 2 ) && party.size() < (Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS ? 1 : 3)) {
|
|
cm.sendOk("You need at least 3 players to participate in the battle!");
|
|
} else {
|
|
cm.cpqLobby2(selection);
|
|
}
|
|
cm.dispose();
|
|
}
|
|
} else if (status == 11) {
|
|
cm.dispose();
|
|
}
|
|
}
|
|
} |