public Item CreateItem(int level, ItemType itemType) { level = this.LevelVaration(level, 3); Rarity itemRarity = CreateItemRarity(); Int64 power = (Int64)(this.GetPowerScale(itemRarity) * level); Item item = new Item() { Level = level, Name = this.nameHelper.NameFor(itemType), Description = "none", Rarity = itemRarity, Power = (Int64)(this.GetPowerScale(itemRarity) * level), Value = power * 2, ImageId = this.nameHelper.RandomItemImageIDFor(itemType), ItemType = itemType }; //If equipment if ((int)itemType > 3 && (int)itemType < 10) { item.Stats = SystemHelper.Serialize(this.CreateStats(item)); } else { item.Stats = new byte[0]; } return(item); }
public void RecalculateCharacterStats(Character character) { CharacterStats cs = new CharacterStats(character.Skills, this.EquippedItems(character)); character.CharacterStats = SystemHelper.Serialize(cs); }