use of server.partyquest.Pyramid in project HeavenMS by ronancpl.
the class NPCConversationManager method createPyramid.
public boolean createPyramid(String mode, boolean party) {
// lol
PyramidMode mod = PyramidMode.valueOf(mode);
MapleParty partyz = getPlayer().getParty();
MapleMapFactory mf = c.getChannelServer().getMapFactory();
MapleMap map = null;
int mapid = 926010100;
if (party) {
mapid += 10000;
}
mapid += (mod.getMode() * 1000);
for (byte b = 0; b < 5; b++) {
// They cannot warp to the next map before the timer ends (:
map = mf.getMap(mapid + b);
if (map.getCharacters().size() > 0) {
continue;
} else {
break;
}
}
if (map == null) {
return false;
}
if (!party) {
partyz = new MapleParty(-1, new MaplePartyCharacter(getPlayer()));
}
Pyramid py = new Pyramid(partyz, mod, map.getId());
getPlayer().setPartyQuest(py);
py.warp(mapid);
dispose();
return true;
}
Aggregations