Exemple #1
0
        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 void ElementsCommand(string value, WorldClient client)
 {
     Color[]            Colors   = new Color[] { Color.Blue, Color.Cyan, Color.Yellow, Color.Pink, Color.Goldenrod, Color.Green, Color.Red, Color.Purple, Color.Silver, Color.SkyBlue, Color.Black };
     MapElementRecord[] elements = MapElementRecord.GetMapElementByMap(client.Character.Map.Id).ToArray();
     if (elements.Count() == 0)
     {
         client.Character.Reply("No Elements on Map...");
         return;
     }
     for (int i = 0; i < elements.Count(); i++)
     {
         var ele = elements[i];
         client.Send(new DebugHighlightCellsMessage(Colors[i].ToArgb(), new ushort[] { ele.CellId }));
         client.Character.Reply("Element > " + ele.ElementId + " CellId > " + ele.CellId, Colors[i]);
     }
 }