Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2011, 05:56 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

I am not sure what you are asking when you say you don't want to use if commands. The only if in that script is to handle the case where the user says something to the npc that it doesn't understand. If you don't care about that and you want the npc to say " whenever that happens then go ahead and remove the if although that makes no sense to me.
Reply With Quote
  #2  
Old 11-07-2011, 06:20 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I am not exactly sure what you are wanting to do, but maybe a plugin can help simplify things a bit for you. I haven't tested this at all, but it may work for what you are wanting. Just add following plugin to one of your plugin files in your plugins folder.

Code:
#Usage: plugin::EventSay("ExpectedText", "Response");
# Example: plugin::EventSay("Hail", "It Worked!");

sub EventSay {
	my $text = plugin::val('$text');
	my $CheckText = $_[0];
	my $Response = $_[1];
	
	if ($text =~ /$CheckText/i)
	{
		quest::say("$Response");
	}

}
Then, you should be able to test it using this:

Usage Example:
Code:
sub EVENT_SAY {

	my $cookie = quest::saylink("Cookie");
	my $cookieid = quest::varlink("19732");

	plugin::EventSay("Hail", "Would you like a [$cookie]?");
	plugin::EventSay("cookie", "Yes, a Cookie! Here is what it looks like [$cookieid]");
	plugin::EventSay("no", "Okay, I will eat it!");

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:01 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3