Example #1
0
 public SubActorLook(sbyte index, SubEntityBindingPointCategoryEnum category, ActorLook look)
 {
     this.m_bindingIndex    = index;
     this.m_bindingCategory = category;
     this.m_look            = look;
     this.m_subEntity       = new ObjectValidator <SubEntity>(new Func <SubEntity>(this.BuildSubEntity));
 }
Example #2
0
 public SubActorLook(sbyte index, SubEntityBindingPointCategoryEnum category, ActorLook look)
 {
     m_bindingIndex    = index;
     m_bindingCategory = category;
     Look        = look;
     m_subEntity = new ObjectValidator <SubEntity>(BuildSubEntity);
 }
        public ActorLook Clone()
        {
            var actorLook = new ActorLook();

            actorLook.BonesID    = this.m_bonesID;
            actorLook.m_colors   = this.m_colors.ToDictionary((System.Collections.Generic.KeyValuePair <int, Color> x) => x.Key, (System.Collections.Generic.KeyValuePair <int, Color> x) => x.Value);
            actorLook.m_skins    = this.m_skins.ToList <short>();
            actorLook.m_scales   = this.m_scales.ToList <short>();
            actorLook.m_subLooks = (
                from x in this.m_subLooks
                select new SubActorLook(x.BindingIndex, x.BindingCategory, x.Look.Clone())).ToList <SubActorLook>();
            return(actorLook);
        }
Example #4
0
 public void SetRiderLook(ActorLook look)
 {
     SetSubLook(new SubActorLook(0, SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_MOUNT_DRIVER,
                                 look));
 }
Example #5
0
        public void SetPetSkin(short skin, short[] scales)
        {
            var petLook = PetLook;

            if (skin == 3119 || skin == 3120)
            {
                SetSubLook(new SubActorLook(0, SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_PET_FOLLOWER, petLook = new ActorLook()));
            }
            else
            {
                SetSubLook(new SubActorLook(0, SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_PET, petLook = new ActorLook()));
                petLook.SetScales(scales);
            }

            petLook.BonesID = skin;
        }
        public static ActorLook Parse(string str)
        {
            if (string.IsNullOrEmpty(str) || str[0] != '{')
            {
                throw new System.Exception("Incorrect EntityLook format : " + str);
            }
            var i   = 1;
            var num = str.IndexOf('|');

            if (num == -1)
            {
                num = str.IndexOf("}");
                if (num == -1)
                {
                    throw new System.Exception("Incorrect EntityLook format : " + str);
                }
            }
            var bones = short.Parse(str.Substring(i, num - i));

            i = num + 1;
            var skins = new short[0];

            if ((num = str.IndexOf('|', i)) != -1 || (num = str.IndexOf('}', i)) != -1)
            {
                skins = ActorLook.ParseCollection <short>(str.Substring(i, num - i), new Func <string, short>(short.Parse));
                i     = num + 1;
            }
            var source = new Tuple <int, int> [0];

            if ((num = str.IndexOf('|', i)) != -1 || (num = str.IndexOf('}', i)) != -1)
            {
                source = ActorLook.ParseCollection <Tuple <int, int> >(str.Substring(i, num - i), new Func <string, Tuple <int, int> >(ActorLook.ParseIndexedColor));
                i      = num + 1;
            }
            var scales = new short[0];

            if ((num = str.IndexOf('|', i)) != -1 || (num = str.IndexOf('}', i)) != -1)
            {
                scales = ActorLook.ParseCollection <short>(str.Substring(i, num - i), new Func <string, short>(short.Parse));
                i      = num + 1;
            }
            var list = new System.Collections.Generic.List <SubActorLook>();

            while (i < str.Length)
            {
                var num2          = str.IndexOf('@', i, 3);
                var num3          = str.IndexOf('=', num2 + 1, 3);
                var category      = byte.Parse(str.Substring(i, num2 - i));
                var b             = byte.Parse(str.Substring(num2 + 1, num3 - (num2 + 1)));
                var num4          = 0;
                var num5          = num3 + 1;
                var stringBuilder = new System.Text.StringBuilder();
                do
                {
                    stringBuilder.Append(str[num5]);
                    if (str[num5] == '{')
                    {
                        num4++;
                    }
                    else
                    {
                        if (str[num5] == '}')
                        {
                            num4--;
                        }
                    }
                    num5++;
                }while (num4 > 0);
                list.Add(new SubActorLook((sbyte)b, (SubEntityBindingPointCategoryEnum)category, ActorLook.Parse(stringBuilder.ToString())));
                i = num5 + 1;
            }
            return(new ActorLook(bones, skins, source.ToDictionary((Tuple <int, int> x) => x.Item1, (Tuple <int, int> x) => Color.FromArgb(x.Item2)), scales, list.ToArray()));
        }
        public void SetAuraSkin(short skin)
        {
            var actorLook = this.AuraLook;

            if (actorLook == null)
            {
                this.AddSubLook(new SubActorLook(0, SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_BASE_FOREGROUND, actorLook = new ActorLook()));
            }
            actorLook.BonesID = skin;
        }
        public void SetPetSkin(short skin)
        {
            var actorLook = this.PetLook;

            this.AddSubLook(new SubActorLook(0, SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_PET, actorLook = new ActorLook()));
            actorLook.SetScales(new short[]
            {
                75
            });
            actorLook.BonesID = skin;
        }