#W# Add a new kind of towncrier the HintCrier.
This commit is contained in:
parent
7fea9764af
commit
717dbd4e1a
4 changed files with 267 additions and 0 deletions
32
Scripts/Commands/BroadcastCrier.cs
Normal file
32
Scripts/Commands/BroadcastCrier.cs
Normal 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." );
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue