Search in sources :

Example 1 with Pyramid

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;
}
Also used : PyramidMode(server.partyquest.Pyramid.PyramidMode) MapleMapFactory(server.maps.MapleMapFactory) MapleMap(server.maps.MapleMap) Pyramid(server.partyquest.Pyramid) MapleParty(net.server.world.MapleParty) MaplePartyCharacter(net.server.world.MaplePartyCharacter)

Aggregations

MapleParty (net.server.world.MapleParty)1 MaplePartyCharacter (net.server.world.MaplePartyCharacter)1 MapleMap (server.maps.MapleMap)1 MapleMapFactory (server.maps.MapleMapFactory)1 Pyramid (server.partyquest.Pyramid)1 PyramidMode (server.partyquest.Pyramid.PyramidMode)1