Here is simple plugin I made that can be used similar to quest::say(), but instead of saying the message, this will send the message directly to the player only. You can set the color in this plugin to whatever color you would like your whispers to be on your server.
Using this plugin will message the player in this format:
Code:
Soandso whispers, 'Only you can hear this!'
All it is actually doing is getting the name of the NPC and sending it along with your message in that format to the player using $client->Message(). If whispers are something you might like to use, this plugin should save a little time when writing scripts.
Note: This plugin requires that you have at least the "val()" plugin from the post here:
http://www.eqemulator.net/forums/sho...hlight=plugins
If you do not yet have that plugin, you can get it from the PEQ Quest SVN here:
http://projecteqquests.googlecode.co...quests/plugins
The particular plugin file there is named "globals.pl". Make sure you download that and save it to your server /plugins/ folder.
Here are the steps to add this plugin to your server:
1. Open notepad, or whatever text editor you prefer.
2. Copy and paste the following code into Notepad:
Code:
#Usage: plugin::Whisper("Message");
sub Whisper {
my $TextColor = 315; #Set the Text Color for the Message (this one is beige)
my $npc = plugin::val('$npc');
my $client = plugin::val('$client');
my $MyMessage = $_[0]; #Use the Message Supplied to the Function - "$_[0]" means to use the first argument given
if ($client) {
#$client->Message($TextColor, "-"); #Spacer between Text messages to make them easier to read
my $NPCName = $npc->GetCleanName(); #Get the clean name of the NPC sending the message
$client->Message($TextColor, "$NPCName whispers, '$MyMessage'"); #Send a message to the player simulating a whisper directly to them from the NPC
}
}
return 1; #always leave this line at the end of the script_function.pl file as it is needed by require()
3. Save that file to your server /plugins/ folder and name it "whisper.pl".
4. Do a #questreload and the new plugin should be ready for use
One nice thing about this plugin is that you can use find/replace to convert an entire script from quest::say messages to plugin::whisper messages in a matter of seconds. Also, if you use silent saylinks regularly, you might want to uncomment the following line to make it easier to read the NPC text:
Code:
#$client->Message($TextColor, "-"); #Spacer between Text messages to make them easier to read