#W# Added: Treasure bags are like treasure chests but theres a chance they may not be locked or trapped for less loot.
This commit is contained in:
parent
e15fde2e97
commit
128bececce
8 changed files with 608 additions and 3 deletions
76
Projects/UOContent/Items/TreasureChests/TreasureBagLevel1.cs
Normal file
76
Projects/UOContent/Items/TreasureChests/TreasureBagLevel1.cs
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
using System;
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items;
|
||||
// ==============================================================
|
||||
// LEVEL 1: 50% Trapped / 50% Locked
|
||||
// ==============================================================
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class TreasureBagLevel1 : BaseTreasureBag
|
||||
{
|
||||
[Constructible]
|
||||
public TreasureBagLevel1()
|
||||
{
|
||||
var isTrapped = false;
|
||||
|
||||
Locked = Utility.RandomDouble() < 0.50; // 50% Locked
|
||||
RequiredSkill = 57;
|
||||
LockLevel = RequiredSkill - Utility.Random(1, 10);
|
||||
MaxLockLevel = RequiredSkill + Utility.Random(1, 10);
|
||||
|
||||
if (Utility.RandomDouble() < 0.50) // 50% Trapped
|
||||
{
|
||||
TrapType = TrapType.DartTrap;
|
||||
TrapPower = Utility.Random(1, 25);
|
||||
isTrapped = true;
|
||||
}
|
||||
|
||||
if (isTrapped && Locked)
|
||||
{
|
||||
DropItem(new Gold(Utility.Random(30, 100)));
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
var gems = Loot.RandomGem();
|
||||
gems.Amount = Utility.Random(1, 3);
|
||||
DropItem(gems);
|
||||
}
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomWeapon());
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomArmorOrShield());
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomClothing());
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomJewelry());
|
||||
}
|
||||
else if (isTrapped && !Locked)
|
||||
{
|
||||
DropItem(new Gold(Utility.Random(30, 80)));
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
var gems = Loot.RandomGem();
|
||||
gems.Amount = Utility.Random(1, 3);
|
||||
DropItem(gems);
|
||||
}
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomWeapon());
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomClothing());
|
||||
}
|
||||
else if (!isTrapped && Locked)
|
||||
{
|
||||
DropItem(new Gold(Utility.Random(30, 80)));
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
var gems = Loot.RandomGem();
|
||||
gems.Amount = Utility.Random(1, 3);
|
||||
DropItem(gems);
|
||||
}
|
||||
if (Utility.RandomBool()) DropItem(Loot.RandomArmor());
|
||||
}
|
||||
else
|
||||
{
|
||||
DropItem(new Gold(Utility.Random(30, 50)));
|
||||
if (Utility.RandomBool())
|
||||
{
|
||||
var gems = Loot.RandomGem();
|
||||
gems.Amount = 1;
|
||||
DropItem(gems);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue