/// <summary> /// Adds the specified message. /// </summary> /// <param name="message">The message.</param> /// <param name="currentOutfit">The current outfit.</param> /// <param name="currentMount">The current mount.</param> /// <param name="outfits">The outfits.</param> /// <param name="mounts">The mounts.</param> public static void Add(NetworkMessage message, IOutfit currentOutfit, IMount currentMount, ICollection <IOutfit> outfits, ICollection <IMount> mounts) { message.AddPacketType(GamePacketType.AppearanceWindow); message.AddAppearance(currentOutfit, currentMount); AddOutfits(message, outfits); AddMounts(message, mounts); }
/// <summary> /// Adds the creature. /// </summary> /// <param name="message">The message.</param> /// <param name="characterSpawn">The character spawn.</param> /// <param name="creatureSpawn">The creature spawn.</param> /// <param name="known">if set to <c>true</c> [known].</param> /// <param name="removeKnown">The remove known.</param> public static void AddCreature(NetworkMessage message, ICharacterSpawn characterSpawn, ICreatureSpawn creatureSpawn, bool known, uint removeKnown) { // TODO: This method MUST be called "Add" for consistency if (known) { // TODO: MAGIC NUMBER DETECTED! message.AddUInt16(0x62); // known message.AddUInt32(creatureSpawn.Id); } else { // TODO: MAGIC NUMBER DETECTED! message.AddUInt16(0x61); // unknown message.AddUInt32(removeKnown); message.AddUInt32(creatureSpawn.Id); message.AddCreatureType(creatureSpawn.Creature.CreatureType); message.AddString(creatureSpawn.Creature.Name); } message.AddPercent(creatureSpawn.Health.ToPercent()); message.AddDirection(creatureSpawn.Direction); message.AddAppearance(creatureSpawn.Outfit, creatureSpawn.Mount); message.AddByte(creatureSpawn.LightInfo.Level); message.AddByte(creatureSpawn.LightInfo.Color); message.AddUInt16(creatureSpawn.Speed.WalkSpeed); message.AddSkullType(creatureSpawn.Skull.Type); message.AddPartyShield(characterSpawn.GetPartyShield(creatureSpawn as CharacterSpawn)); if (!known) { message.AddWarIcon(creatureSpawn.WarIcon); } CreatureType creatureType = creatureSpawn.Creature.CreatureType; if (creatureType == CreatureType.Monster && creatureSpawn is ISummon summon) { creatureType = summon.Master == characterSpawn ? CreatureType.SummonOwn : CreatureType.SummonOthers; } message.AddCreatureType(creatureType); message.AddSpeechBubble(creatureSpawn.Creature.SpeechBubble); // TODO: Implement marked/unmarked?? message.AddByte(0xFF); // TODO: Implement helpers //if (otherPlayer) //{ // msg.add<uint16_t>(otherPlayer->getHelpers()); //} //else //{ // TODO: MAGIC NUMBER DETECTED! message.AddUInt16(0x00); //} message.AddBoolean(creatureSpawn is ISolidBlock); }
/// <summary> /// Adds the specified message. /// </summary> /// <param name="message">The message.</param> /// <param name="creatureSpawnId">The creature spawn identifier.</param> /// <param name="outfit">The outfit.</param> /// <param name="mount">The mount.</param> public static void Add(NetworkMessage message, uint creatureSpawnId, IOutfit outfit, IMount mount) { message.AddPacketType(GamePacketType.CreatureChangeAppearance); message.AddUInt32(creatureSpawnId); message.AddAppearance(outfit, mount); }