Exemplo n.º 1
0
        public void RemodelCosmetic(CharacterRecord record, ushort cosmeticId)
        {
            var skinId = HeadRecord.GetSkin(record.CosmeticId);

            record.Look.RemoveSkin(skinId);
            record.Look.AddSkin(HeadRecord.GetSkin(cosmeticId));
            record.CosmeticId = cosmeticId;
        }
        public void RemodelBreed(CharacterRecord record, sbyte breedId, ushort cosmecticId)
        {
            var currentBreed = BreedRecord.GetBreed(record.BreedId);

            var newBreed = BreedRecord.GetBreed(breedId);

            var level = ExperienceRecord.GetCharacterLevel(record.Exp);

            var shortcuts = record.Shortcuts.OfType <CharacterSpellShortcut>();

            List <ushort> spells = currentBreed.GetSpellsForLevel(200, new List <CharacterSpell>()).ToList();

            spells.AddRange(this.BreedSpecialSpells);


            foreach (var spell in spells)
            {
                record.Spells.RemoveAll(x => x.SpellId == spell);
                var shortcut = shortcuts.FirstOrDefault(x => x.SpellId == spell);
                record.Shortcuts.Remove(shortcut);
            }

            foreach (var spell in newBreed.GetSpellsForLevel(level, new List <CharacterSpell>()))
            {
                record.Spells.Add(new CharacterSpell(spell, 1));
            }

            var look    = record.Sex ? ContextActorLook.Parse(currentBreed.FemaleLook) : ContextActorLook.Parse(currentBreed.MaleLook);
            var newLook = record.Sex ? ContextActorLook.Parse(newBreed.FemaleLook) : ContextActorLook.Parse(newBreed.MaleLook);

            record.SpellPoints += (ushort)(level - 1);

            foreach (var skin in look.Skins)
            {
                record.Look.RemoveSkin(skin);
            }

            foreach (var skin in newLook.Skins)
            {
                record.Look.AddSkin(skin);
            }

            record.Look.SetScale(newLook.Scale);

            ushort headSkin = HeadRecord.GetSkin(record.CosmeticId);

            record.Look.RemoveSkin(headSkin);

            record.Look.AddSkin(HeadRecord.GetSkin(cosmecticId));

            record.BreedId = breedId;
        }
Exemplo n.º 3
0
        public static ContextActorLook GetBreedLook(int breedid, bool sex, int cosmeticid, IEnumerable <int> colors)
        {
            var breed = GetBreed(breedid);
            ContextActorLook result = sex ? ContextActorLook.Parse(breed.FemaleLook) : ContextActorLook.Parse(breed.MaleLook);

            result.AddSkin(HeadRecord.GetSkin(cosmeticid));

            int[] simpleColors = VerifiyColors(colors, sex, breed);

            result.SetColors(ContextActorLook.GetConvertedColors(simpleColors));

            return(result);
        }
Exemplo n.º 4
0
 public static ushort GetSkinFromCosmeticId(int cosmecticId)
 {
     return(HeadRecord.GetSkin(cosmecticId));
 }