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;
}
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);
}
}
}
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);
}
}
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);
}
}
}
}
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();
}
}
Aggregations