public LevelUpPacket(CCharacter instance, bool sendToSelf = true) : base(ClientEventCode.ServerPacket, MessageSubCode.LevelUp, sendToSelf) { var data = new LevelUpData() { NewLevel = (byte)instance.Stats.GetStat <Level>(), NewNextLevelExperience = instance.GetCharData <GeneralStats>().NextLevelExperience, CurrentGold = instance.GetCharData <GeneralStats>().Gold, StatPoints = (byte)instance.Stats.GetStat <StatPoints>() }; AddSerializedParameter(data, ClientParameterCode.Object); }
private void AddUserInfo(CCharacter player) { UserInfo info = new UserInfo() { // Position = player.Position, // Name = player.Name, GenStats = player.GetCharData <GeneralStats>(), // // //Attributes - level, exp, stats Stats = player.Stats.GetAllStats(), // // //inventory - all equiped items // Equipment = player.Items.Equipment.ToDictionary(item => (int)item.Key, item => (ItemData)item.Value), Inventory = player.Items.Inventory.ToDictionary(item => item.Key, item => (ItemData)(Item)item.Value), // // //Talents - skills // // //effects // // //movement speed // //action/emotes }; AddSerializedParameter(info, ClientParameterCode.Object, false); }