Esempio n. 1
0
        private Equipment LoadEquipmentFromXml(SecurityElement element)
        {
            Equipment equipment = new Equipment {
                id                     = StrParser.ParseHexInt(element.Attribute("Id"), 0),
                sortIndex              = StrParser.ParseDecInt(element.Attribute("SortIndex"), 0),
                type                   = TypeNameContainer <_Type> .Parse(element.Attribute("Type"), 0),
                qualityLevel           = StrParser.ParseDecInt(element.Attribute("QualityLevel"), 0),
                weaponType             = TypeNameContainer <_WeaponType> .Parse(element.Attribute("WeaponType"), 0),
                activeableAssembleDesc = StrParser.ParseStr(element.Attribute("ActiveableAssembleDesc"), string.Empty, true)
            };

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag == "EquipmentBreakthrough")
                        {
                            equipment.equipBreakthroughs.Add(this.LoadEquipmentBreakthroughFromXml(element2));
                        }
                        else if (tag == "GetWay")
                        {
                            goto Label_00F4;
                        }
                    }
                    continue;
Label_00F4:
                    equipment.getways.Add(GetWay.LoadFromXml(element2));
                }
            }
            return(equipment);
        }
Esempio n. 2
0
        private Skill LoadSkillFromXml(SecurityElement element)
        {
            Skill skill = new Skill {
                id           = StrParser.ParseHexInt(element.Attribute("Id"), 0),
                type         = TypeNameContainer <CombatTurn._Type> .Parse(element.Attribute("Type"), 0),
                sortIndex    = StrParser.ParseDecInt(element.Attribute("SortIndex"), 0),
                qualityLevel = StrParser.ParseDecInt(element.Attribute("QualityLevel"), 0)
            };

            skill.uiPfxName = StrParser.ParseStr(element.Attribute("UIPfxName"), skill.uiPfxName);
            skill.needSkillScrollToRobShow = StrParser.ParseBool(element.Attribute("NeedSkillScrollToRobShow"), false);
            skill.activeableAssembleDesc   = StrParser.ParseStr(element.Attribute("ActiveableAssembleDesc"), string.Empty);
            skill.isSuperSkill             = StrParser.ParseBool(element.Attribute("IsSuperSkill"), false);
            skill.roleVoiceName            = element.Attribute("RoleVoiceName");
            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag != "LevelDesc")
                        {
                            if (tag == "LevelModiferSets")
                            {
                                goto Label_0163;
                            }
                            if (tag == "GetWay")
                            {
                                goto Label_0176;
                            }
                            if (tag == "SkillUnlockDesc")
                            {
                                goto Label_0189;
                            }
                            if (tag == "PowerAttribute")
                            {
                                goto Label_019D;
                            }
                        }
                        else
                        {
                            skill.levelDescs.Add(IncreaseString.LoadFromXml(element2));
                        }
                    }
                    continue;
Label_0163:
                    skill.levelModiferSets.Add(PropertyModifierSet.LoadFromXml(element2));
                    continue;
Label_0176:
                    skill.getways.Add(GetWay.LoadFromXml(element2));
                    continue;
Label_0189:
                    skill.skillUnlockDescs.Add(this.LoadSkillUnlockDescFromXml(element2));
                    continue;
Label_019D:
                    skill.powerAttributes = PowerAttribute.LoadFromXml(element2);
                }
            }
            return(skill);
        }
Esempio n. 3
0
        private Avatar LoadAvatarFromXml(SecurityElement element)
        {
            Avatar avatar = new Avatar {
                id        = StrParser.ParseHexInt(element.Attribute("Id"), 0),
                sortIndex = StrParser.ParseDecInt(element.Attribute("SortIndex"), 0)
            };

            avatar.qualityLevel = StrParser.ParseDecInt(element.Attribute("QualityLevel"), avatar.qualityLevel);
            avatar.gender       = TypeNameContainer <_AvatarGender> .Parse(element.Attribute("Gender"), 0);

            avatar.growthDesc  = StrParser.ParseStr(element.Attribute("GrowthDesc"), "", true);
            avatar.countryType = TypeNameContainer <_AvatarCountryType> .Parse(element.Attribute("CountryType"), 0);

            avatar.traitDesc = StrParser.ParseStr(element.Attribute("TraitDesc"), "", true);
            avatar.traitType = TypeNameContainer <_AvatarTraitType> .Parse(element.Attribute("TraitType"), 0);

            avatar.characterType = StrParser.ParseDecInt(element.Attribute("CharacterType"), 0);
            avatar.cardPicture   = StrParser.ParseStr(element.Attribute("CardPicture"), "");
            avatar.npcDesc       = StrParser.ParseStr(element.Attribute("NpcDesc"), "");
            avatar.smardCardRect = rect.LoadFromXml(element.Attribute("SmardCardRect"));
            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    switch (element2.Tag)
                    {
                    case "Assemble":
                    {
                        int item = StrParser.ParseHexInt(element2.Attribute("Id"), 0);
                        if (item != 0)
                        {
                            avatar.assemableIds.Add(item);
                        }
                        break;
                    }

                    case "AvatarBreakthrough":
                        avatar.breakThroughs.Add(this.LoadAvatarBreakThoughFromXml(element2));
                        break;

                    case "AvatarDefaultSkillId":
                    {
                        int num2 = StrParser.ParseHexInt(element2.Attribute("Id"), 0);
                        if (num2 != 0)
                        {
                            avatar.avatarDefaultSkillIds.Add(num2);
                        }
                        break;
                    }

                    case "Voice":
                        avatar.voices.Add(StrParser.ParseStr(element2.Attribute("Name"), ""));
                        break;

                    case "GetWay":
                        avatar.getways.Add(GetWay.LoadFromXml(element2));
                        break;

                    case "WeaponAsset":
                        avatar.weaponAssets.Add(this.LoadWeaponAssetFromXml(element2));
                        break;

                    case "ShowWeaponAsset":
                        avatar.showWeaponAssets.Add(this.LoadWeaponAssetFromXml(element2));
                        break;

                    case "CompositeSkillId":
                        avatar.compositeSkillId = StrParser.ParseHexInt(element2.Text, 0);
                        break;
                    }
                }
            }
            return(avatar);
        }