Water of Life + Fixed GPQ & Buff system
Added Water of Life. Fixed Shuang (GPQ) npc dc'ing the leader when first trying to enter the waiting area. Fixed some cases with the revamped buff system, that would not properly check for the best buffs in some scenarios, and would throw exceptions, caused by not properly protecting access to critical data.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
var isPq = true;
|
||||
var minPlayers = 1, maxPlayers = 30;
|
||||
var minPlayers = 6, maxPlayers = 30;
|
||||
var minLevel = 1, maxLevel = 255;
|
||||
var entryMap = 990000000;
|
||||
var exitMap = 990001100;
|
||||
@@ -201,10 +201,10 @@ function scheduledTimeout(eim) {
|
||||
} else {
|
||||
eim.startEventTimer(eventTime * 60000);
|
||||
|
||||
//if(isTeamAllJobs(eim)) {
|
||||
if(isTeamAllJobs(eim)) {
|
||||
var rnd = Math.floor(Math.random() * 4);
|
||||
eim.applyEventPlayersItemBuff(2023000 + rnd);
|
||||
//}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
end(eim);
|
||||
|
||||
@@ -104,7 +104,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection == 0) {
|
||||
MapleInventoryManipulator.removeFromSlot(cm.getC(), MapleInventoryType.CASH, 1, 1, true);
|
||||
MapleInventoryManipulator.removeFromSlot(cm.getClient(), MapleInventoryType.CASH, 1, 1, true);
|
||||
cm.sendOk("Your cash first slot is removed.");
|
||||
} else if (selection == 1) {
|
||||
if (cm.haveItem(5000029, 2)) {
|
||||
|
||||
95
scripts/npc/waterOfLife.js
Normal file
95
scripts/npc/waterOfLife.js
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
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 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/>.
|
||||
*/
|
||||
/* Mar the Fairy
|
||||
Handles Water of Life
|
||||
*/
|
||||
|
||||
importPackage(Packages.client.inventory);
|
||||
importPackage(Packages.server);
|
||||
|
||||
var status;
|
||||
var dList;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
dList = cm.getDriedPets();
|
||||
if(dList.size() == 0) {
|
||||
cm.playerMessage(5, "You currently do not own a pet that needs to be treated with Water of Life.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0 && type > 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("I am Mar the Fairy. You have the #bWater of Life#k... With this, I can bring a doll back to life with my magic. What do you think? Do you want to use this item and reawaken your pet ...?");
|
||||
|
||||
} else if (status == 1) {
|
||||
var talkStr = "So which pet you want to reawaken? Please choose the pet you'd most like to reawaken...\r\n\r\n";
|
||||
|
||||
var listStr = "";
|
||||
var i = 0;
|
||||
|
||||
var dIter = dList.iterator();
|
||||
while (dIter.hasNext()){
|
||||
var dPet = dIter.next();
|
||||
|
||||
listStr += "#b#L" + i + "# " + dPet.getName() + " #k - Lv " + dPet.getLevel() + " Closeness " + dPet.getCloseness();
|
||||
listStr += "#l\r\n";
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
cm.sendSimple(talkStr + listStr);
|
||||
} else if (status == 2) {
|
||||
var sPet = dList.get(selection);
|
||||
|
||||
if(sPet != null) {
|
||||
cm.sendNext("Your doll has now reawaken as your pet! However, my magic isn't perfect, so I can't promise an eternal life for your pet... Please take care of that pet before the Water of Life dries. Well then, good bye...");
|
||||
|
||||
var it = cm.getPlayer().getInventory(MapleInventoryType.CASH).getItem(sPet.getPosition());
|
||||
it.setExpiration(Date.now() + (1000 * 60 * 60 * 24 * 90));
|
||||
cm.getPlayer().forceUpdateItem(it);
|
||||
|
||||
cm.gainItem(5180000, -1);
|
||||
} else {
|
||||
cm.sendNext("Oh, well then. Good bye...");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ function end(mode, type, selection) {
|
||||
name = MapleItemInformationProvider.getInstance().getName(after);
|
||||
} */
|
||||
|
||||
//qm.unequipPet(qm.getC());
|
||||
//qm.unequipPet(qm.getClient());
|
||||
qm.gainItem(5380000, -1);
|
||||
qm.gainMeso(-10000);
|
||||
qm.evolvePet(i, after);
|
||||
|
||||
Reference in New Issue
Block a user