Ludibrium Maze PQ
Implemented Ludibrium Maze PQ.
This commit is contained in:
@@ -183,6 +183,15 @@ public class EventManager {
|
||||
return Integer.parseInt(props.getProperty(key));
|
||||
}
|
||||
|
||||
private boolean getLockLobby(int lobbyId) {
|
||||
l.lock();
|
||||
try {
|
||||
return openedLobbys.get(lobbyId);
|
||||
} finally {
|
||||
l.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private void setLockLobby(int lobbyId, boolean lock) {
|
||||
l.lock();
|
||||
try {
|
||||
@@ -243,10 +252,14 @@ public class EventManager {
|
||||
//Expedition method: starts an expedition
|
||||
public boolean startInstance(int lobbyId, MapleExpedition exped) {
|
||||
try {
|
||||
if(lobbyId > -1) {
|
||||
if(lobbyId == -1) {
|
||||
lobbyId = availableLobbyInstance();
|
||||
if(lobbyId == -1) return false;
|
||||
}
|
||||
else {
|
||||
if(getLockLobby(lobbyId)) return false;
|
||||
startLobbyInstance(lobbyId);
|
||||
}
|
||||
|
||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
||||
if(eim == null) {
|
||||
@@ -271,10 +284,14 @@ public class EventManager {
|
||||
|
||||
public boolean startInstance(int lobbyId, MapleCharacter chr) {
|
||||
try {
|
||||
if(lobbyId > -1) {
|
||||
if(lobbyId == -1) {
|
||||
lobbyId = availableLobbyInstance();
|
||||
if(lobbyId == -1) return false;
|
||||
}
|
||||
else {
|
||||
if(getLockLobby(lobbyId)) return false;
|
||||
startLobbyInstance(lobbyId);
|
||||
}
|
||||
|
||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
||||
if(eim == null) {
|
||||
@@ -298,10 +315,14 @@ public class EventManager {
|
||||
|
||||
public boolean startInstance(int lobbyId, MapleParty party, MapleMap map) {
|
||||
try {
|
||||
if(lobbyId > -1) {
|
||||
if(lobbyId == -1) {
|
||||
lobbyId = availableLobbyInstance();
|
||||
if(lobbyId == -1) return false;
|
||||
}
|
||||
else {
|
||||
if(getLockLobby(lobbyId)) return false;
|
||||
startLobbyInstance(lobbyId);
|
||||
}
|
||||
|
||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", (Object) null));
|
||||
if(eim == null) {
|
||||
@@ -326,10 +347,14 @@ public class EventManager {
|
||||
|
||||
public boolean startInstance(int lobbyId, MapleParty party, MapleMap map, int difficulty) {
|
||||
try {
|
||||
if(lobbyId > -1) {
|
||||
if(lobbyId == -1) {
|
||||
lobbyId = availableLobbyInstance();
|
||||
if(lobbyId == -1) return false;
|
||||
}
|
||||
else {
|
||||
if(getLockLobby(lobbyId)) return false;
|
||||
startLobbyInstance(lobbyId);
|
||||
}
|
||||
|
||||
EventInstanceManager eim = (EventInstanceManager) (iv.invokeFunction("setup", difficulty, (lobbyId > -1) ? lobbyId : party.getLeaderId()));
|
||||
if(eim == null) {
|
||||
@@ -354,10 +379,14 @@ public class EventManager {
|
||||
|
||||
public boolean startInstance(int lobbyId, EventInstanceManager eim, String leader) {
|
||||
try {
|
||||
if(lobbyId > -1) {
|
||||
if(lobbyId == -1) {
|
||||
lobbyId = availableLobbyInstance();
|
||||
if(lobbyId == -1) return false;
|
||||
}
|
||||
else {
|
||||
if(getLockLobby(lobbyId)) return false;
|
||||
startLobbyInstance(lobbyId);
|
||||
}
|
||||
|
||||
if(eim == null) {
|
||||
if(lobbyId > -1) setLockLobby(lobbyId, false);
|
||||
|
||||
Reference in New Issue
Block a user