#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
49
Projects/UOContent/Items/TreasureChests/BaseTreasureBag.cs
Normal file
49
Projects/UOContent/Items/TreasureChests/BaseTreasureBag.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using ModernUO.Serialization;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Items;
|
||||
|
||||
public abstract class BaseTreasureBag : LockableContainer
|
||||
{
|
||||
public BaseTreasureBag() : base(0xE76)
|
||||
{
|
||||
SetBagAppearance();
|
||||
Movable = false;
|
||||
|
||||
// Pick a random hue between 1 and 1000
|
||||
Hue = Utility.Random(1, 1000);
|
||||
}
|
||||
|
||||
public BaseTreasureBag(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Decays => true;
|
||||
public override bool IsDecoContainer => false;
|
||||
|
||||
private readonly TimeSpan _decayTime = TimeSpan.FromMinutes(Utility.Random(15, 60));
|
||||
public override TimeSpan DecayTime => _decayTime;
|
||||
|
||||
private static readonly (int, int)[] _bagAppearances =
|
||||
{
|
||||
(0xE76, 0x3D), // Bag
|
||||
(0xE75, 0x3C), // Backpack
|
||||
(0xE79, 0x41) // Pouch
|
||||
};
|
||||
|
||||
private void SetBagAppearance()
|
||||
{
|
||||
(ItemID, GumpID) = _bagAppearances.RandomElement();
|
||||
}
|
||||
|
||||
public override Rectangle2D Bounds
|
||||
{
|
||||
get
|
||||
{
|
||||
if (GumpID == 0x3D) return new Rectangle2D(29, 34, 108, 94); // Bag
|
||||
if (GumpID == 0x3C) return new Rectangle2D(44, 65, 142, 94); // Backpack
|
||||
return new Rectangle2D(18, 20, 125, 62); // Pouch
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue