Beispiel #1
0
        public PropertyModifierSet GetModifierSetByIdAndLevel(int skillId, int skillLevel)
        {
            CombatTurn combatTurnByID = this.GetCombatTurnByID(skillId);

            if ((combatTurnByID == null) || (combatTurnByID.type != 5))
            {
                return(null);
            }
            int          id         = combatTurnByID.GetStage(3).value;
            AvatarAction actionById = this.GetActionById(id);

            if (actionById == null)
            {
                return(null);
            }
            AvatarAction.Event event2 = (actionById.events.Count != 0) ? actionById.events[0] : null;
            if ((event2 == null) || (event2.eventType != 4))
            {
                return(null);
            }
            ClientServerCommon.Buff buffById = this.GetBuffById(event2.buffId);
            if (buffById == null)
            {
                return(null);
            }
            return(buffById.GetModifierSetByLevelFilter(skillLevel));
        }
Beispiel #2
0
        public AvatarAction.Event LoadEventFromXml(SecurityElement element, int eventIdx, int sourceTurnID)
        {
            AvatarAction.Event event2 = new AvatarAction.Event {
                sourceTurnId = sourceTurnID,
                index        = eventIdx
            };
            event2.keyFrameId = StrParser.ParseDecInt(element.Attribute("KeyFrameId"), event2.keyFrameId);
            event2.eventType  = TypeNameContainer <AvatarAction.Event._Type> .Parse(element.Attribute("Type"), 0);

            event2.delay           = StrParser.ParseFloat(element.Attribute("Delay"), 0f);
            event2.loop            = StrParser.ParseBool(element.Attribute("Loop"), event2.loop);
            event2.playOnAllTarget = StrParser.ParseBool(element.Attribute("PlayOnAllTarget"), event2.playOnAllTarget);
            event2.weaponId        = StrParser.ParseHexInt(element.Attribute("WeaponId"), 0);
            event2.boneName        = StrParser.ParseStr(element.Attribute("BoneName"), "");
            event2.buffType        = TypeNameContainer <ClientServerCommon.Buff._BuffType> .ParseBitList(element.Attribute("BuffType"), 0);

            event2.modifyType = TypeNameContainer <PropertyModifier._ValueModifyType> .Parse(element.Attribute("ModifyType"), 2);

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    int    num;
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag != "Effect")
                        {
                            if (tag == "Buff")
                            {
                                goto Label_017E;
                            }
                            if (tag == "ModifierSet")
                            {
                                goto Label_0193;
                            }
                            if (tag == "TestType")
                            {
                                goto Label_01A6;
                            }
                        }
                        else
                        {
                            event2.effects.Add(this.LoadEffectFromXml(element2));
                        }
                    }
                    continue;
Label_017E:
                    this.buffs.Add(this.LoadBuffFromXml(element2, sourceTurnID));
                    continue;
Label_0193:
                    event2.modifierSets.Add(PropertyModifierSet.LoadFromXml(element2));
                    continue;
Label_01A6:
                    num = TypeNameContainer <CombatTurn._TestType> .Parse(element2.Text, 0);

                    if (num != 0)
                    {
                        event2.testType |= num;
                    }
                }
            }
            event2.buffId = StrParser.ParseHexInt(element.Attribute("BuffId"), 0);
            return(event2);
        }