Files
sweetgum-server/scripts/npc/2030013_old.js
ronancpl 46fec675f1 Added Puppets on Aggro + Guild/Alliance packet info patch + Pet flags
Added pet flags recognition, such as the "pet speed same as owner" mechanic.
Fixed repeatable quest "Remnants of HT..." not rewarding Dragon Stones.
Refactored character object's check slots method, now using the same algorithm from the API class.
Fixed a vunerability from before reviving/respawning players to towns, on where players would get their HP restored in area map before sending them back to safety.
Fixed some NPC gates in Mushking Empire, allowing players to access bosses free of quest requirements.
Improved dialog of NPCs for "permission to attempt Zakum expeds".
Implemented (or rather improved) item scripts, now using NPC conversation methods as it was intended originally.
Rehauled mob-skill "summon mobs" limit, now using the placeholders found in the wz to determine limit of concurrent underlings spawned, and "limit" now refers to total of underlings spawned from a mob.
Revised IoSession closing mechanics in several login classes.
Implemented automated loggedin account shutdown if another player has gained a pass from the DB to login.
Improved the server-side check for teleport rocks.
Fixed removeAfter from mobs being procced after they were disposed.
Reviewed EIM start references on several scripts, minding the latest EIM setup implementations.
Fixed equipments that were reused Scissors of Karma not not being able to sell on pshops/merchants.
Fixed a bug where entering alliances would lead a player to see information from other guilds of past alliances until an update takes place.
Padronized a few skillbook names.
Reviewed player puppets not gaining priority properly on the recent aggro system.
Improved "item sold" message of merchants, now displaying also quantity left of an item on store.
Fixed a bug with itemid limits of weapons on server.
2019-02-17 16:08:53 -03:00

113 lines
4.4 KiB
JavaScript

/*
* 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 Stereo, xQuasar, XkelvinchiaX (Kelvin) - For make it Fully Working.
*
* Adobis - El Nath: Entrance to Zakum Altar (211042400)
*
* Start of Zakum Bossfight
*/
var status;
var minLevel = 50;
var state;
var maxPlayers = 30;
function start() {
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 (status == 0) {
if ((cm.getPlayer().getLevel() < minLevel)) {
cm.warp(211042300);
cm.sendOk("Please come back when you're prepared for the battle. You should not be here yet.");
cm.dispose();
return;
}
cm.sendSimple("The battle to defeat Zakum begins here. What would you like to do? #b\r\n#L0#Start a new Zakum Battle#l\r\n#L1#Join your group's Zakum Battle#l");
}
else if (status == 1) {
state = selection;
if (selection == 0)
cm.sendGetText("In order to start the Zakum Battle, you need to choose a name for your instance. This is the password that lets your members join, so tell it to everybody who wants to participate in the battle.");
else if (selection == 1)
cm.sendGetText("In order to join a Zakum Battle, you need to enter the password. If you don't know what it is, please ask the person leading the battle.");
}
else if (status == 2) {
var em = cm.getEventManager("ZakumBattle");
var passwd = cm.getText();
if (em == null)
cm.sendOk("This trial is currently under construction.");
else {
if (state == 0) { // Leader
if (getEimForString(em,passwd) != null)
cm.sendOk("You may not use that password.");
else { // start Zakum Battle
//var em = cm.getEventManager("Zakum" + passwd);
if (!em.startInstance(cm.getPlayer())) {
cm.sendOk("A party is already registered in this instance.");
}
cm.dispose();
return;
}
}
if (state == 1) { // Member
var eim = getEimForString(em,passwd);
if (eim == null)
cm.sendOk("There is currently no battle registered under that name.");
else {
if (eim.getProperty("canEnter").toLowerCase() == "true") {
if (eim.getPlayers().size() < maxPlayers)
eim.registerPlayer(cm.getPlayer());
else
cm.sendOk("I'm sorry, but that battle is currently full. Please wait to join another one.");
}
else
cm.sendOk("I'm sorry, but that battle is currently in progress. Please return later.");
}
}
}
cm.dispose();
}
}
}
function getEimForString(em, name) {
var stringId = "Zakum" + name;
return em.getInstance(stringId);
}