예제 #1
0
        public static string GetResourceName(Action _action, string _resName, bool _bUseAdvanceSkin)
        {
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (refParamObject != null && refParamObject.Originator && refParamObject.Originator.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && refParamObject.Originator.get_handle().ActorControl != null)
            {
                HeroWrapper heroWrapper = (HeroWrapper)refParamObject.Originator.get_handle().ActorControl;
                uint        num;
                if (heroWrapper != null && heroWrapper.GetSkinCfgID(out num))
                {
                    int           num2           = _resName.LastIndexOf('/');
                    StringBuilder stringBuilder  = new StringBuilder(_resName);
                    StringBuilder stringBuilder2 = new StringBuilder(heroWrapper.GetSkinEffectPath());
                    if (num2 >= 0)
                    {
                        stringBuilder.Remove(0, num2);
                        stringBuilder2.Append(stringBuilder);
                        if (_bUseAdvanceSkin)
                        {
                            int advanceSkinIndex = heroWrapper.GetAdvanceSkinIndex();
                            if (advanceSkinIndex > 0)
                            {
                                stringBuilder2.AppendFormat("_level{0}", advanceSkinIndex);
                            }
                        }
                        return(stringBuilder2.ToString());
                    }
                }
            }
            return(_resName);
        }
예제 #2
0
        public static string GetResourceName(AGE.Action _action, string _resName, bool _bUseAdvanceSkin)
        {
            uint            num;
            SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");

            if (((refParamObject == null) || (refParamObject.Originator == 0)) || ((refParamObject.Originator.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero) || (refParamObject.Originator.handle.ActorControl == null)))
            {
                return(_resName);
            }
            HeroWrapper actorControl = (HeroWrapper)refParamObject.Originator.handle.ActorControl;

            if ((actorControl == null) || !actorControl.GetSkinCfgID(out num))
            {
                return(_resName);
            }
            int           length   = _resName.LastIndexOf('/');
            StringBuilder builder  = new StringBuilder(_resName);
            StringBuilder builder2 = new StringBuilder(actorControl.GetSkinEffectPath());

            if (length < 0)
            {
                return(_resName);
            }
            builder.Remove(0, length);
            builder2.Append(builder);
            if (_bUseAdvanceSkin)
            {
                int advanceSkinIndex = actorControl.GetAdvanceSkinIndex();
                if (advanceSkinIndex > 0)
                {
                    builder2.AppendFormat("_level{0}", advanceSkinIndex);
                }
            }
            return(builder2.ToString());
        }
예제 #3
0
 public static string GetResourceName(ref PoolObjHandle <ActorRoot> _attack, string _resName, bool _bUseAdvanceSkin)
 {
     if (_attack && _attack.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && _attack.get_handle().ActorControl != null)
     {
         HeroWrapper heroWrapper = (HeroWrapper)_attack.get_handle().ActorControl;
         uint        num;
         if (heroWrapper != null && heroWrapper.GetSkinCfgID(out num))
         {
             int           num2           = _resName.LastIndexOf('/');
             StringBuilder stringBuilder  = new StringBuilder(_resName);
             StringBuilder stringBuilder2 = new StringBuilder(heroWrapper.GetSkinEffectPath());
             if (num2 >= 0)
             {
                 stringBuilder.Remove(0, num2);
                 stringBuilder2.Append(stringBuilder);
                 if (_bUseAdvanceSkin)
                 {
                     int advanceSkinIndex = heroWrapper.GetAdvanceSkinIndex();
                     if (advanceSkinIndex > 0)
                     {
                         stringBuilder2.AppendFormat("_level{0}", advanceSkinIndex);
                     }
                 }
                 return(stringBuilder2.ToString());
             }
         }
     }
     return(_resName);
 }
예제 #4
0
        public static string GetResourceName(ref PoolObjHandle <ActorRoot> _attack, string _resName, bool _bUseAdvanceSkin)
        {
            uint num;

            if (((_attack == 0) || (_attack.handle.TheActorMeta.ActorType != ActorTypeDef.Actor_Type_Hero)) || (_attack.handle.ActorControl == null))
            {
                return(_resName);
            }
            HeroWrapper actorControl = (HeroWrapper)_attack.handle.ActorControl;

            if ((actorControl == null) || !actorControl.GetSkinCfgID(out num))
            {
                return(_resName);
            }
            int           length   = _resName.LastIndexOf('/');
            StringBuilder builder  = new StringBuilder(_resName);
            StringBuilder builder2 = new StringBuilder(actorControl.GetSkinEffectPath());

            if (length < 0)
            {
                return(_resName);
            }
            builder.Remove(0, length);
            builder2.Append(builder);
            if (_bUseAdvanceSkin)
            {
                int advanceSkinIndex = actorControl.GetAdvanceSkinIndex();
                if (advanceSkinIndex > 0)
                {
                    builder2.AppendFormat("_level{0}", advanceSkinIndex);
                }
            }
            return(builder2.ToString());
        }