Updated Meso & Arrow drops + Aran change jobs fix + improved concurrency

Added meso drop data for many mobs that were missing mesos.
Enhanced arrow drop data, now dropping bundles instead of unitary items.
Fixed issues with several Aran change jobs crashing the player shortly after changing jobs.
Improved concurrency in MapleGuild, MapleAlliance and MaplePlayerShop.
New tools: MapleArrowFetcher and MapleMesoFetcher, that were used to compile the updated drop data info.
This commit is contained in:
ronancpl
2017-11-01 13:34:26 -02:00
parent 44949aea37
commit 64af2cfa00
192 changed files with 44793 additions and 271 deletions

View File

@@ -0,0 +1,82 @@
/** * [MENTION=19862]id[/MENTION] 2042000
* [MENTION=806871]NPC[/MENTION] Spiegelmann
* [MENTION=836108]Function[/MENTION] Monster Carnival Lobby NPC
* @author s4nta
*/
// Relevant Monster Carnival classes
var MonsterCarnival = net.sf.odinms.server.partyquest.mcpq.MonsterCarnival;
var MCTracker = net.sf.odinms.server.partyquest.mcpq.MCTracker;
var MCParty = net.sf.odinms.server.partyquest.mcpq.MCParty;
var MCField = net.sf.odinms.server.partyquest.mcpq.MCField;
var MCTeam = net.sf.odinms.server.partyquest.mcpq.MCField.MCTeam;
// NPC variables
var status = -1;
var carnival, field;
var room = -1;
function start() {
if (cm.getMapId() != 980000000) {
MCTracker.log("Spiegelmann called on invalid map " + cm.getMapId() + " by player " + cm.getName());
cm.sendOk("You are not authorized to do this.");
cm.dispose();
return;
}
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
return;
}
if (mode == 1) status++;
else status--;
if (status == 0) {
if (cm.getParty() == null) {
cm.sendOk("You are not in a party.");
cm.dispose();
return;
} else if (!cm.isLeader()) {
cm.sendOk("If you want to try Carnival PQ, please tell the #bleader of your party#k to talk to me.");
cm.dispose();
return;
}
carnival = MonsterCarnival.getMonsterCarnival(cm.getChannel());
cm.sendSimple(carnival.getNPCAvailableFields());
} else if (status == 1) {
room = selection;
if (room < 1 || room > 6) {
cm.sendOk("That is not a valid room.");
cm.dispose();
return;
}
var code = carnival.registerStatus(cm.getParty(), selection);
if (code == MonsterCarnival.STATUS_FIELD_FULL) {
cm.sendOk("This room is currently full.")
} else if (code == MonsterCarnival.STATUS_PARTY_SIZE) {
cm.sendOk("Your party is not the right size for this field.");
} else if (code == MonsterCarnival.STATUS_PARTY_LEVEL) {
cm.sendOk("Please check to see that the members in your party are between level 30 and 50.");
} else if (code == MonsterCarnival.STATUS_PARTY_MISSING) {
cm.sendOk("Please make sure everyone in your party is in this lobby.");
} else if (code == MonsterCarnival.STATUS_FIELD_INVALID) {
cm.sendOk("Unauthorized request.");
}
if (code == MonsterCarnival.STATUS_PROCEED) {
field = carnival.getField(room);
party = carnival.createParty(cm.getParty());
field.register(party, MCTeam.RED);
cm.sendOk("You will have 3 minutes to accept challenges from other parties.");
} else if (code == MonsterCarnival.STATUS_REQUEST) {
cm.sendOk("Sending request to room " + room + ". You will be automatically warped in if they accept your challenge.");
field = carnival.getField(room);
party = carnival.createParty(cm.getParty());
field.request(party);
}
cm.dispose();
}
}

View File

@@ -0,0 +1,326 @@
/** * [MENTION=19862]id[/MENTION] 2042002
* [MENTION=806871]NPC[/MENTION] Spiegelmann
* [MENTION=836108]Function[/MENTION] Monster Carnival NPC
* @author s4nta
* [MENTION=497496]cred[/MENTION]its xirengfx (for store code, CPQ description)
*/
var DISABLED = false;
var SavedLocationType = Packages.net.sf.odinms.server.maps.SavedLocationType;
// Relevant Monster Carnival classes
var MonsterCarnival = Packages.net.sf.odinms.server.partyquest.mcpq.MonsterCarnival;
var MCTracker = Packages.net.sf.odinms.server.partyquest.mcpq.MCTracker;
var MCParty = Packages.net.sf.odinms.server.partyquest.mcpq.MCParty;
var MCField = Packages.net.sf.odinms.server.partyquest.mcpq.MCField;
// NPC variables
var status = -1;
var store = false;
var ctx = -1; //context
var storeInfo;
var purchaseId;
var purchaseCost;
// Reference
var coinId = 4001129;
var coinIcon = "#i" + coinId + "#";
var infoMaps = [220000000, 200000000, 103000000, 540000000]; // ludi, orbis, kerning, singapore
var gradeS = 600
var gradeA = 500
var gradeB = 400
var gradeC = 300
var gradeD = 200
var gradeE = 100
var expRewards = [[150000, 100000], // S Winner/Loser
[100000, 70000], // A Winner/Loser
[75000, 43250], // B Winner/Loser
[50000, 25000], // C Winner/Loser
[25000, 12500], // D Winner/Loser
[12500, 6250], // E Winner/Loser
[5000, 2500] // F Winner/Loser
];
// Exchange stores
var warrior = [[1302004, 7], [1402006, 7], [1302009, 10], [1402007, 10],
[1302010, 20], [1402003, 20], [1312006, 7], [1412004, 7],
[1312007, 10], [1412005, 10], [1312018, 20], [1412003, 20],
[1322015, 7], [1422008, 7], [1322016, 10], [1422007, 10],
[1322017, 20], [1422005, 20], [1432003, 7], [1442003, 7],
[1432005, 10], [1442009, 10], [1442005, 20], [1432004, 20]];
var magician = [[1372001, 7], [1382018, 7], [1372012, 10], [1382019, 10],
[1382001, 20], [1372007, 20]];
var archer = [[1452006, 7], [1452007, 10], [1452008, 20], [1462005, 7],
[1462006, 10], [1462007, 20]];
var thief = [[1472013, 7], [1472017, 10], [1472021, 20], [1332014, 7],
[1332011, 10], [1332031, 10], [1332016, 20], [1332034, 20]];
var pirate = [[1482005, 7], [1482006, 10], [1482007, 20], [1492005, 7],
[1492006, 10], [1492007, 20]];
var necklace = [[1122007, 50], [2041211, 40]];
// Long Text Descriptions
var infoText = "You wish to know about the Monster Carnival? Very well. The Monster Carnival is a place of trilling battles and exciting competiton against people just as strong and motivated as yourself. You must summon monsters and defeat the monsters summoned by the opposing party. That's the essence of the Monster Carnival. Once you enter the Carnival Field, the task is to earn CP by hunter monsters from the opposing party and use those CP's to distract the opposing party from hunting monsters. There are three ways to distract the other party; Summon a Monster, Skill or Protector. Please remember this though, it's never a good idea to save up CP just for the sake of it. The CP's you've used will also help determine the winner and the loser of the carnival.";
var no = "You do not have enough Maple Coins for this item. Come back to me when you acquire more!";
function getGrade(cp) {
// Returns index of corresponding expRewards pair.
if (cp >= gradeS) {
return 0;
} else if (cp >= gradeA) {
return 1;
} else if (cp >= gradeB) {
return 2;
} else if (cp >= gradeC) {
return 3;
} else if (cp >= gradeD) {
return 4;
} else if (cp >= gradeE) {
return 5;
} else {
return 6;
}
}
function isTownMap(map) {
for (var i = 0; i < infoMaps.length; i++) {
if (infoMaps[i] == map) {
return true;
}
}
return false;
}
function isExitMap(map) {
return map == 980000010;
}
function isWinnerMap(map) {
return (map >= 980000000 && map <= 980000700 && map % 10 == 3);
}
function isLoserMap(map) {
return (map >= 980000000 && map <= 980000700 && map % 10 == 4);
}
var CONTEXT_NONE = -1;
var CONTEXT_TOWN = 0;
var CONTEXT_EXIT = 1;
var CONTEXT_WIN = 2;
var CONTEXT_LOSE = 3;
function start() {
if (DISABLED) {
cm.sendOk("CPQ is temporarily unavailable.");
cm.dispose();
return;
}
m = cm.getMapId();
if (isTownMap(m)) {
ctx = CONTEXT_TOWN;
} else if (isExitMap(m)) {
ctx = CONTEXT_EXIT;
} else if (isWinnerMap(m)) {
ctx = CONTEXT_WIN;
} else if (isLoserMap(m)) {
ctx = CONTEXT_LOSE;
} else {
ctx = CONTEXT_NONE;
}
action(1, 0, 0);
}
function doLoserMap(mode, type, selection) {
if (cm.getPlayer().getMCPQParty() == null) {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.dispose();
return;
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 1) status++;
else status--;
if (status == 0) {
cm.sendNext("Unfortunately, you did not manage to win this round. Better luck next time!");
} else if (status == 1) {
var points = cm.getPlayer().getMCPQParty().getTotalCP();
var grade = getGrade(points);
var letterGrade = "ABCDF"[grade];
var expReward = expRewards[grade][1];
cm.sendNext("Your grade is: #b" + letterGrade + "\r\n\r\n#kEXP Reward: " + expReward);
cm.gainExp(expReward);
} else if (status == 2) {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.dispose();
}
}
}
function doWinnerMap(mode, type, selection) {
if (cm.getPlayer().getMCPQParty() == null) {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.dispose();
return;
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 1) status++;
else status--;
if (status == 0) {
cm.sendNext("Congratulations! You managed to defeat the enemy team!");
} else if (status == 1) {
var points = cm.getPlayer().getMCPQParty().getTotalCP();
var grade = getGrade(points);
var letterGrade = "ABCDF"[grade];
var expReward = expRewards[grade][0];
cm.sendNext("Your grade is: #b" + letterGrade + "\r\n\r\n#kEXP Reward: " + expReward);
cm.gainExp(expReward);
} else if (status == 2) {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.dispose();
}
}
}
function doTown(mode, type, selection) {
if (mode == -1) {
cm.sendOk("Be sure to vote for the server every 24 hours!");
cm.dispose();
} else {
if (mode == 1) status++;
else status--;
if (status == 0) {
cm.sendSimple("What would you like to do? If you have never participated in the Monster Carnival, you'll need to know a thing or two about it before joining.\r\n\r\n#b#L0#Go to the Monster Carnival Field#l\r\n#L1#Learn about the Monster Carnival#l\r\n#L2#Trade Maple Coin#l");
} else if (status == 1) {
if (selection == 0) {
if (cm.getChar().getLevel() < MonsterCarnival.MIN_LEVEL || cm.getChar().getLevel() > MonsterCarnival.MAX_LEVEL) {
cm.sendOk("You must be between level " + MonsterCarnival.MIN_LEVEL + " and level " + MonsterCarnival.MAX_LEVEL + " to enter.");
cm.dispose();
return;
}
cm.getChar().saveLocation(SavedLocationType.MONSTER_CARNIVAL);
cm.warp(MonsterCarnival.MAP_LOBBY, 4);
cm.dispose();
return;
} else if (selection == 1) {
cm.sendPrev(infoText);
cm.dispose();
return;
} else if (selection == 2) {
store = true;
cm.sendSimple("Select a category:\r\n" +
"#L101##bTrade Maple Coins for Warrior Weapons\r\n" +
"#L102#Trade Maple Coins for Magician Weapons\r\n" +
"#L103#Trade Maple Coins for Bowman Weapons\r\n" +
"#L104#Trade Maple Coins for Thief Weapons\r\n" +
"#L105#Trade Maple Coins for Pirate Weapons\r\n" +
"#L106#Trade Maple Coins for a Necklace");
}
} else if (status == 2) {
if (store) {
switch (selection) {
case 101:
storeInfo = warrior;
break;
case 102:
storeInfo = magician;
break;
case 103:
storeInfo = archer;
break;
case 104:
storeInfo = thief;
break;
case 105:
storeInfo = pirate;
break;
case 106:
storeInfo = necklace;
break;
default:
storeInfo = [];
}
if (storeInfo.length == 0) {
cm.sendOk("That store doesn't exist.");
cm.dispose();
return;
}
var storeText = "";
for (var i = 0; i < storeInfo.length; ++i) {
var wepId = storeInfo[i][0];
var cost = storeInfo[i][1];
storeText += "#L" + i + "##v" + wepId + "# - #z" + wepId + "# - " + cost + " " + coinIcon + "#l\r\n";
}
cm.sendSimple(storeText);
} else {
MCTracker.log("[MCPQ_Info] CONTEXT_TOWN: Invalid status 2");
}
} else if (status == 3) {
if (store) {
purchaseId = storeInfo[selection][0];
purchaseCost = storeInfo[selection][1];
if (cm.haveItem(coinId, purchaseCost)) {
cm.sendYesNo("Are you sure you want to purchase #i" + purchaseId + "#? You will have #r#e" + (cm.itemQuantity(coinId) - purchaseCost) + " " + coinIcon + "##k#n remaining.");
} else {
cm.sendOk("You don't have enough " + coinIcon + ".");
cm.dispose();
}
} else {
MCTracker.log("[MCPQ_Info] CONTEXT_TOWN: Invalid status 3");
}
} else if (status == 4) {
if (store) {
if (cm.haveItem(coinId, purchaseCost)) {
cm.gainItem(coinId, -purchaseCost);
cm.gainItem(purchaseId);
cm.sendOk("Congratulations! Enjoy your new item.");
cm.dispose();
}
} else {
MCTracker.log("[MCPQ_Info] CONTEXT_TOWN: Invalid status 4");
}
}
}
}
function doExit() {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.sendOk("Hope you had fun in the Carnival PQ!");
cm.dispose();
}
function action(mode, type, selection) {
switch (ctx) {
case CONTEXT_TOWN:
doTown(mode, type, selection);
break;
case CONTEXT_EXIT:
doExit();
break;
case CONTEXT_LOSE:
doLoserMap(mode, type, selection);
break;
case CONTEXT_WIN:
doWinnerMap(mode, type, selection);
break;
default:
MCTracker.log("[MCPQ_INFO] Invalid context (value: " + ctx + ")");
cm.dispose();
}
}

View File

@@ -0,0 +1,88 @@
/** * [MENTION=19862]id[/MENTION] 2042003
* [MENTION=806871]NPC[/MENTION] Assistant Red
* [MENTION=836108]Function[/MENTION] Monster Carnival Waiting Room NPC
* @author s4nta
*/
// Relevant Monster Carnival classes
var MonsterCarnival = net.sf.odinms.server.partyquest.mcpq.MonsterCarnival;
var MCTracker = net.sf.odinms.server.partyquest.mcpq.MCTracker;
var MCParty = net.sf.odinms.server.partyquest.mcpq.MCParty;
var MCField = net.sf.odinms.server.partyquest.mcpq.MCField;
var MCTeam = net.sf.odinms.server.partyquest.mcpq.MCField.MCTeam;
// NPC variables
var status = -1;
var carnival, field;
var room = -1;
function start() {
if (!MonsterCarnival.isLobbyMap(cm.getMapId())) {
MCTracker.log("Assistant called on invalid map " + cm.getMapId() + " by player " + cm.getName());
cm.sendOk("You are not authorized to do this.");
cm.dispose();
return;
}
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
return;
}
if (mode == 1) status++;
else status--;
if (status == 0) {
if (cm.getParty() == null) {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.dispose();
return;
}
options = ["#L1#Leave the room #r#e(WARNING: Abusing this will block you from future Carnival PQs)#b#n.#l",
"#L2#Close NPC#l"];
if (cm.isLeader()) {
options.unshift("#L0#View pending challenges#l");
}
text = "Welcome to Carnival PQ. I am #rAssistant Red#k. What can I do for you?#b\r\n";
for (var i = 0; i < options.length; i++) {
text += options[i];
text += "\r\n";
}
cm.sendSimple(text);
} else if (status == 1) {
field = cm.getChar().getMCPQField();
if (selection == 0) {
if (!cm.isLeader()) {
cm.sendOk("You are not authorized to do this.");
cm.dispose();
return;
}
if (!field.hasPendingRequests()) {
cm.sendOk("There are no pending requests at this time.");
cm.dispose();
return;
}
cm.sendSimple(field.getNPCRequestString());
} else if (selection == 1) {
if (field != null) {
field.deregister(true);
} else {
cm.warp(MonsterCarnival.MAP_EXIT);
}
cm.dispose();
} else {
cm.dispose();
}
} else if (status == 2) {
var code = field.acceptRequest(selection);
if (code == 1) {
cm.sendOk("The challenge was accepted.");
} else {
cm.sendOk("An unknown error occurred.");
}
cm.dispose();
}
}

View File

@@ -0,0 +1,88 @@
/** * [MENTION=19862]id[/MENTION] 2042004
* [MENTION=806871]NPC[/MENTION] Assistant Blue
* [MENTION=836108]Function[/MENTION] Monster Carnival Waiting Room NPC
* @author s4nta
*/
// Relevant Monster Carnival classes
var MonsterCarnival = net.sf.odinms.server.partyquest.mcpq.MonsterCarnival;
var MCTracker = net.sf.odinms.server.partyquest.mcpq.MCTracker;
var MCParty = net.sf.odinms.server.partyquest.mcpq.MCParty;
var MCField = net.sf.odinms.server.partyquest.mcpq.MCField;
var MCTeam = net.sf.odinms.server.partyquest.mcpq.MCField.MCTeam;
// NPC variables
var status = -1;
var carnival, field;
var room = -1;
function start() {
if (!MonsterCarnival.isLobbyMap(cm.getMapId())) {
MCTracker.log("Assistant called on invalid map " + cm.getMapId() + " by player " + cm.getName());
cm.sendOk("You are not authorized to do this.");
cm.dispose();
return;
}
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
return;
}
if (mode == 1) status++;
else status--;
if (status == 0) {
if (cm.getParty() == null) {
cm.warp(MonsterCarnival.MAP_LOBBY);
cm.dispose();
return;
}
options = ["#L1#Leave the room #r#e(WARNING: Abusing this will block you from future Carnival PQs)#b#n.#l",
"#L2#Close NPC#l"];
if (cm.isLeader()) {
options.unshift("#L0#View pending challenges#l");
}
text = "Welcome to Carnival PQ. I am #bAssistant Blue#k. What can I do for you?#b\r\n";
for (var i = 0; i < options.length; i++) {
text += options[i];
text += "\r\n";
}
cm.sendSimple(text);
} else if (status == 1) {
field = cm.getChar().getMCPQField();
if (selection == 0) {
if (!cm.isLeader()) {
cm.sendOk("You are not authorized to do this.");
cm.dispose();
return;
}
if (!field.hasPendingRequests()) {
cm.sendOk("There are no pending requests at this time.");
cm.dispose();
return;
}
cm.sendSimple(field.getNPCRequestString());
} else if (selection == 1) {
if (field != null) {
field.deregister(true);
} else {
cm.warp(MonsterCarnival.MAP_EXIT);
}
cm.dispose();
} else {
cm.dispose();
}
} else if (status == 2) {
var code = field.acceptRequest(selection);
if (code == 1) {
cm.sendOk("The challenge was accepted.");
} else {
cm.sendOk("An unknown error occurred.");
}
cm.dispose();
}
}

View File

@@ -0,0 +1,8 @@
function enter(pi) { player = pi.getPlayer();
if (player.getMCPQField() != null) {
player.getMCPQField().onRevive(player);
} else {
pi.warp(980000000);
}
return true;
}

View File

@@ -0,0 +1,8 @@
function enter(pi) { player = pi.getPlayer();
if (player.getMCPQField() != null) {
player.getMCPQField().onRevive(player);
} else {
pi.warp(980000000);
}
return true;
}

View File

@@ -0,0 +1,8 @@
function enter(pi) { player = pi.getPlayer();
if (player.getMCPQField() != null) {
player.getMCPQField().onRevive(player);
} else {
pi.warp(980000000);
}
return true;
}

View File

@@ -0,0 +1,8 @@
function enter(pi) { player = pi.getPlayer();
if (player.getMCPQField() != null) {
player.getMCPQField().onRevive(player);
} else {
pi.warp(980000000);
}
return true;
}

View File

@@ -0,0 +1,8 @@
function enter(pi) { player = pi.getPlayer();
if (player.getMCPQField() != null) {
player.getMCPQField().onRevive(player);
} else {
pi.warp(980000000);
}
return true;
}

View File

@@ -0,0 +1,8 @@
function enter(pi) { player = pi.getPlayer();
if (player.getMCPQField() != null) {
player.getMCPQField().onRevive(player);
} else {
pi.warp(980000000);
}
return true;
}

View File

@@ -0,0 +1,51 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
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/>.
*/
importPackage(Packages.net.sf.odinms.server.maps);
/*
Return from MCPQ map.
*/
function enter(pi) {
var returnMap = pi.getPlayer().getSavedLocation(SavedLocationType.MONSTER_CARNIVAL);
if (returnMap < 0) {
returnMap = 100000000; // to fix people who entered the fm trough an unconventional way
}
var target = pi.getPlayer().getClient().getChannelServer().getMapFactory().getMap(returnMap);
var targetPortal;
if (returnMap == 230000000) {
targetPortal = target.getPortal("market01");
} else {
targetPortal = target.getPortal("market00");
}
if (targetPortal == null)
targetPortal = target.getPortal(0);
if (pi.getPlayer().getMapId() != target) {
pi.getPlayer().clearSavedLocation(SavedLocationType.MONSTER_CARNIVAL);
pi.getPlayer().changeMap(target, targetPortal);
return true;
}
return false;
}