KerningPQ + some boosts on PQ/event scripting
Added cleaner mechanics for dealing with PQs and events (bonus Exp when clearing a stage, for instance). Reimplemented KerningPQ.
This commit is contained in:
+16
-1
@@ -185,4 +185,19 @@ Corre
|
|||||||
|
|
||||||
29 Abril 2017,
|
29 Abril 2017,
|
||||||
Novos métodos para uso especializado em eventos caracteristicos de PQ.
|
Novos métodos para uso especializado em eventos caracteristicos de PQ.
|
||||||
Aprimoração da Boss Rush PQ: novo sistema de recompensas.
|
Aprimoração da Boss Rush PQ: novo sistema de recompensas.
|
||||||
|
|
||||||
|
01 Maio 2017,
|
||||||
|
Correção de bugs menores na BRPQ.
|
||||||
|
Refatoração de código pertinente aos Cash USEs para Pet.
|
||||||
|
Animação para Pets ao consumirem pet food.
|
||||||
|
|
||||||
|
02 Maio 2017,
|
||||||
|
Reestruturação e refatoração de código para PQs (funções específicas para uso em PQs).
|
||||||
|
Reimplementação da Kerning PQ.
|
||||||
|
|
||||||
|
03 Maio 2017,
|
||||||
|
Para quests que podem ser repetidas, adição de mensagem mencionando o tempo restante para recomeçá-la.
|
||||||
|
|
||||||
|
04 - 05 Maio 2017,
|
||||||
|
Finalização da reimplementação da Kerning PQ, com adição de novos mecanismos esperados em eventos/PQs.
|
||||||
@@ -3,30 +3,14 @@
|
|||||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
<group>
|
<group>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/kpq3.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MonsterBook.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/kpq4.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/raid_stage.js</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/kpq1.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/AbstractPlayerInteraction.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/9020001.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/1022101.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/1012103.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/9000038.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/raid_rest.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleDisease.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/BossRushPQ.js</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/kpq2.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/QuestActionHandler.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/KerningPQ.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java</file>
|
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/kpq0.js</file>
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/world0/9000037.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/raidout.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/PiratePQ.js</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventManager.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/quest/MapleQuest.java</file>
|
|
||||||
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/quest/requirements/MonsterBookCountRequirement.java</file>
|
|
||||||
</group>
|
</group>
|
||||||
</open-files>
|
</open-files>
|
||||||
</project-private>
|
</project-private>
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function disbandParty(eim, player) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearPQ(eim) {
|
function clearPQ(eim) {
|
||||||
// Happens when the function EventInstanceManager.finishPQ() is invoked by NPC/Reactor script
|
// Happens when the function EventInstanceManager.clearPQ() is invoked by NPC/Reactor script
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePlayer(eim, player) {
|
function removePlayer(eim, player) {
|
||||||
|
|||||||
+27
-37
@@ -69,9 +69,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
|
|||||||
function setup(level, leaderid) {
|
function setup(level, leaderid) {
|
||||||
em.setProperty("state", "1");
|
em.setProperty("state", "1");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
|
|
||||||
var eim = em.newInstance("BossRush" + leaderid);
|
var eim = em.newInstance("BossRush" + leaderid);
|
||||||
|
eim.setProperty("level", level);
|
||||||
em.setProperty("level", level);
|
|
||||||
eim.startEventTimer(45 * 60000); //45 mins
|
eim.startEventTimer(45 * 60000); //45 mins
|
||||||
setEventRewards(eim);
|
setEventRewards(eim);
|
||||||
return eim;
|
return eim;
|
||||||
@@ -93,8 +94,7 @@ function playerExit(eim, player) {
|
|||||||
|
|
||||||
function changedMap(eim, player, mapid) {
|
function changedMap(eim, player, mapid) {
|
||||||
if (mapid < 970030001 || mapid > 970042711) {
|
if (mapid < 970030001 || mapid > 970042711) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
if (eim.isLeader(player) || party.size() <= minPlayers) {
|
|
||||||
eim.unregisterPlayer(player);
|
eim.unregisterPlayer(player);
|
||||||
end(eim);
|
end(eim);
|
||||||
}
|
}
|
||||||
@@ -106,8 +106,7 @@ function changedMap(eim, player, mapid) {
|
|||||||
function playerDead(eim, player) {}
|
function playerDead(eim, player) {}
|
||||||
|
|
||||||
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
if (eim.isLeader(player) || party.size() <= minPlayers) {
|
|
||||||
eim.unregisterPlayer(player);
|
eim.unregisterPlayer(player);
|
||||||
end(eim);
|
end(eim);
|
||||||
}
|
}
|
||||||
@@ -117,16 +116,14 @@ function playerRevive(eim, player) { // player presses ok on the death pop up.
|
|||||||
|
|
||||||
|
|
||||||
function playerDisconnected(eim, player) {
|
function playerDisconnected(eim, player) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(true, minPlayers, player))
|
||||||
if (eim.isLeader(player) || party.size() <= minPlayers)
|
|
||||||
end(eim);
|
end(eim);
|
||||||
else
|
else
|
||||||
playerExit(eim, player);
|
playerExit(eim, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
function leftParty(eim, player) {
|
function leftParty(eim, player) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(false, minPlayers, player))
|
||||||
if (party.size() <= minPlayers)
|
|
||||||
end(eim);
|
end(eim);
|
||||||
else
|
else
|
||||||
playerExit(eim, player);
|
playerExit(eim, player);
|
||||||
@@ -137,35 +134,33 @@ function disbandParty(eim) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function monsterValue(eim, mobId) {
|
function monsterValue(eim, mobId) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function end(eim) {
|
function end(eim) {
|
||||||
var party = eim.getPlayers();
|
var party = eim.getPlayers();
|
||||||
for (var i = 0; i < party.size(); i++) {
|
for (var i = 0; i < party.size(); i++) {
|
||||||
playerExit(eim, party.get(i));
|
playerExit(eim, party.get(i));
|
||||||
}
|
}
|
||||||
eim.dispose();
|
eim.dispose();
|
||||||
|
|
||||||
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerClear(eim, player, toMap) {
|
function clearPQ(eim) {
|
||||||
eim.unregisterPlayer(player);
|
eim.stopEventTimer();
|
||||||
}
|
eim.setEventCleared(); // from now on event just finishes when ALL players gets out of the range defined inside changedMap function.
|
||||||
|
|
||||||
function complete(eim, toMap) {
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
var party = eim.getPlayers();
|
|
||||||
for (var i = 0; i < party.size(); i++) {
|
|
||||||
playerClear(eim, party.get(i), toMap);
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearPQ(eim, toMap) {
|
|
||||||
complete(eim, toMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function giveRandomEventReward(eim, player) {
|
function giveRandomEventReward(eim, player) {
|
||||||
eim.giveEventReward(player);
|
eim.giveEventReward(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
function reopenEvent() {
|
||||||
|
em.setProperty("state", "0");
|
||||||
|
em.setProperty("leader", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterKilled(mob, eim) {}
|
function monsterKilled(mob, eim) {}
|
||||||
@@ -174,9 +169,4 @@ function allMonstersDead(eim) {}
|
|||||||
|
|
||||||
function cancelSchedule() {}
|
function cancelSchedule() {}
|
||||||
|
|
||||||
function dispose(eim) {
|
function dispose(eim) {}
|
||||||
em.cancelSchedule();
|
|
||||||
|
|
||||||
em.setProperty("state", "0");
|
|
||||||
em.setProperty("leader", "true");
|
|
||||||
}
|
|
||||||
|
|||||||
+53
-76
@@ -1,6 +1,6 @@
|
|||||||
var isPq = true;
|
var isPq = true;
|
||||||
var minPlayers = 4, maxPlayers = 6;
|
var minPlayers = 1, maxPlayers = 6;
|
||||||
var minLevel = 44, maxLevel = 55;
|
var minLevel = 1, maxLevel = 200;
|
||||||
var entryMap = 930000000;
|
var entryMap = 930000000;
|
||||||
var exitMap = 930000800;
|
var exitMap = 930000800;
|
||||||
var recruitMap = 300030100;
|
var recruitMap = 300030100;
|
||||||
@@ -35,8 +35,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
|
|||||||
function setup(level, leaderid) {
|
function setup(level, leaderid) {
|
||||||
em.setProperty("state", "1");
|
em.setProperty("state", "1");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
|
|
||||||
var eim = em.newInstance("Ellin" + leaderid);
|
var eim = em.newInstance("Ellin" + leaderid);
|
||||||
|
eim.setProperty("level", level);
|
||||||
|
|
||||||
eim.setInstanceMap(930000000).resetPQ(level);
|
eim.setInstanceMap(930000000).resetPQ(level);
|
||||||
eim.setInstanceMap(930000100).resetPQ(level);
|
eim.setInstanceMap(930000100).resetPQ(level);
|
||||||
eim.setInstanceMap(930000200).resetPQ(level);
|
eim.setInstanceMap(930000200).resetPQ(level);
|
||||||
@@ -55,109 +57,89 @@ function setup(level, leaderid) {
|
|||||||
|
|
||||||
function respawnStg2(eim) {
|
function respawnStg2(eim) {
|
||||||
if(!eim.getMapInstance(930000200).getAllPlayer().isEmpty()) eim.getMapInstance(930000200).instanceMapRespawn();
|
if(!eim.getMapInstance(930000200).getAllPlayer().isEmpty()) eim.getMapInstance(930000200).instanceMapRespawn();
|
||||||
em.schedule("respawnStg2", eim, 4 * 1000);
|
eim.schedule("respawnStg2", 4 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changedMap(eim, player, mapid) {
|
function changedMap(eim, player, mapid) {
|
||||||
if (mapid < 930000000 || mapid > 930000800) {
|
if (mapid < 930000000 || mapid > 930000800) {
|
||||||
eim.unregisterPlayer(player);
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
if(eim.getPlayers().isEmpty()) end(eim);
|
eim.unregisterPlayer(player);
|
||||||
}
|
end(eim);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
eim.unregisterPlayer(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerEntry(eim, player) {
|
function playerEntry(eim, player) {
|
||||||
var map = eim.getMapInstance(entryMap);
|
var map = eim.getMapInstance(entryMap);
|
||||||
player.changeMap(map, map.getPortal(0));
|
player.changeMap(map, map.getPortal(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
function scheduledTimeout(eim) {
|
function scheduledTimeout(eim) {
|
||||||
end(eim);
|
end(eim);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePlayer(eim, player) {
|
function playerExit(eim, player) {
|
||||||
eim.unregisterPlayer(player);
|
eim.unregisterPlayer(player);
|
||||||
player.changeMap(exitMap, 0);
|
player.changeMap(exitMap, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerDead(eim, player) {}
|
function playerDead(eim, player) {}
|
||||||
|
|
||||||
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
||||||
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
var party = eim.getPlayers();
|
eim.unregisterPlayer(player);
|
||||||
for (var i = 0; i < party.size(); i++)
|
end(eim);
|
||||||
playerExit(eim, party.get(i));
|
}
|
||||||
eim.dispose();
|
else
|
||||||
} else
|
eim.unregisterPlayer(player);
|
||||||
playerExit(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function playerDisconnected(eim, player) {
|
function playerDisconnected(eim, player) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(true, minPlayers, player))
|
||||||
if (eim.isLeader(player) || party.size() < minPlayers) {
|
end(eim);
|
||||||
var party = eim.getPlayers();
|
else
|
||||||
for (var i = 0; i < party.size(); i++)
|
playerExit(eim, player);
|
||||||
if (party.get(i).equals(player))
|
|
||||||
removePlayer(eim, player);
|
|
||||||
else
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
removePlayer(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function leftParty(eim, player) {
|
function leftParty(eim, player) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(false, minPlayers, player))
|
||||||
if (party.size() < minPlayers) {
|
end(eim);
|
||||||
for (var i = 0; i < party.size(); i++)
|
else
|
||||||
playerExit(eim,party.get(i));
|
playerExit(eim, player);
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
playerExit(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disbandParty(eim) {
|
function disbandParty(eim) {
|
||||||
var party = eim.getPlayers();
|
end(eim);
|
||||||
for (var i = 0; i < party.size(); i++) {
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
function playerExit(eim, player) {
|
|
||||||
eim.unregisterPlayer(player);
|
|
||||||
player.changeMap(exitMap, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterValue(eim, mobId) {
|
function monsterValue(eim, mobId) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function end(eim) {
|
function end(eim) {
|
||||||
var party = eim.getPlayers();
|
var party = eim.getPlayers();
|
||||||
for (var i = 0; i < party.size(); i++) {
|
for (var i = 0; i < party.size(); i++) {
|
||||||
playerExit(eim, party.get(i));
|
playerExit(eim, party.get(i));
|
||||||
}
|
}
|
||||||
eim.dispose();
|
eim.dispose();
|
||||||
|
|
||||||
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerClear(eim, player, toMap) {
|
function clearPQ(eim) {
|
||||||
eim.unregisterPlayer(player);
|
eim.stopEventTimer();
|
||||||
|
eim.setEventCleared();
|
||||||
if(toMap != null) player.changeMap(toMap);
|
eim.warpEventTeam(toMap);
|
||||||
else player.changeMap(clearMap, 0);
|
|
||||||
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
}
|
}
|
||||||
|
|
||||||
function complete(eim, toMap) {
|
function reopenEvent() {
|
||||||
var party = eim.getPlayers();
|
em.setProperty("state", "0");
|
||||||
for (var i = 0; i < party.size(); i++) {
|
em.setProperty("leader", "true");
|
||||||
playerClear(eim, party.get(i), toMap);
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearPQ(eim, toMap) {
|
|
||||||
complete(eim, toMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterKilled(mob, eim) {}
|
function monsterKilled(mob, eim) {}
|
||||||
@@ -166,9 +148,4 @@ function allMonstersDead(eim) {}
|
|||||||
|
|
||||||
function cancelSchedule() {}
|
function cancelSchedule() {}
|
||||||
|
|
||||||
function dispose(eim) {
|
function dispose(eim) {}
|
||||||
em.cancelSchedule();
|
|
||||||
|
|
||||||
em.setProperty("state", "0");
|
|
||||||
em.setProperty("leader", "true");
|
|
||||||
}
|
|
||||||
|
|||||||
+129
-134
@@ -1,140 +1,153 @@
|
|||||||
/*
|
var isPq = true;
|
||||||
* This file is part of the OdinMS Maple Story Server
|
var minPlayers = 1, maxPlayers = 6;
|
||||||
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
var minLevel = 1, maxLevel = 200;
|
||||||
Matthias Butz <matze@odinms.de>
|
var entryMap = 103000800;
|
||||||
Jan Christian Meyer <vimes@odinms.de>
|
var exitMap = 103000890;
|
||||||
|
var recruitMap = 103000000;
|
||||||
|
var clearMap = 103000805;
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
function init() {
|
||||||
it under the terms of the GNU Affero General Public License version 3
|
em.setProperty("state", "0");
|
||||||
as published by the Free Software Foundation. You may not use, modify
|
em.setProperty("leader", "true");
|
||||||
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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300001,4001007,5);
|
|
||||||
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300000,4001008,1);
|
|
||||||
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300002,4001008,1);
|
|
||||||
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300003,4001008,1);
|
|
||||||
*/
|
|
||||||
|
|
||||||
importPackage(Packages.world);
|
|
||||||
var exitMap;
|
|
||||||
var minPlayers = 3;
|
|
||||||
|
|
||||||
function init() { // Initial loading.
|
|
||||||
exitMap = em.getChannelServer().getMapFactory().getMap(103000890);
|
|
||||||
em.setProperty("KPQOpen", "true"); // allows entrance.
|
|
||||||
em.setProperty("shuffleReactors", "true");
|
|
||||||
instanceId = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setEventRewards(eim) {
|
||||||
|
var itemSet, itemQty, evLevel, expStages;
|
||||||
|
|
||||||
|
evLevel = 1; //Rewards at clear PQ
|
||||||
function monsterValue(eim, mobId) { // Killed monster.
|
itemSet = [2040505, 2040514, 2040502, 2040002, 2040602, 2040402, 2040802, 1032009, 1032004, 1032005, 1032006, 1032007, 1032010, 1032002, 1002026, 1002089, 1002090, 2000003, 2000001, 2000002, 2000006, 2022003, 2022000, 2000004, 4003000, 4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007, 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008];
|
||||||
return 1; // returns an amount to add onto kill count.
|
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 80, 80, 80, 50, 5, 15, 15, 30, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3, 3];
|
||||||
|
eim.setEventRewards(evLevel, itemSet, itemQty);
|
||||||
|
|
||||||
|
expStages = [100, 200, 400, 800, 1500]; //bonus exp given on CLEAR stage signal
|
||||||
|
eim.setEventClearStageExp(expStages);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup() { // Invoked from "EventManager.startInstance()"
|
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
|
||||||
var eim = em.newInstance("KerningPQ"); // adds a new instance and returns EventInstanceManager.
|
var eligible = [];
|
||||||
var eventTime = 30 * (1000 * 60); // 30 mins.
|
var hasLeader = false;
|
||||||
var firstPortal = eim.getMapInstance(103000800).getPortal("next00");
|
|
||||||
respawn(eim);
|
if(party.size() > 0) {
|
||||||
firstPortal.setScriptName("kpq0");
|
var partyList = party.toArray();
|
||||||
em.schedule("timeOut", eim, eventTime); // invokes "timeOut" in how ever many seconds.
|
|
||||||
eim.startEventTimer(eventTime); // Sends a clock packet and tags a timer to the players.
|
for(var i = 0; i < party.size(); i++) {
|
||||||
return eim; // returns the new instance.
|
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 playerEntry(eim, player) { // this gets looped for every player in the party.
|
function setup(level, leaderid) {
|
||||||
var map = eim.getMapInstance(103000800);
|
em.setProperty("state", "1");
|
||||||
player.changeMap(map, map.getPortal(0)); // We're now in KPQ :D
|
em.setProperty("leader", "true");
|
||||||
|
|
||||||
|
var eim = em.newInstance("Kerning" + leaderid);
|
||||||
|
eim.setProperty("level", level);
|
||||||
|
|
||||||
|
respawnStg1(eim);
|
||||||
|
eim.startEventTimer(30 * 60000); //30 mins
|
||||||
|
setEventRewards(eim);
|
||||||
|
return eim;
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerDead(eim, player) {
|
function respawnStg1(eim) {
|
||||||
|
eim.getMapInstance(103000800).instanceMapRespawn();
|
||||||
|
eim.schedule("respawnStg1", 10 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
function playerEntry(eim, player) {
|
||||||
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
|
var map = eim.getMapInstance(entryMap);
|
||||||
var party = eim.getPlayers();
|
player.changeMap(map, map.getPortal(0));
|
||||||
for (var i = 0; i < party.size(); i++)
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
playerExit(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function scheduledTimeout(eim) {
|
||||||
function respawn(eim) {
|
end(eim);
|
||||||
var map = eim.getMapInstance(103000800);
|
|
||||||
var map2 = eim.getMapInstance(103000805);
|
|
||||||
if (map.getSummonState()) { //Map spawns are set to true by default
|
|
||||||
map.instanceMapRespawn();
|
|
||||||
}
|
|
||||||
if(map2.getSummonState()) {
|
|
||||||
map2.instanceMapRespawn();
|
|
||||||
}
|
|
||||||
eim.schedule("respawn", 10000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function playerDisconnected(eim, player) {
|
|
||||||
var party = eim.getPlayers();
|
|
||||||
if (eim.isLeader(player) || party.size() < minPlayers) {
|
|
||||||
var party = eim.getPlayers();
|
|
||||||
for (var i = 0; i < party.size(); i++)
|
|
||||||
if (party.get(i).equals(player))
|
|
||||||
removePlayer(eim, player);
|
|
||||||
else
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
removePlayer(eim, player);
|
|
||||||
}
|
|
||||||
|
|
||||||
function leftParty(eim, player) {
|
|
||||||
var party = eim.getPlayers();
|
|
||||||
if (party.size() < minPlayers) {
|
|
||||||
for (var i = 0; i < party.size(); i++)
|
|
||||||
playerExit(eim,party.get(i));
|
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
playerExit(eim, player);
|
|
||||||
}
|
|
||||||
|
|
||||||
function disbandParty(eim) {
|
|
||||||
var party = eim.getPlayers();
|
|
||||||
for (var i = 0; i < party.size(); i++) {
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerExit(eim, player) {
|
function playerExit(eim, player) {
|
||||||
eim.unregisterPlayer(player);
|
eim.unregisterPlayer(player);
|
||||||
player.changeMap(exitMap, exitMap.getPortal(0));
|
player.changeMap(exitMap, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePlayer(eim, player) {
|
function changedMap(eim, player, mapid) {
|
||||||
eim.unregisterPlayer(player);
|
if (mapid < 103000800 || mapid > 103000805) {
|
||||||
player.getMap().removePlayer(player);
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
player.setMap(exitMap);
|
eim.unregisterPlayer(player);
|
||||||
|
end(eim);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
eim.unregisterPlayer(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
|
}
|
||||||
|
|
||||||
|
function giveRandomEventReward(eim, player) {
|
||||||
|
eim.giveEventReward(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearPQ(eim) {
|
function clearPQ(eim) {
|
||||||
var party = eim.getPlayers();
|
eim.stopEventTimer();
|
||||||
for (var i = 0; i < party.size(); i++)
|
eim.setEventCleared();
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
eim.dispose();
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
|
}
|
||||||
|
|
||||||
|
function reopenEvent() {
|
||||||
|
em.setProperty("state", "0");
|
||||||
|
em.setProperty("leader", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterKilled(mob, eim) {}
|
function monsterKilled(mob, eim) {}
|
||||||
@@ -143,22 +156,4 @@ function allMonstersDead(eim) {}
|
|||||||
|
|
||||||
function cancelSchedule() {}
|
function cancelSchedule() {}
|
||||||
|
|
||||||
function dispose(eim) {
|
function dispose(eim) {}
|
||||||
em.cancelSchedule();
|
|
||||||
em.schedule("OpenKPQ", 10000); // 10 seconds ?
|
|
||||||
}
|
|
||||||
|
|
||||||
function OpenKPQ() {
|
|
||||||
em.setProperty("KPQOpen", "true");
|
|
||||||
}
|
|
||||||
|
|
||||||
function timeOut(eim) {
|
|
||||||
if (eim != null) {
|
|
||||||
if (eim.getPlayerCount() > 0) {
|
|
||||||
var pIter = eim.getPlayers().iterator();
|
|
||||||
while (pIter.hasNext())
|
|
||||||
playerExit(eim, pIter.next());
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+58
-85
@@ -1,6 +1,6 @@
|
|||||||
var isPq = true;
|
var isPq = true;
|
||||||
var minPlayers = 3, maxPlayers = 6;
|
var minPlayers = 1, maxPlayers = 6;
|
||||||
var minLevel = 55, maxLevel = 100;
|
var minLevel = 1, maxLevel = 200;
|
||||||
var entryMap = 925100000;
|
var entryMap = 925100000;
|
||||||
var exitMap = 925100700;
|
var exitMap = 925100700;
|
||||||
var recruitMap = 251010404;
|
var recruitMap = 251010404;
|
||||||
@@ -35,7 +35,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
|
|||||||
function setup(level, leaderid) {
|
function setup(level, leaderid) {
|
||||||
em.setProperty("state", "1");
|
em.setProperty("state", "1");
|
||||||
em.setProperty("leader", "true");
|
em.setProperty("leader", "true");
|
||||||
|
|
||||||
var eim = em.newInstance("Pirate" + leaderid);
|
var eim = em.newInstance("Pirate" + leaderid);
|
||||||
|
eim.setProperty("level", level);
|
||||||
|
|
||||||
em.setProperty("stage2", "0");
|
em.setProperty("stage2", "0");
|
||||||
em.setProperty("stage2a", "0");
|
em.setProperty("stage2a", "0");
|
||||||
em.setProperty("stage3a", "0");
|
em.setProperty("stage3a", "0");
|
||||||
@@ -43,7 +46,7 @@ function setup(level, leaderid) {
|
|||||||
em.setProperty("stage3b", "0");
|
em.setProperty("stage3b", "0");
|
||||||
em.setProperty("stage4", "0");
|
em.setProperty("stage4", "0");
|
||||||
em.setProperty("stage5", "0");
|
em.setProperty("stage5", "0");
|
||||||
em.setProperty("level", level);
|
|
||||||
em.setProperty("openedChests", "0");
|
em.setProperty("openedChests", "0");
|
||||||
eim.setInstanceMap(925100000).resetPQ(level);
|
eim.setInstanceMap(925100000).resetPQ(level);
|
||||||
eim.setInstanceMap(925100000).shuffleReactors();
|
eim.setInstanceMap(925100000).shuffleReactors();
|
||||||
@@ -125,111 +128,91 @@ function setup(level, leaderid) {
|
|||||||
return eim;
|
return eim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function respawnStg4(eim) {
|
||||||
|
eim.getMapInstance(925100400).instanceMapRespawn();
|
||||||
|
eim.schedule("respawnStg4", 10 * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
function playerEntry(eim, player) {
|
function playerEntry(eim, player) {
|
||||||
var map = eim.getMapInstance(entryMap);
|
var map = eim.getMapInstance(entryMap);
|
||||||
player.changeMap(map, map.getPortal(0));
|
player.changeMap(map, map.getPortal(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
function scheduledTimeout(eim) {
|
function scheduledTimeout(eim) {
|
||||||
end(eim);
|
end(eim);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePlayer(eim, player) {
|
function playerExit(eim, player) {
|
||||||
eim.unregisterPlayer(player);
|
eim.unregisterPlayer(player);
|
||||||
player.changeMap(exitMap, 0);
|
player.changeMap(exitMap, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changedMap(eim, player, mapid) {
|
function changedMap(eim, player, mapid) {
|
||||||
if (mapid < 925100000 || mapid > 925100500) {
|
if (mapid < 925100000 || mapid > 925100500) {
|
||||||
eim.unregisterPlayer(player);
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
|
eim.unregisterPlayer(player);
|
||||||
if (eim.disposeIfPlayerBelow(minPlayers, exitMap)) {
|
end(eim);
|
||||||
em.setProperty("state", "0");
|
}
|
||||||
em.setProperty("leader", "true");
|
else
|
||||||
}
|
eim.unregisterPlayer(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerDead(eim, player) {}
|
function playerDead(eim, player) {}
|
||||||
|
|
||||||
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
function playerRevive(eim, player) { // player presses ok on the death pop up.
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
||||||
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
|
eim.unregisterPlayer(player);
|
||||||
var party = eim.getPlayers();
|
end(eim);
|
||||||
for (var i = 0; i < party.size(); i++)
|
}
|
||||||
playerExit(eim, party.get(i));
|
else
|
||||||
eim.dispose();
|
eim.unregisterPlayer(player);
|
||||||
} else
|
|
||||||
playerExit(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function playerDisconnected(eim, player) {
|
function playerDisconnected(eim, player) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(true, minPlayers, player))
|
||||||
if (eim.isLeader(player) || party.size() < minPlayers) {
|
end(eim);
|
||||||
var party = eim.getPlayers();
|
else
|
||||||
for (var i = 0; i < party.size(); i++)
|
playerExit(eim, player);
|
||||||
if (party.get(i).equals(player))
|
|
||||||
removePlayer(eim, player);
|
|
||||||
else
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
removePlayer(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function leftParty(eim, player) {
|
function leftParty(eim, player) {
|
||||||
var party = eim.getPlayers();
|
if (eim.isEventTeamLackingNow(false, minPlayers, player))
|
||||||
if (party.size() < minPlayers) {
|
end(eim);
|
||||||
for (var i = 0; i < party.size(); i++)
|
else
|
||||||
playerExit(eim,party.get(i));
|
playerExit(eim, player);
|
||||||
eim.dispose();
|
|
||||||
} else
|
|
||||||
playerExit(eim, player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disbandParty(eim) {
|
function disbandParty(eim) {
|
||||||
var party = eim.getPlayers();
|
end(eim);
|
||||||
for (var i = 0; i < party.size(); i++) {
|
|
||||||
playerExit(eim, party.get(i));
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
function playerExit(eim, player) {
|
|
||||||
eim.unregisterPlayer(player);
|
|
||||||
player.changeMap(exitMap, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterValue(eim, mobId) {
|
function monsterValue(eim, mobId) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function end(eim) {
|
function end(eim) {
|
||||||
var party = eim.getPlayers();
|
var party = eim.getPlayers();
|
||||||
for (var i = 0; i < party.size(); i++) {
|
for (var i = 0; i < party.size(); i++) {
|
||||||
playerExit(eim, party.get(i));
|
playerExit(eim, party.get(i));
|
||||||
}
|
}
|
||||||
eim.dispose();
|
eim.dispose();
|
||||||
|
|
||||||
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
}
|
}
|
||||||
|
|
||||||
function playerClear(eim, player, toMap) {
|
function clearPQ(eim) {
|
||||||
eim.unregisterPlayer(player);
|
eim.stopEventTimer();
|
||||||
|
eim.setEventCleared();
|
||||||
if(toMap != null) player.changeMap(toMap);
|
eim.warpEventTeam(toMap);
|
||||||
else player.changeMap(clearMap, 0);
|
|
||||||
|
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
|
||||||
}
|
}
|
||||||
|
|
||||||
function complete(eim, toMap) {
|
function reopenEvent() {
|
||||||
var party = eim.getPlayers();
|
em.setProperty("state", "0");
|
||||||
for (var i = 0; i < party.size(); i++) {
|
em.setProperty("leader", "true");
|
||||||
playerClear(eim, party.get(i), toMap);
|
|
||||||
}
|
|
||||||
eim.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearPQ(eim, toMap) {
|
|
||||||
complete(eim, toMap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function monsterKilled(mob, eim) {}
|
function monsterKilled(mob, eim) {}
|
||||||
@@ -238,14 +221,4 @@ function allMonstersDead(eim) {}
|
|||||||
|
|
||||||
function cancelSchedule() {}
|
function cancelSchedule() {}
|
||||||
|
|
||||||
function respawnStg4(eim) {
|
function dispose(eim) {}
|
||||||
eim.getMapInstance(925100400).instanceMapRespawn();
|
|
||||||
em.schedule("respawnStg4", eim, 10 * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
function dispose(eim) {
|
|
||||||
em.cancelSchedule();
|
|
||||||
|
|
||||||
em.setProperty("state", "0");
|
|
||||||
em.setProperty("leader", "true");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -94,7 +94,11 @@ function action(mode, type, selection) {
|
|||||||
if (prop == null || prop.equals("0")) { //Start the PQ
|
if (prop == null || prop.equals("0")) { //Start the PQ
|
||||||
cm.removeHPQItems();
|
cm.removeHPQItems();
|
||||||
em.setProperty("latestLeader", cm.getPlayer().getName());
|
em.setProperty("latestLeader", cm.getPlayer().getName());
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function action(mode, type, selection) {
|
|||||||
status++;
|
status++;
|
||||||
if (status == 51) {
|
if (status == 51) {
|
||||||
var eim = cm.getEventManager("HenesysPQ").getInstance("HenesysPQ_" + cm.getParty().getLeader().getName());
|
var eim = cm.getEventManager("HenesysPQ").getInstance("HenesysPQ_" + cm.getParty().getLeader().getName());
|
||||||
eim.finishPQ();
|
eim.clearPQ();
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ function action(mode, type, selection) {
|
|||||||
cm.sendNextPrev("When the flowers of primrose blooms, the full moon will rise, and that's when the Moon Bunnies will appear and start pounding the mill. Your task is to fight off the monsters to make sure that Moon Bunny can concentrate on making the best rice cake possible.");
|
cm.sendNextPrev("When the flowers of primrose blooms, the full moon will rise, and that's when the Moon Bunnies will appear and start pounding the mill. Your task is to fight off the monsters to make sure that Moon Bunny can concentrate on making the best rice cake possible.");
|
||||||
} else if (chosen == 1) {
|
} else if (chosen == 1) {
|
||||||
var eim = cm.getEventManager("HenesysPQ").getInstance("HenesysPQ_" + cm.getParty().getLeader().getName());
|
var eim = cm.getEventManager("HenesysPQ").getInstance("HenesysPQ_" + cm.getParty().getLeader().getName());
|
||||||
eim.finishPQ();
|
eim.clearPQ();
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (status == 4) {
|
} else if (status == 4) {
|
||||||
|
|||||||
@@ -22,7 +22,9 @@ function start() {
|
|||||||
} else if (em.getProperty("started").equals("true")) {
|
} else if (em.getProperty("started").equals("true")) {
|
||||||
cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world." );
|
cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world." );
|
||||||
} else {
|
} else {
|
||||||
em.startInstance(cm.getParty(), cm.getMap());
|
if(!em.startInstance(cm.getParty(), cm.getMap())) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ function action(mode, type, selection) {
|
|||||||
cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end...");
|
cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end...");
|
||||||
else if (status == 1) {
|
else if (status == 1) {
|
||||||
var eim = cm.getPlayer().getEventInstance();
|
var eim = cm.getPlayer().getEventInstance();
|
||||||
eim.finishPQ();
|
eim.clearPQ();
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (cm.getPlayer().getMapId() == 920011300) {
|
} else if (cm.getPlayer().getMapId() == 920011300) {
|
||||||
|
|||||||
@@ -117,7 +117,11 @@ function action(mode, type, selection) {
|
|||||||
if (em == null) {
|
if (em == null) {
|
||||||
cm.sendOk("This trial is currently under construction.");
|
cm.sendOk("This trial is currently under construction.");
|
||||||
} else {
|
} else {
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
party = cm.getPlayer().getEventInstance().getPlayers();
|
party = cm.getPlayer().getEventInstance().getPlayers();
|
||||||
cm.removeFromParty(4001015, party);
|
cm.removeFromParty(4001015, party);
|
||||||
cm.removeFromParty(4001018, party);
|
cm.removeFromParty(4001018, party);
|
||||||
|
|||||||
@@ -79,7 +79,11 @@ function action(mode, type, selection) {
|
|||||||
cm.sendOk("You may not use that password.");
|
cm.sendOk("You may not use that password.");
|
||||||
else { // start Zakum Battle
|
else { // start Zakum Battle
|
||||||
var eim = em.newInstance("Zakum" + passwd);
|
var eim = em.newInstance("Zakum" + passwd);
|
||||||
em.startInstance(eim,cm.getPlayer().getName());
|
if(!em.startInstance(eim,cm.getPlayer().getName())) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
eim.registerPlayer(cm.getPlayer());
|
eim.registerPlayer(cm.getPlayer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ function action(mode, type, selection) {
|
|||||||
cm.givePartyExp(20000, party);
|
cm.givePartyExp(20000, party);
|
||||||
} else
|
} else
|
||||||
cm.givePartyExp(12000, party);
|
cm.givePartyExp(12000, party);
|
||||||
eim.finishPQ();
|
eim.clearPQ();
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
else if (selectedType == 2) {
|
else if (selectedType == 2) {
|
||||||
|
|||||||
@@ -74,7 +74,11 @@ function action(mode, type, selection) {
|
|||||||
} else {
|
} else {
|
||||||
var prop = em.getProperty("LPQOpen");
|
var prop = em.getProperty("LPQOpen");
|
||||||
if (prop == null || prop.equals("true")) {
|
if (prop == null || prop.equals("true")) {
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
cm.removeAll(4001022);
|
cm.removeAll(4001022);
|
||||||
cm.removeAll(4001023);
|
cm.removeAll(4001023);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
|
|||||||
@@ -85,7 +85,11 @@ function action(mode, type, selection) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Begin the PQ.
|
// Begin the PQ.
|
||||||
em.startInstance(cm.getParty(),cm.getPlayer().getMap());
|
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
|
//force the two scripts on portals in the map
|
||||||
//eim = cm.getPlayer().getEventInstance();
|
//eim = cm.getPlayer().getEventInstance();
|
||||||
var map = eim.getMapInstance(240050100);
|
var map = eim.getMapInstance(240050100);
|
||||||
|
|||||||
@@ -50,7 +50,11 @@ function action(mode, type, selection) {
|
|||||||
if(eli.size() > 0) {
|
if(eli.size() > 0) {
|
||||||
var prop = em.getProperty("state");
|
var prop = em.getProperty("state");
|
||||||
if (prop != null && prop.equals("0")) {
|
if (prop != null && prop.equals("0")) {
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
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.");
|
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.");
|
||||||
|
|||||||
@@ -20,28 +20,32 @@ function action(mode, type, selection) {
|
|||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var em = cm.getEventManager("PiratePQ");
|
|
||||||
if (em == null) {
|
|
||||||
cm.sendNext("The event isn't started...");
|
|
||||||
cm.dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
level = em.getProperty("level");
|
|
||||||
if (!cm.isLeader()) {
|
if (!cm.isLeader()) {
|
||||||
cm.sendNext("I wish for your leader to talk to me.");
|
cm.sendNext("I wish for your leader to talk to me.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var eim = cm.getEventInstance();
|
||||||
|
if (eim == null) {
|
||||||
|
cm.warp(251010404,0);
|
||||||
|
cm.sendNext("How are you even here without being registered on an event?");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
level = eim.getProperty("level");
|
||||||
|
|
||||||
switch(cm.getPlayer().getMapId()) {
|
switch(cm.getPlayer().getMapId()) {
|
||||||
case 925100000:
|
case 925100000:
|
||||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must destroy all the monsters guarding it.");
|
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must destroy all the monsters guarding it.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
break;
|
break;
|
||||||
case 925100100:
|
case 925100100:
|
||||||
var emp = em.getProperty("stage2");
|
var emp = eim.getProperty("stage2");
|
||||||
if (emp == null) {
|
if (emp == null) {
|
||||||
em.setProperty("stage2", "0");
|
eim.setProperty("stage2", "0");
|
||||||
emp = "0";
|
emp = "0";
|
||||||
}
|
}
|
||||||
if (emp.equals("0")) {
|
if (emp.equals("0")) {
|
||||||
@@ -49,7 +53,7 @@ function action(mode, type, selection) {
|
|||||||
cm.sendNext("Excellent! Now hunt me 20 Rising Medals.");
|
cm.sendNext("Excellent! Now hunt me 20 Rising Medals.");
|
||||||
cm.gainItem(4001120,-20);
|
cm.gainItem(4001120,-20);
|
||||||
cm.getMap().killAllMonsters();
|
cm.getMap().killAllMonsters();
|
||||||
em.setProperty("stage2", "1");
|
eim.setProperty("stage2", "1");
|
||||||
} else {
|
} else {
|
||||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals.");
|
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals.");
|
||||||
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300114, level, true);
|
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300114, level, true);
|
||||||
@@ -59,7 +63,7 @@ function action(mode, type, selection) {
|
|||||||
cm.sendNext("Excellent! Now hunt me 20 Veteran Medals.");
|
cm.sendNext("Excellent! Now hunt me 20 Veteran Medals.");
|
||||||
cm.gainItem(4001121,-20);
|
cm.gainItem(4001121,-20);
|
||||||
cm.getMap().killAllMonsters();
|
cm.getMap().killAllMonsters();
|
||||||
em.setProperty("stage2", "2");
|
eim.setProperty("stage2", "2");
|
||||||
} else {
|
} else {
|
||||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals.");
|
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals.");
|
||||||
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300115, level, true);
|
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300115, level, true);
|
||||||
@@ -69,7 +73,7 @@ function action(mode, type, selection) {
|
|||||||
cm.sendNext("Excellent! Now let us go.");
|
cm.sendNext("Excellent! Now let us go.");
|
||||||
cm.gainItem(4001122,-20);
|
cm.gainItem(4001122,-20);
|
||||||
cm.getMap().killAllMonsters();
|
cm.getMap().killAllMonsters();
|
||||||
em.setProperty("stage2", "3");
|
eim.setProperty("stage2", "3");
|
||||||
} else {
|
} else {
|
||||||
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Veteran Medals.");
|
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Veteran Medals.");
|
||||||
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300116, level, true);
|
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300116, level, true);
|
||||||
@@ -87,9 +91,9 @@ function action(mode, type, selection) {
|
|||||||
case 925100201:
|
case 925100201:
|
||||||
if (cm.getMap().getMonsters().size() == 0) {
|
if (cm.getMap().getMonsters().size() == 0) {
|
||||||
cm.sendNext("Excellent.");
|
cm.sendNext("Excellent.");
|
||||||
if (em.getProperty("stage2a") == "0") {
|
if (eim.getProperty("stage2a") == "0") {
|
||||||
cm.getMap().setReactorState();
|
cm.getMap().setReactorState();
|
||||||
em.setProperty("stage2a", "1");
|
eim.setProperty("stage2a", "1");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
|
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
|
||||||
@@ -99,9 +103,9 @@ function action(mode, type, selection) {
|
|||||||
case 925100301:
|
case 925100301:
|
||||||
if (cm.getMap().getMonsters().size() == 0) {
|
if (cm.getMap().getMonsters().size() == 0) {
|
||||||
cm.sendNext("Excellent.");
|
cm.sendNext("Excellent.");
|
||||||
if (em.getProperty("stage3a").equals("0")) {
|
if (eim.getProperty("stage3a").equals("0")) {
|
||||||
cm.getMap().setReactorState();
|
cm.getMap().setReactorState();
|
||||||
em.setProperty("stage3a", "1");
|
eim.setProperty("stage3a", "1");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
|
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
|
||||||
@@ -119,7 +123,8 @@ function action(mode, type, selection) {
|
|||||||
break;
|
break;
|
||||||
case 925100500:
|
case 925100500:
|
||||||
if (cm.getMap().getMonsters().size() == 0) {
|
if (cm.getMap().getMonsters().size() == 0) {
|
||||||
cm.clearPQ(925100600);
|
cm.getEventInstance().clearPQ();
|
||||||
|
cm.getEventInstance().warpEventTeam(925100600);
|
||||||
} else {
|
} else {
|
||||||
cm.sendNext("Defeat all monsters! Even Lord Pirate's minions!");
|
cm.sendNext("Defeat all monsters! Even Lord Pirate's minions!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,11 @@ function action(mode, type, selection) {
|
|||||||
if(eli.size() > 0) {
|
if(eli.size() > 0) {
|
||||||
var prop = em.getProperty("state");
|
var prop = em.getProperty("state");
|
||||||
if (prop != null && prop.equals("0")) {
|
if (prop != null && prop.equals("0")) {
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
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.");
|
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.");
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ function action(mode, type, selection) {
|
|||||||
cm.sendOk("Due to an unknown error, the request for squad has been denied.");
|
cm.sendOk("Due to an unknown error, the request for squad has been denied.");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
} else if (selection == 3) { // get insode
|
} else if (selection == 3) { // get inside
|
||||||
if (cm.getSquad("PinkBean") != null) {
|
if (cm.getSquad("PinkBean") != null) {
|
||||||
var dd = cm.getEventManager("PinkBeanBattle");
|
var dd = cm.getEventManager("PinkBeanBattle");
|
||||||
dd.startInstance(cm.getSquad("PinkBean"), cm.getMap(), 160104);
|
dd.startInstance(cm.getSquad("PinkBean"), cm.getMap(), 160104);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ function action(mode, type, selection) {
|
|||||||
} else if (status == 3) {
|
} else if (status == 3) {
|
||||||
if (cm.haveItem(4031801))
|
if (cm.haveItem(4031801))
|
||||||
cm.gainItem(4031801, -1);
|
cm.gainItem(4031801, -1);
|
||||||
cm.warp(2010000);
|
cm.warp(104000000);
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,18 +41,16 @@ function action(mode, type, selection) {
|
|||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if(state == 3) {
|
if(state == 3) {
|
||||||
|
if(cm.getEventInstance().getProperty("clear") == null) {
|
||||||
|
cm.getEventInstance().clearPQ();
|
||||||
|
cm.getEventInstance().setProperty("clear", "true");
|
||||||
|
}
|
||||||
|
|
||||||
if(cm.isLeader()) {
|
if(cm.isLeader()) {
|
||||||
if(cm.getPlayer().getEventInstance().getPlayerCount() > 1) {
|
cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now I will be handing your reward as you are being transported out...");
|
||||||
cm.sendOk("Now, tell your party I will be warping everyone out and rewarding them as they talk to me. The leader goes last.");
|
}
|
||||||
cm.dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now I will be handing your reward as you are being transported out...");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
cm.sendOk("For #bdefeating all bosses#k in this event, congratulations! Now you will receive a prize that matches your performance here as I warp you out.");
|
cm.sendOk("For #bdefeating all bosses#k in this event, congratulations! You will now receive a prize that matches your performance here as I warp you out.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(state == 2) {
|
else if(state == 2) {
|
||||||
@@ -114,7 +112,11 @@ function action(mode, type, selection) {
|
|||||||
if(eli.size() > 0) {
|
if(eli.size() > 0) {
|
||||||
var prop = em.getProperty("state");
|
var prop = em.getProperty("state");
|
||||||
if (prop != null && prop.equals("0")) {
|
if (prop != null && prop.equals("0")) {
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
} else {
|
} else {
|
||||||
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.");
|
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.");
|
||||||
|
|||||||
@@ -1,89 +1,91 @@
|
|||||||
/*
|
/**
|
||||||
This file is part of the OdinMS Maple Story Server
|
* @author: Ronan
|
||||||
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
* @npc: Lakelis
|
||||||
Matthias Butz <matze@odinms.de>
|
* @map: 103000000 - Kerning City
|
||||||
Jan Christian Meyer <vimes@odinms.de>
|
* @func: Kerning PQ
|
||||||
|
|
||||||
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/>.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
var status = 0;
|
||||||
-- Odin JavaScript --------------------------------------------------------------------------------
|
var minLevel = 1;
|
||||||
Lakelis - Victoria Road: Kerning City (103000000)
|
var maxLevel = 200;
|
||||||
-- By ---------------------------------------------------------------------------------------------
|
var minPartySize = 1;
|
||||||
Stereo
|
var maxPartySize = 6;
|
||||||
-- Version Info -----------------------------------------------------------------------------------
|
var state;
|
||||||
1.0 - First Version by Stereo
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
**/
|
|
||||||
|
|
||||||
var status;
|
|
||||||
var minLevel = 21;
|
|
||||||
var maxLevel = 255;
|
|
||||||
var minPlayers = 1;
|
|
||||||
var maxPlayers = 6;
|
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
status = -1;
|
status = -1;
|
||||||
action(1, 0, 0);
|
state = (cm.getMapId() >= 103000800 && cm.getMapId() <= 103000805) ? 1 : 0;
|
||||||
|
action(1, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function action(mode, type, selection) {
|
function action(mode, type, selection) {
|
||||||
if (mode == 1)
|
if (mode == -1) {
|
||||||
status++;
|
cm.dispose();
|
||||||
else {
|
|
||||||
cm.dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (status == 0) {
|
|
||||||
if (cm.getParty() == null) { // No Party
|
|
||||||
cm.sendOk("How about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.");
|
|
||||||
cm.dispose();
|
|
||||||
} else if (!cm.isLeader()) { // Not Party Leader
|
|
||||||
cm.sendOk("If you want to try the quest, please tell the #bleader of your party#k to talk to me.");
|
|
||||||
cm.dispose();
|
|
||||||
} else {
|
} else {
|
||||||
var party = cm.getParty().getMembers();
|
if (mode == 0 && status == 0) {
|
||||||
var inMap = cm.partyMembersInMap();
|
cm.dispose();
|
||||||
var levelValid = 0;
|
return;
|
||||||
for (var i = 0; i < party.size(); i++) {
|
}
|
||||||
if (party.get(i).getLevel() >= minLevel && party.get(i).getLevel() <= maxLevel)
|
if (mode == 1)
|
||||||
levelValid++;
|
status++;
|
||||||
}
|
else
|
||||||
if (inMap < minPlayers || inMap > maxPlayers) {
|
status--;
|
||||||
cm.sendOk("Your party is not a party of "+minPlayers+". Please make sure all your members are present and qualified to participate in this quest.");
|
|
||||||
cm.dispose();
|
if (status == 0) {
|
||||||
} else if (levelValid != inMap) {
|
if(state == 1) {
|
||||||
cm.sendOk("Please make sure all your members are present and qualified to participate in this quest. This PQ requires players ranging from level "+minLevel+" to level "+maxLevel+". I see #b" + levelValid + "#k members are in the right level range. If this seems wrong, #blog out and log back in,#k or reform the party.");
|
cm.sendYesNo("Do you wish to abandon this area?");
|
||||||
cm.dispose();
|
}
|
||||||
} else {
|
else {
|
||||||
var em = cm.getEventManager("KerningPQ");
|
cm.sendSimple("#b<Party Quest: 1st Accompaniment>#k\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
|
||||||
if (em == null) {
|
}
|
||||||
cm.sendOk("This PQ is currently unavailable.");
|
} else if (status == 1) {
|
||||||
} else if (em.getProperty("KPQOpen").equals("true")) {
|
if(state == 1) {
|
||||||
// Begin the PQ.
|
cm.warp(103000000);
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
|
cm.dispose();
|
||||||
party = cm.getParty();
|
}
|
||||||
cm.removePartyItems(4001008);
|
else {
|
||||||
cm.removePartyItems(4001007);
|
if (selection == 0) {
|
||||||
em.setProperty("KPQOpen" , "false");
|
if (cm.getParty() == null) {
|
||||||
} else {
|
cm.sendOk("You can participate in the party quest only if you are in a party.");
|
||||||
cm.sendNext("There is already another party inside. Please wait !");
|
cm.dispose();
|
||||||
|
} else if(!cm.isLeader()) {
|
||||||
|
cm.sendOk("Your party leader must talk to me to start this party quest.");
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
var em = cm.getEventManager("KerningPQ");
|
||||||
|
if(em == null) {
|
||||||
|
cm.sendOk("The Kerning PQ has encountered an error.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
var eli = em.getEligibleParty(cm.getParty());
|
||||||
|
if(eli.size() > 0) {
|
||||||
|
var prop = em.getProperty("state");
|
||||||
|
if (prop != null && prop.equals("0")) {
|
||||||
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
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.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (selection == 1) {
|
||||||
|
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
cm.sendOk("#b<Party Quest: 1st Accompaniment>#k\r\nYour party must pass through many obstacles and puzzles while traversing the sub-objectives of this Party Quest. Coordinate with your team in order to further advance and defeat the final boss and collect the dropped item in order to access the rewards and bonus stage.");
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+242
-326
@@ -1,4 +1,4 @@
|
|||||||
/*/*
|
/*
|
||||||
This file is part of the OdinMS Maple Story Server
|
This file is part of the OdinMS Maple Story Server
|
||||||
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
||||||
Matthias Butz <matze@odinms.de>
|
Matthias Butz <matze@odinms.de>
|
||||||
@@ -21,31 +21,25 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
-- Odin JavaScript --------------------------------------------------------------------------------
|
* @author: Stereo, Moogra, Ronan
|
||||||
Cloto - Hidden Street : 1st Accompaniment
|
* @npc: Cloto
|
||||||
-- By ---------------------------------------------------------------------------------------------
|
* @map: 1st Accompaniment - KPQ
|
||||||
Stereo
|
* @func: Kerning PQ
|
||||||
-- Version Info -----------------------------------------------------------------------------------
|
*/
|
||||||
1.1 - Second Version by Moogra
|
|
||||||
1.0 - First Version by Stereo
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
**/
|
|
||||||
|
|
||||||
importPackage(Packages.tools);
|
importPackage(Packages.tools);
|
||||||
importPackage(java.awt);
|
importPackage(java.awt);
|
||||||
|
|
||||||
var status;
|
var stage1Questions = Array(
|
||||||
var curMap;
|
"Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as warrior.",
|
||||||
var questions = Array("Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as warrior.",
|
|
||||||
"Here's the question. Collect the same number of coupons as the minimum amount of STR needed to make the first job advancement as a warrior.",
|
"Here's the question. Collect the same number of coupons as the minimum amount of STR needed to make the first job advancement as a warrior.",
|
||||||
"Here's the question. Collect the same number of coupons as the minimum amount of INT needed to make the first job advancement as a magician.",
|
"Here's the question. Collect the same number of coupons as the minimum amount of INT needed to make the first job advancement as a magician.",
|
||||||
"Here's the question. Collect the same number of coupons as the minimum amount of DEX needed to make the first job advancement as a bowman.",
|
"Here's the question. Collect the same number of coupons as the minimum amount of DEX needed to make the first job advancement as a bowman.",
|
||||||
"Here's the question. Collect the same number of coupons as the minimum amount of DEX needed to make the first job advancement as a thief.",
|
"Here's the question. Collect the same number of coupons as the minimum amount of DEX needed to make the first job advancement as a thief.",
|
||||||
"Here's the question. Collect the same number of coupons as the minimum level required to advance to 2nd job.",
|
"Here's the question. Collect the same number of coupons as the minimum level required to advance to 2nd job.",
|
||||||
"Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as a magician.");
|
"Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as a magician.");
|
||||||
var qanswers = Array(10, 35, 20, 25, 25, 30, 8);
|
var stage1Answers = Array(10, 35, 20, 25, 25, 30, 8);
|
||||||
var party;
|
|
||||||
var preamble; // we dont even need this mother fucker ! --
|
|
||||||
var stage2Rects = Array(new Rectangle(-755,-132,4,218),new Rectangle(-721,-340,4,166),new Rectangle(-586,-326,4,150),new Rectangle(-483,-181,4,222));
|
var stage2Rects = Array(new Rectangle(-755,-132,4,218),new Rectangle(-721,-340,4,166),new Rectangle(-586,-326,4,150),new Rectangle(-483,-181,4,222));
|
||||||
var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,140,45),
|
var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,140,45),
|
||||||
new Rectangle(958,-180,140,50),new Rectangle(876,-238,140,45),
|
new Rectangle(958,-180,140,50),new Rectangle(876,-238,140,45),
|
||||||
@@ -53,329 +47,251 @@ var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,14
|
|||||||
var stage4Rects = Array(new Rectangle(910,-236,35,5),new Rectangle(877,-184,35,5),
|
var stage4Rects = Array(new Rectangle(910,-236,35,5),new Rectangle(877,-184,35,5),
|
||||||
new Rectangle(946,-184,35,5),new Rectangle(845,-132,35,5),
|
new Rectangle(946,-184,35,5),new Rectangle(845,-132,35,5),
|
||||||
new Rectangle(910,-132,35,5),new Rectangle(981,-132,35,5));
|
new Rectangle(910,-132,35,5),new Rectangle(981,-132,35,5));
|
||||||
var stage2combos = Array(Array(0,1,1,1),Array(1,0,1,1),Array(1,1,0,1),Array(1,1,1,0));
|
|
||||||
var stage3combos = Array(Array(0,0,1,1,1),Array(0,1,0,1,1),Array(0,1,1,0,1),
|
var stage2Combos = Array(Array(0,1,1,1),Array(1,0,1,1),Array(1,1,0,1),Array(1,1,1,0));
|
||||||
|
var stage3Combos = Array(Array(0,0,1,1,1),Array(0,1,0,1,1),Array(0,1,1,0,1),
|
||||||
Array(0,1,1,1,0),Array(1,0,0,1,1),Array(1,0,1,0,1),
|
Array(0,1,1,1,0),Array(1,0,0,1,1),Array(1,0,1,0,1),
|
||||||
Array(1,0,1,1,0),Array(1,1,0,0,1),Array(1,1,0,1,0),
|
Array(1,0,1,1,0),Array(1,1,0,0,1),Array(1,1,0,1,0),
|
||||||
Array(1,1,1,0,0));
|
Array(1,1,1,0,0));
|
||||||
var stage4combos = Array(Array(0,0,0,1,1,1),Array(0,0,1,0,1,1),Array(0,0,1,1,0,1),
|
var stage4Combos = Array(Array(0,0,0,1,1,1),Array(0,0,1,0,1,1),Array(0,0,1,1,0,1),
|
||||||
Array(0,0,1,1,1,0),Array(0,1,0,0,1,1),Array(0,1,0,1,0,1),
|
Array(0,0,1,1,1,0),Array(0,1,0,0,1,1),Array(0,1,0,1,0,1),
|
||||||
Array(0,1,0,1,1,0),Array(0,1,1,0,0,1),Array(0,1,1,0,1,0),
|
Array(0,1,0,1,1,0),Array(0,1,1,0,0,1),Array(0,1,1,0,1,0),
|
||||||
Array(0,1,1,1,0,0),Array(1,0,0,0,1,1),Array(1,0,0,1,0,1),
|
Array(0,1,1,1,0,0),Array(1,0,0,0,1,1),Array(1,0,0,1,0,1),
|
||||||
Array(1,0,0,1,1,0),Array(1,0,1,0,0,1),Array(1,0,1,0,1,0),
|
Array(1,0,0,1,1,0),Array(1,0,1,0,0,1),Array(1,0,1,0,1,0),
|
||||||
Array(1,0,1,1,0,0),Array(1,1,0,0,0,1),Array(1,1,0,0,1,0),
|
Array(1,0,1,1,0,0),Array(1,1,0,0,0,1),Array(1,1,0,0,1,0),
|
||||||
Array(1,1,0,1,0,0),Array(1,1,1,0,0,0));
|
Array(1,1,0,1,0,0),Array(1,1,1,0,0,0));
|
||||||
var eye = 9300002;
|
|
||||||
var necki = 9300000;
|
function clearStage(stage, eim, curMap) {
|
||||||
var slime = 9300003;
|
eim.setProperty(stage + "stageclear", "true");
|
||||||
var monsterIds = Array(eye, eye, eye, necki, necki, necki, necki, necki, necki, slime);
|
eim.showClearEffect(true);
|
||||||
var prizeIdScroll = Array(2040502, 2040505,// Overall DEX and DEF
|
|
||||||
2040802,// Gloves for DEX
|
eim.linkToNextStage(stage, "kpq", curMap); //opens the portal to the next map
|
||||||
2040002, 2040402, 2040602);// Helmet, Topwear and Bottomwear for DEF
|
}
|
||||||
var prizeIdUse = Array(2000001, 2000002, 2000003, 2000006,// Orange, White and Blue Potions and Mana Elixir
|
|
||||||
2000004, 2022000, 2022003);// Elixir, Pure Water and Unagi
|
function rectangleStages(eim, property, areaCombos, areaRects) {
|
||||||
var prizeQtyUse = Array(80, 80, 80, 50, 5, 15, 15);
|
var c = eim.getProperty(property);
|
||||||
var prizeIdEquip = Array(1032004, 1032005, 1032009,// Level 20-25 Earrings
|
if(c == null) {
|
||||||
1032006, 1032007, 1032010,// Level 30 Earrings
|
c = Math.floor(Math.random() * areaCombos.length);
|
||||||
1032002,// Level 35 Earring
|
eim.setProperty(property, c.toString());
|
||||||
1002026, 1002089, 1002090);// Bamboo Hats
|
}
|
||||||
var prizeIdEtc = Array(4010000, 4010001, 4010002, 4010003,// Mineral Ores
|
else c = parseInt(c);
|
||||||
4010004, 4010005, 4010006,// Mineral Ores
|
|
||||||
4020000, 4020001, 4020002, 4020003,// Jewel Ores
|
// get player placement
|
||||||
4020004, 4020005, 4020006,// Jewel Ores
|
var players = eim.getPlayers();
|
||||||
4020007, 4020008, 4003000); // Diamond and Black Crystal Ores and Screws
|
var playerPlacement = new Array(0, 0, 0, 0, 0, 0);
|
||||||
var prizeQtyEtc = Array(15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3, 3, 30);
|
|
||||||
//500, 1000, 2000, 4000, 7500 = default
|
for(var i = 0; i < eim.getPlayerCount(); i++) {
|
||||||
|
for(var j = 0; j < areaRects.length; j++) {
|
||||||
|
if(areaRects[j].contains(players.get(i).getPosition())) {
|
||||||
|
playerPlacement[j] += 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var curCombo = areaCombos[c];
|
||||||
|
var accept = true;
|
||||||
|
for(var j = 0; j < curCombo.length; j++) {
|
||||||
|
if(curCombo[j] != playerPlacement[j]) {
|
||||||
|
accept = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return accept;
|
||||||
|
}
|
||||||
|
|
||||||
|
var status = -1;
|
||||||
|
var eim;
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
status = -1;
|
action(1, 0, 0);
|
||||||
curMap = cm.getPlayer().getMapId() - 103000799;
|
|
||||||
action(1, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function action(mode, type, selection) {
|
function action(mode, type, selection) {
|
||||||
if (mode == 1) {
|
eim = cm.getEventInstance();
|
||||||
status++;
|
|
||||||
} else if (type == 0 && mode == 0)
|
if (mode == -1) {
|
||||||
status--;
|
|
||||||
else {
|
|
||||||
cm.dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (curMap == 1) { // First Stage.
|
|
||||||
if (isLeader()) {
|
|
||||||
var eim = cm.getPlayer().getEventInstance();
|
|
||||||
party = eim.getPlayers();
|
|
||||||
preamble = eim.getProperty("leader1stpreamble");
|
|
||||||
if (preamble == null) {
|
|
||||||
cm.sendNext("Hello. Welcome to the first stage. Look around and you'll see Ligators wandering around. When you defeat them, they will cough up a #bcoupon#k. Every member of the party other than the leader should talk to me, geta question, and gather up the same number of #bcoupons#k as the answer to the question I'll give to them.\r\nIf you gather up the right amount of #bcoupons#k, I'll give the #bpass#k to that player. Once all the party members other than the leader gather up the #bpasses#k and give them to the leader, the leader will hand over the #bpasses#k to me, clearing the stage in the process. The faster you take care of the stages, the more stages you'll be able to challenge. So I suggest you take care of things quickly and swiftly. Well then, best of luck to you.");
|
|
||||||
eim.setProperty("leader1stpreamble","done");
|
|
||||||
cm.dispose();
|
|
||||||
} else {
|
|
||||||
var complete = eim.getProperty(curMap + "stageclear");
|
|
||||||
if (complete != null) {
|
|
||||||
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
|
||||||
cm.dispose();
|
|
||||||
} else {
|
|
||||||
var numpasses = party.size() - 1; // All the players in the party need to get a pass besides the leader.
|
|
||||||
var strpasses = "#b" + numpasses + " passes#k";
|
|
||||||
if (!cm.haveItem(4001008, numpasses)) {
|
|
||||||
cm.sendNext("I'm sorry, but you are short on the number of passes. You need to give me the right number of passes; it should be the number of members of your party minus the leader, " + strpasses + " to clear the stage. Tell your party members to solve the questions, gather up the passes, and give them to you.");
|
|
||||||
cm.dispose();
|
|
||||||
} else {
|
|
||||||
cm.sendNext("You gathered up " + strpasses + "! Congratulations on clearing the stage! I'll make the portal that sends you to the next stage. There's a time limit on getting there, so please hurry. Best of luck to you all!");
|
|
||||||
clear(1, eim, cm);
|
|
||||||
cm.givePartyExp("KerningPQ1st");
|
|
||||||
cm.gainItem(4001008, -numpasses);
|
|
||||||
cm.dispose();
|
|
||||||
// TODO: Make the shiny thing flash
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else { // Not leader
|
|
||||||
var eim = cm.getPlayer().getEventInstance();
|
|
||||||
pstring = "member1stpreamble" + cm.getPlayer().getId();
|
|
||||||
preamble = eim.getProperty(pstring);
|
|
||||||
if (status == 0) {
|
|
||||||
if (preamble == null) {
|
|
||||||
var qstring = "member1st" + cm.getPlayer().getId();
|
|
||||||
var question = eim.getProperty(qstring);
|
|
||||||
if (question == null) {
|
|
||||||
// Select a random question to ask the player.
|
|
||||||
var questionNum = Math.floor(Math.random() * questions.length);
|
|
||||||
eim.setProperty(qstring, questionNum);
|
|
||||||
}
|
|
||||||
cm.sendNext("Here, you need to collect #bcoupons#k by defeating the same number of Ligators as the answer to the questions asked individually.");
|
|
||||||
} else { // Otherwise, check for stage completed
|
|
||||||
var complete = eim.getProperty(curMap + "stageclear");
|
|
||||||
if (complete != null) { // Strage completed
|
|
||||||
cm.sendNext("Please hurry on to the next stage, the portal is open!");
|
|
||||||
cm.dispose();
|
|
||||||
} else {
|
|
||||||
// Reply to player correct/incorrect response to the question they have been asked
|
|
||||||
var qstring = "member1st" + cm.getPlayer().getId();
|
|
||||||
var qcompletestr = "member1stcom" + cm.getPlayer().getId();
|
|
||||||
var numcoupons = qanswers[parseInt(eim.getProperty(qstring))];
|
|
||||||
var qcorr = cm.itemQuantity(4001007);
|
|
||||||
if(eim.getProperty(qcompletestr) != null) {
|
|
||||||
cm.sendNext("Thanks for bringing me the coupons. Please hand the pass to your party leader to continue.");
|
|
||||||
cm.dispose();
|
|
||||||
} else if (numcoupons == qcorr) {
|
|
||||||
cm.sendNext("That's the right answer! For that you have just received a #bpass#k. Please hand it to the leader of the party.");
|
|
||||||
cm.gainItem(4001007, -numcoupons);
|
|
||||||
cm.gainItem(4001008, 1);
|
|
||||||
eim.setProperty(qcompletestr, "done");
|
|
||||||
cm.dispose();
|
|
||||||
} else
|
|
||||||
cm.sendNext("I'm sorry, but that is not the right answer! Please have the correct number of coupons in your inventory.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (status == 1) {
|
|
||||||
if (preamble == null) {
|
|
||||||
var qstring = "member1st" + cm.getPlayer().getId();
|
|
||||||
var question = parseInt(eim.getProperty(qstring));
|
|
||||||
cm.sendNextPrev(questions[question]);
|
|
||||||
} else {
|
|
||||||
var qstring = "member1st" + cm.getPlayer().getId();
|
|
||||||
var question = parseInt(eim.getProperty(qstring));
|
|
||||||
cm.sendNextPrev(questions[question]);
|
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
} else if (status == 2) { // Preamble completed
|
|
||||||
eim.setProperty(pstring,"done");
|
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
|
||||||
} // End first map scripts
|
|
||||||
}else if (2 <= curMap && 4 >= curMap) {
|
|
||||||
new Rectanglestages(cm);
|
|
||||||
}else if (curMap == 5) { // Final stage
|
|
||||||
var eim = cm.getPlayer().getEventInstance();
|
|
||||||
if (eim.getProperty("5stageclear") == null) { //If no
|
|
||||||
if (isLeader()) { // Leader
|
|
||||||
if (cm.haveItem(4001008, 10)) {
|
|
||||||
// Clear stage
|
|
||||||
cm.sendNext("Here's the portal that leads you to the last, bonus stage. It's a stage that allows you to defeat regular monsters a little easier. You'll be given a set amount of time to hunt as much as possible, but you can always leave the stage in the middle of it through the NPC. Again, congratulations on clearing all the stages. Take care...");
|
|
||||||
party = eim.getPlayers();
|
|
||||||
cm.gainItem(4001008, -10);
|
|
||||||
clear(5, eim, cm);
|
|
||||||
cm.givePartyExp("KerningPQFinal");
|
|
||||||
cm.dispose();
|
|
||||||
} else { // Not done yet
|
|
||||||
cm.sendNext("Hello. Welcome to the 5th and final stage. Walk around the map and you'll be able to find some Boss monsters. Defeat all of them, gather up #bthe passes#k, and please get them to me. Once you earn your pass, the leader of your party will collect them, and then get them to me once the #bpasses#k are gathered up. The monsters may be familiar to you, but they may be much stronger than you think, so please be careful. Good luck!\r\nAs a result of complaints, it is now mandatory to kill all the Slimes! Do it!");
|
|
||||||
}
|
|
||||||
cm.dispose();
|
|
||||||
} else { // Members
|
|
||||||
cm.sendNext("Welcome to the 5th and final stage. Walk around the map and you will be able to find some Boss monsters. Defeat them all, gather up the #bpasses#k, and give them to your leader. Once you are done, return to me to collect your reward.");
|
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
} else { // Give rewards and warp to bonus
|
|
||||||
if (status == 0) {
|
|
||||||
cm.sendNext("Incredible! You cleared all the stages to get to this point. Here's a small prize for your job well done. Before you accept it, however, please make sure your use and etc. inventories have empty slots available.\r\n#bYou will not receive a prize if you have no free slots!#k");
|
|
||||||
} else if (status == 1) {
|
|
||||||
getPrize(eim,cm);
|
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else { // No map found
|
|
||||||
cm.sendNext("Invalid map, this means the stage is incomplete.");
|
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function clear(stage, eim, cm) {
|
|
||||||
eim.setProperty(stage + "stageclear", "true");
|
|
||||||
var map = eim.getMapInstance(cm.getPlayer().getMapId());
|
|
||||||
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
|
|
||||||
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
|
|
||||||
map.broadcastMessage(MaplePacketCreator.environmentChange("gate", 2));
|
|
||||||
var mf = eim.getMapFactory();
|
|
||||||
map = mf.getMap(103000800 + stage);
|
|
||||||
var nextStage = eim.getMapInstance(103000800 + stage);
|
|
||||||
var portal = nextStage.getPortal("next00");
|
|
||||||
if (portal != null) {
|
|
||||||
portal.setScriptName("kpq" + stage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function failstage(eim, cm) {
|
|
||||||
var map = eim.getMapInstance(cm.getPlayer().getMapId());
|
|
||||||
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Failed"));
|
|
||||||
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/wrong_kor"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function Rectanglestages (cm) {
|
|
||||||
var eim = cm.getPlayer().getEventInstance();
|
|
||||||
var nthtext;
|
|
||||||
var nthobj;
|
|
||||||
var nthverb;
|
|
||||||
var nthpos;
|
|
||||||
var curArray;
|
|
||||||
var curCombo;
|
|
||||||
var objset;
|
|
||||||
if (curMap == 2) {
|
|
||||||
nthtext = "2nd";
|
|
||||||
nthobj = "ropes";
|
|
||||||
nthverb = "hang";
|
|
||||||
nthpos = "hang on the ropes too low";
|
|
||||||
curArray = stage2Rects;
|
|
||||||
curCombo = stage2combos;
|
|
||||||
objset = [0,0,0,0];
|
|
||||||
} else if (curMap == 3) {
|
|
||||||
nthtext = "3rd";
|
|
||||||
nthobj = "platforms";
|
|
||||||
nthverb = "stand";
|
|
||||||
nthpos = "stand too close to the edges";
|
|
||||||
curArray = stage3Rects;
|
|
||||||
curCombo = stage3combos;
|
|
||||||
objset = [0,0,0,0,0];
|
|
||||||
} else if (curMap == 4) {
|
|
||||||
nthtext = "4th";
|
|
||||||
nthobj = "barrels";
|
|
||||||
nthverb = "stand";
|
|
||||||
nthpos = "stand too close to the edges";
|
|
||||||
curArray = stage4Rects;
|
|
||||||
curCombo = stage4combos;
|
|
||||||
objset = [0,0,0,0,0,0];
|
|
||||||
}
|
|
||||||
if (isLeader()) { // Check if player is leader
|
|
||||||
if (status == 0) {
|
|
||||||
party = eim.getPlayers();
|
|
||||||
preamble = eim.getProperty("leader" + nthtext + "preamble");
|
|
||||||
if (preamble == null) { // first time talking.
|
|
||||||
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
|
|
||||||
eim.setProperty("leader" + nthtext + "preamble","done");
|
|
||||||
var sequenceNum = Math.floor(Math.random() * curCombo.length);
|
|
||||||
eim.setProperty("stage" + nthtext + "combo", sequenceNum.toString());
|
|
||||||
cm.dispose();
|
|
||||||
} else {
|
|
||||||
if(cm.getPlayer().getMap().getCharacters().size() != eim.getPlayerCount()) {
|
|
||||||
cm.sendOk("Please make sure all of your party members are here before you continue.");
|
|
||||||
cm.dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var complete = eim.getProperty(curMap + "stageclear");
|
|
||||||
if (complete != null) {
|
|
||||||
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
|
||||||
cm.dispose();
|
|
||||||
} else { // Check for people on ropes and their positions
|
|
||||||
var playersOnCombo = 0;
|
|
||||||
for (var i = 0; i < party.size(); i++) {
|
|
||||||
for (var y = 0; y < curArray.length; y++) {
|
|
||||||
if (curArray[y].contains(party.get(i).getPosition())) {
|
|
||||||
playersOnCombo++;
|
|
||||||
objset[y] = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (playersOnCombo == 3) {
|
|
||||||
var combo = curCombo[parseInt(eim.getProperty("stage" + nthtext + "combo"))];
|
|
||||||
var correctCombo = true;
|
|
||||||
for (i = 0; i < objset.length && correctCombo; i++)
|
|
||||||
if (combo[i] != objset[i])
|
|
||||||
correctCombo = false;
|
|
||||||
if (correctCombo) {
|
|
||||||
clear(curMap, eim, cm);
|
|
||||||
cm.givePartyExp("KerningPQ" + nthtext);
|
|
||||||
cm.dispose();
|
|
||||||
} else { // Wrong
|
|
||||||
failstage(eim, cm);
|
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
|
|
||||||
cm.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
var complete = eim.getProperty(curMap + "stageclear");
|
if (mode == 0 && status == 0) {
|
||||||
if (complete != null) {
|
cm.dispose();
|
||||||
var target = eim.getMapInstance(103000800 + curMap);
|
return;
|
||||||
var targetPortal = target.getPortal("st00");
|
}
|
||||||
cm.getPlayer().changeMap(target, targetPortal);
|
if (mode == 1)
|
||||||
}
|
status++;
|
||||||
cm.dispose();
|
else
|
||||||
}
|
status--;
|
||||||
} else { // Not leader
|
|
||||||
var complete = eim.getProperty(curMap.toString() + "stageclear");
|
if(status == 0) {
|
||||||
if (complete != null) {
|
var curMap = cm.getMapId();
|
||||||
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
var stage = curMap - 103000800 + 1;
|
||||||
} else {
|
if(eim.getProperty(stage.toString() + "stageclear") != null) {
|
||||||
cm.sendNext("Please have the party leader talk to me.");
|
if(stage < 5) {
|
||||||
}
|
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
|
cm.sendNext("Incredible! You cleared all the stages to get to this point. Here's a small prize for your job well done. Before you accept it, however, please make sure your use and etc. inventories have empty slots available.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(curMap == 103000800) { // stage 1
|
||||||
|
if(cm.isLeader()) {
|
||||||
|
var numpasses = eim.getPlayerCount() - 1; // minus leader
|
||||||
|
|
||||||
function isLeader(){
|
if(cm.hasItem(4001008, numpasses)) {
|
||||||
if(cm.getParty() == null)
|
cm.sendNext("You gathered up " + numpasses + " passes! Congratulations on clearing the stage! I'll make the portal that sends you to the next stage. There's a time limit on getting there, so please hurry. Best of luck to you all!");
|
||||||
return false;
|
clearStage(stage, eim, curMap);
|
||||||
else
|
eim.gridClear();
|
||||||
return cm.isLeader();
|
cm.gainItem(4001008, -numpasses);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
cm.sendNext("I'm sorry, but you are short on the number of passes. You need to give me the right number of passes; it should be the number of members of your party minus the leader, in this case the total of " + numpasses + " to clear the stage. Tell your party members to solve the questions, gather up the passes, and give them to you.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var data = eim.gridCheck(cm.getPlayer());
|
||||||
|
|
||||||
function getPrize(eim,cm) {
|
if(data == 0) {
|
||||||
var itemSetSel = Math.random();
|
cm.sendNext("Thanks for bringing me the coupons. Please hand the pass to your party leader to continue.");
|
||||||
var itemSet;
|
} else if(data == -1) {
|
||||||
var itemSetQty;
|
data = Math.floor(Math.random() * stage1Questions.length) + 1; //data will be counted from 1
|
||||||
var hasQty = false;
|
eim.gridInsert(cm.getPlayer(), data);
|
||||||
if (itemSetSel < 0.3)
|
|
||||||
itemSet = prizeIdScroll;
|
var question = stage1Questions[data - 1];
|
||||||
else if (itemSetSel < 0.6)
|
cm.sendNext(question);
|
||||||
itemSet = prizeIdEquip;
|
} else {
|
||||||
else if (itemSetSel < 0.9) {
|
var answer = stage1Answers[data - 1];
|
||||||
itemSet = prizeIdUse;
|
|
||||||
itemSetQty = prizeQtyUse;
|
if(cm.itemQuantity(4001007) == answer) {
|
||||||
hasQty = true;
|
cm.sendNext("That's the right answer! For that you have just received a #bpass#k. Please hand it to the leader of the party.");
|
||||||
} else {
|
cm.gainItem(4001007, -answer);
|
||||||
itemSet = prizeIdEtc;
|
cm.gainItem(4001008, 1);
|
||||||
itemSetQty = prizeQtyEtc;
|
eim.gridInsert(cm.getPlayer(), 0);
|
||||||
hasQty = true;
|
}
|
||||||
}
|
else {
|
||||||
var sel = Math.floor(Math.random()*itemSet.length);
|
cm.sendNext("I'm sorry, but that is not the right answer! Please have the correct number of coupons in your inventory.");
|
||||||
var qty = 1;
|
}
|
||||||
if (hasQty)
|
}
|
||||||
qty = itemSetQty[sel];
|
}
|
||||||
cm.gainItem(itemSet[sel], qty, true, true);
|
|
||||||
cm.getPlayer().changeMap(eim.getMapInstance(103000805));
|
cm.dispose();
|
||||||
|
} else if(curMap == 103000801) { // stage 2
|
||||||
|
var stgProperty = "stg2Property";
|
||||||
|
var stgCombos = stage2Combos;
|
||||||
|
var stgAreas = stage2Rects;
|
||||||
|
|
||||||
|
var nthtext = "2nd", nthobj = "ropes", nthverb = "hang", nthpos = "hang on the ropes too low";
|
||||||
|
var nextStgId = 103000802;
|
||||||
|
|
||||||
|
if(!eim.isLeader(cm.getPlayer())) {
|
||||||
|
cm.sendOk("Follow the instructions given by your party leader to proceed through this stage.");
|
||||||
|
}
|
||||||
|
else if(eim.getProperty(stgProperty) == null) {
|
||||||
|
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
|
||||||
|
var c = Math.floor(Math.random() * stgCombos.length);
|
||||||
|
eim.setProperty(stgProperty, c.toString());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas);
|
||||||
|
|
||||||
|
if(accept) {
|
||||||
|
clearStage(stage, eim, curMap);
|
||||||
|
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
eim.showWrongEffect();
|
||||||
|
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.dispose();
|
||||||
|
} else if(curMap == 103000802) {
|
||||||
|
var stgProperty = "stg3Property";
|
||||||
|
var stgCombos = stage3Combos;
|
||||||
|
var stgAreas = stage3Rects;
|
||||||
|
|
||||||
|
var nthtext = "3rd", nthobj = "platforms", nthverb = "stand", nthpos = "stand too close to the edges";
|
||||||
|
var nextStgId = 103000803;
|
||||||
|
|
||||||
|
if(!eim.isLeader(cm.getPlayer())) {
|
||||||
|
cm.sendOk("Follow the instructions given by your party leader to proceed through this stage.");
|
||||||
|
}
|
||||||
|
else if(eim.getProperty(stgProperty) == null) {
|
||||||
|
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
|
||||||
|
var c = Math.floor(Math.random() * stgCombos.length);
|
||||||
|
eim.setProperty(stgProperty, c.toString());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas);
|
||||||
|
|
||||||
|
if(accept) {
|
||||||
|
clearStage(stage, eim, curMap);
|
||||||
|
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
eim.showWrongEffect();
|
||||||
|
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.dispose();
|
||||||
|
} else if(curMap == 103000803) {
|
||||||
|
var stgProperty = "stg4Property";
|
||||||
|
var stgCombos = stage4Combos;
|
||||||
|
var stgAreas = stage4Rects;
|
||||||
|
|
||||||
|
var nthtext = "4th", nthobj = "barrels", nthverb = "stand", nthpos = "stand too close to the edges";
|
||||||
|
var nextStgId = 103000804;
|
||||||
|
|
||||||
|
if(!eim.isLeader(cm.getPlayer())) {
|
||||||
|
cm.sendOk("Follow the instructions given by your party leader to proceed through this stage.");
|
||||||
|
}
|
||||||
|
else if(eim.getProperty(stgProperty) == null) {
|
||||||
|
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
|
||||||
|
var c = Math.floor(Math.random() * stgCombos.length);
|
||||||
|
eim.setProperty(stgProperty, c.toString());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas);
|
||||||
|
|
||||||
|
if(accept) {
|
||||||
|
clearStage(stage, eim, curMap);
|
||||||
|
cm.sendNext("Please hurry on to the next stage, the portal opened!");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
eim.showWrongEffect();
|
||||||
|
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.dispose();
|
||||||
|
} else if(curMap == 103000804) {
|
||||||
|
if (eim.isLeader(cm.getPlayer())) {
|
||||||
|
if (cm.haveItem(4001008, 10)) {
|
||||||
|
cm.sendNext("Here's the portal that leads you to the last, bonus stage. It's a stage that allows you to defeat regular monsters a little easier. You'll be given a set amount of time to hunt as much as possible, but you can always leave the stage in the middle of it through the NPC. Again, congratulations on clearing all the stages. Let your party talk to me to receive their prizes as they are allowed to pass to the bonus stage. Take care...");
|
||||||
|
cm.gainItem(4001008, -10);
|
||||||
|
|
||||||
|
clearStage(stage, eim, curMap);
|
||||||
|
eim.clearPQ();
|
||||||
|
} else {
|
||||||
|
cm.sendNext("Hello. Welcome to the 5th and final stage. Walk around the map and you'll be able to find some Boss monsters. Defeat all of them, gather up #bthe passes#k, and please get them to me. Once you earn your pass, the leader of your party will collect them, and then get them to me once the #bpasses#k are gathered up. The monsters may be familiar to you, but they may be much stronger than you think, so please be careful. Good luck!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cm.sendNext("Welcome to the 5th and final stage. Walk around the map and you will be able to find some Boss monsters. Defeat them all, gather up the #bpasses#k, and #bgive them to your leader#k. Once you are done, return to me to collect your reward.");
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (status == 1) {
|
||||||
|
if(!eim.giveEventReward(cm.getPlayer())) {
|
||||||
|
cm.sendNext("Please make room on your inventory first!");
|
||||||
|
} else {
|
||||||
|
cm.warp(103000805, "st00");
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ function action(mode, type, selection){
|
|||||||
var mapId = cm.getPlayer().getMapId();
|
var mapId = cm.getPlayer().getMapId();
|
||||||
if (mapId == 103000890) {
|
if (mapId == 103000890) {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
cm.sendNext("See you next time.");
|
cm.sendNext("To return back to the city, follow this way.");
|
||||||
} else {
|
} else {
|
||||||
cm.getPlayer().changeMap(103000000, cm.getClient().getChannelServer().getMapFactory().getMap(103000000).getRandomSpawnpoint());
|
cm.getPlayer().changeMap(103000000, cm.getClient().getChannelServer().getMapFactory().getMap(103000000).getRandomSpawnpoint());
|
||||||
cm.removeAll(4001007);
|
cm.removeAll(4001007);
|
||||||
@@ -61,15 +61,7 @@ function action(mode, type, selection){
|
|||||||
}
|
}
|
||||||
cm.sendYesNo(outText);
|
cm.sendYesNo(outText);
|
||||||
} else if (mode == 1) {
|
} else if (mode == 1) {
|
||||||
var eim = cm.getPlayer().getEventInstance(); // Remove them from the PQ!
|
cm.warp(103000890, "st00"); // Warp player
|
||||||
if (eim == null)
|
|
||||||
cm.warp(103000890, "st00"); // Warp player
|
|
||||||
else if (cm.isLeader()) {
|
|
||||||
//cm.getEventManager("KerningPQ").setProperty("KPQOpen" , "true");
|
|
||||||
eim.disbandParty();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
eim.leftParty(cm.getPlayer());
|
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function start() {
|
|||||||
points = 100;
|
points = 100;
|
||||||
cm.getGuild().gainGP(points);
|
cm.getGuild().gainGP(points);
|
||||||
}
|
}
|
||||||
eim.finishPQ();
|
eim.clearPQ();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and return it to me. That is all.");
|
cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and return it to me. That is all.");
|
||||||
|
|||||||
@@ -72,8 +72,11 @@ function action(mode, type, selection) {
|
|||||||
} else if (!open){
|
} else if (!open){
|
||||||
cm.sendOk("The PQ is #rclosed#k for now.");
|
cm.sendOk("The PQ is #rclosed#k for now.");
|
||||||
} else {
|
} else {
|
||||||
//cm.sendOk("You may enter");//ENTER PQ
|
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
|
||||||
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var party = cm.getPlayer().getEventInstance().getPlayers();
|
var party = cm.getPlayer().getEventInstance().getPlayers();
|
||||||
cm.removeFromParty(4001106, party);
|
cm.removeFromParty(4001106, party);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,8 +59,13 @@ function start() {
|
|||||||
var em = cm.getEventManager("AmoriaPQ");
|
var em = cm.getEventManager("AmoriaPQ");
|
||||||
if (em == null)
|
if (em == null)
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
else
|
else {
|
||||||
em.startInstance(cm.getParty(),cm.getPlayer().getMap());
|
if(!em.startInstance(cm.getParty(),cm.getPlayer().getMap())) {
|
||||||
|
cm.sendOk("A party in your name is already registered in this event.");
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
cm.dispose();
|
cm.dispose();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Kerning PQ: 4th stage to final stage portal
|
|||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
var eim = pi.getPlayer().getEventInstance();
|
var eim = pi.getPlayer().getEventInstance();
|
||||||
var target = eim.getMapInstance(103000805);
|
var target = eim.getMapInstance(103000805);
|
||||||
if (eim.getProperty("4stageclear") != null) {
|
if (eim.getProperty("5stageclear") != null) {
|
||||||
pi.getPlayer().changeMap(target, target.getPortal("st00"));
|
pi.getPlayer().changeMap(target, target.getPortal("st00"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
function enter(pi) {
|
function enter(pi) {
|
||||||
if ((pi.getMap().getMonsters().size() == 0 || pi.getMap().getMonsterById(9300183) != null) && (pi.getMap().getReactorByName("") == null || pi.getMap().getReactorByName("").getState() == 1)) {
|
if ((pi.getMap().getMonsters().size() == 0 || pi.getMap().getMonsterById(9300183) != null) && (pi.getMap().getReactorByName("") == null || pi.getMap().getReactorByName("").getState() == 1)) {
|
||||||
if(pi.isLeader()) {
|
if(pi.isLeader()) {
|
||||||
pi.clearPQ(930000800);
|
pi.getEventInstance().clearPQ();
|
||||||
|
pi.getEventInstance().warpEventTeam(930000800);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -19106,6 +19106,8 @@
|
|||||||
UPDATE reactordrops SET questid=6002 WHERE itemid=4031508;
|
UPDATE reactordrops SET questid=6002 WHERE itemid=4031508;
|
||||||
UPDATE reactordrops SET questid=9351 WHERE itemid=4031258;
|
UPDATE reactordrops SET questid=9351 WHERE itemid=4031258;
|
||||||
UPDATE reactordrops SET questid=3083 WHERE itemid >= 4031274 AND itemid <= 4031278;
|
UPDATE reactordrops SET questid=3083 WHERE itemid >= 4031274 AND itemid <= 4031278;
|
||||||
|
UPDATE reactordrops SET questid=1008 WHERE itemid=4031161;
|
||||||
|
UPDATE reactordrops SET questid=1008 WHERE itemid=4031162;
|
||||||
|
|
||||||
INSERT INTO `reactordrops` (`reactorid`, `itemid`, `chance`, `questid`) VALUES
|
INSERT INTO `reactordrops` (`reactorid`, `itemid`, `chance`, `questid`) VALUES
|
||||||
(9102000, 4031157, 1, 2074),
|
(9102000, 4031157, 1, 2074),
|
||||||
|
|||||||
@@ -151,9 +151,17 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
private static final int[] EXP_RATE_GAIN = {1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144}; //fibonacci :3
|
private static final int[] EXP_RATE_GAIN = {1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144}; //fibonacci :3
|
||||||
|
|
||||||
private static final String LEVEL_200 = "[Congrats] %s has reached Level 200! Congratulate %s on such an amazing achievement!";
|
private static final String LEVEL_200 = "[Congrats] %s has reached Level 200! Congratulate %s on such an amazing achievement!";
|
||||||
|
|
||||||
|
// MapleStory default keyset
|
||||||
private static final int[] DEFAULT_KEY = {18, 65, 2, 23, 3, 4, 5, 6, 16, 17, 19, 25, 26, 27, 31, 34, 35, 37, 38, 40, 43, 44, 45, 46, 50, 56, 59, 60, 61, 62, 63, 64, 57, 48, 29, 7, 24, 33, 41, 39};
|
private static final int[] DEFAULT_KEY = {18, 65, 2, 23, 3, 4, 5, 6, 16, 17, 19, 25, 26, 27, 31, 34, 35, 37, 38, 40, 43, 44, 45, 46, 50, 56, 59, 60, 61, 62, 63, 64, 57, 48, 29, 7, 24, 33, 41, 39};
|
||||||
private static final int[] DEFAULT_TYPE = {4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 5, 6, 6, 6, 6, 6, 6, 5, 4, 5, 4, 4, 4, 4, 4};
|
private static final int[] DEFAULT_TYPE = {4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 5, 6, 6, 6, 6, 6, 6, 5, 4, 5, 4, 4, 4, 4, 4};
|
||||||
private static final int[] DEFAULT_ACTION = {0, 106, 10, 1, 12, 13, 18, 24, 8, 5, 4, 19, 14, 15, 2, 17, 11, 3, 20, 16, 9, 50, 51, 6, 7, 53, 100, 101, 102, 103, 104, 105, 54, 22, 52, 21, 25, 26, 23, 27};
|
private static final int[] DEFAULT_ACTION = {0, 106, 10, 1, 12, 13, 18, 24, 8, 5, 4, 19, 14, 15, 2, 17, 11, 3, 20, 16, 9, 50, 51, 6, 7, 53, 100, 101, 102, 103, 104, 105, 54, 22, 52, 21, 25, 26, 23, 27};
|
||||||
|
|
||||||
|
// MapleSolaxiaV2 custom keyset
|
||||||
|
private static final int[] CUSTOM_KEY = {2, 3, 4, 5, 31, 56, 59, 32, 42, 6, 17, 29, 30, 41, 50, 60, 61, 62, 63, 64, 65, 16, 7, 8};
|
||||||
|
private static final int[] CUSTOM_TYPE = {4, 4, 4, 4, 5, 5, 6, 5, 5, 4, 4, 4, 5, 4, 4, 6, 6, 6, 6, 6, 6, 4, 4, 4};
|
||||||
|
private static final int[] CUSTOM_ACTION = {1, 0, 3, 2, 53, 54, 100, 52, 51, 19, 5, 9, 50, 7, 22, 101, 102, 103, 104, 105, 106, 8, 17, 26};
|
||||||
|
|
||||||
private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "help", "helper", "alert", "notice", "maplestory", "Solaxia", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay",
|
private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "help", "helper", "alert", "notice", "maplestory", "Solaxia", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay",
|
||||||
"nigger", "homo", "suck", "cum", "shit", "shitty", "condom", "security", "official", "rape", "nigga", "sex", "tit", "boner", "orgy", "clit", "asshole", "fatass", "bitch", "support", "gamemaster", "cock", "gaay", "gm",
|
"nigger", "homo", "suck", "cum", "shit", "shitty", "condom", "security", "official", "rape", "nigga", "sex", "tit", "boner", "orgy", "clit", "asshole", "fatass", "bitch", "support", "gamemaster", "cock", "gaay", "gm",
|
||||||
"operate", "master", "sysop", "party", "GameMaster", "community", "message", "event", "test", "meso", "Scania", "renewal", "yata", "AsiaSoft", "henesys"};
|
"operate", "master", "sysop", "party", "GameMaster", "community", "message", "event", "test", "meso", "Scania", "renewal", "yata", "AsiaSoft", "henesys"};
|
||||||
@@ -354,9 +362,28 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
ret.getInventory(MapleInventoryType.USE).setSlotLimit(24);
|
ret.getInventory(MapleInventoryType.USE).setSlotLimit(24);
|
||||||
ret.getInventory(MapleInventoryType.SETUP).setSlotLimit(24);
|
ret.getInventory(MapleInventoryType.SETUP).setSlotLimit(24);
|
||||||
ret.getInventory(MapleInventoryType.ETC).setSlotLimit(24);
|
ret.getInventory(MapleInventoryType.ETC).setSlotLimit(24);
|
||||||
for (int i = 0; i < DEFAULT_KEY.length; i++) {
|
|
||||||
ret.keymap.put(DEFAULT_KEY[i], new MapleKeyBinding(DEFAULT_TYPE[i], DEFAULT_ACTION[i]));
|
// Select a keybinding method
|
||||||
|
int[] selectedKey;
|
||||||
|
int[] selectedType;
|
||||||
|
int[] selectedAction;
|
||||||
|
|
||||||
|
if(ServerConstants.USE_CUSTOM_KEYSET) {
|
||||||
|
selectedKey = CUSTOM_KEY;
|
||||||
|
selectedType = CUSTOM_TYPE;
|
||||||
|
selectedAction = CUSTOM_ACTION;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
selectedKey = DEFAULT_KEY;
|
||||||
|
selectedType = DEFAULT_TYPE;
|
||||||
|
selectedAction = DEFAULT_ACTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < selectedKey.length; i++) {
|
||||||
|
ret.keymap.put(selectedKey[i], new MapleKeyBinding(selectedType[i], selectedAction[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//to fix the map 0 lol
|
//to fix the map 0 lol
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
ret.trockmaps.add(999999999);
|
ret.trockmaps.add(999999999);
|
||||||
@@ -1206,6 +1233,11 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
newWarpMap = -1;
|
newWarpMap = -1;
|
||||||
changeMap(temp);
|
changeMap(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if this event map has a gate already opened, render it
|
||||||
|
if(getEventInstance() != null) {
|
||||||
|
getEventInstance().recoverOpenedGate(this, map.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changePage(int page) {
|
public void changePage(int page) {
|
||||||
@@ -1714,6 +1746,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
this.addFame(delta);
|
this.addFame(delta);
|
||||||
this.updateSingleStat(MapleStat.FAME, this.fame);
|
this.updateSingleStat(MapleStat.FAME, this.fame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void gainMeso(int gain) {
|
||||||
|
gainMeso(gain, true, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
public void gainMeso(int gain, boolean show) {
|
public void gainMeso(int gain, boolean show) {
|
||||||
gainMeso(gain, show, false, false);
|
gainMeso(gain, show, false, false);
|
||||||
@@ -3475,7 +3511,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
int lastQuestProcessed = 0;
|
int lastQuestProcessed = 0;
|
||||||
try {
|
try {
|
||||||
for (MapleQuestStatus q : quests.values()) {
|
for (MapleQuestStatus q : quests.values()) {
|
||||||
lastQuestProcessed = q.getQuest().getId();
|
lastQuestProcessed = q.getQuest().getId();
|
||||||
if (q.getStatus() == MapleQuestStatus.Status.COMPLETED || q.getQuest().canComplete(this, null)) {
|
if (q.getStatus() == MapleQuestStatus.Status.COMPLETED || q.getQuest().canComplete(this, null)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -4037,12 +4073,28 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select a keybinding method
|
||||||
|
int[] selectedKey;
|
||||||
|
int[] selectedType;
|
||||||
|
int[] selectedAction;
|
||||||
|
|
||||||
|
if(ServerConstants.USE_CUSTOM_KEYSET) {
|
||||||
|
selectedKey = CUSTOM_KEY;
|
||||||
|
selectedType = CUSTOM_TYPE;
|
||||||
|
selectedAction = CUSTOM_ACTION;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
selectedKey = DEFAULT_KEY;
|
||||||
|
selectedType = DEFAULT_TYPE;
|
||||||
|
selectedAction = DEFAULT_ACTION;
|
||||||
|
}
|
||||||
|
|
||||||
ps = con.prepareStatement("INSERT INTO keymap (characterid, `key`, `type`, `action`) VALUES (?, ?, ?, ?)");
|
ps = con.prepareStatement("INSERT INTO keymap (characterid, `key`, `type`, `action`) VALUES (?, ?, ?, ?)");
|
||||||
ps.setInt(1, id);
|
ps.setInt(1, id);
|
||||||
for (int i = 0; i < DEFAULT_KEY.length; i++) {
|
for (int i = 0; i < selectedKey.length; i++) {
|
||||||
ps.setInt(2, DEFAULT_KEY[i]);
|
ps.setInt(2, selectedKey[i]);
|
||||||
ps.setInt(3, DEFAULT_TYPE[i]);
|
ps.setInt(3, selectedType[i]);
|
||||||
ps.setInt(4, DEFAULT_ACTION[i]);
|
ps.setInt(4, selectedAction[i]);
|
||||||
ps.execute();
|
ps.execute();
|
||||||
}
|
}
|
||||||
ps.close();
|
ps.close();
|
||||||
@@ -4203,6 +4255,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
|||||||
ps.addBatch();
|
ps.addBatch();
|
||||||
}
|
}
|
||||||
ps.executeBatch();
|
ps.executeBatch();
|
||||||
|
|
||||||
deleteWhereCharacterId(con, "DELETE FROM skillmacros WHERE characterid = ?");
|
deleteWhereCharacterId(con, "DELETE FROM skillmacros WHERE characterid = ?");
|
||||||
ps = con.prepareStatement("INSERT INTO skillmacros (characterid, skill1, skill2, skill3, name, shout, position) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
ps = con.prepareStatement("INSERT INTO skillmacros (characterid, skill1, skill2, skill3, name, shout, position) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
||||||
ps.setInt(1, getId());
|
ps.setInt(1, getId());
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class ServerConstants {
|
|||||||
public static boolean JAVA_8;
|
public static boolean JAVA_8;
|
||||||
public static boolean SHUTDOWNHOOK;
|
public static boolean SHUTDOWNHOOK;
|
||||||
//Gameplay Configurations
|
//Gameplay Configurations
|
||||||
|
public static final boolean USE_CUSTOM_KEYSET = true;
|
||||||
public static final boolean USE_MAXRANGE = true; //will send and receive packets from all events of a map, rather than those of only view range.
|
public static final boolean USE_MAXRANGE = true; //will send and receive packets from all events of a map, rather than those of only view range.
|
||||||
public static final boolean USE_DEBUG = true; //will enable some text prints and new commands in the client oriented for debugging.
|
public static final boolean USE_DEBUG = true; //will enable some text prints and new commands in the client oriented for debugging.
|
||||||
public static final boolean USE_MTS = false;
|
public static final boolean USE_MTS = false;
|
||||||
|
|||||||
@@ -35,28 +35,30 @@ import tools.data.input.SeekableLittleEndianAccessor;
|
|||||||
public final class KeymapChangeHandler extends AbstractMaplePacketHandler {
|
public final class KeymapChangeHandler extends AbstractMaplePacketHandler {
|
||||||
@Override
|
@Override
|
||||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||||
if (slea.available() >= 8) {
|
if (slea.available() >= 8) {
|
||||||
int mode = slea.readInt();
|
int mode = slea.readInt();
|
||||||
if(mode == 0) {
|
if(mode == 0) {
|
||||||
int numChanges = slea.readInt();
|
int numChanges = slea.readInt();
|
||||||
for (int i = 0; i < numChanges; i++) {
|
for (int i = 0; i < numChanges; i++) {
|
||||||
int key = slea.readInt();
|
int key = slea.readInt();
|
||||||
int type = slea.readByte();
|
int type = slea.readByte();
|
||||||
int action = slea.readInt();
|
int action = slea.readInt();
|
||||||
|
|
||||||
Skill skill = SkillFactory.getSkill(action);
|
Skill skill = SkillFactory.getSkill(action);
|
||||||
boolean isBanndedSkill = false;
|
boolean isBanndedSkill = false;
|
||||||
if (skill != null) {
|
if (skill != null) {
|
||||||
isBanndedSkill = GameConstants.bannedBindSkills(skill.getId());
|
isBanndedSkill = GameConstants.bannedBindSkills(skill.getId());
|
||||||
if (isBanndedSkill || (!c.getPlayer().isGM() && GameConstants.isGMSkills(skill.getId())) || (!GameConstants.isInJobTree(skill.getId(), c.getPlayer().getJob().getId()) && !c.getPlayer().isGM())) { //for those skills are are "technically" in the beginner tab, like bamboo rain in Dojo or skills you find in PYPQ
|
if (isBanndedSkill || (!c.getPlayer().isGM() && GameConstants.isGMSkills(skill.getId())) || (!GameConstants.isInJobTree(skill.getId(), c.getPlayer().getJob().getId()) && !c.getPlayer().isGM())) { //for those skills are are "technically" in the beginner tab, like bamboo rain in Dojo or skills you find in PYPQ
|
||||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit keymapping.");
|
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit keymapping.");
|
||||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skill.getId() + "\r\n");
|
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skill.getId() + "\r\n");
|
||||||
c.disconnect(true, false);
|
c.disconnect(true, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (c.getPlayer().getSkillLevel(skill) < 1) {
|
/* if (c.getPlayer().getSkillLevel(skill) < 1) { HOW WOULD A SKILL EVEN BE AVAILABLE TO KEYBINDING
|
||||||
continue;
|
continue; IF THERE IS NOT EVEN A SINGLE POINT USED INTO IT??
|
||||||
}
|
} */ //Nice to know some skills have the same ids as items, heh.
|
||||||
}
|
}
|
||||||
|
|
||||||
c.getPlayer().changeKeybinding(key, new MapleKeyBinding(type, action));
|
c.getPlayer().changeKeybinding(key, new MapleKeyBinding(type, action));
|
||||||
}
|
}
|
||||||
} else if(mode == 1) { // Auto HP Potion
|
} else if(mode == 1) { // Auto HP Potion
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ public final class PartyOperationHandler extends AbstractMaplePacketHandler {
|
|||||||
String name = slea.readMapleAsciiString();
|
String name = slea.readMapleAsciiString();
|
||||||
MapleCharacter invited = world.getPlayerStorage().getCharacterByName(name);
|
MapleCharacter invited = world.getPlayerStorage().getCharacterByName(name);
|
||||||
if (invited != null) {
|
if (invited != null) {
|
||||||
if(invited.getLevel() < 10) { //min requirement is level 10
|
if(invited.getLevel() < 10) { //min requirement is level 10
|
||||||
c.announce(MaplePacketCreator.serverNotice(5, "The player you have invited does not meet the requirements."));
|
c.announce(MaplePacketCreator.serverNotice(5, "The player you have invited does not meet the requirements."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (invited.getParty() == null) {
|
if (invited.getParty() == null) {
|
||||||
if (player.getParty() == null) {
|
if (player.getParty() == null) {
|
||||||
partyplayer = new MaplePartyCharacter(player);
|
partyplayer = new MaplePartyCharacter(player);
|
||||||
|
|||||||
@@ -245,8 +245,8 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler {
|
|||||||
player.checkBerserk();
|
player.checkBerserk();
|
||||||
player.expirationTask();
|
player.expirationTask();
|
||||||
//player.setRates();
|
//player.setRates();
|
||||||
if (GameConstants.hasSPTable(player.getJob()) && player.getJob().getId() != 2001) {
|
if (GameConstants.hasSPTable(player.getJob()) && player.getJob().getId() != 2001) {
|
||||||
player.createDragon();
|
player.createDragon();
|
||||||
}
|
}
|
||||||
if (newcomer){
|
if (newcomer){
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -59,18 +59,18 @@ public final class QuestActionHandler extends AbstractMaplePacketHandler {
|
|||||||
} else if (action == 4) { // scripted start quest
|
} else if (action == 4) { // scripted start quest
|
||||||
int npc = slea.readInt();
|
int npc = slea.readInt();
|
||||||
slea.readInt();
|
slea.readInt();
|
||||||
if(quest.canStart(player, npc)) {
|
if(quest.canStart(player, npc)) {
|
||||||
QuestScriptManager.getInstance().start(c, questid, npc);
|
QuestScriptManager.getInstance().start(c, questid, npc);
|
||||||
}
|
}
|
||||||
} else if (action == 5) { // scripted end quests
|
} else if (action == 5) { // scripted end quests
|
||||||
//System.out.println(slea.toString());
|
//System.out.println(slea.toString());
|
||||||
int npc = slea.readInt();
|
int npc = slea.readInt();
|
||||||
slea.readInt();
|
slea.readInt();
|
||||||
|
|
||||||
if(quest.canComplete(player, npc)) {
|
if(quest.canComplete(player, npc)) {
|
||||||
QuestScriptManager.getInstance().end(c, questid, npc);
|
QuestScriptManager.getInstance().end(c, questid, npc);
|
||||||
player.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); //show effect when completion
|
player.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); //show effect when completion
|
||||||
player.getMap().broadcastMessage(player, MaplePacketCreator.showForeignEffect(player.getId(), 9));//show effect around players I guess
|
player.getMap().broadcastMessage(player, MaplePacketCreator.showForeignEffect(player.getId(), 9));//show effect around players I guess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import net.server.channel.Channel;
|
|||||||
import net.server.guild.MapleGuild;
|
import net.server.guild.MapleGuild;
|
||||||
import net.server.world.MapleParty;
|
import net.server.world.MapleParty;
|
||||||
import net.server.world.MaplePartyCharacter;
|
import net.server.world.MaplePartyCharacter;
|
||||||
|
import scripting.event.EventInstanceManager;
|
||||||
import scripting.event.EventManager;
|
import scripting.event.EventManager;
|
||||||
import scripting.npc.NPCScriptManager;
|
import scripting.npc.NPCScriptManager;
|
||||||
import server.MapleInventoryManipulator;
|
import server.MapleInventoryManipulator;
|
||||||
@@ -157,24 +158,19 @@ public class AbstractPlayerInteraction {
|
|||||||
return getClient().getEventManager(event);
|
return getClient().getEventManager(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearPQ(int toMap) {
|
public EventInstanceManager getEventInstance() {
|
||||||
clearPQ(getWarpMap(toMap));
|
return getPlayer().getEventInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearPQ(MapleMap toMap) {
|
|
||||||
if(getPlayer().getEventInstance() != null)
|
|
||||||
getPlayer().getEventInstance().getEm().clearPQ(getPlayer().getEventInstance(), toMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MapleInventory getInventory(MapleInventoryType type) {
|
public MapleInventory getInventory(MapleInventoryType type) {
|
||||||
return getPlayer().getInventory(type);
|
return getPlayer().getInventory(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasItem(int itemid){
|
public boolean hasItem(int itemid) {
|
||||||
return haveItem(itemid, 1);
|
return haveItem(itemid, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasItem(int itemid, int quantity){
|
public boolean hasItem(int itemid, int quantity) {
|
||||||
return haveItem(itemid, quantity);
|
return haveItem(itemid, quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,12 @@ import java.io.File;
|
|||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||||
@@ -39,6 +41,7 @@ import javax.script.ScriptException;
|
|||||||
import net.server.world.MapleParty;
|
import net.server.world.MapleParty;
|
||||||
import net.server.world.MaplePartyCharacter;
|
import net.server.world.MaplePartyCharacter;
|
||||||
import provider.MapleDataProviderFactory;
|
import provider.MapleDataProviderFactory;
|
||||||
|
import server.MaplePortal;
|
||||||
import server.TimerManager;
|
import server.TimerManager;
|
||||||
import server.expeditions.MapleExpedition;
|
import server.expeditions.MapleExpedition;
|
||||||
import server.life.MapleMonster;
|
import server.life.MapleMonster;
|
||||||
@@ -52,6 +55,7 @@ import java.util.concurrent.ScheduledFuture;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import scripting.AbstractPlayerInteraction;
|
import scripting.AbstractPlayerInteraction;
|
||||||
|
import tools.MaplePacketCreator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -75,12 +79,23 @@ public class EventInstanceManager {
|
|||||||
private final WriteLock wL = mutex.writeLock();
|
private final WriteLock wL = mutex.writeLock();
|
||||||
private ScheduledFuture<?> event_schedule = null;
|
private ScheduledFuture<?> event_schedule = null;
|
||||||
private boolean disposed = false;
|
private boolean disposed = false;
|
||||||
|
private boolean eventCleared = false;
|
||||||
|
|
||||||
// multi-leveled PQ rewards!
|
// multi-leveled PQ rewards!
|
||||||
private Map<Integer, List<Integer>> collectionSet = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
|
private Map<Integer, List<Integer>> collectionSet = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
|
||||||
private Map<Integer, List<Integer>> collectionQty = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
|
private Map<Integer, List<Integer>> collectionQty = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
|
||||||
private Map<Integer, Integer> collectionExp = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
|
private Map<Integer, Integer> collectionExp = new HashMap<>(ServerConstants.MAX_EVENT_LEVELS);
|
||||||
|
|
||||||
|
// Exp/Meso rewards by CLEAR on a stage
|
||||||
|
private List<Integer> onMapClearExp = new ArrayList<>();
|
||||||
|
private List<Integer> onMapClearMeso = new ArrayList<>();
|
||||||
|
|
||||||
|
// registers player status on an event (null on this Map structure equals to 0)
|
||||||
|
private Map<Integer, Integer> playerGrid = new HashMap<>();
|
||||||
|
|
||||||
|
// registers all opened gates on the event. Will help late characters to encounter next stages gates already opened
|
||||||
|
private Set<Integer> openedGates = new HashSet<>();
|
||||||
|
|
||||||
public EventInstanceManager(EventManager em, String name) {
|
public EventInstanceManager(EventManager em, String name) {
|
||||||
this.em = em;
|
this.em = em;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@@ -97,6 +112,8 @@ public class EventInstanceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void giveEventPlayersExp(int gain, int mapId) {
|
public void giveEventPlayersExp(int gain, int mapId) {
|
||||||
|
if(gain == 0) return;
|
||||||
|
|
||||||
rL.lock();
|
rL.lock();
|
||||||
try {
|
try {
|
||||||
if(mapId == -1) {
|
if(mapId == -1) {
|
||||||
@@ -113,6 +130,30 @@ public class EventInstanceManager {
|
|||||||
rL.unlock();
|
rL.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void giveEventPlayersMeso(int gain) {
|
||||||
|
giveEventPlayersMeso(gain, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void giveEventPlayersMeso(int gain, int mapId) {
|
||||||
|
if(gain == 0) return;
|
||||||
|
|
||||||
|
rL.lock();
|
||||||
|
try {
|
||||||
|
if(mapId == -1) {
|
||||||
|
for(MapleCharacter mc: chars) {
|
||||||
|
mc.gainMeso(gain * mc.getMesoRate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(MapleCharacter mc: chars) {
|
||||||
|
if(mc.getMapId() == mapId) mc.gainMeso(gain * mc.getMesoRate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void registerPlayer(MapleCharacter chr) {
|
public void registerPlayer(MapleCharacter chr) {
|
||||||
if (chr == null || !chr.isLoggedin()){
|
if (chr == null || !chr.isLoggedin()){
|
||||||
@@ -186,12 +227,19 @@ public class EventInstanceManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelEventTimer() {
|
public void stopEventTimer() {
|
||||||
if(event_schedule != null) event_schedule.cancel(false);
|
if(event_schedule != null) {
|
||||||
|
event_schedule.cancel(false);
|
||||||
|
event_schedule = null;
|
||||||
|
}
|
||||||
dismissEventTimer();
|
dismissEventTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dismissEventTimer() {
|
private void dismissEventTimer() {
|
||||||
|
for(MapleCharacter chr: getPlayers()) {
|
||||||
|
chr.getClient().getSession().write(MaplePacketCreator.removeClock());
|
||||||
|
}
|
||||||
|
|
||||||
event_schedule = null;
|
event_schedule = null;
|
||||||
eventTime = 0;
|
eventTime = 0;
|
||||||
timeStarted = 0;
|
timeStarted = 0;
|
||||||
@@ -220,9 +268,10 @@ public class EventInstanceManager {
|
|||||||
public void unregisterPlayer(MapleCharacter chr) {
|
public void unregisterPlayer(MapleCharacter chr) {
|
||||||
wL.lock();
|
wL.lock();
|
||||||
try {
|
try {
|
||||||
chars.remove(chr);
|
chars.remove(chr);
|
||||||
|
gridRemove(chr);
|
||||||
} finally {
|
} finally {
|
||||||
wL.unlock();
|
wL.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
chr.setEventInstance(null);
|
chr.setEventInstance(null);
|
||||||
@@ -231,20 +280,20 @@ public class EventInstanceManager {
|
|||||||
public int getPlayerCount() {
|
public int getPlayerCount() {
|
||||||
rL.lock();
|
rL.lock();
|
||||||
try {
|
try {
|
||||||
return chars.size();
|
return chars.size();
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
rL.unlock();
|
rL.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapleCharacter> getPlayers() {
|
public List<MapleCharacter> getPlayers() {
|
||||||
rL.lock();
|
rL.lock();
|
||||||
try {
|
try {
|
||||||
return new ArrayList<>(chars);
|
return new ArrayList<>(chars);
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
rL.unlock();
|
rL.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,37 +389,40 @@ public class EventInstanceManager {
|
|||||||
|
|
||||||
public int getKillCount(MapleCharacter chr) {
|
public int getKillCount(MapleCharacter chr) {
|
||||||
Integer kc = killCount.get(chr);
|
Integer kc = killCount.get(chr);
|
||||||
if (kc == null) {
|
return (kc == null) ? 0 : kc;
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return kc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void cancelSchedule() {
|
||||||
|
if(event_schedule != null) {
|
||||||
|
event_schedule.cancel(false);
|
||||||
|
event_schedule = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
try {
|
try {
|
||||||
em.getIv().invokeFunction("dispose", this);
|
em.getIv().invokeFunction("dispose", this);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
wL.lock();
|
wL.lock();
|
||||||
try {
|
try {
|
||||||
chars.clear();
|
chars.clear();
|
||||||
} finally {
|
} finally {
|
||||||
wL.unlock();
|
wL.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(event_schedule != null) event_schedule.cancel(false);
|
cancelSchedule();
|
||||||
|
|
||||||
mobs.clear();
|
mobs.clear();
|
||||||
killCount.clear();
|
killCount.clear();
|
||||||
mapFactory = null;
|
mapFactory = null;
|
||||||
if (expedition != null) {
|
if (expedition != null) {
|
||||||
em.getChannelServer().getExpeditions().remove(expedition);
|
em.getChannelServer().getExpeditions().remove(expedition);
|
||||||
}
|
}
|
||||||
em.disposeInstance(name);
|
em.disposeInstance(name);
|
||||||
em = null;
|
em = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleMapFactory getMapFactory() {
|
public MapleMapFactory getMapFactory() {
|
||||||
@@ -381,6 +433,8 @@ public class EventInstanceManager {
|
|||||||
TimerManager.getInstance().schedule(new Runnable() {
|
TimerManager.getInstance().schedule(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if(em == null) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
em.getIv().invokeFunction(methodName, EventInstanceManager.this);
|
em.getIv().invokeFunction(methodName, EventInstanceManager.this);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
@@ -431,8 +485,8 @@ public class EventInstanceManager {
|
|||||||
return props.getProperty(key);
|
return props.getProperty(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Properties getProperties(){
|
public Properties getProperties() {
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void leftParty(MapleCharacter chr) {
|
public void leftParty(MapleCharacter chr) {
|
||||||
@@ -451,7 +505,7 @@ public class EventInstanceManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishPQ() {
|
public void clearPQ() {
|
||||||
try {
|
try {
|
||||||
em.getIv().invokeFunction("clearPQ", this);
|
em.getIv().invokeFunction("clearPQ", this);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
@@ -472,149 +526,315 @@ public class EventInstanceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final MapleMap setInstanceMap(final int mapid) { //gets instance map from the channelserv
|
public final MapleMap setInstanceMap(final int mapid) { //gets instance map from the channelserv
|
||||||
if (disposed) {
|
if (disposed) {
|
||||||
|
return this.getMapFactory().getMap(mapid);
|
||||||
|
}
|
||||||
|
mapIds.add(mapid);
|
||||||
|
isInstanced.add(false);
|
||||||
return this.getMapFactory().getMap(mapid);
|
return this.getMapFactory().getMap(mapid);
|
||||||
}
|
|
||||||
mapIds.add(mapid);
|
|
||||||
isInstanced.add(false);
|
|
||||||
return this.getMapFactory().getMap(mapid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean disposeIfPlayerBelow(final byte size, final int towarp) {
|
public final boolean disposeIfPlayerBelow(final byte size, final int towarp) {
|
||||||
if (disposed) {
|
if (disposed) {
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
MapleMap map = null;
|
|
||||||
if (towarp > 0) {
|
|
||||||
map = this.getMapFactory().getMap(towarp);
|
|
||||||
}
|
|
||||||
|
|
||||||
rL.lock();
|
|
||||||
try {
|
|
||||||
if (chars != null && chars.size() < size) {
|
|
||||||
for (MapleCharacter chr : chars) {
|
|
||||||
if (chr == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
unregisterPlayer(chr);
|
|
||||||
if (towarp > 0) {
|
|
||||||
chr.changeMap(map, map.getPortal(0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dispose();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
MapleMap map = null;
|
||||||
ex.printStackTrace();
|
if (towarp > 0) {
|
||||||
} finally {
|
map = this.getMapFactory().getMap(towarp);
|
||||||
rL.unlock();
|
}
|
||||||
}
|
|
||||||
return false;
|
rL.lock();
|
||||||
|
try {
|
||||||
|
if (chars != null && chars.size() < size) {
|
||||||
|
for (MapleCharacter chr : chars) {
|
||||||
|
if (chr == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
unregisterPlayer(chr);
|
||||||
|
if (towarp > 0) {
|
||||||
|
chr.changeMap(map, map.getPortal(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Integer> convertToIntegerArray(List<Double> list) {
|
private List<Integer> convertToIntegerArray(List<Double> list) {
|
||||||
List<Integer> intList = new ArrayList<>();
|
List<Integer> intList = new ArrayList<>();
|
||||||
for(Double d: list) intList.add(d.intValue());
|
for(Double d: list) intList.add(d.intValue());
|
||||||
|
|
||||||
return intList;
|
return intList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventClearStageExp(List<Double> gain) {
|
||||||
|
onMapClearExp.clear();
|
||||||
|
onMapClearExp.addAll(convertToIntegerArray(gain));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventClearStageMeso(List<Double> gain) {
|
||||||
|
onMapClearMeso.clear();
|
||||||
|
onMapClearMeso.addAll(convertToIntegerArray(gain));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getClearStageExp(int stage) { //stage counts from ONE.
|
||||||
|
if(stage > onMapClearExp.size()) return 0;
|
||||||
|
return onMapClearExp.get(stage - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getClearStageMeso(int stage) { //stage counts from ONE.
|
||||||
|
if(stage > onMapClearMeso.size()) return 0;
|
||||||
|
return onMapClearMeso.get(stage - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getClearStageBonus(int stage) {
|
||||||
|
List<Integer> list = new ArrayList<>();
|
||||||
|
list.add(getClearStageExp(stage));
|
||||||
|
list.add(getClearStageMeso(stage));
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setEventRewards(List<Double> rwds, List<Double> qtys, int expGiven) {
|
public final void setEventRewards(List<Double> rwds, List<Double> qtys, int expGiven) {
|
||||||
setEventRewards(1, rwds, qtys, expGiven);
|
setEventRewards(1, rwds, qtys, expGiven);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setEventRewards(List<Double> rwds, List<Double> qtys) {
|
public final void setEventRewards(List<Double> rwds, List<Double> qtys) {
|
||||||
setEventRewards(1, rwds, qtys);
|
setEventRewards(1, rwds, qtys);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setEventRewards(int eventLevel, List<Double> rwds, List<Double> qtys) {
|
public final void setEventRewards(int eventLevel, List<Double> rwds, List<Double> qtys) {
|
||||||
setEventRewards(eventLevel, rwds, qtys, 0);
|
setEventRewards(eventLevel, rwds, qtys, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setEventRewards(int eventLevel, List<Double> rwds, List<Double> qtys, int expGiven) {
|
public final void setEventRewards(int eventLevel, List<Double> rwds, List<Double> qtys, int expGiven) {
|
||||||
// fixed EXP will be rewarded at the same time the random item is given
|
// fixed EXP will be rewarded at the same time the random item is given
|
||||||
|
|
||||||
if(eventLevel <= 0 || eventLevel > ServerConstants.MAX_EVENT_LEVELS) return;
|
if(eventLevel <= 0 || eventLevel > ServerConstants.MAX_EVENT_LEVELS) return;
|
||||||
eventLevel--; //event level starts from 1
|
eventLevel--; //event level starts from 1
|
||||||
|
|
||||||
List<Integer> rewardIds = convertToIntegerArray(rwds);
|
List<Integer> rewardIds = convertToIntegerArray(rwds);
|
||||||
List<Integer> rewardQtys = convertToIntegerArray(qtys);
|
List<Integer> rewardQtys = convertToIntegerArray(qtys);
|
||||||
|
|
||||||
//rewardsSet and rewardsQty hold temporary values
|
//rewardsSet and rewardsQty hold temporary values
|
||||||
collectionSet.put(eventLevel, rewardIds);
|
wL.lock();
|
||||||
collectionQty.put(eventLevel, rewardQtys);
|
try {
|
||||||
collectionExp.put(eventLevel, expGiven);
|
collectionSet.put(eventLevel, rewardIds);
|
||||||
|
collectionQty.put(eventLevel, rewardQtys);
|
||||||
|
collectionExp.put(eventLevel, expGiven);
|
||||||
|
} finally {
|
||||||
|
wL.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte getRewardListRequirements(int level) {
|
private byte getRewardListRequirements(int level) {
|
||||||
if(level >= collectionSet.size()) return 0;
|
if(level >= collectionSet.size()) return 0;
|
||||||
|
|
||||||
byte rewardTypes = 0;
|
byte rewardTypes = 0;
|
||||||
List<Integer> list = collectionSet.get(level);
|
List<Integer> list = collectionSet.get(level);
|
||||||
|
|
||||||
for (Integer itemId : list) {
|
for (Integer itemId : list) {
|
||||||
rewardTypes |= (1 << ItemConstants.getInventoryType(itemId).getType());
|
rewardTypes |= (1 << ItemConstants.getInventoryType(itemId).getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
return rewardTypes;
|
return rewardTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasRewardSlot(MapleCharacter player, int eventLevel) {
|
private boolean hasRewardSlot(MapleCharacter player, int eventLevel) {
|
||||||
byte listReq = getRewardListRequirements(eventLevel); //gets all types of items present in the event reward list
|
byte listReq = getRewardListRequirements(eventLevel); //gets all types of items present in the event reward list
|
||||||
|
|
||||||
//iterating over all valid inventory types
|
//iterating over all valid inventory types
|
||||||
for(byte type = 1; type <= 5; type++) {
|
for(byte type = 1; type <= 5; type++) {
|
||||||
if((listReq >> type) % 2 == 1 && !player.hasEmptySlot(type))
|
if((listReq >> type) % 2 == 1 && !player.hasEmptySlot(type))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean giveEventReward(MapleCharacter player) {
|
public final boolean giveEventReward(MapleCharacter player) {
|
||||||
return giveEventReward(player, 1);
|
return giveEventReward(player, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//gives out EXP & a random item in a similar fashion of when clearing KPQ, LPQ, etc.
|
//gives out EXP & a random item in a similar fashion of when clearing KPQ, LPQ, etc.
|
||||||
public final boolean giveEventReward(MapleCharacter player, int eventLevel) {
|
public final boolean giveEventReward(MapleCharacter player, int eventLevel) {
|
||||||
eventLevel--; //event level starts counting from 1
|
rL.lock();
|
||||||
if(eventLevel >= collectionSet.size()) return true;
|
try {
|
||||||
|
eventLevel--; //event level starts counting from 1
|
||||||
List<Integer> rewardsSet = collectionSet.get(eventLevel);
|
if(eventLevel >= collectionSet.size()) return true;
|
||||||
List<Integer> rewardsQty = collectionQty.get(eventLevel);
|
|
||||||
|
|
||||||
Integer rewardExp = collectionExp.get(eventLevel);
|
|
||||||
if(rewardExp == null) rewardExp = 0;
|
|
||||||
|
|
||||||
if(rewardsSet == null || rewardsSet.isEmpty()) {
|
|
||||||
if(rewardExp > 0) player.gainExp(rewardExp);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!hasRewardSlot(player, eventLevel)) return false;
|
|
||||||
|
|
||||||
AbstractPlayerInteraction api = new AbstractPlayerInteraction(player.getClient());
|
List<Integer> rewardsSet = collectionSet.get(eventLevel);
|
||||||
int rnd = (int)Math.floor(Math.random() * rewardsSet.size());
|
List<Integer> rewardsQty = collectionQty.get(eventLevel);
|
||||||
|
|
||||||
api.gainItem(rewardsSet.get(rnd), rewardsQty.get(rnd).shortValue());
|
Integer rewardExp = collectionExp.get(eventLevel);
|
||||||
if(rewardExp > 0) player.gainExp(rewardExp);
|
if(rewardExp == null) rewardExp = 0;
|
||||||
return true;
|
|
||||||
|
if(rewardsSet == null || rewardsSet.isEmpty()) {
|
||||||
|
if(rewardExp > 0) player.gainExp(rewardExp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!hasRewardSlot(player, eventLevel)) return false;
|
||||||
|
|
||||||
|
AbstractPlayerInteraction api = new AbstractPlayerInteraction(player.getClient());
|
||||||
|
int rnd = (int)Math.floor(Math.random() * rewardsSet.size());
|
||||||
|
|
||||||
|
api.gainItem(rewardsSet.get(rnd), rewardsQty.get(rnd).shortValue());
|
||||||
|
if(rewardExp > 0) player.gainExp(rewardExp);
|
||||||
|
return true;
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setEventCleared() {
|
||||||
|
eventCleared = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean isEventTeamLackingNow(boolean testLeader, int minPlayers, MapleCharacter quitter) {
|
||||||
|
if(eventCleared && getPlayerCount() > 1) return false;
|
||||||
|
|
||||||
|
if(!eventCleared && testLeader && getLeader().getId() == quitter.getId()) return true;
|
||||||
|
if(getPlayerCount() <= minPlayers) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isEventTeamTogether() {
|
public final boolean isEventTeamTogether() {
|
||||||
if(chars.size() <= 1) return true;
|
rL.lock();
|
||||||
|
try {
|
||||||
int mapId = chars.get(0).getMapId();
|
if(chars.size() <= 1) return true;
|
||||||
for(int i = 1; i < chars.size(); i++) {
|
|
||||||
if(chars.get(i).getMapId() != mapId) return false;
|
int mapId = chars.get(0).getMapId();
|
||||||
}
|
for(int i = 1; i < chars.size(); i++) {
|
||||||
|
if(chars.get(i).getMapId() != mapId) return false;
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void warpEventTeam(int warpTo) {
|
public final void warpEventTeam(int warpTo) {
|
||||||
for (MapleCharacter chr : chars) {
|
rL.lock();
|
||||||
chr.changeMap(warpTo);
|
try {
|
||||||
}
|
for (MapleCharacter chr : chars) {
|
||||||
|
chr.changeMap(warpTo);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final MapleCharacter getLeader() {
|
||||||
|
rL.lock();
|
||||||
|
try {
|
||||||
|
for (MapleCharacter chr : chars) {
|
||||||
|
if(chr.isPartyLeader()) return chr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void showWrongEffect() {
|
||||||
|
MapleMap map = getMapInstance(getLeader().getMapId());
|
||||||
|
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/wrong_kor"));
|
||||||
|
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Failed"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void showClearEffect() {
|
||||||
|
showClearEffect(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void showClearEffect(boolean hasGate) {
|
||||||
|
MapleMap map = getMapInstance(getLeader().getMapId());
|
||||||
|
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
|
||||||
|
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
|
||||||
|
if(hasGate) {
|
||||||
|
map.broadcastMessage(MaplePacketCreator.environmentChange("gate", 2));
|
||||||
|
wL.lock();
|
||||||
|
try {
|
||||||
|
openedGates.add(map.getId());
|
||||||
|
} finally {
|
||||||
|
wL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void recoverOpenedGate(MapleCharacter chr, int thisMapId) {
|
||||||
|
rL.lock();
|
||||||
|
try {
|
||||||
|
if(openedGates.contains(thisMapId)) {
|
||||||
|
chr.announce(MaplePacketCreator.environmentChange("gate", 2));
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void linkToNextStage(int thisStage, String eventFamily, int thisMapId) {
|
||||||
|
List<Integer> list = getClearStageBonus(thisStage); // will give bonus exp & mesos to everyone in the event
|
||||||
|
giveEventPlayersExp(list.get(0));
|
||||||
|
giveEventPlayersMeso(list.get(1));
|
||||||
|
|
||||||
|
thisStage--; //stages counts from ONE, scripts from ZERO
|
||||||
|
|
||||||
|
MapleMap nextStage = getMapInstance(thisMapId);
|
||||||
|
MaplePortal portal = nextStage.getPortal("next00");
|
||||||
|
if (portal != null) {
|
||||||
|
portal.setScriptName(eventFamily + thisStage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// registers a player status in an event
|
||||||
|
public final void gridInsert(MapleCharacter chr, int newStatus) {
|
||||||
|
wL.lock();
|
||||||
|
try {
|
||||||
|
playerGrid.put(chr.getId(), newStatus);
|
||||||
|
} finally {
|
||||||
|
wL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unregisters a player status in an event
|
||||||
|
public final void gridRemove(MapleCharacter chr) {
|
||||||
|
wL.lock();
|
||||||
|
try {
|
||||||
|
playerGrid.remove(chr.getId());
|
||||||
|
} finally {
|
||||||
|
wL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// checks a player status
|
||||||
|
public final int gridCheck(MapleCharacter chr) {
|
||||||
|
rL.lock();
|
||||||
|
try {
|
||||||
|
Integer i = playerGrid.get(chr.getId());
|
||||||
|
return (i != null) ? i : -1;
|
||||||
|
} finally {
|
||||||
|
rL.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void gridClear() {
|
||||||
|
wL.lock();
|
||||||
|
try {
|
||||||
|
playerGrid.clear();
|
||||||
|
} finally {
|
||||||
|
wL.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,56 +154,76 @@ public class EventManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Expedition method: starts an expedition
|
//Expedition method: starts an expedition
|
||||||
public void startInstance(MapleExpedition exped) {
|
public boolean startInstance(MapleExpedition exped) {
|
||||||
try {
|
try {
|
||||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
||||||
|
if(eim == null) return false;
|
||||||
|
|
||||||
eim.registerExpedition(exped);
|
eim.registerExpedition(exped);
|
||||||
exped.start();
|
exped.start();
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Regular method: player
|
//Regular method: player
|
||||||
public void startInstance(MapleCharacter chr) {
|
public boolean startInstance(MapleCharacter chr) {
|
||||||
try {
|
try {
|
||||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
||||||
|
if(eim == null) return false;
|
||||||
|
|
||||||
eim.registerPlayer(chr);
|
eim.registerPlayer(chr);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//PQ method: starts a PQ
|
//PQ method: starts a PQ
|
||||||
public void startInstance(MapleParty party, MapleMap map) {
|
public boolean startInstance(MapleParty party, MapleMap map) {
|
||||||
try {
|
try {
|
||||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
||||||
|
if(eim == null) return false;
|
||||||
|
|
||||||
eim.registerParty(party, map);
|
eim.registerParty(party, map);
|
||||||
party.setEligibleMembers(null);
|
party.setEligibleMembers(null);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//PQ method: starts a PQ with a difficulty level, requires function setup(difficulty, leaderid) instead of setup()
|
//PQ method: starts a PQ with a difficulty level, requires function setup(difficulty, leaderid) instead of setup()
|
||||||
public void startInstance(MapleParty party, MapleMap map, int difficulty) {
|
public boolean startInstance(MapleParty party, MapleMap map, int difficulty) {
|
||||||
try {
|
try {
|
||||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", difficulty, party.getLeader().getId()));
|
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", difficulty, party.getLeader().getId()));
|
||||||
|
if(eim == null) return false;
|
||||||
|
|
||||||
eim.registerParty(party, map);
|
eim.registerParty(party, map);
|
||||||
party.setEligibleMembers(null);
|
party.setEligibleMembers(null);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//non-PQ method for starting instance
|
//non-PQ method for starting instance
|
||||||
public void startInstance(EventInstanceManager eim, String leader) {
|
public boolean startInstance(EventInstanceManager eim, String leader) {
|
||||||
try {
|
try {
|
||||||
|
if(eim == null) return false;
|
||||||
|
|
||||||
iv.invokeFunction("setup", eim);
|
iv.invokeFunction("setup", eim);
|
||||||
eim.setProperty("leader", leader);
|
eim.setProperty("leader", leader);
|
||||||
} catch (ScriptException | NoSuchMethodException ex) {
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaplePartyCharacter> getEligibleParty(MapleParty party) {
|
public List<MaplePartyCharacter> getEligibleParty(MapleParty party) {
|
||||||
@@ -225,6 +245,14 @@ public class EventManager {
|
|||||||
return(new ArrayList<>());
|
return(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearPQ(EventInstanceManager eim) {
|
||||||
|
try {
|
||||||
|
iv.invokeFunction("clearPQ", eim);
|
||||||
|
} catch (ScriptException | NoSuchMethodException ex) {
|
||||||
|
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void clearPQ(EventInstanceManager eim, MapleMap toMap) {
|
public void clearPQ(EventInstanceManager eim, MapleMap toMap) {
|
||||||
try {
|
try {
|
||||||
iv.invokeFunction("clearPQ", eim, toMap);
|
iv.invokeFunction("clearPQ", eim, toMap);
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
|||||||
if (gain > 0 && ServerConstants.USE_AUTOBAN == true) {
|
if (gain > 0 && ServerConstants.USE_AUTOBAN == true) {
|
||||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " gained " + gain + " mesos from NPC " + npc + "\r\n");
|
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " gained " + gain + " mesos from NPC " + npc + "\r\n");
|
||||||
}
|
}
|
||||||
getPlayer().gainMeso(gain, true, false, true);
|
getPlayer().gainMeso(gain);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void gainExp(int gain) {
|
public void gainExp(int gain) {
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ public class MapleQuest {
|
|||||||
|
|
||||||
MapleQuestRequirement req = this.getRequirement(type, startReq);
|
MapleQuestRequirement req = this.getRequirement(type, startReq);
|
||||||
|
|
||||||
if(req == null)
|
if(req == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (type.equals(MapleQuestRequirementType.MOB)) {
|
if (type.equals(MapleQuestRequirementType.MOB)) {
|
||||||
for (MapleData mob : startReq.getChildren()) {
|
for (MapleData mob : startReq.getChildren()) {
|
||||||
@@ -161,15 +161,46 @@ public class MapleQuest {
|
|||||||
public static MapleQuest getInstance(int id) {
|
public static MapleQuest getInstance(int id) {
|
||||||
MapleQuest ret = quests.get(id);
|
MapleQuest ret = quests.get(id);
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
questInfo = questData.getData("QuestInfo.img");
|
questInfo = questData.getData("QuestInfo.img");
|
||||||
questReq = questData.getData("Check.img");
|
questReq = questData.getData("Check.img");
|
||||||
questAct = questData.getData("Act.img");
|
questAct = questData.getData("Act.img");
|
||||||
|
|
||||||
ret = new MapleQuest(id);
|
ret = new MapleQuest(id);
|
||||||
quests.put(id, ret);
|
quests.put(id, ret);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getIntervalTimeLeft(MapleCharacter c, IntervalRequirement r) {
|
||||||
|
StringBuilder str = new StringBuilder();
|
||||||
|
|
||||||
|
long futureTime = c.getQuest(MapleQuest.getInstance(getId())).getCompletionTime() + r.getInterval();
|
||||||
|
long leftTime = futureTime - System.currentTimeMillis();
|
||||||
|
|
||||||
|
byte mode = 0;
|
||||||
|
if(leftTime / (60*1000) > 0) {
|
||||||
|
mode++; //counts minutes
|
||||||
|
|
||||||
|
if(leftTime / (60*60*1000) > 0)
|
||||||
|
mode++; //counts hours
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(mode) {
|
||||||
|
case 2:
|
||||||
|
int hours = (int) ((leftTime / (1000*60*60)));
|
||||||
|
str.append(hours + " hours, ");
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
int minutes = (int) ((leftTime / (1000*60)) % 60);
|
||||||
|
str.append(minutes + " minutes, ");
|
||||||
|
|
||||||
|
default:
|
||||||
|
int seconds = (int) (leftTime / 1000) % 60 ;
|
||||||
|
str.append(seconds + " seconds");
|
||||||
|
}
|
||||||
|
|
||||||
|
return str.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean canStart(MapleCharacter c, int npcid) {
|
public boolean canStart(MapleCharacter c, int npcid) {
|
||||||
if (c.getQuest(this).getStatus() != Status.NOT_STARTED && !(c.getQuest(this).getStatus() == Status.COMPLETED && repeatable)) {
|
if (c.getQuest(this).getStatus() != Status.NOT_STARTED && !(c.getQuest(this).getStatus() == Status.COMPLETED && repeatable)) {
|
||||||
@@ -177,6 +208,9 @@ public class MapleQuest {
|
|||||||
}
|
}
|
||||||
for (MapleQuestRequirement r : startReqs.values()) {
|
for (MapleQuestRequirement r : startReqs.values()) {
|
||||||
if (!r.check(c, npcid)) {
|
if (!r.check(c, npcid)) {
|
||||||
|
if(r.getType().getType() == MapleQuestRequirementType.INTERVAL.getType()) {
|
||||||
|
c.message("This quest will become available again in approximately " + getIntervalTimeLeft(c, (IntervalRequirement)r) + ".");
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -198,9 +232,9 @@ public class MapleQuest {
|
|||||||
public void start(MapleCharacter c, int npc) {
|
public void start(MapleCharacter c, int npc) {
|
||||||
if (autoStart || canStart(c, npc)) {
|
if (autoStart || canStart(c, npc)) {
|
||||||
for (MapleQuestAction a : startActs.values()) {
|
for (MapleQuestAction a : startActs.values()) {
|
||||||
if (!a.check(c, null)) { // would null be good ?
|
if (!a.check(c, null)) { // would null be good ?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
a.run(c, null);
|
a.run(c, null);
|
||||||
}
|
}
|
||||||
forceStart(c, npc);
|
forceStart(c, npc);
|
||||||
@@ -212,20 +246,20 @@ public class MapleQuest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void complete(MapleCharacter c, int npc, Integer selection) {
|
public void complete(MapleCharacter c, int npc, Integer selection) {
|
||||||
if (autoPreComplete || canComplete(c, npc)) {
|
if (autoPreComplete || canComplete(c, npc)) {
|
||||||
for (MapleQuestAction a : completeActs.values()) {
|
for (MapleQuestAction a : completeActs.values()) {
|
||||||
if (!a.check(c, selection)) {
|
if (!a.check(c, selection)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
forceComplete(c, npc);
|
forceComplete(c, npc);
|
||||||
for (MapleQuestAction a : completeActs.values()) {
|
for (MapleQuestAction a : completeActs.values()) {
|
||||||
a.run(c, selection);
|
a.run(c, selection);
|
||||||
}
|
}
|
||||||
|
|
||||||
c.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); // Quest completion
|
c.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9)); // Quest completion
|
||||||
c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false); //use 9 instead of 12 for both
|
c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false); //use 9 instead of 12 for both
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset(MapleCharacter c) {
|
public void reset(MapleCharacter c) {
|
||||||
@@ -314,9 +348,9 @@ public class MapleQuest {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTimeLimit() {
|
public int getTimeLimit() {
|
||||||
return timeLimit;
|
return timeLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void clearCache(int quest) {
|
public static void clearCache(int quest) {
|
||||||
if(quests.containsKey(quest)){
|
if(quests.containsKey(quest)){
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ public class IntervalRequirement extends MapleQuestRequirement {
|
|||||||
questID = quest.getId();
|
questID = quest.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getInterval() {
|
||||||
|
return interval;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processData(MapleData data) {
|
public void processData(MapleData data) {
|
||||||
|
|||||||
@@ -51,6 +51,6 @@ public abstract class MapleQuestRequirement {
|
|||||||
public abstract void processData(MapleData data);
|
public abstract void processData(MapleData data);
|
||||||
|
|
||||||
public MapleQuestRequirementType getType() {
|
public MapleQuestRequirementType getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2508,6 +2508,7 @@ public class MaplePacketCreator {
|
|||||||
* @param progress
|
* @param progress
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static byte[] updateQuestInfo(short quest, int npc) {
|
public static byte[] updateQuestInfo(short quest, int npc) {
|
||||||
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||||
mplew.writeShort(SendOpcode.UPDATE_QUEST_INFO.getValue());
|
mplew.writeShort(SendOpcode.UPDATE_QUEST_INFO.getValue());
|
||||||
|
|||||||
Reference in New Issue
Block a user