//************************************************************************ // Custom Treasure Function for generating treasure of varying types in placeable, store or creature // B W-Husey, 30th May 2003 // See cu_magic for the remaining categories (split into two for compile ease) // Treasure Types included here are: /* Gold10 - Up to 10 gold, bonus adds to quantity Gold100 - 10d10 Gold, bonus adds to quantity Misc - Various kits, torches, arrows, etc (Containers and Stores) Weapon - standard weapon (no club) (Any, creature arms) Armour - Armour, send a bonus for better stuff (Any, creature armour?) Gem - Any gem except ruby, diamond, sapphire, emerald (Containers and Creatures) Minor - 1-3 gold, Various gems & non valuable rings, etc. (Containers, stores and some creatures: Bodyguards, etc) OneHand - One handed weapons (more common ones except dagger and club) Ranged - Ranged weapon with 20 amunition AnyHand - Any hand to hand weapon as with OneHand, but includes 2 handed weapons. Inputs: sTreasureSet - The name of the group of treasure as above oCreateIn - The object to contain the treasure nChance - Chance of getting any of this type nBonus - For Armour (to add in heavier types) by default heavy armours are excluded; Add 4 to add in all heavy and remove light, negative nBonus increases Leather (not padded) chance. Max 4 For gold10 & Gold100 (adds to amount) nEquip - 1 = equip the item (use for AnyHand, OneHand) The following are found in cu_magic and GetMagic(): Potions - Potions! (up to 3) (Any) Scrolls1 - Level 0 & 1 scrolls (Bookcases, stores & Wizards) Scrolls12 - Level 1 & 2 scrolls (Bookcases, stores & Wizards) Scrolls34 - level 3 & 4 scrolls (Bookcases, stores & Wizards) Weapon1 - +1 weapons (Containers and stores) Weapon2 - +2 weapons (Containers and stores) Armour1 - +1 Armour (Containers and stores) Armour2 - +2 Armour (Containers and stores) Magic - Magic Items of increasing quality, send a bonus to function for better stuff. Major - Various gems (including major), jewelry, chance of minor magic (Containers, stores and some creatures: Bosses) */ void GetTreasure(string sTreasureSet, object oCreateIn=OBJECT_SELF, int nChance=100, int nBonus=0, int nEquip=0) { if (Random(100)