private Item GetItemDrop(MonsterDefinition monster, DropItemGroup selectedGroup) { if (selectedGroup != null) { if (selectedGroup.PossibleItems?.Count > 0) { var item = new TemporaryItem(); item.Definition = selectedGroup.PossibleItems.SelectRandom(this.randomizer); this.ApplyRandomOptions(item); return(item); } switch (selectedGroup.ItemType) { case SpecialItemType.Ancient: return(this.GetRandomAncient()); case SpecialItemType.Excellent: return(this.GetRandomExcellentItem((int)monster[Stats.Level])); case SpecialItemType.RandomItem: return(this.GetRandomItem((int)monster[Stats.Level], false)); case SpecialItemType.SocketItem: return(this.GetRandomItem((int)monster[Stats.Level], true)); default: // none return(null); } } return(null); }
private void CreateEventItem(byte number, byte group, byte width, byte height, string name, params byte[] dropLevels) { var item = this.Context.CreateNew <ItemDefinition>(); this.GameConfiguration.Items.Add(item); item.Group = group; item.Number = number; item.Name = name; item.Width = width; item.Height = height; item.Durability = 1; byte itemLevel = 1; DropItemGroup previousGroup = null; foreach (var dropLevel in dropLevels) { if (previousGroup is { })
/// <summary> /// Registers the default drop item group. /// </summary> /// <param name="dropItemGroup">The drop item group.</param> internal static void RegisterDefaultDropItemGroup(DropItemGroup dropItemGroup) { DefaultDropItemGroups.Add(dropItemGroup); }
/// <inheritdoc /> public Item?GenerateItemDrop(DropItemGroup group) { return(null); }