public static ushort GetTeleporterCellId(int mapid, TeleporterTypeEnum tptype) { var map = MapRecord.GetMap(mapid); string actionType = string.Empty; switch (tptype) { case TeleporterTypeEnum.TELEPORTER_ZAAP: actionType = "Zaap"; break; case TeleporterTypeEnum.TELEPORTER_SUBWAY: actionType = "Zaapi"; break; case TeleporterTypeEnum.TELEPORTER_PRISM: actionType = "Prism"; break; default: break; } var interactive = GetInteractivesByActionType(actionType).Find(x => x.MapId == mapid); if (interactive != null) { var mapElements = MapElementRecord.GetMapElementByMap(interactive.MapId); var ele = mapElements.Find(x => x.ElementId == interactive.ElementId); return((ushort)map.CloseCell((short)ele.CellId)); } return((ushort)map.RandomWalkableCell()); }
public static ushort GetTeleporterCellId(int mapid,TeleporterTypeEnum tptype) { var map = MapRecord.GetMap(mapid); string actionType = string.Empty; switch (tptype) { case TeleporterTypeEnum.TELEPORTER_ZAAP: actionType = "Zaap"; break; case TeleporterTypeEnum.TELEPORTER_SUBWAY: actionType = "Zaapi"; break; case TeleporterTypeEnum.TELEPORTER_PRISM: actionType = "Prism"; break; default: break; } var interactive = GetInteractivesByActionType(actionType).Find(x => x.MapId == mapid); if (interactive != null) { var mapElements = MapElementRecord.GetMapElementByMap(interactive.MapId); var ele = mapElements.Find(x => x.ElementId == interactive.ElementId); return (ushort)map.CloseCell((short)ele.CellId); } return (ushort)map.RandomWalkableCell(); }