static void Zaapi(WorldClient client, InteractiveRecord ele) { if (client.Character.CurrentDialogType == DialogTypeEnum.DIALOG_TELEPORTER) { return; } client.Character.CurrentDialogType = DialogTypeEnum.DIALOG_TELEPORTER; var maps = new List <int>(); var subareas = new List <ushort>(); var cost = new List <ushort>(); var tptype = new List <sbyte>(); foreach (InteractiveRecord interactive in InteractiveRecord.GetInteractivesByActionType("Zaapi")) { if (interactive.OptionalValue1 == ele.OptionalValue1) { maps.Add(interactive.MapId); subareas.Add(MapRecord.GetSubAreaId(interactive.MapId)); cost.Add(ZaapiCost); tptype.Add(0); } } client.Send(new TeleportDestinationsListMessage((sbyte)TeleporterTypeEnum.TELEPORTER_SUBWAY, maps, subareas, cost, tptype)); }
public static List <MonsterSpawnMapRecord> GetSpawns(int mapid) { var spawn = MonsterSpawnMapRecord.GetSpawn(mapid); if (spawn.Count() > 0) { return(spawn); } else { var subId = MapRecord.GetSubAreaId(mapid); var sub = MonstersSpawnsSub.FindAll(x => x.SubAreaId == subId); return(sub.ConvertAll <MonsterSpawnMapRecord>(x => new MonsterSpawnMapRecord(0, x.MonsterId, mapid, x.Probability))); } }
public static void HandleMapInformations(MapInformationsRequestMessage message, WorldClient client) { client.Character.Map = MapRecord.GetMap(message.mapId); if (client.Character.Map == null) { client.Character.TeleportToSpawnPoint(); client.Character.NotificationError("Unknown Map...(" + message.mapId + ")"); return; } client.Character.Map.Instance.SyncMonsters(); client.Character.SubAreaId = MapRecord.GetSubAreaId(message.mapId); client.Send(new MapComplementaryInformationsDataMessage(client.Character.SubAreaId, message.mapId, new List <HouseInformations>(), client.Character.Map.Instance.GetActors(), client.Character.Map.Instance.GetInteractiveElements(), new List <StatedElement>(), new List <MapObstacle>(), client.Character.Map.Instance.Fights)); client.Character.Map.Instance.ShowFightsCount(client); client.Character.CheckMapTip(message.mapId); client.Character.Map.Instance.AddClient(client); client.Character.RefreshMap(); }
public TeleporterDialog(Character character, MapInteractiveElementSkill skill) : base(character) { var zaapElements = InteractiveElementRecord.GetByElementType(skill.Element.Record.ElementType).ToArray(); zaapElements = zaapElements.Where(x => x.GetSkillByActionType(skill.ActionType).Value1 == skill.Record.Value1).ToArray(); this.Maps = new int[zaapElements.Length]; this.SubAreaIds = new ushort[zaapElements.Length]; this.Costs = new ushort[zaapElements.Length]; this.DestTeleporterType = new TeleporterTypeEnum[zaapElements.Length]; for (int i = 0; i < zaapElements.Length; i++) { var element = zaapElements[i]; this.Maps[i] = element.MapId; this.SubAreaIds[i] = MapRecord.GetSubAreaId(element.MapId); this.Costs[i] = GetCost(skill.Element.Record.MapId, element.MapId); this.DestTeleporterType[i] = TeleporterType; } }
public static void Zaap(WorldClient client, InteractiveRecord ele) { if (client.Character.CurrentDialogType == DialogTypeEnum.DIALOG_TELEPORTER) { return; } client.Character.CurrentDialogType = DialogTypeEnum.DIALOG_TELEPORTER; var maps = new List <int>(); var subareas = new List <ushort>(); var costs = new List <ushort>(); var tptype = new List <sbyte>(); foreach (InteractiveRecord interactive in InteractiveRecord.GetInteractivesByActionType("Zaap")) { if (interactive.OptionalValue1 == ele.OptionalValue1) { maps.Add(interactive.MapId); subareas.Add(MapRecord.GetSubAreaId(interactive.MapId)); costs.Add(ZaapCost); tptype.Add((sbyte)TeleporterTypeEnum.TELEPORTER_ZAAP); } } client.Send(new ZaapListMessage((sbyte)TeleporterTypeEnum.TELEPORTER_ZAAP, maps, subareas, costs, tptype, client.Character.Record.SpawnPointMapId)); }