Reworked Singapore/Malaysia + warp fix
Reworked many aspects of the Malaysia/Singapore region (added DB data, enabled Latanica & Scarga expedition, fixed maps). Fixed some issues related with player warping.
This commit is contained in:
@@ -146,13 +146,13 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
return;
|
||||
} else {
|
||||
for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps
|
||||
if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) {
|
||||
cm.sendOk("Someone is already in the Dojo.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps
|
||||
if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) {
|
||||
cm.sendOk("Someone is already in the Dojo.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
cm.getClient().getChannelServer().getMapFactory().getMap(925020100).resetReactors();
|
||||
cm.getClient().getChannelServer().getMapFactory().getMap(925020100).killAllMonsters();
|
||||
cm.warpParty(925020100);
|
||||
|
||||
@@ -133,13 +133,13 @@ function action(mode, type, selection) {
|
||||
} else if (!isBetween30) {
|
||||
cm.sendNext("Your partys level ranges are too broad to enter. Please make sure all of your party members are within #r30 levels#k of each other.");
|
||||
} else {
|
||||
for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps
|
||||
if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) {
|
||||
cm.sendOk("Someone is already in the Dojo.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (var i = 1 ; i < 39; i++) { //only 32 stages, but 38 maps
|
||||
if(cm.getClient().getChannelServer().getMapFactory().getMap(925020000 + 100 * i).getCharacters().size() > 0) {
|
||||
cm.sendOk("Someone is already in the Dojo.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
cm.getClient().getChannelServer().getMapFactory().getMap(925020100).resetReactors();
|
||||
cm.getClient().getChannelServer().getMapFactory().getMap(925020100).killAllMonsters();
|
||||
cm.warpParty(925020100);
|
||||
|
||||
@@ -21,11 +21,11 @@ function action(mode, type, selection) {
|
||||
cm.sendNext("We have to eliminate all these contaminated reactors!");
|
||||
break;
|
||||
case 930000300:
|
||||
cm.warpParty(930000400);
|
||||
cm.getEventInstance().warpEventTeam(930000400);
|
||||
break;
|
||||
case 930000400:
|
||||
if (cm.haveItem(4001169,20)) {
|
||||
cm.warpParty(930000500);
|
||||
cm.getEventInstance().warpEventTeam(930000500);
|
||||
cm.gainItem(4001169,-20);
|
||||
} else if (!cm.haveItem(2270004)) {
|
||||
if(cm.canHold(2270004,10)) {
|
||||
|
||||
@@ -15,7 +15,7 @@ function action(mode, type, selection) {
|
||||
if (!cm.haveItem(4001163)) {
|
||||
cm.sendNext("Get me the Purple Stone of Magic from here.");
|
||||
} else {
|
||||
cm.warpParty(930000600);
|
||||
cm.getEventInstance().warpEventTeam(930000600);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
/*Jack
|
||||
*
|
||||
*@author SharpAceX (Alan)
|
||||
*@author SharpAceX (Alan), Ronan
|
||||
*/
|
||||
importPackage(Packages.server.expeditions);
|
||||
importPackage(Packages.tools);
|
||||
|
||||
@@ -21,31 +21,34 @@
|
||||
*/
|
||||
/* Aldol
|
||||
*
|
||||
* @Author Alan (SharpAceX)
|
||||
* @Author Ronan
|
||||
*/
|
||||
importPackage(Packages.server.expeditions);
|
||||
|
||||
var status;
|
||||
|
||||
function start() {
|
||||
cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?");
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
var scarga = MapleExpeditionType.SCARGA;
|
||||
var expedition = cm.getExpedition(scarga);
|
||||
if (mode < 1)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (cm.getPlayer().getMap().getCharacters().size() < 2){
|
||||
cm.getPlayer().getMap().killAllMonsters();
|
||||
cm.getPlayer().getMap().resetReactors();
|
||||
if (expedition != null){
|
||||
cm.endExpedition(expedition);
|
||||
}
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0 && status == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("If you leave now, you won't be able to return. Are you sure you want to leave?");
|
||||
} else if (status == 1) {
|
||||
cm.warp(551030100, 2);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
if (cm.getPlayer().getEventInstance() != null)
|
||||
cm.getPlayer().getEventInstance().removePlayer(cm.getPlayer());
|
||||
else
|
||||
cm.warp(551030100);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
@@ -31,22 +31,30 @@ var fface = Array(21001, 21002, 21003, 21004, 21005, 21006, 21008, 21012, 21014,
|
||||
var facenew = Array();
|
||||
|
||||
function start() {
|
||||
cm.sendSimple("If you use this regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152037##k, I will do it anyways for you. But don't forget, it will be random!\r\n\#L2#OK!#l");
|
||||
cm.sendSimple("If you use this regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152037##k, I will do it anyways for you. But don't forget, it will be random!\r\n\#L2#OK! (Uses #i5152037# #t5152037#)#l");
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (mode == 0 && status == 0)
|
||||
if (mode == 0 && status >= 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 1)
|
||||
cm.dispose();
|
||||
else if (selection == 2) {
|
||||
|
||||
if (status == 1) {
|
||||
if (!cm.haveItem(5152037)) {
|
||||
cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you...");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
facenew = Array();
|
||||
if (cm.getPlayer().getGender() == 0)
|
||||
for(var i = 0; i < mface.length; i++)
|
||||
@@ -56,13 +64,11 @@ function action(mode, type, selection) {
|
||||
facenew.push(fface[i] + cm.getPlayer().getFace()% 1000 - (cm.getPlayer().getFace()% 100));
|
||||
cm.sendYesNo("If you use the regular coupon, your face may transform into a random new look...do you still want to do it using #b#t5152037##k?");
|
||||
} else if (status == 2){
|
||||
cm.gainItem(5152037 , -1);
|
||||
cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]);
|
||||
cm.sendOk("Enjoy your new and improved face!");
|
||||
|
||||
cm.dispose();
|
||||
if (cm.haveItem(5152037)){
|
||||
cm.gainItem(5152037 , -1);
|
||||
cm.setFace(facenew[Math.floor(Math.random() * facenew.length)]);
|
||||
cm.sendOk("Enjoy your new and improved face!");
|
||||
} else
|
||||
cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,18 +37,25 @@ function start() {
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (mode == 0 && status == 0)
|
||||
else {
|
||||
if (mode == 0 && status >= 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
cm.sendSimple("Let's see...I can totally transform your face into something new. Don't you want to try it? For #b#t5152038##k, you can get the face of your liking. Take your time in choosing the face of your preference...\r\n\#L2#Let me get my dream face!#l");
|
||||
cm.dispose();
|
||||
} else if (selection == 2) {
|
||||
cm.sendSimple("Let's see...I can totally transform your face into something new. Don't you want to try it? For #b#t5152038##k, you can get the face of your liking. Take your time in choosing the face of your preference...\r\n\#L2#Let me get my dream face! (Uses #i5152038# #t5152038#)#l");
|
||||
} else if (status == 1) {
|
||||
if (!cm.haveItem(5152038)) {
|
||||
cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you...");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
facenew = Array();
|
||||
if (cm.getPlayer().getGender() == 0) {
|
||||
for(var i = 0; i < mface.length; i++)
|
||||
@@ -62,14 +69,11 @@ function action(mode, type, selection) {
|
||||
cm.sendStyle("Let's see... I can totally transform your face into something new. Don't you want to try it? For #b#t5152038##k, you can get the face of your liking. Take your time in choosing the face of your preference...", facenew);
|
||||
}
|
||||
else if (status == 2){
|
||||
cm.gainItem(5152038, -1);
|
||||
cm.setFace(facenew[selection]);
|
||||
cm.sendOk("Enjoy your new and improved face!");
|
||||
|
||||
cm.dispose();
|
||||
if (cm.haveItem(5152038)){
|
||||
cm.gainItem(5152038, -1);
|
||||
cm.setFace(facenew[selection]);
|
||||
cm.sendOk("Enjoy your new and improved face!");
|
||||
} else {
|
||||
cm.sendOk("Hmm ... it looks like you don't have the coupon specifically for this place. Sorry to say this, but without the coupon, there's no plastic surgery for you...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,24 +24,42 @@
|
||||
by Moogra
|
||||
*/
|
||||
var skin = Array(0, 1, 2, 3, 4);
|
||||
var status;
|
||||
|
||||
function start() {
|
||||
cm.sendSimple("Well, hello! Welcome to the Lian Hua Hua Skin-Care! Would you like to have a firm, tight, healthy looking skin like mine? With #b#tCBD Skin Coupon##k, you can let us take care of the rest and have the kind of skin you've always wanted!\r\n\#L1#Sounds Good!#l");
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode < 1)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (selection == 1)
|
||||
cm.sendStyle("With our specialized service, you can see the way you'll look after the treatment in advance. What kind of a skin-treatment would you like to do? Go ahead and choose the style of your liking...", skin);
|
||||
else {
|
||||
if (cm.haveItem(5153010)){
|
||||
cm.gainItem(5153010 , -1);
|
||||
cm.setSkin(selection);
|
||||
cm.sendOk("Enjoy your new and improved skin!");
|
||||
} else
|
||||
if (mode == 0 && status >= 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if (status == 0) {
|
||||
cm.sendSimple("Well, hello! Welcome to the Lian Hua Hua Skin-Care! Would you like to have a firm, tight, healthy looking skin like mine? With #b#tCBD Skin Coupon##k, you can let us take care of the rest and have the kind of skin you've always wanted!\r\n\#L1#Sounds Good! (uses #i5153010# #t5153010#)#l");
|
||||
}
|
||||
else if (status == 1) {
|
||||
if (!cm.haveItem(5153010)) {
|
||||
cm.sendOk("It looks like you don't have the coupon you need to receive the treatment. I'm sorry but it looks like we cannot do it for you.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendStyle("With our specialized service, you can see the way you'll look after the treatment in advance. What kind of a skin-treatment would you like to do? Go ahead and choose the style of your liking...", skin);
|
||||
}
|
||||
else {
|
||||
cm.gainItem(5153010, -1);
|
||||
cm.setSkin(selection);
|
||||
cm.sendOk("Enjoy your new and improved skin!");
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
31
scripts/npc/9270031.js
Normal file
31
scripts/npc/9270031.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
/* Dave & Iris
|
||||
()
|
||||
|
||||
|
||||
*/
|
||||
|
||||
function start() {
|
||||
cm.sendOk("We had our wedding at Amoria, such a beautiful place, and their people are even more amiable. Now our honeymoon on this paradisiac place... Ah, glorious, glorious!");
|
||||
cm.dispose();
|
||||
}
|
||||
@@ -20,9 +20,48 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/* Engine room - Bob
|
||||
* @author Moogra
|
||||
* @author Ronan
|
||||
*/
|
||||
|
||||
var eim;
|
||||
var status = 0;
|
||||
|
||||
function start() {
|
||||
cm.warp(541010110);
|
||||
cm.dispose();
|
||||
}
|
||||
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--;
|
||||
|
||||
eim = cm.getEventInstance();
|
||||
if(status == 0) {
|
||||
if(!eim.isEventCleared()) {
|
||||
cm.sendYesNo("Are you ready to leave this place?");
|
||||
} else {
|
||||
cm.sendYesNo("You have defeated Capt. Latanica, well done! Are you ready to leave this place?");
|
||||
}
|
||||
} else if(status == 1) {
|
||||
if(eim.isEventCleared()) {
|
||||
if(!eim.giveEventReward(cm.getPlayer)) {
|
||||
cm.sendOk("Please make a room on your inventory to receive the loot.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cm.warp(541010110);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,11 +53,17 @@ function action(mode, type, selection) {
|
||||
oldSelection = selection;
|
||||
}else if(status == 1){
|
||||
if(oldSelection == 0){
|
||||
if (cm.getPlayer().getMeso() > 4999 && cm.getPlayer().haveItem(4031732) == false) {
|
||||
cm.gainMeso(-5000);
|
||||
cm.gainItem(4031732);
|
||||
cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!");
|
||||
cm.dispose();
|
||||
if (cm.getPlayer().getMeso() > 4999 && !cm.getPlayer().haveItem(4031732)) {
|
||||
if(cm.getPlayer().canHold(4031732, 1)) {
|
||||
cm.gainMeso(-5000);
|
||||
cm.gainItem(4031732);
|
||||
cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!");
|
||||
cm.dispose();
|
||||
}
|
||||
else {
|
||||
cm.sendOk("You don't have a free slot on your ETC inventory for the ticket, please make a room beforehand.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You do not have enough mesos or you've already purchased a ticket.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -53,11 +53,17 @@ function action(mode, type, selection) {
|
||||
oldSelection = selection;
|
||||
}else if(status == 1){
|
||||
if(oldSelection == 0){
|
||||
if (cm.getPlayer().getMeso() > 4999 && cm.getPlayer().haveItem(4031731) == false) {
|
||||
cm.gainMeso(-5000);
|
||||
cm.gainItem(4031731);
|
||||
cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!");
|
||||
cm.dispose();
|
||||
if (cm.getPlayer().getMeso() > 4999 && !cm.getPlayer().haveItem(4031731)) {
|
||||
if(cm.canHold(4031731, 1)) {
|
||||
cm.gainMeso(-5000);
|
||||
cm.gainItem(4031731);
|
||||
cm.sendOk("Thank you for choosing Wizet Airline! Enjoy your flight!");
|
||||
cm.dispose();
|
||||
}
|
||||
else {
|
||||
cm.sendOk("You don't have a free slot on your ETC inventory for the ticket, please make a room beforehand.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You do not have enough mesos or you've already purchased a ticket.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
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/>.
|
||||
*/
|
||||
/*Adobis
|
||||
/*Aldol
|
||||
*
|
||||
*@author SharpAceX (Alan)
|
||||
*@author SharpAceX (Alan), Ronan
|
||||
*/
|
||||
importPackage(Packages.server.expeditions);
|
||||
importPackage(Packages.tools);
|
||||
@@ -30,7 +30,11 @@ var status = 0;
|
||||
var expedition;
|
||||
var player;
|
||||
var em;
|
||||
var scarga = MapleExpeditionType.SCARGA;
|
||||
var exped = MapleExpeditionType.SCARGA;
|
||||
var expedBoss = "Scarlion and Targa";
|
||||
var expedMap = "Spooky World";
|
||||
var expedItem = 4032246;
|
||||
|
||||
var list = "What would you like to do?#b\r\n\r\n#L1#View current Expedition members#l\r\n#L2#Start the fight!#l\r\n#L3#Stop the expedition.#l";
|
||||
|
||||
function start() {
|
||||
@@ -40,114 +44,139 @@ function start() {
|
||||
function action(mode, type, selection) {
|
||||
|
||||
player = cm.getPlayer();
|
||||
expedition = cm.getExpedition(scarga);
|
||||
expedition = cm.getExpedition(exped);
|
||||
em = cm.getEventManager("ScargaBattle");
|
||||
|
||||
if (mode < 1) {
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (status == 0) {
|
||||
//cm.removeExpedition(expedition);
|
||||
if (player.getClient().getChannel() != 1) { //Only channel 1
|
||||
cm.sendOk("Sorry, Scarlion and Targa may only be challenged on #bChannel 1#k.");
|
||||
cm.dispose();
|
||||
} else if (player.getLevel() < scarga.getMinLevel() && player.getLevel() > scarga.getMaxLevel()) { //Don't fit requirement
|
||||
cm.sendOk("You do not meet the criteria to take on Scarlion and Targa!");
|
||||
cm.dispose();
|
||||
} else if (expedition == null) { //Start an expedition
|
||||
cm.sendSimple("Would you like to assemble a team to take on #rScarlion and Targa#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
|
||||
status = 1;
|
||||
} else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
|
||||
cm.sendSimple(list);
|
||||
status = 2;
|
||||
} else if (expedition.isRegistering()) { //If the expedition is registering
|
||||
if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
|
||||
cm.sendOk("You have already registered for the expedition. Please wait for " + expedition.getLeader().getName() + " to begin the expedition.");
|
||||
cm.dispose();
|
||||
} else { //If you aren't in it, you're going to get added
|
||||
cm.sendOk(expedition.addMember(cm.getPlayer()));
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (expedition.isInProgress()) { //Only if the expedition is in progress
|
||||
if (expedition.contains(player)) { //If you're registered, warp you in
|
||||
em.getInstance("ScargaBattle_" + player.getClient().getChannel()).registerPlayer(player);
|
||||
cm.dispose();
|
||||
} else { //If you're not in by now, tough luck
|
||||
cm.sendOk("Another expedition has taken the initiative to fight Scarlion and Targa, lets pray for those brave souls.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
} else if (status == 1) {
|
||||
if (selection == 1) {
|
||||
cm.createExpedition(scarga);
|
||||
cm.sendOk("The #rScarlion and Targa Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
cm.sendOk("Sure, not everyone's up to challenging the might of Scarlion and Targa.");
|
||||
} else {
|
||||
if (mode == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (status == 2) {
|
||||
if (selection == 1) {
|
||||
if (expedition == null) {
|
||||
cm.sendOk("The expedition could not be loaded.");
|
||||
|
||||
if (status == 0) {
|
||||
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
|
||||
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
|
||||
cm.dispose();
|
||||
} else if (expedition == null) { //Start an expedition
|
||||
cm.sendSimple("#e#b<Expedition: Scarlion & Targa>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
|
||||
status = 1;
|
||||
} else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
|
||||
cm.sendSimple(list);
|
||||
status = 2;
|
||||
} else if (expedition.isRegistering()) { //If the expedition is registering
|
||||
if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
|
||||
cm.sendOk("You have already registered for the expedition. Please wait for #r" + expedition.getLeader().getName() + "#k to begin the expedition.");
|
||||
cm.dispose();
|
||||
} else { //If you aren't in it, you're going to get added
|
||||
cm.sendOk(expedition.addMember(cm.getPlayer()));
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (expedition.isInProgress()) { //Only if the expedition is in progress
|
||||
if (expedition.contains(player)) { //If you're registered, warp you in
|
||||
var eim = em.getInstance("Scarga" + player.getClient().getChannel());
|
||||
if(eim.getIntProperty("canJoin") == 1) {
|
||||
eim.registerPlayer(player);
|
||||
} else {
|
||||
cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
} else { //If you're not in by now, tough luck
|
||||
cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
} else if (status == 1) {
|
||||
if (selection == 1) {
|
||||
if (!cm.haveItem(expedItem)) {
|
||||
cm.sendOk("As the expedition leader, you must have on your inventory a #b#t" + expedItem + "##k to battle " + expedBoss + "!");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
expedition = cm.getExpedition(exped);
|
||||
if(expedition != null) {
|
||||
cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
cm.createExpedition(exped);
|
||||
cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + ".");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var size = expedition.getMembers().size();
|
||||
if (size == 1) {
|
||||
cm.sendOk("You are the only member of the expedition.");
|
||||
} else if (status == 2) {
|
||||
if (selection == 1) {
|
||||
if (expedition == null) {
|
||||
cm.sendOk("The expedition could not be loaded.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var size = expedition.getMembers().size();
|
||||
if (size == 1) {
|
||||
cm.sendOk("You are the only member of the expedition.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var text = "The following members make up your expedition (Click on them to expel them):\r\n";
|
||||
text += "\r\n\t\t1." + expedition.getLeader().getName();
|
||||
for (var i = 1; i < size; i++) {
|
||||
text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
|
||||
}
|
||||
cm.sendSimple(text);
|
||||
status = 6;
|
||||
} else if (selection == 2) {
|
||||
var min = exped.getMinSize();
|
||||
var size = expedition.getMembers().size();
|
||||
if (size < min) {
|
||||
cm.sendOk("You need at least " + min + " players registered in your expedition.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendOk("The expedition will begin and you will now be escorted to the #b" + expedMap + "#k.");
|
||||
status = 4;
|
||||
} else if (selection == 3) {
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
|
||||
cm.endExpedition(expedition);
|
||||
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var text = "The following members make up your expedition (Click on them to expel them):\r\n";
|
||||
text += "\r\n\t\t1." + expedition.getLeader().getName();
|
||||
for (var i = 1; i < size; i++) {
|
||||
text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
|
||||
} else if (status == 4) {
|
||||
if (em == null) {
|
||||
cm.sendOk("The event could not be initialized, please report this on the forum.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendSimple(text);
|
||||
status = 6;
|
||||
} else if (selection == 2) {
|
||||
cm.sendOk("The expedition will begin and you will now be escorted to the #bSpooky World#k.");
|
||||
status = 4;
|
||||
} else if (selection == 3) {
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.removeClock());
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
|
||||
cm.endExpedition(expedition);
|
||||
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (status == 4) {
|
||||
var min = 1; //scarga.getMinSize();
|
||||
var size = expedition.getMembers().size();
|
||||
if (size < min) {
|
||||
cm.sendOk("You need at least " + min + " players registered in your expedition.");
|
||||
|
||||
em.setProperty("leader", player.getName());
|
||||
em.setProperty("channel", player.getClient().getChannel());
|
||||
if(!em.startInstance(expedition)) {
|
||||
cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (em == null) {
|
||||
cm.sendOk("The event could not be found, please report this on the forum.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendOk("Good luck! Scarlion and Targa are worthy foes!");
|
||||
em.setProperty("leader", player.getName());
|
||||
em.setProperty("channel", player.getClient().getChannel());
|
||||
em.startInstance(expedition);
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (status == 6) {
|
||||
if (selection > 0) {
|
||||
var banned = expedition.getMembers().get(selection);
|
||||
expedition.ban(banned);
|
||||
cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendSimple(list);
|
||||
status = 2;
|
||||
} else if (status == 6) {
|
||||
if (selection > 0) {
|
||||
var banned = expedition.getMembers().get(selection - 1);
|
||||
expedition.ban(banned);
|
||||
cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendSimple(list);
|
||||
status = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user