Ejemplo n.º 1
0
        private FateTarget[] BuildFates()
        {
            const int Count = 3;

            FateTarget[] fates = new FateTarget[Count];
            for (int i = 0; i < fates.Length; ++i)
            {
                Fate      fate  = As <Fate>("Fate", i);
                PlaceName place = As <PlaceName>("PlaceName{Fate}", i);

                fates[i] = new FateTarget(fate, place);
            }

            return(fates);
        }
Ejemplo n.º 2
0
        void BuildFate(Game.Fate sFate)
        {
            if (string.IsNullOrEmpty(sFate.Name.ToString()) || sFate.MaximumClassJobLevel <= 1)
            {
                return;
            }

            dynamic fate = new JObject();

            fate.id = sFate.Key;
            _builder.Localize.Strings((JObject)fate, sFate, x => Utils.RemoveLineBreaks(Utils.SanitizeTags(x)), "Name");
            _builder.Localize.HtmlStrings(fate, sFate, "Description");
            fate.patch  = PatchDatabase.Get("fate", sFate.Key);
            fate.lvl    = sFate.ClassJobLevel;
            fate.maxlvl = sFate.MaximumClassJobLevel;
            fate.type   = MapIconToFateType(sFate.Key, sFate.Name, Utils.GetIconId(sFate.MapIcon));

            if (_fateDataById.TryGetValue(sFate.Key, out var data))
            {
                if (data.zoneid != null)
                {
                    fate.zoneid = data.zoneid;
                    _builder.Db.AddLocationReference((int)fate.zoneid);
                }
                //else
                //    System.Diagnostics.Debug.WriteLine("FATE " + name + " has no zone");

                if (data.coords != null)
                {
                    var coords = ((JArray)data.coords).Select(t => (int)t).ToArray();
                    fate.coords = new JArray(coords);
                }

                if (data.items != null)
                {
                    fate.items = data.items;
                    foreach (int itemId in fate.items)
                    {
                        _builder.Db.AddReference(fate, "item", itemId, false);
                    }
                }
            }

            _builder.Db.Fates.Add(fate);
        }
Ejemplo n.º 3
0
 public FateTarget(Fate fate, PlaceName placeName)
 {
     Fate      = fate;
     PlaceName = placeName;
 }
Ejemplo n.º 4
0
 public FateTarget(Fate fate, PlaceName placeName)
 {
     Fate = fate;
     PlaceName = placeName;
 }