예제 #1
0
        /// <summary>
        /// Get Item Name by TypeID
        /// </summary>
        public string GetName(uint TypeID)
        {
            switch (TypeID.GetItemGroup())
            {
            case IffGroupFlag.ITEM_TYPE_CHARACTER:
                return(Character.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_PART:
                //Part
                return(Part.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_HAIR_STYLE:
            {
                return(HairStyle.GetItemName(TypeID));
            }

            case IffGroupFlag.ITEM_TYPE_CLUB:
                return(ClubSet.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_BALL:
                // Ball
                return(Ball.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_USE:
                // Normal Item
                return(Item.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_CADDIE:
                // Cadie
                return(Caddie.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_CADDIE_ITEM:
                return(CaddieItem.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_SETITEM:
                // Part
                return(SetItem.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_SKIN:
                return(Skin.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_MASCOT:
                return(Mascot.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_CARD:
                return(Card.GetItemName(TypeID));

            case IffGroupFlag.ITEM_TYPE_AUX:
                return(AuxPart.GetItemName(TypeID));
            }
            return("Unknown Item Name");
        }
예제 #2
0
        public bool IsExist(uint TypeID)
        {
            switch (TypeID.GetItemGroup())
            {
            case IffGroupFlag.ITEM_TYPE_CLUB:
                return(ClubSet.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_CHARACTER:
                return(Character.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_PART:
                //  Part
                return(Part.IsExist(TypeID));

            //Hair
            case IffGroupFlag.ITEM_TYPE_HAIR_STYLE:
                return(HairStyle.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_BALL:
                //  Ball
                return(Ball.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_USE:
                // Normal Item
                return(Item.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_CADDIE:
                return(Caddie.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_CADDIE_ITEM:
                return(CaddieItem.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_SETITEM:
                return(SetItem.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_SKIN:
                return(Skin.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_MASCOT:
                return(Mascot.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_CARD:
                return(Card.IsExist(TypeID));

            case IffGroupFlag.ITEM_TYPE_AUX:
                return(AuxPart.IsExist(TypeID));
            }
            return(false);
        }
예제 #3
0
 public void LoadIff()
 {
     try
     {
         if (File.Exists("data/pangya_gb.iff"))
         {
             Card.Load();
             Items.Load();
             SetItem.Load();
             Character.Load();
             HairStyle.Load();
             Club.Load();
             Caddie.Load();
             Skin.Load();
             CaddieItem.Load();
             Mascot.Load();
             CutinInfo.Load();
             GrandPrix.Load();
             LevelPrize.Load();
             Ball.Load();
             GPSpecial.Load();
             GPReward.Load();
             MemorialRare.Load();
             MemorialCoin.Load();
             MgicBox.Load();
             AuxPart.Load();
             Desc.Load();
             Part.Load();
         }
         else
         {
             MessageBox.Show("data/pangya_gb.iff file in folder not found !", "Pangya File Core", MessageBoxButtons.OK, MessageBoxIcon.Error);
             throw new Exception("[ERROR_IFF]: data/pangya_gb.iff file in folder not found !");
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message, ConsoleColor.Red);
         Environment.Exit(0);
     }
 }
예제 #4
0
        public void LoadIff()
        {
            bool result;

            try
            {
                if (Directory.Exists("data") && File.Exists(FileName))
                {
                    var zip = ZipFileEx.Open(FileName);

                    result = Part.Load(zip.GetFileData("Part.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Part]: Items Loads {Part.Count}");
                    }

                    result = Card.Load(zip.GetFileData("Card.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Card]: Items Loads {Card.Count}");
                    }

                    result = Caddie.Load(zip.GetFileData("Caddie.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Caddie]: Items Loads {Caddie.Count}");
                    }

                    result = Item.Load(zip.GetFileData("Item.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Item]: Items Loads {Item.Count}");
                    }

                    result = LevelUpPrizeItem.Load(zip.GetFileData("LevelUpPrizeItem.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.LevelUpPrizeItem]: Items Loads {LevelUpPrizeItem.Count}");
                    }

                    result = Character.Load(zip.GetFileData("Character.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Character]: Items Loads {Character.Count}");
                    }

                    result = Ball.Load(zip.GetFileData("Ball.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Ball]: Items Loads {Ball.Count}");
                    }

                    result = Ability.Load(zip.GetFileData("Ability.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Ability]: Items Loads {Ability.Count}");
                    }

                    result = Skin.Load(zip.GetFileData("Skin.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Skin]: Items Loads {Skin.Count}");
                    }
                    result = CaddieItem.Load(zip.GetFileData("CaddieItem.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.CaddieItem]: Items Loads {CaddieItem.Count}");
                    }

                    result = Club.Load(zip.GetFileData("Club.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Club]: Items Loads {Club.Count}");
                    }

                    result = ClubSet.Load(zip.GetFileData("ClubSet.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.ClubSet]: Items Loads {ClubSet.Count}");
                    }

                    result = Course.Load(zip.GetFileData("Course.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Course]: Items Loads {Course.Count}");
                    }

                    result = CutinInformation.Load(zip.GetFileData("CutinInfomation.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.CutinInformation]: Items Loads {CutinInformation.Count}");
                    }

                    result = Desc.Load(zip.GetFileData("Desc.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Desc]: Items Loads {Desc.Count}");
                    }

                    result = Furniture.Load(zip.GetFileData("Furniture.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Furniture]: Items Loads {Furniture.Count}");
                    }

                    result = FurnitureAbility.Load(zip.GetFileData("FurnitureAbility.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.FurnitureAbility]: Items Loads {FurnitureAbility.Count}");
                    }

                    result = Mascot.Load(zip.GetFileData("Mascot.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Mascot]: Items Loads {Mascot.Count}");
                    }

                    result = TikiSpecialTable.Load(zip.GetFileData("TikiSpecialTable.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.TikiSpecialTable]: Items Loads {TikiSpecialTable.Count}");
                    }

                    result = TikiRecipe.Load(zip.GetFileData("TikiRecipe.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.TikiRecipe]: Items Loads {TikiRecipe.Count}");
                    }

                    result = TikiPointTable.Load(zip.GetFileData("TikiPointTable.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.TikiPointTable]: Items Loads {TikiPointTable.Count}");
                    }

                    result = CadieMagicBox.Load(zip.GetFileData("CadieMagicBox.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.CadieMagicBox]: Items Loads {CadieMagicBox.Count}");
                    }

                    result = CadieMagicBoxRandom.Load(zip.GetFileData("CadieMagicBoxRandom.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.CadieMagicBoxRandom]: Items Loads {CadieMagicBoxRandom.Count}");
                    }

                    result = HairStyle.Load(zip.GetFileData("HairStyle.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.HairStyle]: Items Loads {HairStyle.Count}");
                    }

                    result = Match.Load(zip.GetFileData("Match.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Match]: Items Loads {Match.Count}");
                    }

                    result = SetItem.Load(zip.GetFileData("SetItem.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.SetItem]: Items Loads {SetItem.Count}");
                    }

                    result = Enchant.Load(zip.GetFileData("Enchant.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Enchant]: Items Loads {Enchant.Count}");
                    }

                    result = Achievement.Load(zip.GetFileData("Achievement.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.Achievement]: Items Loads {Achievement.Count}");
                    }

                    result = QuestItem.Load(zip.GetFileData("QuestItem.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.QuestItem]: Items Loads {QuestItem.Count}");
                    }

                    result = QuestStuff.Load(zip.GetFileData("QuestStuff.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.QuestStuff]: Items Loads {QuestStuff.Count}");
                    }

                    result = SetEffectTable.Load(zip.GetFileData("SetEffectTable.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.SetEffectTable]: Items Loads {SetEffectTable.Count}");
                    }

                    result = AuxPart.Load(zip.GetFileData("AuxPart.iff"));
                    if (result)
                    {
                        Console.WriteLine(DateTime.Now.ToString("[yyyy/MM/dd HH:mm:ss] ") + $"[Pang.IFF.AuxPart]: Items Loads {AuxPart.Count}");
                    }
                }
                else
                {
                    throw new Exception(" Failed to attempt to load data from file not found: " + FileName);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Pang.IFF.Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(0);
            }
        }
예제 #5
0
        public object GetItem(uint TypeID)
        {
            switch (GetItemGroup(TypeID))
            {
            case IFFGROUP.ITEM_TYPE_CHARACTER:
            {
                return(Character.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_HAIR_STYLE:
            {
                return(HairStyle.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_PART:
            {
                return(Part.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_CLUB:
            {
                return(Club.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_BALL:
            {
                return(Ball.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_USE:
            {
                return(Items.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_CADDIE:
            {
                return(Caddie.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_CADDIE_ITEM:
            {
                return(CaddieItem.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_SETITEM:
            {
                return(SetItem.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_SKIN:
            {
                return(Skin.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_MASCOT:
            {
                return(Mascot.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_CARD:
            {
                return(Card.GetItem(TypeID));
            }

            case IFFGROUP.ITEM_TYPE_AUX:
            {
                return(AuxPart.GetItem(TypeID));
            }

            default:
            {
                Console.WriteLine($"ItemGroup_Un -> {GetItemGroup(TypeID)}");
            }
            break;
            }
            throw new NotImplementedException();
        }
예제 #6
0
        internal override IFFFile Get()
        {
            var item = new AuxPart();

            #region Header IFF
            item.Header.Active                = Reader().ReadUInt32();
            item.Header.ID                    = Reader().ReadUInt32();
            item.Header.Name                  = GetString(40); // 40 Byte long
            item.Header.Level                 = (ItemLevelEnum)Reader().ReadByte();
            item.Header.Icon                  = GetString(40);
            item.Header.Flag1                 = Reader().ReadByte();
            item.Header.Flag2                 = Reader().ReadByte();
            item.Header.Flag3                 = Reader().ReadByte();
            item.Header.Price                 = Reader().ReadUInt32();
            item.Header.DiscountPrice         = Reader().ReadUInt32();
            item.Header.UsedPrice             = Reader().ReadUInt32();
            item.Header.ShopFlag              = (ShopFlag)Reader().ReadByte();
            item.Header.MoneyFlag             = (MoneyFlag)Reader().ReadByte();
            item.Header.TimeFlag              = Reader().ReadByte();
            item.Header.TimeByte              = Reader().ReadByte();
            item.Header.TPItem                = Reader().ReadUInt32();
            item.Header.TPCount               = Reader().ReadUInt32();
            item.Header.Mileage               = Reader().ReadUInt16();
            item.Header.BonusProb             = Reader().ReadUInt16();
            item.Header.Mileage2              = Reader().ReadUInt16();
            item.Header.Mileage3              = Reader().ReadUInt16();
            item.Header.TikiPointShop         = Reader().ReadUInt32();
            item.Header.TikiPang              = Reader().ReadUInt32();
            item.Header.ActiveData            = Reader().ReadUInt32();
            item.Header.StartTime.Year        = Reader().ReadUInt16();
            item.Header.StartTime.Month       = Reader().ReadUInt16();
            item.Header.StartTime.DayOfWeek   = Reader().ReadUInt16();
            item.Header.StartTime.Day         = Reader().ReadUInt16();
            item.Header.StartTime.Hour        = Reader().ReadUInt16();
            item.Header.StartTime.Minute      = Reader().ReadUInt16();
            item.Header.StartTime.Second      = Reader().ReadUInt16();
            item.Header.StartTime.MilliSecond = Reader().ReadUInt16();
            item.Header.EndTime.Year          = Reader().ReadUInt16();
            item.Header.EndTime.Month         = Reader().ReadUInt16();
            item.Header.EndTime.DayOfWeek     = Reader().ReadUInt16();
            item.Header.EndTime.Day           = Reader().ReadUInt16();
            item.Header.EndTime.Hour          = Reader().ReadUInt16();
            item.Header.EndTime.Minute        = Reader().ReadUInt16();
            item.Header.EndTime.Second        = Reader().ReadUInt16();
            item.Header.EndTime.MilliSecond   = Reader().ReadUInt16();
            #endregion
            item.Amount               = Reader().ReadByte();
            item.Unknown1             = Reader().ReadUInt32();
            item.Unknown2             = Reader().ReadUInt16();
            item.Power                = Reader().ReadByte();
            item.Control              = Reader().ReadByte();
            item.Accuracy             = Reader().ReadByte();
            item.Spin                 = Reader().ReadByte();
            item.Curve                = Reader().ReadByte();
            item.PowerSlot            = Reader().ReadByte();
            item.ControlSlot          = Reader().ReadByte();
            item.AccuracySlot         = Reader().ReadByte();
            item.SpinSlot             = Reader().ReadByte();
            item.CurveSlot            = Reader().ReadByte();
            item.ClubDistance         = Reader().ReadUInt16();
            item.Luck                 = Reader().ReadUInt16();
            item.PowerGauge           = Reader().ReadUInt16();
            item.PangBonus            = Reader().ReadUInt16();
            item.ExperiencePercentage = Reader().ReadUInt16();
            item.Unknown3             = Reader().ReadUInt32();

            return(item);
        }