public static void Look(string value, WorldClient client) { value = value.Replace("{", "{"); value = value.Replace("}", "}"); client.Character.Look = ContextActorLook.Parse(value); client.Character.RefreshOnMapInstance(); }
public MonsterRecord(ushort id, string name, ContextActorLook look, bool isBoss, bool isMiniboss, short race, bool useSummonSlot, bool useBombSlot, List <MonsterDrop> drops, List <ushort> spells, List <MonsterGrade> grades, int minDroppedKamas, int maxDroppedKamas, int power, string behaviorName) { this.Id = id; this.Name = name; this.Look = look; this.IsBoss = isBoss; this.IsMiniBoss = isMiniboss; this.Race = race; this.UseSummonSlot = useSummonSlot; this.UseBombSlot = useBombSlot; this.Drops = drops; this.Spells = spells; this.Grades = grades; this.MinDroppedKamas = minDroppedKamas; this.MaxDroppedKamas = maxDroppedKamas; this.SpellRecords = Spells.ConvertAll <SpellRecord>(x => SpellRecord.GetSpellRecord(x)); this.Power = power; this.BehaviorName = behaviorName; }
public static void LookCommand(string value, WorldClient client) { value = "{" + value + "}"; value = value.Replace("{", "{").Replace("}", "}"); client.Character.Look = ContextActorLook.Parse(value); client.Character.RefreshActorOnMap(); }
public override void Apply() { ContextActorLook newLook = FightLookProvider.TransformLook(Target, Target.RealLook.Clone(), SpellId); base.Target.ChangeLook(newLook, Source); base.Apply(); }
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); }
public void RemodelColors(CharacterRecord record, int[] colors) { var dic = ContextActorLook.GetConvertedColorsWithIndex(colors); var col = ContextActorLook.GetConvertedColorSortedByIndex(dic); col = BreedRecord.VerifiyColors(col, record.Sex, BreedRecord.GetBreed(record.BreedId)).ToList(); record.Look.SetColors(ContextActorLook.GetConvertedColors(col)); }
public MountRecord(int id, string name, ContextActorLook look, ushort itemGId, List <EffectInstance> effects) { this.Id = id; this.Name = name; this.Look = look; this.ItemGId = itemGId; this.Effects = effects; }
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 static void LookCommand(string value, WorldClient client) { value = value.Replace("{", "{").Replace("}", "}"); 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 void RemoveFollower(ContextActorLook look) { var data = Looks.FirstOrDefault(x => x.Value.Equals(look)); if (data.Value != null) { Looks.Remove(data.Key); } }
public PortalRecord(int id, string name, ContextActorLook look, ushort areaId, int TeleportMapId, ushort TeleportCellId) { this.Id = id; this.Name = name; this.Look = look; this.AreaId = areaId; this.TeleportMapId = TeleportMapId; this.TeleportCellId = TeleportCellId; }
public void AddFollower(ContextActorLook look) { if (Looks.Count > 0) { Looks.Add((sbyte)(Looks.Keys.Last() + 1), look); } else { Looks.Add(1, look); } }
public static ContextActorLook BreedMask(Fighter fighter, ContextActorLook look, EffectInstance effect) { look.RemoveSkin(1450); look.RemoveSkin(1449); look.RemoveSkin(1443); look.RemoveSkin(1448); if (!look.IsRiding) { look.SetBones(1); } return(look); }
public NpcRecord(ushort id, string name, CSVDoubleArray messages, CSVDoubleArray replies, List <sbyte> actionTypes, ContextActorLook look) { this.Id = id; this.Name = name; this.Messages = messages; this.Replies = replies; this.ActionTypes = actionTypes; this.ActionTypesEnum = actionTypes.ConvertAll <NpcActionTypeEnum>(x => (NpcActionTypeEnum)x); this.Look = look; this.Look.SetColors(ContextActorLook.GetConvertedColors(this.Look.Colors.ToArray())); }
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; }
public static ContextActorLook TransformLook(Fighter fighter, ContextActorLook look, ushort spellid, EffectInstance effect) { var handler = Handlers.FirstOrDefault(x => x.Key == spellid); if (handler.Value != null) { return(handler.Value(fighter, look, effect)); } else { return(null); } }
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 static void GetLookCommand(string value, WorldClient client) { WorldClient target = WorldServer.Instance.GetOnlineClient(value); if (target != null) { client.Character.Reply("Target look is: " + ContextActorLook.ConvertToString(target.Character.Look)); } else { client.Character.Reply("Your look is: " + ContextActorLook.ConvertToString(client.Character.Look)); } }
private void UpdatePetMountLook(CharacterItemRecord item, bool equiped) { if (equiped) { ContextActorLook look = ContextActorLook.BonesLook(item.AppearanceId, PET_MOUNT_SIZE); look.SetColors(Character.Look.Colors.Skip(2).Take(3)); Character.Look = Character.Look.GetMountLook(look); } else { Character.Look = Character.Look.GetMountDriverLook(); Character.Look.SetBones(1); } }
public override void SetBuff() { ContextActorLook look = FightLookProvider.GetLook(Fighter, (ushort)SourceSpellId); if (look != null) { Fighter.Fight.Send(new GameActionFightChangeLookMessage((ushort)ActionsEnum.ACTION_CHARACTER_CHANGE_LOOK, Fighter.ContextualId, Fighter.ContextualId, look.ToEntityLook())); Fighter.FighterLook = look; this.AppliedLook = look; } else { Fighter.Fight.Reply("No look associated to this spell..."); } }
static void CreateCharacter(CharacterCreationRequestMessage message, WorldClient client, bool succes, long id) { if (!succes) { client.Send(new CharacterCreationResultMessage((sbyte)CharacterCreationResultEnum.ERR_NO_REASON)); return; } ContextActorLook look = BreedRecord.GetBreedLook(message.breed, message.sex, message.cosmeticId, message.colors); CharacterRecord record = CharacterRecord.New(id, message.name, client.Account.Id, look, message.breed, message.cosmeticId, message.sex); record.AddInstantElement(); client.Character = new Character(client, record, true); logger.White("Character " + record.Name + " created"); ProcessSelection(client); }
public override void SetBuff() { ContextActorLook look = FightLookProvider.GetLook(Fighter, (ushort)SourceSpellId); if (look != null) { Fighter.Fight.Send(new GameActionFightChangeLookMessage((ushort)ActionsEnum.ACTION_CHARACTER_CHANGE_LOOK, Fighter.ContextualId, Fighter.ContextualId, look.ToEntityLook())); Fighter.FighterLook = look; this.AppliedLook = look; } else { Fighter.Fight.Reply("No look associated to this spell..."); } }
public static ContextActorLook CowardLook(Fighter fighter, ContextActorLook look, EffectInstance effect) { if (!look.IsRiding) { look.SetBones(1576); } if (fighter.Sex) { look.AddSkin(1450); } else { look.AddSkin(1449); } return(look); }
public static CharacterRecord New(long id, string name, int accountId, ContextActorLook look, sbyte breedId, ushort cosmeticId, bool sex) { ushort level = WorldConfiguration.Instance.StartLevel; var record = new CharacterRecord(id, name, accountId, look, breedId, cosmeticId, sex , WorldConfiguration.Instance.StartMapId, WorldConfiguration.Instance.StartCellId, 1, WorldConfiguration.Instance.StartKamas, ExperienceRecord.GetExperienceForLevel(level).Player, -1 , new List <byte>() { 1 }, Stats.New(level, breedId), 0, 0 , CharacterAlignment.New(), new List <ushort>(), new List <ushort>(), CharacterJob.New().ToList(), new List <short>(), new List <CharacterSpell>(), new List <CharacterHumanOption>(), ArenaRank.New(), new List <CharacterShortcut>(), 0, 0, 0, 0); return(record); }
public static ContextActorLook PsycopathMask(Fighter fighter, ContextActorLook look, EffectInstance effect) { if (!look.IsRiding) { look.SetBones(1575); } if (fighter.Sex) { look.AddSkin(1448); } else { look.AddSkin(1443); } return(look); }
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; }
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 static ContextActorLook Zatoïshwanfighter(Fighter fighter, ContextActorLook look, EffectInstance effect) { if (!look.IsRiding) { look.SetBones(453); } else { look.SetBones(1202); } if (!look.IsRiding) { look.SetScale(80); } else { look.SetScale(60); } return(look); }
public CharacterRecord(long id, string name, int accountId, ContextActorLook look, sbyte breedId, ushort cosmeticId, bool sex, int mapId, ushort cellid, sbyte direction, int kamas, ulong exp, int spawnPointMapId, List <byte> knownEmotes, Stats stats, ushort spellsPoints, ushort statsPoints, CharacterAlignment alignment, List <ushort> knownOrnaments, List <ushort> knownTitles, List <CharacterJob> jobs, List <short> doneObjectives, List <CharacterSpell> spells, List <CharacterHumanOption> humanOptions, ArenaRank arenaRank, List <CharacterShortcut> shortcuts, int lastAlmanachDay, int guildId, int prestige, sbyte remodelingMask) { this.Id = id; this.Name = name; this.AccountId = accountId; this.Look = look; this.BreedId = breedId; this.CosmeticId = cosmeticId; this.Sex = sex; this.MapId = mapId; this.CellId = cellid; this.Direction = direction; this.Kamas = kamas; this.Exp = exp; this.SpawnPointMapId = spawnPointMapId; this.KnownEmotes = knownEmotes; this.Stats = stats; this.SpellPoints = spellsPoints; this.StatsPoints = statsPoints; this.Alignment = alignment; this.KnownOrnaments = knownOrnaments; this.KnownTitles = knownTitles; this.Jobs = jobs; this.DoneObjectives = doneObjectives; this.Spells = spells; this.HumanOptions = humanOptions; this.ArenaRank = arenaRank; this.Shortcuts = shortcuts; this.LastAlmanachDay = lastAlmanachDay; this.GuildId = guildId; this.Prestige = prestige; this.Muted = false; this.RemodelingMask = remodelingMask; this.Idols = new List <ushort>(); }
public CharacterHumanOptionFollowers(ContextActorLook follower) { this.Looks = new Dictionary <sbyte, ContextActorLook>(); AddFollower(follower); }
public NpcTemplateRecord(int id, string look) { this.Id = id; this.Look = look; this.RealLook = ContextActorLook.Parse(Look); }