Horntail PQ & Exped + Equip levelup fix

Added Horntail PQ and boss fight. Fixed short integer overflow of
equipment stats on client messing up player stats.
This commit is contained in:
ronancpl
2017-07-20 12:02:59 -03:00
parent 8fab2a6e3e
commit c09bc02c85
137 changed files with 1154 additions and 583 deletions

View File

@@ -0,0 +1,57 @@
/*
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/>.
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Snack Bar Spawner
-- Edited by --------------------------------------------------------------------------------------
Ronan (based on xQuasar's King Clang spawner)
**/
function init() {
scheduleNew();
}
function scheduleNew() {
setupTask = em.schedule("start", 0); //spawns upon server start. Each 3 hours an server event checks if boss exists, if not spawns it instantly.
}
function cancelSchedule() {
if (setupTask != null)
setupTask.cancel(true);
}
function start() {
var snackBarMap = em.getChannelServer().getMapFactory().getMap(105090310);
var snackBar = Packages.server.life.MapleLifeFactory.getMonster(8220008);
if(snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var setPos = [[-626, -604], [735, -600]];
var rndPos = setPos[Math.floor(Math.random() * setPos.length)];
snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Packages.java.awt.Point(rndPos[0], rndPos[1]));
snackBarMap.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -1,155 +1,209 @@
/*
* This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
/**
* @author: Ronan
* @event: Horntail Battle
*/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
importPackage(Packages.server.life);
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
var isPq = true;
var minPlayers = 1, maxPlayers = 30;
var minLevel = 100, maxLevel = 255;
var entryMap = 240060000;
var exitMap = 240050600;
var recruitMap = 240050400;
var clearMap = 240050600;
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var minMapId = 240060000;
var maxMapId = 240060200;
/*
* @Author SharpAceX(Alan)
* Horntail fight
*/
var eventTime = 15; // 15 minutes
importPackage(Packages.server.expeditions);
var lobbyRange = [0, 0];
var exitMap;
var minPlayers = 1;
var fightTime = 60;
var trial1; //Cave of Life - The Cave of Trial I
var trial2; // Cave of Life - The Cave of Trial II
var fightMap; // Cave of Life - Horntail's Cave
var exitMap;
function init() {
em.setProperty("shuffleReactors","false");
trial1 = em.getChannelServer().getMapFactory().getMap(240060000); //Cave of Life - The Cave of Trial I
trial2 = em.getChannelServer().getMapFactory().getMap(240060100); // Cave of Life - The Cave of Trial II
fightMap = em.getChannelServer().getMapFactory().getMap(240060200); // Cave of Life - Horntail's Cave
exitMap = em.getChannelServer().getMapFactory().getMap(211042300);
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
}
function setEventRequirements() {
var reqStr = "";
reqStr += "\r\n Number of players: ";
if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers;
else reqStr += minPlayers;
reqStr += "\r\n Level range: ";
if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel;
else reqStr += minLevel;
reqStr += "\r\n Time limit: ";
reqStr += eventTime + " minutes";
em.setProperty("party", reqStr);
}
function setEventExclusives(eim) {
var itemSet = [];
eim.setExclusiveItems(itemSet);
}
function setup() {
var eim = em.newInstance("HorntailFight_" + em.getProperty("channel"));
var timer = 1000 * 60 * fightTime;
em.schedule("timeOut", eim, timer);
eim.startEventTimer(timer);
return eim;
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages, mesoStages;
evLevel = 1; //Rewards at clear PQ
itemSet = [];
itemQty = [];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = []; //bonus exp given on CLEAR stage signal
eim.setEventClearStageExp(expStages);
mesoStages = []; //bonus meso given on CLEAR stage signal
eim.setEventClearStageMeso(mesoStages);
}
function afterSetup(eim) {}
function playerEntry(eim,player) {
var map = eim.getMapInstance(trial1.getId());
player.changeMap(map,map.getPortal(0));
if (exitMap == null)
debug(eim,"The exit map was not properly linked.");
function setup(channel) {
var eim = em.newInstance("Scarga" + channel);
eim.setProperty("canJoin", 1);
eim.setProperty("defeatedBoss", 0);
eim.setProperty("defeatedHead", 0);
var level = 1;
eim.getInstanceMap(240060000).resetPQ(level);
eim.getInstanceMap(240060100).resetPQ(level);
eim.getInstanceMap(240060200).resetPQ(level);
var map, mob;
map = eim.getInstanceMap(240060000);
mob = MapleLifeFactory.getMonster(8810000);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(960, 120));
map = eim.getInstanceMap(240060100);
mob = MapleLifeFactory.getMonster(8810001);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(-420, 120));
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function playerRevive(eim,player) {
player.setHp(500);
player.setStance(0);
eim.unregisterPlayer(player);
player.changeMap(exitMap, exitMap.getPortal(0));
var party = eim.getPlayers();
if (party.size() < minPlayers)
end(eim,"There are not enough players remaining, the Battle is over.");
return false;
function playerEntry(eim, player) {
eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
}
function playerDead(eim,player) {
function scheduledTimeout(eim) {
end(eim);
}
function playerDisconnected(eim,player) {
var party = eim.getPlayers();
if (player.getName().equals(eim.getProperty("leader"))) {
// tell members
var iter = party.iterator();
while (iter.hasNext())
iter.next().getPlayer().dropMessage(6,"The leader of the instance has disconnected.");
}
// and, if the party is too small
if (party.size() < minPlayers) {
end(eim,"There are not enough players remaining. The Battle is over.");
function changedMap(eim, player, mapid) {
if (mapid < minMapId || mapid > maxMapId) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
eim.unregisterPlayer(player);
end(eim);
}
else {
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
eim.unregisterPlayer(player);
}
}
}
function changedLeader(eim, leader) {}
function playerDead(eim, player) {}
function playerRevive(eim, player) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
end(eim);
}
else {
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
eim.unregisterPlayer(player);
}
}
function playerDisconnected(eim, player) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.dropMessage(5, "[Expedition] Either the leader has quitted the event or there is no longer the minimum number of members required to continue this event.");
eim.unregisterPlayer(player);
end(eim);
}
else {
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the event.");
eim.unregisterPlayer(player);
}
}
function leftParty (eim, player) {}
function disbandParty (eim) {}
function monsterValue(eim, mobId) {
return 1;
}
function leftParty(eim,player) {}
function disbandParty(eim) {}
function playerUnregistered(eim, player) {}
function playerExit(eim,player) {
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap,exitMap.getPortal(0));
if (eim.getPlayers().size() < minPlayers)//not enough after someone left
end(eim,"There are no longer enough players to continue, and those remaining shall be warped out.");
player.changeMap(exitMap, 0);
}
function end(eim,msg) {
var iter = eim.getPlayers().iterator();
while (iter.hasNext()) {
var player = iter.next();
player.getPlayer().dropMessage(6,msg);
eim.unregisterPlayer(player);
if (player != null)
player.changeMap(exitMap, exitMap.getPortal(0));
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
}
// for offline folk
function removePlayer(eim,player) {
eim.unregisterPlayer(player);
player.getMap().removePlayer(player);
player.setMap(exitMap);
function giveRandomEventReward(eim, player) {
eim.giveEventReward(player);
}
function clearPQ(eim) {}
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
}
function finish(eim) {
var iter = eim.getPlayers().iterator();
while (iter.hasNext()) {
var player = iter.next();
eim.unregisterPlayer(player);
player.changeMap(exitMap, exitMap.getPortal(0));
function isHorntailHead(mob) {
var mobid = mob.getId();
return (mobid == 8810000 || mobid == 8810001);
}
function isHorntail(mob) {
var mobid = mob.getId();
return (mobid == 8810018);
}
function monsterKilled(mob, eim) {
if(isHorntail(mob)) {
eim.setIntProperty("defeatedBoss", 1);
eim.showClearEffect(mob.getMap().getId());
eim.clearPQ();
mob.getMap().broadcastHorntailVictory();
} else if(isHorntailHead(mob)) {
var killed = eim.getIntProperty("defeatedHead");
eim.setIntProperty("defeatedHead", killed + 1);
eim.showClearEffect(mob.getMap().getId());
}
eim.dispose();
}
function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function timeOut() {}
function debug(eim,msg) {
var iter = eim.getPlayers().iterator();
while (iter.hasNext()) {
iter.next().getClient().getSession().write(Packages.tools.MaplePacketCreator.serverNotice(6,msg));
}
}
function dispose(eim) {}

213
scripts/event/HorntailPQ.js Normal file
View File

@@ -0,0 +1,213 @@
/**
* @author: Ronan
* @event: Horntail PQ
*/
var isPq = true;
var minPlayers = 1, maxPlayers = 6;
var minLevel = 120, maxLevel = 255;
var entryMap = 240050100;
var exitMap = 240050500;
var recruitMap = 240050000;
var clearMap = 240050400;
var minMapId = 240050100;
var maxMapId = 240050310;
var eventTime = 25; // 25 minutes
var lobbyRange = [0, 0];
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
}
function setEventRequirements() {
var reqStr = "";
reqStr += "\r\n Number of players: ";
if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers;
else reqStr += minPlayers;
reqStr += "\r\n Level range: ";
if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel;
else reqStr += minLevel;
reqStr += "\r\n Time limit: ";
reqStr += eventTime + " minutes";
em.setProperty("party", reqStr);
}
function setEventExclusives(eim) {
var itemSet = [4001087, 4001088, 4001089, 4001090, 4001091, 4001092, 4001093];
eim.setExclusiveItems(itemSet);
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages;
evLevel = 1; //Rewards at clear PQ
itemSet = [];
itemQty = [];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = []; //bonus exp given on CLEAR stage signal
eim.setEventClearStageExp(expStages);
}
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
var eligible = [];
var hasLeader = false;
if(party.size() > 0) {
var partyList = party.toArray();
for(var i = 0; i < party.size(); i++) {
var ch = partyList[i];
if(ch.getMapId() == recruitMap && ch.getLevel() >= minLevel && ch.getLevel() <= maxLevel) {
if(ch.isLeader()) hasLeader = true;
eligible.push(ch);
}
}
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
}
function setup(level, lobbyid) {
var eim = em.newInstance("PreHorntail" + lobbyid);
eim.setProperty("level", level);
eim.getInstanceMap(240050000).resetPQ(level);
eim.getInstanceMap(240050100).resetPQ(level);
eim.getInstanceMap(240050101).resetPQ(level);
eim.getInstanceMap(240050102).resetPQ(level);
eim.getInstanceMap(240050103).resetPQ(level);
eim.getInstanceMap(240050104).resetPQ(level);
eim.getInstanceMap(240050105).resetPQ(level);
eim.getInstanceMap(240050200).resetPQ(level);
eim.getInstanceMap(240050300).resetPQ(level);
eim.getInstanceMap(240050310).resetPQ(level);
eim.getInstanceMap(240050101).getReactorByName("passKey1").setEventState(0);
eim.getInstanceMap(240050102).getReactorByName("passKey2").setEventState(1);
eim.getInstanceMap(240050103).getReactorByName("passKey3").setEventState(2);
eim.getInstanceMap(240050104).getReactorByName("passKey4").setEventState(3);
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
setEventExclusives(eim);
return eim;
}
function afterSetup(eim) {}
function respawnStages(eim) {}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
}
function scheduledTimeout(eim) {
end(eim);
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function changedMap(eim, player, mapid) {
if (mapid < minMapId || mapid > maxMapId) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function changedLeader(eim, leader) {
var mapid = leader.getMapId();
if (!eim.isEventCleared() && (mapid < minMapId || mapid > maxMapId)) {
end(eim);
}
}
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function playerDisconnected(eim, player) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function leftParty(eim, player) {
if (eim.isEventTeamLackingNow(false, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function disbandParty(eim) {
end(eim);
}
function monsterValue(eim, mobId) {
return 1;
}
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
}
function giveRandomEventReward(eim, player) {
eim.giveEventReward(player);
}
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
eim.warpEventTeam(clearMap);
}
function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {}

View File

@@ -68,7 +68,7 @@ function afterSetup(eim) {}
function setup(channel) {
var eim = em.newInstance("Scarga" + channel);
eim.setProperty("canJoin", 1);
eim.setProperty("defeatedBoss", 1);
eim.setProperty("defeatedBoss", 0);
var level = 1;
eim.getInstanceMap(551030200).resetPQ(level);

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @author BubblesDev, Ronan
* @author BubblesDev
* @author Ronan
* @NPC Tory
*/

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @author BubblesDev, Ronan
* @author BubblesDev
* @author Ronan
* @npc Tommy (HPQ)
*/
var status = 0;

View File

@@ -2,7 +2,7 @@
Growlie (that fatass uhh.. hungry lion or whatever)
FightDesign @RageZONE
Ronan
@author Ronan
*/
var status = 0;

View File

@@ -1,5 +1,6 @@
/**
* @author: Eric, Ronan
* @author: Eric
* @author: Ronan
* @npc: Red Sign
* @map: 101st Floor Eos Tower (221024500)
* @func: Ludi PQ

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Red Balloon
@ Map = Hidden-Street <Stage 1>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Orange Balloon
@ Map = Hidden-Street <Stage 2>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Yellow Balloon
@ Map = Hidden-Street <Stage 3>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Lime Balloon
@ Map = Hidden-Street <Stage 4>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Green Balloon
@ Map = Hidden-Street <Stage 5>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Sky-Blue Balloon
@ Map = Hidden-Street <Stage 7>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Twdtwd, Ronan
@ Author : Twdtwd
@ Author : Ronan
@
@ NPC = Blue Balloon
@ Map = Hidden-Street <Stage 8>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Twdtwd, Ronan
@ Author : Twdtwd
@ Author : Ronan
@
@ NPC = Violet Balloon
@ Map = Hidden-Street <Crack on the Wall>

View File

@@ -21,7 +21,8 @@
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Pink Balloon
@ Map = Hidden-Street <Stage B>

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
@ Author : Raz, Ronan
@ Author : Raz
@ Author : Ronan
@
@ NPC = Sgt.Anderson
@ Map = Abandoned Tower <Stage 1>

View File

@@ -19,12 +19,25 @@
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/>.
*/
//Fixed by Moogra
//Fixed by Moogra, Ronan
//Fixed grammar, javascript syntax
importPackage(Packages.client);
var status = 0;
var price = 100000;
function isTransformed(ch) {
return ch.getBuffSource(MapleBuffStat.MORPH) == 2210003;
}
function start() {
if(!(isTransformed(cm.getPlayer()) || cm.haveItem(4001086))) {
cm.sendOk("This is the cave of the mighty Horntail, supreme ruler of the Leafre Canyons, outsiders are not welcome. Get lost!");
cm.dispose();
return;
}
cm.sendSimple("Welcome to Cave of Life - Entrance ! Would you like to go inside and fight #rHorntail#k ? If you want to fight him, you may might need some #b#v2000005##k, so you can recover some HP if you have been hit by #rHorntail#k.\r\n#L1#I would like to buy 10 for 100,000 Mesos!#l\r\n\#L2#No thanks, let me in now!#l");
}
@@ -32,12 +45,17 @@ function action(mode, type, selection) {
if (mode < 1)
cm.dispose();
else if (selection == 1) {
if(cm.getMeso() >= price && cm.canHold(2000005)) {
cm.gainMeso(-price);
cm.gainItem(2000005, 10);
cm.sendOk("Thank you for buying the potion. Use it as well!");
} else
if(cm.getMeso() >= price) {
if(!cm.canHold(2000005)) {
cm.sendOk("Sorry, you don't have a slot on your inventory for the item!");
} else {
cm.gainMeso(-price);
cm.gainItem(2000005, 10);
cm.sendOk("Thank you for buying the potion. Use it as well!");
}
} else {
cm.sendOk("Sorry, you don't have enough mesos to buy them!");
}
cm.dispose();
} else if (selection == 2) {
if (cm.getLevel() > 99)

View File

@@ -47,68 +47,15 @@ function action(mode, type, selection) {
else
status--;
if (status == 0) {
// Slate has no preamble, directly checks if you're in a party
if (cm.getParty() == null) { // no party
cm.sendOk("If you want to attempt the quest, try making a party and getting 6 People...");
if(cm.haveItem(4001086)) {
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
} else {
cm.sendOk("Those who don't have the #r#t4001086##k must prove their valor before challenging #bHorntail#k.");
cm.dispose();
return;
}
if (!cm.isLeader()) { // not party leader
cm.sendSimple("You are not the party leader.");
cm.dispose();
}
else {
// Check teh partyy
var party = cm.getParty().getMembers();
var mapId = cm.getPlayer().getMapId();
var next = true;
var levelValid = 0;
var inMap = 0;
// Temp removal for testing
if (party.size() < minPlayers || party.size() > maxPlayers)
next = false;
else {
for (var i = 0; i < party.size() && next; i++) {
if ((party.get(i).getLevel() >= minLevel) && (party.get(i).getLevel() <= maxLevel))
levelValid += 1;
if (party.get(i).getMapId() == mapId)
inMap += 1;
}
if (levelValid < party.size() || inMap < party.size())
next = false;
}
if (next) {
// Kick it into action. Slate says nothing here, just warps you in.
var em = cm.getEventManager("HontalePQ");
if (em == null) {
cm.dispose();
}
else {
// Begin the PQ.
if(!em.startInstance(cm.getParty(),cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
//force the two scripts on portals in the map
//eim = cm.getPlayer().getEventInstance();
var map = eim.getMapInstance(240050100);
var bulbMap = eim.getMapInstance(240050200);
//map.getPortal(7).setScriptName("hontale_BtoB1");
//map.getPortal(2).setScriptName("hontale_C");
// Remove pass/coupons
party = cm.getPlayer().getEventInstance().getPlayers();
}
cm.dispose();
}
else {
cm.sendOk("Your party is not a party of six. Make sure all your members are present and qualified to participate in this quest. I see #b" + levelValid.toString() + " #kmembers are in the right level range, and #b" + inMap.toString() + "#k are in my map. If this seems wrong, #blog out and log back in,#k or reform the party.");
cm.dispose();
}
}
}
else {
cm.sendOk("RAWR!?!?!?");
cm.warp(240050400);
cm.dispose();
}
}

View File

@@ -1,25 +1,107 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
/**
* @author: Ronan
* @npc: Mark of the Squad
* @map: Cave of Life - Cave Entrance (240050000)
* @func: Horntail PQ
*/
var status = 0;
var price = 100000;
var em = null;
var hasPass;
function isRecruitingMap(mapid) {
return mapid == 240050000;
}
function start() {
cm.warp(240050400);
cm.dispose();
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(isRecruitingMap(cm.getMapId())) {
if (status == 0) {
em = cm.getEventManager("HorntailPQ");
if(em == null) {
cm.sendOk("The Horntail PQ has encountered an error.");
cm.dispose();
return;
}
cm.sendSimple("#e#b<Party Quest: Horntail Trial Grounds>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nThis is the path to Horntail's lair. If you want to face him, you and your team shall be tested on the trial grounds ahead.#b\r\n#L0#Let us pass to the trial grounds.\r\n#L1#I would like to hear more details.");
} else if (status == 1) {
if (selection == 0) {
if (cm.getParty() == null) {
cm.sendOk("You can participate in the party quest only if you are in a party.");
cm.dispose();
} else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");
}
}
else {
cm.sendOk("Either I cannot accept some members of your party inside the cave or you team is lacking. Solve this problem then talk to me!");
}
cm.dispose();
}
} else {
cm.sendOk("#e#b<Party Quest: Horntail Trial Grounds>#k#n\r\nAs the gatekeeper of Horntail's lair, I will grant access #bjust to those worthy#k of his presence. Even for those people, the path inside is that of a maze, full of branches and trials. However, those #radept at fighting squad bosses#k have a better chance to stand to our leader, although those #rof our kind#k have a shabby chance as well.");
cm.dispose();
}
}
} else {
if(!cm.isEventLeader()) {
cm.sendOk("Only your event leader is allowed to interact with the Schedule.");
} else if(cm.getMapId() == 240050100) {
if(cm.haveItem(4001087) && cm.haveItem(4001088) && cm.haveItem(4001089) && cm.haveItem(4001090) && cm.haveItem(4001091)) {
cm.gainItem(4001087, -1);
cm.gainItem(4001088, -1);
cm.gainItem(4001089, -1);
cm.gainItem(4001090, -1);
cm.gainItem(4001091, -1);
cm.getEventInstance().warpEventTeam(240050200);
} else {
cm.sendOk("You don't have all the keys needed to proceed.");
}
} else if(cm.getMapId() == 240050300) {
if(cm.haveItem(4001092, 1) && cm.haveItem(4001093, 6)) {
cm.gainItem(4001092, -1);
cm.gainItem(4001093, -6);
cm.getEventInstance().clearPQ();
} else {
cm.sendOk("Check if you have got all 6 Red keys and 1 Blue key with you.");
}
} else if(cm.getMapId() == 240050310) {
if(cm.haveItem(4001092, 1) && cm.haveItem(4001093, 6)) {
cm.gainItem(4001092, -1);
cm.gainItem(4001093, -6);
cm.getEventInstance().clearPQ();
} else {
cm.sendOk("Check if you have got all 6 Red keys and 1 Blue key with you.");
}
}
cm.dispose();
}
}
}

View File

@@ -22,7 +22,7 @@
/**
*Crystal of Roots
*@Author: Moogra
*@Author: Ronan
*@NPC: Crystal of Roots
*/
function start() {
@@ -33,11 +33,9 @@ function action(mode, type, selection) {
if (mode < 1)
cm.dispose();
else {
cm.warp(240040700);
if (cm.getPlayer().getMap().getCharacters().size() < 2){
cm.getPlayer().getMap().killAllMonsters();
cm.getPlayer().getMap().resetReactors();
}
if(cm.getMapId() > 240050400) cm.warp(240050600);
else cm.warp(240040700);
cm.dispose();
}
}

View File

@@ -19,11 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*Mark of the Squad
*@author Even
*
*@author SharpAceX (Alan)
*/
/*TODO
* ADD A CHECK TO SEE IF PLAYERS HAVE BADGE
*@author Ronan
*/
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
@@ -33,7 +31,10 @@ var status = 0;
var expedition;
var player;
var em;
var horntail = MapleExpeditionType.HORNTAIL;
var exped = MapleExpeditionType.HORNTAIL;
var expedName = "Horntail";
var expedBoss = "mighty Horntail";
var list = "What would you like to do?#b\r\n\r\n#L1#View current Expedition members#l\r\n#L2#Start the fight!#l\r\n#L3#Stop the expedition.#l";
function start() {
@@ -43,113 +44,134 @@ function start() {
function action(mode, type, selection) {
player = cm.getPlayer();
expedition = cm.getExpedition(horntail);
expedition = cm.getExpedition(exped);
em = cm.getEventManager("HorntailFight");
if (mode < 1) {
if (mode == -1) {
cm.dispose();
return;
}
if (status == 0) {
//cm.removeExpedition(expedition);
if (player.getClient().getChannel() != 1) { //Only channel 1
cm.sendOk("Sorry, Horntail may only be challenged on #bChannel 1#k.");
cm.dispose();
} else if (player.getLevel() < horntail.getMinLevel() && player.getLevel() > horntail.getMaxLevel()) { //Don't fit requirement
cm.sendOk("You do not meet the criteria to take on Horntail!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
cm.sendSimple("Would you like to assemble a team to take on the mighty #rHorntail#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
status = 1;
} else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
cm.sendSimple(list);
status = 2;
} else if (expedition.isRegistering()) { //If the expedition is registering
if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
cm.sendOk("You have already registered for the expedition. Please wait for " + expedition.getLeader().getName() + " to begin the expedition.");
cm.dispose();
} else { //If you aren't in it, you're going to get added
cm.sendOk(expedition.addMember(cm.getPlayer()));
cm.dispose();
}
} else if (expedition.isInProgress()) { //Only if the expedition is in progress
if (expedition.contains(player)) { //If you're registered, warp you in
em.getInstance("HorntailFight_" + player.getClient().getChannel()).registerPlayer(player);
cm.dispose();
} else { //If you're not in by now, tough luck
cm.sendOk("Another expedition has taken the initiative to fight Horntail, lets pray for those brave souls.");
cm.dispose();
}
}
} else if (status == 1) {
if (selection == 1) {
cm.createExpedition(horntail);
cm.sendOk("The #rHorntail Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
cm.dispose();
return;
} else if (selection == 2) {
cm.sendOk("Sure, not everyone's up to challenging the might of Horntail.");
} else {
if (mode == 0) {
cm.dispose();
return;
}
} else if (status == 2) {
if (selection == 1) {
if (expedition == null) {
cm.sendOk("The expedition could not be loaded.");
if (status == 0) {
if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
cm.sendSimple("#e#b<Expedition: " + expedName + ">\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
status = 1;
} else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
cm.sendSimple(list);
status = 2;
} else if (expedition.isRegistering()) { //If the expedition is registering
if (expedition.contains(player)) { //If you're in it but it hasn't started, be patient
cm.sendOk("You have already registered for the expedition. Please wait for #r" + expedition.getLeader().getName() + "#k to begin the expedition.");
cm.dispose();
} else { //If you aren't in it, you're going to get added
cm.sendOk(expedition.addMember(cm.getPlayer()));
cm.dispose();
}
} else if (expedition.isInProgress()) { //Only if the expedition is in progress
if (expedition.contains(player)) { //If you're registered, warp you in
var eim = em.getInstance(expedName + player.getClient().getChannel());
if(eim.getIntProperty("canJoin") == 1) {
eim.registerPlayer(player);
} else {
cm.sendOk("Your expedition already started the battle against " + expedBoss + ". Lets pray for those brave souls.");
}
cm.dispose();
} else { //If you're not in by now, tough luck
cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
cm.dispose();
}
}
} else if (status == 1) {
if (selection == 1) {
expedition = cm.getExpedition(exped);
if(expedition != null) {
cm.sendOk("Someone already taken the initiative to be the leader of the expedition. Try joining them!");
cm.dispose();
return;
}
cm.createExpedition(exped);
cm.sendOk("The #r" + expedBoss + " Expedition#k has been created.\r\n\r\nTalk to me again to view the current team, or start the fight!");
cm.dispose();
return;
} else if (selection == 2) {
cm.sendOk("Sure, not everyone's up to challenging " + expedBoss + ".");
cm.dispose();
return;
}
var size = expedition.getMembers().size();
if (size == 1) {
cm.sendOk("You are the only member of the expedition.");
} else if (status == 2) {
if (selection == 1) {
if (expedition == null) {
cm.sendOk("The expedition could not be loaded.");
cm.dispose();
return;
}
var size = expedition.getMembers().size();
if (size == 1) {
cm.sendOk("You are the only member of the expedition.");
cm.dispose();
return;
}
var text = "The following members make up your expedition (Click on them to expel them):\r\n";
text += "\r\n\t\t1." + expedition.getLeader().getName();
for (var i = 1; i < size; i++) {
text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
}
cm.sendSimple(text);
status = 6;
} else if (selection == 2) {
//var min = exped.getMinSize();
var min = 1;
var size = expedition.getMembers().size();
if (size < min) {
cm.sendOk("You need at least " + min + " players registered in your expedition.");
cm.dispose();
return;
}
cm.sendOk("Good luck! All of Leafre is counting on you.");
status = 4;
} else if (selection == 3) {
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition);
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
cm.dispose();
return;
}
var text = "The following members make up your expedition (Click on them to expel them):\r\n";
text += "\r\n\t\t1." + expedition.getLeader().getName();
for (var i = 1; i < size; i++) {
text += "\r\n#b#L" + (i + 1) + "#" + (i + 1) + ". " + expedition.getMembers().get(i).getName() + "#l\n";
} else if (status == 4) {
if (em == null) {
cm.sendOk("The event could not be initialized, please report this on the forum.");
cm.dispose();
return;
}
cm.sendSimple(text);
status = 6;
} else if (selection == 2) {
cm.sendOk("The expedition will begin and you will be escorted to the #bCave of Trial I#k.");
status = 4;
} else if (selection == 3) {
cm.sendOk("The expedition has now ended. Sometimes the best strategy is to run away.");
player.getMap().broadcastMessage(MaplePacketCreator.removeClock());
player.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, expedition.getLeader().getName() + " has ended the expedition."));
cm.endExpedition(expedition);
cm.dispose();
return;
}
} else if (status == 4) {
var min = 1; //horntail.getMinSize();
var size = expedition.getMembers().size();
if (size < min) {
cm.sendOk("You need at least " + min + " players registered in your expedition.");
em.setProperty("leader", player.getName());
em.setProperty("channel", player.getClient().getChannel());
if(!em.startInstance(expedition)) {
cm.sendOk("Another expedition has taken the initiative to challenge " + expedBoss + ", lets pray for those brave souls.");
cm.dispose();
return;
}
cm.dispose();
return;
}
if (em == null) {
cm.sendOk("The event could not be found, please report this on the forum.");
cm.dispose();
return;
}
cm.sendOk("Good luck! All of Leafre is counting on you.");
em.setProperty("channel", player.getClient().getChannel());
em.startInstance(expedition);
cm.dispose();
return;
} else if (status == 6) {
if (selection > 0) {
var banned = expedition.getMembers().get(selection);
expedition.ban(banned);
cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
cm.dispose();
} else {
cm.sendSimple(list);
status = 2;
} else if (status == 6) {
if (selection > 0) {
var banned = expedition.getMembers().get(selection - 1);
expedition.ban(banned);
cm.sendOk("You have banned " + banned.getName() + " from the expedition.");
cm.dispose();
} else {
cm.sendSimple(list);
status = 2;
}
}
}
}

View File

@@ -1,4 +1,5 @@
/* Author: aaroncsn(MapleSea Like), Ronan Lana
/* @author aaroncsn(MapleSea Like)
* @author Ronan
NPC Name: Mr. Do
Map(s): Mu Lung: Mu Lung(2500000000)
Description: Potion Creator

View File

@@ -24,9 +24,9 @@ function action(mode, type, selection) {
else
status--;
if(status == 0){
cm.sendAcceptDecline("I don't know how you found out about this, but you came to the right place! For those that wandered around Nihal Desert and are getting homesick, I am offering a flight straight to Victorial Island, non-stop! Don't worry about the flying ship--it's only fallen once or twice! Don't you feel claustrophobic being in a long flight on that small ship? What do you think? Are you willing to take the offer on this direct flight?");
cm.sendNext("I don't know how you found out about this, but you came to the right place! For those that wandered around Nihal Desert and are getting homesick, I am offering a flight straight to Victorial Island, non-stop! Don't worry about the flying ship--it's only fallen once or twice! Don't you feel claustrophobic being in a long flight on that small ship?");
} else if(status == 1){
cm.sendAcceptDecline("Please remember two things. One, this line is actually for overseas shipping, so #rI cannot gurantee exactly which town you'll land#k. Two, since I am putting you in this special flight, it'll be a bit expensive. The service charge is #e#b10,000 mesos#n#k. There's a flight thats about to take off. Are you interested?");
cm.sendAcceptDecline("Please remember two things. One, this line is actually for overseas shipping, so #rI cannot gurantee exactly which town you'll land#k. Two, since I am putting you in this special flight, it'll be a bit expensive. The service charge is #e#b10,000 mesos#n#k. There's a flight thats about to take off. Are you interested in this direct flight?");
} else if(status == 2){
cm.sendNext("Okay, ready to takeoff~");
} else if(status == 3){

View File

@@ -2,7 +2,7 @@
Refining NPC:
* Chaos scroll SYNTHETIZER (rofl)
*
* By RonanLana
* @author RonanLana
*/
var status = 0;

View File

@@ -25,7 +25,7 @@
Refining NPC:
* Accessories refiner
*
* By Ronan Lana
* @author Ronan Lana
*/
var status = -1;

View File

@@ -23,7 +23,7 @@
Victoria Road : Henesys
NPC Bazaar:
* By Ronan Lana
* @author Ronan Lana
*/
var options = ["EQUIP","USE","SET-UP","ETC"];

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* @Author TheRamon, Ronan
* @Author TheRamon
* @Author Ronan
*
* Sharen III's Soul, Sharenian: Sharen III's Grave (990000700)
*

View File

@@ -1,4 +1,5 @@
/* @Author Lerk, Ronan
/* @Author Lerk
* @Author Ronan
*
* Guardian Statue - Sharenian: Fountain of the Wiseman (990000500)
*

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Author : Raz, Ronan
* Author : Raz
* Author : Ronan
*
* NPC = 9103000 - Pierre
* Map = Ludibrium - Ludibrium Maze 16

View File

@@ -20,7 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Author : Raz, Ronan
* Author : Raz
* Author : Ronan
*
* NPC = 9103001 - Rolly
* Map = Ludibrium - <Ludibrium>

View File

@@ -20,7 +20,8 @@
*/
/*Jack
*
*@author SharpAceX (Alan), Ronan
*@author SharpAceX (Alan)
*@author Ronan
*/
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);

View File

@@ -20,7 +20,8 @@
*/
/*Aldol
*
*@author SharpAceX (Alan), Ronan
*@author SharpAceX (Alan)
*@author Ronan
*/
importPackage(Packages.server.expeditions);
importPackage(Packages.tools);
@@ -31,6 +32,7 @@ var expedition;
var player;
var em;
var exped = MapleExpeditionType.SCARGA;
var expedName = "Scarga";
var expedBoss = "Scarlion and Targa";
var expedMap = "Spooky World";
var expedItem = 4032246;
@@ -60,7 +62,7 @@ function action(mode, type, selection) {
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
cm.sendSimple("#e#b<Expedition: Scarlion & Targa>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
cm.sendSimple("#e#b<Expedition: " + expedName + ">\r\n#k#n" + em.getProperty("party") + "\r\n\r\nWould you like to assemble a team to take on #r" + expedBoss + "#k?\r\n#b#L1#Lets get this going!#l\r\n\#L2#No, I think I'll wait a bit...#l");
status = 1;
} else if (expedition.isLeader(player)) { //If you're the leader, manage the exped
cm.sendSimple(list);
@@ -75,7 +77,7 @@ function action(mode, type, selection) {
}
} else if (expedition.isInProgress()) { //Only if the expedition is in progress
if (expedition.contains(player)) { //If you're registered, warp you in
var eim = em.getInstance("Scarga" + player.getClient().getChannel());
var eim = em.getInstance(expedName + player.getClient().getChannel());
if(eim.getIntProperty("canJoin") == 1) {
eim.registerPlayer(player);
} else {

View File

@@ -0,0 +1,3 @@
//some quest where you must use hidden portals
function enter(pi) {
}

View File

@@ -1,4 +1,4 @@
/* By RonanLana */
/* @author RonanLana */
function enter(pi) {
if (!pi.haveItem(4000381)) {

View File

@@ -0,0 +1,15 @@
function enter(pi) {
if (pi.getQuestStatus(20407) == 2) {
pi.warp(924010200,0);
return true;
} else if (pi.getQuestStatus(20406) == 2) {
pi.warp(924010100,0);
return true;
} else if (pi.getQuestStatus(20404) == 2) {
pi.warp(924010000,0);
return true;
} else {
pi.playerMessage(5, "I shouldn't go here.. it's creepy!");
return false;
}
}

View File

@@ -19,7 +19,8 @@
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 Lerk, Ronan
/* @Author Lerk
* @Author Ronan
*
* Guild Quest Waiting Room - Entry Portal (map 990000000)
*/

View File

@@ -21,39 +21,21 @@
*/
function enter(pi) {
if (pi.getPlayer().getMapId() == 240060000) {
var nextMap = 240060100;
var eim = pi.getPlayer().getEventInstance()
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("head1");
if (avail != "yes") {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}else {
pi.getPlayer().changeMap(target, targetPortal);
if (eim.getProperty("head2spawned") != "yes") {
eim.setProperty("head2spawned", "yes");
eim.schedule("headTwo", 5000);
}
return true;
}
if(pi.getEventInstance().getIntProperty("defeatedHead") >= 1) {
pi.warp(240060100, 0);
return true;
} else {
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}
} else if (pi.getPlayer().getMapId() == 240060100) {
var nextMap = 240060200;
var eim = pi.getPlayer().getEventInstance()
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("head2");
if (avail != "yes") {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}else {
pi.getPlayer().changeMap(target, targetPortal);
return true;
}
if(pi.getEventInstance().getIntProperty("defeatedHead") >= 2) {
pi.warp(240060200, 0);
return true;
} else {
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}
}
return true;
return false;
}

View File

@@ -29,10 +29,10 @@ function enter(pi) {
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("2stageclear");
var avail = eim.getProperty("1stageclear");
if (avail == null) {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "This door is closed.");
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}else {
pi.getPlayer().changeMap(target, targetPortal);
@@ -45,10 +45,10 @@ function enter(pi) {
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("3stageclear");
var avail = eim.getProperty("2stageclear");
if (avail == null) {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "This door is closed.");
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}else {
pi.getPlayer().changeMap(target, targetPortal);
@@ -61,10 +61,10 @@ function enter(pi) {
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("4stageclear");
var avail = eim.getProperty("3stageclear");
if (avail == null) {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "This door is closed.");
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}else {
pi.getPlayer().changeMap(target, targetPortal);
@@ -77,10 +77,10 @@ function enter(pi) {
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("5stageclear");
var avail = eim.getProperty("4stageclear");
if (avail == null) {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "This door is closed.");
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
return false;
}else {
pi.getPlayer().changeMap(target, targetPortal);
@@ -88,14 +88,26 @@ function enter(pi) {
}
}
else if (pi.getPlayer().getMapId() == 240050105) {
if (pi.haveItem(4001091, 6) && pi.isLeader()) {
pi.gainItem(4001091, -6);
pi.getPlayer().dropMessage(6, "The six keys break the seal for a flash...");
pi.warp(240050100, "st00");
var nextMap = 240050100;
var eim = pi.getPlayer().getEventInstance()
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("st00");
var avail = eim.getProperty("5stageclear");
if (avail == null) {
if (pi.haveItem(4001092) && pi.isEventLeader()) {
pi.getEventInstance().showClearEffect();
pi.getPlayer().dropMessage(6, "The leader's key break the seal for a flash...");
pi.getPlayer().changeMap(target, targetPortal);
eim.setIntProperty("5stageclear", 1);
return true;
} else {
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is blocking this door. Only the leader with the key can lift this seal.");
return false;
}
}else {
pi.getPlayer().changeMap(target, targetPortal);
return true;
} else {
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is blocking this door.");
return false;
}
}
return true;

View File

@@ -24,20 +24,15 @@
*/
function enter(pi) {
var nextMap = 240050101;
var eim = pi.getPlayer().getEventInstance()
var target = eim.getMapInstance(nextMap);
var targetPortal = target.getPortal("sp");
// only let people through if the eim is ready
var avail = eim.getProperty("1stageclear");
if (!pi.haveItem(4001092, 1)) {
// do nothing; send message to player
pi.getPlayer().dropMessage(6, "Horntail\'s Seal is Blocking this Door.");
if (pi.getMap().countPlayers() == 1) {
pi.getPlayer().dropMessage(6, "As the last player on this map, you are compelled to wait for the incoming keys.");
return false;
}else {
pi.gainItem(4001092, -1);
pi.getPlayer().dropMessage(6, "The key disentegrates as Horntail\'s Seal is broken for a flash...");
pi.getPlayer().changeMap(target, targetPortal);
if(pi.haveItem(4001087)) {
pi.getPlayer().dropMessage(6, "You cannot pass to the next map holding the 1st Crystal Key in your inventory.");
return false;
}
pi.warp(240050101);
return true;
}
}

View File

@@ -23,31 +23,23 @@
**hontale_c.js
@author Jvlaple
@author Ronan
*/
function enter(pi) {
if (pi.isLeader() == true) {
if (pi.isEventLeader() == true) {
var eim = pi.getPlayer().getEventInstance();
var party = eim.getPlayers();
var target;
var theWay = eim.getProperty("theWay");
var target;
if (theWay != null) {
if (theWay = "light") {
target = eim.getMapInstance(240050300); //light
} else {
target = eim.getMapInstance(240050310); //dark
}
var theWay = pi.getMap().getReactorByName("light").getState();
if (theWay == 1) {
target = 240050300; //light
} else if(theWay == 3) {
target = 240050310; //dark
} else {
pi.playerMessage(5, "Hit the Lightbulb to determine your fate!");
return false;
}
var targetPortal = target.getPortal("sp");
//Warp the full party into the map...
var partyy = pi.getPlayer().getEventInstance().getPlayers();
for (var i = 0; i < partyy.size(); i++) {
party.get(i).changeMap(target, targetPortal);
}
eim.warpEventTeam(target);
return true;
} else {
pi.playerMessage(6, "You are not the party leader. Only the party leader may proceed through this portal.");

View File

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

View File

@@ -0,0 +1,5 @@
function enter(pi) {
pi.saveLocation("MIRROR");
pi.warp(926010000, 0);
return true;
}

View File

@@ -19,14 +19,17 @@
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 Aexr
/* @Author Aexr, Ronan
* 2401000.js: Horntail's Cave - Summons Horntail.
*/
function act() {
rm.changeMusic("Bgm14/HonTale");
if (rm.getReactor().getMap().getMonsterById(8810026) == null) {
rm.spawnMonster(8810026,71,260);
rm.getReactor().getMap().spawnHorntailOnGroundBelow(new java.awt.Point(71,260));
var eim = rm.getEventInstance();
eim.restartEventTimer(60 * 60000);
}
rm.mapMessage(6, "From the depths of his cave, here comes Horntail!");
}

View File

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

View File

@@ -0,0 +1,23 @@
/*
Dragon nest
*/
function sendToHeaven() {
rm.destroyNpc(2081008);
rm.mapMessage(6, "In a flicker of light, Nine Spirit's Little Dragon returns to the place it belongs, high above the skies.");
rm.getReactor().getMap().resetReactors();
}
function touch() {
if(rm.haveItem(4001094) && rm.getReactor().getState() == 0) {
rm.hitReactor();
rm.gainItem(4001094, -1);
}
}
function untouch() {}
function act() {
rm.spawnNpc(2081008);
rm.schedule("sendToHeaven", 12 * 1000);
}

View File

@@ -25,34 +25,36 @@
*@author Jvlaple
*/
importPackage(Packages.client.inventory);
function act() {
var eim = rm.getPlayer().getEventInstance();
var party = rm.getPlayer().getEventInstance().getPlayers();
var womanfred = eim.getMapFactory().getMap(240050100);
var vvpMap = rm.getPlayer().getMapId();
var vvpKey;
var vvpOrig = 4001087;
var vvpOrig = 4001088;
var vvpStage = -1;
rm.mapMessage(6, "The key is teleported somewhere...");
eim.showClearEffect(false, vvpMap);
rm.mapMessage(6, "The key has been teleported somewhere...");
switch (vvpMap) {
case 240050101 : {
vvpKey = vvpOrig;
vvpStage = 2;
vvpStage = 1;
break;
}
case 240050102 : {
vvpKey = vvpOrig + 1;
vvpStage = 3;
vvpStage = 2;
break;
}
case 240050103 : {
vvpKey = vvpOrig + 2;
vvpStage = 4;
vvpStage = 3;
break;
}
case 240050104 : {
vvpKey = vvpOrig + 3;
vvpStage = 5;
vvpStage = 4;
break;
}
default : {
@@ -60,11 +62,14 @@ function act() {
break;
}
}
var tehWomanfred = new client.Item(vvpKey, 0, 1);
eim.setIntProperty(vvpStage + "stageclear", 1);
var tehWomanfred = new Item(vvpKey, 0, 1);
var theWomanfred = womanfred.getReactorByName("keyDrop1");
var dropper = eim.getPlayers().get(0);
womanfred.spawnItemDrop(theWomanfred, dropper, tehWomanfred, theWomanfred.getPosition(), true, true);
womanfred.dropMessage(5, "A bright flash of light, then a key suddenly appears somewhere in the map.");
eim.getMapInstance(240050100).dropMessage(6, "A bright flash of light, then a key suddenly appears somewhere in the map.");
}

View File

@@ -0,0 +1,3 @@
function act() {
rm.spawnNpc(2081008);
}

View File

@@ -22,7 +22,8 @@
/*
Stage 2: Spear destinations - Guild Quest
@Author Lerk, Ronan
@Author Lerk
@Author Ronan
*/
function act() {