From 23e3ede4018279ea5bc0b2427b1cfba66fe28922 Mon Sep 17 00:00:00 2001 From: WarrentyExpired Date: Thu, 13 Aug 2026 19:48:45 -0400 Subject: [PATCH] #W# Dungeon Passage Relics add/to loot. Teleports you to a random classic dungeon. --- Scripts/Items/DungeonPassageRelic.cs | 139 +++++++++++++++++++++++++++ Scripts/Mobiles/BaseCreature.cs | 8 ++ 2 files changed, 147 insertions(+) create mode 100644 Scripts/Items/DungeonPassageRelic.cs diff --git a/Scripts/Items/DungeonPassageRelic.cs b/Scripts/Items/DungeonPassageRelic.cs new file mode 100644 index 0000000..0af3953 --- /dev/null +++ b/Scripts/Items/DungeonPassageRelic.cs @@ -0,0 +1,139 @@ +using System; +using Server; +using Server.Items; +using Server.Mobiles; +using Server.Network; +using Server.Gumps; + +namespace Server.Items +{ + public class DungeonPassageRelic : Item + { + [Constructable] + public DungeonPassageRelic() : base( 0x1F14 ) + { + Name = "a relic of the classic depths"; + Hue = 1150; // White glowing hue + Weight = 1.0; + } + + public DungeonPassageRelic( Serial serial ) : base( serial ) + { + } + + public override void OnDoubleClick( Mobile from ) + { + if ( !IsChildOf( from.Backpack ) ) + { + from.SendLocalizedMessage( 1042001 ); + return; + } + + from.CloseGump( typeof( DungeonPassageGump ) ); + from.SendGump( new DungeonPassageGump( from, this ) ); + } + + public override void Serialize( GenericWriter writer ) + { + base.Serialize( writer ); + writer.Write( (int) 0 ); + } + + public override void Deserialize( GenericReader reader ) + { + base.Deserialize( reader ); + int version = reader.ReadInt(); + } + } +} + +namespace Server.Gumps +{ + public class DungeonPassageGump : Gump + { + private Item m_Relic; + + public DungeonPassageGump( Mobile from, Item relic ) : base( 100, 100 ) + { + m_Relic = relic; + + Closable = false; + Disposable = true; + Dragable = true; + Resizable = false; + + AddPage(0); + + AddBackground(0, 0, 320, 150, 3600); + AddHtml(0, 15, 320, 20, "
Dungeon Passage
", false, false); + AddImageTiled(25, 40, 270, 2, 96); // Divider line + + AddHtml(25, 55, 270, 40, "Are you sure you wish to shatter this relic and be transported to a random classic dungeon?", false, false); + + // Yes Button + AddButton(40, 105, 4005, 4007, 1, GumpButtonType.Reply, 0); + AddLabel(80, 106, 1152, "Yes!"); + + // No/Cancel Button + AddButton(190, 105, 4017, 4019, 0, GumpButtonType.Reply, 0); + AddLabel(230, 106, 38, "Not Now."); + } + + public override void OnResponse( NetState sender, RelayInfo info ) + { + Mobile m = sender.Mobile; + + if ( info.ButtonID == 1 ) + { + if ( m_Relic == null || m_Relic.Deleted || !m_Relic.IsChildOf( m.Backpack ) ) + { + m.SendMessage( 38, "The relic must be in your backpack to use." ); + return; + } + + Point3D destination = Point3D.Zero; + Map targetMap = Map.Felucca; + string dungeonName = ""; + + switch ( Utility.Random( 6 ) ) + { + case 0: // Shame + destination = new Point3D( 3515, 174, -2 ); + dungeonName = "Shame"; + break; + case 1: // Deceit + destination = new Point3D( 3827, 165, 0 ); + dungeonName = "Deceit"; + break; + case 2: // Covetous + destination = new Point3D( 4096, 127, 0 ); + dungeonName = "Covetous"; + break; + case 3: // Hythloth + destination = new Point3D( 4297, 64, 59 ); + dungeonName = "Hythloth"; + break; + case 4: // Despise + destination = new Point3D( 4748, 183, 30 ); + dungeonName = "Despise"; + break; + case 5: // Destard + destination = new Point3D( 5155, 286, 0 ); + dungeonName = "Destard"; + break; + } + + Effects.PlaySound( m.Location, m.Map, 0x1FE ); + m.MoveToWorld( destination, targetMap ); + Effects.PlaySound( m.Location, m.Map, 0x1FE ); + + m.SendMessage( 63, "The relic shatters into dust and you find yourself in the depths of {0}!", dungeonName ); + m_Relic.Delete(); + } + else + { + m.SendMessage( "You put the relic away for now." ); + } + } + } +} diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs index 6ccc50d..03efc1d 100644 --- a/Scripts/Mobiles/BaseCreature.cs +++ b/Scripts/Mobiles/BaseCreature.cs @@ -4063,6 +4063,14 @@ namespace Server.Mobiles AddLoot( LootPack.UltraRich ); } + if ( Fame >= 5000 ) + { + if ( Utility.RandomDouble() < 0.10 ) + { + PackItem( new Server.Items.DungeonPassageRelic() ); + } + } + m_Spawning = false; m_KillersLuck = 0; }