public void SendStatus() { NetworkMessage outMessage = new NetworkMessage(); PlayerStatusPacket.Add( outMessage, Player.Health, Player.MaxHealth, Player.Capacity, Player.Experience, Player.Level, 0, // TODO: level system Player.Mana, Player.MaxMana, Player.MagicLevel, 0, 0, 0 ); Send(outMessage); }
public void SendInitialPacket() { NetworkMessage message = new NetworkMessage(); SelfAppearPacket.Add( message, Player.Id, true ); MapDescriptionPacket.Add( this, message, Player.Tile.Location ); EffectPacket.Add(message, Player.Tile.Location, Effect.Teleport); foreach (var kvp in Player.Inventory.GetSlotItems()) { InventorySetSlotPacket.Add( message, kvp.Key, kvp.Value ); } WorldLightPacket.Add( message, LightLevel.World, LightColor.White ); CreatureLightPacket.Add( message, Player.Id, LightLevel.None, LightColor.None ); string welcomeMessage = String.Format( Settings.Default.WelcomeMessage, Settings.Default.WorldName, Player.Name); if (Player.LastLogin > DateTime.MinValue) { welcomeMessage += String.Format(" Last login: {0}.", Player.LastLogin); } TextMessagePacket.Add( message, TextMessageType.EventDefault, welcomeMessage ); PlayerStatusPacket.Add( message, Player.Health, Player.MaxHealth, Player.Capacity, Player.Experience, Player.Level, 0, // TODO: level system Player.Mana, Player.MaxMana, Player.MagicLevel, 0, 0, 0 ); // Player skills //message.AddBytes("A1 0A 02 0A 00 0E 44 0B 62 0A 0D 0F 3E 13 26".ToBytesAsHex()); // Fight modes //message.AddBytes("A0 02 00 01".ToBytesAsHex()); Send(message); }