Felladrin
Sorceror
Yell default command working as a Chat System
Introduction:
I wanted to have a global chat system to use on a small casual shard. Using the default uo chat system was not fast, and the other system released here on forums were much more than I wanted.
So I thought giving a new use for the Yell command, as it's rarely used. Just needed to change it to send a broadcast message.
Exclamation.
Exclamation + Space-Bar.
Exclamation + Space-Bar + Your Message.
Everyone in the game will see your broadcast message.
Making the change:
Open your PlayerMobile script (Scripts/Mobiles/PlayerMobile.cs).
Find the line: public override void DoSpeech
You should see this on an unmodified script:
Now you just need to add the following green lines:
Save, close and restart the server to see the results.
Some Notes:
I used RawName because the property Name can be temporally changed with some systems, but RawName is always the same.
You can change the string format to whatever you want, just need keep the "{0}" (Palyer Name) and "{1}" (Text the player wrote).
To change the color of the messagem, just edit the "0x482" to the hue code of your choice.
It's good for small and/or private shards. Maybe on big shards it could bring chaos.
There's no ban/mute player option, and Squelch the player won't stop him. If you want this feature and much more, I suggest Knives' Chat 3.0.
Just remove the green lines and restart the server if you don't want it anymore.
Please, if I wrote something wrong, tell me, and feel free to comment.
Have fun!
Felladrin.
Introduction:
I wanted to have a global chat system to use on a small casual shard. Using the default uo chat system was not fast, and the other system released here on forums were much more than I wanted.
So I thought giving a new use for the Yell command, as it's rarely used. Just needed to change it to send a broadcast message.
Exclamation.
Exclamation + Space-Bar.
Exclamation + Space-Bar + Your Message.
Everyone in the game will see your broadcast message.
Making the change:
Open your PlayerMobile script (Scripts/Mobiles/PlayerMobile.cs).
Find the line: public override void DoSpeech
You should see this on an unmodified script:
Code:
public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
{
if( Guilds.Guild.NewGuildSystem && (type == MessageType.Guild || type == MessageType.Alliance) )
{
(...)
}
else
{
base.DoSpeech( text, keywords, type, hue );
}
}
Now you just need to add the following green lines:
Code:
public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
{
if( Guilds.Guild.NewGuildSystem && (type == MessageType.Guild || type == MessageType.Alliance) )
{
(...)
}
[B][COLOR="Green"] else if( type == MessageType.Yell )
{
Server.Commands.CommandHandlers.BroadcastMessage( AccessLevel.Player, 0x482, String.Format( "{0} says: {1}", this.RawName, text ) );
}[/COLOR][/B]
else
{
base.DoSpeech( text, keywords, type, hue );
}
}
Save, close and restart the server to see the results.
Some Notes:
I used RawName because the property Name can be temporally changed with some systems, but RawName is always the same.
You can change the string format to whatever you want, just need keep the "{0}" (Palyer Name) and "{1}" (Text the player wrote).
To change the color of the messagem, just edit the "0x482" to the hue code of your choice.
It's good for small and/or private shards. Maybe on big shards it could bring chaos.
There's no ban/mute player option, and Squelch the player won't stop him. If you want this feature and much more, I suggest Knives' Chat 3.0.
Just remove the green lines and restart the server if you don't want it anymore.
Please, if I wrote something wrong, tell me, and feel free to comment.
Have fun!
Felladrin.