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:
@@ -27,19 +27,26 @@
|
||||
var status;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode < 0)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0 && mode == 1) {
|
||||
}
|
||||
}
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0 && status == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if(status == 0) {
|
||||
cm.sendOk("Sample text.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
var isPq = true;
|
||||
var minPlayers = 1, maxPlayers = 6;
|
||||
var minLevel = 1, maxLevel = 200;
|
||||
var minLevel = 1, maxLevel = 255;
|
||||
var entryMap = 970030100;
|
||||
var exitMap = 970030000;
|
||||
var recruitMap = 970030000;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
var isPq = true;
|
||||
var minPlayers = 1, maxPlayers = 30;
|
||||
var minLevel = 1, maxLevel = 200;
|
||||
var minLevel = 1, maxLevel = 255;
|
||||
var entryMap = 990000000;
|
||||
var exitMap = 990001100;
|
||||
var recruitMap = 101030104;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
var isPq = true;
|
||||
var minPlayers = 3, maxPlayers = 6;
|
||||
var minLevel = 10, maxLevel = 200;
|
||||
var minLevel = 10, maxLevel = 255;
|
||||
var entryMap = 910010000;
|
||||
var exitMap = 910010300;
|
||||
var recruitMap = 100000200;
|
||||
|
||||
208
scripts/event/LatanicaBattle.js
Normal file
208
scripts/event/LatanicaBattle.js
Normal file
@@ -0,0 +1,208 @@
|
||||
/**
|
||||
* @author: Ronan
|
||||
* @event: Vs Latanica
|
||||
*/
|
||||
|
||||
var isPq = true;
|
||||
var minPlayers = 1, maxPlayers = 6;
|
||||
var minLevel = 1, maxLevel = 255;
|
||||
var entryMap = 541010100;
|
||||
var exitMap = 541010110;
|
||||
var recruitMap = 541010060;
|
||||
var clearMap = 541010110;
|
||||
|
||||
var minMapId = 541010100;
|
||||
var maxMapId = 541010100;
|
||||
|
||||
var eventTime = 10; // 10 minutes
|
||||
|
||||
var lobbyRange = [0, 0];
|
||||
|
||||
function init() {
|
||||
setEventRequirements();
|
||||
}
|
||||
|
||||
function setLobbyRange() {
|
||||
return lobbyRange;
|
||||
}
|
||||
|
||||
function setEventRequirements() {
|
||||
var reqStr = "";
|
||||
|
||||
reqStr += "\r\n Number of players: ";
|
||||
if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers;
|
||||
else reqStr += minPlayers;
|
||||
|
||||
reqStr += "\r\n Level range: ";
|
||||
if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel;
|
||||
else reqStr += minLevel;
|
||||
|
||||
reqStr += "\r\n Time limit: ";
|
||||
reqStr += eventTime + " minutes";
|
||||
|
||||
em.setProperty("party", reqStr);
|
||||
}
|
||||
|
||||
function setEventExclusives(eim) {
|
||||
var itemSet = [];
|
||||
eim.setExclusiveItems(itemSet);
|
||||
}
|
||||
|
||||
function setEventRewards(eim) {
|
||||
var itemSet, itemQty, evLevel, expStages;
|
||||
|
||||
evLevel = 1; //Rewards at clear PQ
|
||||
itemSet = [];
|
||||
itemQty = [];
|
||||
eim.setEventRewards(evLevel, itemSet, itemQty);
|
||||
|
||||
expStages = []; //bonus exp given on CLEAR stage signal
|
||||
eim.setEventClearStageExp(expStages);
|
||||
}
|
||||
|
||||
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
|
||||
var eligible = [];
|
||||
var hasLeader = false;
|
||||
|
||||
if(party.size() > 0) {
|
||||
var partyList = party.toArray();
|
||||
|
||||
for(var i = 0; i < party.size(); i++) {
|
||||
var ch = partyList[i];
|
||||
|
||||
if(ch.getMapId() == recruitMap && ch.getLevel() >= minLevel && ch.getLevel() <= maxLevel) {
|
||||
if(ch.isLeader()) hasLeader = true;
|
||||
eligible.push(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
|
||||
return eligible;
|
||||
}
|
||||
|
||||
function setup(level, lobbyid) {
|
||||
var eim = em.newInstance("Latanica" + lobbyid);
|
||||
eim.setProperty("level", level);
|
||||
eim.setProperty("boss", "0");
|
||||
|
||||
eim.getInstanceMap(541010100).resetPQ(level);
|
||||
|
||||
respawnStages(eim);
|
||||
eim.startEventTimer(eventTime * 60000);
|
||||
setEventRewards(eim);
|
||||
setEventExclusives(eim);
|
||||
return eim;
|
||||
}
|
||||
|
||||
function afterSetup(eim) {}
|
||||
|
||||
function respawnStages(eim) {}
|
||||
|
||||
function playerEntry(eim, player) {
|
||||
var map = eim.getMapInstance(entryMap);
|
||||
player.changeMap(map, map.getPortal(0));
|
||||
}
|
||||
|
||||
function scheduledTimeout(eim) {
|
||||
end(eim);
|
||||
}
|
||||
|
||||
function playerUnregistered(eim, player) {}
|
||||
|
||||
function playerExit(eim, player) {
|
||||
eim.unregisterPlayer(player);
|
||||
player.changeMap(exitMap, 0);
|
||||
}
|
||||
|
||||
function changedMap(eim, player, mapid) {
|
||||
if (mapid < minMapId || mapid > maxMapId) {
|
||||
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||
eim.unregisterPlayer(player);
|
||||
end(eim);
|
||||
}
|
||||
else
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
function changedLeader(eim, leader) {
|
||||
var mapid = leader.getMapId();
|
||||
if (!eim.isEventCleared() && (mapid < minMapId || mapid > maxMapId)) {
|
||||
end(eim);
|
||||
}
|
||||
}
|
||||
|
||||
function playerDead(eim, player) {}
|
||||
|
||||
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
||||
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||
eim.unregisterPlayer(player);
|
||||
end(eim);
|
||||
}
|
||||
else
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
|
||||
function playerDisconnected(eim, player) {
|
||||
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||
eim.unregisterPlayer(player);
|
||||
end(eim);
|
||||
}
|
||||
else
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
|
||||
function leftParty(eim, player) {
|
||||
if (eim.isEventTeamLackingNow(false, minPlayers, player)) {
|
||||
eim.unregisterPlayer(player);
|
||||
end(eim);
|
||||
}
|
||||
else
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
|
||||
function disbandParty(eim) {
|
||||
end(eim);
|
||||
}
|
||||
|
||||
function monsterValue(eim, mobId) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
function end(eim) {
|
||||
var party = eim.getPlayers();
|
||||
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
playerExit(eim, party.get(i));
|
||||
}
|
||||
eim.dispose();
|
||||
}
|
||||
|
||||
function giveRandomEventReward(eim, player) {
|
||||
eim.giveEventReward(player);
|
||||
}
|
||||
|
||||
function clearPQ(eim) {
|
||||
eim.stopEventTimer();
|
||||
eim.setEventCleared();
|
||||
}
|
||||
|
||||
function isLatanica(mob) {
|
||||
var mobid = mob.getId();
|
||||
return mobid == 9420513;
|
||||
}
|
||||
|
||||
function monsterKilled(mob, eim) {
|
||||
if(isLatanica(mob)) {
|
||||
eim.showClearEffect();
|
||||
eim.clearPQ();
|
||||
}
|
||||
}
|
||||
|
||||
function allMonstersDead(eim) {}
|
||||
|
||||
function cancelSchedule() {}
|
||||
|
||||
function dispose(eim) {}
|
||||
|
||||
@@ -257,8 +257,13 @@ function clearPQ(eim) {
|
||||
eim.warpEventTeam(925100600);
|
||||
}
|
||||
|
||||
function isLordPirate(mob) {
|
||||
var mobid = mob.getId();
|
||||
return (mobid == 9300105) || (mobid == 9300106) || (mobid == 9300107) || (mobid == 9300119);
|
||||
}
|
||||
|
||||
function monsterKilled(mob, eim) {
|
||||
if(mob.isBoss()) { // lord pirate defeated, spawn the little fella!
|
||||
if(isLordPirate(mob)) { // lord pirate defeated, spawn the little fella!
|
||||
mob.getMap().broadcastStringMessage(5, "As Lord Pirate dies, Wu Yang is released!");
|
||||
eim.spawnNpc(2094001, new java.awt.Point(777, 140), mob.getMap());
|
||||
}
|
||||
|
||||
@@ -1,163 +1,188 @@
|
||||
/*
|
||||
* 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>
|
||||
/**
|
||||
* @author: Ronan
|
||||
* @event: Scarga Battle
|
||||
*/
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License version 3
|
||||
as published by the Free Software Foundation. You may not use, modify
|
||||
or distribute this program under any other version of the
|
||||
GNU Affero General Public License.
|
||||
var isPq = true;
|
||||
var minPlayers = 6, maxPlayers = 30;
|
||||
var minLevel = 70, maxLevel = 255;
|
||||
var entryMap = 551030200;
|
||||
var exitMap = 551030100;
|
||||
var recruitMap = 551030100;
|
||||
var clearMap = 551030100;
|
||||
|
||||
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.
|
||||
var minMapId = 551030200;
|
||||
var maxMapId = 551030200;
|
||||
|
||||
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 eventTime = 60; // 60 minutes for boss stg
|
||||
|
||||
/*
|
||||
* @Author SharpAceX(Alan)
|
||||
* Scarga Battle
|
||||
*/
|
||||
|
||||
var exitMap;
|
||||
var battleMap;
|
||||
var minPlayers = 1;
|
||||
var fightTime = 60;
|
||||
var lobbyRange = [0, 0];
|
||||
|
||||
function init() {
|
||||
em.setProperty("shuffleReactors","false");
|
||||
exitMap = em.getChannelServer().getMapFactory().getMap(551030100);
|
||||
battleMap = em.getChannelServer().getMapFactory().getMap(551030200);
|
||||
setEventRequirements();
|
||||
}
|
||||
|
||||
function setup() {
|
||||
var eim = em.newInstance("ScargaBattle_" + em.getProperty("channel"));
|
||||
var timer = 1000 * 60 * fightTime;
|
||||
eim.setProperty("summoned", "false");
|
||||
em.schedule("timeOut", eim, timer);
|
||||
eim.startEventTimer(timer);
|
||||
return eim;
|
||||
function setLobbyRange() {
|
||||
return lobbyRange;
|
||||
}
|
||||
|
||||
function setEventRequirements() {
|
||||
var reqStr = "";
|
||||
|
||||
reqStr += "\r\n Number of players: ";
|
||||
if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers;
|
||||
else reqStr += minPlayers;
|
||||
|
||||
reqStr += "\r\n Level range: ";
|
||||
if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel;
|
||||
else reqStr += minLevel;
|
||||
|
||||
reqStr += "\r\n Time limit: ";
|
||||
reqStr += eventTime + " minutes";
|
||||
|
||||
em.setProperty("party", reqStr);
|
||||
}
|
||||
|
||||
function setEventExclusives(eim) {
|
||||
var itemSet = [];
|
||||
eim.setExclusiveItems(itemSet);
|
||||
}
|
||||
|
||||
function setEventRewards(eim) {
|
||||
var itemSet, itemQty, evLevel, expStages, mesoStages;
|
||||
|
||||
evLevel = 1; //Rewards at clear PQ
|
||||
itemSet = [];
|
||||
itemQty = [];
|
||||
eim.setEventRewards(evLevel, itemSet, itemQty);
|
||||
|
||||
expStages = []; //bonus exp given on CLEAR stage signal
|
||||
eim.setEventClearStageExp(expStages);
|
||||
|
||||
mesoStages = []; //bonus meso given on CLEAR stage signal
|
||||
eim.setEventClearStageMeso(mesoStages);
|
||||
}
|
||||
|
||||
function afterSetup(eim) {}
|
||||
|
||||
function playerEntry(eim,player) {
|
||||
var battle = eim.getMapInstance(battleMap.getId());
|
||||
player.changeMap(battle, battle.getPortal(0));
|
||||
function setup(channel) {
|
||||
var eim = em.newInstance("Scarga" + channel);
|
||||
eim.setProperty("canJoin", 1);
|
||||
eim.setProperty("defeatedBoss", 1);
|
||||
|
||||
if (battle == null)
|
||||
debug(eim, "The battle map was not properly linked.");
|
||||
var level = 1;
|
||||
eim.getInstanceMap(551030200).resetPQ(level);
|
||||
|
||||
eim.startEventTimer(eventTime * 60000);
|
||||
setEventRewards(eim);
|
||||
setEventExclusives(eim);
|
||||
|
||||
return eim;
|
||||
}
|
||||
|
||||
function playerRevive(eim,player) {
|
||||
player.setHp(500);
|
||||
player.setStance(0);
|
||||
eim.unregisterPlayer(player);
|
||||
player.changeMap(exitMap, exitMap.getPortal(0));
|
||||
var exped = eim.getPlayers();
|
||||
if (exped.size() < minPlayers)
|
||||
end(eim,"There are not enough players remaining, the battle is over.");
|
||||
return false;
|
||||
function playerEntry(eim, player) {
|
||||
eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
|
||||
var map = eim.getMapInstance(entryMap);
|
||||
player.changeMap(map, map.getPortal(0));
|
||||
}
|
||||
|
||||
function playerDead(eim,player) {
|
||||
function scheduledTimeout(eim) {
|
||||
end(eim);
|
||||
}
|
||||
|
||||
function playerDisconnected(eim,player) {
|
||||
var exped = eim.getPlayers();
|
||||
if (player.getName().equals(eim.getProperty("leader"))) {
|
||||
var iter = exped.iterator();
|
||||
while (iter.hasNext()) {
|
||||
iter.next().getPlayer().dropMessage(6, "The leader of the expedition has disconnected.");
|
||||
}
|
||||
}
|
||||
//If the expedition is too small.
|
||||
if (exped.size() < minPlayers) {
|
||||
end(eim,"There are not enough players remaining. The Battle is over.");
|
||||
function changedMap(eim, player, mapid) {
|
||||
if (mapid < minMapId || mapid > maxMapId) {
|
||||
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||
eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
|
||||
eim.unregisterPlayer(player);
|
||||
end(eim);
|
||||
}
|
||||
else {
|
||||
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function monsterValue(eim,mobId) { // potentially display time of death? does not seem to work
|
||||
return -1;
|
||||
function changedLeader(eim, leader) {}
|
||||
|
||||
function playerDead(eim, player) {}
|
||||
|
||||
function playerRevive(eim, player) {
|
||||
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||
eim.unregisterPlayer(player);
|
||||
eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
|
||||
end(eim);
|
||||
}
|
||||
else {
|
||||
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
function leftParty(eim,player) {
|
||||
function playerDisconnected(eim, player) {
|
||||
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||
eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
|
||||
eim.unregisterPlayer(player);
|
||||
end(eim);
|
||||
}
|
||||
else {
|
||||
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
|
||||
eim.unregisterPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
function disbandParty(eim) {
|
||||
function leftParty (eim, player) {}
|
||||
|
||||
function disbandParty (eim) {}
|
||||
|
||||
function monsterValue(eim, mobId) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
function playerUnregistered(eim, player) {}
|
||||
|
||||
function playerExit(eim,player) {
|
||||
function playerExit(eim, player) {
|
||||
eim.unregisterPlayer(player);
|
||||
player.changeMap(exitMap, exitMap.getPortal(0));
|
||||
if (eim.getPlayers().size() < minPlayers) {//not enough after someone left
|
||||
end(eim, "There are no longer enough players to continue, and those remaining shall be warped out.");
|
||||
}
|
||||
player.changeMap(exitMap, 0);
|
||||
}
|
||||
|
||||
function end(eim,msg) {
|
||||
var iter = eim.getPlayers().iterator();
|
||||
while (iter.hasNext()) {
|
||||
var player = iter.next();
|
||||
player.getPlayer().dropMessage(6,msg);
|
||||
eim.unregisterPlayer(player);
|
||||
if (player != null){
|
||||
player.changeMap(exitMap, exitMap.getPortal(0));
|
||||
}
|
||||
function end(eim) {
|
||||
var party = eim.getPlayers();
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
playerExit(eim, party.get(i));
|
||||
}
|
||||
eim.dispose();
|
||||
}
|
||||
|
||||
function removePlayer(eim,player) {
|
||||
eim.unregisterPlayer(player);
|
||||
player.getMap().removePlayer(player);
|
||||
player.setMap(exitMap);
|
||||
function giveRandomEventReward(eim, player) {
|
||||
eim.giveEventReward(player);
|
||||
}
|
||||
|
||||
function clearPQ(eim) { //When the hell does this get executed?
|
||||
end(eim,"As the sound of battle fades away, you feel strangely unsatisfied.");
|
||||
function clearPQ(eim) {
|
||||
eim.stopEventTimer();
|
||||
eim.setEventCleared();
|
||||
}
|
||||
|
||||
function finish(eim) {
|
||||
var iter = eim.getPlayers().iterator();
|
||||
while (iter.hasNext()) {
|
||||
var player = iter.next();
|
||||
eim.unregisterPlayer(player);
|
||||
player.changeMap(exitMap, exitMap.getPortal(0));
|
||||
function isScarga(mob) {
|
||||
var mobid = mob.getId();
|
||||
return (mobid == 9420544) || (mobid == 9420549);
|
||||
}
|
||||
|
||||
function monsterKilled(mob, eim) {
|
||||
if(isScarga(mob)) {
|
||||
var killed = eim.getIntProperty("defeatedBoss");
|
||||
if(killed == 1) {
|
||||
eim.showClearEffect();
|
||||
eim.clearPQ();
|
||||
}
|
||||
|
||||
eim.setIntProperty("defeatedBoss", killed + 1);
|
||||
}
|
||||
eim.dispose();
|
||||
}
|
||||
|
||||
function monsterKilled(mob, eim) {}
|
||||
|
||||
function allMonstersDead(eim) {}
|
||||
|
||||
function cancelSchedule() {}
|
||||
|
||||
function timeOut(eim) {
|
||||
if (eim != null) {
|
||||
if (eim.getPlayerCount() > 0) {
|
||||
var pIter = eim.getPlayers().iterator();
|
||||
while (pIter.hasNext()){
|
||||
var player = pIter.next();
|
||||
player.dropMessage(6, "You have run out of time to defeat Scarlion and Targa!");
|
||||
playerExit(eim, player);
|
||||
}
|
||||
}
|
||||
eim.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
function debug(eim,msg) {
|
||||
var iter = eim.getPlayers().iterator();
|
||||
while (iter.hasNext()) {
|
||||
iter.next().getClient().getSession().write(Packages.tools.MaplePacketCreator.serverNotice(6,msg));
|
||||
}
|
||||
}
|
||||
function dispose(eim) {}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
63
scripts/portal/MD_high.js
Normal file
63
scripts/portal/MD_high.js
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
This file is part of the OdinMS Maple Story Server
|
||||
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
||||
Matthias Butz <matze@odinms.de>
|
||||
Jan Christian Meyer <vimes@odinms.de>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License version 3
|
||||
as published by the Free Software Foundation. You may not use, modify
|
||||
or distribute this program under any other version of the
|
||||
GNU Affero General Public License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
MiniDungeon - Longest Ride on ByeBye Station
|
||||
*/
|
||||
|
||||
var baseid = 551030000;
|
||||
var dungeonid = 551030001;
|
||||
var dungeons = 19;
|
||||
|
||||
function enter(pi) {
|
||||
if (pi.getMapId() == baseid) {
|
||||
if (pi.getPlayer().getFame() < 10) {
|
||||
pi.playerMessage(5, "You need 10 Fame to enter.");
|
||||
return;
|
||||
}
|
||||
if (pi.getParty() != null) {
|
||||
if (pi.isLeader()) {
|
||||
for (var i = 0; i < dungeons; i++) {
|
||||
if (pi.getPlayerCount(dungeonid + i) == 0) {
|
||||
pi.warpParty(dungeonid + i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
for (var i = 0; i < dungeons; i++) {
|
||||
if (pi.getPlayerCount(dungeonid + i) == 0) {
|
||||
pi.warp(dungeonid + i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
pi.playerMessage(5, "All of the Mini-Dungeons are in use right now, please try again later.");
|
||||
return false;
|
||||
} else {
|
||||
pi.playPortalSound();
|
||||
pi.warp(baseid, "MD00");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ function enter(pi) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pi.playerMessage(5, "You are not the leader of the party.");
|
||||
pi.playerMessage(5, "Only solo or party leaders are supposed to enter the Mini-Dungeon.");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,36 +1,32 @@
|
||||
//importPackage(server.maps);
|
||||
//importPackage(net.channel);
|
||||
//importPackage(tools);
|
||||
//
|
||||
//function enter(pi) {
|
||||
// var mapid = 541010100;
|
||||
// var map = ChannelServer.getInstance(pi.getPlayer().getClient().getChannel()).getMapFactory().getMap(mapid);
|
||||
// var mapchars = map.getCharacters();
|
||||
// if (mapchars.isEmpty()) {
|
||||
// var mapobjects = map.getMapObjects();
|
||||
// var iter = mapobjects.iterator();
|
||||
// while (iter.hasNext()) {
|
||||
// o = iter.next();
|
||||
// if (o.getType() == MapleMapObjectType.MONSTER){
|
||||
// map.removeMapObject(o);
|
||||
// }
|
||||
// }
|
||||
// map.resetReactors();
|
||||
// } else {
|
||||
// var mapobjects = map.getMapObjects();
|
||||
// var boss = null;
|
||||
// var iter = mapobjects.iterator();
|
||||
// while (iter.hasNext()) {
|
||||
// o = iter.next();
|
||||
// if (o.getType() == MapleMapObjectType.MONSTER){
|
||||
// boss = o;
|
||||
// }
|
||||
// }
|
||||
// if (boss != null) {
|
||||
// pi.getPlayer().dropMessage(5, "The battle against the boss has already begun, so you may not enter this place.");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// pi.warp(541010100, "sp");
|
||||
// return true;
|
||||
//}
|
||||
/* By RonanLana */
|
||||
|
||||
function enter(pi) {
|
||||
if (!pi.haveItem(4000381)) {
|
||||
pi.playerMessage(5, "You do not have White Essence.");
|
||||
return false;
|
||||
} else {
|
||||
var em = pi.getEventManager("LatanicaBattle");
|
||||
|
||||
if (pi.getParty() == null) {
|
||||
pi.playerMessage(5, "You are currently not in a party, create one to attempt the boss.");
|
||||
return false;
|
||||
} else if(!pi.isLeader()) {
|
||||
pi.playerMessage(5, "Your party leader must enter the portal to start the battle.");
|
||||
return false;
|
||||
} else {
|
||||
var eli = em.getEligibleParty(pi.getParty());
|
||||
if(eli.size() > 0) {
|
||||
if(!em.startInstance(pi.getParty(), pi.getPlayer().getMap(), 1)) {
|
||||
pi.playerMessage(5, "The battle against the boss has already begun, so you may not enter this place.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else { //this should never appear
|
||||
pi.playerMessage(5, "You cannot start this battle yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
pi.warp(300000012,0);
|
||||
pi.warp(300000012,"portal");
|
||||
return(true);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ function enter(pi) {
|
||||
var jailedTime = pi.getJailTimeLeft();
|
||||
|
||||
if(jailedTime <= 0) {
|
||||
pi.warp(300000010,0);
|
||||
pi.warp(300000010,"in01");
|
||||
return(true);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
function enter(pi) {
|
||||
try {
|
||||
pi.warp(pi.getPlayer().getSavedLocation("FREE_MARKET"));
|
||||
try {
|
||||
var toMap = pi.getPlayer().getSavedLocation("FREE_MARKET");
|
||||
pi.warp(toMap, pi.getMarketPortalId(toMap));
|
||||
} catch(err) {
|
||||
pi.warp(100000000);
|
||||
}
|
||||
|
||||
@@ -22,5 +22,6 @@
|
||||
function act(){
|
||||
rm.changeMusic("Bgm09/TimeAttack");
|
||||
rm.spawnMonster(9420513, -146, 225);
|
||||
rm.getEventInstance().setIntProperty("boss", 1);
|
||||
rm.mapMessage(5, "As you wish, here comes Capt Latanica.");
|
||||
}
|
||||
@@ -2,10 +2,14 @@
|
||||
* 5511000.js: Summons Targa.
|
||||
*/
|
||||
|
||||
function summonBoss() {
|
||||
rm.spawnMonster(9420542,-527,637);
|
||||
rm.changeMusic("Bgm09/TimeAttack");
|
||||
rm.mapMessage(6, "Beware! The furious Targa has shown himself!");
|
||||
}
|
||||
|
||||
function act() {
|
||||
if (rm.getReactor().getMap().getMonsterById(9420542) == null) {
|
||||
rm.spawnMonster(9420542,-527,637);
|
||||
rm.changeMusic("Bgm09/TimeAttack");
|
||||
rm.mapMessage(6, "Beware! The furious Targa has shown himself!");
|
||||
rm.schedule("summonBoss", 3200);
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,14 @@
|
||||
* 5511001.js: Summons Scarlion.
|
||||
*/
|
||||
|
||||
function summonBoss() {
|
||||
rm.spawnMonster(9420547,-238,636);
|
||||
rm.changeMusic("Bgm09/TimeAttack");
|
||||
rm.mapMessage(6, "Beware! The furious Scarlion has shown himself!");
|
||||
}
|
||||
|
||||
function act() {
|
||||
if (rm.getReactor().getMap().getMonsterById(9420547) == null) {
|
||||
rm.spawnMonster(9420547,-238,636);
|
||||
rm.changeMusic("Bgm09/TimeAttack");
|
||||
rm.mapMessage(6, "Beware! The furious Scarlion has shown himself!");
|
||||
rm.schedule("summonBoss", 3200);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user