L1SkillUse Execution:
if (_skillId == TELEPORT || _skillId == MASS_TELEPORT) {
L1PcInstance pc = (L1PcInstance) cha;
L1BookMark bookm = pc.getBookMark(_bookmarkId);
if (bookm != null) {
if ((!pc.getMap().isTradeZone() && pc.getMap().isEscapable()) || pc.isGm()) {
int newX = bookm.getLocX();
int newY = bookm.getLocY();
short mapId = bookm.getMapId();
if (_skillId == MASS_TELEPORT) {
List clanMember = L1World
.getInstance().getVisiblePlayer(pc);
for (L1PcInstance member : clanMember) {
if (pc.getLocation()
.getTileLineDistance(
member.getLocation()) <= 3
&& member.getClanId() == pc
.getClanId()
&& pc.getClanId() != 0
&& member.getId() != pc.getId()
&& !member.isPrivateShop()) {
L1Teleport.teleport(member, newX,
newY, mapId, 5, true);
}
}
}
L1Teleport.teleport(pc, newX, newY, mapId, 5,
true);
} else {
L1Teleport.teleport(pc, pc.getX(), pc.getY(),
pc.getMapId(), pc.getHeading(), false);
pc.sendPackets(new S_ServerMessage(79));
}
} else {
if (pc.getMap().isTeleportable() || pc.isGm()) {
L1Location newLocation = pc.getLocation()
.randomLocation(200, true);
int newX = newLocation.getX();
int newY = newLocation.getY();
short mapId = (short) newLocation.getMapId();
if (_skillId == MASS_TELEPORT) {
List clanMember = L1World
.getInstance().getVisiblePlayer(pc);
for (L1PcInstance member : clanMember) {
if (pc.getLocation()
.getTileLineDistance(
member.getLocation()) <= 3
&& member.getClanId() == pc
.getClanId()
&& pc.getClanId() != 0
&& member.getId() != pc.getId()) {
L1Teleport.teleport(member, newX,
newY, mapId, 5, true);
}
}
}
L1Teleport.teleport(pc, newX, newY, mapId, 5,
true);
} else {
pc.sendPackets(new S_ServerMessage(276));
L1Teleport.teleport(pc, pc.getX(), pc.getY(),
pc.getMapId(), pc.getHeading(), false);
}
}
}