Area boss G. Centipede + fixed Hak event

Added new script for area boss Giant Centipede. Fixed event Hak not
disposing players properly, which made character clients stuck until
logout.
This commit is contained in:
ronancpl
2017-04-18 23:46:59 -03:00
parent c17e4c93a3
commit 72ef73a949
11 changed files with 138 additions and 35 deletions

View File

@@ -0,0 +1,54 @@
/*
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 --------------------------------------------------------------------------------
Deo Spawner
-- Edited by --------------------------------------------------------------------------------------
ThreeStep (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 herbGarden = em.getChannelServer().getMapFactory().getMap(251010102);
var gcent = Packages.server.life.MapleLifeFactory.getMonster(5220004);
if(herbGarden.getMonsterById(5220004) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
herbGarden.spawnMonsterOnGroundBelow(gcent, new Packages.java.awt.Point(560, 50));
herbGarden.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -5,12 +5,13 @@ var rideTo = new Array(250000100, 200000141);
var birdRide = new Array(200090300, 200090310);
var myRide;
var returnMap;
var exitMap;
var map;
var docked;
var timeOnRide = 60; //Seconds
var onRide;
function init() {
}
function setup() {
@@ -24,27 +25,35 @@ function playerEntry(eim, player) {
} else {
myRide = 1;
}
docked = eim.getEm().getChannelServer().getMapFactory().getMap(rideTo[myRide]);
returnMap = eim.getMapFactory().getMap(returnTo[myRide]);
onRide = eim.getMapFactory().getMap(birdRide[myRide]);
player.changeMap(onRide, onRide.getPortal(0));
player.getClient().getSession().write(MaplePacketCreator.getClock(timeOnRide));
eim.schedule("timeOut", timeOnRide * 1000);
exitMap = eim.getEm().getChannelServer().getMapFactory().getMap(rideTo[myRide]);
returnMap = eim.getMapFactory().getMap(returnTo[myRide]);
onRide = eim.getMapFactory().getMap(birdRide[myRide]);
player.changeMap(onRide, onRide.getPortal(0));
player.getClient().getSession().write(MaplePacketCreator.getClock(timeOnRide));
eim.schedule("timeOut", timeOnRide * 1000);
}
function timeOut() {
onRide.warpEveryone(docked.getId());
function timeOut(eim) {
end(eim);
}
function playerExit(eim, player, success) {
eim.unregisterPlayer(player);
player.changeMap(success ? exitMap.getId() : returnMap.getId(), 0);
}
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i), true);
}
eim.dispose();
}
function playerDisconnected(eim, player) {
return 0;
playerExit(eim, player, false);
}
function cancelSchedule() {}
function dispose() {
em.cancelSchedule();
}
function dispose(eim) {}

View File

@@ -61,7 +61,7 @@ function action(mode, type, selection) {
selectedType = selection;
var selStr;
if (selectedType == 0){ //Make a medicine
itemSet = new Array(2022145,2022146,2022147,2022148,2022149,2022150,2022178,4031554);
itemSet = new Array(2022145,2022146,2022147,2022148,2022149,2022150,2050004,4031554);
matSet = new Array(2022116,2022116,new Array(4000281,4000293),new Array(4000276,2002005),new Array(4000288,4000292),4000295,new Array(2022131,2022132),new Array(4000286,4000287,4000293));
matQtySet = new Array(3,3,new Array(10,10),new Array(20,1),new Array(20,20),10,new Array(1,1),new Array(20,20,20));
matQtyMeso = new Array(0,0,910,950,1940,600,700,1000);

View File

@@ -22,7 +22,7 @@
var status = 0;
var minLevel = 55;
var maxLevel = 100;
var minPlayers = 0;
var minPlayers = 2;
var maxPlayers = 6;
function start() {
@@ -84,7 +84,7 @@ function action(mode, type, selection) {
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.sendOk("Your party is not a party of two to six members. 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();
}
}