Client clean-up + PiratePQ Implementation
Major update on client packets, now properly making unseen killed monsters not appear as residual on a player's client. Many updates revolving the PiratePQ environment as well.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
var minPlayers = 2;
|
||||
var entryMap = 930000000;
|
||||
|
||||
function init() {
|
||||
em.setProperty("state", "0");
|
||||
@@ -26,7 +27,7 @@ function setup(level, leaderid) {
|
||||
}
|
||||
|
||||
function playerEntry(eim, player) {
|
||||
var map = eim.getMapInstance(0);
|
||||
var map = eim.getMapInstance(entryMap);
|
||||
player.changeMap(map, map.getPortal(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
var isPq = true;
|
||||
var minPlayers = 1;
|
||||
var entryMap = 925100000;
|
||||
var exitMap = 925100700;
|
||||
|
||||
function init() {
|
||||
em.setProperty("state", "0");
|
||||
em.setProperty("state", "0");
|
||||
em.setProperty("leader", "true");
|
||||
}
|
||||
|
||||
function setup(level, leaderid) {
|
||||
em.setProperty("state", "1");
|
||||
em.setProperty("state", "1");
|
||||
em.setProperty("leader", "true");
|
||||
var eim = em.newInstance("Pirate" + leaderid);
|
||||
var eim = em.newInstance("Pirate" + leaderid);
|
||||
em.setProperty("stage2", "0");
|
||||
em.setProperty("stage2a", "0");
|
||||
em.setProperty("stage2a", "0");
|
||||
em.setProperty("stage3a", "0");
|
||||
em.setProperty("stage2b", "0");
|
||||
em.setProperty("stage3b", "0");
|
||||
em.setProperty("stage4", "0");
|
||||
em.setProperty("stage5", "0");
|
||||
em.setProperty("level", level);
|
||||
em.setProperty("openedChests", "0");
|
||||
eim.setInstanceMap(925100000).resetPQ(level);
|
||||
eim.setInstanceMap(925100100).resetPQ(level);
|
||||
var map = eim.setInstanceMap(925100200);
|
||||
@@ -85,24 +91,27 @@ em.setProperty("state", "1");
|
||||
eim.setInstanceMap(925100302).resetPQ(level);
|
||||
eim.setInstanceMap(925100400).resetPQ(level);
|
||||
eim.setInstanceMap(925100500).resetPQ(level);
|
||||
|
||||
eim.startEventTimer(1200000); //20 mins
|
||||
return eim;
|
||||
|
||||
respawnStg4(eim);
|
||||
eim.startEventTimer(1200000); //20 mins
|
||||
return eim;
|
||||
}
|
||||
|
||||
function playerEntry(eim, player) {
|
||||
var map = eim.getMapInstance(0);
|
||||
var map = eim.getMapInstance(entryMap);
|
||||
player.changeMap(map, map.getPortal(0));
|
||||
player.tryPartyQuest(1204);
|
||||
}
|
||||
|
||||
function playerRevive(eim, player) {
|
||||
}
|
||||
|
||||
function scheduledTimeout(eim) {
|
||||
end(eim);
|
||||
}
|
||||
|
||||
function removePlayer(eim, player) {
|
||||
eim.unregisterPlayer(player);
|
||||
player.getMap().removePlayer(player);
|
||||
player.setMap(exitMap);
|
||||
}
|
||||
|
||||
function changedMap(eim, player, mapid) {
|
||||
if (mapid < 925100000 || mapid > 925100500) {
|
||||
eim.unregisterPlayer(player);
|
||||
@@ -114,42 +123,86 @@ function changedMap(eim, player, mapid) {
|
||||
}
|
||||
}
|
||||
|
||||
function playerDead(eim, player) {}
|
||||
|
||||
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
||||
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
|
||||
var party = eim.getPlayers();
|
||||
for (var i = 0; i < party.size(); i++)
|
||||
playerExit(eim, party.get(i));
|
||||
eim.dispose();
|
||||
} else
|
||||
playerExit(eim, player);
|
||||
}
|
||||
|
||||
|
||||
function playerDisconnected(eim, player) {
|
||||
return 0;
|
||||
var party = eim.getPlayers();
|
||||
if (eim.isLeader(player) || party.size() < minPlayers) {
|
||||
var party = eim.getPlayers();
|
||||
for (var i = 0; i < party.size(); i++)
|
||||
if (party.get(i).equals(player))
|
||||
removePlayer(eim, player);
|
||||
else
|
||||
playerExit(eim, party.get(i));
|
||||
eim.dispose();
|
||||
} else
|
||||
removePlayer(eim, player);
|
||||
}
|
||||
|
||||
function leftParty(eim, player) {
|
||||
var party = eim.getPlayers();
|
||||
if (party.size() < minPlayers) {
|
||||
for (var i = 0; i < party.size(); i++)
|
||||
playerExit(eim,party.get(i));
|
||||
eim.dispose();
|
||||
} else
|
||||
playerExit(eim, player);
|
||||
}
|
||||
|
||||
function disbandParty(eim) {
|
||||
var party = eim.getPlayers();
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
playerExit(eim, party.get(i));
|
||||
}
|
||||
eim.dispose();
|
||||
}
|
||||
|
||||
function playerExit(eim, player) {
|
||||
eim.unregisterPlayer(player);
|
||||
player.changeMap(exitMap, exitMap.getPortal(0));
|
||||
}
|
||||
|
||||
function monsterValue(eim, mobId) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
function playerExit(eim, player) {
|
||||
eim.unregisterPlayer(player);
|
||||
|
||||
if (eim.disposeIfPlayerBelow(0, 0)) {
|
||||
em.setProperty("state", "0");
|
||||
em.setProperty("leader", "true");
|
||||
}
|
||||
}
|
||||
|
||||
function end(eim) {
|
||||
eim.disposeIfPlayerBelow(100, 925100700);
|
||||
em.setProperty("state", "0");
|
||||
em.setProperty("leader", "true");
|
||||
var party = eim.getPlayers();
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
playerExit(eim, party.get(i));
|
||||
}
|
||||
eim.dispose();
|
||||
}
|
||||
|
||||
function clearPQ(eim) {
|
||||
end(eim);
|
||||
}
|
||||
|
||||
function allMonstersDead(eim) {
|
||||
function allMonstersDead(eim) {}
|
||||
|
||||
function cancelSchedule() {}
|
||||
|
||||
function respawnStg4(eim) {
|
||||
//if(em.getProperty("stage4") == "0") {
|
||||
eim.getMapInstance(925100400).instanceMapRespawn();
|
||||
em.schedule("respawnStg4", eim, 10 * 1000);
|
||||
//}
|
||||
}
|
||||
|
||||
function leftParty (eim, player) {
|
||||
// If only 2 players are left, uncompletable:
|
||||
end(eim);
|
||||
function dispose(eim) {
|
||||
em.cancelSchedule();
|
||||
|
||||
em.setProperty("state", "0");
|
||||
em.setProperty("leader", "true");
|
||||
}
|
||||
function disbandParty (eim) {
|
||||
end(eim);
|
||||
}
|
||||
function playerDead(eim, player) {}
|
||||
function cancelSchedule() {}
|
||||
27
scripts/npc/world0/2041029.js
Normal file
27
scripts/npc/world0/2041029.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
function start() {
|
||||
cm.sendOk("Up ahead is the mysterious forest of Elin. Go through #bthe portal of time#k if you are ready to unveil some of the mysteries of the past of Victoria Island, as how it used to be at it's dawn.");
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
}
|
||||
else {
|
||||
em.startInstance(cm.getParty(),cm.getPlayer().getMap());
|
||||
em.startInstance(cm.getParty(),cm.getPlayer().getMap(), 1);
|
||||
party = cm.getParty().getMembers();
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
@@ -19,7 +19,77 @@
|
||||
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/>.
|
||||
*/
|
||||
|
||||
var status = -1;
|
||||
|
||||
function start() {
|
||||
cm.warp(100000000, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
cm.removeAll(4001117);
|
||||
cm.removeAll(4001120);
|
||||
cm.removeAll(4001121);
|
||||
cm.removeAll(4001122);
|
||||
cm.sendSimple("#b#L0#Get me out of here.#l\r\n#L1#Give me Pirate Hat.#l#k");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (!cm.canHold(4001129, 1)) {
|
||||
cm.sendOk("Please make room in ETC.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.gainItem(4001129, 1);
|
||||
cm.warp(251010404,0);
|
||||
} else { //TODO JUMP
|
||||
if (cm.haveItem(1003267, 1)) {
|
||||
cm.sendOk("You have the best hat.");
|
||||
} else if (cm.haveItem(1002573, 1)) {
|
||||
if (cm.haveItem(4001129, 20)) {
|
||||
if (cm.canHold(1003267,1)) {
|
||||
cm.gainItem(1002573, -1);
|
||||
cm.gainItem(4001129, -20);
|
||||
cm.gainItem(1003267,1);
|
||||
cm.sendOk("I have given you the hat.");
|
||||
} else {
|
||||
cm.sendOk("Please make room.");
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You need 20 #t4001129# to get the next hat.");
|
||||
}
|
||||
} else if (cm.haveItem(1002572, 1)) {
|
||||
if (cm.haveItem(4001129, 20)) {
|
||||
if (cm.canHold(1002573,1)) {
|
||||
cm.gainItem(1002572, -1);
|
||||
cm.gainItem(4001129, -20);
|
||||
cm.gainItem(1002573,1);
|
||||
cm.sendOk("I have given you the hat.");
|
||||
} else {
|
||||
cm.sendOk("Please make room.");
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You need 20 #t4001129# to get the next hat.");
|
||||
}
|
||||
} else {
|
||||
if (cm.haveItem(4001129, 20)) {
|
||||
if (cm.canHold(1002572,1)) {
|
||||
cm.gainItem(4001129, -20);
|
||||
cm.gainItem(1002572,1);
|
||||
cm.sendOk("I have given you the hat.");
|
||||
} else {
|
||||
cm.sendOk("Please make room.");
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You need 20 #t4001129# to get the next hat.");
|
||||
}
|
||||
}
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
129
scripts/npc/world0/2094002.js
Normal file
129
scripts/npc/world0/2094002.js
Normal file
@@ -0,0 +1,129 @@
|
||||
var status = -1;
|
||||
var level = 1;
|
||||
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
} else {
|
||||
status--;
|
||||
}
|
||||
if (cm.getPlayer().getMapId() == 925100700) {
|
||||
cm.removeAll(4001117);
|
||||
cm.removeAll(4001120);
|
||||
cm.removeAll(4001121);
|
||||
cm.removeAll(4001122);
|
||||
cm.warp(251010404,0);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var em = cm.getEventManager("PiratePQ");
|
||||
if (em == null) {
|
||||
cm.sendNext("The event isn't started...");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
level = em.getProperty("level");
|
||||
if (!cm.isLeader()) {
|
||||
cm.sendNext("I wish for your leader to talk to me.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
switch(cm.getPlayer().getMapId()) {
|
||||
case 925100000:
|
||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must destroy all the monsters guarding it.");
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100100:
|
||||
var emp = em.getProperty("stage2");
|
||||
if (emp == null) {
|
||||
em.setProperty("stage2", "0");
|
||||
emp = "0";
|
||||
}
|
||||
if (emp.equals("0")) {
|
||||
if (cm.haveItem(4001120,20)) {
|
||||
cm.sendNext("Excellent! Now hunt me 20 Rising Medals.");
|
||||
cm.gainItem(4001120,-20);
|
||||
cm.getMap().killAllMonsters();
|
||||
em.setProperty("stage2", "1");
|
||||
} else {
|
||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals.");
|
||||
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300114, level, true);
|
||||
}
|
||||
} else if (emp.equals("1")) {
|
||||
if (cm.haveItem(4001121,20)) {
|
||||
cm.sendNext("Excellent! Now hunt me 20 Veteran Medals.");
|
||||
cm.gainItem(4001121,-20);
|
||||
cm.getMap().killAllMonsters();
|
||||
em.setProperty("stage2", "2");
|
||||
} else {
|
||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals.");
|
||||
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300115, level, true);
|
||||
}
|
||||
} else if (emp.equals("2")) {
|
||||
if (cm.haveItem(4001122,20)) {
|
||||
cm.sendNext("Excellent! Now let us go.");
|
||||
cm.gainItem(4001122,-20);
|
||||
cm.getMap().killAllMonsters();
|
||||
em.setProperty("stage2", "3");
|
||||
} else {
|
||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Veteran Medals.");
|
||||
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300116, level, true);
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("The next stage has opened. GO!");
|
||||
}
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100200:
|
||||
case 925100300:
|
||||
cm.sendNext("To assault the pirate ship, we must destroy the guards first.");
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100201:
|
||||
if (cm.getMap().getMonsters().size() == 0) {
|
||||
cm.sendNext("Excellent.");
|
||||
if (em.getProperty("stage2a") == "0") {
|
||||
cm.getMap().setReactorState();
|
||||
em.setProperty("stage2a", "1");
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
|
||||
}
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100301:
|
||||
if (cm.getMap().getMonsters().size() == 0) {
|
||||
cm.sendNext("Excellent.");
|
||||
if (em.getProperty("stage3a").equals("0")) {
|
||||
cm.getMap().setReactorState();
|
||||
em.setProperty("stage3a", "1");
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
|
||||
}
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100202:
|
||||
case 925100302:
|
||||
cm.sendNext("These are the Captains and Krus which devote their whole life to Lord Pirate. Kill them as you see fit.");
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100400:
|
||||
cm.sendNext("These are the sources of the ship's power. We must seal it by using the Old Metal Keys on the doors!");
|
||||
cm.dispose();
|
||||
break;
|
||||
case 925100500:
|
||||
if (cm.getMap().getMonsters().size() == 0) {
|
||||
cm.warpParty(925100600);
|
||||
} else {
|
||||
cm.sendNext("Defeat all monsters! Even Lord Pirate's minions!");
|
||||
}
|
||||
cm.dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
var status = -1;
|
||||
|
||||
var exchangeItem = 4000439;
|
||||
|
||||
function start() {
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
var status = -1;
|
||||
|
||||
var exchangeItem = 4000437;
|
||||
|
||||
function start() {
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
8
scripts/npc/world0/2131004.js
Normal file
8
scripts/npc/world0/2131004.js
Normal file
@@ -0,0 +1,8 @@
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
cm.sendNext("Zzzzz...");
|
||||
cm.dispose();
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
var status = -1;
|
||||
|
||||
var exchangeItem = 4000436;
|
||||
|
||||
function start() {
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
var status = -1;
|
||||
|
||||
var exchangeItem = 4000440;
|
||||
|
||||
function start() {
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
var status = -1;
|
||||
|
||||
var exchangeItem = 4000438;
|
||||
|
||||
function start() {
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
function start(){
|
||||
cm.sendOk("Hmmm! For you to make your way here, far away from the Camp, you must be one strong individual. Let's explore new areas and find a place to establish our own town!!");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
cm.sendNext("Call me Dark Lord. I will give thieves a place in society... watch in a few years!");
|
||||
cm.dispose();
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
cm.sendNext("The magic of this forest is amazing...");
|
||||
cm.dispose();
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
cm.sendNext("Being young doesn't mean I'm any different from those guys. I'll show them!");
|
||||
cm.dispose();
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
var status = -1;
|
||||
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
73
scripts/npc/world0/2133000.txt
Normal file
73
scripts/npc/world0/2133000.txt
Normal file
@@ -0,0 +1,73 @@
|
||||
var status = -1;
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
} else {
|
||||
if (status == 0) {
|
||||
cm.dispose();
|
||||
}
|
||||
status--;
|
||||
}
|
||||
if (status == 0) {
|
||||
cm.removeAll(4001163);
|
||||
cm.removeAll(4001169);
|
||||
cm.removeAll(2270004);
|
||||
cm.sendSimple("#b#L0#Give me Altaire Earrings.#l\r\n#L1#Give me Glittering Altaire Earrings.#l\r\n#L3#Give me Brilliant Altaire Earrings.#l\r\n#L2#Attempt Forest of Poison Haze.#l#k");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (!cm.haveItem(1032060) && cm.haveItem(4001198, 10)) {
|
||||
cm.gainItem(1032060,1);
|
||||
cm.gainItem(4001198, -10);
|
||||
} else {
|
||||
cm.sendOk("You either have Altair Earrings already or you do not have 10 Altair Fragments");
|
||||
}
|
||||
} else if (selection == 1){
|
||||
if (cm.haveItem(1032060) && !cm.haveItem(1032061) && cm.haveItem(4001198, 10)) {
|
||||
cm.gainItem(1032060,-1);
|
||||
cm.gainItem(1032061, 1);
|
||||
cm.gainItem(4001198, -10);
|
||||
} else {
|
||||
cm.sendOk("You either don't have Altair Earrings already or you do not have 10 Altair Fragments");
|
||||
}
|
||||
} else if (selection == 1){
|
||||
if (cm.haveItem(1032061) && !cm.haveItem(1032101) && cm.haveItem(4001198, 10)) {
|
||||
cm.gainItem(1032061,-1);
|
||||
cm.gainItem(1032101, 1);
|
||||
cm.gainItem(4001198, -10);
|
||||
} else {
|
||||
cm.sendOk("You either don't have Glittering Altair Earrings already or you do not have 10 Altair Fragments");
|
||||
}
|
||||
} else if (selection == 2) {
|
||||
if (cm.getPlayer().getParty() == null || !cm.isLeader()) {
|
||||
cm.sendOk("The leader of the party must be here.");
|
||||
} else {
|
||||
var party = cm.getPlayer().getParty().getMembers();
|
||||
var mapId = cm.getPlayer().getMapId();
|
||||
var next = true;
|
||||
var size = 0;
|
||||
var it = party.iterator();
|
||||
while (it.hasNext()) {
|
||||
var cPlayer = it.next();
|
||||
var ccPlayer = cm.getPlayer().getMap().getCharacterById(cPlayer.getId());
|
||||
if (ccPlayer == null || ccPlayer.getLevel() < 70 || ccPlayer.getLevel() > 255) {
|
||||
next = false;
|
||||
break;
|
||||
}
|
||||
size += (ccPlayer.isGM() ? 4 : 1);
|
||||
}
|
||||
if (next && size >= 2) {
|
||||
var em = cm.getEventManager("Ellin");
|
||||
if (em == null) {
|
||||
cm.sendOk("Please try again later.");
|
||||
} else {
|
||||
em.startInstance(cm.getPlayer().getParty(), cm.getPlayer().getMap(), 120);
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("All 2+ members of your party must be here and above level 70.");
|
||||
}
|
||||
}
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
var status = -1;
|
||||
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
var status = -1;
|
||||
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
var status = -1;
|
||||
|
||||
function start() {
|
||||
action(1,0,0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
|
||||
13
scripts/portal/davy2_hd1.js
Normal file
13
scripts/portal/davy2_hd1.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var windowTime = 10 * 1000;
|
||||
|
||||
function enter(pi) {
|
||||
var em = pi.getEventManager("PiratePQ");
|
||||
var level = em.getProperty("level");
|
||||
if(em.getProperty("stage2b") == "0") {
|
||||
pi.getMap(925100202).spawnAllMonstersFromMapSpawnList(level, true);
|
||||
em.setProperty("stage2b", "1");
|
||||
}
|
||||
|
||||
pi.warp(925100202,0);
|
||||
return(true);
|
||||
}
|
||||
13
scripts/portal/davy3_hd1.js
Normal file
13
scripts/portal/davy3_hd1.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var windowTime = 10 * 1000;
|
||||
|
||||
function enter(pi) {
|
||||
var em = pi.getEventManager("PiratePQ");
|
||||
var level = em.getProperty("level");
|
||||
if(em.getProperty("stage3b") == "0") {
|
||||
pi.getMap(925100302).spawnAllMonstersFromMapSpawnList(level, true);
|
||||
em.setProperty("stage3b", "1");
|
||||
}
|
||||
|
||||
pi.warp(925100302,0);
|
||||
return(true);
|
||||
}
|
||||
@@ -40,11 +40,10 @@ function enter(pi) {
|
||||
eim.setProperty("entryTimeStamp", 1000 * 60 * 6);
|
||||
for(var g=0; g<party.size(); g++) {
|
||||
party.get(g).changeMap(target, targetPortal);
|
||||
party.get(g).getClient().sendClock(party.get(g).getClient(), 300);
|
||||
}
|
||||
return true;
|
||||
}else {
|
||||
pi.getPlayer().dropMessage(6, "Please kill all monsters before proceeding.");
|
||||
pi.getPlayer().dropMessage(6, "You need to kill all monsters before proceeding.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
16
scripts/portal/davy_next1.js
Normal file
16
scripts/portal/davy_next1.js
Normal file
@@ -0,0 +1,16 @@
|
||||
function enter(pi) {
|
||||
try {
|
||||
var em = pi.getEventManager("PiratePQ");
|
||||
if (em != null && em.getProperty("stage2").equals("3")) {
|
||||
pi.warp(925100200,0); //next
|
||||
return(true);
|
||||
} else {
|
||||
pi.playerMessage(5, "The portal is not opened yet.");
|
||||
return(false);
|
||||
}
|
||||
} catch(e) {
|
||||
pi.playerMessage(5, "Error: " + e);
|
||||
}
|
||||
|
||||
return(false);
|
||||
}
|
||||
9
scripts/portal/davy_next2.js
Normal file
9
scripts/portal/davy_next2.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function enter(pi) {
|
||||
if (pi.getMap().getMonsters().size() == 0) {
|
||||
pi.warp(925100300,0); //next
|
||||
return(true);
|
||||
} else {
|
||||
pi.playerMessage(5, "The portal is not opened yet.");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
9
scripts/portal/davy_next3.js
Normal file
9
scripts/portal/davy_next3.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function enter(pi) {
|
||||
if (pi.getMap().getMonsters().size() == 0) {
|
||||
pi.warp(925100400,0); //next
|
||||
return(true);
|
||||
} else {
|
||||
pi.playerMessage(5, "The portal is not opened yet.");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
29
scripts/portal/davy_next4.js
Normal file
29
scripts/portal/davy_next4.js
Normal file
@@ -0,0 +1,29 @@
|
||||
importPackage(Packages.server.life);
|
||||
|
||||
function enter(pi) {
|
||||
if (pi.getMap().getReactorByName("sMob1").getState() >= 1 && pi.getMap().getReactorByName("sMob2").getState() >= 1 && pi.getMap().getReactorByName("sMob3").getState() >= 1 && pi.getMap().getReactorByName("sMob4").getState() >= 1) {
|
||||
if (pi.isLeader()) {
|
||||
var em = pi.getEventManager("PiratePQ");
|
||||
|
||||
var level = parseInt(em.getProperty("level"));
|
||||
var chests = parseInt(em.getProperty("openedChests"));
|
||||
var boss;
|
||||
|
||||
if(chests == 0) boss = MapleLifeFactory.getMonster(9300119); //lord pirate
|
||||
else if(chests == 1) boss = MapleLifeFactory.getMonster(9300105); //angry lord pirate
|
||||
else boss = MapleLifeFactory.getMonster(9300106); //enraged lord pirate
|
||||
|
||||
boss.changeDifficulty(level, true);
|
||||
|
||||
pi.getMap(925100500).spawnMonster(boss);
|
||||
pi.warpParty(925100500); //next
|
||||
return(true);
|
||||
} else {
|
||||
pi.playerMessage(5, "The leader must be here");
|
||||
return(false);
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "The portal is not opened yet.");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
4
scripts/portal/enterWarehouse.js
Normal file
4
scripts/portal/enterWarehouse.js
Normal file
@@ -0,0 +1,4 @@
|
||||
function enter(pi) {
|
||||
pi.warp(300000011,0);
|
||||
return(true);
|
||||
}
|
||||
@@ -25,7 +25,7 @@ LudiPQ - 1 - 2 Portal
|
||||
|
||||
function enter(pi) {
|
||||
var nextMap = 922010900;
|
||||
var eim = pi.getPlayer().getEventInstance()
|
||||
var eim = pi.getPlayer().getEventInstance();
|
||||
var target = eim.getMapInstance(nextMap);
|
||||
var targetPortal = target.getPortal("st00");
|
||||
// only let people through if the eim is ready
|
||||
@@ -33,7 +33,8 @@ function enter(pi) {
|
||||
if (avail == null) {
|
||||
// can't go thru eh?
|
||||
pi.getPlayer().dropMessage(5, "Some seal is blocking this door.");
|
||||
return false; }
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
pi.getPlayer().changeMap(target, targetPortal);
|
||||
return true;
|
||||
|
||||
33
scripts/reactor/2512001.js
Normal file
33
scripts/reactor/2512001.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
/*2512001.js
|
||||
*@Author Ronan
|
||||
*Pirate PQ Treasure chest
|
||||
*/
|
||||
|
||||
function act() {
|
||||
var eim = rm.getPlayer().getEventInstance();
|
||||
var now = parseInt(eim.getProperty("openedChests"));
|
||||
var nextNum = now + 1;
|
||||
eim.setProperty("openedChests", nextNum);
|
||||
rm.dropItems(true, 1, 50, 100, 15);
|
||||
}
|
||||
28
scripts/reactor/2519000.js
Normal file
28
scripts/reactor/2519000.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
/*2519000.js - Reactor used at the door on stage 4.
|
||||
*@author Ronan
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getPlayer().getMap().setAllowSpawnPointInRange(false, rm.getReactor().getPosition(), 120.0);
|
||||
}
|
||||
28
scripts/reactor/2519001.js
Normal file
28
scripts/reactor/2519001.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
/*2519001.js - Reactor used at the door on stage 4.
|
||||
*@author Ronan
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getPlayer().getMap().setAllowSpawnPointInRange(false, rm.getReactor().getPosition(), 120.0);
|
||||
}
|
||||
28
scripts/reactor/2519002.js
Normal file
28
scripts/reactor/2519002.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
/*2519002.js - Reactor used at the door on stage 4.
|
||||
*@author Ronan
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getPlayer().getMap().setAllowSpawnPointInRange(false, rm.getReactor().getPosition(), 120.0);
|
||||
}
|
||||
28
scripts/reactor/2519003.js
Normal file
28
scripts/reactor/2519003.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
/*2519003.js - Reactor used at the door on stage 4.
|
||||
*@author Ronan
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getPlayer().getMap().setAllowSpawnPointInRange(false, rm.getReactor().getPosition(), 120.0);
|
||||
}
|
||||
Reference in New Issue
Block a user