Implemented EllinPQ + some bug fixes
Implemented EllinPQ, adjusted several drop rates and data, fixes some bugs at quests at client-side.
This commit is contained in:
@@ -46,6 +46,9 @@ import server.maps.MapleMap;
|
||||
import server.maps.MapleMapFactory;
|
||||
import tools.DatabaseConnection;
|
||||
import client.MapleCharacter;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -67,6 +70,7 @@ public class EventInstanceManager {
|
||||
private final ReentrantReadWriteLock mutex = new ReentrantReadWriteLock();
|
||||
private final ReadLock rL = mutex.readLock();
|
||||
private final WriteLock wL = mutex.writeLock();
|
||||
private ScheduledFuture<?> event_schedule = null;
|
||||
private boolean disposed = false;
|
||||
|
||||
public EventInstanceManager(EventManager em, String name) {
|
||||
@@ -114,8 +118,18 @@ public class EventInstanceManager {
|
||||
}
|
||||
|
||||
public void startEventTimer(long time) {
|
||||
timeStarted = System.currentTimeMillis();
|
||||
timeStarted = System.currentTimeMillis();
|
||||
eventTime = time;
|
||||
|
||||
event_schedule = TimerManager.getInstance().schedule(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
em.getIv().invokeFunction("scheduledTimeout", EventInstanceManager.this);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {
|
||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}, time);
|
||||
}
|
||||
|
||||
public boolean isTimerStarted() {
|
||||
@@ -186,6 +200,11 @@ public class EventInstanceManager {
|
||||
|
||||
public void monsterKilled(MapleMonster mob) {
|
||||
mobs.remove(mob);
|
||||
try {
|
||||
em.getIv().invokeFunction("monsterKilled", mob, this);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (mobs.isEmpty()) {
|
||||
try {
|
||||
em.getIv().invokeFunction("allMonstersDead", this);
|
||||
@@ -268,6 +287,8 @@ public class EventInstanceManager {
|
||||
} finally {
|
||||
wL.unlock();
|
||||
}
|
||||
|
||||
event_schedule.cancel(true);
|
||||
|
||||
mobs.clear();
|
||||
killCount.clear();
|
||||
|
||||
@@ -58,8 +58,12 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
|
||||
public void dropItems(boolean meso, int mesoChance, int minMeso, int maxMeso) {
|
||||
dropItems(meso, mesoChance, minMeso, maxMeso, 0);
|
||||
}
|
||||
|
||||
|
||||
public void dropItems(boolean meso, int mesoChance, int minMeso, int maxMeso, int minItems) {
|
||||
dropItems((int)reactor.getPosition().getX(), (int)reactor.getPosition().getY(), meso, mesoChance, minMeso, maxMeso, minItems);
|
||||
}
|
||||
|
||||
public void dropItems(int posX, int posY, boolean meso, int mesoChance, int minMeso, int maxMeso, int minItems) {
|
||||
List<ReactorDropEntry> chances = getDropChances();
|
||||
List<ReactorDropEntry> items = new LinkedList<>();
|
||||
int numItems = 0;
|
||||
@@ -79,8 +83,10 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
|
||||
numItems++;
|
||||
}
|
||||
java.util.Collections.shuffle(items);
|
||||
final Point dropPos = reactor.getPosition();
|
||||
|
||||
final Point dropPos = new Point(posX, posY);
|
||||
dropPos.x -= (12 * numItems);
|
||||
|
||||
for (ReactorDropEntry d : items) {
|
||||
if (d.itemId == 0) {
|
||||
int range = maxMeso - minMeso;
|
||||
@@ -98,7 +104,6 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
|
||||
reactor.getMap().spawnItemDrop(reactor, getPlayer(), drop, dropPos, false, false);
|
||||
}
|
||||
dropPos.x += 25;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user