private static void PortalEnter(YiObj player, ref MsgAction packet) { var portalX = (ushort)packet.Param; var portalY = (ushort)(packet.Param >> 16); if (player.UniqueId != packet.UniqueId) { return; } foreach (var portal in Portal.Portals.Values.Where(portal => portal.Location.X == portalX && portal.Location.Y == portalY && portal.MapId == player.MapId)) { player.Teleport(portal.ToX, portal.ToY, portal.ToMap); return; } Output.WriteLine($"Portal from {portalX}-{portalY} on {player.MapId} not found."); player.Teleport((ushort)(player.Location.X - 3), (ushort)(player.Location.Y - 3), player.MapId); }
private static void ACTION_USER_CHGMAP(YiObj target, YiObj invoker, cq_action cqaction, SquigglyContext db) { var nextIds = cqaction.param.Trim().Split(' '); var map = ushort.Parse(nextIds[0]); var x = ushort.Parse(nextIds[1]); var y = ushort.Parse(nextIds[2]); invoker.Teleport(x, y, map); Process(target, invoker, db.cq_action.Find(cqaction.id_next), db); }
private static void PortalEnter(YiObj player, ref MsgAction packet) { var portalX = (ushort)packet.Param; var portalY = (ushort)(packet.Param >> 16); if (player.UniqueId != packet.UniqueId) { return; } if (GameWorld.Maps.ContainsKey(player.MapId)) { foreach (var portal in GameWorld.Maps[player.MapId].Portals.Values.Where(portal => portal.X == portalX && portal.Y == portalY)) { var passway = PortalProcessor.FindPortal((int)portal.IdX, player.MapId); player.Teleport((ushort)passway.portal_x, (ushort)passway.portal_y, (ushort)passway.mapid); return; } } Output.WriteLine($"Portal from {portalX}-{portalY} on {player.MapId} not found."); player.Teleport((ushort)(player.Location.X - 3), (ushort)(player.Location.Y - 3), player.MapId); }
public static bool Execute(YiObj entity, Item item) { try { if (entity.IsInJail() || !entity.CanUseScroll()) { return(false); } entity.Teleport(225, 205, 1000); entity.Inventory.RemoveItem(item); } catch { return(false); } return(true); }
public static bool Execute(YiObj entity, Item item) { try { if (entity.IsInJail() || !entity.CanUseScroll()) { Message.SendTo(entity, "You can not use scrolls in this map.", MsgTextType.Top); } else { entity.Teleport(190, 271, 1011); entity.Inventory.RemoveItem(item); } } catch { return(false); } return(true); }