AmoriaPQ + ItemSort fix + revamped GMShop

Implemented AmoriaPQ. Fixed an issue with ItemIdSortHandler where empty
vectors given to the sorting module would cause an exception thrown,
wiping players inventory items. Thanks to Vcoc, revamped shop data for
GMShop (shop id 1337). Mount quest for explorers now uses event script.
This commit is contained in:
ronancpl
2017-09-15 21:32:15 -03:00
parent 6abbc2947e
commit 1ffcf47f79
133 changed files with 63565 additions and 60865 deletions

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*3rd Job Event - Bowman
* @Author Ronan
* 3rd Job Event - Bowman
**/
importPackage(Packages.tools);

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*3rd Job Event - Magician
* @Author Ronan
* 3rd Job Event - Magician
**/
importPackage(Packages.tools);

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
* 3rd Job Event - Kenta's Mount Quest
**/
importPackage(Packages.tools);
var entryMap = 923010000;
var exitMap = 923010100;
var minMapId = 923010000;
var maxMapId = 923010000;
var eventMaps = [923010000];
var eventTime = 5; //5 minutes
var lobbyRange = [0, 0];
function setLobbyRange() {
return lobbyRange;
}
function init() {
em.setProperty("noEntry","false");
}
function respawnStages(eim) {
var i;
for (i = 0; i < eventMaps.length; i++) {
eim.getInstanceMap(eventMaps[i]).instanceMapRespawn();
}
eim.schedule("respawnStages", 10 * 1000);
}
function playerEntry(eim, player) {
var mapObj = eim.getInstanceMap(entryMap);
mapObj.resetPQ(1);
mapObj.instanceMapForceRespawn();
respawnStages(eim);
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
player.getClient().getSession().write(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
var api = player.getClient().getAbstractPlayerInteraction();
api.removeAll(4031507);
api.removeAll(4031508);
eim.unregisterPlayer(player);
eim.dispose();
em.setProperty("noEntry","false");
}
function scheduledTimeout(eim) {
var player = eim.getPlayers().get(0);
playerExit(eim, player);
player.changeMap(exitMap);
}
function playerDisconnected(eim, player) {
playerExit(eim, player);
}
function changedMap(eim, chr, mapid) {
if(mapid < minMapId || mapid > maxMapId) playerExit(eim, chr);
}
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
var player = eim.getPlayers().get(0);
eim.unregisterPlayer(player);
player.changeMap(exitMap);
eim.dispose();
em.setProperty("noEntry","false");
}
function monsterKilled(mob, eim) {}
function monsterValue(eim, mobId) {
return 1;
}
function friendlyKilled(mob, eim) {
if(em.getProperty("noEntry") != "false") {
var player = eim.getPlayers().get(0);
playerExit(eim, player);
player.changeMap(exitMap);
}
}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose() {}

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*3rd Job Event - Pirate
* @Author Ronan
* 3rd Job Event - Pirate
**/
importPackage(Packages.tools);

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*3rd Job Event - Thief
* @Author Ronan
* 3rd Job Event - Thief
**/
importPackage(Packages.tools);

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*3rd Job Event - Warrior
* @Author Ronan
* 3rd Job Event - Warrior
**/
importPackage(Packages.tools);

249
scripts/event/AmoriaPQ.js Normal file
View File

@@ -0,0 +1,249 @@
/**
* @author: Ronan
* @event: Amoria PQ
*/
var isPq = true;
var minPlayers = 6, maxPlayers = 6;
var minLevel = 40, maxLevel = 255;
var entryMap = 670010200;
var exitMap = 670011000;
var recruitMap = 670010100;
var clearMap = 670010800;
var minMapId = 670010200;
var maxMapId = 670010800;
var eventTime = 75; // 75 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 At least 1 of both genders";
reqStr += "\r\n Time limit: ";
reqStr += eventTime + " minutes";
em.setProperty("party", reqStr);
}
function setEventExclusives(eim) {
var itemSet = [4031594, 4031595, 4031596, 4031597];
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 = [2000, 4000, 6000, 8000, 9000, 11000]; //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;
var mask = 0;
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);
mask |= (1 << ch.getPlayer().getGender());
}
}
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers && mask == 3)) eligible = [];
return eligible;
}
function setup(level, lobbyid) {
var eim = em.newInstance("Amoria" + lobbyid);
eim.setProperty("level", level);
eim.setProperty("marriedGroup", 0);
eim.setProperty("missCount", 0);
eim.setProperty("statusStg1", -1);
eim.setProperty("statusStg2", -1);
eim.setProperty("statusStg3", -1);
eim.setProperty("statusStg4", -1);
eim.setProperty("statusStg5", -1);
eim.setProperty("statusStg6", -1);
eim.setProperty("statusStgBonus", 0);
eim.getInstanceMap(670010200).resetPQ(level);
eim.getInstanceMap(670010300).resetPQ(level);
eim.getInstanceMap(670010301).resetPQ(level);
eim.getInstanceMap(670010302).resetPQ(level);
eim.getInstanceMap(670010400).resetPQ(level);
eim.getInstanceMap(670010500).resetPQ(level);
eim.getInstanceMap(670010600).resetPQ(level);
eim.getInstanceMap(670010700).resetPQ(level);
eim.getInstanceMap(670010750).resetPQ(level);
eim.getInstanceMap(670010800).resetPQ(level);
eim.getInstanceMap(670010200).toggleDrops();
eim.getInstanceMap(670010300).toggleDrops();
eim.getInstanceMap(670010301).toggleDrops();
eim.getInstanceMap(670010302).toggleDrops();
eim.getInstanceMap(670010200).instanceMapForceRespawn();
eim.getInstanceMap(670010500).instanceMapForceRespawn();
eim.getInstanceMap(670010750).shuffleReactors();
eim.getInstanceMap(670010800).shuffleReactors();
var mapObj = eim.getInstanceMap(670010700);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400536);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(942, 478));
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function isTeamAllCouple(eim) { // all players married each other, not implemented
return false;
}
function afterSetup(eim) {
if(isTeamAllCouple(eim)) {
eim.setIntProperty("marriedGroup", 1);
}
}
function respawnStages(eim) {}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
}
function scheduledTimeout(eim) {
if(eim.getIntProperty("statusStg6") == 1) {
eim.warpEventTeam(exitMap);
}
else {
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 monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -52,6 +52,7 @@ function action(mode, type, selection) {
if(cm.getMeso() < 5000) {
cm.sendOk("Oh, you don't have the money, right? Sorry, I can't let you in.");
} else {
cm.gainMeso(-5000);
cm.warp(193000000);
}

View File

@@ -50,6 +50,10 @@ var itemQty_lv1 = [1, 1, 1, 1, 1, 30, 30, 30, 30, 30, 40, 40, 40, 80, 80, 20, 1,
var levels = ["Tier 1", "Tier 2", "Tier 3", "Tier 4", "Tier 5", "Tier 6"];
var tickets = [0, 0, 0, 0, 0, 0];
var coinId = 4001158;
var coins = 0;
var hasCoin = false;
var currentTier;
var curItemQty;
var curItemSel;
@@ -76,12 +80,13 @@ function action(mode, type, selection) {
advance = true;
if(status == 0) {
cm.sendNext("This is the vending machine of the Internet Cafe. Place your erasers earned throughout the quests to redeem a prize. You can place #bany amount of erasers#k, however take note that bigger shots improves the reward possibilities!");
hasCoin = cm.haveItem(coinId);
cm.sendNext("This is the vending machine of the Internet Cafe. Place your erasers or #t" + coinId + "# earned throughout the quests to redeem a prize. You can place #bany amount of erasers#k, however take note that bigger shots improves the reward possibilities!");
} else if(status == 1) {
var sendStr;
currentTier = getRewardTier();
if(currentTier >= 0) sendStr = "With the erasers you have currently placed, you can retrieve a #r" + levels[currentTier] + "#k prize. Place erasers:";
if(currentTier >= 0) sendStr = "With the items you have currently placed, you can retrieve a #r" + levels[currentTier] + "#k prize. Place erasers:";
else sendStr = "You have placed no erasers yet. Place erasers:";
var listStr = "";
@@ -90,11 +95,16 @@ function action(mode, type, selection) {
if(tickets[i] > 0) listStr += " - " + tickets[i] + " erasers";
listStr += "#l\r\n";
}
if(hasCoin) {
listStr += "#b#L" + tickets.length + "##t" + coinId + "##k";
if(coins > 0) listStr += " - " + coins + " feathers";
listStr += "#l\r\n";
}
cm.sendSimple(sendStr + "\r\n\r\n" + listStr + "#r#L6#Retrieve a prize!#l#k\r\n");
cm.sendSimple(sendStr + "\r\n\r\n" + listStr + "#r#L" + getRewardIndex(hasCoin) + "#Retrieve a prize!#l#k\r\n");
} else if(status == 2) {
if(selection == 6) {
if(selection == getRewardIndex(hasCoin)) {
if(currentTier < 0) {
cm.sendPrev("You have set no erasers. Insert at least one to claim a prize.");
advance = false;
@@ -103,7 +113,10 @@ function action(mode, type, selection) {
cm.dispose();
}
} else {
var tickSel = 4001009 + selection;
var tickSel;
if(selection < tickets.length) tickSel = 4001009 + selection;
else tickSel = coinId;
curItemQty = cm.getItemQuantity(tickSel);
curItemSel = selection;
@@ -125,7 +138,8 @@ function action(mode, type, selection) {
cm.sendPrev("You cannot insert the given amount of erasers (#r" + curItemQty + "#k available). Click '#rBack#k' to return to the main interface.");
advance = false;
} else {
tickets[curItemSel] = placedQty;
if(curItemSel < tickets.length) tickets[curItemSel] = placedQty;
else coins = placedQty;
cm.sendPrev("Operation succeeded. Click '#rBack#k' to return to the main interface.");
advance = false;
@@ -142,6 +156,10 @@ function action(mode, type, selection) {
}
}
function getRewardIndex(hasCoin) {
return (!hasCoin) ? tickets.length : tickets.length + 1;
}
function getRewardTier() {
var points = getPoints();
@@ -162,6 +180,7 @@ function getPoints() {
points += (6 + ((tickets[i] - 1) * getTicketMultiplier(i))); //6 from uniques + rest from each ticket difficulty
}
points += Math.ceil(0.46 * coins); // 100 coins for a LV6 tier item.
return points;
}
@@ -202,6 +221,8 @@ function givePrize() {
for(var i = 0; i < tickets.length; i++) {
cm.gainItem(4001009 + i, -1 * tickets[i]);
}
cm.gainItem(coinId, -1 * coins);
cm.gainItem(lvTarget[rnd], lvQty[rnd]);
}
}

View File

@@ -19,7 +19,10 @@
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/>.
*/
/* 1061009 - Door of Dimension
/*
@Author Ronan
1061009 - Door of Dimension
Enter 3rd job event
*/

35
scripts/npc/1102002.js Normal file
View File

@@ -0,0 +1,35 @@
/*
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/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Kiridu - Cygnus
-- By ---------------------------------------------------------------------------------------------
Ronan
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Ronan
---------------------------------------------------------------------------------------------------
**/
function start() {
cm.sendOk("Yo. I am #p1102002#, in charge of mount raising and training for the Cygnus Knights' of Ereve!");
cm.dispose();
}

View File

@@ -78,11 +78,11 @@ function action(mode, type, selection){
cm.getPlayer().removePartyQuestItem("JBQ");
}
if(cm.getJobId() / 10 == 11) cm.sendNext("You have just become the #bCrusader#k. A number of new attacking skills such as #bShout#k and #bCombo Attack#k are devastating, while #bArmor Crash#k will put a dent on the monsters' defensive abilities. It'll be best to concentrate on acquiring skills with the weapon you mastered during the days as a Fighter.");
else if(cm.getJobId() / 10 == 12) cm.sendNext("You have just become the #bWhite Knight#k. You'll be introduced to a new skill book featuring various new attacking skills as well as element-based attacks. It's recommended that the type of weapon complementary to the Page, whether it be a sword or a blunt weapon, should be continued as the White Knight. There's a skill called #bCharge#k, which adds an element of ice, fire and lightning to the weapon, making White Knight the only warrior that can perform element-based attacks. Charge up your weapon with an element that weakens the monster, and then apply massive damage with the #bCharged Blow#k. This will definitely make you a devastating force around here.");
if(Math.floor(cm.getJobId() / 10) == 11) cm.sendNext("You have just become the #bCrusader#k. A number of new attacking skills such as #bShout#k and #bCombo Attack#k are devastating, while #bArmor Crash#k will put a dent on the monsters' defensive abilities. It'll be best to concentrate on acquiring skills with the weapon you mastered during the days as a Fighter.");
else if(Math.floor(cm.getJobId() / 10) == 12) cm.sendNext("You have just become the #bWhite Knight#k. You'll be introduced to a new skill book featuring various new attacking skills as well as element-based attacks. It's recommended that the type of weapon complementary to the Page, whether it be a sword or a blunt weapon, should be continued as the White Knight. There's a skill called #bCharge#k, which adds an element of ice, fire and lightning to the weapon, making White Knight the only warrior that can perform element-based attacks. Charge up your weapon with an element that weakens the monster, and then apply massive damage with the #bCharged Blow#k. This will definitely make you a devastating force around here.");
else cm.sendNext("You're #bDragon Knight#k from here on out. You'll be introduced to a range of new attacking skills for spears and pole arms, and whatever weapon was chosen as the Spearman should be continued as the Dragon Knigth. Skills such as #bCrusher#k (maximum damage to one monster) and #bDragon Fury#k (damage to multiple monsters) are recommended as main attacking skills of choice, while a skill called #bDragon Roar#k will damage everything on screen with devasting force. The downside is the fact that the skill uses up over half of the available HP.");
} else if (status == 3) {
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstavles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
}
}else if (actionx["Physical"]){
if (status == 0)

View File

@@ -66,8 +66,8 @@ function action(mode, type, selection){
cm.getPlayer().removePartyQuestItem("JBQ");
}
if(cm.getJobId() / 10 == 21) cm.sendNext("You're the #bMage of Fire and Poison#k from here on out. The new skill book features new and improved fire and poison based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP.");
else if(cm.getJobId() / 10 == 22) cm.sendNext("You're the #bMage of Ice and Lightning#k from here on out. The new skill book features new and improved ice and lightning based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP.");
if(Math.floor(cm.getJobId() / 10) == 21) cm.sendNext("You're the #bMage of Fire and Poison#k from here on out. The new skill book features new and improved fire and poison based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP.");
else if(Math.floor(cm.getJobId() / 10) == 22) cm.sendNext("You're the #bMage of Ice and Lightning#k from here on out. The new skill book features new and improved ice and lightning based spells, and skills such as #bElement Amplification#k (improved element-based spells) and #bSpell Booster#k (improves the overall speed of your attacking spells) will enable you to attack the monsters quickly and effectively. Defensive spells such as #bPartial Resistance#k (allows you to become stronger against certain elemental-based attacks) and #bSeal#k (seals up the monster) will help negate the one weakness Mages possess: lack of HP.");
else cm.sendNext("You're #bPriest#k from here on out. The new skill book features new and improved holy spells such as #bShining Ray#k and #bSummon Dragon#k, and skills such as #bMystic Door#k (creates a door for the exit to the nearest town) and #bHoly Symbol#k (improves the EXP gained) can be vital to the party play. Off-beat spells such as #bDoom#k (turn monsters into snails) separates Priests from other jobs as the most different of all.");
} else if (status == 3) {
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");

View File

@@ -68,10 +68,10 @@ function action(mode, type, selection){
cm.getPlayer().removePartyQuestItem("JBQ");
}
if(cm.getJobId() / 10 == 31) cm.sendNext("You have officially become the #bRanger#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Rangers to fire arrows from close-range. #bInferno#k allows Rangers to temporarily perform fire-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bSilver Hawk#k (summons a Silver Hawk that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire.");
if(Math.floor(cm.getJobId() / 10) == 31) cm.sendNext("You have officially become the #bRanger#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Rangers to fire arrows from close-range. #bInferno#k allows Rangers to temporarily perform fire-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bSilver Hawk#k (summons a Silver Hawk that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire.");
else cm.sendNext("You have officially become the #bSniper#k. One of the skills that you'll truly embrace is a skill called #bMortal Blow#k that allows Snipers to fire arrows from close-range. #bBlizzard#k allows Snipers to temporarily perform ice-based attacks on monsters, while skills like #bPuppet#k (summons a scarecrow which attracts the monsters' attention) and #bGolden Eagle#k (summons a Golden Eagle that attacks monsters) solidify the Bowman's status as a long-range attack extraordinaire.");
} else if (status == 3) {
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstavles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful warrior, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
}
}else if (actionx["Physical"]){
if (status == 0)

View File

@@ -66,11 +66,11 @@ function action(mode, type, selection){
cm.getPlayer().removePartyQuestItem("JBQ");
}
if(cm.getJobId() / 10 == 41) cm.sendNext("You have officially been anointed as a #bHermit#k from here on out. The skill book introduces a slew of new attacking skills for Hermits using shadows as a way of duplication and replacement, including such skills as #bShadow Meso#k (replacing MP with mesos and attack monsters with the damage based on the amount of mesos thrown) and #bCopy cat#k (creating a shadow that mimics every move, enabling a Hermit to attack a monster as if two Hermits are there). Use those skills to take on the monsters that may have been difficult to conquer before.");
if(Math.floor(cm.getJobId() / 10) == 41) cm.sendNext("You have officially been anointed as a #bHermit#k from here on out. The skill book introduces a slew of new attacking skills for Hermits using shadows as a way of duplication and replacement, including such skills as #bShadow Meso#k (replacing MP with mesos and attack monsters with the damage based on the amount of mesos thrown) and #bCopy cat#k (creating a shadow that mimics every move, enabling a Hermit to attack a monster as if two Hermits are there). Use those skills to take on the monsters that may have been difficult to conquer before.");
else cm.sendNext("You have officially been anointed as a #bChief Bandit#k from here on out. One of the new additions to the skill book is a skill called #bBand of Thieves#k, in which you can summon fellow Bandits to attack multiple monsters at once. Chief Bandits can also utilize mesos in numerous ways, from attacking monsters (#bMeso Explosion#k, which explodes the mesos on the ground), to defending yourself (#bMeso Guard#k, which decreases the weapon damage).");
} else if (status == 3) {
cm.sendNextPrev("I've also given you some SP and AP; this should get you started. You have now become a powerful, powerful thief, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstavles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
cm.sendNextPrev("I've also given you some SP and AP; this should get you started. You have now become a powerful, powerful thief, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
}
}else if (actionx["Physical"]){
if (status == 0)

View File

@@ -66,10 +66,10 @@ function action(mode, type, selection){
cm.getPlayer().removePartyQuestItem("JBQ");
}
if(cm.getJobId() / 10 == 51) cm.sendNext("Great! You are now a #bMarauder#k. As a Marauder, you will learn some of the most sophisticated skills related to melee-based attacks. #bEnergy Charge#k is a skill that allows you to store your power and the damage you receive into a special form of energy. Once this ball of energy is charged, you may use #bEnergy Blast#k to apply maximum damage against your enemies, and also use #bEnergy Drain#k to steal your enemy's HP to recover your own. #bTransformation#k will allow you to transform into a superhuman being with devastating melee attacks, and while transformed, you can use #bShockwave#k to cause a mini-earthquake and inflict massive damage to your enemies.");
if(Math.floor(cm.getJobId() / 10) == 51) cm.sendNext("Great! You are now a #bMarauder#k. As a Marauder, you will learn some of the most sophisticated skills related to melee-based attacks. #bEnergy Charge#k is a skill that allows you to store your power and the damage you receive into a special form of energy. Once this ball of energy is charged, you may use #bEnergy Blast#k to apply maximum damage against your enemies, and also use #bEnergy Drain#k to steal your enemy's HP to recover your own. #bTransformation#k will allow you to transform into a superhuman being with devastating melee attacks, and while transformed, you can use #bShockwave#k to cause a mini-earthquake and inflict massive damage to your enemies.");
else cm.sendNext("Great! You have now become an #bOutlaw#k. As an Outlaw, you will become a true pistolero, a master of every known Gun attack, as well as a few other skills to help you vanquish evil. #bBurst Fire#k is a more powerful version of Double Shot, shooting more bullets and causing more damage at the same time. You also now have the ability to summon a loyal #bOctopus#k and the swooping #bGaviota#k as your trusty allies, while attacking your enemies using #bBullseye#k. You can also use element-based attacks using #bFlamethrower#k and #bIce Splitter#k.");
} else if (status == 3) {
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful pirate, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstavles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
cm.sendNextPrev("I've also given you some SP and AP, which will help you get started. You have now become a powerful, powerful pirate, indeed. Remember, though, that the real world will be awaiting your arrival with even tougher obstacles to overcome. Once you feel like you cannot train yourself to reach a higher place, then, and only then, come see me. I'll be here waiting.");
}
}else if (actionx["Physical"]){
if (status == 0)

View File

@@ -19,16 +19,35 @@
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
2060005 - Kenta
Enter 3rd job mount event
**/
function start() {
if(cm.isQuestCompleted(6002))
if(cm.isQuestCompleted(6002)) {
cm.sendOk("Thanks for saving the pork.");
else if(cm.getWarpMap(923010000).getCharacters().size() > 0)
cm.sendOk("There is currently someone in this map, come back later.");
else if(cm.isQuestStarted(6002)) {
cm.resetMapObjects(923010000);
cm.warp(923010000);
}
else cm.sendSimple("Only few adventurers, from a selected public, are eligible to protect the Watch Hog.");
else if(cm.isQuestStarted(6002)) {
var em = cm.getEventManager("3rdJob_mount");
if (em == null)
cm.sendOk("Sorry, but 3rd job advancement (mount) is closed.");
else {
if (em.getProperty("noEntry") == "false") {
var eim = em.newInstance("3rdjob_mount");
eim.registerPlayer(cm.getPlayer());
}
else {
cm.sendOk("There is currently someone in this map, come back later.");
}
}
}
else {
cm.sendSimple("Only few adventurers, from a selected public, are eligible to protect the Watch Hog.");
}
cm.dispose();
}

View File

@@ -34,10 +34,10 @@ function action(mode, type, selection) {
cm.gainMeso(-1000);
} else
cm.gainItem(4031242,-1);
cm.warp(230030200);
cm.warp(230030200, 2);
cm.dispose();
return;
}else if(selection == 1){
} else if (selection == 1) {
if (cm.getPlayer().getMeso() < 10000) {
cm.sendOk("I don't think you have enough money...");
cm.dispose();

View File

@@ -46,7 +46,7 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 1) {
if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 1) {
cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
cm.dispose();
} else if (!cm.isQuestCompleted(6904)) {

View File

@@ -46,7 +46,7 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 2) {
if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 2) {
cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
cm.dispose();
} else if (!cm.isQuestCompleted(6914)) {

View File

@@ -46,7 +46,7 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 3) {
if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 3) {
cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
cm.dispose();
} else if (!cm.isQuestCompleted(6924)) {

View File

@@ -46,7 +46,7 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 4) {
if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 4) {
cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
cm.dispose();
} else if (!cm.isQuestCompleted(6934)) {

View File

@@ -46,7 +46,7 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
if(cm.getLevel() < 120 || Math.round(cm.getJobId() / 100) != 5) {
if(cm.getLevel() < 120 || Math.floor(cm.getJobId() / 100) != 5) {
cm.sendOk("Please don't bother me right now, I am trying to concentrate.");
cm.dispose();
} else if (!cm.isQuestCompleted(6944)) {

View File

@@ -97,7 +97,8 @@ function action(mode, type, selection) {
var mapobj = eim.getMapInstance(926100401);
var bossobj = MapleLifeFactory.getMonster(9300139);
mapobj.spawnMonsterWithEffect(bossobj, 13, new Packages.java.awt.Point(250, 100));
//mapobj.spawnMonsterWithEffect(bossobj, 13, new Packages.java.awt.Point(250, 100));
mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100));
eim.setIntProperty("statusStg7", 1);
eim.setIntProperty("yuletePassed", -1);
@@ -108,7 +109,8 @@ function action(mode, type, selection) {
var mapobj = eim.getMapInstance(926100401);
var bossobj = MapleLifeFactory.getMonster(9300140);
mapobj.spawnMonsterWithEffect(bossobj, 14, new Packages.java.awt.Point(250, 100));
//mapobj.spawnMonsterWithEffect(bossobj, 14, new Packages.java.awt.Point(250, 100));
mapobj.spawnMonsterOnGroundBelow(bossobj, new Packages.java.awt.Point(250, 100));
eim.setIntProperty("statusStg7", 2);
eim.setIntProperty("yuletePassed", -1);

View File

@@ -38,7 +38,7 @@ function action(mode, type, selection){
if(status == 0) cm.sendOk("Well okay, I will send you back.");
else {
cm.warp(923010100);
cm.getEventInstance().clearPQ();
cm.dispose();
}
}

View File

@@ -45,7 +45,7 @@ function action(mode, type, selection) {
else
status--;
if (status == 1 && selection == 0) {
if (cm.haveItem(4031592, 1) && cm.isMarried()==1) {
if (cm.haveItem(4031592, 1)/* && cm.isMarried()==1*/) {
cm.sendYesNo("So you would like to enter the #bEntrance#k?");
MySelection = selection;
} else {
@@ -53,7 +53,11 @@ function action(mode, type, selection) {
cm.dispose();
}
} else if (status == 1 && selection == 1) {
if (cm.haveItem(4031593, 10)) {
if (cm.haveItem(4031592)) {
cm.sendOk("You already have an Entrance Ticket!");
cm.dispose();
}
else if (cm.haveItem(4031593, 10)) {
cm.sendYesNo("So you would like a Ticket?");
MySelection = selection;
} else {

291
scripts/npc/9201044.js Normal file
View File

@@ -0,0 +1,291 @@
/*
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 = Amos (PQ)
@ Map = AmoriaPQ maps
@ Function = AmoriaPQ Host
@
@ Description: Used to find the combo to unlock the next door. Players stand on 5 different crates to guess the combo.
*/
importPackage(Packages.server.life);
var debug = false;
var autopass = false;
function spawnMobs(maxSpawn) {
var spawnPosX;
var spawnPosY;
var mapObj = cm.getMap();
if (stage == 2) {
spawnPosX = [619, 299, 47, -140, -471];
spawnPosY = [-840, -840, -840, -840, -840];
for(var i = 0; i < 5; i++) {
for(var j = 0; j < 2; j++) {
var mobObj1 = MapleLifeFactory.getMonster(9400515);
var mobObj2 = MapleLifeFactory.getMonster(9400516);
var mobObj3 = MapleLifeFactory.getMonster(9400517);
mapObj.spawnMonsterOnGroundBelow(mobObj1, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i]));
mapObj.spawnMonsterOnGroundBelow(mobObj2, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i]));
mapObj.spawnMonsterOnGroundBelow(mobObj3, new Packages.java.awt.Point(spawnPosX[i], spawnPosY[i]));
}
}
} else {
spawnPosX = [2303, 1832, 1656, 1379, 1171];
spawnPosY = [240, 150, 300, 150, 240];
for(var i = 0; i < maxSpawn; i++) {
var rndMob = 9400519 + Math.floor(Math.random() * 4);
var rndPos = Math.floor(Math.random() * 5);
var mobObj = MapleLifeFactory.getMonster(rndMob);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(spawnPosX[rndPos], spawnPosY[rndPos]));
}
}
}
function generateCombo1() {
var positions = Array(0,0,0,0,0,0,0,0,0);
var rndPicked = Math.floor(Math.random() * Math.pow(3, 5));
while(rndPicked > 0) {
(positions[rndPicked % 3])++;
rndPicked = Math.floor(rndPicked / 3);
}
var returnString = "";
for(var i = 0; i < positions.length; i++) {
returnString += positions[i];
if(i != positions.length - 1)
returnString += ",";
}
return returnString;
}
function generateCombo2() {
var toPick = 5, rndPicked;
var positions = Array(0,0,0,0,0,0,0,0,0);
while(toPick > 0) {
rndPicked = Math.floor(Math.random() * 9);
if(positions[rndPicked] == 0) {
positions[rndPicked] = 1;
toPick--;
}
}
var returnString = "";
for(var i = 0; i < positions.length; i++) {
returnString += positions[i];
if(i != positions.length - 1)
returnString += ",";
}
return returnString;
}
var status = 0;
var curMap, stage;
function clearStage(stage, eim, curMap) {
eim.setProperty(stage + "stageclear", "true");
if(stage > 1) {
eim.showClearEffect(true);
eim.linkToNextStage(stage, "apq", curMap); //opens the portal to the next map
}
else {
cm.getMap().getPortal("go01").setPortalState(false);
var val = Math.floor(Math.random() * 3);
eim.showClearEffect(670010200, "gate" + val, 2);
cm.getMap().getPortal("go0" + val).setPortalState(true);
eim.linkPortalToScript(stage, "go0" + val, "apq0" + val, curMap);
}
}
function start() {
curMap = cm.getMapId();
stage = Math.floor((curMap - 670010200) / 100) + 1;
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else if (mode == 0){
cm.dispose();
} else {
if (mode == 1)
status++;
else
status--;
var eim = cm.getPlayer().getEventInstance();
if(eim.getProperty(stage.toString() + "stageclear") != null) {
cm.sendNext("The portal is already open, advance for the trials that awaits you there.");
}
else {
if (eim.isEventLeader(cm.getPlayer())) {
var state = eim.getIntProperty("statusStg" + stage);
if(state == -1) { // preamble
if(stage == 1) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, talk to #p9201047#, he will pass to you further details of the mission. After shattering the Magik Mirror down there, return the shard to #p9201047# and come here to gain access to the next stage.");
else if(stage == 2) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, let 5 of your party members climb up the platforms in such a way to try for a combination to unlock the portal to the next level. When you feel ready, talk to me and I'll let you know the situation. However, be prepared, as in the case the portal does not get unlocked after a few tries, monsters will spawn.");
else if(stage == 3) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, let 5 of your party members climb up the platforms, one on each, in such a way to try for a combination to unlock the portal to the next level. When you feel ready, talk to me and I'll let you know the situation. Take hint: upon failing, count the number of slimes appearing on the scene, that will tell how many of you had their position right.");
var st = (autopass) ? 2 : 0;
eim.setProperty("statusStg" + stage, st);
}
else { // check stage completion
if(state == 2) {
eim.setProperty("statusStg" + stage, 1);
clearStage(stage, eim, curMap);
cm.dispose();
return;
}
var map = cm.getPlayer().getMap();
if(stage == 1) {
if(eim.getIntProperty("statusStg" + stage) == 1) {
clearStage(stage, eim, curMap);
} else {
cm.sendOk("Talk with #p9201047# for more info on this stage.");
}
} else if(stage == 2 || stage == 3) {
if(map.countMonsters() == 0) {
objset = [0,0,0,0,0,0,0,0,0];
var playersOnCombo = 0;
var party = cm.getEventInstance().getPlayers();
for (var i = 0; i < party.size(); i++) {
for (var y = 0; y < map.getAreas().size(); y++) {
if (map.getArea(y).contains(party.get(i).getPosition())) {
playersOnCombo++;
objset[y] += 1;
break;
}
}
}
if (playersOnCombo == 5/* || cm.getPlayer().gmLevel() > 1*/ || debug) {
var comboStr = eim.getProperty("stage" + stage + "combo");
if (comboStr == null || comboStr == "") {
if (stage == 2) {
comboStr = generateCombo1();
} else {
comboStr = generateCombo2();
}
eim.setProperty("stage" + stage + "combo", comboStr);
if(debug) print("generated " + comboStr + " for stg" + stage + "\n");
}
var combo = comboStr.split(',');
var correctCombo = true;
var guessedRight = objset.length;
var playersRight = 0;
if(!debug) {
for (i = 0; i < objset.length; i++) {
if (parseInt(combo[i]) != objset[i]) {
correctCombo = false;
guessedRight--;
} else {
if(objset[i] > 0) playersRight++;
}
}
} else {
for (i = 0; i < objset.length; i++) {
var ci = cm.getPlayer().countItem(4000000 + i);
if (ci != parseInt(combo[i])) {
correctCombo = false;
guessedRight--;
} else {
if(ci > 0) playersRight++;
}
}
}
if (correctCombo/* || cm.getPlayer().gmLevel() > 1*/) {
eim.setProperty("statusStg" + stage, 1);
clearStage(stage, eim, curMap);
cm.dispose();
} else {
var miss = eim.getIntProperty("missCount") + 1;
var maxMiss = (stage == 2) ? 7 : 1;
if (miss < maxMiss) { //already implies stage 2
eim.setIntProperty("missCount", miss);
if(guessedRight == 6) { //6 unused slots on this stage
cm.sendNext("All ropes weigh differently. Think your next course of action, then try again.");
cm.mapMessage(5, "Amos: Hmm... All ropes weigh differently.");
}
else {
cm.sendNext("One rope weigh the same. Think your next course of action, then try again.");
cm.mapMessage(5, "Amos: Hmm... One rope weigh the same.");
}
} else {
spawnMobs(playersRight);
eim.setIntProperty("missCount", 0);
if(stage == 2) {
eim.setProperty("stage2combo", "");
cm.sendNext("You have failed to discover the right combination, now it shall be reset. Start over again!");
cm.mapMessage(5, "Amos: You have failed to discover the right combination, now it shall be reset. Start over again!");
}
}
eim.showWrongEffect();
cm.dispose();
}
} else {
if(stage == 2) cm.sendNext("It looks like you guys haven't found the ways of this trial yet. Think on an arrangement of 5 members on the platforms. Remember, exactly 5 are allowed to stand on the platforms, and if you move it may not count as an answer, so please keep that in mind. Keep going!");
else cm.sendNext("It looks like you guys haven't found the ways of this trial yet. Think on an arrangement of party members on different platforms. Remember, exactly 5 are allowed to stand on the platforms, and if you move it may not count as an answer, so please keep that in mind. Keep going!");
cm.dispose();
}
} else {
cm.sendNext("Defeat all mobs before trying for a combination.");
}
}
}
} else {
cm.sendNext("Please tell your #bParty-Leader#k to come talk to me.");
}
}
cm.dispose();
}
}

197
scripts/npc/9201045.js Normal file
View File

@@ -0,0 +1,197 @@
/*
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 = Amos (PQ)
@ Map = AmoriaPQ maps
@ Function = AmoriaPQ Host
@
@ Description: Last stages of the Amorian Challenge
*/
var debug = false;
var status = 0;
var curMap, stage;
function isAllGatesOpen() {
var map = cm.getPlayer().getMap();
for(var i = 0; i < 7; i++) {
var gate = map.getReactorByName("gate0" + i);
if(gate.getState() != 4) {
return false;
}
}
return true;
}
function clearStage(stage, eim, curMap) {
eim.setProperty(stage + "stageclear", "true");
eim.showClearEffect(true);
eim.linkToNextStage(stage, "apq", curMap); //opens the portal to the next map
}
function start() {
curMap = cm.getMapId();
stage = Math.floor((curMap - 670010200) / 100) + 1;
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else if (mode == 0){
cm.dispose();
} else {
if (mode == 1)
status++;
else
status--;
var eim = cm.getPlayer().getEventInstance();
if(eim.getProperty(stage.toString() + "stageclear") != null) {
if(stage < 5) cm.sendNext("The portal is already open, advance for the trials that awaits you there.");
else if(stage == 5) eim.warpEventTeamToMapSpawnPoint(670010700, 0);
else {
if(cm.isEventLeader()) {
if(eim.getIntProperty("marriedGroup") == 0) {
eim.restartEventTimer(1 * 60 * 1000);
eim.warpEventTeam(670010800);
} else {
eim.setIntProperty("marriedGroup", 0);
eim.restartEventTimer(2 * 60 * 1000);
eim.warpEventTeamToMapSpawnPoint(670010750, 1);
}
} else {
cm.sendNext("Wait for the leader's command to start the bonus phase.");
}
}
}
else {
if(stage != 6) {
if (eim.isEventLeader(cm.getPlayer())) {
var state = eim.getIntProperty("statusStg" + stage);
if(state == -1) { // preamble
if(stage == 4) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. In this stage, collect me #b50 #t4031597##k from the mobs around here.");
else if(stage == 5) cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k of the Amorian Challenge. That was quite the run to reach here, eh? Well, that was your task this stage here, anyway: survival! Firstly, have anyone alive gathered here before challenging the boss.");
var st = (debug) ? 2 : 0;
eim.setProperty("statusStg" + stage, st);
}
else { // check stage completion
if(stage == 4) {
if(cm.haveItem(4031597, 50)) {
cm.gainItem(4031597, -50);
var tl = eim.getTimeLeft();
if(tl >= 5 * 60 * 1000) {
eim.setProperty("timeLeft", tl);
eim.restartEventTimer(4 * 60 * 1000);
}
cm.sendNext("Well done! Let me open the gate for you now.");
cm.mapMessage(5, "Amos: The time runs short now. Your objective is to open the gates and gather together on the other side of the next map. Good luck!");
clearStage(stage, eim, curMap);
} else {
cm.sendNext("Hey, didn't you pay heed? I demand #r50 #t4031597##k for the success of this trial.");
}
} else if(stage == 5) {
var pass = true;
if(eim.isEventTeamTogether()) {
var party = cm.getEventInstance().getPlayers();
var area = cm.getMap().getArea(2);
for (var i = 0; i < party.size(); i++) {
var chr = party.get(i);
if (chr.isAlive() && !area.contains(chr.getPosition())) {
pass = false;
break;
}
}
} else {
pass = false;
}
if(pass) {
if(isAllGatesOpen()) {
var tl = eim.getProperty("timeLeft");
if(tl != null) {
var tr = eim.getTimeLeft();
var tl = parseFloat(tl);
eim.restartEventTimer(tl - (4 * 60 * 1000 - tr));
}
cm.sendNext("Okay, your team is already gathered. Talk to me when you guys feel ready to fight the #rGeist Balrog#k.");
cm.mapMessage(5, "Amos: Now only the boss fight remains! Once inside, talk to me only if you want to join the boss fight, you will be transported to action immediately.");
clearStage(stage, eim, curMap);
} else {
cm.sendNext("You guys reached here by teleporting, eh? I can tell it. This is a shame, all gates needs to be open to fulfill this stage. If you still have the time, backtrack your steps and take down those gates.");
}
} else {
cm.sendNext("Your team has not gathered nearby yet. Give them some time to reach here.");
}
}
}
} else {
cm.sendNext("Please tell your #bParty-Leader#k to come talk to me.");
}
} else {
var area = cm.getMap().getArea(0);
if (area.contains(cm.getPlayer().getPosition())) {
if(cm.getPlayer().isAlive()) {
cm.warp(670010700, "st01");
} else {
cm.sendNext("Oy stand back... You are already dead.");
}
} else {
if(cm.isEventLeader()) {
if(cm.haveItem(4031594, 1)) {
cm.gainItem(4031594, -1);
cm.sendNext("Congratulations! Your party defeated the Geist Balrog, thus #bcompleting the Amorian Challenge#k! Talk to me again to start the bonus stage.");
clearStage(stage, eim, curMap);
eim.clearPQ();
} else {
cm.sendNext("How is it? Are you going to retrieve me the #b#t4031594##k? That's your last trial, hold on!")
}
} else {
cm.sendNext("Please tell your #bParty-Leader#k to come talk to me.");
}
}
}
}
cm.dispose();
}
}

84
scripts/npc/9201046.js Normal file
View File

@@ -0,0 +1,84 @@
/*
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 = Amos (PQ)
@ Map = AmoriaPQ maps
@ Function = AmoriaPQ Host
@
@ Description: Bonus stages of the Amorian Challenge
*/
var debug = false;
var status = 0;
var curMap, stage;
function start() {
curMap = cm.getMapId();
stage = Math.floor((curMap - 670010200) / 100) + 1;
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else if (mode == 0){
cm.dispose();
} else {
if (mode == 1)
status++;
else
status--;
var eim = cm.getPlayer().getEventInstance();
if(curMap == 670010750) {
if(cm.haveItem(4031597, 35)) {
if(cm.canHold(1102101) && eim.getIntProperty("marriedGroup") == 0) {
eim.setIntProperty("marriedGroup", 1);
var baseId = (cm.getPlayer().getGender() == 0) ? 1102101 : 1102104;
var rnd = Math.floor(Math.random() * 3);
cm.gainItem(baseId + rnd);
cm.sendNext("Bravo! You are the first to claim the prize for fetching 35 #t4031597#. Take this cape as merit for your feat.");
cm.gainItem(4031597, -35);
cm.gainExp(4000 * cm.getPlayer().getExpRate());
} else if(eim.getIntProperty("marriedGroup") == 0) {
cm.sendNext("Check if you have a slot available before talking about receiving prizes!");
} else {
cm.sendNext("35 #t4031597#. Nicely done, too bad someone took the prize first. Hurry up to get the last moments of the bonus stage!");
cm.gainItem(4031597, -35);
cm.gainExp(4000 * cm.getPlayer().getExpRate());
}
} else {
cm.sendNext("To claim a prize here, get to me 35 #t4031597# from the mobs spawned from the boxes. Only the #rfirst player can claim the big prize#k, although others can still claim an EXP boost from this feat. Alternatively, one can choose to #bskip this bonus stage#k and go for the usual one by passing #bthrough the portals#k.");
}
} else {
cm.sendNext("Hurry up to get the last moments of the bonus stage!");
}
cm.dispose();
}
}

88
scripts/npc/9201047.js Normal file
View File

@@ -0,0 +1,88 @@
/*
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/>.
*/
/* The Glimmer Man
Amoria PQ Stg1/exit
*/
var status;
var curMap, stage;
function start() {
curMap = cm.getMapId();
stage = Math.floor((curMap - 670010200) / 100) + 1;
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
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.getMapId() != 670010200) {
cm.sendYesNo("So, are you going to leave this place?");
} else {
if(cm.isEventLeader()) {
var eim = cm.getEventInstance();
var st = eim.getIntProperty("statusStg" + stage);
if(cm.haveItem(4031595, 1)) {
cm.gainItem(4031595, -1);
eim.setIntProperty("statusStg" + stage, 1);
cm.sendOk("You retrieved the #t4031595#, splendid! You may report to Amos about your success on this task.");
} else if(st < 1 && cm.getMap().countMonsters() == 0) {
eim.setIntProperty("statusStg" + stage, 1);
var mapObj = cm.getMap();
mapObj.toggleDrops();
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400518);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(-245, 810));
cm.sendOk("The fierry appeared! Defeat it to get the #b#t4031596##k!");
} else {
if(st < 1) cm.sendOk("Your task is to recover a shard of the Magik Mirror. To do so, you will need a #b#t4031596##k, that drops on a fierry that appears when all other mobs are killed. To access the rooms the mobs are, pick the portal corresponding to your gender and kill all mobs there. Ladies take the left side, gentlemen the right side.");
else cm.sendOk("Your task is to recover a shard of the Magik Mirror. Defeat the fierry to get the #b#t4031596##k.");
}
} else {
cm.sendOk("Your task is to recover a shard of the Magik Mirror. To do so, you will need a #b#t4031596##k, that drops on a fierry that appears when all other mobs are killed. To access the rooms the mobs are, pick the portal corresponding to your gender and kill all mobs there. Ladies take the left side, gentlemen the right side. #bYour leader#k must bring the #b#t4031595##k to have my pass.");
}
cm.dispose();
}
} else if(status == 1) {
cm.warp(670010000, "st00");
cm.dispose();
}
}
}

View File

@@ -1,76 +1,68 @@
/*
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: Amos
* @map: Entrance of Amorian Challenge (670010100)
* @func: Amoria PQ
*/
/* @Author Jvlaple */
var minLevel = 40;
var maxLevel = 255;
var minPlayers = 0;
var maxPlayers = 6;
//var minMarried = 6;
//var minGirls = 1;
//var minBoys = 1;
var status = 0;
var em = null;
function start() {
if (cm.getParty() == null) {
cm.sendOk("Please come back to me after you've formed a party.");
cm.dispose();
return;
}
if (!cm.isLeader()) {
cm.sendOk("You are not the party leader.");
cm.dispose();
} else {
var party = cm.getParty().getMembers();
var next = true;
var levelValid = 0;
var inMap = 0;
if (party.size() < minPlayers || party.size() > maxPlayers)
next = false;
else {
for (var i = 0; i < party.size() && next; i++) {
if ((party.get(i).getLevel() >= minLevel) && (party.get(i).getLevel() <= maxLevel))
levelValid++;
if (party.get(i).getMapid() == cm.getPlayer().getMapId())
inMap++;
}
if (levelValid < minPlayers || inMap < minPlayers)
next = false;
}
if (next) {
var em = cm.getEventManager("AmoriaPQ");
if (em == null)
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
else {
if(!em.startInstance(cm.getParty(),cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
} else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
em = cm.getEventManager("AmoriaPQ");
if(em == null) {
cm.sendOk("The Amoria PQ has encountered an error.");
cm.dispose();
return;
}
cm.sendSimple("#e#b<Party Quest: Amorian Challenge>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nIf you're brave enough to attempt the Amorian Challenge, join with others like you and let your #bparty leader#k talk to me. If a party filled with whole married couples register to the challenge, better prizes awaits there.#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: Amorian Challenge>#k#n\r\nI am Amos, hoster of the well-round famed Amorian Challenge. The event consist of many team puzzles, where cooperation is the fundamental key for progress. Team up with other players to attempt for the bonus stage, where many goodies can be obtained at the end of the event. If an all-couple party is formed, they can get even better prizes on the extra bonus stage.");
cm.dispose();
}
}
}
cm.dispose();
}
else {
cm.sendOk("Your party is not a party of six. Make sure all your members are present and qualified to participate in this quest. I see #b" + levelValid.toString() + " #kmembers are in the right level range, and #b" + inMap.toString() + "#k are in my map. If this seems wrong, #blog out and log back in,#k or reform the party.");
cm.dispose();
}
}
}
}

View File

@@ -129,7 +129,7 @@ function writeSolaxiaCommandsLv3() { //GM
addCommand("notice", "");
addCommand("rip", "");
addCommand("openportal", "");
addCommand("closeportals", "");
addCommand("closeportal", "");
addCommand("pe", "");
addCommand("startevent", "");
addCommand("endevent", "");

25
scripts/portal/apq00.js Normal file
View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.warp(670010300, 0);
return true;
}

25
scripts/portal/apq01.js Normal file
View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.warp(670010301, 0);
return true;
}

25
scripts/portal/apq02.js Normal file
View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.warp(670010302, 0);
return true;
}

25
scripts/portal/apq1.js Normal file
View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.warp(670010400, 0);
return true;
}

25
scripts/portal/apq2.js Normal file
View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.warp(670010500, 0);
return true;
}

25
scripts/portal/apq3.js Normal file
View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.warp(670010600, 0);
return true;
}

View File

@@ -0,0 +1,25 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.message("The gate is not opened yet.");
return false;
}

View File

@@ -20,19 +20,16 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*6702001.js - Door of APQ
*@author Jvlaple
* @Author Ronan
*/
function act() {
var eim = rm.getPlayer().getEventInstance();
var party = eim.getPlayers();
var numOpen = Integer.parseInt(eim.getProperty("openedDoors"));
var mf = eim.getMapFactory();
var map = mf.getMap(670010600);
eim.setProperty("openedDoors", numOpen + 1);
for (var i = 0; i < party.size(); i++) {
party.get(i).changeMap(map, map.getPortal((numOpen + 1) * 2));
}
}
function enter(pi) {
var name = pi.getPortal().getName().substring(2, 4);
var gate = pi.getPlayer().getMap().getReactorByName("gate" + name);
if(gate != null && gate.getState() == 4) {
pi.warp(670010600, "gt" + name + "PIB");
return true;
} else {
pi.message("The gate is not opened yet.");
return false;
}
}

View File

@@ -0,0 +1,20 @@
function enter(pi) {
var map = pi.getPlayer().getMap();
if(pi.getPortal().getName() == "female00") {
if (pi.getPlayer().getGender() == 1) {
pi.warp(map.getId(), "female01");
return true;
} else {
pi.message("This portal leads to the girls' area, try the portal at the other side.");
return false;
}
} else {
if (pi.getPlayer().getGender() == 0) {
pi.warp(map.getId(), "male01");
return true;
} else {
pi.message("This portal leads to the boys' area, try the portal at the other side.");
return false;
}
}
}

View File

@@ -0,0 +1,29 @@
/*
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/>.
*/
/*
Stage Bonus - Amoria PQ
@Author Ronan
*/
function enter(pi) {
pi.warp(670010800);
return true;
}

View File

@@ -25,10 +25,12 @@ function enter(pi) {
pi.removeAll(4031508);
}
pi.warp(230000003, "out00");
if (pi.getClient().getChannelServer().getMapFactory().getMap(923010000).getCharacters().size() == 0) {
pi.getClient().getChannelServer().getMapFactory().getMap(923010000).clearMapObjects();
}
var pCount = pi.getPlayer().countItem(4031507);
var rCount = pi.getPlayer().countItem(4031508);
if(pCount > 5) pi.gainItem(4031507, -1 * (pCount - 5));
if(rCount > 5) pi.gainItem(4031508, -1 * (rCount - 5));
pi.warp(230000003, "out00");
return true;
}

93
scripts/quest/20526.js Normal file
View File

@@ -0,0 +1,93 @@
/*
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 Lana
*/
var status = -1;
function start(mode, type, selection) {
if (mode == -1) {
qm.dispose();
return;
}
else if (status >= 2 && mode == 0) {
qm.dispose();
return;
}
if(mode == 1) status++;
else status--;
if (status == 0) {
qm.sendNext("You lost your Mimiana?! Geez, you have to be zealous for them, as they are a gift of the Empress to us! You have to be teached once again: The riding for Knights are a bit different from the rides available for regular folks. The takes place through a creature that is of the Mimi race that can be found on this island; they are called #bMimianas#k. Instead of riding monsters, the Knights ride Mimiana. There's one thing that you should never, ever forget.");
} else if (status == 1) {
qm.sendNextPrev("Dont't think of this as just a form of mount or transportation. These mounts can be your friend, your comrade, your colleague... all of the above. Even a friend close enough to entrust your life! That's why the Knights of Ereve actually grow their own mounts.");
} else if (status == 2) {
qm.sendAcceptDecline("Now, here's a Mimiana egg. Are you ready to raise a Mimiana and have it as your traveling companion for the rest of its life?");
} else if (status == 3) {
if(!qm.haveItem(4220137) && !qm.canHold(4220137)) {
qm.sendOk("Make up a room on your ETC tab so I can give you the Mimiana egg.");
qm.dispose();
return;
}
qm.forceStartQuest();
if(!qm.haveItem(4220137)) qm.gainItem(4220137);
qm.sendOk("Mimiana's egg can be raised by #bsharing your daily experiences with it#k. Once Mimiana fully grows up, please come see me. One more thing, I talked with #p2060005# beforehand and retrieved the #b#t4032117##k for you. The price to charge remains the same: #r10,000,000 mesos#k.");
qm.dispose();
}
}
function end(mode, type, selection) {
if (mode != 1) {
qm.dispose();
return;
}
status++;
if (status == 0) {
qm.sendNext("Hey there! How's Mimiana's egg?");
} else if (status == 1) { //pretty sure there would need to have an egg EXP condition... Whatever.
if(!qm.haveItem(4220137)) {
qm.sendOk("I see, you lost your egg... You need to be more careful when raising a baby Mimiana!");
qm.dispose();
return;
}
if(!qm.canHold(1902005)) {
qm.sendOk("Please, make a space on your EQUIP tab for your Mimiana!");
qm.dispose();
return;
}
qm.sendOk("Okay, you now may mount Mimiana again. Take good care of it this time.");
qm.gainItem(1902005, 1);
qm.gainItem(4220137, -1);
qm.gainMeso(-10000000);
qm.forceCompleteQuest();
qm.dispose();
}
}

View File

@@ -0,0 +1,39 @@
/*
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
*
* Box - bonus for couples
*
*/
importPackage(Packages.server.life);
function act(){
var startId = 9400523;
var mobObj, mapObj = rm.getMap();
for(var i = 0; i < 7; i++) {
mobObj = MapleLifeFactory.getMonster(startId + Math.floor(Math.random() * 3));
mapObj.spawnMonsterOnGroundBelow(mobObj, rm.getReactor().getPosition());
}
}

View File

@@ -0,0 +1,39 @@
/*
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
*
* Box - bonus for couples
*
*/
importPackage(Packages.server.life);
function act(){
var startId = 9400523;
var mobObj, mapObj = rm.getMap();
for(var i = 0; i < 7; i++) {
mobObj = MapleLifeFactory.getMonster(startId + Math.floor(Math.random() * 3));
mapObj.spawnMonsterOnGroundBelow(mobObj, rm.getReactor().getPosition());
}
}

View File

@@ -0,0 +1,39 @@
/*
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
*
* Box - bonus for couples
*
*/
importPackage(Packages.server.life);
function act(){
var startId = 9400523;
var mobObj, mapObj = rm.getMap();
for(var i = 0; i < 7; i++) {
mobObj = MapleLifeFactory.getMonster(startId + Math.floor(Math.random() * 3));
mapObj.spawnMonsterOnGroundBelow(mobObj, rm.getReactor().getPosition());
}
}