GMS-like Wedding + Scissors of Karma + Maple Life + Buyback

Properly developed the Marriage feature in the source.
Added TRAVEL_RATE server flag, a modifier for the travel frequency rate.
Corrected stance for players in 3rd party view when entering a map to work similarly as GMS.
Fixed mobs spamming skills incoherently.
Added code support for old GMS-like PQ NPCs, where party leaders just need to click once to start a new PQ.
Implemented podium system for the Hall of Fame PlayerNPCs.
Improved character load-out system, now using way less queries to the DB in the process.
Fixed birthday field for accounts not being read correctly.
Further implemented the incomplete yet-existing Scissors of Karma mechanic.
Fixed Duey not propagating item flags when packaging an item.
Added a custom buyback system.
Refactored the character creation system, now offering support for Maple Life.
Fixed some issues with the PlayerNPC positioning system.
Added server flag allowing AP assignment for novices (beginners under level 11).
Fixed Strategy Time (GPQ) announcement being sent twice to guilds in certain cases.
Tweaked mount EXP system now awarding it accordingly with the amount of tiredness healed.
Removed the randomness aspect of closeness gain when feeding the pet, now acting accordingly with amount of fullness gained.
Fixed an exploit with Arwen script.
Fixed travel-back from Florina forcefully sending players to Lith Harbor in certain situations.
Thoroughly reviewed job skill questlines for Explorers and Aran.
Localhost edit: removed MTS block in certain maps (useful for the buyback system).
Localhost edit: removed party blocks for novices.
Localhost edit: removed AP assigning block for novices.
Localhost edit: removed speed cap.
Localhost edit: removed Maker block popping up when inputting ATK gems on non-weapons.
This commit is contained in:
ronancpl
2018-06-05 02:40:53 -03:00
230 changed files with 11510 additions and 3591 deletions

View File

@@ -13,6 +13,10 @@ var beginTime = 5 * 60 * 1000; //The time to begin the ride
var rideTime = 1 * 60 * 1000; //The time that require move to destination
function init() {
closeTime = em.getTransportationTime(closeTime);
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
KC_bfd = em.getChannelServer().getMapFactory().getMap(540010100);
CBD_bfd = em.getChannelServer().getMapFactory().getMap(540010001);
Plane_to_CBD = em.getChannelServer().getMapFactory().getMap(540010101);

View File

@@ -24,6 +24,7 @@
*/
var isPq = true;
var onlyMarriedPlayers = true;
var minPlayers = 6, maxPlayers = 6;
var minLevel = 40, maxLevel = 255;
var entryMap = 670010200;
@@ -58,6 +59,7 @@ function setEventRequirements() {
else reqStr += minLevel;
reqStr += "\r\n At least 1 of both genders";
if(onlyMarriedPlayers) reqStr += "\r\n All married";
reqStr += "\r\n Time limit: ";
reqStr += eventTime + " minutes";
@@ -84,7 +86,7 @@ function setEventRewards(eim) {
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
var eligible = [];
var hasLeader = false;
var hasLeader = false, hasNotMarried = false;
var mask = 0;
if(party.size() > 0) {
@@ -95,6 +97,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
if(ch.getMapId() == recruitMap && ch.getLevel() >= minLevel && ch.getLevel() <= maxLevel) {
if(ch.isLeader()) hasLeader = true;
if(!ch.getPlayer().isMarried()) hasNotMarried = true;
eligible.push(ch);
mask |= (1 << ch.getPlayer().getGender());
@@ -103,6 +106,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers && mask == 3)) eligible = [];
if(onlyMarriedPlayers && hasNotMarried) eligible = [];
return eligible;
}
@@ -155,8 +159,19 @@ function setup(level, lobbyid) {
return eim;
}
function isTeamAllCouple(eim) { // all players married each other, not implemented
return false;
function isTeamAllCouple(eim) { // everyone partner of someone on the team
var eventPlayers = eim.getPlayers();
for (var iterator = eventPlayers.iterator(); iterator.hasNext();) {
var chr = iterator.next();
var pid = chr.getPartnerId();
if(pid <= 0 || eim.getPlayerById(pid) == null) {
return false;
}
}
return true;
}
function afterSetup(eim) {

View File

@@ -19,6 +19,12 @@ var invasionDelayTime = 1 * 60 * 1000; //The time to balrog ship approach
var invasionDelay = 5 * 1000; //The time that spawn balrog
function init() {
closeTime = em.getTransportationTime(closeTime);
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
invasionStartTime = em.getTransportationTime(invasionStartTime);
invasionDelayTime = em.getTransportationTime(invasionDelayTime);
Orbis_btf = em.getChannelServer().getMapFactory().getMap(200000112);
Ellinia_btf = em.getChannelServer().getMapFactory().getMap(101000301);
Boat_to_Orbis = em.getChannelServer().getMapFactory().getMap(200090010);

View File

@@ -54,6 +54,10 @@ var beginTime = 5 * 60 * 1000; //The time to begin the ride
var rideTime = 5 * 60 * 1000; //The time that require move to destination
function init() {
closeTime = em.getTransportationTime(closeTime);
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
Orbis_btf = em.getChannelServer().getMapFactory().getMap(200000132);
Leafre_btf = em.getChannelServer().getMapFactory().getMap(240000111);
Cabin_to_Orbis = em.getChannelServer().getMapFactory().getMap(200090210);

View File

@@ -1,194 +0,0 @@
/*
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 Jvlaple
*
* Wedding for odinMS
*/
importPackage(java.lang);
importPackage(Packages.world);
importPackage(Packages.client);
importPackage(Packages.server.maps);
var exitMap;
var altarMap;
var cakeMap;
var instanceId;
var minPlayers = 1;
function init() {
exitMap = em.getChannelServer().getMapFactory().getMap(680000500); //Teh exit map :) <---------t
altarMap = em.getChannelServer().getMapFactory().getMap(680000210); //Teh altar map
cakeMap = em.getChannelServer().getMapFactory().getMap(680000300); //Teh cake
instanceId = 1;
}
function monsterValue(eim, mobId) {
return 1;
}
function setup(eim) {
var instanceName = "CathedralWedding" + instanceId;
var eim = em.newInstance(instanceName);
instanceId++;
var eim = em.newInstance(instanceName);
var mf = eim.getMapFactory();
var map = mf.getMap(680000200);//wutt
//Lets make the clock continue through all maps xD
em.schedule("playerAltar", 3 * 60000);
eim.setProperty("hclicked", 0);
eim.setProperty("wclicked", 0);
eim.setProperty("entryTimestamp",System.currentTimeMillis() + (3 * 60000));
return eim;
}
function afterSetup(eim) {}
function playerEntry(eim, player) {
var map = eim.getMapInstance(680000200);
player.changeMap(map, map.getPortal(0));
//1st - 20 min 2nd - 5 min 3rd 5 min xD
//player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(1200));
//player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(180));
player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock((Long.parseLong(eim.getProperty("entryTimestamp")) - System.currentTimeMillis()) / 1000));
}
//lets forget this bullshit...
function playerDead(eim, player) {
}
function playerRevive(eim, player) {
//how the fuck can this happen? o.O
}
function playerDisconnected(eim, player) {
playerExit(eim, player);//kick him/her
}
function leftParty(eim, player) { //this doesnt fucking matter...
}
function disbandParty(eim) {
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, exitMap.getPortal(0));
}
function playerWarpAltar(eim, player) {
if ((player.getName() != eim.getProperty("husband")) && (player.getName() != eim.getProperty("wife"))){
player.changeMap(altarMap, altarMap.getPortal(0));
player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(300));
}else{
player.changeMap(altarMap, altarMap.getPortal(2));
player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(300));
player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.serverNotice(6, "Please talk to High Priest John now!"));
}
}
function playerWarpCake(eim, player) {
player.changeMap(cakeMap, cakeMap.getPortal(0));
player.getClient().getSession().write(net.sf.odinms.tools.MaplePacketCreator.getClock(300));
}
function playerAltar(eim, player) {
var iter = em.getInstances().iterator();
while (iter.hasNext()) {
var eim = iter.next();
if (eim.getPlayerCount() > 0) {
var pIter = eim.getPlayers().iterator();
while (pIter.hasNext()) {
playerWarpAltar(eim, pIter.next());
}
}
em.schedule("playerCake", 5 * 60000);
//eim.dispose();
}
}
function playerCake(eim, player) {
var iter = em.getInstances().iterator();
while (iter.hasNext()) {
var eim = iter.next();
if (eim.getPlayerCount() > 0) {
var pIter = eim.getPlayers().iterator();
while (pIter.hasNext()) {
playerWarpCake(eim, pIter.next());
}
}
em.schedule("timeOut", 5 * 60000);
//eim.dispose();
}
}
//Those offline cuntts
function removePlayer(eim, player) {
eim.unregisterPlayer(player);
player.getMap().removePlayer(player);
player.setMap(exitMap);
}
function clearPQ(eim) {
//Wedding? IDK about gifts o.O
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
}
function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function timeOut() {
var iter = em.getInstances().iterator();
while (iter.hasNext()) {
var eim = iter.next();
if (eim.getPlayerCount() > 0) {
var pIter = eim.getPlayers().iterator();
while (pIter.hasNext()) {
playerExit(eim, pIter.next());
}
}
eim.dispose();
}
}
function dispose() {
}

199
scripts/event/ElnathPQ.js Normal file
View File

@@ -0,0 +1,199 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
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
* @event: ElNath PQ
*/
var isPq = true;
var minPlayers = 1, maxPlayers = 4;
var minLevel = 80, maxLevel = 255;
var entryMap = 921100300;
var exitMap = 211040100;
var recruitMap = 211000001;
var minMapId = 921100300;
var maxMapId = 921100300;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 0];
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
}
function setEventRequirements() {
var reqStr = "";
reqStr += "\r\n Number of players: ";
if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers;
else reqStr += minPlayers;
reqStr += "\r\n Level range: ";
if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel;
else reqStr += minLevel;
reqStr += "\r\n Time limit: ";
reqStr += eventTime + " minutes";
em.setProperty("party", reqStr);
}
function 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("Tylus" + lobbyid);
eim.setProperty("level", level);
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
return eim;
}
function afterSetup(eim) {}
function respawnStages(eim) {
eim.getMapInstance(entryMap).instanceMapRespawn();
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 playerLeft(eim, player) {
if(!eim.isEventCleared()) {
playerExit(eim, player);
}
}
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)) {
end(eim);
}
else
playerLeft(eim, player);
}
function disbandParty(eim) {
if (!eim.isEventCleared()) {
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 clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
}
function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -34,6 +34,10 @@ var beginTime = 5 * 60 * 1000; //The time to begin the ride
var rideTime = 5 * 60 * 1000; //The time that require move to destination
function init() {
closeTime = em.getTransportationTime(closeTime);
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
Orbis_btf = em.getChannelServer().getMapFactory().getMap(200000152);
Ariant_btf = em.getChannelServer().getMapFactory().getMap(260000110);
Genie_to_Orbis = em.getChannelServer().getMapFactory().getMap(200090410);

View File

@@ -12,7 +12,9 @@ var onRide;
//Time Setting is in millisecond
var rideTime = 60 * 1000;
function init() {}
function init() {
rideTime = em.getTransportationTime(rideTime);
}
function setup() {
var eim = em.newInstance("Hak_" + + em.getProperty("player"));

View File

@@ -156,7 +156,7 @@ function playerLeft(eim, player) {
}
function changedMap(eim, player, mapid) {
if (mapid < minMapId || mapid > maxMapId) {
if (mapid < minMapId || mapid > maxMapId || mapid == 910010300) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);

View File

@@ -12,7 +12,9 @@ var onRide;
//Time Setting is in millisecond
var rideTime = 10 * 1000;
function init() {}
function init() {
rideTime = em.getTransportationTime(rideTime);
}
function setup() {
var eim = em.newInstance("KerningTrain_" + em.getProperty("player"));

View File

@@ -13,6 +13,10 @@ var beginTime = 1 * 60 * 1000; //The time to begin the ride
var rideTime = 4 * 60 * 1000; //The time that require move to destination
function init() {
closeTime = em.getTransportationTime(closeTime);
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
KC_Waiting = em.getChannelServer().getMapFactory().getMap(600010004);
NLC_Waiting = em.getChannelServer().getMapFactory().getMap(600010002);
Subway_to_KC = em.getChannelServer().getMapFactory().getMap(600010003);
@@ -34,6 +38,7 @@ function stopEntry() {
}
function takeoff() {
//sound src: https://www.soundjay.com/transportation/metro-door-close-01.mp3
KC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
NLC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));

View File

@@ -15,6 +15,10 @@ var beginTime = 5 * 60 * 1000; //The time to begin the ride
var rideTime = 5 * 60 * 1000; //The time that require move to destination
function init() {
closeTime = em.getTransportationTime(closeTime);
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
Orbis_btf = em.getChannelServer().getMapFactory().getMap(200000122);
Ludibrium_btf = em.getChannelServer().getMapFactory().getMap(220000111);
Train_to_Orbis = em.getChannelServer().getMapFactory().getMap(200090110);

View File

@@ -0,0 +1,253 @@
/**
* @author: Ronan
* @event: Cathedral Wedding
*/
var entryMap = 680000200;
var exitMap = 680000500;
var recruitMap = 680000000;
var clearMap = 680000500;
var minMapId = 680000100;
var maxMapId = 680000401;
var startMsgTime = 4;
var blessMsgTime = 5;
var eventTime = 10; // 10 minutes gathering
var ceremonyTime = 20; // 20 minutes ceremony
var blessingsTime = 15;// blessings are held until the 15th minute from the ceremony start
var partyTime = 45; // 45 minutes party
var forceHideMsgTime = 10; // unfortunately, EIM weddings don't send wedding talk packets to the server... this will need to suffice
var eventBoss = true; // spawns a Cake boss at the hunting ground
var isCathedral = true;
var lobbyRange = [0, 0];
function init() {}
function setLobbyRange() {
return lobbyRange;
}
function setEventExclusives(eim) {
var itemSet = [4031217, 4000313]; // golden key, golden maple leaf
eim.setExclusiveItems(itemSet);
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages;
evLevel = 1; //Rewards at clear PQ
itemSet = [];
itemQty = [];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = []; //bonus exp given on CLEAR stage signal
eim.setEventClearStageExp(expStages);
}
function spawnCakeBoss(eim) {
var mapObj = eim.getMapInstance(680000400);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177));
}
function setup(level, lobbyid) {
var eim = em.newInstance("Wedding" + lobbyid);
eim.setProperty("weddingId", "0");
eim.setProperty("weddingStage", "0"); // 0: gathering time, 1: wedding time, 2: ready to fulfill the wedding, 3: just married
eim.setProperty("guestBlessings", "0");
eim.setProperty("isPremium", "1");
eim.setProperty("canJoin", "1");
eim.setProperty("groomId", "0");
eim.setProperty("brideId", "0");
eim.setProperty("confirmedVows", "-1");
eim.getInstanceMap(680000400).resetPQ(level);
if(eventBoss) spawnCakeBoss(eim);
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function afterSetup(eim) {}
function respawnStages(eim) {
eim.getMapInstance(680000400).instanceMapRespawn();
eim.schedule("respawnStages", 15 * 1000);
}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.getClient().getAbstractPlayerInteraction().gainItem(4000313, 1);
player.changeMap(map, map.getPortal(0));
}
function stopBlessings(eim) {
var mapobj = eim.getMapInstance(entryMap + 10);
mapobj.dropMessage(6, "Wedding Assistant: Alright people, our couple are preparing their vows to each other right now.");
eim.setIntProperty("weddingStage", 2);
}
function sendWeddingAction(eim, type) {
var chr = eim.getLeader();
if(chr.getGender() == 0) {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
} else {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
}
}
function hidePriestMsg(eim) {
sendWeddingAction(eim, 2);
}
function showStartMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0));
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showBlessMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1));
eim.setIntProperty("guestBlessings", 1);
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showMarriedMsg(eim) {
sendWeddingAction(eim, 3);
eim.schedule("hidePriestMsg", 10 * 1000);
eim.restartEventTimer(partyTime * 60000);
}
function scheduledTimeout(eim) {
if(eim.getIntProperty("canJoin") == 1) {
em.getChannelServer().closeOngoingWedding(isCathedral);
eim.setIntProperty("canJoin", 0);
var mapobj = eim.getMapInstance(entryMap);
var chr = mapobj.getCharacterById(eim.getIntProperty("groomId"));
if(chr != null) {
chr.changeMap(entryMap + 10, "we00");
}
chr = mapobj.getCharacterById(eim.getIntProperty("brideId"));
if(chr != null) {
chr.changeMap(entryMap + 10, "we00");
}
mapobj.dropMessage(6, "Wedding Assistant: The couple are heading to the altar, hurry hurry talk to me to arrange your seat.");
eim.setIntProperty("weddingStage", 1);
eim.schedule("showStartMsg", startMsgTime * 60 * 1000);
eim.schedule("showBlessMsg", blessMsgTime * 60 * 1000);
eim.schedule("stopBlessings", blessingsTime * 60 * 1000);
eim.startEventTimer(ceremonyTime * 60000);
} else {
end(eim);
}
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function playerLeft(eim, player) {
if(!eim.isEventCleared()) {
playerExit(eim, player);
}
}
function isMarrying(eim, player) {
var playerid = player.getId();
return playerid == eim.getIntProperty("groomId") || playerid == eim.getIntProperty("brideId");
}
function changedMap(eim, player, mapid) {
if (mapid < minMapId || mapid > maxMapId) {
if (isMarrying(eim, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function changedLeader(eim, leader) {}
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
if (isMarrying(eim, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function playerDisconnected(eim, player) {
if (isMarrying(eim, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function leftParty(eim, player) {}
function disbandParty(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 isCakeBoss(mob) {
return mob.getId() == 9400606;
}
function monsterKilled(mob, eim) {
if(isCakeBoss(mob)) {
eim.showClearEffect();
eim.clearPQ();
}
}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -0,0 +1,253 @@
/**
* @author: Ronan
* @event: Chapel Wedding
*/
var entryMap = 680000100;
var exitMap = 680000500;
var recruitMap = 680000000;
var clearMap = 680000500;
var minMapId = 680000100;
var maxMapId = 680000401;
var startMsgTime = 4;
var blessMsgTime = 5;
var eventTime = 10; // 10 minutes gathering
var ceremonyTime = 20; // 20 minutes ceremony
var blessingsTime = 15;// blessings are held until the 15th minute from the ceremony start
var partyTime = 45; // 45 minutes party
var forceHideMsgTime = 10; // unfortunately, EIM weddings don't send wedding talk packets to the server... this will need to suffice
var eventBoss = true; // spawns a Cake boss at the hunting ground
var isCathedral = false;
var lobbyRange = [0, 0];
function init() {}
function setLobbyRange() {
return lobbyRange;
}
function setEventExclusives(eim) {
var itemSet = [4031217, 4000313]; // golden key, golden maple leaf
eim.setExclusiveItems(itemSet);
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages;
evLevel = 1; //Rewards at clear PQ
itemSet = [];
itemQty = [];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = []; //bonus exp given on CLEAR stage signal
eim.setEventClearStageExp(expStages);
}
function spawnCakeBoss(eim) {
var mapObj = eim.getMapInstance(680000400);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177));
}
function setup(level, lobbyid) {
var eim = em.newInstance("Wedding" + lobbyid);
eim.setProperty("weddingId", "0");
eim.setProperty("weddingStage", "0"); // 0: gathering time, 1: wedding time, 2: ready to fulfill the wedding, 3: just married
eim.setProperty("guestBlessings", "0");
eim.setProperty("isPremium", "1");
eim.setProperty("canJoin", "1");
eim.setProperty("groomId", "0");
eim.setProperty("brideId", "0");
eim.setProperty("confirmedVows", "-1");
eim.getInstanceMap(680000400).resetPQ(level);
if(eventBoss) spawnCakeBoss(eim);
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function afterSetup(eim) {}
function respawnStages(eim) {
eim.getMapInstance(680000400).instanceMapRespawn();
eim.schedule("respawnStages", 15 * 1000);
}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.getClient().getAbstractPlayerInteraction().gainItem(4000313, 1);
player.changeMap(map, map.getPortal(0));
}
function stopBlessings(eim) {
var mapobj = eim.getMapInstance(entryMap + 10);
mapobj.dropMessage(6, "Wedding Assistant: Alright people, our couple are preparing their vows to each other right now.");
eim.setIntProperty("weddingStage", 2);
}
function sendWeddingAction(eim, type) {
var chr = eim.getLeader();
if(chr.getGender() == 0) {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
} else {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
}
}
function hidePriestMsg(eim) {
sendWeddingAction(eim, 2);
}
function showStartMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0));
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showBlessMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1));
eim.setIntProperty("guestBlessings", 1);
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showMarriedMsg(eim) {
sendWeddingAction(eim, 1);
eim.schedule("hidePriestMsg", 10 * 1000);
eim.restartEventTimer(partyTime * 60000);
}
function scheduledTimeout(eim) {
if(eim.getIntProperty("canJoin") == 1) {
em.getChannelServer().closeOngoingWedding(isCathedral);
eim.setIntProperty("canJoin", 0);
var mapobj = eim.getMapInstance(entryMap);
var chr = mapobj.getCharacterById(eim.getIntProperty("groomId"));
if(chr != null) {
chr.changeMap(entryMap + 10, "we00");
}
chr = mapobj.getCharacterById(eim.getIntProperty("brideId"));
if(chr != null) {
chr.changeMap(entryMap + 10, "we00");
}
mapobj.dropMessage(6, "Wedding Assistant: The couple are heading to the altar, hurry hurry talk to me to arrange your seat.");
eim.setIntProperty("weddingStage", 1);
eim.schedule("showStartMsg", startMsgTime * 60 * 1000);
eim.schedule("showBlessMsg", blessMsgTime * 60 * 1000);
eim.schedule("stopBlessings", blessingsTime * 60 * 1000);
eim.startEventTimer(ceremonyTime * 60000);
} else {
end(eim);
}
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function playerLeft(eim, player) {
if(!eim.isEventCleared()) {
playerExit(eim, player);
}
}
function isMarrying(eim, player) {
var playerid = player.getId();
return playerid == eim.getIntProperty("groomId") || playerid == eim.getIntProperty("brideId");
}
function changedMap(eim, player, mapid) {
if (mapid < minMapId || mapid > maxMapId) {
if (isMarrying(eim, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function changedLeader(eim, leader) {}
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
if (isMarrying(eim, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function playerDisconnected(eim, player) {
if (isMarrying(eim, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function leftParty(eim, player) {}
function disbandParty(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 isCakeBoss(mob) {
return mob.getId() == 9400606;
}
function monsterKilled(mob, eim) {
if(isCakeBoss(mob)) {
eim.showClearEffect();
eim.clearPQ();
}
}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -25,6 +25,9 @@ var beginTime = 60 * 1000; //The time to begin the ride
var rideTime = 60 * 1000; //The time that require move to destination
function init() {
beginTime = em.getTransportationTime(beginTime);
rideTime = em.getTransportationTime(rideTime);
em.getChannelServer().getMapFactory().getMap(222020100).resetReactors();
em.getChannelServer().getMapFactory().getMap(222020200).resetReactors();

View File

@@ -12,10 +12,33 @@ function monsterValue(eim, mobId) {
return 1;
}
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() == 105090200 && ch.getLevel() >= 120) {
if(ch.isLeader()) hasLeader = true;
eligible.push(ch);
}
}
}
if(!(hasLeader && eligible.length >= minPlayers)) eligible = [];
return eligible;
}
function setup() {
var eim = em.newInstance("s4aWorld");
eim.getInstanceMap(910500000).resetFully();
eim.getInstanceMap(910500000).resetPQ(1);
respawnStages(eim);
eim.getMapInstance(910500000).instanceMapForceRespawn();
eim.startEventTimer(1200000);
em.setProperty("started", "true");
@@ -25,6 +48,11 @@ function setup() {
function afterSetup(eim) {}
function respawnStages(eim) {
eim.getMapInstance(910500000).instanceMapRespawn();
eim.schedule("respawnStages", 15 * 1000);
}
function playerEntry(eim, player) {
var map = eim.getMapFactory().getMap(910500000);
player.changeMap(map, map.getPortal(0));
@@ -86,4 +114,6 @@ function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function cancelSchedule() {}
function dispose() {}

View File

@@ -33,24 +33,20 @@ spawnPnpc = false;
spawnPnpcFee = 7000000;
jobType = 3;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);
} else {
if (cm.getJobId() == 0) {
actionx["1stJob"] = true;
if (cm.getLevel() >= 10)
if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType))
cm.sendNext("So you decided to become a #rBowman#k?");
else {
cm.sendOk("Train a bit more and I can show you the way of the #rBowman#k.");

View File

@@ -53,6 +53,9 @@ function action(mode, type, selection) {
cm.sendOk("The Henesys PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Primrose Hill>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nI'm Tory. Inside here is a beautiful hill where the primrose blooms. There's a tiger that lives in the hill, Growlie, and he seems to be looking for something to eat. Would you like to head over to the hill of primrose and join forces with your party members to help Growlie out?#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.\r\n#L3#I would like to redeem an event hat.");

View File

@@ -34,24 +34,20 @@ spawnPnpc = false;
spawnPnpcFee = 7000000;
jobType = 1;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);
} else {
if (cm.getJobId() == 0) {
actionx["1stJob"] = true;
if (cm.getLevel() >= 10)
if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType))
cm.sendNext("Do you want to become a Warrior? You need to meet some criteria in order to do so.#b You should be at least in level 10, with at least 35 in STR#k. Let's see...");
else {
cm.sendOk("Train a bit more and I can show you the way of the #rWarrior#k.");

View File

@@ -34,24 +34,20 @@ spawnPnpc = false;
spawnPnpcFee = 7000000;
jobType = 2;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);
} else {
if (cm.getJobId() == 0) {
actionx["1stJob"] = true;
if (cm.getLevel() >= 8)
if (cm.getLevel() >= 8 && cm.canGetFirstJob(jobType))
cm.sendNext("Want to be a magician? There are some standards to meet. because we can't just accept EVERYONE in... #bYour level should be at least 8#k, with getting INT as your top priority. Let's see.");
else {
cm.sendOk("Train a bit more and I can show you the way of the #rMagician#k.");

View File

@@ -77,7 +77,7 @@ function action(mode, type, selection) {
}
} else if (status == 3) {
if (selected == 0) {
if (cm.haveItem(4011000) && cm.haveItem(4011001) && cm.haveItem(4011002) && cm.haveItem(4011003) && cm.haveItem(4011004) && cm.haveItem(4011005) && cm.haveItem(4011006) && cm.getMeso() > 10000) {
if (cm.haveItem(4011000) && cm.haveItem(4011001) && cm.haveItem(4011002) && cm.haveItem(4011003) && cm.haveItem(4011004) && cm.haveItem(4011005) && cm.haveItem(4011006) && cm.getMeso() >= 10000) {
cm.gainMeso(-10000);
for(var i = 4011000; i<4011007; i++) {
cm.gainItem(i,-1);
@@ -88,9 +88,9 @@ function action(mode, type, selection) {
cm.sendNext("Are you sure you have enough mesos? Please check and see if you have the refined #bBronze Plate#k, #bSteel Plate#k,\r\n#bMithril Plate#k, #bAdamantium Plate#k, #bSilver Plate#k, #bOrihalcon Plate#k and #bGold Plate#k, one of each.");
}
} else if (selected == 1) {
if (cm.haveItem(4021000) && cm.haveItem(4021001) && cm.haveItem(4021002) && cm.haveItem(4021003) && cm.haveItem(4021004) && cm.haveItem(4021005) && cm.haveItem(4021006) && cm.haveItem(4021007) && cm.haveItem(4021008) && cm.getMeso() > 15000) {
if (cm.haveItem(4021000) && cm.haveItem(4021001) && cm.haveItem(4021002) && cm.haveItem(4021003) && cm.haveItem(4021004) && cm.haveItem(4021005) && cm.haveItem(4021006) && cm.haveItem(4021007) && cm.haveItem(4021008) && cm.getMeso() >= 15000) {
cm.gainMeso(-15000);
for(var j = 4021000; j<4011009; j++) {
for(var j = 4021000; j<4021009; j++) {
cm.gainItem(j,-1);
}
cm.gainItem(4021009, 1);
@@ -99,9 +99,9 @@ function action(mode, type, selection) {
cm.sendNext("Are you sure you have enough mesos? Please check and see if you have the refined #bGarnet#k, #bAmethyst#k, #bAquaMarine#k, #bEmerald#k, #bOpal#k, #bSapphire#k, #bTopaz#k, #bDiamond#k and #bBlack Crystal#k, one of each.");
}
} else if (selected == 2) {
if (cm.haveItem(4001006) && cm.haveItem(4011007) && cm.haveItem(4021008) && cm.getMeso() > 30000) {
if (cm.haveItem(4001006) && cm.haveItem(4011007) && cm.haveItem(4021008) && cm.getMeso() >= 30000) {
cm.gainMeso(-30000);
for(var k = 4021000; k<4021009; k+=1001) {
for(var k = 4001006; k<4021009; k+=10001) {
cm.gainItem(k,-1);
}
cm.gainItem(4031042, 1);

View File

@@ -9,7 +9,8 @@
Dragon Evolver
*/
importPackage(Packages.client);
importPackage(Packages.client.inventory);
importPackage(Packages.client.inventory.manipulator);
importPackage(Packages.server);
var status;

View File

@@ -33,24 +33,20 @@ spawnPnpc = false;
spawnPnpcFee = 7000000;
jobType = 4;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);
} else {
if (cm.getJobId() == 0) {
actionx["1stJob"] = true;
if (cm.getLevel() >= 10)
if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType))
cm.sendNext("Want to be a thief? There are some standards to meet. because we can't just accept EVERYONE in... #bYour level should be at least 10, with your DEX over 25#k. Let's see.");
else {
cm.sendOk("Train a bit more and I can show you the way of the #rThief#k.");

View File

@@ -96,6 +96,10 @@ function action(mode, type, selection) {
cm.sendOk("The CafePQ_" + pqArea + "has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
status = 1;
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Premium Road - " + levels[selection] + ">\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThe #p1052014# operates differently than the common ones. They do not use mesos or gachapon tickets, rather #rERASERS#k, that can be obtained by completing the missions held on the Premium Road. To go there, you must find partners and attend to a Party Quest. When teamed up and ready, 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.");

View File

@@ -5,7 +5,7 @@
*/
function start() {
if (cm.getQuestStatus(6108) == 1) {
if (cm.getQuestStatus(6107) == 1 || cm.getQuestStatus(6108) == 1) {
var ret = checkJob();
if (ret == -1) {
cm.sendOk("Please form a party and talk to me again.");
@@ -22,13 +22,17 @@ function start() {
} else if (em.getProperty("started").equals("true")) {
cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world." );
} else {
if(!em.startInstance(cm.getParty(), cm.getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("A party in your name is already registered in this event.");
}
} 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.");
}
}
}
}
else {
} else {
cm.sendOk("You're not allowed to enter the other world with unknown reason.");
}

View File

@@ -25,6 +25,7 @@
-- By ---------------------------------------------------------------------------------------------
Information & Xterminator
-- Version Info -----------------------------------------------------------------------------------
1.3 - Fixed saved location [Ronan]
1.2 - Fixed and cleanup [Shootsource]
1.1 - Add null map check [Xterminator]
1.0 - First Version
@@ -34,7 +35,7 @@ var status = 0;
var returnmap;
function start() {
returnmap = cm.getPlayer().getSavedLocation("FLORINA");
returnmap = cm.getPlayer().peekSavedLocation("FLORINA");
if (returnmap == -1)
returnmap = 104000000;
cm.sendNext("So you want to leave #b#m110000000##k? If you want, I can take you back to #b#m"+returnmap+"##k.");
@@ -53,6 +54,7 @@ function action(mode, type, selection) {
if (status == 1)
cm.sendYesNo("Are you sure you want to return to #b#m"+returnmap+"##k? Alright, we'll have to get going fast. Do you want to head back to #m"+returnmap+"# now?")
else {
cm.getPlayer().getSavedLocation("FLORINA");
cm.warp(returnmap);
cm.dispose();
}

View File

@@ -33,24 +33,20 @@ spawnPnpc = false;
spawnPnpcFee = 7000000;
jobType = 5;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);
} else {
if (cm.getJobId() == 0) {
actionx["1stJob"] = true;
if (cm.getLevel() >= 10)
if (cm.getLevel() >= 10 && cm.canGetFirstJob(jobType))
cm.sendNext("Want to be a pirate? There are some standards to meet. because we can't just accept EVERYONE in... #bYour level should be at least 10#k. Let's see.");
else {
cm.sendOk("Train a bit more and I can show you the way of the #rPirate#k.");

View File

@@ -29,18 +29,14 @@ var spawnPnpcFee = 7000000;
var minJobType = 11;
var maxJobType = 15;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
var jobType = parseInt(cm.getJobId() / 100);
if (jobType >= minJobType && jobType <= maxJobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);

View File

@@ -4,17 +4,13 @@ var spawnPnpc = false;
var spawnPnpcFee = 7000000;
var jobType = 21;
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
if (parseInt(cm.getJobId() / 100) == jobType && cm.canSpawnPlayerNpc(Packages.constants.GameConstants.getHallOfFameMapid(cm.getJob()))) {
spawnPnpc = true;
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, didn't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
var sendStr = "You have walked a long way to reach the power, wisdom and courage you hold today, haven't you? What do you say about having right now #ra NPC on the Hall of Fame holding the current image of your character#k? Do you like it?";
if(spawnPnpcFee > 0) {
sendStr += " I can do it for you, for the fee of #b " + numberWithCommas(spawnPnpcFee) + " mesos.#k";
sendStr += " I can do it for you, for the fee of #b " + cm.numberWithCommas(spawnPnpcFee) + " mesos.#k";
}
cm.sendYesNo(sendStr);

View File

@@ -34,7 +34,7 @@ function action(mode, type, selection) {
else {
var map = cm.getPlayer().getSavedLocation("HAPPYVILLE");
if (map == -1)
map = 101000000;
map = 101000000;
cm.warp(map, 0);
}

56
scripts/npc/2012023.js Normal file
View File

@@ -0,0 +1,56 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
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/>.
*/
/* Maple Marble
4th job skill - Night Lord
*/
var status;
function start() {
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.haveItem(4031476)) {
cm.gainItem(4031476, -1);
if(cm.canHold(4031456, 1)) {
cm.gainItem(4031456, 1);
}
}
cm.dispose();
}
}
}

View File

@@ -53,6 +53,9 @@ function action(mode, type, selection) {
cm.sendOk("The Orbis PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Tower of Goddess>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bTower of Goddess#k? Have your #bparty leader#k talk to me or make yourself a party.#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.\r\n#L3#I would like to reclaim a prize.");

View File

@@ -27,11 +27,27 @@ actionx = {"Mental" : false, "Physical" : false};
function start() {
if(cm.isQuestStarted(6192)) {
if(cm.getWarpMap(921100300).getCharacters().size() > 0)
cm.sendOk("There is someone currently in this map, come back later.");
if(cm.getParty() == null) {
cm.sendOk("Form a party to start this instance.");
cm.dispose();
return;
}
var em = cm.getEventManager("ElnathPQ");
if(em == null) {
cm.sendOk("The El Nath PQ has encountered an error.");
cm.dispose();
return;
}
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("Another party is already challenging this instance. Please try another channel, or wait for the current party to finish.");
}
}
else {
cm.resetMapObjects(921100300);
cm.warp(921100300, 0);
cm.sendOk("You cannot start this instance 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();

View File

@@ -32,6 +32,12 @@
var status = 0;
function start() {
if(cm.haveItem(4031450, 1)) {
cm.warp(921100100);
cm.dispose();
return;
}
cm.sendNext("Hey, you look like you want to go farther and deeper past this place. Over there, though, you'll find yourself surrounded by aggressive, dangerous monsters, so even if you feel that you're ready to go, please be careful. Long ago, a few brave men from our town went in wanting to eliminate anyone threatening the town, but never came back out...");
}

View File

@@ -1,6 +1,6 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2018 RonanLana
Copyleft (L) 2016 - 2018 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as

View File

@@ -52,6 +52,12 @@ function action(mode, type, selection) {
else
status--;
if(cm.haveItem(4001109, 1)) {
cm.warp(921100000, "out00");
cm.dispose();
return;
}
if(!cm.isQuestStarted(100200)) {
cm.sendOk("Beware, for the power of olde has not been forgotten... ");
cm.dispose();

54
scripts/npc/2030014.js Normal file
View File

@@ -0,0 +1,54 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
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/>.
*/
/* Ancient Icy Stone
4th job I/L skill
*/
var status;
function start() {
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.haveItem(4031450, 1)) {
if(cm.canHold(2280011, 1)) {
cm.gainItem(2280011, 1);
cm.gainItem(4031450, -1);
}
}
cm.dispose();
}
}
}

View File

@@ -33,6 +33,9 @@ function action(mode, type, selection) {
cm.sendOk("The Ludibrium PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Dimensional Schism>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any higher because of the extremely dangerous creatures above. Would you like to collaborate with party members to complete the quest? If so, 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.");

View File

@@ -61,6 +61,9 @@ function action(mode, type, selection) {
cm.sendOk("The Elemental Battle has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Elemental Thanatos>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou are looking for Elemental Thanatos, right? If you team up with another mage, with the opposite elemental affinity as yours, you guys will be able to overcome them. As a leader, talk to me when you feel ready to go.#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.");

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,39 +17,210 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var status = 0;
/* Spiegelmann
Refining NPC:
* Auto ore refiner
*
* @author RonanLana
*/
var status;
var refineRocks = true; // enables moon rock, star rock
var refineCrystals = true; // enables common crystals
var refineSpecials = true; // enables lithium, special crystals
var feeMultiplier = 7.0;
function start() {
cm.sendOk("The Monster Carnival is currently unavailable.");
cm.dispose();
/*
if (cm.getPlayer().getParty() != null)
cm.sendCPQMapLists();
else {
cm.sendOk("You must be in a party!");
cm.dispose();
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode < 1)
cm.dispose();
else {
status++;
if (status == 1) {
if (cm.fieldTaken(selection)) {
if (cm.fieldLobbied(selection)) {
cm.challengeParty(selection);
cm.dispose();
} else {
cm.sendOk("The room is taken.");
cm.dispose();
}
} else {
cm.cpqLobby(selection);
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
var selStr = "The Monster Carnival is currently unavailable, but instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b";
var options = new Array("Refine mineral ores","Refine jewel ores");
if(refineCrystals) {
options.push("Refine crystal ores");
}
if(refineRocks) {
options.push("Refine plates/jewels");
}
for (var i = 0; i < options.length; i++){
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
}
cm.sendSimple(selStr);
} else if(status == 1) {
var allDone;
if (selection == 0) {
allDone = refineItems(0); // minerals
} else if (selection == 1) {
allDone = refineItems(1); // jewels
} else if (selection == 2 && refineCrystals) {
allDone = refineItems(2); // crystals
} else if (selection == 2 && !refineCrystals || selection == 3) {
allDone = refineRockItems(); // moon/star rock
}
if(allDone) {
cm.sendOk("Done. Thanks for showing up~.");
} else {
cm.sendOk("Done. Be aware some of the items could not be synthetized because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
}
cm.dispose();
}
}
}
function getRefineFee(fee) {
return ((feeMultiplier * fee) | 0);
}
function isRefineTarget(refineType, refineItemid) {
if(refineType == 0) { //mineral refine
return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials);
} else if(refineType == 1) { //jewel refine
return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials);
} else if(refineType == 2) { //crystal refine
return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials);
}
return false;
}
function getRockRefineTarget(refineItemid) {
if(refineItemid >= 4011000 && refineItemid <= 4011006) {
return 0;
} else if(refineItemid >= 4021000 && refineItemid <= 4021008) {
return 1;
}
return -1;
}
function refineItems(refineType) {
var allDone = true;
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
var itemCount = {};
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();
if(isRefineTarget(refineType, itemid)) {
var ic = itemCount[itemid];
if(ic != undefined) {
itemCount[itemid] += it.getQuantity();
} else {
itemCount[itemid] = it.getQuantity();
}
}
}*/
}
}
for(var key in itemCount) {
var itemqty = itemCount[key];
var itemid = parseInt(key);
var refineQty = ((itemqty / 10) | 0);
if(refineQty <= 0) continue;
while(true) {
itemqty = refineQty * 10;
var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty);
if(cm.canHold(itemid + 1000, refineQty) && cm.getMeso() >= fee) {
cm.gainMeso(-fee);
cm.gainItem(itemid, -itemqty);
cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty);
break;
} else if(refineQty <= 1) {
allDone = false;
break;
} else {
refineQty--;
}
}
}
return allDone;
}
function refineRockItems() {
var allDone = true;
var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
var minRocks = [2147483647, 2147483647];
var rockItems = [4011007, 4021009];
var rockFees = [10000, 15000];
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
while (iter.hasNext()) {
var it = iter.next();
var itemid = it.getItemId();
var rockRefine = getRockRefineTarget(itemid);
if(rockRefine >= 0) {
var rockItem = ((itemid % 100) | 0);
var itemqty = it.getQuantity();
minItems[rockRefine][rockItem] += itemqty;
}
}
for(var i = 0; i < minRocks.length; i++) {
for(var j = 0; j < minItems[i].length; j++) {
if(minRocks[i] > minItems[i][j]) {
minRocks[i] = minItems[i][j];
}
}
if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue;
var refineQty = minRocks[i];
while(true) {
var fee = getRefineFee(rockFees[i] * refineQty);
if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) {
cm.gainMeso(-fee);
var j;
if(i == 0) {
for(j = 4011000; j < 4011007; j++) {
cm.gainItem(j, -refineQty);
}
cm.gainItem(j, refineQty);
} else {
for(j = 4021000; j < 4021009; j++) {
cm.gainItem(j, -refineQty);
}
cm.gainItem(j, refineQty);
}
break;
} else if(refineQty <= 1) {
allDone = false;
break;
} else {
refineQty--;
}
}
}
return allDone;
}

View File

@@ -0,0 +1,53 @@
/*
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/>.
*/
var status = 0;
function start() {
if (cm.getPlayer().getParty() != null)
cm.sendCPQMapLists();
else {
cm.sendOk("You must be in a party!");
cm.dispose();
}
}
function action(mode, type, selection) {
if (mode < 1)
cm.dispose();
else {
status++;
if (status == 1) {
if (cm.fieldTaken(selection)) {
if (cm.fieldLobbied(selection)) {
cm.challengeParty(selection);
cm.dispose();
} else {
cm.sendOk("The room is taken.");
cm.dispose();
}
} else {
cm.cpqLobby(selection);
cm.dispose();
}
}
}
}

View File

@@ -261,9 +261,9 @@ function getStimID(equipID){
return 4130012;
case 146: //xbow
return 4130013;
case 148: // Knuckle
case 148: //knuckle
return 4130016;
case 149:
case 149: //pistol
return 4130017;
case 133: //dagger
return 4130014;

View File

@@ -59,9 +59,12 @@ function action(mode, type, selection) {
cm.sendOk("The Horntail PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Horntail Trial Grounds>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the path to Horntail's lair. If you want to face him, you and your team shall be tested on the trial grounds ahead.#b\r\n#L0#Let us pass to the trial grounds.\r\n#L1#I would like to hear more details.");
cm.sendSimple("#e#b<Party Quest: Horntail Trial Grounds>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the path to Horntail's lair. If you want to face him, you and your team shall be tested on the trial grounds ahead.#b\r\n#L0#Let us pass to the trial grounds.\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) {
@@ -83,6 +86,9 @@ function action(mode, type, selection) {
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: Horntail Trial Grounds>#k#n\r\nAs the gatekeeper of Horntail's lair, I will grant access #bjust to those worthy#k of his presence. Even for those people, the path inside is that of a maze, full of branches and trials. However, those #radept at fighting squad bosses#k have a better chance to stand to our leader, although those #rof our kind#k have a shabby chance as well.");
cm.dispose();

View File

@@ -52,6 +52,9 @@ function action(mode, type, selection) {
cm.sendOk("The Pirate PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Pirate Ship>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHelp! My son has been kidnapped and is bound on the hands of the fearful #rLord Pirate#k. I need your help... Would you please assemble or join a team to save him? Have your #bparty leader#k talk to me or make yourself a party.#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.");

View File

@@ -60,6 +60,9 @@ function action(mode, type, selection) {
cm.sendOk("The Magatia PQ (Alcadno) has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
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.");

View File

@@ -60,6 +60,9 @@ function action(mode, type, selection) {
cm.sendOk("The Magatia PQ (Zenumist) has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
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.");

View File

@@ -52,6 +52,9 @@ function action(mode, type, selection) {
cm.sendOk("The Ellin PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Forest of Poison Haze>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble or join a team to solve the puzzles of the #bForest of Poison Haze#k? Have your #bparty leader#k talk to me or make yourself a party.#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.\r\n#L3#I would like to reclaim a prize.");

View File

@@ -37,7 +37,7 @@ function action(mode, type, selection) {
}
if (cm.getPlayer().getMapId() == 800000000) {
if (status == 0)
cm.sendSimple("How's the traveling? Are you enjoying it?#b\r\n#L0#Yes, I'm done with traveling. Can I go back to #m" + cm.getPlayer().getSavedLocation("WORLDTOUR") + "#?\r\n#L1#No, I'd like to continue exploring this place.");
cm.sendSimple("How's the traveling? Are you enjoying it?#b\r\n#L0#Yes, I'm done with traveling. Can I go back to #m" + cm.getPlayer().peekSavedLocation("WORLDTOUR") + "#?\r\n#L1#No, I'd like to continue exploring this place.");
else if (status == 1) {
if (selection == 0) {
cm.sendNext("Alright. I'll take you back to where you were before the visit to Japan. If you ever feel like traveling again down the road, please let me know!");
@@ -47,7 +47,7 @@ function action(mode, type, selection) {
}
} else if (status == 2) {
var map = cm.getPlayer().getSavedLocation("WORLDTOUR");
if (map == undefined) map = 104000000;
if (map == -1) map = 104000000;
cm.warp(map);
cm.dispose();

View File

@@ -117,8 +117,11 @@ function action(mode, type, selection) {
cm.sendOk("The Boss Rush PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Boss Rush>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to collaborate with party members to complete the expedition, or are you brave enough to take it on all by yourself? Have your #bparty leader#k talk to me or make yourself a party.#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) {

49
scripts/npc/9000040.js Normal file
View File

@@ -0,0 +1,49 @@
/*
This file is part of the HeavenMS MapleStory Server
Copyleft (L) 2016 - 2018 RonanLana
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/>.
*/
/* Dalair
Medal 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 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.sendOk("The medal ranking system is currently unavailable.");
cm.dispose();
}
}
}

View File

@@ -29,10 +29,6 @@ var name;
var status;
var selectedType = 0;
function numberWithCommas(x) { // I ain't interessed in finding a way to parse java int to something js will accept through toLocaleString, so be it!
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function start() {
status = -1;
action(1, 0, 0);
@@ -61,7 +57,7 @@ function action(mode, type, selection) {
name = cm.getText();
var res = cm.getPlayer().sellAllItemsFromName(selectedType + 1, name);
if(res > -1) cm.sendOk("Transaction complete! You received #r" + numberWithCommas(res) + " mesos#k from this action.");
if(res > -1) cm.sendOk("Transaction complete! You received #r" + cm.numberWithCommas(res) + " mesos#k from this action.");
else cm.sendOk("There is no #b'" + name + "'#k in your #b" + options[selectedType] + "#k inventory!");
cm.dispose();

View File

@@ -57,6 +57,9 @@ function action(mode, type, selection) {
if(em == null) {
cm.sendOk("The Kerning PQ has encountered an error.");
cm.dispose();
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: 1st Accompaniment>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to 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.");

View File

@@ -56,6 +56,9 @@ function action(mode, type, selection) {
cm.sendOk("The Ludibrium Maze PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: Ludibrium Maze>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the entrance to the Ludibrium Maze. Enjoy!\r\n#b#L0#Enter the Lubidrium Maze#l\r\n#L1#I want to find party members.\r\n#L2#What is the Ludibrium Maze?");

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,123 +17,202 @@
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/>.
*/
/**
*Moony - 9201000.js
*@author Jvlaple
*For HurricaneMS v.59
/* Moony
Amoria (680000000)
Engagement ring NPC.
*/
//var numberOfLoves = 0;
//var ringSelection = -1;
function start() {
// status = -1;
// action(1, 0, 0);
//}
//function action(mode, type, selection) {
// if (mode == -1) {
// cm.dispose();
// } else {
// if (mode == 0) {
// cm.dispose();
// return;
// }
// if (mode == 1) {
// status++;
// } else {
// status--;
// }
// if (status == 0) {
// if (cm.getPlayer().getMarriageQuestLevel() == 0 && cm.getPlayer().getLevel() >= 10) {
// cm.sendNext("Hey, I'm Moony, and I make engagement rings for marriage.");
// } else if (cm.getPlayer().getMarriageQuestLevel() == 1) {
// for (var i = 4031367; i < 4031373; i++)
// numberOfLoves += cm.getPlayer().countItem(i);
// if (numberOfLoves >= 4) {
// cm.sendNext("Wow, you're back pretty early. Got the #bProof of Loves#k? Lets see...");
// } else {
// cm.sendOk("Please come back when you got 4 different #bProof of Loves#k.");
// cm.dispose();
// }
// } else if (cm.getPlayer().getMarriageQuestLevel() == 2) {
// cm.sendSimple("Hey, your'e back! Ready to choose your ring?\r\n#b#L0#Moonstone Ring#l\r\n#L1#Star Gem Ring#l\r\n#L2#Golden Heart Ring#l\r\n#L3#Silver Swan Ring#l#k");
// } else {
cm.sendOk("I hate making rings...");
cm.dispose();
// }
// } else if (status == 1) {
// if (cm.getPlayer().getMarriageQuestLevel() == 0 && cm.getPlayer().getLevel() >= 10) {
// cm.sendYesNo("Hey, you look like you might want to be married! Want to make an engagement ring?");
// } else if (cm.getPlayer().getMarriageQuestLevel() == 1) {
// cm.sendNext("Great work getting the #bProof of Loves#k! Now we can make the #bEngagement Ring#k.");
// } else if (cm.getPlayer().getMarriageQuestLevel() == 2) {
// ringSelection = selection;
// if (ringSelection == 0) {
// if (cm.haveItem(4011007, 1) && cm.haveItem(4021007, 1) && cm.getPlayer().getMeso() >= 3000000) {
// cm.gainItem(4011007, -1);
// cm.gainItem(4021007, -1);
// cm.gainMeso(-3000000);
// cm.gainItem(2240000, 1);
// cm.sendOk("Here's the ring as promised! Have fun!");
// cm.getPlayer().setMarriageQuestLevel(50);
// cm.dispose();
// } else {
// cm.sendNext("You did not get all the right materials. To make an engagement ring, I need one of the following:\r\n\r\n#e#dMoonstone Ring:#k\r\n#v4011007#Moon Rock 1,#v4021007#Diamond 1, 3,000,000 Meso\r\n#dStar Gem Ring:#k\r\n#v4021009#Star Rock 1,#v4021007#Diamond 1, 2,000,000 Meso\r\n#dGolden Heart Ring:#k\r\n#v4011006#Gold Plate 1,#v4021007#Diamond 1, 1,000,000 Meso\r\n#dSilver Swan Ring:#k\r\n#v4011004#Silver Plate 1,#v4021007#Diamond 1, 500,000 Meso\r\n");
// cm.dispose();
// }
// } else if (ringSelection == 1) {
// if (cm.haveItem(4021009, 1) && cm.haveItem(4021007, 1) && cm.getPlayer().getMeso() >= 2000000) {
// cm.gainItem(4021009, -1);
// cm.gainItem(4021007, -1);
// cm.gainMeso(-2000000);
// cm.gainItem(2240001, 1);
// cm.sendOk("Here's the ring as promised! Have fun!");
// cm.getPlayer().setMarriageQuestLevel(50);
// cm.dispose();
// } else {
// cm.sendNext("You did not get all the right materials. To make an engagement ring, I need one of the following:\r\n\r\n#e#dMoonstone Ring:#k\r\n#v4011007#Moon Rock 1,#v4021007#Diamond 1, 3,000,000 Meso\r\n#dStar Gem Ring:#k\r\n#v4021009#Star Rock 1,#v4021007#Diamond 1, 2,000,000 Meso\r\n#dGolden Heart Ring:#k\r\n#v4011006#Gold Plate 1,#v4021007#Diamond 1, 1,000,000 Meso\r\n#dSilver Swan Ring:#k\r\n#v4011004#Silver Plate 1,#v4021007#Diamond 1, 500,000 Meso\r\n");
// cm.dispose();
// }
// } else if (ringSelection == 2) {
// if (cm.haveItem(4011006, 1) && cm.haveItem(4021007, 1) && cm.getPlayer().getMeso() >= 1000000) {
// cm.gainItem(4011006, -1);
// cm.gainItem(4021007, -1);
// cm.gainMeso(-1000000);
// cm.gainItem(2240002, 1);
// cm.sendOk("Here's the ring as promised! Have fun!");
// cm.getPlayer().setMarriageQuestLevel(50);
// cm.dispose();
// } else {
// cm.sendNext("You did not get all the right materials. To make an engagement ring, I need one of the following:\r\n\r\n#e#dMoonstone Ring:#k\r\n#v4011007#Moon Rock 1,#v4021007#Diamond 1, 3,000,000 Meso\r\n#dStar Gem Ring:#k\r\n#v4021009#Star Rock 1,#v4021007#Diamond 1, 2,000,000 Meso\r\n#dGolden Heart Ring:#k\r\n#v4011006#Gold Plate 1,#v4021007#Diamond 1, 1,000,000 Meso\r\n#dSilver Swan Ring:#k\r\n#v4011004#Silver Plate 1,#v4021007#Diamond 1, 500,000 Meso\r\n");
// cm.dispose();
// }
// } else if (ringSelection == 3) {
// if (cm.haveItem(4011004, 1) && cm.haveItem(4021007, 1) && cm.getPlayer().getMeso() >= 500000) {
// cm.gainItem(4011004, -1);
// cm.gainItem(4021007, -1);
// cm.gainMeso(-500000);
// cm.gainItem(2240003, 1);
// cm.sendOk("Here's the ring as promised! Have fun!");
// cm.getPlayer().setMarriageQuestLevel(50);
// cm.dispose();
// } else {
// cm.sendNext("You did not get all the right materials. To make an engagement ring, I need one of the following:\r\n\r\n#e#dMoonstone Ring:#k\r\n#v4011007#Moon Rock 1,#v4021007#Diamond 1, 3,000,000 Meso\r\n#dStar Gem Ring:#k\r\n#v4021009#Star Rock 1,#v4021007#Diamond 1, 2,000,000 Meso\r\n#dGolden Heart Ring:#k\r\n#v4011006#Gold Plate 1,#v4021007#Diamond 1, 1,000,000 Meso\r\n#dSilver Swan Ring:#k\r\n#v4011004#Silver Plate 1,#v4021007#Diamond 1, 500,000 Meso\r\n");
// cm.dispose();
// }
// }
// }
// } else if (status == 2) {
// if (cm.getPlayer().getMarriageQuestLevel() == 0 && cm.getPlayer().getLevel() >= 10) {
// cm.getPlayer().addMarriageQuestLevel();
// cm.sendOk("Okay, first bring me back any four colored #bProof of Loves#k. You can get them from talking to #bNana the Love Fairy#k in any town. Also, only one of you, either the Groom or Bride will do this quest.");
// cm.dispose();
// } else if (cm.getPlayer().getMarriageQuestLevel() == 1) {
// for (var j = 4031367; j < 4031373; j++)
// cm.removeAll(j);
// cm.getPlayer().addMarriageQuestLevel();
// cm.sendNextPrev("You need the following raw materials to make an\r\n#bEngagement Ring#k.\r\n\r\n#e#dMoonstone Ring:#k\r\n#v4011007#Moon Rock 1,#v4021007#Diamond 1, 3,000,000 Meso\r\n#dStar Gem Ring:#k\r\n#v4021009#Star Rock 1,#v4021007#Diamond 1, 2,000,000 Meso\r\n#dGolden Heart Ring:#k\r\n#v4011006#Gold Plate 1,#v4021007#Diamond 1, 1,000,000 Meso\r\n#dSilver Swan Ring:#k\r\n#v4011004#Silver Plate 1,#v4021007#Diamond 1, 500,000 Meso\r\n");
// cm.dispose();
// }
// }
// }
var status;
var state;
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
function hasEngagementBox(player) {
for(var i = 2240000; i <= 2240003; i++) {
if(player.haveItem(i)) {
return true;
}
}
return false;
}
function start() {
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) {
options = ["I want to make a ring.", "I want to discard the ring box I have."];
cm.sendSimple("I'm #p9201000#, the #bengagement ring maker#k. How can I help you?\r\n\r\n#b" + generateSelectionMenu(options));
} else if(status == 1) {
if(selection == 0) {
if(!cm.isQuestCompleted(100400)) {
if(!cm.isQuestStarted(100400)) {
state = 0;
cm.sendAcceptDecline("So you want to make a engagement ring, huh? Very well, I can provide one for you if you pass my test. Certainly you must have already seen #rNanas, the fairies of Love#k, around the Maple world. From 4 of them, collect #b4 #t4031367#'s#k and bring them here. Only then I'll accept you as a proper ring holder. Are you up to it?");
} else {
if(!hasProofOfLoves(cm.getPlayer())) {
cm.sendOk("Please bring here #b4 #t4031367#'s#k. That's a must for me to accept you as a proper holder for the wedding ring.");
} else {
cm.completeQuest(100400);
cm.gainExp(20000 * cm.getPlayer().getExpRate());
for(var i = 4031367; i <= 4031372; i++) {
cm.removeAll(i);
}
cm.sendOk("You brought the #t4031367#'s, good. From now on you are eligible for holding the rings I make. Talk to me again to start forging the kind of ring you want.");
}
cm.dispose();
}
} else {
if(hasEngagementBox(cm.getPlayer())) {
cm.sendOk("Sorry, you already have an engagement box. I cannot provide you more than one box per time.");
cm.dispose();
return;
}
if(cm.getPlayer().getGender() != 0) {
cm.sendOk("Sorry, but the ring box is currently available only for males.");
cm.dispose();
return;
}
state = 1;
options = ["Moonstone","Star Gem","Golden Heart", "Silver Swan"];
var selStr = "So, what kind of engagement ring you want me to craft?\r\n\r\n#b" + generateSelectionMenu(options);
cm.sendSimple(selStr);
}
} else {
if(hasEngagementBox(cm.getPlayer())) {
for(var i = 2240000; i <= 2240003; i++) {
cm.removeAll(i);
}
cm.sendOk("Your ring box has been discarded.");
} else {
cm.sendOk("You have no ring box to discard.");
}
cm.dispose();
}
} else if(status == 2) {
if(state == 0) {
cm.startQuest(100400);
cm.sendOk("Very well, then go after these #t4031367#'s. I will be waiting here.");
cm.dispose();
} else {
var itemSet = new Array(2240000,2240001,2240002,2240003);
var matSet = new Array(new Array(4011007,4021007),new Array(4021009,4021007),new Array(4011006,4021007),new Array(4011004,4021007));
var matQtySet = new Array(new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1));
var costSet = new Array (30000,20000,10000,5000);
item = itemSet[selection];
mats = matSet[selection];
matQty = matQtySet[selection];
cost = costSet[selection];
var prompt = "Then I'm going to craft you a #b#t" + item + "##k, is that right?";
prompt += " In that case, I'm going to need specific items from you in order to make it. Make sure you have room in your inventory, though!#b";
if (mats instanceof Array){
for(var i = 0; i < mats.length; i++){
prompt += "\r\n#i"+mats[i]+"# " + matQty[i] + " #t" + mats[i] + "#";
}
}
else {
prompt += "\r\n#i"+mats+"# " + matQty + " #t" + mats + "#";
}
if (cost > 0)
prompt += "\r\n#i4031138# " + cost + " meso";
cm.sendYesNo(prompt);
}
} else if(status == 3) {
var complete = true;
var recvItem = item, recvQty = 1, qty = 1;
if(!cm.canHold(recvItem, recvQty)) {
cm.sendOk("Check your inventory for a free slot first.");
cm.dispose();
return;
}
else if (cm.getMeso() < cost * qty)
{
cm.sendOk("I'm sorry but there's a fee for my services. Please bring me the right amount of mesos here before trying to forge a ring.");
cm.dispose();
return;
}
else
{
if (mats instanceof Array) {
for(var i = 0; complete && i < mats.length; i++)
if (!cm.haveItem(mats[i], matQty[i] * qty))
complete = false;
}
else if (!cm.haveItem(mats, matQty * qty))
complete = false;
}
if (!complete)
cm.sendOk("Hm, it seems you're lacking some ingredients for the engagement ring. Please provide them first, will you?");
else {
if (mats instanceof Array) {
for (var i = 0; i < mats.length; i++){
cm.gainItem(mats[i], -matQty[i] * qty);
}
}
else
cm.gainItem(mats, -matQty * qty);
if (cost > 0)
cm.gainMeso(-cost * qty);
cm.gainItem(recvItem, recvQty);
cm.sendOk("All done, the engagement ring came out just right. I wish you a happy engagement.");
}
cm.dispose();
}
}
}
function generateSelectionMenu(array) {
var menu = "";
for (var i = 0; i < array.length; i++) {
menu += "#L" + i + "#" + array[i] + "#l\r\n";
}
return menu;
}

View File

@@ -1,17 +1,83 @@
/*
Credits go to Travis of DeanMS ( xKillsAlotx on RaGEZONE)
Item Exchanger for scrolls
This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
Modified by SharpAceX (Alan) for MapleSolaxia
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/>.
*/
/* Nana, the Love fairy
Amoria (680000000)
Engagement ring NPC.
*/
importPackage(Packages.tools);
var status;
var state;
var status = 0;
var leaf = 4001126;
var chairs = new Array(3010000, 3010001, 3010002, 3010003, 3010004, 3010005, 3010006, 3010007, 3010008, 3010009, 3010010, 3010011, 3010012, 3010013, 3010015, 3010016, 3010017, 3010018, 3010019, 3010022, 3010023, 3010024, 3010025, 3010026, 3010028, 3010040, 3010041, 3010043, 3010045, 3010046, 3010047,3010057,3010058,3010060,3010061,3010062,3010063, 3010064,3010065,3010066,3010067,3010069,3010071,3010072,3010073,3010080,3010081,3010082,3010083, 3010084,3010085,3010097,3010098,3010099,3010101,3010106,3010116,3011000,3012005,3012010,3012011);
var scrolls = new Array(2040603,2044503,2041024,2041025,2044703,2044603,2043303,2040807,2040806,2040006,2040007,2043103,2043203,2043003,2040506,2044403,2040903,2040709,2040710,2040711,2044303,2043803,2040403,2044103,2044203,2044003,2043703);
var weapons = new Array(1302020, 1302030, 1302033, 1302058, 1302064, 1302080, 1312032, 1322054, 1332025, 1332055, 1332056, 1372034, 1382009, 1382012, 1382039, 1402039, 1412011, 1412027, 1422014, 1422029, 1432012, 1432040, 1432046, 1442024, 1442030, 1442051, 1452016, 1452022, 1452045, 1462014, 1462019, 1462040, 1472030, 1472032, 1472055, 1482020, 1482021, 1482022, 1492020, 1492021, 1492022, 1092030, 1092045, 1092046, 1092047);
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
function getNanaLocation(player) {
var mapid = player.getMap().getId();
for(var i = 0; i < mapids.length; i++) {
if(mapid == mapids[i]) {
return i;
}
}
return -1;
}
var nanaLoc;
var mapids = [100000000, 103000000, 102000000, 101000000, 200000000, 220000000];
var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128];
var questExp = [2000, 5000, 10000, 17000, 22000, 30000];
function processNanaQuest() {
if(cm.haveItem(questItems[nanaLoc], 50)) {
if(cm.canHold(4031367 + nanaLoc, 1)) {
cm.gainItem(questItems[nanaLoc], -50);
cm.gainItem(4031367 + nanaLoc, 1);
cm.sendOk("Kyaaaa~ Thank you a lot, here get the #b#t4031367##k.");
return true;
} else {
cm.sendOk("Please have a free ETC slot available to hold the token of love.");
}
} else {
cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k.");
}
return false;
}
function start() {
status = -1;
@@ -19,102 +85,61 @@ function start() {
}
function action(mode, type, selection) {
if (mode == -1)
if (mode == -1) {
cm.dispose();
else {
if (mode == 0 && status == 0)
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple("Hello#b #h ##k, you currently have #b#c4001126# maple leaves.#k \r\nWhat would you like to do?\r\n#k#L1# Trade 1 leaf for 5,000 NX#l\r\n\#L2# Trade 1 leaf for 1 random chair #l\r\n\#L3# Trade 1 leaf for 3 random Maple Weapons #l\r\n\#L4# Trade 1 leaf for 3 Swiss Cheese and Onyx Apples#l\r\n#L5#Trade 1 leaf for a 10 day Hired Merchant#l");
} else if (status == 1) {
if (selection == 1) {
if(cm.haveItem(leaf, 1)) {
cm.getPlayer().getCashShop().gainCash(1, 5000);
cm.getPlayer().announce(MaplePacketCreator.earnTitleMessage("You have earned 5,000 NX"));
cm.gainItem(leaf, -1);
cm.sendOk("Here is your 5,000 NX!");
cm.logLeaf("5k NX");
if(status == 0) {
if(!cm.isQuestStarted(100400)) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
nanaLoc = getNanaLocation(cm.getPlayer());
if(nanaLoc == -1) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
if(!cm.haveItem(4031367 + nanaLoc, 1)) {
if(cm.isQuestCompleted(100401 + nanaLoc)) {
state = 1;
cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k");
} else if(cm.isQuestStarted(100401 + nanaLoc)) {
if(processNanaQuest()) {
cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate());
cm.completeQuest(100401 + nanaLoc);
}
cm.dispose();
} else {
cm.sendOk("Sorry, you don't have a maple leaf!");
}
state = 0;
cm.sendAcceptDecline("Are you searching for #k#t4031367#'s#k? I can share one with you, but you must do a favor for me, is that ok?");
}
} else {
cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?");
cm.dispose();
} else if (selection == 2) {
if(cm.haveItem(leaf, 1)) {
var chair1 = chairs[Math.floor(Math.random()*chairs.length)];
if(cm.canHold(chair1)){
cm.gainItem(chair1);
cm.gainItem(leaf, -1);
cm.sendOk("Here is your random chair!");
cm.logLeaf("Chair ID: " + chair1);
} else {
cm.sendOk("Please make sure you have enough space to hold this chair!");
}
} else {
cm.sendOk("Sorry, you don't have a maple leaf!");
}
}
} else if(status == 1) {
if(state == 0) {
cm.startQuest(100401 + nanaLoc);
cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k.");
cm.dispose();
} else if (selection == 3) {
if(cm.haveItem(leaf, 1)) {
var weapon1 = weapons[Math.floor(Math.random()*weapons.length)];
var weapon2 = weapons[Math.floor(Math.random()*weapons.length)];
var weapon3 = weapons[Math.floor(Math.random()*weapons.length)];
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).isFull(3)) {
cm.gainItem(weapon1, 1, true, true);
cm.gainItem(weapon2, 1, true, true);
cm.gainItem(weapon3, 1, true, true);
cm.gainItem(leaf, -1);
cm.sendOk("Here are your 3 random weapons!");
cm.logLeaf("Maple Weapons IDs: " + weapon1 + "," + weapon2 + "," + weapon3);
} else {
cm.sendOk("Please make sure you have enough space to hold these weapons!");
}
} else {
cm.sendOk("Sorry, you don't have a maple leaf!");
}
} else {
processNanaQuest();
cm.dispose();
} else if (selection == 4) {
if(cm.haveItem(leaf, 1)) {
var cheese = 2022273;
var apple = 2022179;
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.EQUIP).isFull(2)){
cm.gainItem(apple, 3);
cm.gainItem(cheese, 3);
cm.gainItem(leaf, -1);
cm.sendOk("Here are your 3 cheeses and apples!");
cm.logLeaf("3 cheeses and apples");
} else {
cm.sendOk("Please make sure you have enough space to hold these items!");
}
} else {
cm.sendOk("Sorry, you don't have a maple leaf!");
}
cm.dispose();
} else if(selection == 5) {
if(cm.haveItem(leaf, 1)) {
if(!cm.haveItem(5030000, 1)) {
if(!cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.CASH).isFull(1)){
cm.gainItem(5030000, 1, false, true, 1000 * 60 * 60 * 24 * 10);
cm.gainItem(leaf, -1);
cm.sendOk("Here is your Hired Merchant!");
cm.logLeaf("10 day hired merchant");
} else {
cm.sendOk("Please make sure you have enough space to hold these items!");
}
} else {
cm.sendOk("I can't give you a merchant if you already have one!");
}
} else {
cm.sendOk("Sorry, you don't have a maple leaf!");
}
cm.dispose();
} else {
cm.sendOk("Come back later!");
cm.dispose();
}
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,34 +17,398 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* NPC Base
Map Name (Map ID)
Extra NPC info.
/* High Priest John
Marriage NPC
*/
importPackage(Packages.constants);
importPackage(Packages.net.server.channel.handlers);
importPackage(Packages.tools);
importPackage(Packages.tools.packets);
var status;
function start() {
status = -1;
action(1, 0, 0);
var state;
var eim;
var weddingEventName = "WeddingCathedral";
var cathedralWedding = true;
var weddingIndoors;
var weddingBlessingExp = ServerConstants.WEDDING_BLESS_EXP;
function isWeddingIndoors(mapid) {
return mapid >= 680000100 && mapid <= 680000500;
}
function getMarriageInstance(player) {
var em = cm.getEventManager(weddingEventName);
for (var iterator = em.getInstances().iterator(); iterator.hasNext();) {
var eim = iterator.next();
if(eim.isEventLeader(player)) {
return eim;
}
}
return null;
}
function detectPlayerItemid(player) {
for (var x = 4031357; x <= 4031364; x++) {
if (player.haveItem(x)) {
return x;
}
}
return -1;
}
function getRingId(boxItemId) {
return boxItemId == 4031357 ? 1112803 : (boxItemId == 4031359 ? 1112806 : (boxItemId == 4031361 ? 1112807 : (boxItemId == 4031363 ? 1112809 : -1)));
}
function isSuitedForWedding(player, equipped) {
var baseid = (player.getGender() == 0) ? 1050131 : 1051150;
if(equipped) {
for(var i = 0; i < 4; i++) {
if(player.haveItemEquipped(baseid + i)) {
return true;
}
}
} else {
for(var i = 0; i < 4; i++) {
if(player.haveItemWithId(baseid + i, true)) {
return true;
}
}
}
return false;
}
function getWeddingPreparationStatus(player, partner) {
if(!player.haveItem(4000313)) return -3;
if(!partner.haveItem(4000313)) return 3;
if(!isSuitedForWedding(player, true)) return -4;
if(!isSuitedForWedding(partner, true)) return 4;
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (player.haveItem(x)) {
hasEngagement = true;
break;
}
}
if(!hasEngagement) return -1;
hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (partner.haveItem(x)) {
hasEngagement = true;
break;
}
}
if(!hasEngagement) return -2;
if(!player.canHold(1112803)) return 1;
if(!partner.canHold(1112803)) return 2;
return 0;
}
function giveCoupleBlessings(eim, player, partner) {
var blessCount = eim.gridSize();
player.gainExp(blessCount * weddingBlessingExp);
partner.gainExp(blessCount * weddingBlessingExp);
}
function start() {
weddingIndoors = isWeddingIndoors(cm.getMapId());
if(weddingIndoors) eim = cm.getEventInstance();
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) {
cm.sendOk("Wedding is currently closed.");
cm.dispose();
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(!weddingIndoors) {
if(status == 0) {
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (cm.haveItem(x, 1)) {
hasEngagement = true;
break;
}
}
if(hasEngagement) {
var text = "Hi there. How can I help you?";
var choice = new Array("We're ready to get married.");
for (x = 0; x < choice.length; x++) {
text += "\r\n#L" + x + "##b" + choice[x] + "#l";
}
cm.sendSimple(text);
} else {
cm.sendOk("Hmm, today two fluttering hearts are about to be joined together by the blessings of love!");
cm.dispose();
}
} else if(status == 1) {
var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId());
var cserv = cm.getClient().getChannelServer();
if(cserv.isWeddingReserved(wid)) {
if(wid == cserv.getOngoingWedding(cathedralWedding)) {
var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
if(!(partner == null || !cm.getMap().equals(partner.getMap()))) {
if(!cm.canHold(4000313)) {
cm.sendOk("Please have a free ETC slot available to get the #b#t4000313##k.");
cm.dispose();
return;
} else if(!partner.canHold(4000313)) {
cm.sendOk("Please let your partner know they must have a free ETC slot available to get the #b#t4000313##k.");
cm.dispose();
return;
} else if(!isSuitedForWedding(cm.getPlayer(), false)) {
cm.sendOk("Please purchase a #rwedding garment#k for the ceremony, quickly! Without it I am not able to marry you.");
cm.dispose();
return;
} else if(!isSuitedForWedding(partner, false)) {
cm.sendOk("Please let your partner know they must have a #rwedding garment#k ready for the ceremony.");
cm.dispose();
return;
}
cm.sendOk("Very well, the preparatives here are finished too. This indeed is a beautiful day, you two are truly blessed to marry on such a day. Let us begin the marriage!!");
} else {
cm.sendOk("Hmm, it seems your partner is elsewhere... Please let them come here before starting the ceremony.");
cm.dispose();
}
} else {
var placeTime = cserv.getWeddingReservationTimeLeft(wid);
cm.sendOk("Have patience. Your wedding is set to happen at the #r" + placeTime + "#k.");
cm.dispose();
}
} else {
cm.sendOk("Hmm, I'm sorry but there are no reservations made for you at this channel for the time being.");
cm.dispose();
}
} else if(status == 2) {
var cserv = cm.getClient().getChannelServer();
var wtype = cserv.getOngoingWeddingType(cathedralWedding);
var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
if(!(partner == null || !cm.getMap().equals(partner.getMap()))) {
if(cserv.acceptOngoingWedding(cathedralWedding)) {
var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId());
if(wid > 0) {
var em = cm.getEventManager(weddingEventName);
if(em.startInstance(cm.getPlayer())) {
eim = getMarriageInstance(cm.getPlayer());
if(eim != null) {
eim.setIntProperty("weddingId", wid);
eim.setIntProperty("groomId", cm.getPlayer().getId());
eim.setIntProperty("brideId", cm.getPlayer().getPartnerId());
eim.setIntProperty("isPremium", wtype ? 1 : 0);
eim.registerPlayer(partner);
} else {
cm.sendOk("An unexpected error happened when locating the wedding event. Please try again later.");
}
cm.dispose();
} else {
cm.sendOk("An unexpected error happened before the wedding preparations. Please try again later.");
cm.dispose();
}
} else {
cm.sendOk("An unexpected error happened before the wedding preparations. Please try again later.");
cm.dispose();
}
} else { // partner already decided to start
cm.dispose();
}
} else {
cm.sendOk("Hmm, it seems your partner is elsewhere... Please let them come here before starting the ceremony.");
cm.dispose();
}
}
} else {
if (status == 0) {
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
var playerId = cm.getPlayer().getId();
if(playerId == eim.getIntProperty("groomId") || playerId == eim.getIntProperty("brideId")) {
var wstg = eim.getIntProperty("weddingStage");
if(wstg == 2) {
cm.sendYesNo("Very well, the guests has bestowed all their blessings to you now. The time has come, #rshould I make you Husband and Wife#k?");
state = 1;
} else if(wstg == 1) {
cm.sendOk("While you two are making your wedding vows to each other, your guests are currently giving their blessings to you. This is a time of happiness for both of you, please rejoice the ceremony.");
cm.dispose();
} else {
cm.sendOk("Congratulations on your wedding! Our ceremony is complete, you can head to #b#p9201007##k now, she will lead you and your guests to the afterparty. Cheers for your love!");
cm.dispose();
}
} else {
var wstg = eim.getIntProperty("weddingStage");
if(wstg == 1) {
if(eim.gridCheck(cm.getPlayer()) != -1) {
cm.sendOk("Everyone give your blessings to this lovely couple!");
cm.dispose();
} else {
if(eim.getIntProperty("guestBlessings") == 1) {
cm.sendYesNo("Do you want to bless this couple?");
state = 0;
} else {
cm.sendOk("Today we are gathered here to reunite this lively couple in matrimony!");
cm.dispose();
}
}
} else if(wstg == 3) {
cm.sendOk("The two loving birds are now married. What a lively day! Please #rget ready for the afterparty#k, it should start soon. Follow the married couple's lead.");
cm.dispose();
} else {
cm.sendOk("The guest's blessing time has ended. Hang on, the couple will renew their vows very soon now. What a sight to see!");
cm.dispose();
}
}
} else if (status == 1) {
if(state == 0) { // give player blessings
eim.gridInsert(cm.getPlayer(), 1);
if(ServerConstants.WEDDING_BLESSER_SHOWFX) {
var target = cm.getPlayer();
target.announce(MaplePacketCreator.showSpecialEffect(9));
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
} else {
var target = eim.getPlayerById(eim.getIntProperty("groomId"));
target.announce(MaplePacketCreator.showSpecialEffect(9));
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
target = eim.getPlayerById(eim.getIntProperty("brideId"));
target.announce(MaplePacketCreator.showSpecialEffect(9));
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
}
cm.sendOk("Your blessings have been added to their love. What a noble act for a lovely couple!");
cm.dispose();
} else { // couple wants to complete the wedding
var wstg = eim.getIntProperty("weddingStage");
if(wstg == 2) {
var pid = cm.getPlayer().getPartnerId();
if(pid <= 0) {
cm.sendOk("It seems you are no longer engaged to your partner, just before the altar... Where did all that happiness you two had sported a while ago went?");
cm.dispose();
return;
}
var player = cm.getPlayer();
var partner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId());
if(partner != null) {
state = getWeddingPreparationStatus(player, partner);
switch(state) {
case 0:
var pid = eim.getIntProperty("confirmedVows");
if(pid != -1) {
if(pid == player.getId()) {
cm.sendOk("You have already confirmed your vows. All that is left is for your partner to confirm now.");
} else {
eim.setIntProperty("weddingStage", 3);
var cmPartner = partner.getClient().getAbstractPlayerInteraction();
var playerItemId = detectPlayerItemid(player);
var partnerItemId = (playerItemId % 2 == 1) ? playerItemId + 1 : playerItemId - 1;
var marriageRingId = getRingId((playerItemId % 2 == 1) ? playerItemId : partnerItemId);
cm.gainItem(playerItemId, -1);
cmPartner.gainItem(partnerItemId, -1);
RingActionHandler.giveMarriageRings(player, partner, marriageRingId);
player.setMarriageItemId(marriageRingId);
partner.setMarriageItemId(marriageRingId);
//var marriageId = eim.getIntProperty("weddingId");
//player.announce(Wedding.OnMarriageResult(marriageId, player, true));
//partner.announce(Wedding.OnMarriageResult(marriageId, player, true));
giveCoupleBlessings(eim, player, partner);
cm.getMap().dropMessage(6, "High Priest John: By the power vested in me through the mighty Maple tree, I now pronounce you Husband and Wife. You may kiss the bride!");
eim.schedule("showMarriedMsg", 2 * 1000);
}
} else {
eim.setIntProperty("confirmedVows", player.getId());
cm.getMap().dropMessage(6, "Wedding Assistant: " + player.getName() + " has confirmed vows! Alright, one step away to make it official. Tighten your seatbelts!");
}
break;
case -1:
cm.sendOk("It seems you no longer have the ring/ring box you and your partner shared at the engagement time. Sorry, but that was needed for the wedding...");
break;
case -2:
cm.sendOk("It seems your partner no longer has the ring/ring box you two shared at the engagement time. Sorry, but that was needed for the wedding...");
break;
case -3:
cm.sendOk("It seems you don't have the #r#t4000313##k given at the entrance... Please find it, I can't marry you without that item in hands.");
break;
case -4:
cm.sendOk("Pardon my rudiness, but the garments are a essential part of the ceremony. Please #rsuit yourself properly#k for a wedding.");
break;
case 1:
cm.sendOk("Please make an EQUIP slot available to get the marriage ring, will you?");
break;
case 2:
cm.sendOk("Please let your partner know to make an EQUIP slot available to get the marriage ring, will you?");
break;
case 3:
cm.sendOk("It seems your partner don't have the #r#t4000313##k given at the entrance... Please find it, I can't marry you without that item in hands.");
break;
case 4:
cm.sendOk("It seems your partner is not properly dressed for the wedding... Pardon my rudiness, but the garments are a essential part of the ceremony.");
break;
}
cm.dispose();
} else {
cm.sendOk("Hmm, it seems your partner is not here, before the altar... It is a pity, but I can't fulfill the wedding if your partner is not here.");
cm.dispose();
}
} else {
cm.sendOk("You are now #bhusband and wife#k. Congratulations!");
cm.dispose();
}
}
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,11 +17,127 @@
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/>.
*/
/*9201091 - Ames
*@author Moogra
*/
/* Amos the Wise
Amoria (680000000)
Wedding info.
*/
importPackage(Packages.net.server.channel.handlers);
var status;
var rings = [1112806, 1112803, 1112807, 1112809];
var divorceFee = 500000;
var ringObj;
function getWeddingRingItemId(player) {
for (var i = 0; i < rings.length; i++) {
if (player.haveItemWithId(rings[i], false)) {
return rings[i];
}
}
return null;
}
function hasEquippedWeddingRing(player) {
for (var i = 0; i < rings.length; i++) {
if (player.haveItemEquipped(rings[i])) {
return true;
}
}
return false;
}
function start() {
cm.warp(680000000, 0);
cm.dispose();
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) {
var questionStr = ["How can I engage someone?", "How can I marry?", "How can I divorce?"]
if(!(!cm.getPlayer().isMarried() && getWeddingRingItemId(cm.getPlayer()))) questionStr.push("I want a divorce...");
else questionStr.push("I wanna remove my old wedding ring...");
cm.sendSimple("Hello, welcome to #bAmoria#k, a beautiful land where maplers can find love and, if inspired enough, even marry. Do you have any questions about Amoria? Talk it to me.#b\r\n\r\n" + generateSelectionMenu(questionStr));
} else if(status == 1) {
switch(selection) {
case 0:
cm.sendOk("The #bengagement process#k is as straightforward as it can be. Firstly one must start a prequest from the #bring maker, #p9201000##k. They must gather #b#t4031367#'s#k thoughout the Maple world.\r\nFrom the completion of the quest, the player will gain an engagement ring. With that in hand, declare yourself to someone you become fond of. Then, hope the person accepts your proposal.");
cm.dispose();
break;
case 1:
cm.sendOk("For the #bmarriage process#k you must be already engaged. The loving couple must choose a venue they want to hold their marriage. Amoria offers two: the #rCathedral#k and the #rChapel#k.\r\nThen, one of the partners must buy a #bWedding Ticket#k, available through the Cash Shop, and book their ceremony with the Wedding Assistant. Each partner will receive #rguest tickets#k to be distributed to their acquaintances.");
cm.dispose();
break;
case 2:
cm.sendOk("Unfortunately the love of long may fizzle someday. Well, I hope that's not the case for any loving couple that once married, is marrying today or is going to do so tomorrow. But, if that ever happens, I myself will be at service to make a safe divorce, by the fee of #r" + divorceFee + "#k mesos.");
cm.dispose();
break;
case 3:
ringObj = cm.getPlayer().getMarriageRing();
if(ringObj == null) {
var itemid = getWeddingRingItemId(cm.getPlayer());
if(itemid != null) {
cm.sendOk("There you go, I've removed your old wedding ring.");
cm.gainItem(itemid, -1);
} else if(hasEquippedWeddingRing(cm.getPlayer())) {
cm.sendOk("If you want your old wedding ring removed, please unequip it before talking to me.");
} else {
cm.sendOk("You're not married to require a divorce from it.");
}
cm.dispose();
return;
}
cm.sendYesNo("So, you want to divorce from your partner? Be sure, this process #bcannot be rollbacked#k by any means, it's supposed to be an ultimatum from which your ring will be destroyed as consequence. That said, do you #rreally want to divorce#k?");
break;
}
} else if(status == 2) {
if(cm.getMeso() < divorceFee) {
cm.sendOk("You don't have the required amount of #r" + divorceFee + " mesos#k for the divorce fee.");
cm.dispose();
return;
} else if(ringObj.equipped()) {
cm.sendOk("Please unequip your ring before trying to divorce.");
cm.dispose();
return;
}
cm.gainMeso(-divorceFee);
RingActionHandler.breakMarriageRing(cm.getPlayer(), ringObj.getItemId());
cm.gainItem(ringObj.getItemId(), -1);
cm.sendOk("You have divorced from your partner.");
cm.dispose();
}
}
}
function generateSelectionMenu(array) {
var menu = "";
for (var i = 0; i < array.length; i++) {
menu += "#L" + i + "#" + array[i] + "#l\r\n";
}
return menu;
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,85 +17,290 @@
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/>.
*/
/**
Nicole
-- By ---------------------------------------------------------------------------------------------
Angel (get31720 ragezone)
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3] & [XotiCraze]
---------------------------------------------------------------------------------------------------
**/
/* Assistant Nicole
Marriage NPC
*/
var status;
var x;
var hasEngageRing = false;
var wid;
var isMarrying;
var cathedralWedding = true;
var weddingEventName = "WeddingCathedral";
var weddingEntryTicketCommon = 5251000;
var weddingEntryTicketPremium = 5251003;
var weddingSendTicket = 4031395;
var weddingGuestTicket = 4031407;
var weddingAltarMapid = 680000210;
var weddingIndoors;
function isWeddingIndoors(mapid) {
return mapid >= 680000100 && mapid <= 680000500;
}
function hasSuitForWedding(player) {
var baseid = (player.getGender() == 0) ? 1050131 : 1051150;
for(var i = 0; i < 4; i++) {
if(player.haveItemWithId(baseid + i, true)) {
return true;
}
}
return false;
}
function getMarriageInstance(weddingId) {
var em = cm.getEventManager(weddingEventName);
for (var iterator = em.getInstances().iterator(); iterator.hasNext();) {
var eim = iterator.next();
if(eim.getIntProperty("weddingId") == weddingId) {
return eim;
}
}
return null;
}
function hasWeddingRing(player) {
var rings = [1112806, 1112803, 1112807, 1112809];
for (var i = 0; i < rings.length; i++) {
if (player.haveItemWithId(rings[i], true)) {
return true;
}
}
return false;
}
function start() {
status = -1;
weddingIndoors = isWeddingIndoors(cm.getMapId());
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then");
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
} else if (mode == 1) {
status++;
} else {
status--;
return;
}
var item = new Array(4031360, 4031358, 4031362, 4031364);
for (x = 0; x < item.length && !hasEngageRing; x++) {
if (cm.haveItem(item[x], 1))
hasEngageRing = true;
}
if (status == 0) {
var text = "I'm here to assist you on weddings !";
var choice = new Array("How do I prepare a wedding?", "I have an engagement ring and need invites for my guests", "I am the bride/groom and I'd like to start the wedding", "I am the guest and I'd like to go into the wedding");
for (x = 0; x < choice.length; x++) {
text += "\r\n#L" + x + "##b" + choice[x] + "#l";
}
cm.sendSimple(text);
} else if (status == 1) {
switch(selection) {
case 0:
cm.sendOk("Moony makes the engagement ring. The engagement ring is required throughout the wedding so never lose it. To invite your guests into the wedding you need to show me your engagement ring and then I'll give you 15 Gold Maple Leaves. They need 1 each to enter the wedding. Enjoy!");
cm.dispose();
break;
case 1:
if (cm.haveItem(4000313)) {
cm.sendOk("You already have a Gold Maple Leaf. Go give them to your guests before you go into the wedding.");
cm.dispose();
} else if (hasEngageRing) {
cm.sendOk("You have received 15 Gold Maple Leaves.");
cm.gainItem(4000313,15);
cm.dispose();
} else {
cm.sendOk("You do not have an engagement ring.");
cm.dispose();
}
break;
case 2:
if (hasEngageRing) {
cm.warp(680000210, 2);
cm.sendOk("Talk to High Priest John when you're ready to be married.");
cm.dispose();
} else {
cm.sendOk("You do not have an engagement ring.");
cm.dispose();
}
break;
case 3:
if (cm.haveItem(4000313)) {
cm.warp(680000210, 0);
cm.sendOk("Enjoy the wedding. Don't drop your Gold Maple Leaf or you won't be able to finish the whole wedding.");
cm.dispose();
} else {
cm.sendOk("You do not have a Gold Maple Leaf.");
cm.dispose();
}
break;
}
}
if (mode == 1)
status++;
else
status--;
if(!weddingIndoors) {
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (cm.haveItem(x, 1)) {
hasEngagement = true;
break;
}
}
if (status == 0) {
var text = "Welcome to the #bCathedral#k! How can I help you?";
var choice = ["How do I prepare a wedding?", "I have an engagement and want to arrange the wedding", "I am the guest and I'd like to go into the wedding"];
for (x = 0; x < choice.length; x++) {
text += "\r\n#L" + x + "##b" + choice[x] + "#l";
}
if (cm.haveItem(5251100)) {
text += "\r\n#L" + x + "##bMake additional invitation cards#l";
}
cm.sendSimple(text);
} else if (status == 1) {
switch(selection) {
case 0:
cm.sendOk("Firstly you need to be #bengaged#k to someone. #p9201000# makes the engagement ring. Once attained the engagement status, purchase a #b#t" + weddingEntryTicketCommon + "##k.\r\nShow me your engagement ring and a wedding ticket, and I will book a reservation for you along with #r15 Wedding Tickets#k. Use them to invite your guests into the wedding. They need 1 each to enter.");
cm.dispose();
break;
case 1:
if (hasEngagement) {
var wserv = cm.getClient().getWorldServer();
var cserv = cm.getClient().getChannelServer();
var weddingId = wserv.getRelationshipId(cm.getPlayer().getId());
if(weddingId > 0) {
if(cserv.isWeddingReserved(weddingId)) { // registration check
var placeTime = cserv.getWeddingReservationTimeLeft(weddingId);
cm.sendOk("Your wedding is set to start at the #r" + placeTime + "#k. Don't be late!");
} else {
var partner = wserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
if(partner == null) {
cm.sendOk("Your partner seems to be offline right now... Make sure to get both gathered here when the time comes!");
cm.dispose();
return;
}
if(hasWeddingRing(cm.getPlayer()) || hasWeddingRing(partner)) {
cm.sendOk("Either you or your partner already has a marriage ring.");
cm.dispose();
return;
}
if(!cm.getMap().equals(partner.getMap())) {
cm.sendOk("Please let your partner come here as well to register the reservation.");
cm.dispose();
return;
}
if(!cm.canHold(weddingSendTicket, 15) || !partner.canHold(weddingSendTicket, 15)) {
cm.sendOk("Either you or your partner doesn't have a free ETC slot for the Wedding tickets! Please make some room before trying to register a reservation.");
cm.dispose();
return;
}
var hasCommon = cm.haveItem(weddingEntryTicketCommon);
var hasPremium = cm.haveItem(weddingEntryTicketPremium);
if(hasCommon || hasPremium) {
var weddingType = (hasPremium ? true : false);
var player = cm.getPlayer();
var resStatus = cserv.pushWeddingReservation(weddingId, cathedralWedding, weddingType, player.getId(), player.getPartnerId());
if(resStatus > 0) {
cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1);
var expirationTime = cserv.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,15,false,true,expirationTime);
partner.getClient().getAbstractPlayerInteraction().gainItem(weddingSendTicket,15,false,true,expirationTime);
var placeTime = cserv.getWeddingReservationTimeLeft(weddingId);
var wedType = weddingType ? "Premium" : "Regular";
cm.sendOk("You both have received 15 Wedding Tickets, to be given to your guests. #bDouble-click the ticket#k to send it to someone. Invitations can only be sent #rbefore the wedding start time#k. Your #b" + wedType + " wedding#k is set to start at the #r" + placeTime + "#k. Don't be late!");
player.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Don't be late!");
partner.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Don't be late!");
if(!hasSuitForWedding(player)) {
player.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria.");
}
if(!hasSuitForWedding(partner)) {
partner.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria.");
}
} else {
cm.sendOk("Your wedding reservation must have been processed recently. Please try again later.");
}
} else {
cm.sendOk("Please have a #b#t" + weddingEntryTicketCommon + "##k available on your CASH inventory before trying to register a reservation.");
}
}
} else {
cm.sendOk("Wedding reservation encountered an error, try again later.");
}
cm.dispose();
} else {
cm.sendOk("You do not have an engagement ring.");
cm.dispose();
}
break;
case 2:
if (cm.haveItem(weddingGuestTicket)) {
var cserv = cm.getClient().getChannelServer();
wid = cserv.getOngoingWedding(cathedralWedding);
if(wid > 0) {
if(cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) {
var eim = getMarriageInstance(wid);
if(eim != null) {
cm.sendOk("Enjoy the wedding. Don't drop your Gold Maple Leaf or you won't be able to finish the whole wedding.");
} else {
cm.sendOk("Please wait a moment while the couple get ready to enter the Cathedral.");
cm.dispose();
}
} else {
cm.sendOk("Sorry, but you have not been invited for this wedding.");
cm.dispose();
}
} else {
cm.sendOk("There is no wedding booked right now.");
cm.dispose();
}
} else {
cm.sendOk("You do not have a #b#t" + weddingGuestTicket + "##k.");
cm.dispose();
}
break;
default:
var wserv = cm.getClient().getWorldServer();
var cserv = cm.getClient().getChannelServer();
var weddingId = wserv.getRelationshipId(cm.getPlayer().getId());
var resStatus = cserv.getWeddingReservationStatus(weddingId, cathedralWedding);
if(resStatus > 0) {
if(cm.canHold(weddingSendTicket, 3)) {
cm.gainItem(5251100, -1);
var expirationTime = cserv.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,3,false,true,expirationTime);
} else {
cm.sendOk("Please have a free ETC slot available to get more invitations.");
}
} else {
cm.sendOk("You're not currently booked on the Cathedral to make additional invitations.");
}
cm.dispose();
}
} else if (status == 2) { // registering guest
var eim = getMarriageInstance(wid);
if(eim != null) {
if(!cm.canHold(4000313)) {
cm.sendOk("Please have a free ETC slot available to get the #b#t4000313##k.");
cm.dispose();
return;
}
cm.gainItem(weddingGuestTicket, -1);
eim.registerPlayer(cm.getPlayer()); //cm.warp(680000210, 0);
} else {
cm.sendOk("The marriage event could not be found.");
}
cm.dispose();
}
} else {
if (status == 0) {
var eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId"));
if(eim.getIntProperty("weddingStage") == 0) {
if(!isMarrying) {
cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please hang around with the groom and bride while the other guests are gathering here.\r\n\r\nWhen the timer reach it's end the couple will head to the altar, at that time you will be allowed to root over them from the #bguests area#k.");
} else {
cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please greet the guests that are already here while the others are coming. When the timer reach it's end the couple will head to the altar.");
}
cm.dispose();
} else {
cm.sendYesNo("The #bbride and groom#k are already on their way to the altar. Would you like to join them now?");
}
} else if (status == 1) {
cm.warp(weddingAltarMapid,"sp");
cm.dispose();
}
}
}
}

View File

@@ -37,7 +37,7 @@ function start() {
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then");
cm.sendOk("Goodbye then.");
cm.dispose();
return;
} else if (mode == 1) {
@@ -45,28 +45,53 @@ function action(mode, type, selection) {
} else {
status--;
}
var eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
var isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId"));
switch (status) {
case 0:
cm.sendNext("I only warp out people who are here by accident.");
break;
case 1:
var engagementRings = new Array(4031360, 4031358, 4031362, 4031364);
var hasEngagement = false;
for (var x = 0; x < engagementRings.length && !hasEngagement; x++) {
if (cm.haveItem(engagementRings[x], 1))
for (var x = 4031357; x <= 4031364; x++) {
if (cm.haveItem(x, 1)) {
hasEngagement = true;
break;
}
}
if (cm.haveItem(4000313) && hasEngagement) {
cm.sendOk("Please continue with the wedding.");
cm.dispose();
if (cm.haveItem(4000313) && isMarrying) {
if(eim.getIntProperty("weddingStage") == 3) {
cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty.");
cm.dispose();
} else if(hasEngagement) {
cm.sendOk("Please continue with the wedding.");
cm.dispose();
} else {
cm.sendOk("You do not have the required item to continue through this wedding. Unfortunately, it's over...");
}
} else {
cm.warp(680000000,0);
cm.dispose();
if(eim.getIntProperty("weddingStage") == 3) {
if(!isMarrying) {
cm.sendYesNo("The couple #rhas just married#k, and soon #bthey will start the afterparty#k. You should wait here for them. Are you really ready to #rquit this wedding#k and return to #bAmoria#k?");
} else {
cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty.");
cm.dispose();
}
} else {
cm.sendYesNo("Are you sure you want to #rquit this wedding#k and return to #bAmoria#k?");
}
}
break;
case 2:
cm.sendOk("You do not have the required item to continue through this wedding.");
case 1:
cm.warp(680000000,0);
cm.dispose();
break;
}
}

View File

@@ -25,20 +25,64 @@
Angel (get31720 ragezone)
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3] & [XotiCraze]
-- Content Improved by ----------------------------------------------------------------------------
RonanLana (HeavenMS)
---------------------------------------------------------------------------------------------------
**/
var status;
var i;
var eim;
var hasEngage;
var hasRing;
function start() {
status = -1;
action(1, 0, 0);
eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
if(cm.getMapId() == 680000200) {
if(eim.getIntProperty("weddingStage") == 0) {
cm.sendNext("The guests are gathering here right now. Please wait awhile, the ceremony will start soon enough.");
} else {
cm.warp(680000210, "sp");
cm.sendNext("Pick your seat over here and good show!");
}
cm.dispose();
} else {
if(cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) {
cm.sendNext("Sorry, only the marrying couple should be talking to me right now.");
cm.dispose();
return;
}
hasEngage = false;
for(var i = 4031357; i <= 4031364; i++) {
if(cm.haveItem(i)) {
hasEngage = true;
break;
}
}
var rings = [1112806, 1112803, 1112807, 1112809];
hasRing = false;
for (i = 0; i < rings.length; i++) {
if (cm.getPlayer().haveItemWithId(rings[i], true)) {
hasRing = true;
}
}
status = -1;
action(1, 0, 0);
}
}
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then");
cm.sendOk("Goodbye then.");
cm.dispose();
return;
} else if (mode == 1) {
@@ -46,28 +90,16 @@ function action(mode, type, selection) {
} else {
status--;
}
var engagementRings = Array(4031360, 4031358, 4031362, 4031364);
var hasEngage = false;
for (i = 0; i < engagementRings.length && !hasEngage; i++) {
if (cm.haveItem(engagementRings[i]))
hasEngage = true;
}
var Rings = Array(1112806, 1112803, 1112807, 1112809);
var hasRing = false;
for (i = 0; i < Rings.length; i++) {
if (cm.haveItem(Rings[i])) {
hasRing = true;
}
}
if (status == 0) {
if (cm.haveItem(4000313) && hasEngage) {
var hasGoldenLeaf = cm.haveItem(4000313);
if (hasGoldenLeaf && hasEngage) {
cm.sendOk("You can't leave yet! You need to click High Priest John and get married before I can let you leave.");
cm.dispose();
} else if (cm.haveItem(4000313) && hasRing) {
var choice = Array("Go to the Cherished Visage Photos", "What should I be doing");
var msg = "What can I help you with?";
} else if (hasGoldenLeaf && hasRing) {
var choice = Array("Go to the Afterparty", "What should I be doing");
var msg = "What can I help you with?#b";
for (i = 0; i < choice.length; i++) {
msg += "\r\n#L" + i + "#" + choice[i] + "#l";
}
@@ -79,14 +111,22 @@ function action(mode, type, selection) {
} else if (status == 1) {
switch(selection) {
case 0:
cm.warp(680000300, 0);
cm.sendOk("Enjoy! Cherish your Photos Forever!");
if(eim.getIntProperty("isPremium") == 1) {
eim.warpEventTeam(680000300);
cm.sendOk("Enjoy! Cherish your Photos Forever!");
} else { // skip the party-time (premium only)
eim.warpEventTeam(680000500);
cm.sendOk("Congratulations for the newly-wed! I will escort you to the exit.");
}
cm.dispose();
break;
case 1:
cm.sendOk("The Bride and Groom must click High Priest John to be wed. When you are ready you can click me to go to the Cherished Visage Photos");
cm.sendOk("The Bride and Groom must receive the blessings of High Priest John to be wed. When you are ready you can click me to go to the Afterparty.");
cm.dispose();
break;
default:
cm.warp(680000000,0);
cm.dispose();

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,34 +17,289 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* NPC Base
Map Name (Map ID)
Extra NPC info.
/* Assistant Bonnie
Marriage NPC
*/
var status;
function start() {
status = -1;
action(1, 0, 0);
var wid;
var isMarrying;
var cathedralWedding = false;
var weddingEventName = "WeddingChapel";
var weddingEntryTicketCommon = 5251001;
var weddingEntryTicketPremium = 5251002;
var weddingSendTicket = 4031377;
var weddingGuestTicket = 4031406;
var weddingAltarMapid = 680000110;
var weddingIndoors;
function isWeddingIndoors(mapid) {
return mapid >= 680000100 && mapid <= 680000500;
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
function hasSuitForWedding(player) {
var baseid = (player.getGender() == 0) ? 1050131 : 1051150;
for(var i = 0; i < 4; i++) {
if(player.haveItemWithId(baseid + i, true)) {
return true;
}
}
return false;
}
function getMarriageInstance(weddingId) {
var em = cm.getEventManager(weddingEventName);
for (var iterator = em.getInstances().iterator(); iterator.hasNext();) {
var eim = iterator.next();
if(eim.getIntProperty("weddingId") == weddingId) {
return eim;
}
}
return null;
}
function hasWeddingRing(player) {
var rings = [1112806, 1112803, 1112807, 1112809];
for (var i = 0; i < rings.length; i++) {
if (player.haveItemWithId(rings[i], true)) {
return true;
}
}
return false;
}
function start() {
weddingIndoors = isWeddingIndoors(cm.getMapId());
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(!weddingIndoors) {
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (cm.haveItem(x, 1)) {
hasEngagement = true;
break;
}
}
if (status == 0) {
var text = "Welcome to the #bChapel#k! How can I help you?";
var choice = ["How do I prepare a wedding?", "I have an engagement and want to arrange the wedding", "I am the guest and I'd like to go into the wedding"];
for (x = 0; x < choice.length; x++) {
text += "\r\n#L" + x + "##b" + choice[x] + "#l";
}
if (cm.haveItem(5251100)) {
text += "\r\n#L" + x + "##bMake additional invitation cards#l";
}
cm.sendSimple(text);
} else if (status == 1) {
switch(selection) {
case 0:
cm.sendOk("Firstly you need to be #bengaged#k to someone. #p9201000# makes the engagement ring. Once attained the engagement status, purchase a #b#t" + weddingEntryTicketCommon + "##k.\r\nShow me your engagement ring and a wedding ticket, and I will book a reservation for you along with #r15 Wedding Tickets#k. Use them to invite your guests into the wedding. They need 1 each to enter.");
cm.dispose();
break;
case 1:
if (hasEngagement) {
var wserv = cm.getClient().getWorldServer();
var cserv = cm.getClient().getChannelServer();
var weddingId = wserv.getRelationshipId(cm.getPlayer().getId());
if(weddingId > 0) {
if(cserv.isWeddingReserved(weddingId)) { // registration check
var placeTime = cserv.getWeddingReservationTimeLeft(weddingId);
cm.sendOk("Your wedding is set to start at the #r" + placeTime + "#k. Don't be late!");
} else {
var partner = wserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
if(partner == null) {
cm.sendOk("Your partner seems to be offline right now... Make sure to get both gathered here when the time comes!");
cm.dispose();
return;
}
if(hasWeddingRing(cm.getPlayer()) || hasWeddingRing(partner)) {
cm.sendOk("Either you or your partner already has a marriage ring.");
cm.dispose();
return;
}
if(!cm.getMap().equals(partner.getMap())) {
cm.sendOk("Please let your partner come here as well to register the reservation.");
cm.dispose();
return;
}
if(!cm.canHold(weddingSendTicket, 15) || !partner.canHold(weddingSendTicket, 15)) {
cm.sendOk("Either you or your partner doesn't have a free ETC slot for the Wedding tickets! Please make some room before trying to register a reservation.");
cm.dispose();
return;
}
var hasCommon = cm.haveItem(weddingEntryTicketCommon);
var hasPremium = cm.haveItem(weddingEntryTicketPremium);
if(hasCommon || hasPremium) {
var weddingType = (hasPremium ? true : false);
var player = cm.getPlayer();
var resStatus = cserv.pushWeddingReservation(weddingId, cathedralWedding, weddingType, player.getId(), player.getPartnerId());
if(resStatus > 0) {
cm.gainItem((weddingType) ? weddingEntryTicketPremium : weddingEntryTicketCommon, -1);
var expirationTime = cserv.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,15,false,true,expirationTime);
partner.getClient().getAbstractPlayerInteraction().gainItem(weddingSendTicket,15,false,true,expirationTime);
var placeTime = cserv.getWeddingReservationTimeLeft(weddingId);
var wedType = weddingType ? "Premium" : "Regular";
cm.sendOk("You both have received 15 Wedding Tickets, to be given to your guests. #bDouble-click the ticket#k to send it to someone. Invitations can only be sent #rbefore the wedding start time#k. Your #b" + wedType + " wedding#k is set to start at the #r" + placeTime + "#k. Don't be late!");
player.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Don't be late!");
partner.dropMessage(6, "Wedding Assistant: You both have received 15 Wedding Tickets. Invitations can only be sent before the wedding start time. Your " + wedType + " wedding is set to start at the " + placeTime + ". Don't be late!");
if(!hasSuitForWedding(player)) {
player.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria.");
}
if(!hasSuitForWedding(partner)) {
partner.dropMessage(5, "Wedding Assistant: Please purchase a wedding garment before showing up for the ceremony. One can be bought at the Wedding Shop left-most Amoria.");
}
} else {
cm.sendOk("Your wedding reservation must have been processed recently. Please try again later.");
}
} else {
cm.sendOk("Please have a #b#t" + weddingEntryTicketCommon + "##k available on your CASH inventory before trying to register a reservation.");
}
}
} else {
cm.sendOk("Wedding reservation encountered an error, try again later.");
}
cm.dispose();
} else {
cm.sendOk("You do not have an engagement ring.");
cm.dispose();
}
break;
case 2:
if (cm.haveItem(weddingGuestTicket)) {
var cserv = cm.getClient().getChannelServer();
wid = cserv.getOngoingWedding(cathedralWedding);
if(wid > 0) {
if(cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) {
var eim = getMarriageInstance(wid);
if(eim != null) {
cm.sendOk("Enjoy the wedding. Don't drop your Gold Maple Leaf or you won't be able to finish the whole wedding.");
} else {
cm.sendOk("Please wait a moment while the couple get ready to enter the Chapel.");
cm.dispose();
}
} else {
cm.sendOk("Sorry, but you have not been invited for this wedding.");
cm.dispose();
}
} else {
cm.sendOk("There is no wedding booked right now.");
cm.dispose();
}
} else {
cm.sendOk("You do not have a #b#t" + weddingGuestTicket + "##k.");
cm.dispose();
}
break;
default:
var wserv = cm.getClient().getWorldServer();
var cserv = cm.getClient().getChannelServer();
var weddingId = wserv.getRelationshipId(cm.getPlayer().getId());
var resStatus = cserv.getWeddingReservationStatus(weddingId, cathedralWedding);
if(resStatus > 0) {
if(cm.canHold(weddingSendTicket, 3)) {
cm.gainItem(5251100, -1);
var expirationTime = cserv.getRelativeWeddingTicketExpireTime(resStatus);
cm.gainItem(weddingSendTicket,3,false,true,expirationTime);
} else {
cm.sendOk("Please have a free ETC slot available to get more invitations.");
}
} else {
cm.sendOk("You're not currently booked on the Chapel to make additional invitations.");
}
cm.dispose();
}
} else if (status == 2) { // registering guest
var eim = getMarriageInstance(wid);
if(eim != null) {
if(!cm.canHold(4000313)) {
cm.sendOk("Please have a free ETC slot available to get the #b#t4000313##k.");
cm.dispose();
return;
}
cm.gainItem(weddingGuestTicket, -1);
eim.registerPlayer(cm.getPlayer()); //cm.warp(680000210, 0);
} else {
cm.sendOk("The marriage event could not be found.");
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.sendOk("Wedding is currently closed.");
cm.dispose();
cm.dispose();
}
} else {
if (status == 0) {
var eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId"));
if(eim.getIntProperty("weddingStage") == 0) {
if(!isMarrying) {
cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please hang around with the groom and bride while the other guests are gathering here.\r\n\r\nWhen the timer reach it's end the couple will head to the altar, at that time you will be allowed to root over them from the #bguests area#k.");
} else {
cm.sendOk("Welcome to the #b#m" + cm.getMapId() + "##k. Please greet the guests that are already here while the others are coming. When the timer reach it's end the couple will head to the altar.");
}
cm.dispose();
} else {
cm.sendYesNo("The #bbride and groom#k are already on their way to the altar. Would you like to join them now?");
}
} else if (status == 1) {
cm.warp(weddingAltarMapid,"sp");
cm.dispose();
}
}
}
}

136
scripts/npc/9201009.js Normal file
View File

@@ -0,0 +1,136 @@
/*
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/>.
*/
/**
Assistant Nancy
-- By ---------------------------------------------------------------------------------------------
Angel (get31720 ragezone)
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3] & [XotiCraze]
-- Content Improved by ----------------------------------------------------------------------------
RonanLana (HeavenMS)
---------------------------------------------------------------------------------------------------
**/
var status;
var eim;
var hasEngage;
var hasRing;
function start() {
eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
if(cm.getMapId() == 680000200) {
if(eim.getIntProperty("weddingStage") == 0) {
cm.sendNext("The guests are gathering here right now. Please wait awhile, the ceremony will start soon enough.");
} else {
cm.warp(680000210, "sp");
cm.sendNext("Pick your seat over here and good show!");
}
cm.dispose();
} else {
if(cm.getPlayer().getId() != eim.getIntProperty("groomId") && cm.getPlayer().getId() != eim.getIntProperty("brideId")) {
cm.sendNext("Sorry, only the marrying couple should be talking to me right now.");
cm.dispose();
return;
}
hasEngage = false;
for(var i = 4031357; i <= 4031364; i++) {
if(cm.haveItem(i)) {
hasEngage = true;
break;
}
}
var rings = [1112806, 1112803, 1112807, 1112809];
hasRing = false;
for (i = 0; i < rings.length; i++) {
if (cm.getPlayer().haveItemWithId(rings[i], true)) {
hasRing = true;
}
}
status = -1;
action(1, 0, 0);
}
}
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then.");
cm.dispose();
return;
} else if (mode == 1) {
status++;
} else {
status--;
}
if (status == 0) {
var hasGoldenLeaf = cm.haveItem(4000313);
if (hasGoldenLeaf && hasEngage) {
cm.sendOk("You can't leave yet! You need to click Pelvis Bebop and get his word before I can let you leave.");
cm.dispose();
} else if (hasGoldenLeaf && hasRing) {
var choice = Array("Go to the Afterparty", "What should I be doing");
var msg = "What can I help you with?#b";
for (i = 0; i < choice.length; i++) {
msg += "\r\n#L" + i + "#" + choice[i] + "#l";
}
cm.sendSimple(msg);
} else {
cm.sendNext("You don't seem to have a Gold Maple Leaf, engagement ring, or wedding ring. You must not belong here, so I will take you to Amoria.");
selection = 20; // Random.
}
} else if (status == 1) {
switch(selection) {
case 0:
if(eim.getIntProperty("isPremium") == 1) {
eim.warpEventTeam(680000300);
cm.sendOk("Enjoy! Cherish your Photos Forever!");
} else { // skip the party-time (premium only)
eim.warpEventTeam(680000500);
cm.sendOk("Congratulations for the newly-wed! I will escort you to the exit.");
}
cm.dispose();
break;
case 1:
cm.sendOk("The superstars must receive the word of Pelvis Bebop to be united. When you are ready you can click me to go to the Afterparty.");
cm.dispose();
break;
default:
cm.warp(680000000,0);
cm.dispose();
break;
}
}
}

View File

@@ -29,17 +29,74 @@
**/
var status;
function start() {
if (cm.haveItem(4000313)) {
cm.sendOk("You are a guest. Please continue with the wedding. I only warp out people who are here by accident.");
cm.dispose();
} else
cm.sendNext("I warp people out. If you are the newly wed don't click next or you will not be able to collect your prize at the end.");
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode > 1)
cm.warp(680000000);
cm.dispose();
}
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.dispose();
return;
} else if (mode == 1) {
status++;
} else {
status--;
}
var eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
var isMarrying = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId"));
switch (status) {
case 0:
if(cm.getMapId() == 680000300) {
cm.sendYesNo("Are you sure you want to #rquit the stage#k and head back to #bAmoria#k? You will be #rskipping the bonus stages#k that way.");
} else {
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (cm.haveItem(x, 1)) {
hasEngagement = true;
break;
}
}
if (cm.haveItem(4000313) && isMarrying) {
if(eim.getIntProperty("weddingStage") == 3) {
cm.sendOk("You guys totally rocked the stage!!! Go go, talk to #b#p9201007##k to start the afterparty.");
cm.dispose();
} else if(hasEngagement) {
cm.sendOk("Please continue rocking on the stage, you are our superstars today!");
cm.dispose();
} else {
cm.sendOk("Oh, hey, where are the credentials for the this so-lauded party? Oh man, we can't continue at this rate now... Sorry, the party is over.");
}
} else {
if(eim.getIntProperty("weddingStage") == 3) {
if(!isMarrying) {
cm.sendYesNo("You guys didn't miss them right? Our superstars #rworked so good together#k, and soon #bthey will start the afterparty#k. Are you really going to #rdrop out of the show#k and return to #bAmoria#k?");
} else {
cm.sendOk("You guys totally rocked the stage!!! Go go, talk to #b#p9201007##k to start the afterparty.");
cm.dispose();
}
} else {
cm.sendYesNo("Are you sure you want to #rquit the stage#k and head to #bAmoria#k? You will be #rskipping the bonus stages#k, fam.");
}
}
}
break;
case 1:
cm.warp(680000000,0);
cm.dispose();
break;
}
}

292
scripts/npc/9201011.js Normal file
View File

@@ -0,0 +1,292 @@
/*
This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
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/>.
*/
/* Pelvis Bebop
Marriage NPC
*/
importPackage(Packages.constants);
importPackage(Packages.net.server.channel.handlers);
importPackage(Packages.tools);
importPackage(Packages.tools.packets);
var status;
var state;
var eim;
var weddingEventName = "WeddingChapel";
var cathedralWedding = false;
var weddingIndoors;
var weddingBlessingExp = ServerConstants.WEDDING_BLESS_EXP;
function detectPlayerItemid(player) {
for (var x = 4031357; x <= 4031364; x++) {
if (player.haveItem(x)) {
return x;
}
}
return -1;
}
function getRingId(boxItemId) {
return boxItemId == 4031357 ? 1112803 : (boxItemId == 4031359 ? 1112806 : (boxItemId == 4031361 ? 1112807 : (boxItemId == 4031363 ? 1112809 : -1)));
}
function isSuitedForWedding(player, equipped) {
var baseid = (player.getGender() == 0) ? 1050131 : 1051150;
if(equipped) {
for(var i = 0; i < 4; i++) {
if(player.haveItemEquipped(baseid + i)) {
return true;
}
}
} else {
for(var i = 0; i < 4; i++) {
if(player.haveItemWithId(baseid + i, true)) {
return true;
}
}
}
return false;
}
function getWeddingPreparationStatus(player, partner) {
if(!player.haveItem(4000313)) return -3;
if(!partner.haveItem(4000313)) return 3;
if(!isSuitedForWedding(player, true)) return -4;
if(!isSuitedForWedding(partner, true)) return 4;
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (player.haveItem(x)) {
hasEngagement = true;
break;
}
}
if(!hasEngagement) return -1;
hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (partner.haveItem(x)) {
hasEngagement = true;
break;
}
}
if(!hasEngagement) return -2;
if(!player.canHold(1112803)) return 1;
if(!partner.canHold(1112803)) return 2;
return 0;
}
function giveCoupleBlessings(eim, player, partner) {
var blessCount = eim.gridSize();
player.gainExp(blessCount * weddingBlessingExp);
partner.gainExp(blessCount * weddingBlessingExp);
}
function start() {
eim = cm.getEventInstance();
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(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
var playerId = cm.getPlayer().getId();
if(playerId == eim.getIntProperty("groomId") || playerId == eim.getIntProperty("brideId")) {
var wstg = eim.getIntProperty("weddingStage");
if(wstg == 2) {
cm.sendYesNo("Awhoooooooooosh~, the guests have proclaimed their love to y'all. The time has come baby~, #rshould I make you Husband and Wife#k?");
state = 1;
} else if(wstg == 1) {
cm.sendOk("W-whoah wait a bit alright? Your guests are currently giving their love to y'all. Let's shake this place up, baby~~.");
cm.dispose();
} else {
cm.sendOk("Wheeeeeeeeeeeeeew! Our festival here is now complete, give a sweet talk to #b#p9201009##k, she will lead you and your folks to the afterparty. Cheers for your love!");
cm.dispose();
}
} else {
var wstg = eim.getIntProperty("weddingStage");
if(wstg == 1) {
if(eim.gridCheck(cm.getPlayer()) != -1) {
cm.sendOk("Everyone let's shake this place up! Let's rock 'n' roll!!");
cm.dispose();
} else {
if(eim.getIntProperty("guestBlessings") == 1) {
cm.sendYesNo("Will you manifest your love to the superstars here present?");
state = 0;
} else {
cm.sendOk("Our superstars are gathered down here. Everyone, let's give them some nice, nicey party~!");
cm.dispose();
}
}
} else if(wstg == 3) {
cm.sendOk("Whooooooo-hoo! The couple's love now are like one super big shiny heart right now! And it shall go on ever after this festival. Please #rget ready for the afterparty#k, baby~. Follow the married couple's lead!");
cm.dispose();
} else {
cm.sendOk("It's now guys... Stay with your eyes and ears keened up! They are about to smooch it all over the place!!!");
cm.dispose();
}
}
} else if (status == 1) {
if(state == 0) { // give player blessings
eim.gridInsert(cm.getPlayer(), 1);
if(ServerConstants.WEDDING_BLESSER_SHOWFX) {
var target = cm.getPlayer();
target.announce(MaplePacketCreator.showSpecialEffect(9));
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
} else {
var target = eim.getPlayerById(eim.getIntProperty("groomId"));
target.announce(MaplePacketCreator.showSpecialEffect(9));
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
target = eim.getPlayerById(eim.getIntProperty("brideId"));
target.announce(MaplePacketCreator.showSpecialEffect(9));
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
}
cm.sendOk("Way to go, my friend! Your LOVE has been added to theirs, now in one bigger heart-shaped sentiment that will remain lively in our hearts forever! Who-hoo~!");
cm.dispose();
} else { // couple wants to complete the wedding
var wstg = eim.getIntProperty("weddingStage");
if(wstg == 2) {
var pid = cm.getPlayer().getPartnerId();
if(pid <= 0) {
cm.sendOk("Huh~.... Wait wait, did you just break that thing you had right now?? Oh my, what happened?");
cm.dispose();
return;
}
var player = cm.getPlayer();
var partner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId());
if(partner != null) {
state = getWeddingPreparationStatus(player, partner);
switch(state) {
case 0:
var pid = eim.getIntProperty("confirmedVows");
if(pid != -1) {
if(pid == player.getId()) {
cm.sendOk("You have already confirmed your vows. All that is left is for your partner to confirm now.");
} else {
eim.setIntProperty("weddingStage", 3);
var cmPartner = partner.getClient().getAbstractPlayerInteraction();
var playerItemId = detectPlayerItemid(player);
var partnerItemId = (playerItemId % 2 == 1) ? playerItemId + 1 : playerItemId - 1;
var marriageRingId = getRingId((playerItemId % 2 == 1) ? playerItemId : partnerItemId);
cm.gainItem(playerItemId, -1);
cmPartner.gainItem(partnerItemId, -1);
RingActionHandler.giveMarriageRings(player, partner, marriageRingId);
player.setMarriageItemId(marriageRingId);
partner.setMarriageItemId(marriageRingId);
//var marriageId = eim.getIntProperty("weddingId");
//player.announce(Wedding.OnMarriageResult(marriageId, player, true));
//partner.announce(Wedding.OnMarriageResult(marriageId, player, true));
giveCoupleBlessings(eim, player, partner);
cm.getMap().dropMessage(6, "Wayne: I'll call it out right now, and it shall go on: you guys are the key of the other's lock, a lace of a pendant. That's it, snog yourselves!");
eim.schedule("showMarriedMsg", 2 * 1000);
}
} else {
eim.setIntProperty("confirmedVows", player.getId());
cm.getMap().dropMessage(6, "Wedding Assistant: " + player.getName() + " has confirmed vows! Alright, one step away to make it official. Tighten your seatbelts!");
}
break;
case -1:
cm.sendOk("Well, it seems you no longer have the ring/ring box you guys exchanged at the engagement. Awww man~");
break;
case -2:
cm.sendOk("Well, it seems your partner no longer has the ring/ring box you guys exchanged at the engagement. Awww man~");
break;
case -3:
cm.sendOk("Well, it seems you don't have the #r#t4000313##k given at the entrance... Please find it, baby~");
break;
case -4:
cm.sendOk("Aww I know that shucks, but the fashionable wedding clothes does a essential part here. Please wear it before talking to me.");
break;
case 1:
cm.sendOk("Please make an EQUIP slot available to get the marriage ring, will you?");
break;
case 2:
cm.sendOk("Please let your partner know to make an EQUIP slot available to get the marriage ring, will you?");
break;
case 3:
cm.sendOk("Well, it seems your partner don't have the #r#t4000313##k given at the entrance... Please find it, I can't call the finally without it.");
break;
case 4:
cm.sendOk("Aww I know that shucks, but it seems your partner is not using the fashionable wedding clothes. Please tell them to wear it before talking to me.");
break;
}
cm.dispose();
} else {
cm.sendOk("Oof, is that it that your partner is not here, right now? ... Oh noes, I'm afraid I can't call the finally if your partner is not here.");
cm.dispose();
}
} else {
cm.sendOk("Wheeeeeeeeeeeeew~ You are now #bofficially one couple#k, and a brilliant one. Your moves fitted in outstandingly, congratulations!");
cm.dispose();
}
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,34 +17,168 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* NPC Base
Map Name (Map ID)
Extra NPC info.
/* Wayne
Marriage NPC
*/
var status;
function start() {
status = -1;
action(1, 0, 0);
var state;
var eim;
var weddingEventName = "WeddingChapel";
var cathedralWedding = false;
function isSuitedForWedding(player, equipped) {
var baseid = (player.getGender() == 0) ? 1050131 : 1051150;
if(equipped) {
for(var i = 0; i < 4; i++) {
if(player.haveItemEquipped(baseid + i)) {
return true;
}
}
} else {
for(var i = 0; i < 4; i++) {
if(player.haveItemWithId(baseid + i, true)) {
return true;
}
}
}
return false;
}
function getMarriageInstance(player) {
var em = cm.getEventManager(weddingEventName);
for (var iterator = em.getInstances().iterator(); iterator.hasNext();) {
var eim = iterator.next();
if(eim.isEventLeader(player)) {
return eim;
}
}
return null;
}
function start() {
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) {
cm.sendOk("Wedding is currently closed.");
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) {
var hasEngagement = false;
for (var x = 4031357; x <= 4031364; x++) {
if (cm.haveItem(x, 1)) {
hasEngagement = true;
break;
}
}
if(hasEngagement) {
var text = "Hi there. How about skyrocket the day with your fiancee baby~?";
var choice = new Array("We're ready to get married.");
for (x = 0; x < choice.length; x++) {
text += "\r\n#L" + x + "##b" + choice[x] + "#l";
}
cm.sendSimple(text);
} else {
cm.sendOk("Hi there, folks. Even thought of having a wedding held on Amoria? When the talk is about wedding, everyone firstly thinks about Amoria, there is no miss to it. Our chapel here is renowned around the Maple world for offering the best wedding services for maplers!");
cm.dispose();
}
} else if(status == 1) {
var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId());
var cserv = cm.getClient().getChannelServer();
if(cserv.isWeddingReserved(wid)) {
if(wid == cserv.getOngoingWedding(cathedralWedding)) {
var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
if(!(partner == null || !cm.getMap().equals(partner.getMap()))) {
if(!cm.canHold(4000313)) {
cm.sendOk("Please have a free ETC slot available to get the #b#t4000313##k.");
cm.dispose();
return;
} else if(!partner.canHold(4000313)) {
cm.sendOk("Please let your partner know they must have a free ETC slot available to get the #b#t4000313##k.");
cm.dispose();
return;
} else if(!isSuitedForWedding(cm.getPlayer(), false)) {
cm.sendOk("Please purchase fashionable #rwedding clothes#k for the wedding, quickly! It's time to shine, baby~!");
cm.dispose();
return;
} else if(!isSuitedForWedding(partner, false)) {
cm.sendOk("Your partner must know they must have fashionable #rwedding clothes#k for the wedding. It's time to shine, baby~!");
cm.dispose();
return;
}
cm.sendOk("Alright! The couple appeared here stylish as ever. Let's go folks, let's rock 'n' roll!!!");
} else {
cm.sendOk("Aww, your partner is elsewhere... Both must be here for the wedding, else it's going to be sooooo lame.");
cm.dispose();
}
} else {
var placeTime = cserv.getWeddingReservationTimeLeft(wid);
cm.sendOk("Yo. Your wedding is set to happen at the #r" + placeTime + "#k, don't be late will you?");
cm.dispose();
}
} else {
cm.sendOk("Aawww, I'm sorry but there are no reservations made for you at this channel for the time being.");
cm.dispose();
}
} else if(status == 2) {
var cserv = cm.getClient().getChannelServer();
var wtype = cserv.getOngoingWeddingType(cathedralWedding);
var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
if(!(partner == null || !cm.getMap().equals(partner.getMap()))) {
if(cserv.acceptOngoingWedding(cathedralWedding)) {
var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId());
if(wid > 0) {
var em = cm.getEventManager(weddingEventName);
if(em.startInstance(cm.getPlayer())) {
eim = getMarriageInstance(cm.getPlayer());
if(eim != null) {
eim.setIntProperty("weddingId", wid);
eim.setIntProperty("groomId", cm.getPlayer().getId());
eim.setIntProperty("brideId", cm.getPlayer().getPartnerId());
eim.setIntProperty("isPremium", wtype ? 1 : 0);
eim.registerPlayer(partner);
} else {
cm.sendOk("An unexpected error happened when locating the wedding event. Please try again later.");
}
cm.dispose();
} else {
cm.sendOk("An unexpected error happened before the wedding preparations. Please try again later.");
cm.dispose();
}
} else {
cm.sendOk("An unexpected error happened before the wedding preparations. Please try again later.");
cm.dispose();
}
} else { // partner already decided to start
cm.dispose();
}
} else {
cm.sendOk("Aww, it seems your partner is elsewhere... Both must be here for the wedding, else it's going to be sooooo lame.");
cm.dispose();
}
}
}
}

View File

@@ -19,51 +19,11 @@
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/>.
*/
/* victora
by Angel (get31720 ragezone)
/* Victoria
by Ronan
*/
var wui = 0;
function start() {
cm.sendSimple ("Welcome to the Cathedral. What would you like to do? \r\n#L0##bI need invitations for my guests#k #l\r\n#L1##bI'd like to prepare a wedding#k #l\r\n#L2##bCan you explain how I should prepare a wedding?#k #l\r\n#L3##bI am either the groom or bride and I'd like to go in#k #l\r\n#L4##bI am a guest and I'd like to go in#k #l");
}
function action(mode, type, selection) {
cm.sendOk("Welcome to the Cathedral.\r\n\r\n#bCouples#k wanting to marry on the Cathedral should first #barrange a reservation#k with #r#p9201005##k. When the arranged time comes #bboth#k must show up here, on the same channel from the reservation, and start the ceremony (there is a 10-minutes fault policy to this) by talking to #r#p9201002##k. Once arranged, both can #bdistribute tickets#k to friends or acquainteds to become the guests for the marriage.\r\n\r\nThe ceremony will start accepting #bguests#k after the groom and the bride has entered the building. Show the #b#t4000313##k to #r#p9201005##k to access the inner rooms. No one without a ticket is allowed to enter the stage!");
cm.dispose();
if (selection == 0) {
if (cm.haveItem(4214002)) {
cm.sendNext("Alright here are you invitations make sure your guest have them or they can't come in!");
cm.gainItem(4031395,10);
} else {
cm.sendOk("Sorry but please make sure you have your premium wedding receipt or you won't be able to have your wedding");
status = 9;
}
} else if (selection == 1) {
if (cm.haveItem(5251003)) {
cm.sendNext("Alright, I'll give you your premium wedding receipt and make sure you don't lose it! If you lose your receipt you won't be able to get invitations or enter the cathedral!");
cm.gainItem(4214002,1);
} else if (selection == 2) {
cm.sendNext("Have both the bride and groom buy a premium cathedral wedding ticket from the cash shop. Then ask me to prepare your wedding and i'll give you a wedding receipt. Talk to me if you want invitations so other guests can join. When you're ready just have everyone come to me and i'll let you or the guests in. Inside Debbie will warp you out to Amoria if you chose to leave. Nicole will warp you to the next map.");
} else if (selection == 3) {
if (cm.haveItem(4214002)) {
cm.sendNext("Okay go on in. Once you're ready click the Priest and he'll get you married.");
cm.warp(680000210, 2);
} else {
cm.sendOk("Sorry but you don't have a wedding receipt.");
status = 9;
}
} else if (selection == 4) {
if (cm.haveItem(4031395)) {
cm.sendNext("Okay go on in. Once the bride and groom is ready click Nicole on the bottom to warp to the next map. Or use Debbie to leave to Amoria.");
cm.warp(680000210,0);
} else {
cm.sendOk("Sorry but you don't have a premium wedding invitation.");
status = 9;
}
cm.dispose();
}
}
}
}

View File

@@ -25,9 +25,13 @@
Angel (get31720 ragezone)
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3] & [XotiCraze]
Improved by [RonanLana]
---------------------------------------------------------------------------------------------------
**/
var bgPrizes = [[2022179,10], [2022282,10], [2210005,5], [2210003,5]];
var cmPrizes = [[2022011,10], [2000005,50], [2022273,10], [2022179,3]];
var status;
function start() {
@@ -37,7 +41,7 @@ function start() {
function action(mode, type, selection) {
if (mode == -1 || mode == 0) {
cm.sendOk("Goodbye then");
cm.sendOk("Goodbye then.");
cm.dispose();
return;
} else if (mode == 1) {
@@ -47,7 +51,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!";
var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!#b";
var choice1 = new Array("I have an Onyx Chest for Bride and Groom", "I have an Onyx Chest");
for (var i = 0; i < choice1.length; i++) {
msg += "\r\n#L" + i + "#" + choice1[i] + "#l";
@@ -56,38 +60,41 @@ function action(mode, type, selection) {
} else if (status == 1) {
if (selection == 0) {
if (cm.haveItem(4031424)) {
var rand = Math.floor(Math.random() * 4);
if (rand == 0)
cm.gainItem(2022179,10);
else if (rand == 1)
cm.gainItem(2022282,10);
else if (rand == 2)
cm.gainItem(2210005,5);
else if (rand == 3)
cm.gainItem(2210003,5);
cm.gainItem(4031424,-1);
if (cm.isMarried()) {
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
var rand = Math.floor(Math.random() * bgPrizes.length);
cm.gainItem(bgPrizes[rand][0], bgPrizes[rand][1]);
cm.gainItem(4031424,-1);
cm.dispose();
} else {
cm.sendOk("You don't have a free USE slot right now.");
cm.dispose();
}
} else {
cm.sendOk("You must be married to claim the prize for this box.");
cm.dispose();
}
} else {
cm.sendOk("You don't have an Onyx Chest for Bride and Groom.");
cm.dispose();
}
} else if (selection == 1) {
if (cm.haveItem(4031423)) {
cm.sendSimple("You may choose your prize.\r\n#L0#Triangular Sushi#l\r\n#L1#50 power elixers#l\r\n#L2#10 Swiss Cheese#l\r\n#L3#3 Onyx Apples#l");
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
var rand = Math.floor(Math.random() * cmPrizes.length);
cm.gainItem(cmPrizes[rand][0], cmPrizes[rand][1]);
cm.gainItem(4031423,-1);
cm.dispose();
} else {
cm.sendOk("You don't have a free USE slot right now.");
cm.dispose();
}
} else {
cm.sendOk("You don't have an Onyx Chest");
cm.sendOk("You don't have an Onyx Chest.");
cm.dispose();
}
}
} else if (status == 2) {
if (selection == 0)
cm.gainItem(2022011,10);
else if (selection == 1)
cm.gainItem(2000005,50);
else if (selection == 2)
cm.gainItem(2022273,10);
else if (selection == 3)
cm.gainItem(2022179,3);
cm.gainItem(4031423,-1);
cm.dispose();
}
}

View File

@@ -22,7 +22,8 @@
var status = 0;
function start() {
cm.sendSimple("Hello, where would you like to go?\r\n#L0#Untamed Hearts Hunting Ground#l\r\n#L1#I have 7 keys. Bring me to smash boxes#l\r\n#L2#Please warp me out.#l");
if(cm.getMapId() != 680000401) cm.sendSimple("Hello, where would you like to go?\r\n#b" + ((cm.getMapId() != 680000400) ? "#L0#Untamed Hearts Hunting Ground#l\r\n" : "") + ((cm.getMapId() == 680000400) ? "#L1#I have 7 keys. Bring me to smash boxes#l\r\n" : "") + "#L2#Please warp me out.#l#k");
else cm.sendSimple("Hello, do you want to go back now? Returning here again will cost you #rother 7 keys#k.\r\n#b#L2#Please warp me back to the training grounds.#l#k");
}
function action(mode, type, selection) {
@@ -36,17 +37,30 @@ function action(mode, type, selection) {
else
status--;
if (status == 1) {
if (selection < 1)
if (selection < 1) {
if(!cm.haveItem(4000313, 1)) {
cm.sendOk("It seems like you lost your #b#t4000313##k. I'm sorry, but I can't let you proceed to the hunting grounds without that.");
cm.dispose();
return;
}
cm.warp(680000400, 0);
else if (selection < 2) {
if (cm.haveItem(4031217,7))
} else if (selection < 2) {
if (cm.haveItem(4031217,7)) {
cm.gainItem(4031217, -7);
else
cm.sendOk("It seems like you don't have 7 Keys. Kill the cakes and candles in the Untamed Heart Hunting Ground to get keys. ");
cm.warp(680000401, 0);
} else {
cm.sendOk("It seems like you don't have 7 Keys. Kill the cakes and candles in the Untamed Heart Hunting Ground to get keys.");
}
} else if (selection > 1) {
cm.warp(680000500, 0);
cm.sendOk("Goodbye. I hope you enjoyed the wedding!");
if(cm.getMapId() != 680000401) {
cm.warp(680000500, 0);
cm.sendOk("Goodbye. I hope you enjoyed the wedding!");
} else {
cm.warp(680000400, 0);
}
}
cm.dispose();
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,47 +17,129 @@
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/>.
*/
/**
*9201023 - Nana(K)
*@author Jvlaple
/* Nana, the Love fairy
Amoria (680000000)
Engagement ring NPC.
*/
function start() {
cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
cm.dispose();
var status;
var state;
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
//
//function action(mode, type, selection) {
// if (mode == -1) {
// cm.dispose();
// } else {
// if (mode == 0 && status == 0) {
// cm.dispose();
// return;
// }
// if (mode == 1)
// status++;
// else
// status--;
// if (cm.getPlayer().getMarriageQuestLevel() == 1 || cm.getPlayer().getMarriageQuestLevel() == 52) {
// if (!cm.haveItem(4000083, 20)) {
// if (status == 0) {
// cm.sendNext("Hey, you look like you need proofs of love? I can get them for you.");
// } else if (status == 1) {
// cm.sendNext("All you have to do is bring me 20 #bJr. Sentinel Pieces.#k.");
// cm.dispose();
// }
// } else {
// if (status == 0) {
// cm.sendNext("Wow, you were quick! Heres the proof of love...");
// cm.gainItem(4000083, -20)
// cm.gainItem(4031369, 1);
// cm.dispose();
// }
// }
// } else {
// cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
// cm.dispose();
// }
// }
//}
function getNanaLocation(player) {
var mapid = player.getMap().getId();
for(var i = 0; i < mapids.length; i++) {
if(mapid == mapids[i]) {
return i;
}
}
return -1;
}
var nanaLoc;
var mapids = [100000000, 103000000, 102000000, 101000000, 200000000, 220000000];
var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128];
var questExp = [2000, 5000, 10000, 17000, 22000, 30000];
function processNanaQuest() {
if(cm.haveItem(questItems[nanaLoc], 50)) {
if(cm.canHold(4031367 + nanaLoc, 1)) {
cm.gainItem(questItems[nanaLoc], -50);
cm.gainItem(4031367 + nanaLoc, 1);
cm.sendOk("Kyaaaa~ Thank you a lot, here get the #b#t4031367##k.");
return true;
} else {
cm.sendOk("Please have a free ETC slot available to hold the token of love.");
}
} else {
cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k.");
}
return false;
}
function start() {
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.isQuestStarted(100400)) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
nanaLoc = getNanaLocation(cm.getPlayer());
if(nanaLoc == -1) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
if(!cm.haveItem(4031367 + nanaLoc, 1)) {
if(cm.isQuestCompleted(100401 + nanaLoc)) {
state = 1;
cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k");
} else if(cm.isQuestStarted(100401 + nanaLoc)) {
if(processNanaQuest()) {
cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate());
cm.completeQuest(100401 + nanaLoc);
}
cm.dispose();
} else {
state = 0;
cm.sendAcceptDecline("Are you searching for #k#t4031367#'s#k? I can share one with you, but you must do a favor for me, is that ok?");
}
} else {
cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?");
cm.dispose();
}
} else if(status == 1) {
if(state == 0) {
cm.startQuest(100401 + nanaLoc);
cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k.");
cm.dispose();
} else {
processNanaQuest();
cm.dispose();
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,47 +17,129 @@
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/>.
*/
/**
*9201024 - Nana(E)
*@author Jvlaple
/* Nana, the Love fairy
Amoria (680000000)
Engagement ring NPC.
*/
function start() {
cm.sendOk("Hi, I'm Nana the love fairy... How's it going?");
cm.dispose();
var status;
var state;
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
//
//function action(mode, type, selection) {
// if (mode == -1) {
// cm.dispose();
// } else {
// if (mode == 0 && status == 0) {
// cm.dispose();
// return;
// }
// if (mode == 1)
// status++;
// else
// status--;
// if (cm.getPlayer().getMarriageQuestLevel() == 1 || cm.getPlayer().getMarriageQuestLevel() == 52) {
// if (!cm.haveItem(4003005, 20)) {
// if (status == 0) {
// cm.sendNext("Hey, you look like you need proofs of love? I can get them for you.");
// } else if (status == 1) {
// cm.sendNext("All you have to do is bring me 20 #bSoft Feathers#k.");
// cm.dispose();
// }
// } else {
// if (status == 0) {
// cm.sendNext("Wow, you were quick! Heres the proof of love...");
// cm.gainItem(4003005, -20)
// cm.gainItem(4031368, 1);
// cm.dispose();
// }
// }
// } else {
// cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
// cm.dispose();
// }
// }
//}
function getNanaLocation(player) {
var mapid = player.getMap().getId();
for(var i = 0; i < mapids.length; i++) {
if(mapid == mapids[i]) {
return i;
}
}
return -1;
}
var nanaLoc;
var mapids = [100000000, 103000000, 102000000, 101000000, 200000000, 220000000];
var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128];
var questExp = [2000, 5000, 10000, 17000, 22000, 30000];
function processNanaQuest() {
if(cm.haveItem(questItems[nanaLoc], 50)) {
if(cm.canHold(4031367 + nanaLoc, 1)) {
cm.gainItem(questItems[nanaLoc], -50);
cm.gainItem(4031367 + nanaLoc, 1);
cm.sendOk("Kyaaaa~ Thank you a lot, here get the #b#t4031367##k.");
return true;
} else {
cm.sendOk("Please have a free ETC slot available to hold the token of love.");
}
} else {
cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k.");
}
return false;
}
function start() {
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.isQuestStarted(100400)) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
nanaLoc = getNanaLocation(cm.getPlayer());
if(nanaLoc == -1) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
if(!cm.haveItem(4031367 + nanaLoc, 1)) {
if(cm.isQuestCompleted(100401 + nanaLoc)) {
state = 1;
cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k");
} else if(cm.isQuestStarted(100401 + nanaLoc)) {
if(processNanaQuest()) {
cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate());
cm.completeQuest(100401 + nanaLoc);
}
cm.dispose();
} else {
state = 0;
cm.sendAcceptDecline("Are you searching for #k#t4031367#'s#k? I can share one with you, but you must do a favor for me, is that ok?");
}
} else {
cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?");
cm.dispose();
}
} else if(status == 1) {
if(state == 0) {
cm.startQuest(100401 + nanaLoc);
cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k.");
cm.dispose();
} else {
processNanaQuest();
cm.dispose();
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,47 +17,129 @@
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/>.
*/
/**
*9201025 - Nana(O)
*@author Jvlaple
/* Nana, the Love fairy
Amoria (680000000)
Engagement ring NPC.
*/
function start() {
cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
cm.dispose();
var status;
var state;
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
//
//function action(mode, type, selection) {
// if (mode == -1) {
// cm.dispose();
// } else {
// if (mode == 0 && status == 0) {
// cm.dispose();
// return;
// }
// if (mode == 1)
// status++;
// else
// status--;
// if (cm.getPlayer().getMarriageQuestLevel() == 1 || cm.getPlayer().getMarriageQuestLevel() == 52) {
// if (!cm.haveItem(4000083, 20)) {
// if (status == 0) {
// cm.sendNext("Hey, you look like you need proofs of love? I can get them for you.");
// } else if (status == 1) {
// cm.sendNext("All you have to do is bring me 20 #bJr. Sentinel Pieces.#k.");
// cm.dispose();
// }
// } else {
// if (status == 0) {
// cm.sendNext("Wow, you were quick! Heres the proof of love...");
// cm.gainItem(4000083, -20)
// cm.gainItem(4031369, 1);
// cm.dispose();
// }
// }
// } else {
// cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
// cm.dispose();
// }
// }
//}
function getNanaLocation(player) {
var mapid = player.getMap().getId();
for(var i = 0; i < mapids.length; i++) {
if(mapid == mapids[i]) {
return i;
}
}
return -1;
}
var nanaLoc;
var mapids = [100000000, 103000000, 102000000, 101000000, 200000000, 220000000];
var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128];
var questExp = [2000, 5000, 10000, 17000, 22000, 30000];
function processNanaQuest() {
if(cm.haveItem(questItems[nanaLoc], 50)) {
if(cm.canHold(4031367 + nanaLoc, 1)) {
cm.gainItem(questItems[nanaLoc], -50);
cm.gainItem(4031367 + nanaLoc, 1);
cm.sendOk("Kyaaaa~ Thank you a lot, here get the #b#t4031367##k.");
return true;
} else {
cm.sendOk("Please have a free ETC slot available to hold the token of love.");
}
} else {
cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k.");
}
return false;
}
function start() {
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.isQuestStarted(100400)) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
nanaLoc = getNanaLocation(cm.getPlayer());
if(nanaLoc == -1) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
if(!cm.haveItem(4031367 + nanaLoc, 1)) {
if(cm.isQuestCompleted(100401 + nanaLoc)) {
state = 1;
cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k");
} else if(cm.isQuestStarted(100401 + nanaLoc)) {
if(processNanaQuest()) {
cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate());
cm.completeQuest(100401 + nanaLoc);
}
cm.dispose();
} else {
state = 0;
cm.sendAcceptDecline("Are you searching for #k#t4031367#'s#k? I can share one with you, but you must do a favor for me, is that ok?");
}
} else {
cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?");
cm.dispose();
}
} else if(status == 1) {
if(state == 0) {
cm.startQuest(100401 + nanaLoc);
cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k.");
cm.dispose();
} else {
processNanaQuest();
cm.dispose();
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,47 +17,129 @@
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/>.
*/
/**
*9201026 - Nana(L)
*@author Jvlaple
/* Nana, the Love fairy
Amoria (680000000)
Engagement ring NPC.
*/
function start() {
cm.sendOk("Hi, I'm Nana the love fairy... How's it going?");
cm.dispose();
var status;
var state;
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
//
//function action(mode, type, selection) {
// if (mode == -1) {
// cm.dispose();
// } else {
// if (mode == 0 && status == 0) {
// cm.dispose();
// return;
// }
// if (mode == 1)
// status++;
// else
// status--;
// if (cm.getPlayer().getMarriageQuestLevel() == 1 || cm.getPlayer().getMarriageQuestLevel() == 52) {
// if (!cm.haveItem(4000106, 30)) {
// if (status == 0) {
// cm.sendNext("Hey, you look like you need proofs of love? I can get them for you.");
// } else if (status == 1) {
// cm.sendNext("All you have to do is bring me 30 #bTeddy Cotton#k.");
// cm.dispose();
// }
// } else {
// if (status == 0) {
// cm.sendNext("Wow, you were quick! Heres the proof of love...");
// cm.gainItem(4000106, -30)
// cm.gainItem(4031370, 1);
// cm.dispose();
// }
// }
// } else {
// cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
// cm.dispose();
// }
// }
//}
function getNanaLocation(player) {
var mapid = player.getMap().getId();
for(var i = 0; i < mapids.length; i++) {
if(mapid == mapids[i]) {
return i;
}
}
return -1;
}
var nanaLoc;
var mapids = [100000000, 103000000, 102000000, 101000000, 200000000, 220000000];
var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128];
var questExp = [2000, 5000, 10000, 17000, 22000, 30000];
function processNanaQuest() {
if(cm.haveItem(questItems[nanaLoc], 50)) {
if(cm.canHold(4031367 + nanaLoc, 1)) {
cm.gainItem(questItems[nanaLoc], -50);
cm.gainItem(4031367 + nanaLoc, 1);
cm.sendOk("Kyaaaa~ Thank you a lot, here get the #b#t4031367##k.");
return true;
} else {
cm.sendOk("Please have a free ETC slot available to hold the token of love.");
}
} else {
cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k.");
}
return false;
}
function start() {
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.isQuestStarted(100400)) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
nanaLoc = getNanaLocation(cm.getPlayer());
if(nanaLoc == -1) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
if(!cm.haveItem(4031367 + nanaLoc, 1)) {
if(cm.isQuestCompleted(100401 + nanaLoc)) {
state = 1;
cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k");
} else if(cm.isQuestStarted(100401 + nanaLoc)) {
if(processNanaQuest()) {
cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate());
cm.completeQuest(100401 + nanaLoc);
}
cm.dispose();
} else {
state = 0;
cm.sendAcceptDecline("Are you searching for #k#t4031367#'s#k? I can share one with you, but you must do a favor for me, is that ok?");
}
} else {
cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?");
cm.dispose();
}
} else if(status == 1) {
if(state == 0) {
cm.startQuest(100401 + nanaLoc);
cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k.");
cm.dispose();
} else {
processNanaQuest();
cm.dispose();
}
}
}
}

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,48 +17,129 @@
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/>.
*/
/**
*9201027 - Nana(P)
*@author Jvlaple
/* Nana, the Love fairy
Amoria (680000000)
Engagement ring NPC.
*/
function start() {
cm.sendOk("Hi, I'm Nana the love fairy... How's it going?");
cm.dispose();
var status;
var state;
var item;
var mats;
var matQty;
var cost;
var options;
function hasProofOfLoves(player) {
var count = 0;
for(var i = 4031367; i <= 4031372; i++) {
if(player.haveItem(i)) {
count++;
}
}
return count >= 4;
}
//function action(mode, type, selection) {
// if (mode == -1) {
// cm.dispose();
// } else {
// if (mode == 0 && status == 0) {
// cm.dispose();
// return;
// }
// if (mode == 1)
// status++;
// else
// status--;
// if (cm.getPlayer().getMarriageQuestLevel() == 1 || cm.getPlayer().getMarriageQuestLevel() == 52) {
// if (!cm.haveItem(4000018, 40)) {
// if (status == 0) {
// cm.sendNext("Hey, you look like you need proofs of love? I can get them for you.");
// } else if (status == 1) {
// cm.sendOk("All you have to do is bring me 40 #bFirewood#k.");
// cm.dispose();
// }
// } else {
// if (status == 0) {
// cm.sendNext("Wow, you were quick! Heres the proof of love...");
// cm.gainItem(4000018, -40)
// cm.gainItem(4031371, 1);
// cm.dispose();
// }
// }
// }
// else {
// cm.sendOk("Hi, I'm Nana the love fairy... Hows it going?");
// cm.dispose();
// }
// }
//}
function getNanaLocation(player) {
var mapid = player.getMap().getId();
for(var i = 0; i < mapids.length; i++) {
if(mapid == mapids[i]) {
return i;
}
}
return -1;
}
var nanaLoc;
var mapids = [100000000, 103000000, 102000000, 101000000, 200000000, 220000000];
var questItems = [4000001, 4000037, 4000215, 4000026, 4000070, 4000128];
var questExp = [2000, 5000, 10000, 17000, 22000, 30000];
function processNanaQuest() {
if(cm.haveItem(questItems[nanaLoc], 50)) {
if(cm.canHold(4031367 + nanaLoc, 1)) {
cm.gainItem(questItems[nanaLoc], -50);
cm.gainItem(4031367 + nanaLoc, 1);
cm.sendOk("Kyaaaa~ Thank you a lot, here get the #b#t4031367##k.");
return true;
} else {
cm.sendOk("Please have a free ETC slot available to hold the token of love.");
}
} else {
cm.sendOk("Please gather to me #b50 #t" + questItems[nanaLoc] + "##k.");
}
return false;
}
function start() {
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.isQuestStarted(100400)) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
nanaLoc = getNanaLocation(cm.getPlayer());
if(nanaLoc == -1) {
cm.sendOk("Hello #b#h0##k, I'm #p9201001# the fairy of Love.");
cm.dispose();
return;
}
if(!cm.haveItem(4031367 + nanaLoc, 1)) {
if(cm.isQuestCompleted(100401 + nanaLoc)) {
state = 1;
cm.sendAcceptDecline("Did you lost the #k#t4031367##k I gave to you? Well, I can share another one with you, but you will need to redo the favor I asked last time, is that ok? I need you to bring me #r50 #t" + questItems[nanaLoc] + "#'s.#k");
} else if(cm.isQuestStarted(100401 + nanaLoc)) {
if(processNanaQuest()) {
cm.gainExp(questExp[nanaLoc] * cm.getPlayer().getExpRate());
cm.completeQuest(100401 + nanaLoc);
}
cm.dispose();
} else {
state = 0;
cm.sendAcceptDecline("Are you searching for #k#t4031367#'s#k? I can share one with you, but you must do a favor for me, is that ok?");
}
} else {
cm.sendOk("Hey there. Did you get the #t4031367# from the other Nana's already?");
cm.dispose();
}
} else if(status == 1) {
if(state == 0) {
cm.startQuest(100401 + nanaLoc);
cm.sendOk("I need you to collect #r50 #t" + questItems[nanaLoc] + "##k.");
cm.dispose();
} else {
processNanaQuest();
cm.dispose();
}
}
}
}

View File

@@ -52,6 +52,9 @@ function action(mode, type, selection) {
cm.sendOk("The Amoria PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
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.");

View File

@@ -1,8 +1,6 @@
/*
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 file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
@@ -19,54 +17,52 @@
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/>.
*/
/**
Ames the Wise
-- By ---------------------------------------------------------------------------------------------
Xelkin
-- Edited by --------------------------------------------------------------------------------------
Angel (get31720 ragezone
-- Extra Info -------------------------------------------------------------------------------------
Fixed by [happydud3 (BENG)] & [XotiCraze]
-- Fixed Dispose ----------------------------------------------------------------------------------
Fixed by Moogra
---------------------------------------------------------------------------------------------------
**/
var status = -1;
/* Ames the Wise
Wedding exit map
Gives Onyx Chest to anyone completing the wedding event.
*/
var status;
function start() {
var rings = new Array(1112806, 1112803, 1112807, 1112809);
var hasRing = false;
for (var x = 0; x < rings.length && !hasRing; x++)
if (cm.haveItem(rings[x])) {
hasRing = true;
break;
}
if (hasRing)
cm.sendNext("You've reached the end of the wedding. You will receive an Onyx Chest for Bride and Groom and an Onyx Chest. Exchange them at Pila, she is at the top of Amoria.");
else if (cm.haveItem(4000313)) {
cm.sendNext("Wow the end of the wedding already ? Good bye then.!");
status = 20;
} else {
cm.sendNext("You do not have the Gold Maple Leaf and you do not have a wedding ring so I will take you to Amoria.");
status = 21;
}
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode < 1) {
cm.sendOk("Goodbye then.");
cm.dispose();
} else {
status++;
if (status == 1) {
cm.gainItem(4031424,1);
cm.gainItem(4031423,1);
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.sendOk("Hey there, did you enjoy the wedding? I will head you back to #bAmoria#k now.");
} else if(status == 1) {
var eim = cm.getEventInstance();
if(eim != null) {
var boxId = (cm.getPlayer().getId() == eim.getIntProperty("groomId") || cm.getPlayer().getId() == eim.getIntProperty("brideId")) ? 4031424 : 4031423;
if(cm.canHold(boxId, 1)) {
cm.gainItem(boxId, 1);
cm.warp(680000000);
cm.sendOk("You just received an Onyx Chest. Search for #b#p9201014##k, she is at the top of Amoria, she knows how to open these.");
} else {
cm.sendOk("Please make room on your ETC inventory to receive the Onyx Chest.");
cm.dispose();
return;
}
} else {
cm.warp(680000000);
}
cm.dispose();
} else if (status == 21) {
cm.gainItem(4000313,-1);
cm.gainItem(4031423,1);
}
cm.warp(680000000);
cm.dispose();
}
}
}

View File

@@ -35,6 +35,11 @@ function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else

View File

@@ -24,6 +24,10 @@ status = -1;
var sel, sel2;
function start() {
cm.sendOk("Hello, the Maple 7th Day Market is currently unavailable.");
cm.dispose();
return;
cm.sendSimple("Hello, the Maple 7th Day Market opens today.#b\r\n#L0#Move to Maple 7th Day Market map\r\n#L1#Listen for an explanation about the Maple 7th Day Market");
}

View File

@@ -51,8 +51,11 @@ function action(mode, type, selection) {
cm.sendOk("The Treasure PQ has encountered an error.");
cm.dispose();
return;
} else if(cm.isUsingOldPqNpcStyle()) {
action(1, 0, 0);
return;
}
cm.sendSimple("#e#b<Party Quest: MV's Lair>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any further because of the extremely dangerous creatures lying ahead. Would you like to collaborate with party members to complete the quest? If so, 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) {

View File

@@ -32,15 +32,15 @@ var ambientSong = "Bgm04/Shinin'Harbor";
var feature_tree = [];
var feature_cursor;
var tabs = ["PQs", "Skills", "Quests", "Player Social Network", "Cash & Items", "Monsters, Maps & Reactors", "PQ potentials", "Player potentials", "Server potentials", "Admin/GM commands", "Project"];
var tabs = ["PQs", "Skills", "Quests", "Player Social Network", "Cash & Items", "Monsters, Maps & Reactors", "PQ potentials", "Player potentials", "Server potentials", "Admin/GM commands", "Localhost edits", "Project"];
function addFeature(feature) {
feature_cursor.push(feature);
}
function writeFeatureTab_PQs() {
addFeature("HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ.");
addFeature("MagatiaPQ/HorntailPQ/AmoriaPQ/TreasurePQ.");
addFeature("HPQ/KPQ/LPQ/LMPQ/OPQ/EllinPQ/PiratePQ/AmoriaPQ.");
addFeature("MagatiaPQ/HorntailPQ/TreasurePQ/ElnathPQ.");
addFeature("CWKPQ as Expedition-based event.");
addFeature("Scarga/Horntail/Showa/Balrog/Zakum/Pinkbean.");
addFeature("GuildPQ & queue with multi-lobby systems available.");
@@ -50,7 +50,7 @@ function writeFeatureTab_PQs() {
}
function writeFeatureTab_Skills() {
addFeature("Reviewed many skills, such as V. Star and M. Door.");
addFeature("Reviewed many skills, such as Steal and M. Door.");
addFeature("Maker skill features properly developed.");
addFeature("Chair Mastery - map chair boosts HP/MP rec.");
}
@@ -60,14 +60,15 @@ function writeFeatureTab_Quests() {
addFeature("Quests are now rewarding items properly.");
addFeature("Selection of rewards works properly.");
addFeature("Loads of quests have been patched.");
addFeature("Lots of job questlines have been reviewed.");
addFeature("Aran questline has been reviewed.");
addFeature("Reviewed several 4th job skill questlines.");
addFeature("Rewarding system now looks up for item stacking.");
addFeature("3rd job quiz with all 40-question pool available.");
}
function writeFeatureTab_PlayerSocialNetwork() {
addFeature("Guild and Alliance system fully functional.");
addFeature("Party for novices-only (may still be disabled locally).");
addFeature("Party for novices-only.");
addFeature("Thoroughly reviewed P. Shops and H. Merchants.");
addFeature("Transactions on Merchs instantly announced to owner.");
addFeature("Game minirooms with semi-functional pw system.");
@@ -83,12 +84,16 @@ function writeFeatureTab_CashItems() {
addFeature("New town scroll: antibanish. Counters boss banishes.");
addFeature("Inventory system checks for free slot & stack space.");
addFeature("Storage with 'Arrange Items' feature functional.");
addFeature("Further improved Karma scissors.");
addFeature("Scroll for Spikes on Shoes.");
addFeature("Scroll for Cold Protection.");
addFeature("Vega's spell.");
addFeature("Owl of Minerva.");
addFeature("Pet item ignore.");
addFeature("New Year's card.");
addFeature("Kite.");
addFeature("Cash Shop surprise.");
addFeature("Maple Life.");
}
function writeFeatureTab_MonstersMapsReactors() {
@@ -97,12 +102,15 @@ function writeFeatureTab_MonstersMapsReactors() {
addFeature("Monsterbook displays updated drop data info.");
addFeature("Every skill/mastery book is now obtainable.");
addFeature("Mobs now can drop more than one of the same equip.");
addFeature("Implemented Zombify disease status.");
addFeature("Added Boss HP Bar for dozens of bosses.");
addFeature("Game will favor showing the targeted boss HPbar.");
addFeature("Dmg overtime on maps and neutralizers functional.");
addFeature("Boats, elevator and other travel mechanics functional.");
addFeature("C. Balrog's boat approaching visual effect functional.");
addFeature("PQs, Taxis and events warps players to random SPs.");
addFeature("PQ boxes sprays items when opened, GMS-like.");
addFeature("Reactors pick items up smartly from the field.");
addFeature("Reviewed Masteria, W. Tour, N. Desert and Neo City.");
addFeature("Giant Cake boss drops s. bags and Maple items.");
}
@@ -127,16 +135,20 @@ function writeFeatureTab_Serverpotentials() {
addFeature("Enhanced auto-pot system: smart pet potion handle.");
addFeature("Enhanced buff system: best buffs effects takes place.");
addFeature("Enhanced AP auto-assigner: focus on eqp demands.");
addFeature("NPC crafters won't take items freely anymore.");
addFeature("Duey: pkg rcvd popup and many delivery mechanics.");
addFeature("Pet pickup gives preference to player attacks.");
addFeature("Channel capacity bar and worlds with capacity check.");
addFeature("Diseases visible for others, even after changing maps.");
addFeature("Poison damage value visible for other players.");
addFeature("M. book announcer displays info based on demand.");
addFeature("Custom jail system.");
addFeature("Custom buyback system, uses mesos / NX, via MTS.");
addFeature("Delete Character.");
addFeature("Autosaver (periodically saves player's data on DB).");
addFeature("Fixed and randomized HP/MP growth rate available.");
addFeature("Prevented 'NPC gone after some uptime' issue.");
addFeature("AP assigning available for novices level 10 or below.");
addFeature("Automatic account registration - thanks shavit!");
}
@@ -146,6 +158,19 @@ function writeFeatureTab_AdminGMcommands() {
addFeature("Several new commands.");
}
function writeFeatureTab_Localhostedits() {
addFeature("Removed the 'n' NPC dialog issue.");
addFeature("Removed caps for MATK, WMDEF, ACC and AVOID.");
addFeature("Removed MTS block, buyback available anywhere.");
addFeature("Removed party blocks for novices under level 10.");
addFeature("Set a much more higher cap for SPEED.");
addFeature("Removed AP usage block for novices.");
addFeature("Removed attack gem block on defensiver gear w/ Maker.");
addFeature("Removed AP excess popup - thanks kevintjuh93!");
addFeature("Removed 'GMs can't attack' - thanks kevintjuh93!");
addFeature("Removed 'Gained a level!' - thanks PrinceReborn!");
}
function writeFeatureTab_Project() {
addFeature("Organized project code.");
addFeature("Highly updated drop data.");

View File

@@ -55,6 +55,8 @@ function writeHeavenMSCommandsLv6() { //Admin
addCommand("shutdownnow", "");
addCommand("clearquestcache", "");
addCommand("clearquest", "");
addCommand("spawnallpnpcs", "");
addCommand("eraseallpnpcs", "");
}
function writeHeavenMSCommandsLv5() { //Developer
@@ -74,6 +76,7 @@ function writeHeavenMSCommandsLv5() { //Developer
addCommand("debugcoupons", "");
addCommand("debugplayercoupons", "");
addCommand("debugtimer", "");
addCommand("debugmarriage", "");
addCommand("set", "");
}
@@ -96,7 +99,8 @@ function writeHeavenMSCommandsLv4() { //SuperGM
addCommand("pap", "");
addCommand("pianus", "");
addCommand("cake", "");
//addCommand("playernpc", "");
addCommand("pnpcremove", "");
addCommand("playernpc", "");
}
function writeHeavenMSCommandsLv3() { //GM

View File

@@ -20,6 +20,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
pi.playPortalSound(); pi.warp(pi.getPlayer().getSavedLocation("EVENT"));
pi.playPortalSound(); pi.warp(pi.getPlayer().getSavedLocation("EVENT"));
return true;
}

View File

@@ -25,10 +25,10 @@ Author: kevintjuh93
function enter(pi) {
var mapId = pi.getPlayer().getSavedLocation("MIRROR");
pi.playPortalSound();
if(mapId == -1) pi.warp(102040000, 12);
else pi.warp(mapId);
//pi.playPortalSound(); pi.warp(102040000, 12);
//pi.warp(102040000, 12);
return true;
}

View File

@@ -1,6 +1,6 @@
function enter(pi) {
if (pi.getPlayer().getMapId() != 777777777) {
if(!Packages.constants.GameConstants.canEnterDeveloperRoom()) {
if(!Packages.net.server.Server.getInstance().canEnterDeveloperRoom()) {
pi.message("The next room is currently unavailable.");
return false;
}

View File

@@ -18,7 +18,7 @@ function enter(pi) {
pi.warp(103000008, 1); //or 103000009
break;
case 100000201:
pi.warp(100000204, 1); //or 100000205
pi.warp(100000204, 2); //or 100000205
break;
default:
pi.warp(pi.getMapId() + 1, 1); //or + 2

View File

@@ -24,10 +24,12 @@
* @purpose Warps to the Junior Balrog map for the Rush Skill.
*/
function enter(pi) {
if(pi.isQuestStarted(6153)) {
if(pi.getWarpMap(910500200).countPlayers() == 0) {
if(pi.isQuestStarted(6153) && pi.haveItem(4031475)) {
var mapobj = pi.getWarpMap(910500200);
if(mapobj.countPlayers() == 0) {
pi.resetMapObjects(910500200);
pi.playPortalSound(); pi.warp(910500200, 0);
mapobj.shuffleReactors();
pi.playPortalSound(); pi.warp(910500200, "out01");
return true;
} else {

View File

@@ -21,7 +21,7 @@
*/
function enter(pi) {
if (pi.getPlayer().getMap().countMonsters() == 0) {
pi.playPortalSound(); pi.warp(910500200, "out01");
pi.playPortalSound(); pi.warp(910500200, "out00");
return true;
}
pi.getPlayer().dropMessage(5, "You must defeat all the monsters first.");

View File

@@ -1,9 +1,11 @@
//Author: Ronan
function enter(pi) {
if(pi.hasItem(4031495)) pi.warp(921100301);
else pi.playPortalSound(); pi.warp(211040100);
if(pi.hasItem(4031495)) {
pi.playPortalSound(); pi.warp(921100301);
} else {
pi.playPortalSound(); pi.warp(211040100);
}
pi.getWarpMap(921100300).clearMapObjects();
return true;
}

View File

@@ -24,7 +24,7 @@
* @purpose Warps to the Junior Balrog map for the Rush Skill.
*/
function enter(pi) {
if(pi.isQuestStarted(6230) || pi.haveItem(4001110)) {
if(pi.isQuestStarted(6230) || pi.isQuestStarted(6231) || pi.haveItem(4001110)) {
if(pi.getWarpMap(922020200).countPlayers() == 0) {
pi.resetMapObjects(922020200);
pi.playPortalSound(); pi.warp(922020200, 0);
@@ -36,6 +36,5 @@ function enter(pi) {
}
}
pi.getPlayer().message("A mysterious force won't let you in.");
return false;
}

View File

@@ -5,6 +5,7 @@
importPackage(Packages.client);
var status = -1;
var jobType = 1;
function end(mode, type, selection) {
if (mode == 0) {
@@ -20,6 +21,12 @@ function end(mode, type, selection) {
if (status == 0) {
qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Dawn Warrior?");
} else if (status == 1) {
if(!qm.canGetFirstJob(jobType)) {
cm.sendOk("Train a bit more and I can show you the way of the #rDawn Warrior#k.");
cm.dispose();
return;
}
qm.sendNext("I have just molded your body to make it perfect for a Dawn Warrior. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k.");
if (qm.getPlayer().getJob().getId() != 1100) {
qm.gainItem(1302077, 1);

View File

@@ -5,6 +5,7 @@
importPackage(Packages.client);
var status = -1;
var jobType = 2;
function end(mode, type, selection) {
if (mode == 0) {
@@ -20,6 +21,12 @@ function end(mode, type, selection) {
if (status == 0) {
qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Blaze Wizard?");
} else if (status == 1) {
if(!qm.canGetFirstJob(jobType)) {
cm.sendOk("Train a bit more and I can show you the way of the #rBlaze Wizard#k.");
cm.dispose();
return;
}
qm.sendNext("I have just molded your body to make it perfect for a Blaze Wizard. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k.");
if (qm.getPlayer().getJob().getId() != 1200) {
qm.gainItem(1372043, 1);

View File

@@ -1,9 +1,11 @@
/*
* Cygnus 1st Job advancement - Wind Archer
*/
importPackage(Packages.client);
var status = -1;
var jobType = 3;
function end(mode, type, selection) {
if (mode == 0) {
@@ -19,6 +21,12 @@ function end(mode, type, selection) {
if (status == 0) {
qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Wind Archer?");
} else if (status == 1) {
if(!qm.canGetFirstJob(jobType)) {
cm.sendOk("Train a bit more and I can show you the way of the #rWind Archer#k.");
cm.dispose();
return;
}
qm.sendNext("I have just molded your body to make it perfect for a Wind Archer. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k.");
if (qm.getPlayer().getJob().getId() != 1300) {
qm.gainItem(2060000, 2000);

View File

@@ -1,9 +1,11 @@
/*
* Cygnus 1st Job advancement - Night Walker
*/
importPackage(Packages.client);
var status = -1;
var jobType = 4;
function end(mode, type, selection) {
if (mode == 0) {
@@ -19,6 +21,12 @@ function end(mode, type, selection) {
if (status == 0) {
qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Night Walker?");
} else if (status == 1) {
if(!qm.canGetFirstJob(jobType)) {
cm.sendOk("Train a bit more and I can show you the way of the #rNight Walker#k.");
cm.dispose();
return;
}
qm.sendNext("I have just molded your body to make it perfect for a Night Walker. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k.");
if (qm.getPlayer().getJob().getId() != 1400) {
qm.gainItem(1472061, 1);

View File

@@ -1,10 +1,11 @@
/*
* Cygnus 1st Job advancement - Thunder Breaker
*/
importPackage(Packages.client);
var status = -1;
var jobType = 5;
function end(mode, type, selection) {
if (mode == 0) {
@@ -20,6 +21,12 @@ function end(mode, type, selection) {
if (status == 0) {
qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Thunder Breaker?");
} else if (status == 1) {
if(!qm.canGetFirstJob(jobType)) {
cm.sendOk("Train a bit more and I can show you the way of the #rThunder Breaker#k.");
cm.dispose();
return;
}
qm.sendNext("I have just molded your body to make it perfect for a Thunder Breaker. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k.");
if (qm.getPlayer().getJob().getId() != 1500) {
qm.gainItem(1482014, 1);

View File

@@ -1,49 +0,0 @@
/*
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 : Generic (http://cronusemu.net)
NPC Name: Dalair
Map(s): Every town
Description: Quest - Title Challenge - Celebrity!
Quest ID : 29002
*/
var status = -1;
function start(mode, type, selection) {
if (mode == -1) {
qm.sendNext("Come back when you're ready.");
qm.dispose();
} else {
if (mode > 0)
status++;
else
status--;
if (status == 0) {// Picture of Celebrity Medal(+blue text "Celebrity Medal"
qm.sendAcceptDecline("#v1142003# #e#b#t1142003##k \r\n- Time Limit 30 Days \r\n- Popularity 1000Increase \r\n#nDo you want to test your skills to see if you're worthy of this title?");
} else if (status == 1) {
qm.sendNext("I'll give you 30 days to reach your goal. Once you're finished, come back and see me. Remember that you have to come back and see me within the time limit in order for it to be approved. Also, unless you complete this challenge or quit first, you can't try out for another title.");
qm.forceStartQuest();
}
}
}

View File

@@ -1,64 +0,0 @@
/*
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 : kevintjuh93
Description: Quest - Veteran Hunter
Quest ID : 29400
*/
var status = -1;
function start(mode, type, selection) {
status++;
if (mode != 1) {
qm.sendNext("Come back when you're ready.");
qm.dispose();
return;
}
if (status == 0)
qm.sendAcceptDecline("#v1142004# #e#b#t1142004##k\r\n\r - Time Limit 30 Days\r - Hunt 100,000 Monsters\r #n *Only monsters that are at your level or higher are approved.\r\nDo you want to test your skills to see if you're worthy of this title?");
else if (status == 1) {
qm.sendNext("Current Ranking \r\n1. #bMoople#k : #r538,673#k monsters\r\n2. #bZeroQuanta#k : #r111,421#k monsters\r\nDon't forget that the record resets at the beginning of each month.");//TODO
} else if (status == 2) {
qm.sendNextPrev("I'll give you 30 days to reach your hunting goal. Once you are finished, come back and see me. Remember, you have to come back and see me within the time limit in order to be approved. Also, you are prohibited from trying out for another title unless you first complete or forfeit this challenge.");
} else if (status == 3) {
qm.forceStartQuest();
qm.dispose();
}
}
function end(mode, type, selection) {
status++;
if (mode != 1) {
if(type == 1 && mode == 0) return;
else{
qm.dispose();
return;
}
if (status == 0) {
qm.sendOk("Not coded yet.");
qm.dispose();
}
}
}

20
scripts/quest/29927.js Normal file
View File

@@ -0,0 +1,20 @@
var status = -1;
function start(mode, type, selection) {
if (qm.canHold(1142132) && !qm.haveItem(1142132,1) && qm.getPlayer().getLevel() >= 120 && ((qm.getPlayer().getJob() / 100) | 0) == 21) {
qm.gainItem(1142132,1);
qm.forceStartQuest();
qm.forceCompleteQuest();
}
qm.dispose();
}
function end(mode, type, selection) {
if (qm.canHold(1142132) && !qm.haveItem(1142132,1) && qm.getPlayer().getLevel() >= 120 && ((qm.getPlayer().getJob() / 100) | 0) == 21) {
qm.gainItem(1142132,1);
qm.forceStartQuest();
qm.forceCompleteQuest();
}
qm.dispose();
}

View File

@@ -24,7 +24,7 @@
Map(s): New Leaf City
Description: Quest - Pet Evolution
*/
importPackage(Packages.client);
importPackage(Packages.client.inventory.manipulator);
importPackage(Packages.server);
var status = -1;

View File

@@ -43,18 +43,17 @@ function end(mode, type, selection) {
} else if (status == 1) {
if(qm.getQuestProgress(6033) == 1 && qm.haveItem(4260003, 1)) {
qm.sendNext("You indeed have crafted a fine piece of Monster Crystal, I see. You passed! Now, I shall teach you the next steps of the Maker skill. Keep the monster crystal with you as well, it's your work.");
var skillid = Math.floor(qm.getPlayer().getJob().getId() / 1000) * 10000000 + 1007;
qm.teachSkill(skillid, 2, 3, -1);
qm.gainExp(230000 * qm.getPlayer().getExpRate());
qm.forceCompleteQuest();
} else {
qm.sendNext("Hey, what's wrong? I did tell you to make a monster crystal to pass my test, didn't I? Buying one or crafting before the start of the test is NOT part of the deal. Go craft me an #b#t4260003##k.");
qm.dispose();
return;
}
} else {
var skillid = Math.floor(qm.getPlayer().getJob().getId() / 1000) * 10000000 + 1007;
qm.teachSkill(skillid, 2, 3, -1);
qm.gainExp(230000 * qm.getPlayer().getExpRate());
qm.forceCompleteQuest();
qm.dispose();
}
}

View File

@@ -43,16 +43,19 @@ function end(mode, type, selection) {
} else if (status == 1) {
if(qm.haveItem(4031980, 1)) {
qm.sendNext("You crafted a #b#t4031980##k?! How comes, how did you do it?? ... Well, that can't be helped, I guess. The student surpassed the teacher! Youth sure do wonders to one's perception capabilities.\r\n\r\nYou are now ready to take the last step on mastering the Maker skill, contemplate it at it's finest form!");
qm.gainItem(4031980, -1);
var skillid = Math.floor(qm.getPlayer().getJob().getId() / 1000) * 10000000 + 1007;
qm.teachSkill(skillid, 3, 3, -1);
qm.gainExp(300000 * qm.getPlayer().getExpRate());
qm.forceCompleteQuest();
} else {
qm.sendNext("... Please step aside, I can't finish this work if I'm being distracted at every moment.");
qm.dispose();
return;
}
} else {
qm.gainItem(4031980, -1);
var skillid = Math.floor(qm.getPlayer().getJob().getId() / 1000) * 10000000 + 1007;
qm.teachSkill(skillid, 3, 3, -1);
qm.gainExp(300000 * qm.getPlayer().getExpRate());
qm.forceCompleteQuest();
qm.dispose();
}

View File

@@ -8,16 +8,16 @@ function start(mode, type, selection) {
qm.forceCompleteQuest();
var medalname = qm.getMedalName();
qm.message("<" + medalname + "> has been awarded.");
qm.message("<" + medalname + "> is not coded.");
qm.earnTitle("<" + medalname + "> has been awarded.");
qm.dispose();
}
function complete(mode, type, selection) {
function end(mode, type, selection) {
qm.forceCompleteQuest();
var medalname = qm.getMedalName();
qm.message("<" + medalname + "> has been awarded.");
qm.message("<" + medalname + "> is not coded.");
qm.earnTitle("<" + medalname + "> has been awarded.");
qm.dispose();
}

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