Beispiel #1
0
        public static void AddStyles(GShopReader shop, ElementReader element)
        {
            foreach (var ssin in RemoveStylesDuplicates(element))
            {
                var cat    = ssin.GetByKey("gender") == 0 ? 6 : 7;
                int subcat = ssin.GetByKey("id_major_type");
                if (subcat == (int)Type.Weapon)
                {
                    continue;
                }
                switch (subcat)
                {
                case (int)Type.Up:
                    subcat = 0;
                    break;

                case (int)Type.Down:
                    subcat = 1;
                    break;

                case (int)Type.Boots:
                    subcat = 2;
                    break;

                case (int)Type.Bracers:
                    subcat = 3;
                    break;

                case (int)Type.Hat:
                    subcat = 4;
                    break;
                }
                shop.AddItem(ssin.GetByKey("ID"), cat, subcat, ssin.GetByKey("Name"), ssin.GetByKey("file_icon"), true);
            }
        }
Beispiel #2
0
        public static void CleanUp(GShopReader shop, ElementReader element, bool removeStyles = true, bool removeWeapon = true)
        {
            List <ShopItem> removeItems = new List <ShopItem>();

            foreach (var item in shop.Items)
            {
                foreach (var i in element.GetListById(84))
                {
                    if (!removeStyles && i.GetByKey("id_major_type") != (int)Type.Weapon)
                    {
                        continue;
                    }
                    if (!removeWeapon && i.GetByKey("id_major_type") == (int)Type.Weapon)
                    {
                        continue;
                    }
                    if (i.GetByKey("ID") != item.ItemId)
                    {
                        continue;
                    }
                    removeItems.Add(item);
                    break;
                }
            }
            foreach (var rr in removeItems)
            {
                shop.RemoveItem(rr);
            }
        }
Beispiel #3
0
        public static void AddWeapons(GShopReader shop, ElementReader element)
        {
            foreach (var ss in RemoveWeaponsDuplicates(element))
            {
                var cat    = ss.GetByKey("gender") == 0 ? (int)Gender.Man : (int)Gender.Women;
                int subcat = ss.GetByKey("character_combo_id");
                switch (subcat)
                {
                case 32:
                    subcat = (int)WeaponSub.Sin;
                    break;

                case 4:
                    subcat = (int)WeaponSub.Sham;
                    break;

                case 273:
                    subcat = (int)WeaponSub.Swords;
                    break;

                case 64:
                    subcat = (int)WeaponSub.Archer;
                    break;

                case 97:
                    subcat = (int)WeaponSub.Archer;
                    break;

                case 17:
                    subcat = (int)WeaponSub.Bylav;
                    break;

                case 650:
                    subcat = (int)WeaponSub.Posox;
                    break;

                case 89:
                    subcat = (int)WeaponSub.Kastet;
                    break;

                default:
                    subcat = (int)WeaponSub.Diff;
                    break;
                }
                shop.AddItem(ss.GetByKey("ID"), cat, subcat, ss.GetByKey("Name"), ss.GetByKey("file_icon"), true);
            }
        }