Ejemplo n.º 1
0
        public static bool OnSkillFuncChangeSkill(ref SSkillFuncContext inContext)
        {
            PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;

            if (inTargetObj != 0)
            {
                int  num            = 0;
                int  skillFuncParam = 0;
                int  num3           = 0;
                bool flag           = false;
                BuffChangeSkillRule changeSkillRule = null;
                if (inContext.inStage == ESkillFuncStage.Enter)
                {
                    skillFuncParam = inContext.GetSkillFuncParam(0, false);
                    num            = inContext.GetSkillFuncParam(1, false);
                    num3           = inContext.GetSkillFuncParam(2, false);
                    flag           = inContext.GetSkillFuncParam(3, false) == 1;
                    inContext.LocalParams[0].iParam = skillFuncParam;
                    if (inTargetObj.handle.BuffHolderComp != null)
                    {
                        changeSkillRule = inTargetObj.handle.BuffHolderComp.changeSkillRule;
                        if (changeSkillRule != null)
                        {
                            changeSkillRule.ChangeSkillSlot((SkillSlotType)skillFuncParam, num, num3);
                        }
                    }
                    if (flag && (skillFuncParam == 0))
                    {
                        inTargetObj.handle.SkillControl.bImmediateAttack = flag;
                    }
                }
                else if (inContext.inStage == ESkillFuncStage.Leave)
                {
                    skillFuncParam = inContext.LocalParams[0].iParam;
                    flag           = inContext.GetSkillFuncParam(3, false) == 1;
                    if (inTargetObj.handle.BuffHolderComp != null)
                    {
                        changeSkillRule = inTargetObj.handle.BuffHolderComp.changeSkillRule;
                        if (changeSkillRule != null)
                        {
                            changeSkillRule.RecoverSkillSlot((SkillSlotType)skillFuncParam);
                        }
                        if (flag && (skillFuncParam == 0))
                        {
                            inTargetObj.handle.SkillControl.bImmediateAttack = false;
                            inTargetObj.handle.ActorControl.CancelCommonAttackMode();
                        }
                    }
                }
            }
            return(true);
        }
        public static bool OnSkillFuncChangeSkill(ref SSkillFuncContext inContext)
        {
            PoolObjHandle <ActorRoot> inTargetObj = inContext.inTargetObj;

            if (inTargetObj != 0)
            {
                int num            = 0;
                int skillFuncParam = 0;
                BuffChangeSkillRule changeSkillRule = null;
                if (inContext.inStage == ESkillFuncStage.Enter)
                {
                    skillFuncParam = inContext.GetSkillFuncParam(0, false);
                    num            = inContext.GetSkillFuncParam(1, false);
                    inContext.LocalParams[0].iParam = skillFuncParam;
                    if (inTargetObj.handle.BuffHolderComp != null)
                    {
                        changeSkillRule = inTargetObj.handle.BuffHolderComp.changeSkillRule;
                        if (changeSkillRule != null)
                        {
                            changeSkillRule.ChangeSkillSlot((SkillSlotType)skillFuncParam, num);
                        }
                    }
                }
                else if (inContext.inStage == ESkillFuncStage.Leave)
                {
                    skillFuncParam = inContext.LocalParams[0].iParam;
                    if (inTargetObj.handle.BuffHolderComp != null)
                    {
                        changeSkillRule = inTargetObj.handle.BuffHolderComp.changeSkillRule;
                        if (changeSkillRule != null)
                        {
                            changeSkillRule.RecoverSkillSlot((SkillSlotType)skillFuncParam);
                        }
                    }
                }
            }
            return(true);
        }