Search in sources :

Example 6 with EventInstanceManager

use of scripting.event.EventInstanceManager in project HeavenMS by ronancpl.

the class MapleCharacter method changeMap.

public void changeMap(int map, MaplePortal portal) {
    MapleMap warpMap;
    EventInstanceManager eim = getEventInstance();
    if (eim != null) {
        warpMap = eim.getMapInstance(map);
    } else {
        warpMap = client.getChannelServer().getMapFactory().getMap(map);
    }
    changeMap(warpMap, portal);
}
Also used : MapleMap(server.maps.MapleMap) EventInstanceManager(scripting.event.EventInstanceManager)

Example 7 with EventInstanceManager

use of scripting.event.EventInstanceManager in project HeavenMS by ronancpl.

the class MapleCharacter method changeMap.

public void changeMap(int map, String portal) {
    MapleMap warpMap;
    EventInstanceManager eim = getEventInstance();
    if (eim != null) {
        warpMap = eim.getMapInstance(map);
    } else {
        warpMap = client.getChannelServer().getMapFactory().getMap(map);
    }
    changeMap(warpMap, warpMap.getPortal(portal));
}
Also used : MapleMap(server.maps.MapleMap) EventInstanceManager(scripting.event.EventInstanceManager)

Example 8 with EventInstanceManager

use of scripting.event.EventInstanceManager in project HeavenMS by ronancpl.

the class World method updateParty.

public void updateParty(int partyid, PartyOperation operation, MaplePartyCharacter target) {
    MapleParty party = getParty(partyid);
    if (party == null) {
        throw new IllegalArgumentException("no party with the specified partyid exists");
    }
    switch(operation) {
        case JOIN:
            party.addMember(target);
            break;
        case EXPEL:
        case LEAVE:
            party.removeMember(target);
            break;
        case DISBAND:
            disbandParty(partyid);
            break;
        case SILENT_UPDATE:
        case LOG_ONOFF:
            party.updateMember(target);
            break;
        case CHANGE_LEADER:
            MapleCharacter mc = party.getLeader().getPlayer();
            EventInstanceManager eim = mc.getEventInstance();
            if (eim != null && eim.isEventLeader(mc)) {
                eim.changedLeader(target.getPlayer());
            }
            party.setLeader(target);
            break;
        default:
            System.out.println("Unhandled updateParty operation " + operation.name());
    }
    updateParty(party, operation, target);
}
Also used : MapleCharacter(client.MapleCharacter) EventInstanceManager(scripting.event.EventInstanceManager)

Aggregations

EventInstanceManager (scripting.event.EventInstanceManager)8 MapleMap (server.maps.MapleMap)5 MapleCharacter (client.MapleCharacter)2 Point (java.awt.Point)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 MapleParty (net.server.world.MapleParty)1 MaplePartyCharacter (net.server.world.MaplePartyCharacter)1 World (net.server.world.World)1