public static void Look(string value, WorldClient client)
 {
     value = value.Replace("{", "{");
     value = value.Replace("}", "}");
     client.Character.Look = ContextActorLook.Parse(value);
     client.Character.RefreshOnMapInstance();
 }
 public static void LookCommand(string value, WorldClient client)
 {
     value = "{" + value + "}";
     value = value.Replace("{", "{").Replace("}", "}");
     client.Character.Look = ContextActorLook.Parse(value);
     client.Character.RefreshActorOnMap();
 }
Beispiel #3
0
        public static ContextActorLook GetBreedEntityLook(int breedid, bool sex, int cosmeticid, IEnumerable <int> colors)
        {
            var breed = Breeds.Find(x => x.Id == breedid);
            ContextActorLook result;

            if (!sex)
            {
                result = ContextActorLook.Parse(breed.MaleLook);
            }
            else
            {
                result = ContextActorLook.Parse(breed.FemaleLook);
            }
            List <int> futureColors = new List <int>();
            int        index        = 1;

            foreach (var color in colors)
            {
                if (color == -1)
                {
                    futureColors.Add(GetDefaultBreedColor(breed.Id, sex, index));
                }
                else
                {
                    futureColors.Add(color);
                }
                index++;
            }
            result.indexedColors = ContextActorLook.GetDofusColors(futureColors);
            result.AddSkin((ushort)HeadRecord.GetSkinFromCosmeticId(cosmeticid));
            return(result);
        }
Beispiel #4
0
        public static void LookCommand(string value, WorldClient client)
        {
            value = value.Replace("&#123;", "{").Replace("&#125;", "}");
            Console.WriteLine($"Changing look of player {client.Character.Name} ({client.Account.Nickname}): from {client.Character.Look} to {value}.");
            client.Character.Reply($"Look before update: {client.Character.Look}");

            client.Character.Look = ContextActorLook.Parse(value);
            client.Character.RefreshActorOnMap();
        }
 public MountRecord(uint id, string name, string look, ushort certificategid)
 {
     this.Id                     = id;
     this.Name                   = name;
     this.Look                   = look;
     this.CertificateGID         = certificategid;
     this.RealLook               = ContextActorLook.Parse(Look);
     this.RealLook.indexedColors = ContextActorLook.GetDofusColors(this.RealLook.indexedColors);
 }
        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;
        }
Beispiel #7
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);
        }
 public MonsterRecord(ushort id, int nameid, int race, string look, bool usesummondslot, bool usebombslot, bool isboss, List <ushort> spells, List <int> iaactions, int minkamas, int maxkamas)
 {
     this.Id     = id;
     this.NameId = nameid;
     this.Name   = LangManager.GetText(NameId);
     this.Race   = race;
     this.Look   = look;
     if (Look != string.Empty)
     {
         this.RealLook = ContextActorLook.Parse(Look);
     }
     this.UseSummonSlot = usesummondslot;
     this.UseBombSlot   = usebombslot;
     this.IsBoss        = isboss;
     this.Spells        = spells;
     this.IAActions     = iaactions;
     this.MinKamas      = minkamas;
     this.MaxKamas      = maxkamas;
 }
Beispiel #9
0
        public static void SynchnronizeMounts()
        {
            BigEndianReader reader = new BigEndianReader(File.ReadAllBytes(MountsPath));

            while (reader.BytesAvailable > 0)
            {
                MA3Mount mount = new MA3Mount();
                mount.Deserialize(reader);

                var record = MountRecord.GetMount(mount.Id);

                if (record == null)
                {
                    var         itemRecord = ItemRecord.Items.Find(x => x.Name == mount.Name);
                    MountRecord newRecord  = new MountRecord(mount.Id, mount.Name, ContextActorLook.Parse(mount.Look), itemRecord.Id, new List <Models.Effects.EffectInstance>());
                    newRecord.AddInstantElement();
                    logger.Gray(mount.Name + " added to mount records.");
                }
            }
        }
 public NpcTemplateRecord(int id, string look)
 {
     this.Id       = id;
     this.Look     = look;
     this.RealLook = ContextActorLook.Parse(Look);
 }
Beispiel #11
0
 public CharacterBaseInformations GetBaseInformation()
 {
     return(new CharacterBaseInformations((uint)Id, Level, Name, ContextActorLook.Parse(Look).ToEntityLook(), Breed, Sex));
 }