servuo/Scripts/Items/Tools/Dices.cs
TrueUO 80e0d42d33
Bug Fixes (#4782)
- Whirlwind Attack now does the correct amount of damage.
- Added in new Aqaurium system, with new catchable fish. https://uo.com/wiki/ultima-online-wiki/gameplay/aquariums/
- Fixed an issue where players could get a weird client crash, and be unable to log back in right away, when fighting Beacons.
- Fixed an exploit with RunicReforging. Recommend updating to newest Reforging code.
- Fixed an issue where item stats from equipment sets were not adding their values correctly on Mannequins.
- Fixed an issue where you sometimes had to exit and re-enter a house to get all the items the load correctly.
- Players can now correctly craft Charybdis bait.
- All scale types can now correctly be turned in to community collection Mobiles.cs
- Thieve Consumables from the Monster Stealing system now all work correctly.
- Some more file structure cleanup.

Co-authored-by: TrueUO <knight.daniel.r@gmail.com>
2020-05-16 15:31:52 -07:00

77 lines
No EOL
2.3 KiB
C#

using Server.ContextMenus;
using Server.Gumps;
using Server.Multis;
using Server.Network;
using System.Collections.Generic;
namespace Server.Items
{
public class Dices : Item, ITelekinesisable, ISecurable
{
[CommandProperty(AccessLevel.GameMaster)]
public SecureLevel Level { get; set; }
[Constructable]
public Dices()
: base(0xFA7)
{
Weight = 1.0;
Level = SecureLevel.Friends;
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
SetSecureLevelEntry.AddTo(from, this, list);
}
public Dices(Serial serial)
: base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (!from.InRange(GetWorldLocation(), 2))
return;
Roll(from);
}
public void OnTelekinesis(Mobile from)
{
Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5022);
Effects.PlaySound(Location, Map, 0x1F5);
Roll(from);
}
public void Roll(Mobile from)
{
int one = Utility.Random(1, 6);
int two = Utility.Random(1, 6);
SendLocalizedMessage(MessageType.Emote, 1042713, AffixType.Prepend, from.Name + " ", ""); // The first die rolls to a stop and shows:
SendLocalizedMessage(MessageType.Regular, 1042714, AffixType.Append, " " + one.ToString(), ""); // The first die rolls to a stop and shows:
SendLocalizedMessage(MessageType.Regular, 1042715, AffixType.Append, " " + two.ToString(), ""); // The second die stops and shows:
SendLocalizedMessage(MessageType.Regular, 1042716, AffixType.Append, " " + (one + two).ToString(), ""); // Total for this roll:
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(1);
writer.Write((int)Level);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
Level = (SecureLevel)reader.ReadInt();
}
}
}