CWKPQ inclusion

Added some CWKPQ imports for the server. Enabled basic mechanics for a
run, but still WIP.
This commit is contained in:
ronancpl
2017-06-26 01:34:56 -03:00
parent 6b2b3616d6
commit a7beff1bb4
101 changed files with 4455 additions and 3821 deletions

View File

@@ -1,4 +1,4 @@
#Wed, 21 Jun 2017 00:41:12 -0300
#Mon, 26 Jun 2017 01:21:39 -0300
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=

BIN
dist/MapleSolaxia.jar vendored

Binary file not shown.

View File

@@ -337,4 +337,7 @@ Definido um suporte para o esquema de expedi
21 Junho 2017,
Corrigido vários aspectos de guilds e alliances, que operavam irregularmente no cliente.
Corrigido "player logged in" aparecendo sempre que jogador troca de canal.
MGC do jogador agora está sincronizado com o MGC da guild, não o contrário.
MGC do jogador agora está sincronizado com o MGC da guild, não o contrário.
23 - 26 Junho 2017,
Diversas reimplementações de mecânicas da CWKPQ, ainda trabalho em progresso.

View File

@@ -3,21 +3,31 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AllianceOperationHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerLoggedinHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010009.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/GuildOperationHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuildCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010008.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/1092014.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/6109000.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/glpqPortal6.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201112.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/PortalFactory.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/AbstractPlayerInteraction.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerInteractionHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/portal/PortalPlayerInteraction.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/reactor/6102001.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleGenericPortal.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201107.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/event/CWKPQ.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/ChangeMapHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/glpqPortal7.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201110.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/glpqPortal3.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleJob.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/portal/PortalScriptManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/InnerPortalHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201115.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MaplePortal.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201108.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9201109.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/portal/party3_r6pt.js</file>
</group>
</open-files>
</project-private>

View File

@@ -1,3 +1,5 @@
var minPlayers = 1;
var mapz = Array(100, 200, 300, 400, 500, 510, 520, 521, 522, 530, 540, 550, 600, 700, 800);
var a = Array("a", "b", "c", "d", "e", "f", "g", "h", "i");
/*
@@ -23,31 +25,83 @@ function init() {
function afterSetup(eim) {}
function setup(leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
em.setProperty("current_instance", "0");
em.setProperty("glpq1", "0");
em.setProperty("glpq2", "0");
em.setProperty("glpq3", "0");
em.setProperty("glpq4", "0");
em.setProperty("glpq5", "0");
em.setProperty("glpq6", "0");
function getNameFromList(index, array) {
return array[index];
}
function generateMapReactors(map) {
var jobReactors = [ [0, 0, -1, -1, 0],
[-1, 4, 3, 3, 3],
[1, 3, 4, 2, 2],
[2, -1, 0, 1, -1],
[3, 2, 1, 0, -1],
[4, 1, -1, 4, 1],
[-1, 2, 4],
[-1, -1]
];
var rndIndex;
var jobFound;
while(true) {
jobFound = {};
rndIndex = [];
for(var i = 0; i < jobReactors.length; i++) {
var jobReactorSlot = jobReactors[i];
var idx = Math.floor(Math.random() * jobReactorSlot.length);
jobFound["" + jobReactorSlot[idx]] = 1;
rndIndex.push(idx);
}
if(Object.keys(jobFound).length == 6) break;
}
var toDeploy = [];
toDeploy.push(getNameFromList(rndIndex[0], ["4skill0a", "4skill0b", "4fake1c", "4fake1d", "4skill0e"]));
toDeploy.push(getNameFromList(rndIndex[1], ["4fake0a", "4skill4b", "4skill3c", "4skill3d", "4skill3e"]));
toDeploy.push(getNameFromList(rndIndex[2], ["4skill1a", "4skill3b", "4skill4c", "4skill2d", "4skill2e"]));
toDeploy.push(getNameFromList(rndIndex[3], ["4skill2a", "4fake1b", "4skill0c", "4skill1d", "4fake1e"]));
toDeploy.push(getNameFromList(rndIndex[4], ["4skill3a", "4skill2b", "4skill1c", "4skill0d", "4fake0e"]));
toDeploy.push(getNameFromList(rndIndex[5], ["4skill4a", "4skill1b", "4fake0c", "4skill4d", "4skill1e"]));
toDeploy.push(getNameFromList(rndIndex[6], ["4fake1a", "4skill2c", "4skill4e"]));
toDeploy.push(getNameFromList(rndIndex[7], ["4fake0b", "4fake0d"]));
var toRandomize = new Array();
for(var i = 0; i < toDeploy.length; i++) {
var react = map.getReactorByName(toDeploy[i]);
react.setState(1);
toRandomize.push(react);
}
map.shuffleReactors(toRandomize);
}
function setup(channel) {
var eim = em.newInstance("CWKPQ" + channel);
eim.setProperty("state", "1");
eim.setProperty("leader", "true");
eim.setProperty("current_instance", "0");
eim.setProperty("glpq1", "0");
eim.setProperty("glpq2", "0");
eim.setProperty("glpq3", "0");
eim.setProperty("glpq3_p", "0");
eim.setProperty("glpq4", "0");
eim.setProperty("glpq5", "0");
eim.setProperty("glpq5_room", "0");
eim.setProperty("glpq6", "0");
var eim = em.newInstance("CWKPQ" + leaderid);
for (var i = 0; i < mapz.length; i++) {
var map = eim.getInstanceMap(610030000 + mapz[i]);
if (map != null) {
map.resetFully();
if (map.getId() == 610030400) {
map.setReactorState(); //because everything is at 0 =[
map.limitReactor(6109016, 1);
map.limitReactor(6109017, 1);
map.limitReactor(6109018, 1);
map.limitReactor(6109019, 1);
map.limitReactor(6109020, 1);
map.shuffleReactors(6109016, 6109020);
map.destroyReactors(6108000, 6108005); //destroy the fake ones, non-GMS like or is this necessary
generateMapReactors(map);
//add environments
for (var x = 0; x < a.length; x++) {
@@ -86,18 +140,18 @@ function setup(leaderid) {
function playerEntry(eim, player) {
eim.dropMessage(5, "[Expedition] " + player.getName() + " has entered the map.");
var map = eim.getMapInstance(610030100 + (parseInt(em.getProperty("current_instance")) * 100));
var map = eim.getMapInstance(610030100 + (eim.getIntProperty("current_instance") * 100));
player.changeMap(map, map.getPortal(0));
}
function spawnGuardians(eim) {
var map = eim.getMapInstance(0);
var map = eim.getMapInstance(610030100);
if (map.countPlayers() <= 0) {
return;
}
eim.dropMessage(5, "The Master Guardians have detected you.");
map.broadcastStringMessage(5, "The Master Guardians have detected you.");
for (var i = 0; i < 20; i++) { //spawn 20 guardians
var mob = em.getMonster(9400594);
var mob = eim.getMonster(9400594);
eim.registerMonster(mob);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(1000, 336));
}
@@ -115,39 +169,39 @@ function changedMap(eim, player, mapid) {
} else {
switch(mapid) {
case 610030200:
if (em.getProperty("current_instance").equals("0")) {
if (eim.getIntProperty("current_instance") == 0) {
eim.restartEventTimer(600000); //10 mins
em.setProperty("current_instance", "1");
eim.setIntProperty("current_instance", 1);
}
break;
case 610030300:
if (em.getProperty("current_instance").equals("1")) {
if (eim.getIntProperty("current_instance") == 1) {
eim.restartEventTimer(600000); //10 mins
em.setProperty("current_instance", "2");
eim.setIntProperty("current_instance", 2);
}
break;
case 610030400:
if (em.getProperty("current_instance").equals("2")) {
if (eim.getIntProperty("current_instance") == 2) {
eim.restartEventTimer(600000); //10 mins
em.setProperty("current_instance", "3");
eim.setIntProperty("current_instance", 3);
}
break;
case 610030500:
if (em.getProperty("current_instance").equals("3")) {
if (eim.getIntProperty("current_instance") == 3) {
eim.restartEventTimer(1200000); //20 mins
em.setProperty("current_instance", "4");
eim.setIntProperty("current_instance", 4);
}
break;
case 610030600:
if (em.getProperty("current_instance").equals("4")) {
if (eim.getIntProperty("current_instance") == 4) {
eim.restartEventTimer(3600000); //1 hr
em.setProperty("current_instance", "5");
eim.setIntProperty("current_instance", 5);
}
break;
case 610030800:
if (em.getProperty("current_instance").equals("5")) {
if (eim.getIntProperty("current_instance") == 5) {
eim.restartEventTimer(60000); //1 min
em.setProperty("current_instance", "6");
eim.setIntProperty("current_instance", 6);
}
break;
}
@@ -182,7 +236,6 @@ function end(eim) {
function clearPQ(eim) {
eim.setEventCleared();
end(eim);
}
function monsterKilled(mob, eim) {}
@@ -191,4 +244,5 @@ function allMonstersDead(eim) {}
function leftParty (eim, player) {}
function disbandParty (eim) {}
function playerDead(eim, player) {}
function cancelSchedule() {}
function cancelSchedule() {}
function dispose(eim) {}

33
scripts/npc/9201107.js Normal file
View File

@@ -0,0 +1,33 @@
/* @Author SharpAceX
*/
function start() {
if (cm.getPlayer().getMapId() == 610030500) {
cm.sendOk("Unbelievable strength and power, anyone can be achieve. But what makes a warrior special is their iron will. No matter the odds, a true warrior pushes through until victory is assured. Thus, the Warrior Chamber is a brutal road where the room itself is against you, as well as the ultra-strong monsters within. Use your skills to shake off the effects and defeat the monsters within to reach the Warrior Statue and claim the Master Sword. Good luck!");
cm.dispose();
} else if (cm.getPlayer().getMap().getId() == 610030000) {
cm.sendOk("A legendary family of heroes, the de Vrisiens are the original founders of the Stormcasters. The family is unique, as each son or daughter inherits the full fighting techniques of their ancestors. This ability has proven to be immensely useful; as it allows for nearly unlimited strategy, improvisation and tactics to defeat all enemies. A true family for the generations.");
cm.dispose();
} else if (cm.getPlayer().getMapId() == 610030510) {
if (cm.getPlayer().getMap().countMonsters() == 0) {
var eim = cm.getEventInstance();
var stgStatus = eim.getIntProperty("glpq5_room");
var jobNiche = cm.getPlayer().getJob().getJobNiche();
if ((stgStatus >> jobNiche) % 2 == 0) {
if(cm.canHold(4001259, 1)) {
cm.gainItem(4001259, 1);
cm.sendOk("Good job.");
stgStatus += (1 << jobNiche);
eim.setIntProperty("glpq5_room", stgStatus);
} else {
cm.sendOk("Make room on your ETC inventory first.");
}
}
} else {
cm.sendOk("Eliminate all Crimson Guardians.");
}
cm.dispose();
}
}

33
scripts/npc/9201108.js Normal file
View File

@@ -0,0 +1,33 @@
/* @Author SharpAceX
*/
function start() {
if (cm.getPlayer().getMapId() == 610030500) {
cm.sendOk("A legendary creature known as the Master Guardian awaits you. It was a Crimson Guardian that Ridley once experimented on, which resulted in its becoming highly resistant to magic attacks, spears, maces, everything--except arrows fired with exceptional power. Bowmen and women! As undisputed masters of the Bow and Arrow, you must use your most powerful attacks--everything from Strafe to Hurricane to Piercing Arrow to destroy this powerful creature and reach the Bowman Statue to claim The Ancestral Bow! Good luck!");
cm.dispose();
} else if (cm.getPlayer().getMap().getId() == 610030000) {
cm.sendOk("One of the only known Holy Archers, Lockewood is one of the Keep's most famous heroes. Of particular note is his custom white and gold battle barb, said to be blessed by a powerfull goddess. His aim was tremendously accurate over long distanes. Feared and respected for his 'Genesis Arrow' and 'Doom Phoenix', he once struck down six Typhons from the Valley of Heroes.");
cm.dispose();
} else if (cm.getPlayer().getMapId() == 610030540) {
if (cm.getPlayer().getMap().countMonsters() == 0) {
var eim = cm.getEventInstance();
var stgStatus = eim.getIntProperty("glpq5_room");
var jobNiche = cm.getPlayer().getJob().getJobNiche();
if ((stgStatus >> jobNiche) % 2 == 0) {
if(cm.canHold(4001258, 1)) {
cm.gainItem(4001258, 1);
cm.sendOk("Good job.");
stgStatus += (1 << jobNiche);
eim.setIntProperty("glpq5_room", stgStatus);
} else {
cm.sendOk("Make room on your ETC inventory first.");
}
}
} else {
cm.sendOk("Eliminate all Master Guardians.");
}
cm.dispose();
}
}

40
scripts/npc/9201109.js Normal file
View File

@@ -0,0 +1,40 @@
/* @Author SharpAceX
*/
function start() {
if (cm.getPlayer().getMapId() == 610030500) {
cm.sendOk("As a powerful Elite Mage, Ridly knew the value of intelligence, the hallmark quality of a wizard. Thus, the Mage Chamber is a twisting maze of devious conception--the Teleport skill is the only skill you can use inside to get around, and Magic Claw is the only skill that will break the statues. You must also kill numerous monsters within. After you solve the maze and defeat all the foes within it, deduce which Mage Statue hides the Staff of First Magic and break it open to claim it! Good luck!");
cm.dispose();
} else if (cm.getPlayer().getMap().getId() == 610030000) {
cm.sendOk("A name forever remembered, Rafael was an exceptionally skilled sorcerer, and the foremost master of mental magic powers, telekinesis and telepathy. In addition to that, he was one of the 'Elite Mages' who mastered all the elements. He was last seen looking for the 'Temple of the Elementals' to turn the tide against the invading Krakian Army...");
cm.dispose();
} else if (cm.getPlayer().getMapId() == 610030521) {
if (cm.getPlayer().getMap().countMonsters() == 0) {
cm.warp(610030522,0);
} else {
cm.sendOk("Eliminate all monsters.");
}
cm.dispose();
} else if (cm.getPlayer().getMapId() == 610030522) {
if (cm.getPlayer().getMap().countMonsters() == 0) {
var eim = cm.getEventInstance();
var stgStatus = eim.getIntProperty("glpq5_room");
var jobNiche = cm.getPlayer().getJob().getJobNiche();
if ((stgStatus >> jobNiche) % 2 == 0) {
if(cm.canHold(4001257, 1)) {
cm.gainItem(4001257, 1);
cm.sendOk("Good job.");
stgStatus += (1 << jobNiche);
eim.setIntProperty("glpq5_room", stgStatus);
} else {
cm.sendOk("Make room on your ETC inventory first.");
}
}
} else {
cm.sendOk("Eliminate all monsters.");
}
cm.dispose();
}
}

35
scripts/npc/9201110.js Normal file
View File

@@ -0,0 +1,35 @@
/* @Author SharpAceX
*/
function start() {
switch(cm.getPlayer().getMapId()) {
case 610030500:
cm.sendOk("As every Thief knows, the best attack is the one you never see coming. So, to best illustrate this, you'll be in a chamber with platforms and ledges that you can only get to with Haste, as well as All-Seeing Eyes that your dagger or claw must close--permanently. After all the All-Seeing Eyes have been eliminated, get ti the Thief Statue and lay claim to the Primal Claw! Good luck!");
break;
case 610030000:
cm.sendOk("Once known as the 'Prince of Shadows', Grandmaster Ryo possessed supreme speed and power with short-ranged daggers and longer chain-like Claw. A part-time memeber of the Bosshunters, he was reowned for unparalleled ability to blend into the very nigth itself. His legend grew during a battle with Crimson Balrog, where he moved so swiftly that Balrog's attacks only caught air. Ryo also performed occasional 'retrievals' for those less fortunate than himself.");
break;
case 610030530:
if (cm.isAllReactorState(6108004, 1) && !cm.haveItem(4001256, 1)) {
var eim = cm.getEventInstance();
var stgStatus = eim.getIntProperty("glpq5_room");
var jobNiche = cm.getPlayer().getJob().getJobNiche();
if ((stgStatus >> jobNiche) % 2 == 0) {
if(cm.canHold(4001256, 1)) {
cm.gainItem(4001256, 1);
cm.sendOk("Good job.");
stgStatus += (1 << jobNiche);
eim.setIntProperty("glpq5_room", stgStatus);
} else {
cm.sendOk("Make room on your ETC inventory first.");
}
}
} else {
cm.sendOk("Go now, destroy all of the watchful eyes with your mobility skills, fellow Thief. Report back to me when you are done.");
}
break;
}
cm.dispose();
}

12
scripts/npc/9201111.js Normal file
View File

@@ -0,0 +1,12 @@
/* @Author SharpAceX
*/
function start() {
if (cm.getPlayer().getMap().getId() == 610030500) {
cm.sendOk("You're about to get wet and do what a Pirate does best--dig for booty! Be careful--that water beneath is known as Heavy Water, and it's so dense that I doubt you could swim through it! You'll have to make your way around....The relic you seek is known as the Forbidden Gun, which is an ancient weapon of the finest Pirate to grace the shores of Masteria--Steel Fist Jack! It's been buried in one of the many treasure chests you'll find below the sea. It won't be easy...Pirates were known for burying things in the most unlikely places, so dig deep and keep your guard up. There are sharks and much worse in those waters!");
cm.dispose();
} else if (cm.getPlayer().getMap().getId() == 610030000) {
cm.sendOk("Long ago, a strange warrior washed upon the shores of Masteria. This being claimed to be a member of a mysterious band of warriors that used claw-like weapons and projectile-based artillery to defeat foes. Known as 'Steel Fist Jack', his cunning and trickery in battle was devilishly effective. He eventually built a boat and left the Keep in search of his former crew and captain.");
cm.dispose();
}
}

86
scripts/npc/9201112.js Normal file
View File

@@ -0,0 +1,86 @@
var status = -1;
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (status == 1 && mode == 0) {
cm.dispose();
return;
}
if (mode == 1) {
status++;
} else {
status--;
}
var eim = cm.getEventInstance();
if (eim == null) {
cm.sendNext("The event isn't started...");
cm.dispose();
return;
}
if (!cm.isEventLeader()) {
cm.sendNext("I wish for your leader to talk to me.");
cm.dispose();
return;
}
switch(cm.getPlayer().getMapId()) {
case 610030100:
if (status == 0) {
cm.sendNext("Agh, you have made it in. Let me tell you real quick: they've caught us already. Master Guardians are about to come here in about a minute. We'd better hurry.");
} else if (status == 1) {
cm.sendNext("The portal to the Twisted Masters is busted. We have to find an alternate way, one that will take us through many death traps.");
} else if (status == 2) {
cm.sendNext("You can find the portal somewhere around here... you'd better find it, quick. I'll catch up.");
cm.dispose();
eim.setProperty("glpq1", "1");
}
break;
case 610030200:
if (status == 0) {
cm.sendNext("That was a success! Now, for this path, I do believe we need one of every Adventurer class to get past.");
} else if (status == 1) {
cm.sendNext("They need to use their skills on each of these things called Sigils. Once all five have been done, we can get past.");
cm.dispose();
}
break;
case 610030300:
if (status == 0) {
cm.sendNext("Now what we have here are more Sigils. All five Adventurers have to climb to the very top and go through the portal.");
} else if (status == 1) {
cm.sendNext("Beware of these death traps: Menhirs. They really pack a punch.");
cm.dispose();
}
break;
case 610030400:
if (status == 0) {
cm.sendNext("Now what we have here are more Sigils. However, some of them don't work. Here all jobs must fill their roles, as at least one of these Sigils are activated by their job skills, however there can be more than one per job, so be sure to test them all.");
} else if (status == 1) {
cm.sendNext("These Stirges will get in your way, but they're merely a distraction. Try every one of these Sigils until they work.");
cm.dispose();
}
break;
case 610030500:
if (status == 0) {
cm.sendNext("Surprised you made it this far! What you see here is the statue of Crimsonwood Keep, but without any of it's weapons.");
} else if (status == 1) {
cm.sendNext("There are five rooms, marked by a statue near each of them, around the statue.");
} else if (status == 2) {
cm.sendNext("I suspect that each of these rooms have one of the statue's five weapons.");
} else if (status == 3) {
cm.sendNext("Bring back the weapons and restore them to the Relic of Mastery!");
cm.dispose();
}
break;
case 610030700:
cm.sendNext("That was some good work out there! This leads the way to the Twisted Masters' Armory.");
cm.dispose();
break;
}
}
}

94
scripts/npc/9201115.js Normal file
View File

@@ -0,0 +1,94 @@
var status = -1;
function start() {
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1) {
status++;
} else {
status--;
}
if (!cm.isEventLeader()) {
cm.sendNext("I wish for your leader to talk to me.");
cm.dispose();
return;
}
var eim = cm.getEventInstance();
if (eim != null) {
if (eim.getIntProperty("glpq6") == 0) {
if (status == 0) {
cm.sendNext("Welcome to the Twisted Masters' Keep. I will be your host for this evening...");
} else if (status == 1) {
cm.sendNext("Tonight, we have a feast of a squad of Maplers.. ahaha...");
} else if (status == 2) {
cm.sendNext("Let our specially trained Master Guardians escort you!");
cm.mapMessage(6, "Engarde! Master Guardians approach!");
for (var i = 0; i < 10; i++) {
var mob = eim.getMonster(9400594);
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (java.lang.Math.random() * 1337), 276));
}
for (var i = 0; i < 20; i++) {
var mob = eim.getMonster(9400582);
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1337 + (java.lang.Math.random() * 1337), 276));
}
eim.setIntProperty("glpq6", 1);
cm.dispose();
}
} else if (eim.getIntProperty("glpq6") == 1) {
if (cm.getMap().countMonsters() == 0) {
if (status == 0) {
cm.sendOk("Eh. What is this? You've defeated them?");
} else if (status == 1) {
cm.sendNext("Well, no matter! The Twisted Masters will be glad to welcome you.");
cm.mapMessage(6, "Twisted Masters approach!");
//MV or Heron
var mob = eim.getMonster(9400589);
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-1000, 276));
//Margana
var mob = eim.getMonster(9400590);
cm.getMap().spawnMonsterOnGroundBelow(mob, new java.awt.Point(-22, 1));
//Red Nirg
var mob2 = eim.getMonster(9400591);
cm.getMap().spawnMonsterOnGroundBelow(mob2, new java.awt.Point(-22, 276));
//Hsalf
var mob4 = eim.getMonster(9400593);
cm.getMap().spawnMonsterOnGroundBelow(mob4, new java.awt.Point(496, 276));
//Rellik
var mob3 = eim.getMonster(9400592);
cm.getMap().spawnMonsterOnGroundBelow(mob3, new java.awt.Point(-496, 276));
eim.setIntProperty("glpq6", 2);
cm.dispose();
}
} else {
cm.sendOk("Pay no attention to me. The Master Guardians will escort you!");
cm.dispose();
}
} else if (eim.getIntProperty("glpq6") == 2) {
if (cm.getMap().countMonsters() == 0) {
cm.sendOk("WHAT? Ugh... this can't be happening.");
cm.mapMessage(5, "The portal to the next stage has opened!");
eim.setIntProperty("glpq6", 3);
eim.showClearEffect(true);
eim.clearPQ();
cm.dispose();
} else {
cm.sendOk("Pay no attention to me. The Twisted Masters will escort you!");
cm.dispose();
}
} else {
cm.dispose();
}
} else {
cm.dispose();
}
}

View File

@@ -0,0 +1,11 @@
function enter(pi) {
if (pi.getEventInstance().getIntProperty("glpq1") == 0) {
pi.getEventInstance().dropMessage(5, "This path is currently blocked.");
return false;
} else {
pi.warp(610030200, 0);
return true;
}
}

View File

@@ -0,0 +1,9 @@
function enter(pi) {
if (pi.getPlayer().getJob().getJobNiche() == 1) {
pi.warp(610030510,0);
return true;
} else {
pi.playerMessage(5, "Only warriors may enter this portal.");
return false;
}
}

View File

@@ -0,0 +1,9 @@
function enter(pi) {
if (pi.getPlayer().getJob().getJobNiche() == 3) {
pi.warp(610030540,0);
return true;
} else {
pi.playerMessage(5, "Only bowmen may enter this portal.");
return false;
}
}

View File

@@ -0,0 +1,9 @@
function enter(pi) {
if (pi.getPlayer().getJob().getJobNiche() == 2) {
pi.warp(610030521,0);
return true;
} else {
pi.playerMessage(5, "Only mages may enter this portal.");
return false;
}
}

View File

@@ -0,0 +1,9 @@
function enter(pi) {
if (pi.getPlayer().getJob().getJobNiche() == 4) {
pi.warp(610030530,0);
return true;
} else {
pi.playerMessage(5, "Only thieves may enter this portal.");
return false;
}
}

View File

@@ -0,0 +1,9 @@
function enter(pi) {
if (pi.getPlayer().getJob().getJobNiche() == 5) {
pi.warp(610030550,0);
return true;
} else {
pi.playerMessage(5, "Only pirates may enter this portal.");
return false;
}
}

View File

@@ -0,0 +1,14 @@
function enter(pi) {
var eim = pi.getEventInstance();
if (eim != null) {
if (eim.getIntProperty("glpq2") == 5) {
pi.warp(610030300, 0);
return true;
} else {
pi.playerMessage(5, "The portal has not been activated yet!");
return false;
}
}
return false;
}

View File

@@ -0,0 +1,28 @@
function enter(pi) {
var eim = pi.getEventInstance();
if (eim != null) {
pi.warp(610030300, 0);
if (eim.getIntProperty("glpq3") < 5 || eim.getIntProperty("glpq3_p") < 5) {
if(eim.getIntProperty("glpq3_p") == 5) {
pi.mapMessage(6, "Not all Sigils have been activated yet. Make sure they have all been activated to proceed to the next stage.");
} else {
eim.setIntProperty("glpq3_p", eim.getIntProperty("glpq3_p") + 1);
if(eim.getIntProperty("glpq3_p") == 5) {
pi.mapMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030300, "3pt", 2);
} else {
pi.mapMessage(6, "An adventurer has passed through! " + (5 - eim.getIntProperty("glpq3_p")) + " to go.");
}
}
}
else {
pi.getPlayer().dropMessage(6, "The portal at the bottom has already been opened! Proceed there!");
}
return true;
}
return false;
}

View File

@@ -0,0 +1,14 @@
function enter(pi) {
var eim = pi.getEventInstance();
if (eim != null) {
if (eim.getIntProperty("glpq3") != 5 || eim.getIntProperty("glpq3_p") != 5) {
pi.playerMessage(5, "The portal is not opened yet.");
return false;
} else {
pi.warp(610030400, 0);
return true;
}
}
return false;
}

View File

@@ -0,0 +1,14 @@
function enter(pi) {
var eim = pi.getEventInstance();
if (eim != null) {
if (eim.getIntProperty("glpq4") < 5){
pi.playerMessage(5, "The portal is not opened yet.");
return false;
} else {
pi.warp(610030500, 0);
return true;
}
}
return false;
}

View File

@@ -0,0 +1,19 @@
function enter(pi) {
var eim = pi.getEventInstance();
if (eim != null) {
if (eim.getIntProperty("glpq5") < 5){
pi.playerMessage(5, "The portal is not opened yet.");
return false;
} else {
pi.removeAll(4001256);
pi.removeAll(4001257);
pi.removeAll(4001258);
pi.removeAll(4001259);
pi.removeAll(4001260);
pi.warp(610030600, 0);
return true;
}
}
return false;
}

View File

@@ -0,0 +1,14 @@
function enter(pi) {
var eim = pi.getEventInstance();
if (eim != null) {
if (eim.getIntProperty("glpq6") < 3){
pi.playerMessage(5, "The portal is not opened yet.");
return false;
} else {
pi.warp(610030700, 0);
return true;
}
}
return false;
}

View File

@@ -0,0 +1,4 @@
function enter(pi) {
pi.warp(610030800, 0);
return true;
}

View File

@@ -0,0 +1,16 @@
function enter(pi) {
var react = pi.getMap().getReactorByName("mob0");
if (react.getState() < 1) {
react.forceHitReactor(1);
pi.getEventInstance().setIntProperty("glpq1", 1);
pi.getEventInstance().dropMessage(5, "A strange force starts being emitted from the portal apparatus, showing a hidden path once blocked now open.");
pi.warp(610030100, 0);
pi.getEventInstance().showClearEffect();
return true;
}
pi.getEventInstance().dropMessage(5, "The portal apparatus is malfunctional, due to the last transportation. The finding another way through.");
return false;
}

View File

@@ -2,7 +2,7 @@ function enter(pi) {
if (pi.isQuestActive(2324)) {
pi.forceCompleteQuest(2324);
pi.removeAll(2430015);
pi.playerMessage("Quest complete.");
pi.playerMessage(5, "Quest complete.");
}
pi.warp(106020501,0);
return true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,27 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
var mapId = rm.getMap().getId();
if (mapId == 610030200) {
eim.dropMessage(6, "The Warrior Sigil has been activated!");
eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1);
if (eim.getIntProperty("glpq2") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "2pt", 2);
}
} else if (mapId == 610030300) {
eim.dropMessage(6, "The Warrior Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!");
eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1);
rm.getMap().moveEnvironment("menhir0", 1);
if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) {
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "3pt", 2);
}
}
}
//rm.getMap().moveEnvironment("menhir0", 1);
}

View File

@@ -0,0 +1,24 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
var mapId = rm.getMap().getId();
if (mapId == 610030200) {
eim.dropMessage(6, "The Archer Sigil has been activated!");
eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1);
if (eim.getIntProperty("glpq2") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "2pt", 2);
}
} else if (mapId == 610030300) {
eim.dropMessage(6, "The Archer Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!");
eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1);
rm.getMap().moveEnvironment("menhir1", 1);
rm.getMap().moveEnvironment("menhir2", 1);
if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) {
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "3pt", 2);
}
}
}
}

View File

@@ -0,0 +1,23 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
var mapId = rm.getMap().getId();
if (mapId == 610030200) {
eim.dropMessage(6, "The Mage Sigil has been activated!");
eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1);
if (eim.getIntProperty("glpq2") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "2pt", 2);
}
} else if (mapId == 610030300) {
eim.dropMessage(6, "The Mage Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!");
eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1);
rm.getMap().moveEnvironment("menhir3", 1);
if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) {
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "3pt", 2);
}
}
}
}

View File

@@ -0,0 +1,23 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
var mapId = rm.getMap().getId();
if (mapId == 610030200) {
eim.dropMessage(6, "The Thief Sigil has been activated!");
eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1);
if (eim.getIntProperty("glpq2") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "2pt", 2);
}
} else if (mapId == 610030300) {
eim.dropMessage(6, "The Thief Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!");
eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1);
rm.getMap().moveEnvironment("menhir4", 1);
if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) {
rm.mapMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "3pt", 2);
}
}
}
}

View File

@@ -0,0 +1,23 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
var mapId = rm.getMap().getId();
if (mapId == 610030200) {
eim.dropMessage(6, "The Pirate Sigil has been activated!");
eim.setIntProperty("glpq2", eim.getIntProperty("glpq2") + 1);
if (eim.getIntProperty("glpq2") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "2pt", 2);
}
} else if (mapId == 610030300) {
eim.dropMessage(6, "The Pirate Sigil has been activated! You hear gears turning! The Menhir Defense System is active! Run!");
eim.setIntProperty("glpq3", eim.getIntProperty("glpq3") + 1);
rm.getMap().moveEnvironment("menhir5", 1);
if (eim.getIntProperty("glpq3") == 5 && eim.getIntProperty("glpq3_p") == 5) {
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(mapId, "3pt", 2);
}
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!");
eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1);
if (eim.getIntProperty("glpq5") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030500, "5pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!");
eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1);
if (eim.getIntProperty("glpq5") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030500, "5pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!");
eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1);
if (eim.getIntProperty("glpq5") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030500, "5pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!");
eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1);
if (eim.getIntProperty("glpq5") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030500, "5pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "A weapon has been restored to the Relic of Mastery!");
eim.setIntProperty("glpq5", eim.getIntProperty("glpq5") + 1);
if (eim.getIntProperty("glpq5") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030500, "5pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "The Warrior Sigil has been activated!");
eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1);
if (eim.getIntProperty("glpq4") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030400, "4pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "The Archer Sigil has been activated!");
eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1);
if (eim.getIntProperty("glpq4") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030400, "4pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "The Mage Sigil has been activated!");
eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1);
if (eim.getIntProperty("glpq4") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030400, "4pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "The Thief Sigil has been activated!");
eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1);
if (eim.getIntProperty("glpq4") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030400, "4pt", 2);
}
}
}

View File

@@ -0,0 +1,11 @@
function act() {
var eim = rm.getEventInstance();
if (eim != null) {
eim.dropMessage(6, "The Pirate Sigil has been activated!");
eim.setIntProperty("glpq4", eim.getIntProperty("glpq4") + 1);
if (eim.getIntProperty("glpq4") == 5) { //all 5 done
eim.dropMessage(6, "The Antellion grants you access to the next portal! Proceed!");
eim.showClearEffect(610030400, "4pt", 2);
}
}
}

View File

@@ -674,6 +674,10 @@ public class AbstractPlayerInteraction {
c.announce(MaplePacketCreator.disableMinimap());
}
public boolean isAllReactorState(final int reactorId, final int state) {
return c.getPlayer().getMap().isAllReactorState(reactorId, state);
}
public void resetMap(int mapid) {
getMap(mapid).resetReactors();
getMap(mapid).killAllMonsters();

View File

@@ -24,6 +24,7 @@ package scripting.event;
import java.io.File;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import tools.Pair;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -103,7 +104,7 @@ public class EventInstanceManager {
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<>();
private Map<Integer, Pair<String, Integer>> openedGates = new HashMap<>();
// forces deletion of items not supposed to be held outside of the event, dealt on a player's leaving moment.
private Set<Integer> exclusiveItems = new HashSet<>();
@@ -698,6 +699,10 @@ public class EventInstanceManager {
}
}
public MapleMonster getMonster(int mid) {
return(MapleLifeFactory.getMonster(mid));
}
private List<Integer> convertToIntegerArray(List<Double> list) {
List<Integer> intList = new ArrayList<>();
for(Double d: list) intList.add(d.intValue());
@@ -981,14 +986,22 @@ public class EventInstanceManager {
}
public final void showClearEffect(boolean hasGate, int mapId) {
showClearEffect(hasGate, mapId, "gate", 2);
}
public final void showClearEffect(int mapId, String mapObj, int newState) {
showClearEffect(true, mapId, mapObj, newState);
}
public final void showClearEffect(boolean hasGate, int mapId, String mapObj, int newState) {
MapleMap map = getMapInstance(mapId);
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
if(hasGate) {
map.broadcastMessage(MaplePacketCreator.environmentChange("gate", 2));
map.broadcastMessage(MaplePacketCreator.environmentChange(mapObj, newState));
wL.lock();
try {
openedGates.add(map.getId());
openedGates.put(map.getId(), new Pair<>(mapObj, newState));
} finally {
wL.unlock();
}
@@ -998,8 +1011,9 @@ public class EventInstanceManager {
public final void recoverOpenedGate(MapleCharacter chr, int thisMapId) {
rL.lock();
try {
if(openedGates.contains(thisMapId)) {
chr.announce(MaplePacketCreator.environmentChange("gate", 2));
if(openedGates.containsKey(thisMapId)) {
Pair<String, Integer> gateData = openedGates.get(thisMapId);
chr.announce(MaplePacketCreator.environmentChange(gateData.getLeft(), gateData.getRight()));
}
} finally {
rL.unlock();

View File

@@ -184,15 +184,19 @@ public class EventManager {
public void setProperty(String key, String value) {
props.setProperty(key, value);
}
public String getProperty(String key) {
return props.getProperty(key);
public void setIntProperty(String key, int value) {
setProperty(key, value);
}
public void setProperty(String key, int value) {
props.setProperty(key, value + "");
}
public String getProperty(String key) {
return props.getProperty(key);
}
public int getIntProperty(String key) {
return Integer.parseInt(props.getProperty(key));
}
@@ -279,7 +283,7 @@ public class EventManager {
startLobbyInstance(lobbyId);
}
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", leader.getId()));
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", leader.getClient().getChannel()));
if(eim == null) {
if(lobbyId > -1) setLockLobby(lobbyId, false);
return false;

View File

@@ -178,7 +178,12 @@ public class MapleMonsterInformationProvider {
try
{
return MapleLifeFactory.getMonster(id).getName();
} catch (Exception e)
}
catch (NullPointerException npe)
{
return null; //nonexistant mob
}
catch (Exception e)
{
e.printStackTrace();
System.err.println("Nonexistant mob id " + id);

View File

@@ -276,6 +276,17 @@ public class MapleMap {
}
}
public boolean isAllReactorState(final int reactorId, final int state) {
for (MapleMapObject mo : getReactors()) {
MapleReactor r = (MapleReactor) mo;
if (r.getId() == reactorId && r.getState() != state) {
return false;
}
}
return true;
}
public int getForcedReturnId() {
return forcedReturnMap;
}
@@ -955,6 +966,41 @@ public class MapleMap {
mr.setPosition(points.remove(points.size() - 1));
}
}
public final void shuffleReactors(List<Object> list) {
List<Point> points = new ArrayList<>();
List<MapleMapObject> listObjects = new ArrayList<>();
List<MapleMapObject> reactors = getReactors();
List<MapleMapObject> targets = new LinkedList<>();
objectRLock.lock();
try {
for (Object obj : list) {
if(obj instanceof MapleMapObject) {
MapleMapObject mmo = (MapleMapObject) obj;
if(mapobjects.containsValue(mmo)) {
listObjects.add(mmo);
}
}
}
} finally {
objectRLock.unlock();
}
for (MapleMapObject obj : listObjects) {
MapleReactor mr = (MapleReactor) obj;
points.add(mr.getPosition());
targets.add(obj);
}
Collections.shuffle(points);
for (MapleMapObject obj : targets) {
MapleReactor mr = (MapleReactor) obj;
mr.setPosition(points.remove(points.size() - 1));
}
}
/**
* Automagically finds a new controller for the given monster from the chars
@@ -1480,6 +1526,10 @@ public class MapleMap {
}
}
}
public void changeEnvironment(String mapObj, int newState) {
broadcastMessage(MaplePacketCreator.environmentChange(mapObj, newState));
}
public void startMapEffect(String msg, int itemId) {
startMapEffect(msg, itemId, 30000);
@@ -2105,7 +2155,7 @@ public class MapleMap {
}
public final void moveEnvironment(final String ms, final int type) {
broadcastMessage(MaplePacketCreator.environmentChange(ms, type));
broadcastMessage(MaplePacketCreator.environmentMove(ms, type));
environment.put(ms, type);
}

View File

@@ -3682,6 +3682,16 @@ public class MaplePacketCreator {
mplew.writeMapleAsciiString(env);
return mplew.getPacket();
}
public static byte[] environmentMove(String env, int mode) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.FIELD_EFFECT.getValue());
mplew.write(mode);
mplew.writeMapleAsciiString(env);
return mplew.getPacket();
}
public static byte[] startMapEffect(String msg, int itemid, boolean active) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

View File

@@ -722,7 +722,7 @@
</imgdir>
</imgdir>
<imgdir name="spec">
<int name="time" value="2100000"/>
<int name="time" value="172800000"/>
<int name="expR" value="4"/>
</imgdir>
</imgdir>

View File

@@ -8752,6 +8752,7 @@
<vector name="origin" x="0" y="33"/>
<int name="z" value="0"/>
</canvas>
<int name="pquest" value="1"/>
</imgdir>
</imgdir>
<imgdir name="04001257">
@@ -8766,6 +8767,7 @@
<vector name="origin" x="0" y="35"/>
<int name="z" value="0"/>
</canvas>
<int name="pquest" value="1"/>
</imgdir>
</imgdir>
<imgdir name="04001258">
@@ -8780,6 +8782,7 @@
<vector name="origin" x="0" y="39"/>
<int name="z" value="0"/>
</canvas>
<int name="pquest" value="1"/>
</imgdir>
</imgdir>
<imgdir name="04001259">
@@ -8794,6 +8797,7 @@
<vector name="origin" x="0" y="36"/>
<int name="z" value="0"/>
</canvas>
<int name="pquest" value="1"/>
</imgdir>
</imgdir>
<imgdir name="04001260">
@@ -8808,6 +8812,7 @@
</canvas>
<int name="price" value="1"/>
<int name="slotMax" value="1"/>
<int name="pquest" value="1"/>
</imgdir>
</imgdir>
<imgdir name="04001261">

View File

@@ -4380,6 +4380,15 @@
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
</imgdir>
<imgdir name="6">
<string name="pn" value="next01"/>
<int name="pt" value="8"/>
<int name="x" value="1547"/>
<int name="y" value="336"/>
<int name="tm" value="999999999"/>
<string name="tn" value=""/>
<string name="script" value="glpqPortalDummy"/>
</imgdir>
<imgdir name="5">
<string name="pn" value="next00"/>
<int name="pt" value="8"/>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More