Implemented CWKPQ
Made CWKPQ fully-functional, using the Expedition system (won't work with the lobby system).
This commit is contained in:
@@ -332,7 +332,16 @@ public class EventInstanceManager {
|
||||
|
||||
public void registerExpedition(MapleExpedition exped) {
|
||||
expedition = exped;
|
||||
registerPlayer(exped.getLeader());
|
||||
registerExpeditionTeam(exped, exped.getRecruitingMap().getId());
|
||||
}
|
||||
|
||||
private void registerExpeditionTeam(MapleExpedition exped, int recruitMap) {
|
||||
expedition = exped;
|
||||
|
||||
for(MapleCharacter chr: exped.getMembers()) {
|
||||
if(chr.getMapId() == recruitMap)
|
||||
registerPlayer(chr);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterPlayer(MapleCharacter chr) {
|
||||
@@ -516,7 +525,10 @@ public class EventInstanceManager {
|
||||
killCount.clear();
|
||||
|
||||
if (expedition != null) {
|
||||
expedition.dispose(true);
|
||||
em.getChannelServer().getExpeditions().remove(expedition);
|
||||
|
||||
expedition = null;
|
||||
}
|
||||
if(!eventCleared) em.disposeInstance(name);
|
||||
em = null;
|
||||
|
||||
@@ -291,8 +291,9 @@ public class EventManager {
|
||||
instanceLocks.put(eim.getName(), lobbyId);
|
||||
eim.setLeader(leader);
|
||||
|
||||
eim.registerExpedition(exped);
|
||||
exped.start();
|
||||
eim.registerExpedition(exped);
|
||||
|
||||
iv.invokeFunction("afterSetup", eim);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {
|
||||
Logger.getLogger(EventManager.class.getName()).log(Level.SEVERE, null, ex);
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ReactorScriptManager extends AbstractScriptManager {
|
||||
touching(c, reactor, false);
|
||||
}
|
||||
|
||||
public void touching(MapleClient c, MapleReactor reactor, boolean touching) {
|
||||
public synchronized void touching(MapleClient c, MapleReactor reactor, boolean touching) {
|
||||
try {
|
||||
ReactorActionManager rm = new ReactorActionManager(c, reactor);
|
||||
Invocable iv = getInvocable("reactor/" + reactor.getId() + ".js", c);
|
||||
|
||||
Reference in New Issue
Block a user