#W# Feature: Added a Dungeon of the Day! [dotd command. Increased gold/skill gain/ and rare drops.

This commit is contained in:
WarrentyExpired 2026-10-07 10:52:08 -04:00
parent b6fa2cea69
commit cb5906025a
4 changed files with 120 additions and 1 deletions

View file

@ -2109,7 +2109,7 @@
{
"$type": "NewbieDungeonRegion",
"Map": "Underworld",
"Name": "New Player Dungeon",
"Name": "the New Player Dungeon",
"Priority": 60,
"Area": [
{ "x1": 2561, "y1": 546, "x2": 2831, "y2": 795 }

View file

@ -0,0 +1,96 @@
using System;
using Server;
using Server.Commands;
namespace Server.Custom
{
public static class DailyDungeonManager
{
public static string ActiveDungeon { get; private set; }
private static readonly string[] DungeonRoster =
{
"the Dungeon Deceit", "the Dungeon Despise", "the Dungeon Destard",
"the Dungeon Covetous", "the Dungeon Shame", "the Dungeon Hythloth"
};
public static void Initialize()
{
CommandSystem.Register("dotd", AccessLevel.Player, DotD_OnCommand);
CommandSystem.Register("ForceDungeonSwap", AccessLevel.GameMaster, ForceSwap_OnCommand);
RotateDungeon();
Timer.DelayCall(TimeSpan.FromHours(24), TimeSpan.FromHours(24), RotateDungeon);
}
public static bool IsActive(Region region)
{
if (region == null || string.IsNullOrEmpty(ActiveDungeon))
{
return false;
}
Region current = region;
while (current != null)
{
if (current.Name == ActiveDungeon)
{
return true;
}
current = current.Parent;
}
if (region.Name != null && region.Name.StartsWith(ActiveDungeon))
{
return true;
}
return false;
}
public static void RotateDungeon()
{
string oldDungeon = ActiveDungeon;
string newDungeon;
do
{
newDungeon = DungeonRoster[Utility.Random(DungeonRoster.Length)];
}
while (newDungeon == oldDungeon && DungeonRoster.Length > 1);
ActiveDungeon = newDungeon;
World.Broadcast(1161, true, $"The magical energies of the world have shifted. {ActiveDungeon} is now the Dungeon of the Day!");
}
[Usage("ForceDungeonSwap")]
[Description("Forces the Dungeon of the Day to rotate immediately.")]
private static void ForceSwap_OnCommand(CommandEventArgs e)
{
RotateDungeon();
e.Mobile.SendMessage("You have forced the daily dungeon to rotate.");
}
[Usage("dotd")]
[Description("Displays the current Dungeon of the Day and its active bonuses.")]
private static void DotD_OnCommand(CommandEventArgs e)
{
Mobile m = e.Mobile;
if (string.IsNullOrEmpty(ActiveDungeon))
{
m.SendMessage(38, "The magical energies are still shifting. There is no active dungeon today.");
return;
}
string displayName = ActiveDungeon;
if (displayName.StartsWith("the Dungeon "))
{
displayName = displayName.Substring(12);
}
m.SendMessage(1161, $"*** Dungeon of the Day: {displayName} ***");
m.SendMessage(259, "Active Bonuses: Increased Skill gains, extra gold drops, and a chance for rare items!");
}
}
}

View file

@ -26,6 +26,7 @@ using Server.Spells.Necromancy;
using Server.Spells.Sixth;
using Server.Spells.Spellweaving;
using Server.Targeting;
using Server.Custom;
namespace Server.Mobiles
{
@ -3652,6 +3653,23 @@ namespace Server.Mobiles
killer = pet.ControlMaster;
}
Region deathRegion = Region.Find(c.Location, c.Map);
if (DailyDungeonManager.IsActive(deathRegion))
{
c.DropItem(new Server.Items.Gold(Utility.RandomMinMax(100, 300)));
if (Utility.RandomDouble() <= 0.05)
{
c.DropItem(new Server.Items.SpecialHairDye());
}
if (killer != null)
{
killer.SendMessage(38, "You have killed a daily mob and earned bonus loot!");
}
}
if (killer is PlayerMobile pm)
{
int goldFound = c.GetAmount(typeof(Gold));

View file

@ -3,6 +3,7 @@ using System.Runtime.CompilerServices;
using Server.Factions;
using Server.Mobiles;
using Server.Regions;
using Server.Custom;
namespace Server.Misc;
@ -147,6 +148,10 @@ public static class SkillCheck
{
gc *= 3.0;
}
else if (DailyDungeonManager.IsActive(from.Region))
{
gc *= 2.0;
}
if (gc >= Utility.RandomDouble())
{