Hello all

Please have a look at the code below. If I want to spawn a random stacked of reags; ie 5 bloodmoss how do i do that? With the current code its just spawn 1 random reags indinvidually.

// ---------- [Level Vendor Mage] ----------
// Metal Chest
[FlipableAttribute(0xe80, 0x9a8)]
public class TreasureLevelVMage : BaseTreasureChestMod
{
[Constructable]
public TreasureLevelVMage() : base(Utility.RandomList(0xe80, 0x9a8))
{
RequiredSkill = 75;
LockLevel = this.RequiredSkill - Utility.Random(1, 10);
MaxLockLevel = this.RequiredSkill;
TrapType = TrapType.MagicTrap;
TrapPower = 2 * Utility.Random(1, 25);

//Base
DropItem(Loot.RandomWand());
DropItem(Loot.RandomPotion());
DropItem(Loot.RandomScroll(1, 32, SpellbookType.Regular));
DropItem(Loot.RandomScroll(1, 32, SpellbookType.Regular));
DropItem(Loot.RandomScroll(1, 32, SpellbookType.Regular));
DropItem(Loot.RandomReagent());
DropItem(Loot.RandomReagent());
DropItem(Loot.RandomReagent());
DropItem(Loot.RandomReagent());
DropItem(Loot.RandomReagent());
DropItem(new Gold(100, 175));
}

private void DropItem(Func<int, int, SpellbookType, SpellScroll> randomScroll)
{
throw new NotImplementedException();
}

public TreasureLevelVMage(Serial serial) : base(serial)
{
}

public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);

writer.Write((int)0); // version
}

public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);

int version = reader.ReadInt();
}
}


Thank you
 
Last edited:
Well you need to set the amount,
like:
Code:
Item drop = Loot.RandomReagent();
drop.Amount = 5;
 
i'm getting the error the name drop does not exist in the current context. Sorry I have no coding experience.
 
Well like I said, it was using the example I posted above, so you would still need the other line
 
Back