Overall wedding implementation

Implementation of the wedding feature.
This commit is contained in:
ronancpl
2018-04-10 21:50:29 -03:00
parent 6da5edd837
commit ede8ad8551
59 changed files with 5281 additions and 1246 deletions

View File

@@ -135,8 +135,19 @@ function setup(level, lobbyid) {
return eim;
}
function isTeamAllCouple(eim) { // all players married each other, not implemented
return false;
function isTeamAllCouple(eim) {
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

@@ -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() {
}

View File

@@ -0,0 +1,252 @@
/**
* @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 = 20; // 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.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, now the couple is preparing to make it official. Tighten your seatbelts!");
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,252 @@
/**
* @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 = 20; // 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.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, now the couple is preparing to make it official. Tighten your seatbelts!");
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

@@ -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,369 @@
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.tools.packets);
importPackage(Packages.net.server.channel.handlers);
var status;
function start() {
status = -1;
action(1, 0, 0);
var state;
var eim;
var weddingEventName = "WeddingCathedral";
var cathedralWedding = true;
var weddingIndoors;
var weddingBlessingExp = 30000;
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 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", cserv.getOngoingWeddingType(cathedralWedding) ? 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 stay awhile.");
cm.dispose();
} else {
cm.sendOk("Congratulations on your wedding! Our ceremony is now 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);
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:
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);
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 ou 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,257 @@
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";
}
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;
default:
if (cm.haveItem(weddingGuestTicket)) {
var cserv = cm.getClient().getChannelServer();
wid = cserv.getOngoingWedding(cathedralWedding);
if(wid > 0) {
if(cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) {
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("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();
}
}
} 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,256 @@
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";
}
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;
default:
if (cm.haveItem(weddingGuestTicket)) {
var cserv = cm.getClient().getChannelServer();
wid = cserv.getOngoingWedding(cathedralWedding);
if(wid > 0) {
if(cserv.isOngoingWeddingGuest(cathedralWedding, cm.getPlayer().getId())) {
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("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();
}
}
} 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,37 @@
**/
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();
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
var eim = cm.getEventInstance();
if(eim == null) {
cm.warp(680000000,0);
cm.dispose();
return;
}
cm.sendYesNo("Are you sure you want to #rquit this wedding#k and return to #bAmoria#k? You will be #rskipping the bonus stages#k if you accept to quit.");
} else if(status == 1) {
cm.warp(680000000,0);
cm.dispose();
}
}
}

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

@@ -0,0 +1,265 @@
/*
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.tools.packets);
importPackage(Packages.net.server.channel.handlers);
var status;
var state;
var eim;
var weddingEventName = "WeddingChapel";
var cathedralWedding = false;
var weddingIndoors;
var weddingBlessingExp = 30000;
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 live 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);
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:
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);
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,166 @@
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 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", cserv.getOngoingWeddingType(cathedralWedding) ? 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

@@ -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

@@ -71,6 +71,7 @@ function writeSolaxiaCommandsLv5() { //Developer
addCommand("debugcoupons", "");
addCommand("debugplayercoupons", "");
addCommand("debugtimer", "");
addCommand("debugmarriage", "");
}
function writeSolaxiaCommandsLv4() { //SuperGM

View File

@@ -20,9 +20,5 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function act(){
for (var i = 0; i < 3; i++) {
rm.spawnMonster(9400506);
rm.spawnMonster(9400507);
}
rm.spawnMonster(9400507);
rm.sprayItems(true, 1, 100, 400, 15);
}

View File

@@ -20,8 +20,5 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function act(){
for (var i = 0; i < 5; i++)
rm.spawnMonster(9400506);
for (var j = 0; j < 7; j++)
rm.spawnMonster(9400507);
rm.sprayItems(true, 1, 100, 400, 15);
}