Beispiel #1
0
        void AddItemSkin(CharacterItemRecord record, ItemRecord template)
        {
            if (template.AppearanceId != 0)
            {
                switch (template.Type)
                {
                case ItemTypeEnum.PET:
                    Character.Look.subentities.Add(new SubEntity((sbyte)SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_PET,
                                                                 0, ContextActorLook.SimpleBonesLook((ushort)template.AppearanceId, PET_SIZE).ToEntityLook()));
                    return;

                case ItemTypeEnum.PETSMOUNT:
                    Character.Look = Character.Look.CharacterToRider((ushort)template.AppearanceId, new List <ushort>(), Character.Look.indexedColors.Take(3).ToList(), 100);
                    return;

                default:
                    if (record.ContainEffect(EffectsEnum.Eff_Mimicry))
                    {
                        var mimicryEffect = record.GetFirstEffect <ObjectEffectInteger>(EffectsEnum.Eff_Mimicry);
                        var mimicryAppId  = (ushort)ItemRecord.GetItem(mimicryEffect.value).AppearanceId;
                        Character.Look.AddSkin(mimicryAppId);
                    }
                    else
                    {
                        Character.Look.AddSkin((ushort)template.AppearanceId);
                    }
                    break;
                }
            }
        }
Beispiel #2
0
        void RemoveItemSkin(CharacterItemRecord record, ItemRecord template)
        {
            if (template.AppearanceId != 0)
            {
                switch (template.Type)
                {
                case ItemTypeEnum.PET:
                    Character.Look.subentities.RemoveAll(x => x.bindingPointCategory == (sbyte)SubEntityBindingPointCategoryEnum.HOOK_POINT_CATEGORY_PET);
                    return;

                case ItemTypeEnum.PETSMOUNT:
                    Character.Look = Character.Look.RiderToCharacter();
                    break;

                default:
                    if (record.ContainEffect(EffectsEnum.Eff_Mimicry))
                    {
                        ObjectEffectInteger mimicryEffect = record.GetFirstEffect <ObjectEffectInteger>(EffectsEnum.Eff_Mimicry);
                        ushort mimicryAppId = (ushort)ItemRecord.GetItem(mimicryEffect.value).AppearanceId;

                        Character.Look.RemoveSkin(mimicryAppId);
                    }
                    else
                    {
                        Character.Look.RemoveSkin((ushort)template.AppearanceId);
                    }
                    break;
                }
            }
        }