Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2010, 09:17 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Plugin::Whisper()

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
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 12-02-2010, 10:01 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

This plugin was added to the repository, I had made a small modification that adds a space before the client message that I do believe you had mentioned you added yourself a while back I am not sure.

Code:
#Usage: plugin::ClientSay("Message"); ###Whisper Modification
#Akkadius
sub ClientSay{
	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) {
		my $NPCName = $npc->GetCleanName();	#Get the clean name of the NPC sending the message
		$client->Message($TextColor, " "); ###Gives a blank space in between messages
		$client->Message($TextColor, "$NPCName says, '$MyMessage'");	#Send a message to the player simulating a whisper directly to them from the NPC
	}
}
Both of these are added to client_messages.pl in the repo
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:41 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3