Performed a syllabus over quest progress tracking. Quests that were supposed to show up as startable/completable upon achieved progress should be able to do so. Reviewed progress tracking on scripts to adequate to this scenario. Fixed some scenarios on where quest dialog popups would appear when updating a quest progress. Fixed some scripts not using updated package addresses after the recent package refactor. Reviewed Raise UI, no longer rendering players unable to access CS/MTS in certain scenarios. Fixed a check of available space in inventory, when trying to obtain items from quests, not informing the player it happened due to a one-of-a-kind item already present. Fixed quest dialog (feature present in many quests) not showing to players when completing it. Fixed several issues with the Cygnus 1st job advancement quests. Added scripting within Raise UI open action. Mimiana egg uses this to keep track of player's EXP progress. Fixed pets not getting despawned as expiration takes place. Fixed hidden players being able to control mobs when either entering map or hidden state. Fixed estimated HP/MP alert not taking bonuses (such as from buffs or equipments) into account. Fixed Energy Charge refreshing buff time upon touching mobs, skewing the uptime of the skill's stat buffs. Switched SnakeYaml for YamlBeans, which makes up for a single JAR artifact. Refactored a channel's event scripts loadout, now taking place after the server bootup phase.
231 lines
6.6 KiB
JavaScript
231 lines
6.6 KiB
JavaScript
/*
|
|
This file is part of the HeavenMS MapleStory Server
|
|
Copyleft (L) 2016 - 2018 RonanLana
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as
|
|
published by the Free Software Foundation version 3 as published by
|
|
the Free Software Foundation. You may not use, modify or distribute
|
|
this program under any other version of the GNU Affero General Public
|
|
License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/**
|
|
* @author: Ronan
|
|
* @event: Horntail Battle
|
|
*/
|
|
|
|
importPackage(Packages.server.life);
|
|
|
|
var isPq = true;
|
|
var minPlayers = 6, maxPlayers = 30;
|
|
var minLevel = 100, maxLevel = 255;
|
|
var entryMap = 240060000;
|
|
var exitMap = 240050600;
|
|
var recruitMap = 240050400;
|
|
var clearMap = 240050600;
|
|
|
|
var minMapId = 240060000;
|
|
var maxMapId = 240060200;
|
|
|
|
var eventTime = 120; // 120 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 = [];
|
|
eim.setExclusiveItems(itemSet);
|
|
}
|
|
|
|
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 setup(channel) {
|
|
var eim = em.newInstance("Horntail" + channel); // thanks Thora for reporting an issue with misleading event name here
|
|
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 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 scheduledTimeout(eim) {
|
|
end(eim);
|
|
}
|
|
|
|
function changedMap(eim, player, mapid) {
|
|
if (mapid < minMapId || mapid > maxMapId) {
|
|
if (eim.isExpeditionTeamLackingNow(true, minPlayers, player)) {
|
|
eim.dropMessage(5, "[Expedition] Either the leader has quit the expedition or there is no longer the minimum number of members required to continue it.");
|
|
eim.unregisterPlayer(player);
|
|
end(eim);
|
|
}
|
|
else {
|
|
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the instance.");
|
|
eim.unregisterPlayer(player);
|
|
}
|
|
}
|
|
}
|
|
|
|
function changedLeader(eim, leader) {}
|
|
|
|
function playerDead(eim, player) {}
|
|
|
|
function playerRevive(eim, player) {
|
|
if (eim.isExpeditionTeamLackingNow(true, minPlayers, player)) {
|
|
eim.unregisterPlayer(player);
|
|
eim.dropMessage(5, "[Expedition] Either the leader has quit the expedition or there is no longer the minimum number of members required to continue it.");
|
|
end(eim);
|
|
}
|
|
else {
|
|
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the instance.");
|
|
eim.unregisterPlayer(player);
|
|
}
|
|
}
|
|
|
|
function playerDisconnected(eim, player) {
|
|
if (eim.isExpeditionTeamLackingNow(true, minPlayers, player)) {
|
|
eim.dropMessage(5, "[Expedition] Either the leader has quit the expedition or there is no longer the minimum number of members required to continue it.");
|
|
eim.unregisterPlayer(player);
|
|
end(eim);
|
|
}
|
|
else {
|
|
eim.dropMessage(5, "[Expedition] " + player.getName() + " has left the instance.");
|
|
eim.unregisterPlayer(player);
|
|
}
|
|
}
|
|
|
|
function leftParty (eim, player) {}
|
|
|
|
function disbandParty (eim) {}
|
|
|
|
function monsterValue(eim, mobId) {
|
|
return 1;
|
|
}
|
|
|
|
function playerUnregistered(eim, player) {}
|
|
|
|
function playerExit(eim, player) {
|
|
eim.unregisterPlayer(player);
|
|
player.changeMap(exitMap, 0);
|
|
}
|
|
|
|
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 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();
|
|
|
|
eim.dispatchRaiseQuestMobCount(8810018, 240060200);
|
|
mob.getMap().broadcastHorntailVictory();
|
|
} else if(isHorntailHead(mob)) {
|
|
var killed = eim.getIntProperty("defeatedHead");
|
|
eim.setIntProperty("defeatedHead", killed + 1);
|
|
eim.showClearEffect(mob.getMap().getId());
|
|
}
|
|
}
|
|
|
|
function allMonstersDead(eim) {}
|
|
|
|
function cancelSchedule() {}
|
|
|
|
function dispose(eim) {}
|