New PQ: Boss Rush PQ + Ellin/PiratePQ bug fixes

Introducing Boss Rush PQ. Corrected a few issues regarding rewardings in
PiratePQ and EllinPQ and implemented a standardized way to script PQs.
This commit is contained in:
ronancpl
2017-04-25 11:55:44 -03:00
parent 828a8a02a2
commit 939b214fb5
66 changed files with 16104 additions and 44622 deletions

View File

@@ -92,7 +92,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
int range = maxMeso - minMeso;
int displayDrop = (int) (Math.random() * range) + minMeso;
int mesoDrop = (displayDrop * client.getWorldServer().getMesoRate());
reactor.getMap().spawnMesoDrop(mesoDrop, dropPos, reactor, client.getPlayer(), false, (byte) 0);
reactor.getMap().spawnMesoDrop(mesoDrop, dropPos, reactor, client.getPlayer(), false, (byte) 2);
} else {
Item drop;
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
@@ -129,7 +129,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
private void spawnMonster(int id, int qty, Point pos) {
for (int i = 0; i < qty; i++) {
reactor.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(id), pos);
reactor.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(id), pos);
}
}

View File

@@ -47,6 +47,23 @@ public class ReactorScriptManager extends AbstractScriptManager {
public synchronized static ReactorScriptManager getInstance() {
return instance;
}
public void onHit(MapleClient c, MapleReactor reactor) {
try {
ReactorActionManager rm = new ReactorActionManager(c, reactor);
Invocable iv = getInvocable("reactor/" + reactor.getId() + ".js", c);
if (iv == null) {
return;
}
engine.put("rm", rm);
iv.invokeFunction("hit");
} catch(final NoSuchMethodException e) {
//do nothing, hit is OPTIONAL
}
catch (final ScriptException | NullPointerException e) {
FilePrinter.printError(FilePrinter.REACTOR + reactor.getId() + ".txt", e);
}
}
public void act(MapleClient c, MapleReactor reactor) {
try {