Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 public void AddAction(AvatarAction avatarAction)
 {
     if (avatarAction != null)
     {
         this.avatarActions.Add(avatarAction);
     }
 }
Ejemplo n.º 3
0
 public static int GetBuffIDFromBuffActionID(int actionID)
 {
     if (!AvatarAction.IsBuffActionID(actionID))
     {
         return(0);
     }
     return(0x5000000 | (actionID & 0xffff));
 }
Ejemplo n.º 4
0
 public static int GetActionIDFromBuffActionID(int actionID)
 {
     if (!AvatarAction.IsBuffActionID(actionID))
     {
         return(0);
     }
     return(actionID & ((int)0x07fff0000L));
 }
Ejemplo n.º 5
0
 public static int ComposeBuffActionID(int actionID, int buffID)
 {
     if (!AvatarAction.IsBuffActionID(actionID))
     {
         return(0);
     }
     return((actionID & -65536) | (buffID & 0xffff));
 }
Ejemplo n.º 6
0
        public AvatarAction GetActionById(int id)
        {
            AvatarAction action;

            if (AvatarAction.IsBuffActionID(id))
            {
                ClientServerCommon.Buff buffById = this.GetBuffById(ClientServerCommon.Buff.GetBuffIDFromBuffActionID(id));
                if (buffById == null)
                {
                    return(null);
                }
                return(buffById.GetActionById(ClientServerCommon.Buff.GetActionIDFromBuffActionID(id)));
            }
            if (!this._id_actionMap.TryGetValue(id, out action))
            {
                return(null);
            }
            return(action);
        }
Ejemplo n.º 7
0
        private AvatarAction LoadActionFromXml(SecurityElement element, int sourceTurnId)
        {
            AvatarAction action = new AvatarAction {
                sourceTurnId    = sourceTurnId,
                id              = StrParser.ParseHexInt(element.Attribute("Id"), 0),
                actionType      = TypeNameContainer <AvatarAction._Type> .Parse(element.Attribute("ActionType"), 0),
                weaponType      = TypeNameContainer <EquipmentConfig._WeaponType> .Parse(element.Attribute("WeaponType"), 0),
                combatStateType = TypeNameContainer <_CombatStateType> .Parse(element.Attribute("CombatStateType"), 0),
                loop            = StrParser.ParseBool(element.Attribute("Loop"), false),
                //sourceTurnId = sourceTurnId
            };

            if (element.Children != null)
            {
                foreach (SecurityElement element2 in element.Children)
                {
                    string tag = element2.Tag;
                    if (tag != null)
                    {
                        if (tag == "Event")
                        {
                            action.events.Add(this.LoadEventFromXml(element2, action.events.Count, sourceTurnId));
                        }
                        else if (tag == "Animation")
                        {
                            goto Label_00F2;
                        }
                    }
                    continue;
Label_00F2:
                    action.animations.Add(this.LoadAnimationFromXml(element2));
                }
                action.animations.Sort((Comparison <AvatarAction.Animation>)((a1, a2) => (a2.type - a1.type)));
            }
            return(action);
        }