Search in sources :

Example 61 with MapleCharacter

use of client.MapleCharacter in project HeavenMS by ronancpl.

the class EventInstanceManager method disposeIfPlayerBelow.

public final boolean disposeIfPlayerBelow(final byte size, final int towarp) {
    if (disposed) {
        return true;
    }
    if (chars == null) {
        return false;
    }
    MapleMap map = null;
    if (towarp > 0) {
        map = this.getMapFactory().getMap(towarp);
    }
    List<MapleCharacter> players = getPlayerList();
    try {
        if (players.size() < size) {
            for (MapleCharacter chr : players) {
                if (chr == null) {
                    continue;
                }
                unregisterPlayer(chr);
                if (towarp > 0) {
                    chr.changeMap(map, map.getPortal(0));
                }
            }
            dispose();
            return true;
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return false;
}
Also used : MapleMap(server.maps.MapleMap) MapleCharacter(client.MapleCharacter) SQLException(java.sql.SQLException) ScriptException(javax.script.ScriptException)

Example 62 with MapleCharacter

use of client.MapleCharacter in project HeavenMS by ronancpl.

the class EventInstanceManager method applyEventPlayersItemBuff.

public void applyEventPlayersItemBuff(int itemId) {
    List<MapleCharacter> players = getPlayerList();
    MapleStatEffect mse = MapleItemInformationProvider.getInstance().getItemEffect(itemId);
    if (mse != null) {
        for (MapleCharacter player : players) {
            mse.applyTo(player);
        }
    }
}
Also used : MapleCharacter(client.MapleCharacter) MapleStatEffect(server.MapleStatEffect)

Example 63 with MapleCharacter

use of client.MapleCharacter in project HeavenMS by ronancpl.

the class EventInstanceManager method registerParty.

public void registerParty(MapleParty party, MapleMap map) {
    for (MaplePartyCharacter pc : party.getEligibleMembers()) {
        MapleCharacter c = map.getCharacterById(pc.getId());
        registerPlayer(c);
    }
}
Also used : MapleCharacter(client.MapleCharacter) MaplePartyCharacter(net.server.world.MaplePartyCharacter)

Example 64 with MapleCharacter

use of client.MapleCharacter in project HeavenMS by ronancpl.

the class EventInstanceManager method applyEventPlayersSkillBuff.

public void applyEventPlayersSkillBuff(int skillId, int skillLv) {
    List<MapleCharacter> players = getPlayerList();
    Skill skill = SkillFactory.getSkill(skillId);
    if (skill != null) {
        MapleStatEffect mse = skill.getEffect(Math.min(skillLv, skill.getMaxLevel()));
        if (mse != null) {
            for (MapleCharacter player : players) {
                mse.applyTo(player);
            }
        }
    }
}
Also used : MapleCharacter(client.MapleCharacter) Skill(client.Skill) MapleStatEffect(server.MapleStatEffect)

Example 65 with MapleCharacter

use of client.MapleCharacter in project HeavenMS by ronancpl.

the class EventInstanceManager method isEventTeamTogether.

public final boolean isEventTeamTogether() {
    rL.lock();
    try {
        if (chars.size() <= 1)
            return true;
        Iterator<MapleCharacter> iterator = chars.values().iterator();
        MapleCharacter mc = iterator.next();
        int mapId = mc.getMapId();
        for (; iterator.hasNext(); ) {
            mc = iterator.next();
            if (mc.getMapId() != mapId)
                return false;
        }
        return true;
    } finally {
        rL.unlock();
    }
}
Also used : MapleCharacter(client.MapleCharacter) Point(java.awt.Point)

Aggregations

MapleCharacter (client.MapleCharacter)163 Point (java.awt.Point)32 SQLException (java.sql.SQLException)22 Item (client.inventory.Item)21 Connection (java.sql.Connection)15 PreparedStatement (java.sql.PreparedStatement)15 MapleMonster (server.life.MapleMonster)15 MapleMapObject (server.maps.MapleMapObject)15 DatabaseConnection (tools.DatabaseConnection)15 MapleMap (server.maps.MapleMap)14 ArrayList (java.util.ArrayList)13 Skill (client.Skill)12 SpawnPoint (server.life.SpawnPoint)12 LinkedList (java.util.LinkedList)11 MapleInventory (client.inventory.MapleInventory)10 World (net.server.world.World)10 MapleStatEffect (server.MapleStatEffect)10 MapleInventoryType (client.inventory.MapleInventoryType)9 ResultSet (java.sql.ResultSet)9 MapleItemInformationProvider (server.MapleItemInformationProvider)9