Lineage Justice

Spells & Skills

Lookup and validate skills and spells.

Teleport
MP: 10 HP: 0 Item: None Amount: N/A Duration: 0 Skill Type: Other
Delay: 10 Cast Invis: Yes Ignores CM: Yes Element: None Range: N/A Area: N/A
Dmg Value: 0.0 Dmg Dice: 0 Dice Count: 0 Prob Value: 0 Prob Dice: 0 Prob Max: N/A
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);
		}
	}
}