#W# Add a new kind of towncrier the HintCrier.

This commit is contained in:
WarrentyExpired 2026-07-15 18:36:11 -04:00
parent 7fea9764af
commit 717dbd4e1a
4 changed files with 267 additions and 0 deletions

View file

@ -0,0 +1,32 @@
using System;
using Server;
using Server.Commands;
using Server.Mobiles; // Needed to access HintCrier
namespace Server.Scripts.Commands
{
public class BroadcastCrierCommand
{
public static void Initialize()
{
// Registers the command so only GameMasters or higher can use it
CommandSystem.Register( "BroadcastCrier", AccessLevel.GameMaster, new CommandEventHandler( BroadcastCrier_OnCommand ) );
}
[Usage( "BroadcastCrier <message>" )]
[Description( "Forces all HintCriers to shout a custom message to test the AnnounceEvent method." )]
public static void BroadcastCrier_OnCommand( CommandEventArgs e )
{
// Make sure the GM actually typed a message
if ( string.IsNullOrWhiteSpace( e.ArgString ) )
{
e.Mobile.SendMessage( "Usage: [BroadcastCrier <message>" );
return;
}
// Pass whatever the GM typed directly into our static AnnounceEvent method
HintCrier.AnnounceEvent( e.ArgString );
e.Mobile.SendMessage( "Event announced to all Hint Criers." );
}
}
}