Maplers' Well-known Battlegrounds
Fulfilled merge of Drago's AriantPQ PR #438 into the source! Adjusted MCPQ map limits predicted within battlefield's map info node. Added max number-of-players option when creating a AriantPQ lobby. Added party creation check when trying to create one inside the AriantPQ rooms. Adjusted several AriantPQ mechanics, in order to either improve the existent features or make those that was still unavailable work seamlessly (score update, ariant batlle points).
This commit is contained in:
@@ -15,7 +15,7 @@ var rideTime = 1 * 60 * 1000; //The time that require move to destination
|
||||
function init() {
|
||||
closeTime = em.getTransportationTime(closeTime);
|
||||
beginTime = em.getTransportationTime(beginTime);
|
||||
rideTime = em.getTransportationTime(rideTime);
|
||||
rideTime = em.getTransportationTime(rideTime);
|
||||
|
||||
KC_bfd = em.getChannelServer().getMapFactory().getMap(540010100);
|
||||
CBD_bfd = em.getChannelServer().getMapFactory().getMap(540010001);
|
||||
|
||||
@@ -99,8 +99,12 @@ function action(mode, type, selection) {
|
||||
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!");
|
||||
if (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!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -106,8 +106,12 @@ function action(mode, type, selection) {
|
||||
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!");
|
||||
if (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!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -98,8 +98,12 @@ function action(mode, type, selection) {
|
||||
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!");
|
||||
if (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!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -1,108 +1,178 @@
|
||||
/*
|
||||
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>
|
||||
/*2101014.js - Lobby and Entrance
|
||||
* @author Jvlaple
|
||||
* For Jvlaple's AriantPQ
|
||||
*/
|
||||
|
||||
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.
|
||||
importPackage(Packages.server.expeditions);
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
NPC NAME: Cesar (2)
|
||||
NPC ID: 2101014
|
||||
Author: Vcoc
|
||||
Function: AriantPQ
|
||||
*/
|
||||
|
||||
status = -1;
|
||||
var sel;
|
||||
empty = [false, false, false];
|
||||
var status = 0;
|
||||
var toBan = -1;
|
||||
var choice;
|
||||
var arenaType;
|
||||
var arena;
|
||||
var arenaName;
|
||||
var type;
|
||||
var map;
|
||||
var exped = MapleExpeditionType.ARIANT;
|
||||
var exped1 = MapleExpeditionType.ARIANT1;
|
||||
var exped2 = MapleExpeditionType.ARIANT2;
|
||||
|
||||
function start() {
|
||||
if((cm.getPlayer().getLevel() < 19 || cm.getPlayer().getLevel() > 30) && !cm.getPlayer().isGM()){
|
||||
cm.sendNext("You're not between level 20 and 30. Sorry, you may not participate.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var text = "What do you want?#b";
|
||||
for(var i = 0; i < 3; i += 1)
|
||||
if (cm.getPlayerCount(980010100 + (i * 100)) > 0)
|
||||
if(cm.getPlayerCount(980010101 + (i * 100)) > 0)
|
||||
continue;
|
||||
else
|
||||
text += "\r\n#L" + i + "# Battle Arena " + (i + 1) + "([" + cm.getPlayerCount(980010100 + (i * 100)) + "/" + cm.getPlayer().getAriantSlotsRoom(i) + "] users: " + cm.getPlayer().getAriantRoomLeaderName(i) + ")#l";
|
||||
else{
|
||||
empty[i] = true;
|
||||
text += "\r\n#L" + i + "# Battle Arena " + (i + 1) + "( Empty )#l";
|
||||
if(cm.getPlayer().getAriantRoomLeaderName(i) != "")
|
||||
cm.getPlayer().removeAriantRoom(i);
|
||||
}
|
||||
cm.sendSimple(text + "\r\n#L3# I'd like to know more about the competition.#l");
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection){
|
||||
status++;
|
||||
if(mode != 1){
|
||||
if(mode == 0 && type == 0)
|
||||
status -= 2;
|
||||
else{
|
||||
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 (cm.getPlayer().getMapId() == 980010000) {
|
||||
if (cm.getLevel() > 30) {
|
||||
cm.sendOk("You are already over #rlevel 30#k, therefore you can't participate in this instance anymore.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
var expedicao = cm.getExpedition(exped);
|
||||
var expedicao1 = cm.getExpedition(exped1);
|
||||
var expedicao2 = cm.getExpedition(exped2);
|
||||
|
||||
var channelMaps = cm.getClient().getChannelServer().getMapFactory();
|
||||
var startSnd = "Voc<6F> gostaria de participar do Desafio #eAriant Coliseu#n?\r\n\r\n#e#r (Escolha uma arena)#n#k\r\n#b";
|
||||
var toSnd = startSnd;
|
||||
|
||||
if (expedicao == null) {
|
||||
toSnd += "#L0#Comece Ariant Coliseu (1)#l\r\n";
|
||||
} else if (channelMaps.getMap(980010101).getCharacters().isEmpty()) {
|
||||
toSnd += "#L0#Junte-se ao Ariant Coliseu (1) Dono (" + expedicao.getLeader().getName() + ")" + " Membros Atuais: " + cm.getExpeditionMemberNames(exped) + "\r\n";
|
||||
}
|
||||
if (expedicao1 == null) {
|
||||
toSnd += "#L1#Comece Ariant Coliseu (2)#l\r\n";
|
||||
} else if (channelMaps.getMap(980010201).getCharacters().isEmpty()) {
|
||||
toSnd += "#L1#Junte-se ao Ariant Coliseu (2) Dono (" + expedicao1.getLeader().getName() + ")" + " Membros Atuais: " + cm.getExpeditionMemberNames(exped1) + "\r\n";
|
||||
}
|
||||
if (expedicao2 == null) {
|
||||
toSnd += "#L2#Comece Ariant Coliseu (3)#l\r\n";
|
||||
} else if (channelMaps.getMap(980010301).getCharacters().isEmpty()) {
|
||||
toSnd += "#L2#Junte-se ao Ariant Coliseu (3) Dono (" + expedicao2.getLeader().getName() + ")" + " Membros Atuais: " + cm.getExpeditionMemberNames(exped2) + "\r\n";
|
||||
}
|
||||
if (toSnd.equals(startSnd)) {
|
||||
cm.sendOk("Todas as arenas esta ocupadas agora. Eu sugiro que voc<6F> volte mais tarde ou mudar de canal.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendSimple(toSnd);
|
||||
}
|
||||
} else if (status == 1) {
|
||||
arenaType = selection;
|
||||
expedicao = fetchArenaType();
|
||||
if (expedicao == "") {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (expedicao != null) {
|
||||
enterArena(-1);
|
||||
} else {
|
||||
cm.sendGetText("Quantos jogadores voce quer em sua instancia?");
|
||||
}
|
||||
} else if (status == 2) {
|
||||
var players = parseInt(cm.getText()); // AriantPQ option limit found thanks to NarutoFury (iMrSiN)
|
||||
if (isNaN(players)) {
|
||||
cm.sendNext("Por favor insira um valor numérico de limite de jogadores permitidos em sua instancia.");
|
||||
status = 0;
|
||||
} else if (players < 2) {
|
||||
cm.sendNext("Sua instancia precisa ter ao menos 2 jogadores.");
|
||||
status = 0;
|
||||
} else {
|
||||
enterArena(players);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (status == 0){
|
||||
if(sel == undefined)
|
||||
sel = selection;
|
||||
if(sel == 3)
|
||||
cm.sendNext("What do you need to do? You must be new to this. Allow me explain in detail.");
|
||||
else{
|
||||
if(cm.getPlayer().getAriantRoomLeaderName(sel) != "" && empty[sel])
|
||||
empty[sel] = false;
|
||||
else if(cm.getPlayer().getAriantRoomLeaderName(sel) != ""){
|
||||
cm.warp(980010100 + (sel * 100));
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if(!empty[sel]){
|
||||
cm.sendNext("Another combatant has created the battle arena first. I advise you to either set up a new one, or join the battle arena that's already been set up.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendGetNumber("Up to how many participants can join in this match? (2~6 ppl)", 0, 2, 6);
|
||||
}
|
||||
}else if (status == 1){
|
||||
if(sel == 3)
|
||||
cm.sendNextPrev("It's really simple, actually. You'll receive #b#t2270002##k from me, and your task is to eliminate a set amount of HP from the monster, then use #b#t2270002##k to absorb its monstrous power.");
|
||||
else{
|
||||
if(cm.getPlayer().getAriantRoomLeaderName(sel) != "" && empty[sel])
|
||||
empty[sel] = false;
|
||||
if(!empty[sel]){
|
||||
cm.sendNext("Another combatant has created the battle arena first. I advise you to either set up a new one, or join the battle arena that's already been set up.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.getPlayer().setAriantRoomLeader(sel, cm.getPlayer().getName());
|
||||
cm.getPlayer().setAriantSlotRoom(sel, selection);
|
||||
cm.warp(980010100 + (sel * 100));
|
||||
cm.dispose();
|
||||
}
|
||||
}else if (status == 2)
|
||||
cm.sendNextPrev("It's simple. If you absorb the power of the monster #b#t2270002##k, then you'll make #b#t4031868##k, which is something Queen Areda loves. The combatant with the most jewels wins the match. It's actually a smart idea to prevent others from absorbing in order to win.");
|
||||
else if (status == 3)
|
||||
cm.sendNextPrev("One thing. Using #b#t2100067##k, you can steal #b#t4031868##k from your enemies. Warning: #rYou may not use pets for this.#k Understood?!");
|
||||
else if (status == 4)
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
function fetchArenaType() {
|
||||
switch (arenaType) {
|
||||
case 0 :
|
||||
exped = MapleExpeditionType.ARIANT;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
map = 980010100;
|
||||
break;
|
||||
case 1 :
|
||||
exped = MapleExpeditionType.ARIANT1;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
map = 980010200;
|
||||
break;
|
||||
case 2 :
|
||||
exped = MapleExpeditionType.ARIANT2;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
map = 980010300;
|
||||
break;
|
||||
default :
|
||||
exped = null;
|
||||
map = 0;
|
||||
expedicao = "";
|
||||
}
|
||||
|
||||
return expedicao;
|
||||
}
|
||||
|
||||
function enterArena(arenaPlayers) {
|
||||
expedicao = fetchArenaType();
|
||||
if (expedicao == "") {
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (expedicao == null) {
|
||||
if (arenaPlayers != -1) {
|
||||
if (cm.createExpedition(exped, true, 0, arenaPlayers)) {
|
||||
cm.warp(map, 0);
|
||||
cm.getPlayer().dropMessage("Sua Arena foi criada. Aguarde as pessoas entrarem agora!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when locating the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (playerAlreadyInLobby(cm.getPlayer())) {
|
||||
cm.sendOk("Desculpe, você já pertence a alguma Lobby.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var playerAdd = expedicao.addMemberInt(cm.getPlayer());
|
||||
if (playerAdd == 3) {
|
||||
cm.sendOk("Desculpe, a Lobby esta cheia agora.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (playerAdd == 0) {
|
||||
cm.warp(map, 0);
|
||||
cm.dispose();
|
||||
} else if (playerAdd == 2) {
|
||||
cm.sendOk("Desculpe, mas o l<>der pediu para nao ser autorizado a entrar.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("erro.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function playerAlreadyInLobby(player) {
|
||||
return cm.getExpedition(MapleExpeditionType.ARIANT) != null && cm.getExpedition(MapleExpeditionType.ARIANT).contains(player) ||
|
||||
cm.getExpedition(MapleExpeditionType.ARIANT1) != null && cm.getExpedition(MapleExpeditionType.ARIANT1).contains(player) ||
|
||||
cm.getExpedition(MapleExpeditionType.ARIANT2) != null && cm.getExpedition(MapleExpeditionType.ARIANT2).contains(player);
|
||||
}
|
||||
63
scripts/npc/2101015.js
Normal file
63
scripts/npc/2101015.js
Normal file
@@ -0,0 +1,63 @@
|
||||
var arena;
|
||||
var status = 0;
|
||||
|
||||
importPackage(Packages.client);
|
||||
|
||||
function start() {
|
||||
arena = cm.getPlayer().getAriantColiseum();
|
||||
if (arena == null) {
|
||||
cm.sendOk("Ei, não vi você em campo durante as atividades do coliseu! O que você está fazendo aqui?");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
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) {
|
||||
menuStr = generateSelectionMenu(["Gostaria de verificar meus pontos de batalha / adquirir a minha Cadeira de Praia com Palmeira", "Gostaria de saber mais sobre os pontos da Arena de Batalha"]);
|
||||
cm.sendSimple("Olá, o que posso fazer por você?\r\n\r\n" + menuStr);
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
apqpoints = cm.getPlayer().getAriantPoints();
|
||||
if (apqpoints < 100) {
|
||||
cm.sendOk("A sua Pontua<75><61>o de Arena de Batalha <20> #b" + apqpoints + "#k Pontos. Voc<6F> precisa ultrapassar os #b100 Pontos#k para que eu possa lhe dar a #bCadeira de Praia com Palmeira#k. Fale comigo novamente somente quando voc<6F> tiver pontos suficientes.");
|
||||
cm.dispose();
|
||||
} else if (apqpoints + arena.getAriantRewardTier(cm.getPlayer()) >= 100) {
|
||||
cm.sendOk("A sua Pontua<75><61>o de Arena de Batalha <20> #b" + apqpoints + "#k Pontos, e voc<6F> praticamente já possui essa pontuação! Converse com minha esposa, #p2101016#, para adquiri-los e então torne a conversar comigo!");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendNext("Uaaau, parece que voc<6F> conseguiu os #b100 Pontos#k necess<73>rios para troca, vamos l<>?!");
|
||||
}
|
||||
} else if (selection == 1) {
|
||||
cm.sendOk("O objetivo maior das Arenas de Batalha é permitir ao jogador acumular pontos para então trocá-los honrosamente pelo prêmio maior: a #bCadeira de Praia com Palmeira#k. Acumule pontos durante as batalhas e fale comigo quando chegar a hora de adquirir seu item.\r\n\r\nEm cada batalha, é dado ao jogador a oportunidade de #bsomar pontos baseando-se na quantidade de joias#k que o jogador possui ao final. Contudo tome cuidado! Se sua distância de pontos dentre os outros jogadores #rfor muito alto#k, isso terá sido tudo por nada e você ganhará mero #r1 ponto#k.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 2) {
|
||||
cm.getPlayer().gainAriantPoints(-100);
|
||||
cm.gainItem(3010018, 1);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function generateSelectionMenu(array) { // nice tool for generating a string for the sendSimple functionality
|
||||
var menu = "";
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
menu += "#L" + i + "##b" + array[i] + "#l#k\r\n";
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
50
scripts/npc/2101016.js
Normal file
50
scripts/npc/2101016.js
Normal file
@@ -0,0 +1,50 @@
|
||||
var arena;
|
||||
var status = 0;
|
||||
|
||||
importPackage(Packages.client);
|
||||
|
||||
function start() {
|
||||
arena = cm.getPlayer().getAriantColiseum();
|
||||
if (arena == null) {
|
||||
cm.sendOk("Ei, não vi você em campo durante as atividades do coliseu! O que você está fazendo aqui?");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
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) {
|
||||
copns = arena.getAriantScore(cm.getPlayer());
|
||||
if (copns < 1 && !cm.getPlayer().isGM()) {
|
||||
cm.sendOk("Que pena, voc<6F> nao conseguiu nenhuma j<>ia!");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendNext("Ok, vamos ver...Voc<6F> foi muito bem, e voc<6F> trouxe #b" + copns + "#k j<>ias que eu adoro. Como voc<6F> completou a partida, vou recompens<6E>-lo com a pontua<75><61>o da Arena de Batalhas de #b" + arena.getAriantRewardTier(cm.getPlayer()) + " Pontos#k. Se voc<6F> quiser saber mais sobre a pontua<75><61>o de Arena de Batalha, ent<6E>o fale com #b#p2101015##k.");
|
||||
}
|
||||
} else if (status == 1) {
|
||||
//cm.warp(980010020, 0);
|
||||
copns = arena.getAriantRewardTier(cm.getPlayer());
|
||||
arena.clearAriantRewardTier(cm.getPlayer());
|
||||
arena.clearAriantScore(cm.getPlayer());
|
||||
cm.removeAll(4031868);
|
||||
|
||||
cm.getPlayer().gainExp(92.7 * cm.getPlayer().getExpRate() * copns, true, true);
|
||||
cm.getPlayer().gainAriantPoints(copns);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,150 +1,150 @@
|
||||
/*
|
||||
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>
|
||||
/*2101017.js
|
||||
*Cesar
|
||||
*@author Jvlaple
|
||||
*/
|
||||
|
||||
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.
|
||||
importPackage(Packages.server.expeditions);
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
NPC NAME: Cesar (3)
|
||||
NPC ID: 2101017
|
||||
Author: Vcoc
|
||||
Function: AriantPQ
|
||||
*/
|
||||
|
||||
importPackage(Packages.tools);
|
||||
importPackage(Packages.client);
|
||||
|
||||
status = -1;
|
||||
var sel;
|
||||
var status = 0;
|
||||
var toBan = -1;
|
||||
var choice;
|
||||
var arena;
|
||||
var arenaName;
|
||||
var type;
|
||||
var map;
|
||||
var exped;
|
||||
var expedicao;
|
||||
var expedMembers;
|
||||
|
||||
function start() {
|
||||
if((cm.getPlayer().getLevel() < 19 || cm.getPlayer().getLevel() > 30) && !cm.getPlayer().isGM()){
|
||||
cm.sendNext("You're not between level 20 and 30. Sorry, you may not participate.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if(cm.getPlayer().getMapId() % 10 == 1)
|
||||
cm.sendSimple("Do you have a request for me?\r\n#b#L0# Give me #t2270002# and #t2100067#.#l\r\n#L1# What should I do?#l\r\n#L2# Get me out of here.#l");
|
||||
else
|
||||
cm.sendSimple(cm.getPlayer().getAriantRoomLeaderName(((cm.getPlayer().getMapId() / 100) % 10) - 1) == cm.getPlayer().getName() ? "Would you like to start the match?#b\r\n#b#L3# Ready to enter the Battle Arena!!#l\r\n#L1# I'd like to kick another character.#l\r\n#L2# Get me out of here.#l" : "What do you want?#b\r\n#L2# Get me out of here.#l");
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection){
|
||||
status++;
|
||||
if(mode != 1){
|
||||
if(mode == 0 && type == 0)
|
||||
status -= 2;
|
||||
else{
|
||||
function action(mode, type, selection) {
|
||||
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(cm.getPlayer().getMapId() % 10 == 1){
|
||||
if (status == 0){
|
||||
if (sel == undefined)
|
||||
sel = selection;
|
||||
if(sel == 0){
|
||||
if(cm.haveItem(2270002))
|
||||
cm.sendNext("You already have #b#t2270002##k.");
|
||||
else if(cm.canHold(2270002) && cm.canHold(2100067)){
|
||||
if(cm.haveItem(2100067))
|
||||
cm.removeAll(2100067);
|
||||
cm.gainItem(2270002, 50);
|
||||
cm.gainItem(2100067, 5);
|
||||
cm.sendNext("Now lower the HP of the monsters, and use #b#t2270002##k to absorb their power!");
|
||||
}else
|
||||
cm.sendNext("Check and see if your Use inventory is full or not");
|
||||
cm.dispose();
|
||||
}else if(sel == 1)
|
||||
cm.sendNext("What do you need to do? You must be new to this. Allow me explain in detail.");
|
||||
else
|
||||
cm.sendYesNo("Are you sure you want to leave?"); //No GMS like.
|
||||
} else if (status == 1){
|
||||
if(type == 1){
|
||||
cm.removeAll(4031868);
|
||||
cm.removeAll(2270002);
|
||||
cm.removeAll(2100067);
|
||||
cm.warp(980010020);
|
||||
|
||||
if (cm.getPlayer().getMapId() == 980010100 || cm.getPlayer().getMapId() == 980010200 || cm.getPlayer().getMapId() == 980010300) {
|
||||
if (cm.getPlayer().getMapId() == 980010100) {
|
||||
exped = MapleExpeditionType.ARIANT;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
|
||||
} else if (cm.getPlayer().getMapId() == 980010200) {
|
||||
exped = MapleExpeditionType.ARIANT1;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
} else {
|
||||
exped = MapleExpeditionType.ARIANT2;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
}
|
||||
|
||||
if (expedicao == null) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.sendNextPrev("It's really simple, actually. You'll receive #b#t2270002##k from me, and your task is to eliminate a set amount of HP from the monster, then use #b#t2270002##k to absorb its monstrous power.");
|
||||
} else if (status == 2)
|
||||
cm.sendNextPrev("It's simple. If you absorb the power of the monster #b#t2270002##k, then you'll make #b#t4031868##k, which is something Queen Areda loves. The combatant with the most jewels wins the match. It's actually a smart idea to prevent others from absorbing in order to win.");
|
||||
else if (status == 3)
|
||||
cm.sendNextPrev("One thing. Using #b#t2100067##k, you can steal #b#t4031868##k from your enemies. Warning: #rYou may not use pets for this.#k Understood?!");
|
||||
else if (status == 4)
|
||||
cm.dispose();
|
||||
}else{
|
||||
var nextchar = cm.getMap(cm.getPlayer().getMapId()).getCharacters().iterator();
|
||||
if(status == 0){
|
||||
if (sel == undefined)
|
||||
sel = selection;
|
||||
if(sel == 1)
|
||||
if(cm.getPlayerCount(cm.getPlayer().getMapId()) > 1){
|
||||
var text = "Who would you like to kick from room?"; //Not GMS like text
|
||||
var name;
|
||||
for(var i = 0; nextchar.hasNext(); i++){
|
||||
name = nextchar.next().getName();
|
||||
if(!cm.getPlayer().getAriantRoomLeaderName(((cm.getPlayer().getMapId() / 100) % 10) - 1).equals(name))
|
||||
text += "\r\n#b#L" + i + "#" + name + "#l";
|
||||
|
||||
expedMembers = expedicao.getMemberList();
|
||||
if (status == 0) {
|
||||
if (cm.isLeaderExpedition(exped)) {
|
||||
cm.sendSimple("O que voce gostaria de fazer?#b\r\n\r\n#L1#Ver registro atual da arena!#l\r\n#L2#Banir player!#l\r\n#L3#Comece a luta!#l\r\n#L4#Sair desta arena!#l");
|
||||
status = 1;
|
||||
} else {
|
||||
var toSend = "Voce tem atualmente essas pessoas em sua arena :\r\n#b";
|
||||
toSend += cm.getExpeditionMemberNames(exped);
|
||||
cm.sendOk(toSend);
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 1) {
|
||||
if (selection == 1) {
|
||||
var toSend = "Voce tem atualmente essas pessoas em sua arena :\r\n#b";
|
||||
toSend += cm.getExpeditionMemberNames(exped);
|
||||
cm.sendOk(toSend);
|
||||
cm.dispose();
|
||||
} else if (selection == 2) {
|
||||
var size = expedMembers.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." + expedicao.getLeader().getName();
|
||||
for (var i = 1; i < size; i++) {
|
||||
text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedMembers.get(i).getValue() + "#l\n";
|
||||
}
|
||||
cm.sendSimple(text);
|
||||
}else{
|
||||
cm.sendNext("There's no character that can be kicked right now.");
|
||||
status = 6;
|
||||
} else if (selection == 3) {
|
||||
if (expedicao.getMembers().size() < 1) {
|
||||
cm.sendOk("Voc<6F> precisa de mais que 2 jogadores para iniciar.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (cm.getParty() != null) {
|
||||
cm.sendOk("Voc<6F> n<>o pode entrar na batalha em um grupo.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var errorMsg = cm.startAriantBattle(exped, cm.getPlayer().getMapId());
|
||||
if (errorMsg != "") {
|
||||
cm.sendOk(errorMsg);
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (selection == 4) {
|
||||
cm.mapMessage(5, "O lider da Arena saiu.");
|
||||
expedicao.warpExpeditionTeam(980010000);
|
||||
cm.endExpedition(expedicao);
|
||||
cm.dispose();
|
||||
}
|
||||
else if(sel == 2){
|
||||
if(cm.getPlayer().getAriantRoomLeaderName(((cm.getPlayer().getMapId() / 100) % 10) - 1) == cm.getPlayer().getName())
|
||||
cm.sendYesNo("Are you sure you want to leave? You're the leader of the Arena, so if you leave, the whole Battle Arena will close.");
|
||||
else
|
||||
cm.sendYesNo("Are you sure you want to leave?"); //No GMS like.
|
||||
}else if(sel == 3)
|
||||
if(cm.getPlayerCount(cm.getPlayer().getMapId()) > 1)
|
||||
cm.sendYesNo("The room is all set, and no other character may join this Battle Arena. Do you want to start the game right now?");
|
||||
else{
|
||||
cm.sendNext("You'll need at least 2 participants inside in order to start the match.");
|
||||
} else if (status == 6) {
|
||||
if (selection > 0) {
|
||||
var banned = expedMembers.get(selection - 1);
|
||||
expedicao.ban(banned);
|
||||
cm.sendOk("You have banned " + banned.getValue() + " from the expedition.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendSimple(list);
|
||||
status = 2;
|
||||
}
|
||||
}else if (status == 1){
|
||||
if(sel == 1){
|
||||
for(var i = 0; nextchar.hasNext(); i++)
|
||||
if(i == selection){
|
||||
nextchar.next().changeMap(cm.getMap(980010000));
|
||||
break;
|
||||
}else
|
||||
nextchar.next();
|
||||
cm.sendNext("Player have been kicked out of the Arena."); //Not GMS like
|
||||
}else if(sel == 2){
|
||||
if(cm.getPlayer().getAriantRoomLeaderName(((cm.getPlayer().getMapId() / 100) % 10) - 1) != cm.getPlayer().getName())
|
||||
cm.warp(980010000);
|
||||
else{
|
||||
cm.getPlayer().removeAriantRoom((cm.getPlayer().getMapId() / 100) % 10);
|
||||
cm.mapMessage(6, cm.getPlayer().getName() + " has left the Arena, so the Arena will now close.");
|
||||
cm.warpMap(980010000);
|
||||
}
|
||||
}else{
|
||||
cm.warpMap(cm.getPlayer().getMapId() + 1);
|
||||
//}
|
||||
//cm.getPlayer().getMap().broadcastMessage(MaplePacketCreator.updateAriantPQRanking(cm.getPlayer().getName(), 0, true));
|
||||
}
|
||||
} else if (Packages.constants.GameConstants.isAriantColiseumArena(cm.getPlayer().getMapId())) {
|
||||
if (cm.getPlayer().getMapId() == 980010101) {
|
||||
exped = MapleExpeditionType.ARIANT;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
} else if (cm.getPlayer().getMapId() == 980010201) {
|
||||
exped = MapleExpeditionType.ARIANT1;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
} else {
|
||||
exped = MapleExpeditionType.ARIANT2;
|
||||
expedicao = cm.getExpedition(exped);
|
||||
}
|
||||
if (status == 0) {
|
||||
var gotTheBombs = expedicao.getProperty("gotBomb" + cm.getChar().getId());
|
||||
if (gotTheBombs != null) {
|
||||
cm.sendOk("Eu ja lhe dei as bombas, por favor, mate os #eEscorpioes#n para conseguir mais delas!");
|
||||
cm.dispose();
|
||||
} else if (cm.canHoldAll([2270002, 2100067], [50, 5])) {
|
||||
cm.sendOk("Eu lhe dei (5) #b#eBombas#k#n e (50) #b#eRochas Elementais#k#n.\r\nUse as rochas elementais para capturar os escorpioes para Sra.#r#eSpirit Jewels#k#n!");
|
||||
expedicao.setProperty("gotBomb" + cm.getChar().getId(), "1");
|
||||
cm.gainItem(2270002, 50);
|
||||
cm.gainItem(2100067, 5);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Por favor encontre 2 espaços no seu inventário de USE antes de receber seus itens!");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("Olá, já ouviu falar da Ariant Coliseum Battle Arena? É um evento competitivo disponível para jogadores entre níveis 20 a 30.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,8 +101,12 @@ function action(mode, type, selection) {
|
||||
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!");
|
||||
if (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!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -20,14 +20,14 @@ function action(mode, type, selection) {
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
if (cm.getLevel() < 25) {
|
||||
if (cm.getLevel() < 20) {
|
||||
cm.sendDimensionalMirror("#-1# There is no place for you to transport to from here.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
var selStr = "";
|
||||
/*if (cm.getLevel() >= 20 && cm.getLevel() <= 30) { NOT IMPLEMENTED
|
||||
if (cm.getLevel() >= 20 && cm.getLevel() <= 30) {
|
||||
selStr += "#0# Ariant Coliseum";
|
||||
} */
|
||||
}
|
||||
|
||||
if (cm.getLevel() >= 25) {
|
||||
selStr += "#1# Mu Lung Dojo";
|
||||
|
||||
@@ -105,8 +105,12 @@ function action(mode, type, selection) {
|
||||
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!");
|
||||
if (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!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -89,8 +89,12 @@ function action(mode, type, selection) {
|
||||
return;
|
||||
}
|
||||
|
||||
cm.createExpedition(cwkpq);
|
||||
cm.sendOk("The #rCrimsonwood Keep Party Quest Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
|
||||
if (cm.createExpedition(cwkpq)) {
|
||||
cm.sendOk("The #rCrimsonwood Keep Party Quest Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -106,8 +106,12 @@ function action(mode, type, selection) {
|
||||
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!");
|
||||
if (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!");
|
||||
} else {
|
||||
cm.sendOk("An unexpected error has occurred when starting the expedition, please try again later.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (selection == 2) {
|
||||
|
||||
@@ -47,6 +47,7 @@ function writeFeatureTab_PQs() {
|
||||
addFeature("Brand-new PQs: BossRushPQ, CafePQ.");
|
||||
addFeature("Mu Lung Dojo.");
|
||||
addFeature("Monster Carnival 1 & 2 - thanks Dragohe4rt & Jayd!");
|
||||
addFeature("AriantPQ - thanks Dragohe4rt!");
|
||||
addFeature("Capt. Latanica with party fighting the boss.");
|
||||
addFeature("Filled up missing obligatory event script methods.");
|
||||
addFeature("Secured uniquety of active lobby-name instances.");
|
||||
@@ -207,6 +208,7 @@ function writeFeatureTab_Serverpotentials() {
|
||||
addFeature("Custom jail system.");
|
||||
addFeature("Custom buyback system, uses mesos / NX, via MTS.");
|
||||
addFeature("Custom fishing system having 'seasonal' catch times.");
|
||||
addFeature("Actual fishing handling w/ F. Net - thanks Dragohe4rt!");
|
||||
addFeature("Custom map leasing system.");
|
||||
addFeature("Delete Character.");
|
||||
addFeature("Smooth view-all-char, now showing all account chars.");
|
||||
|
||||
Reference in New Issue
Block a user