示例#1
0
        public static void SetInstanceIcon(ContentFinderCondition sContentFinderCondition, dynamic obj)
        {
            if (sContentFinderCondition.Content.Key == 55001)
            {
                // Aquapolis
                obj.fullIcon = 1;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55002)
            {
                // Lost Canals of Uznair
                obj.fullIcon = 2;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55003)
            {
                // Hidden Canals of Uznair
                obj.fullIcon = 3;
                return;
            }

            if (sContentFinderCondition.Image.Path.EndsWith("000000.tex"))
            {
                DatabaseBuilder.PrintLine($"Content {sContentFinderCondition.Content.Key} {sContentFinderCondition.Content} has no icon");
                return;
            }

            obj.fullIcon = IconDatabase.EnsureEntry("instance", sContentFinderCondition.Image);
        }
示例#2
0
        public static void SetInstanceIcon(ContentFinderCondition sContentFinderCondition, dynamic obj)
        {
            if (sContentFinderCondition.Content.Key == 55001)
            {
                // Aquapolis
                obj.fullIcon = 1;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55002)
            {
                // Lost Canals of Uznair
                obj.fullIcon = 2;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55003)
            {
                // Hidden Canals of Uznair
                obj.fullIcon = 3;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55004)
            {
                // The Shifting Altars of Uznair
                obj.fullIcon = 4;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55006)
            {
                // The Dungeons of Lyhe Ghiah
                obj.fullIcon = 5;
                return;
            }

            if (sContentFinderCondition.Content.Key == 55008)
            {
                // The Shifting Oubliettes of Lyhe Ghiah
                obj.fullIcon = 6;
                return;
            }

            if (sContentFinderCondition.Image == null)
            {
                DatabaseBuilder.PrintLine($"Content {sContentFinderCondition.Content.Key} {sContentFinderCondition.Content} has no icon");
                return;
            }

            obj.fullIcon = IconDatabase.EnsureEntry("instance", sContentFinderCondition.Image);
        }
示例#3
0
        static string GetColorClass(string color)
        {
            switch (color)
            {
            case "52258": return("highlight-green");

            case "-34022": return("highlight");

            case "-154": return("highlight-yellow");

            case "-3917469": return("highlight-purple");

            case "-12533761": return("highlight");    // [Slots Available], "The Ties that Bind" quest.

            case "-10438406": return("highlight");    // /egiglamour action Egi Glamour quest.

            // Patch 4.4 new colors.
            case "F201F8": return("highlight-green");

            case "F201FA": return("highlight-yellow");

            case "F201F4": return("highlight");

            case "F201F6": return("highlight");

            case "F20222": return("highlight");

            case "F20223": return("highlight-purple");

            case "F20215": return("highlight-yellow");    // Unsure about this one.  Used to note "Legacy of Allag" quest needs to be abandoned and reacquired.

            case "F201FC": return("highlight-red");

            case "F102": return("highlight-blue");    // Only used by some dancer traits in German.  Maybe a bug?

            default:
                DatabaseBuilder.PrintLine($"Unknown color code '{color}'.");
                return("highlight");
            }
        }
示例#4
0
        private static void CheckIconData(Saint.Item item)
        {
            if (!IconDataByItemId.TryGetValue(item.Key, out var storedIconData))
            {
                return;
            }

            var rawIconKey = (UInt16)item.GetRaw("Icon");

            // Ensure the stored data is still what we expect.
            if (rawIconKey != storedIconData.RawIconKey)
            {
                // Icon changed!  Remove data.
                DatabaseBuilder.PrintLine($"{item.Key} {item.Name} icon changed.  {rawIconKey} != {storedIconData.RawIconKey}.  Removing.");
                IconDataByItemId.Remove(item.Key);
            }
            else
            {
                // Have valid stored data.  Cross-reference the image file.
                _iconIdByImageFile[item.Icon] = storedIconData.IconId;
            }
        }
示例#5
0
        public void CreateNpcGilShop(GarlandShop gShop, dynamic npc)
        {
            var shopName = gShop.Name == "Unknown Shop" ? "Purchase Items" : gShop.Name;
            var shop     = CreateShop(shopName, npc, false);

            if (shop == null)
            {
                return; // Skipped.
            }
            var npcId = (int)npc.id;

            foreach (var sItem in gShop.GtShopListings.SelectMany(l => l.Rewards.Select(r => r.Item)))
            {
                if (!_db.ItemsById.TryGetValue(sItem.Key, out var item))
                {
                    if (!string.IsNullOrWhiteSpace(sItem.Name))
                    {
                        DatabaseBuilder.PrintLine($"Skipping shop item: {sItem.Name}");
                    }
                    continue;
                }

                JArray vendors = item.vendors;
                if (vendors == null)
                {
                    item.vendors = vendors = new JArray();
                }

                if (!vendors.Any(i => (int)i == npcId))
                {
                    item.vendors.Add(npcId);
                    Db.AddReference(item, "npc", npcId, true);
                }

                shop.entries.Add(sItem.Key);
                Db.AddReference(npc, "item", sItem.Key, false);
            }
        }
示例#6
0
        private static void MonsterImageCapture(ARealmReversed realm)
        {
            var sMonsters = realm.GameData.GetSheet <Saint.ModelChara>()
                            .Where(m => m.Type == 3)
                            .ToArray();

            var sRat     = sMonsters[0];
            var result   = sRat.GetModelDefinition();
            var modelDef = result.Item1;
            var variant  = result.Item2;
            var model    = modelDef.GetModel(SaintCoinach.Graphics.ModelQuality.High);

            var export = SaintCoinach.Graphics.Exports.ModelExport.AsObj(model, variant);
            var errors = export.GetErrors();

            DatabaseBuilder.PrintLine("Export errors: " + errors);

            WriteExport(export);

            //var source = new SaintCoinach.Graphics.Viewer.RendererSources.MonsterImageRendererSource(sMonsters);
            //var renderer = new SaintCoinach.Graphics.Viewer.ImageRenderer(source, 800, 600);
            //renderer.Run();
        }
示例#7
0
        public string Visit(GenericElement genericElement)
        {
            var genericText = genericElement.ToString();

            switch (genericElement.Tag)
            {
            case TagType.Split:
                if (genericText == "<Split(<Highlight>ObjectParameter(1)</Highlight>, ,1)/>")
                {
                    return("<span class=\"highlight\">Forename</span>");
                }
                else if (genericText == "<Split(<Highlight>ObjectParameter(1)</Highlight>, ,2)/>")
                {
                    return("<span class=\"highlight\">Surname</span>");
                }
                else
                {
                    throw new NotImplementedException();
                }

            case TagType.Highlight:
                var content = genericElement.Content.Accept(this);
                return("<span class=\"highlight\">" + content + "</span>");

            case TagType.Sheet:
                if (genericText == "<Sheet(Addon,9,0)/>")
                {
                    return("<img class=\"hq-icon small\" src=\"images/item/hq.png\">");
                }
                else if (genericText.Contains("GCRank"))
                {
                    return("[GC Rank]");
                }
                else if (genericText == "<Sheet(Race,PlayerParameter(71),0)/>")
                {
                    return("[Race]");
                }
                else if (genericText == "<Sheet(ClassJob,PlayerParameter(68),0)/>")
                {
                    return("[Job]");
                }
                else if (genericText == "<Sheet(Town,PlayerParameter(70),0)/>")
                {
                    return("[Starting City]");
                }
                else if (genericText == "<Sheet(ContentFinderCondition,IntegerParameter(1),18)/>")
                {
                    return("[Item Level]");
                }
                else if (genericText == "<Sheet(ContentFinderCondition,IntegerParameter(2),32)/>")
                {
                    return("[Instance]");
                }
                else if (genericText == "<Sheet(ContentFinderCondition,IntegerParameter(2),34)/>")
                {
                    return("[Instance]");
                }
                else if (genericText.StartsWith("<Sheet(") && !genericText.Contains("PlayerParameter("))
                {
                    var genericElementArgs = genericElement.Arguments.ToArray();
                    var sheetName          = genericElementArgs[0].Accept(this);
                    var sheetKeyRaw        = genericElementArgs[1].Accept(this);
                    if (int.TryParse(sheetKeyRaw.Trim(), out var sheetKey))
                    {
                        var sheet    = DatabaseBuilder.Instance.Realm.GameData.GetSheet(sheetName);
                        var row      = sheet[sheetKey];
                        var rowIndex = int.Parse(genericElementArgs[2].Accept(this).Trim());
                        return(row[rowIndex].ToString());
                    }
                    return("[???]");
                }
                else
                {
                    throw new NotImplementedException();
                }

            case TagType.Clickable:
                return(string.Join("", genericElement.Arguments.Select(v => v.Accept(this))));

            case TagType.Gui:
                if (genericText == "<Gui(54)/>")
                {
                    return("{");
                }
                else if (genericText == "<Gui(55)/>")
                {
                    return("}");
                }
                else if (genericText == "<Gui(63)/>")
                {
                    return("*");    // Not sure about this.
                }
                else
                {
                    DatabaseBuilder.PrintLine($"Unknown GUI string flag: {genericText}, defaulting to *.");
                    return("*");
                }

            case TagType.Time:
                return("[Time]");

            case TagType.SheetEn:
            case TagType.SheetDe:
            case TagType.SheetFr:
            case TagType.SheetJa:
            {
                var genericElementArgs = genericElement.Arguments.ToArray();
                var args      = genericElement.Arguments.Select(a => a.Accept(this)).ToArray();
                var sheetName = genericElementArgs[0].Accept(this);
                try
                {
                    var sheet = DatabaseBuilder.Instance.Realm.GameData.GetSheet(sheetName);
                    if (genericElementArgs[2] is Parameter sheetKeyParam)
                    {
                        return("[Error]");
                    }
                    var sheetKey = int.Parse(genericElementArgs[2].Accept(this).Trim());
                    var row      = sheet[sheetKey];
                    return(row.ToString());
                } catch (KeyNotFoundException e)
                {
                    DatabaseBuilder.PrintLine($"Missing sheet for HTML String Formatter: {sheetName}");
                    return("");
                }
            }

            case TagType.Value:
                return(genericElement.Content.Accept(this));

            case TagType.CommandIcon:
                return("[???]");

            default:
                return("");
            }
        }
示例#8
0
 public static string GetShopName(ScriptInstruction si)
 {
     if (si.Label.Contains("FCCSHOP"))
     {
         return("Spend company credits (items)");
     }
     else if (si.Label == "MOBSHOP1")
     {
         return("Exchange Centurio Seals");
     }
     else if (si.Label == "MOBSHOP2")
     {
         return("Exchange Centurio Seals (Advanced)");
     }
     else if (si.Label == "SHOP_SPOIL")
     {
         return("Exchange Spoils");
     }
     else if (si.Label == "SPECIAL_SHOP0" && si.Argument == 1769813)
     {
         return("Achievement Rewards");
     }
     else if (si.Label == "SPECIAL_SHOP1" && si.Argument == 1769845)
     {
         return("Achievement Rewards 2");
     }
     else if (si.Label == "SPECIAL_SHOP2" && si.Argument == 1769846)
     {
         return("Achievement Rewards 3");
     }
     else if (si.Label == "SHOP_0" && si.Argument == 1769842)
     {
         return("Gold Certificates of Commendation");
     }
     else if (si.Label == "SHOP_1" && si.Argument == 1769841)
     {
         return("Silver Certificates of Commendation");
     }
     else if (si.Label == "SHOP" && si.Argument == 1769812)
     {
         return("PVP Rewards");
     }
     else if (si.Label == "REPLICA_SHOP0" && si.Argument == 262918)
     {
         return("Purchase a Eureka weapon replica (DoW).");
     }
     else if (si.Label == "REPLICA_SHOP1" && si.Argument == 262922)
     {
         return("Purchase a Eureka weapon replica (DoM).");
     }
     else if (si.Label == "FREE_SHOP_BATTLE" && si.Argument == 1769898)
     {
         return("Battle Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_PVP" && si.Argument == 1769899)
     {
         return("PvP Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_CHARACTER" && si.Argument == 1769900)
     {
         return("Character Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_ITEM" && si.Argument == 1769901)
     {
         return("Item Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_CRAFT" && si.Argument == 1769902)
     {
         return("Crafting Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_GATHERING" && si.Argument == 1769903)
     {
         return("Gathering Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_QUEST" && si.Argument == 1769904)
     {
         return("Quest Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_EXPLORATION" && si.Argument == 1769905)
     {
         return("Exploration Achievement Rewards");
     }
     else if (si.Label == "FREE_SHOP_GRANDCOMPANY" && si.Argument == 1769906)
     {
         return("Grand Company Achievement Rewards");
     }
     else
     {
         DatabaseBuilder.PrintLine($"Unknown shop label {si.Label}, arg {si.Argument}.");
         return(si.Label);
     }
 }
示例#9
0
 public static void Stop()
 {
     DatabaseBuilder.PrintLine("One time exports done");
     Console.ReadLine();
     Environment.Exit(0);
 }