MagatiaPQ + several minor fixes

Added MagatiaPQ. Fixed a bug on Dojo where parties quitting the boss
fight without completing until rest point couldn't not start Dojo again
w/o reforming the party. Fixed issues with 2nd job NPC scripts. Reverted
command layout to use "!" and "@" again.
This commit is contained in:
ronancpl
2017-08-11 12:41:35 -03:00
parent f78defec1f
commit e0a27e00ab
185 changed files with 3316 additions and 527 deletions

View File

@@ -1,4 +1,4 @@
#Sat, 05 Aug 2017 19:11:00 -0300
#Fri, 11 Aug 2017 12:31:17 -0300
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=

Binary file not shown.

BIN
dist/MapleSolaxia.jar vendored

Binary file not shown.

View File

@@ -3,12 +3,21 @@ Credits:
Ronan - Freelance Developer
Vcoc - Freelance Developer
---------------------------
DISCLAIMER:
---------------------------
This is NOT intended to be a PURE v83 MapleStory server emulator (acting
under the clean WZ files, provided by Nexon/Wizet). There has been provided
a whole array of edited WZ on the Drive to be used for this server. Although
normal WZs will load properly, there is no guarantee in-game bugs and issues
may arise because of some incompatibilities with the clean files.
---------------------------
Feature list:
---------------------------
PQs:
* HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ/HorntailPQ 100%.
* HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ/MagatiaPQ/HorntailPQ 100%.
* CWKPQ as Expedition-based event 100%.
* Expeditions: Scarga/Horntail/Showa/Zakum/Pinkbean 100%.
* GuildPQ 100% + Guild queue with multi-lobby systems available.
@@ -63,6 +72,6 @@ Project:
* Organized project code.
* Highly configurable server (see all server flags at ServerConstants).
* Fixed/added some missing packets for MoveEnvironment, summons and others.
* Reviewed some Java object aspects that needed concurrency protection.
* Reviewed many Java object aspects that needed concurrency protection.
---------------------------

View File

@@ -433,4 +433,9 @@ Ap
Novo scroll: antibanish. Retorna ao local de onde foi banido pela ultima vez.
Resolvido alguns problemas de concorrência com MapleMapFactory.
Removidos drops inexistentes da DB.
Resolvido problema com GMs de level alto recebendo bloqueio MWLB.
Resolvido problema com GMs de level alto recebendo bloqueio MWLB.
07 - 10 Agosto 2017,
Adicionada Magatia PQ.
Resolvido bug no Dojo impedindo mesma party de tentar entrar de novo se saiu sem acabá-la.
Resolvido bugs nos scripts de 2nd job.

View File

@@ -3,15 +3,7 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/TimerManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapMonitor.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapItem.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AbstractDealDamageHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/Channel.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
</group>
</open-files>
</project-private>

View File

@@ -32,10 +32,12 @@ function start() {
}
function action(mode, type, selection) {
//print("mode" + mode + "type " + type + " selection" + selection + "\n");
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
if (mode == 0 && type > 0) { // hope types 2 & 3 works as well, as 1 and 4 END CHAT
cm.dispose();
return;
}

View File

@@ -88,6 +88,10 @@ function timeOut(eim) {
function monsterKilled(mob, eim) {}
function friendlyKilled(mob, eim) {
// Happens when a friendly mob dies
}
function allMonstersDead(eim) {
// When invoking unregisterMonster(MapleMonster mob) OR killed
// Happens only when size = 0
@@ -134,7 +138,7 @@ function disbandParty(eim, player) {
}
function removePlayer(eim, player) {
// Happens when the funtion NPCConversationalManager.removePlayerFromInstance() is invoked
// Happens when the funtion NPCConversationManager.removePlayerFromInstance() is invoked
}
function registerCarnivalParty(eim, carnivalparty) {

View File

@@ -0,0 +1,395 @@
/**
* @author: Ronan
* @event: Magatia PQ (Alcadno)
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 4, maxPlayers = 4;
var minLevel = 71, maxLevel = 85;
var entryMap = 926110000;
var exitMap = 926110700;
var recruitMap = 261000021;
var clearMap = 926110700;
var minMapId = 926110000;
var maxMapId = 926110600;
var eventTime = 45; // 45 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 = [4001130, 4001131, 4001132, 4001133, 4001134, 4001135];
eim.setExclusiveItems(itemSet);
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages;
evLevel = 1; //Rewards at clear PQ
itemSet = [2000003, 2000002, 2000004, 2000005, 2022003, 1032016, 1032015, 1032014, 2041212, 2041020, 2040502, 2041016, 2044701, 2040301, 2043201, 2040501, 2040704, 2044001, 2043701, 2040803, 1102026, 1102028, 1102029];
itemQty = [100, 100, 20, 10, 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = [0, 10000, 20000, 0, 20000, 20000, 0, 0]; //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("MagatiaA" + lobbyid);
eim.setProperty("level", level);
eim.setIntProperty("isAlcadno", 1);
eim.setIntProperty("escortFail", 0);
eim.setIntProperty("yuleteTimeout", 0);
eim.setIntProperty("yuleteTalked", 0);
eim.setIntProperty("yuletePassed", 0);
eim.setIntProperty("npcShocked", 0);
eim.setIntProperty("normalClear", 0);
eim.setIntProperty("statusStg1", 0);
eim.setIntProperty("statusStg2", 0);
eim.setIntProperty("statusStg3", 0);
eim.setIntProperty("statusStg4", 0);
eim.setIntProperty("statusStg5", 0);
eim.setIntProperty("statusStg6", 0);
eim.setIntProperty("statusStg7", 0);
eim.getInstanceMap(926110000).resetPQ(level);
eim.getInstanceMap(926110001).resetPQ(level);
eim.getInstanceMap(926110100).resetPQ(level);
eim.getInstanceMap(926110200).resetPQ(level);
eim.getInstanceMap(926110201).resetPQ(level);
eim.getInstanceMap(926110202).resetPQ(level);
eim.getInstanceMap(926110203).resetPQ(level);
eim.getInstanceMap(926110300).resetPQ(level);
eim.getInstanceMap(926110301).resetPQ(level);
eim.getInstanceMap(926110302).resetPQ(level);
eim.getInstanceMap(926110303).resetPQ(level);
eim.getInstanceMap(926110304).resetPQ(level);
eim.getInstanceMap(926110400).resetPQ(level);
eim.getInstanceMap(926110401).resetPQ(level);
eim.getInstanceMap(926110500).resetPQ(level);
eim.getInstanceMap(926110600).resetPQ(level);
eim.getInstanceMap(926110700).resetPQ(level);
eim.getInstanceMap(926110201).shuffleReactors(2518000, 2612004);
eim.getInstanceMap(926110202).shuffleReactors(2518000, 2612004);
eim.spawnNpc(2112010, new java.awt.Point(252, 243), eim.getInstanceMap(926110203));
eim.spawnNpc(2112010, new java.awt.Point(200, 100), eim.getInstanceMap(926110401));
eim.spawnNpc(2112011, new java.awt.Point(200, 100), eim.getInstanceMap(926110500));
eim.spawnNpc(2112018, new java.awt.Point(200, 100), eim.getInstanceMap(926110600));
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
function afterSetup(eim) {
eim.setIntProperty("escortFail", 0); // refresh friendly status
var books = [-1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 2, 3];
shuffle(books);
eim.setIntProperty("stg1_b0", books[0]);
eim.setIntProperty("stg1_b1", books[1]);
eim.setIntProperty("stg1_b2", books[2]);
eim.setIntProperty("stg1_b3", books[3]);
eim.setIntProperty("stg1_b4", books[4]);
eim.setIntProperty("stg1_b5", books[5]);
eim.setIntProperty("stg1_b6", books[6]);
eim.setIntProperty("stg1_b7", books[7]);
eim.setIntProperty("stg1_b8", books[8]);
eim.setIntProperty("stg1_b9", books[9]);
eim.setIntProperty("stg1_b10", books[10]);
eim.setIntProperty("stg1_b11", books[11]);
eim.setIntProperty("stg1_b12", books[12]);
eim.setIntProperty("stg1_b13", books[13]);
eim.setIntProperty("stg1_b14", books[14]);
eim.setIntProperty("stg1_b15", books[15]);
eim.setIntProperty("stg1_b16", books[16]);
eim.setIntProperty("stg1_b17", books[17]);
eim.setIntProperty("stg1_b18", books[18]);
eim.setIntProperty("stg1_b19", books[19]);
eim.setIntProperty("stg1_b20", books[20]);
eim.setIntProperty("stg1_b21", books[21]);
eim.setIntProperty("stg1_b22", books[22]);
eim.setIntProperty("stg1_b23", books[23]);
eim.setIntProperty("stg1_b24", books[24]);
eim.setIntProperty("stg1_b25", books[25]);
}
function respawnStages(eim) {
eim.getMapInstance(926110100).instanceMapRespawn();
eim.getMapInstance(926110200).instanceMapRespawn();
if(!eim.isEventCleared()) {
var mapobj = eim.getMapInstance(926110401);
var mobcount = mapobj.countMonster(9300150);
var mobobj;
if(mobcount == 0) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-278, -126));
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
} else if(mobcount == 1) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
}
}
eim.schedule("respawnStages", 15 * 1000);
}
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);
} else if(mapid == 926110203 && eim.getIntProperty("yuleteTimeout") == 0) {
eim.setIntProperty("yuleteTimeout", 1);
eim.schedule("yuleteAction", 10 * 1000);
}
}
function yuleteAction(eim) {
if(eim.getIntProperty("yuleteTalked") == 1) {
eim.setIntProperty("yuletePassed", 1);
eim.dropMessage(5, "Yulete: Ugh, you guys disgust me. All I desired was to make this nation the greatest alchemy powerhouse of the entire world. If they won't accept this, I will make it true by myself, at any costs!!!");
} else {
eim.dropMessage(5, "Yulete: Hahaha... Did you really think I was going to be so disprepared knowing that the Magatia societies' dogs would be coming in my pursuit after my actions? Fools!");
}
eim.setIntProperty("yuleteTalked", -1);
var mapobj = eim.getMapInstance(926110203);
var mob1 = 9300143, mob2 = 9300144;
mapobj.destroyNPC(2112010);
var mobobj1, mobobj2;
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(-455, 135));
}
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(0, 135));
}
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(360, 135));
}
}
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 monsterKilled(mob, eim) {
var map = mob.getMap();
if(map.getId() == 926110001 && eim.getIntProperty("statusStg1") == 1) {
if(map.countMonsters() == 0) {
eim.showClearEffect();
eim.giveEventPlayersStageReward(2);
eim.setIntProperty("statusStg2", 1);
}
}
else if(map.getId() == 926110203 && eim.getIntProperty("statusStg1") == 1) {
if(map.countMonsters() == 0) {
eim.showClearEffect();
eim.giveEventPlayersStageReward(5);
map.getReactorByName("jnr6_out").forceHitReactor(1);
}
} else if(mob.getId() == 9300151 || mob.getId() == 9300152) {
eim.showClearEffect();
eim.giveEventPlayersStageReward(7);
eim.spawnNpc(2112005, new java.awt.Point(-370, -150), map);
var gain = (eim.getIntProperty("escortFail") == 1) ? 90000 : ((mob.getId() == 9300139) ? 105000 : 140000);
eim.giveEventPlayersExp(gain);
map.killAllMonstersNotFriendly();
if(mob.getId() == 9300139) {
eim.setIntProperty("normalClear", 1);
}
eim.clearPQ();
}
}
function friendlyKilled(mob, eim) {
eim.setIntProperty("escortFail", 1);
}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -0,0 +1,395 @@
/**
* @author: Ronan
* @event: Magatia PQ (Zenumist)
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 4, maxPlayers = 4;
var minLevel = 71, maxLevel = 85;
var entryMap = 926100000;
var exitMap = 926100700;
var recruitMap = 261000011;
var clearMap = 926100700;
var minMapId = 926100000;
var maxMapId = 926100600;
var eventTime = 45; // 45 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 = [4001130, 4001131, 4001132, 4001133, 4001134, 4001135];
eim.setExclusiveItems(itemSet);
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages;
evLevel = 1; //Rewards at clear PQ
itemSet = [2000003, 2000002, 2000004, 2000005, 2022003, 1032016, 1032015, 1032014, 2041212, 2041020, 2040502, 2041016, 2044701, 2040301, 2043201, 2040501, 2040704, 2044001, 2043701, 2040803, 1102026, 1102028, 1102029];
itemQty = [100, 100, 20, 10, 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = [0, 10000, 20000, 0, 20000, 20000, 0, 0]; //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("MagatiaZ" + lobbyid);
eim.setProperty("level", level);
eim.setIntProperty("isAlcadno", 0);
eim.setIntProperty("escortFail", 0);
eim.setIntProperty("yuleteTimeout", 0);
eim.setIntProperty("yuleteTalked", 0);
eim.setIntProperty("yuletePassed", 0);
eim.setIntProperty("npcShocked", 0);
eim.setIntProperty("normalClear", 0);
eim.setIntProperty("statusStg1", 0);
eim.setIntProperty("statusStg2", 0);
eim.setIntProperty("statusStg3", 0);
eim.setIntProperty("statusStg4", 0);
eim.setIntProperty("statusStg5", 0);
eim.setIntProperty("statusStg6", 0);
eim.setIntProperty("statusStg7", 0);
eim.getInstanceMap(926100000).resetPQ(level);
eim.getInstanceMap(926100001).resetPQ(level);
eim.getInstanceMap(926100100).resetPQ(level);
eim.getInstanceMap(926100200).resetPQ(level);
eim.getInstanceMap(926100201).resetPQ(level);
eim.getInstanceMap(926100202).resetPQ(level);
eim.getInstanceMap(926100203).resetPQ(level);
eim.getInstanceMap(926100300).resetPQ(level);
eim.getInstanceMap(926100301).resetPQ(level);
eim.getInstanceMap(926100302).resetPQ(level);
eim.getInstanceMap(926100303).resetPQ(level);
eim.getInstanceMap(926100304).resetPQ(level);
eim.getInstanceMap(926100400).resetPQ(level);
eim.getInstanceMap(926100401).resetPQ(level);
eim.getInstanceMap(926100500).resetPQ(level);
eim.getInstanceMap(926100600).resetPQ(level);
eim.getInstanceMap(926100700).resetPQ(level);
eim.getInstanceMap(926100201).shuffleReactors(2518000, 2612004);
eim.getInstanceMap(926100202).shuffleReactors(2518000, 2612004);
eim.spawnNpc(2112000, new java.awt.Point(252, 243), eim.getInstanceMap(926100203));
eim.spawnNpc(2112000, new java.awt.Point(200, 100), eim.getInstanceMap(926100401));
eim.spawnNpc(2112001, new java.awt.Point(200, 100), eim.getInstanceMap(926100500));
eim.spawnNpc(2112018, new java.awt.Point(200, 100), eim.getInstanceMap(926100600));
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
// And swap it with the current element.
temporaryValue = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = temporaryValue;
}
return array;
}
function afterSetup(eim) {
eim.setIntProperty("escortFail", 0); // refresh friendly status
var books = [-1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 2, 3];
shuffle(books);
eim.setIntProperty("stg1_b0", books[0]);
eim.setIntProperty("stg1_b1", books[1]);
eim.setIntProperty("stg1_b2", books[2]);
eim.setIntProperty("stg1_b3", books[3]);
eim.setIntProperty("stg1_b4", books[4]);
eim.setIntProperty("stg1_b5", books[5]);
eim.setIntProperty("stg1_b6", books[6]);
eim.setIntProperty("stg1_b7", books[7]);
eim.setIntProperty("stg1_b8", books[8]);
eim.setIntProperty("stg1_b9", books[9]);
eim.setIntProperty("stg1_b10", books[10]);
eim.setIntProperty("stg1_b11", books[11]);
eim.setIntProperty("stg1_b12", books[12]);
eim.setIntProperty("stg1_b13", books[13]);
eim.setIntProperty("stg1_b14", books[14]);
eim.setIntProperty("stg1_b15", books[15]);
eim.setIntProperty("stg1_b16", books[16]);
eim.setIntProperty("stg1_b17", books[17]);
eim.setIntProperty("stg1_b18", books[18]);
eim.setIntProperty("stg1_b19", books[19]);
eim.setIntProperty("stg1_b20", books[20]);
eim.setIntProperty("stg1_b21", books[21]);
eim.setIntProperty("stg1_b22", books[22]);
eim.setIntProperty("stg1_b23", books[23]);
eim.setIntProperty("stg1_b24", books[24]);
eim.setIntProperty("stg1_b25", books[25]);
}
function respawnStages(eim) {
eim.getMapInstance(926100100).instanceMapRespawn();
eim.getMapInstance(926100200).instanceMapRespawn();
if(!eim.isEventCleared()) {
var mapobj = eim.getMapInstance(926100401);
var mobcount = mapobj.countMonster(9300150);
var mobobj;
if(mobcount == 0) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-278, -126));
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
} else if(mobcount == 1) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
}
}
eim.schedule("respawnStages", 15 * 1000);
}
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);
} else if(mapid == 926100203 && eim.getIntProperty("yuleteTimeout") == 0) {
eim.setIntProperty("yuleteTimeout", 1);
eim.schedule("yuleteAction", 10 * 1000);
}
}
function yuleteAction(eim) {
if(eim.getIntProperty("yuleteTalked") == 1) {
eim.setIntProperty("yuletePassed", 1);
eim.dropMessage(5, "Yulete: Ugh, you guys disgust me. All I desired was to make this nation the greatest alchemy powerhouse of the entire world. If they won't accept this, I will make it true by myself, at any costs!!!");
} else {
eim.dropMessage(5, "Yulete: Hahaha... Did you really think I was going to be so disprepared knowing that the Magatia societies' dogs would be coming in my pursuit after my actions? Fools!");
}
eim.setIntProperty("yuleteTalked", -1);
var mapobj = eim.getMapInstance(926100203);
var mob1 = 9300143, mob2 = 9300144;
mapobj.destroyNPC(2112000);
var mobobj1, mobobj2;
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(-455, 135));
}
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(0, 135));
}
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(360, 135));
}
}
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 monsterKilled(mob, eim) {
var map = mob.getMap();
if(map.getId() == 926100001 && eim.getIntProperty("statusStg1") == 1) {
if(map.countMonsters() == 0) {
eim.showClearEffect();
eim.giveEventPlayersStageReward(2);
eim.setIntProperty("statusStg2", 1);
}
}
else if(map.getId() == 926100203 && eim.getIntProperty("statusStg1") == 1) {
if(map.countMonsters() == 0) {
eim.showClearEffect();
eim.giveEventPlayersStageReward(5);
map.getReactorByName("rnj6_out").forceHitReactor(1);
}
} else if(mob.getId() == 9300139 || mob.getId() == 9300140) {
eim.showClearEffect();
eim.giveEventPlayersStageReward(7);
eim.spawnNpc(2112006, new java.awt.Point(-370, -150), map);
var gain = (eim.getIntProperty("escortFail") == 1) ? 90000 : ((mob.getId() == 9300139) ? 105000 : 140000);
eim.giveEventPlayersExp(gain);
map.killAllMonstersNotFriendly();
if(mob.getId() == 9300139) {
eim.setIntProperty("normalClear", 1);
}
eim.clearPQ();
}
}
function friendlyKilled(mob, eim) {
eim.setIntProperty("escortFail", 1);
}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -216,7 +216,7 @@ function monsterKilled(mob, eim) {
if(isPinkBean(mob)) {
eim.setIntProperty("defeatedBoss", 1);
eim.showClearEffect(mob.getMap().getId());
mob.getMap().killAllMonstersNotFriendly();
mob.getMap().killAllMonsters();
eim.clearPQ();
var ch = eim.getIntProperty("channel");

View File

@@ -166,7 +166,7 @@ function giveRandomEventReward(eim, player) {
}
function clearPQ(eim) {
eim.getInstanceMap(801040100).killAllMonstersNotFriendly();
eim.getInstanceMap(801040100).killAllMonsters();
eim.stopEventTimer();
eim.setEventCleared();

View File

@@ -20,7 +20,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
*@Author: Moogra, Traitor
*@Author: Moogra, Traitor, Ronan
*@Map(s): All Dojo fighting maps
*@Function: Spawns dojo monsters and handles time
*/
@@ -28,21 +28,23 @@
function start(ms) {
ms.getPlayer().resetEnteredScript();
var stage = (ms.getPlayer().getMap().getId() / 100) % 100;
if (stage % 6 == 1)
ms.getPlayer().setDojoStart();
if (ms.getPlayer().getMap().getCharacters().size() == 1)
ms.getPlayer().showDojoClock();
var stage = Math.floor(ms.getMapId() / 100) % 100;
var callBoss = false;
if (stage % 6 == 1) {
ms.getClient().getChannelServer().startDojoSchedule(ms.getMapId());
} else if(stage % 6 == 0) {
ms.getClient().getChannelServer().dismissDojoSchedule(ms.getMapId(), ms.getParty());
}
callBoss = ms.getClient().getChannelServer().setDojoProgress(ms.getMapId());
if (stage % 6 > 0) {
var realstage = stage - ((stage / 6) | 0);
ms.dojoEnergy();
var mob = ms.getMonsterLifeFactory(9300183 + realstage);
if (mob != null && ms.getPlayer().getMap().getMonsterById(9300183 + realstage) == null && ms.getPlayer().getMap().getMonsterById(9300216) == null) {
if (callBoss && mob != null && ms.getPlayer().getMap().getMonsterById(9300216) == null) {
mob.setBoss(false);
ms.getPlayer().getMap().spawnDojoMonster(mob);
ms.playSound("Dojang/start");
ms.showEffect("dojang/start/stage");
ms.showEffect("dojang/start/number/" + realstage);
}
}
}

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Boats";
var toMap = 200090010;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Boats";
var toMap = 200090000;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Trains";
var toMap = 200090100;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Cabin";
var toMap = 200090200;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Genie";
var toMap = 200090400;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Trains";
var toMap = 200090110;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Cabin";
var toMap = 200090210;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Genie";
var toMap = 200090410;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "AirPlane";
var toMap = 540010002;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "AirPlane";
var toMap = 540010101;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Subway";
var toMap = 600010003;

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var eventName = "Subway";
var toMap = 600010005;

View File

@@ -20,8 +20,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* @author Traitor
*/
function start(ms) {
*@Author: Moogra, Traitor, Ronan
*@Map(s): All Dojo fighting maps
*@Function: Displays info for the player when entering a dojo map
*/
function start(ms) {
ms.getPlayer().resetEnteredScript();
var stage = Math.floor(ms.getPlayer().getMap().getId() / 100) % 100;
ms.getPlayer().showDojoClock();
if (stage % 6 > 0) {
var realstage = stage - ((stage / 6) | 0);
ms.dojoEnergy();
ms.playSound("Dojang/start");
ms.showEffect("dojang/start/stage");
ms.showEffect("dojang/start/number/" + realstage);
}
}

View File

@@ -24,47 +24,57 @@
Victoria Road : West Rocky Mountain IV (102020300)
*/
var status = 0;
var status;
function start() {
if (cm.isQuestCompleted(100004)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if (cm.isQuestStarted(100003)) {
cm.completeQuest(100003);
cm.sendNext("Hmmm...it is definitely the letter from #bDances with Balrog#k...so you came all the way here to take the test and make the 2nd job advancement as the warrior. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated.");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 1)
status++;
else
status--;
if (status == 0 && cm.isQuestStarted(100003))
status = 5;
else if (status == 1)
cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item.");
else if (status == 2)
cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test.");
else if (status == 3)
cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease..so you better really buckle up and get ready...well, do you want to go for it now?");
else if (status == 4) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
cm.startQuest(100004);
cm.gainItem(4031008, -1);
}
else if (status == 5) {
cm.warp(108000300, 0);
cm.dispose();
} else {
cm.dispose();
}
}
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.isQuestCompleted(100004)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if(cm.isQuestCompleted(100003)) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
status = 4;
} else if (cm.isQuestStarted(100003)) {
cm.sendNext("Hmmm...it is definitely the letter from #bDances with Balrog#k...so you came all the way here to take the test and make the 2nd job advancement as the warrior. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated.");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
}
else if (status == 1)
cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item.");
else if (status == 2)
cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test.");
else if (status == 3)
cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease..so you better really buckle up and get ready...well, do you want to go for it now?");
else if (status == 4) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
cm.completeQuest(100003);
cm.startQuest(100004);
cm.gainItem(4031008, -1);
}
else if (status == 5) {
cm.warp(108000300, 0);
cm.dispose();
} else {
cm.dispose();
}
}
}

View File

@@ -24,46 +24,56 @@
Victoria Road : The Forest North of Ellinia (101020000)
*/
var status = 0;
var status;
function start() {
if (cm.isQuestCompleted(100007)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if (cm.isQuestStarted(100006)) {
cm.completeQuest(100006);
cm.sendNext("Hmmm...it is definitely the letter from #bGrendell the Really Old#k...so you came all the way here to take the test and make the 2nd job advancement as a magician. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated.")
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 1)
status++;
else
status--;
if (status == 0 && cm.isQuestStarted(100007))
status = 5;
else if (status == 1)
cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item.");
else if (status == 2)
cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test.");
else if (status == 3)
cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease.. So you better really buckle up and get ready...well, do you want to go for it now?");
else if (status == 4) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
cm.startQuest(100007);
cm.gainItem(4031009, -1);
}
else if (status == 5) {
cm.warp(108000200, 0);
cm.dispose();
}
else cm.dispose();
}
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.isQuestCompleted(100007)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if(cm.isQuestCompleted(100006)) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
status = 4;
} else if (cm.isQuestStarted(100006)) {
cm.sendNext("Hmmm...it is definitely the letter from #bGrendell the Really Old#k...so you came all the way here to take the test and make the 2nd job advancement as a magician. Alright, I'll explain the test to you. Don't sweat it too much, it's not that complicated.");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
}
else if(status == 1)
cm.sendNextPrev("I'll send you to a hidden map. You'll see monsters you don't normally see. They look the same like the regular ones, but with a totally different attitude. They neither boost your experience level nor provide you with item.");
else if (status == 2)
cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test.");
else if (status == 3)
cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease.. So you better really buckle up and get ready...well, do you want to go for it now?");
else if (status == 4) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
cm.completeQuest(100006);
cm.startQuest(100007);
cm.gainItem(4031009, -1);
}
else if (status == 5) {
cm.warp(108000200, 0);
cm.dispose();
}
else cm.dispose();
}
}

View File

@@ -24,45 +24,56 @@ Hunter Job Advancement
Warning Street : The Road to the Dungeon (106010000)
*/
var status = 0;
var status;
function start() {
if (cm.isQuestCompleted(100001)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if (cm.isQuestStarted(100000)) {
cm.completeQuest(100000);
cm.sendNext("Oh, isn't this a letter from #bAthena#k?");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 1)
status++;
else
status--;
if (status == 0 && cm.isQuestStarted(100001))
status = 4;
if (status == 1)
cm.sendNextPrev("So you want to prove your skills? Very well...")
else if (status == 2)
cm.sendAcceptDecline("I will give you a chance if you're ready.");
else if (status == 3) {
cm.startQuest(100001);
cm.gainItem(4031010, -1);
cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck.")
} else if (status == 4) {
cm.warp(108000100);
cm.dispose();
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
if (cm.isQuestCompleted(100001)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if(cm.isQuestCompleted(100000)) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
status = 3;
} else if (cm.isQuestStarted(100000)) {
cm.sendNext("Oh, isn't this a letter from #bAthena#k?");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
}
else if (status == 1)
cm.sendNextPrev("So you want to prove your skills? Very well...");
else if (status == 2)
cm.sendAcceptDecline("I will give you a chance if you're ready.");
else if (status == 3) {
cm.completeQuest(100000);
cm.startQuest(100001);
cm.gainItem(4031010, -1);
cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck.")
} else if (status == 4) {
cm.warp(108000100);
cm.dispose();
}
else {
cm.dispose();
}
}
else {
cm.dispose();
}
}
}

View File

@@ -24,45 +24,56 @@
Victoria Road : Construction Site North of Kerning City (102040000)
*/
var status = 0;
var status;
function start() {
if (cm.isQuestCompleted(100010)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if (cm.isQuestStarted(100009)) {
cm.completeQuest(100009);
cm.sendNext("Oh, isn't this a letter from the #bDark Lord#k?");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 1)
status++;
else
status--;
if (status == 0 && cm.isQuestStarted(100010))
status = 4;
if (status == 1)
cm.sendNextPrev("So you want to prove your skills? Very well...")
else if (status == 2)
cm.sendAcceptDecline("I will give you a chance if you're ready.");
else if (status == 3) {
cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck.")
cm.startQuest(100010);
cm.gainItem(4031011, -1);
} else if (status == 4) {
cm.warp(108000400, 0);
cm.dispose();
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.isQuestCompleted(100010)) {
cm.sendOk("You're truly a hero!");
cm.dispose();
} else if(cm.isQuestCompleted(100009)) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
status = 3;
} else if (cm.isQuestStarted(100009)) {
cm.sendNext("Oh, isn't this a letter from the #bDark Lord#k?");
} else {
cm.sendOk("I can show you the way once your ready for it.");
cm.dispose();
}
}
else if(status == 1)
cm.sendNextPrev("So you want to prove your skills? Very well...");
else if (status == 2)
cm.sendAcceptDecline("I will give you a chance if you're ready.");
else if (status == 3) {
cm.sendOk("You will have to collect me #b30 #t4031013##k. Good luck.");
cm.completeQuest(100009);
cm.startQuest(100010);
cm.gainItem(4031011, -1);
} else if (status == 4) {
cm.warp(108000400, 0);
cm.dispose();
}
else {
cm.dispose();
}
}
else {
cm.dispose();
}
}
}
}

View File

@@ -19,21 +19,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var status;
var completed;
function start() {
if (cm.haveItem(4031013,30)) {
cm.removeAll(4031013);
cm.completeQuest(100004);
cm.startQuest(100005);
cm.gainItem(4031012);
cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult... just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Perion.");
} else {
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode > 0)
cm.warp(102020300, 0);
cm.dispose();
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.haveItem(4031013,30)) {
completed = true;
cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult... just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Perion.");
} else {
completed = false;
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l");
}
} else if(status == 1) {
if(completed) {
cm.removeAll(4031013);
cm.completeQuest(100004);
cm.startQuest(100005);
cm.gainItem(4031012);
}
cm.warp(102020300, 2);
cm.dispose();
}
}
}

View File

@@ -19,21 +19,45 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var status;
var completed;
function start() {
if (cm.haveItem(4031013,30)) {
cm.removeAll(4031013);
cm.completeQuest(100007);
cm.startQuest(100008);
cm.gainItem(4031012);
cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult.. just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Ellinia.");
} else {
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode > 0)
cm.warp(101020000, 1);
cm.dispose();
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.haveItem(4031013,30)) {
completed = true;
cm.sendNext("Ohhhhh.. you collected all 30 Dark Marbles!! It should have been difficult.. just incredible! Alright. You've passed the test and for that, I'll reward you #bThe Proof of a Hero#k. Take that and go back to Ellinia.");
} else {
completed = false;
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l");
}
} else if(status == 1) {
if(completed) {
cm.removeAll(4031013);
cm.completeQuest(100007);
cm.startQuest(100008);
cm.gainItem(4031012);
}
cm.warp(101020000, 1);
cm.dispose();
}
}
}

View File

@@ -31,21 +31,45 @@
---------------------------------------------------------------------------------------------------
**/
var status;
var completed;
function start() {
if (cm.haveItem(4031013,30)) {
cm.removeAll(4031013);
cm.completeQuest(100001);
cm.startQuest(100002);
cm.gainItem(4031012);
cm.sendOk("You're a true hero! Take this and Athena will acknowledge you.");
} else {
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l")
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode > 0)
cm.warp(106010000, 1);
cm.dispose();
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.haveItem(4031013,30)) {
completed = true;
cm.sendOk("You're a true hero! Take this and Athena will acknowledge you.");
} else {
completed = false;
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l");
}
} else if(status == 1) {
if(completed) {
cm.removeAll(4031013);
cm.completeQuest(100001);
cm.startQuest(100002);
cm.gainItem(4031012);
}
cm.warp(106010000, 9);
cm.dispose();
}
}
}

View File

@@ -29,21 +29,46 @@
1.0 - First Version by Unknown
---------------------------------------------------------------------------------------------------
*/
var status;
var completed;
function start() {
if (cm.haveItem(4031013,30)) {
cm.removeAll(4031013);
cm.completeQuest(100010);
cm.startQuest(100011);
cm.gainItem(4031012);
cm.sendOk("You're a true hero! Take this and the Dark Lord will acknowledge you.");
} else {
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l")
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1)
cm.warp(102040000, 0);
cm.dispose();
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
if (cm.haveItem(4031013,30)) {
completed = true;
cm.sendOk("You're a true hero! Take this and the Dark Lord will acknowledge you.");
} else {
completed = false;
cm.sendSimple("You will have to collect me #b30 #t4031013##k. Good luck. \r\n#b#L1#I would like to leave#l");
}
} else if(status == 1) {
if(completed) {
cm.removeAll(4031013);
cm.completeQuest(100010);
cm.startQuest(100011);
cm.gainItem(4031012);
}
cm.warp(102040000, 9);
cm.dispose();
}
}
}

View File

@@ -97,7 +97,7 @@ function action(mode, type, selection) {
if(avDojo < 0) {
if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
else cm.sendOk("Your party is already using the dojo. Wait for them to finish to enter.");
}
else {
cm.getClient().getChannelServer().getMapFactory().getMap(925020010 + avDojo).resetMapObjects();
@@ -119,7 +119,7 @@ function action(mode, type, selection) {
if(avDojo < 0) {
if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
else cm.sendOk("Your party is already using the dojo. Wait for them to finish to enter.");
cm.getPlayer().setDojoStage(dojoWarp);
}
else {
@@ -136,7 +136,7 @@ function action(mode, type, selection) {
if(avDojo < 0) {
if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
else cm.sendOk("Your party is already using the dojo. Wait for them to finish to enter.");
}
else {
cm.getClient().getChannelServer().resetDojoMap(925020100 + avDojo);
@@ -174,7 +174,7 @@ function action(mode, type, selection) {
if(avDojo < 0) {
if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
else cm.sendOk("Your party is already using the dojo. Wait for them to finish to enter.");
}
else {
cm.getClient().getChannelServer().resetDojoMap(925030100 + avDojo);
@@ -302,7 +302,7 @@ function action(mode, type, selection) {
if(avDojo < 0) {
if(avDojo == -1) cm.sendOk("All Dojo's are being used already. Wait for awhile before trying again.");
else cm.sendOk("Your party already is using the dojo. Wait for them to finish to enter.");
else cm.sendOk("Your party already registered for the dojo. Wait for the end of the registration time to enter again.");
}
else {
var baseStg = hasParty ? 925030000 : 925020000;

120
scripts/npc/2112000.js Normal file
View File

@@ -0,0 +1,120 @@
/*
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/>.
*/
/* Yulete
Yulete's Office (926100203)
Magatia NPC
*/
var status;
importPackage(Packages.server.life);
function start() {
status = -1;
action(1, 0, 0);
}
function playersTooClose() {
var npcpos = cm.getMap().getMapObject(cm.getNpcObjectId()).getPosition();
var listchr = cm.getMap().getPlayers();
for (var iterator = listchr.iterator(); iterator.hasNext();) {
var chr = iterator.next();
var chrpos = chr.getPosition();
if(Math.sqrt( Math.pow((npcpos.getX() - chrpos.getX()), 2) + Math.pow((npcpos.getY() - chrpos.getY()), 2) ) < 310) return true;
}
return false;
}
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--;
var eim = cm.getEventInstance();
if(cm.getMapId() == 926100203) {
if(status == 0) {
var state = eim.getIntProperty("yuleteTalked");
if(state == -1) {
cm.sendOk("Heh, it seems you guys have company. Have fun with them, as I politely request my leave.");
} else if (playersTooClose() || eim.getIntProperty("npcShocked") == 0) {
cm.sendOk("Oh, hello there. I have been #bmonitoring your moves#k since you guys entered this perimeter. Quite the feat reaching here, I commend all of you. Now, now, look at the time, I've got an appointment right now, I'm afraid I will need to request my leave. But worry not, my #raccessors#k will deal with all of you. Now, if you permit me, I'm leaving now.");
eim.setIntProperty("yuleteTalked", -1);
} else {
cm.sendOk("... Hah! What, wh-- How did you get here?! I though I had sealed all paths here! No matter, this situation will be resolved soon. Guys: DEPLOY the #rmaster weapon#k!! You! Yes, you. Don't you think this ends here, look back at your companions, they need some help! I'll be retreating for now.");
eim.setIntProperty("yuleteTalked", 1);
}
}
cm.dispose();
} else {
if(status == 0) {
if(eim.isEventCleared()) {
cm.sendOk("Nooooo... I have been beated? But how? Everything I did was for the sake of the development of a greater alchemy! You can't jail me, I did what everybody standing in a place like mine would do! But no, they simply decided to damp up the progress of the science JUST BECAUSE it was deemed dangerous??? Oh, come on!");
} else {
var state = eim.getIntProperty("yuletePassed");
if(state == -1) {
cm.sendOk("Behold! The pinnacle of Magatia's alchemy studies! Hahahahahahaha...");
} else if(state == 0) {
cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest alchemy, #rFrankenroid#k.");
eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest alchemy, Frankenroid!");
var mapobj = eim.getMapInstance(926100401);
var bossobj = MapleLifeFactory.getMonster(9300139);
mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100));
eim.setIntProperty("statusStg7", 1);
eim.setIntProperty("yuletePassed", -1);
} else {
cm.sendOk("You guys are such a pain, geez. Very well, I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the #rmighty Frankenroid#k!");
eim.dropMessage(5, "Yulete: I present you my newest weapon, brought by the finest combined alchemy of Alcadno's and Zenumist's, those that the boring people of Magatia societies have banned to bring along, the mighty Frankenroid!!");
var mapobj = eim.getMapInstance(926100401);
var bossobj = MapleLifeFactory.getMonster(9300140);
mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100));
eim.setIntProperty("statusStg7", 2);
eim.setIntProperty("yuletePassed", -1);
}
}
}
cm.dispose();
}
}
}

58
scripts/npc/2112001.js Normal file
View File

@@ -0,0 +1,58 @@
/*
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/>.
*/
/* Yulete
Traces of Yulete (926100500)
Talking
*/
var status;
function start() {
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) {
cm.sendSimple("Defeated... So, that's how Yulete's legacy will reach it's end, oh how woe is this... Hope you guys are happy now, as I will pass my days rotting in a dark cellar. Everything I've done was for the sake of Magatia!! (sob)\r\n #Ll# Hey man, come now, cheer up! There were not many damages that couldn't be resolved here. Magatia created these forbidding laws to protect it's people from the undoings a greater power like this would do if it reaches wrong hands. That's not the end for you, accept rehabilitation from the Societies and everything will work out!#l");
} else if (status == 1){
cm.sendNext("... Are you guys forgiving me after all that I've done? Well, I guess I was blinded by the great source of power that could be discovered that way, maybe they're right saying a human can't simply fathom on the usage of those powers without corrupting theirselves along the way... I am profoundly sorry, and to make myself up with everyone I'm willing to help the Societies again wherever I can on the progress of alchemy. Thank you.");
} else {
if(!cm.isQuestCompleted(7770)) cm.completeQuest(7770);
cm.warp(926100600);
cm.dispose();
}
}
}

77
scripts/npc/2112003.js Normal file
View File

@@ -0,0 +1,77 @@
/**
* @author: Ronan
* @npc: Juliet
* @map: Magatia - Alcadno - Hidden Room (261000021)
* @func: Magatia PQ (Alcadno)
*/
var status = 0;
var em = null;
function start() {
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(cm.getMapId() != 261000021) {
if(status == 0) {
cm.sendYesNo("We must keep fighting to save Romeo, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?");
} else if(status == 1) {
cm.warp(926110700);
cm.dispose();
}
} else {
if (status == 0) {
em = cm.getEventManager("MagatiaPQ_A");
if(em == null) {
cm.sendOk("The Magatia PQ (Alcadno) has encountered an error.");
cm.dispose();
return;
}
cm.sendSimple("#e#b<Party Quest: Romeo and Juliet>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nMy beloved Romeo has been kidnapped! Although he is Zenumist's, I can't stand by and just see him suffer just because of this foolish clash. I need you and your colleagues help to save him! Please, help us!! Please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
} else if (status == 1) {
if (selection == 0) {
if (cm.getParty() == null) {
cm.sendOk("You can participate in the party quest only if you are in a party.");
cm.dispose();
} else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");
}
}
else {
cm.sendOk("You cannot start this party quest 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.");
}
cm.dispose();
}
} else if (selection == 1) {
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
cm.dispose();
} else {
cm.sendOk("#e#b<Party Quest: Romeo and Juliet>#k#n\r\nNot long ago, a scientist named Yulete has been banished from this town because of his researches of combined alchemies of Alcadno's and Zenumist's. Because of the immensurable amount of power coming from this combination, it is forbidden by law to study both. Yet, he ignored this law and got hands in both researches. As a result, he has been exiled.\r\nHe is now retaliating, already took my beloved one and his next target is me, as we are big pictures of Magatia, successors of both societies. But I'm not afraid. We must recover him at all costs!\r\n");
cm.dispose();
}
}
}
}
}

77
scripts/npc/2112004.js Normal file
View File

@@ -0,0 +1,77 @@
/**
* @author: Ronan
* @npc: Romeo
* @map: Magatia - Zenumist - Hidden Room (261000011)
* @func: Magatia PQ (Zenumist)
*/
var status = 0;
var em = null;
function start() {
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(cm.getMapId() != 261000011) {
if(status == 0) {
cm.sendYesNo("We must keep fighting to save Juliet, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?");
} else if(status == 1) {
cm.warp(926100700);
cm.dispose();
}
} else {
if (status == 0) {
em = cm.getEventManager("MagatiaPQ_Z");
if(em == null) {
cm.sendOk("The Magatia PQ (Zenumist) has encountered an error.");
cm.dispose();
return;
}
cm.sendSimple("#e#b<Party Quest: Romeo and Juliet>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nMy beloved Juliet has been kidnapped! Although she is Alcadno's, I can't stand by and just see her suffer just because of this foolish clash. I need you and your colleagues help to save her! Please, help us!! Please have your #bparty leader#k talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
} else if (status == 1) {
if (selection == 0) {
if (cm.getParty() == null) {
cm.sendOk("You can participate in the party quest only if you are in a party.");
cm.dispose();
} else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");
}
}
else {
cm.sendOk("You cannot start this party quest 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.");
}
cm.dispose();
}
} else if (selection == 1) {
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
cm.dispose();
} else {
cm.sendOk("#e#b<Party Quest: Romeo and Juliet>#k#n\r\nNot long ago, a scientist named Yulete has been banished from this town because of his researches of combined alchemies of Alcadno's and Zenumist's. Because of the immensurable amount of power coming from this combination, it is forbidden by law to study both. Yet, he ignored this law and got hands in both researches. As a result, he has been exiled.\r\nHe is now retaliating, already took my beloved one and his next target is me, as we are big pictures of Magatia, successors of both societies. But I'm not afraid. We must recover her at all costs!\r\n");
cm.dispose();
}
}
}
}
}

127
scripts/npc/2112005.js Normal file
View File

@@ -0,0 +1,127 @@
/*
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/>.
*/
/**
* @author: Ronan
* @npc: Juliet
* @func: MagatiaPQ area NPC
*/
var status;
function start() {
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--;
var eim = cm.getEventInstance();
if(!eim.isEventCleared()) {
if(status == 0) {
if(eim.getIntProperty("npcShocked") == 0 && cm.haveItem(4001130, 1)) {
cm.gainItem(4001130, -1);
eim.setIntProperty("npcShocked", 1);
cm.sendNext("Oh? You got a letter for me? On times like this, what should it be... Gasp! Something big is going on, guys. Rally yourselves, from now on things will be harder than ever!");
eim.dropMessage(6, "Juliet seemed very much in shock after reading Romeo's Letter.");
cm.dispose();
return;
} else if (eim.getIntProperty("statusStg4") == 1) {
var door = cm.getMap().getReactorByName("jnr3_out3");
if(door.getState() == 0) {
cm.sendNext("Let me open the door for you.");
door.hitReactor(cm.getClient());
} else {
cm.sendNext("Please hurry, Romeo is in trouble.");
}
cm.dispose();
return;
} else if (cm.haveItem(4001134, 1) && cm.haveItem(4001135, 1)) {
if (cm.isEventLeader()) {
cm.gainItem(4001134, -1);
cm.gainItem(4001135, -1);
cm.sendNext("Great! You got both Alcadno and Zenumist files at hand. Now we can proceed.");
eim.showClearEffect();
eim.giveEventPlayersStageReward(4);
eim.setIntProperty("statusStg4", 1);
cm.getMap().killAllMonsters();
cm.getMap().getReactorByName("jnr3_out3").hitReactor(cm.getClient());
} else {
cm.sendOk("Please let your leader pass the files to me.");
}
cm.dispose();
return;
} else {
cm.sendYesNo("We must keep fighting to save Romeo, please keep your pace. If you are not feeling so well to continue, your companions and I will understand... So, are you going to retreat?");
}
} else {
cm.warp(926110700);
cm.dispose();
}
} else {
if(status == 0) {
if(eim.getIntProperty("escortFail") == 0) {
cm.sendNext("Finally, Romeo is safe! Thanks to your efforts, we could save him from the clutches of Yulete, who will now be judged for his rebellion against Magatia. From now on, as he will start rehabilitation, we will keep an eye on his endeavours, making sure he will cause no more troubles on the future.");
}
else {
cm.sendNext("Romeo is safe now, although the battle took it's toll on him... Thanks to your efforts, we could save him from the clutches of Yulete, who will now be judged for his rebellion against Magatia. Thank you.");
status = 2;
}
} else if(status == 1) {
cm.sendNext("Now, please receive this gift as an act of acceptation for our gratitude.");
} else if(status == 2) {
if(cm.canHold(4001160)) {
cm.gainItem(4001160, 1);
if(eim.getIntProperty("normalClear") == 1) cm.warp(926110600);
else cm.warp(926110500);
} else {
cm.sendOk("Make sure you have a space on your ETC inventory.");
}
cm.dispose();
} else {
cm.warp(926110600);
cm.dispose();
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More