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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-02-2012, 09:59 PM
Luccian
Sarnak
 
Join Date: Sep 2009
Posts: 32
Default Randomly Choose a quest::say()

Hello again. After getting a problem solved yesterday involving randomly choosing pauses between actions in a loop I decided to try using that same idea with phrases said upon hail.
This semi works, in the sense that when a player hails the NPC, they emote and say things, however it says all the options given.
I'm not sure how it should be scripted, but basically I'm looking to have a player be able to Hail this NPC, or group of NPCs sharing the same name, and have the NPC randomly choose a response based on what is put in the $randomphrase values rolled by the RandomRange plugin.

Code:
sub EVENT_SAY 
{
	if($text=~/Hail/)
	{
		quest::emote("appears to be one of Zimora's chosen elite. Light glistens off the shined plate armor.");
		# Random choice of phrases to be said
		my $randomphrase=plugin::RandomRange(1,3);
			if($randomphrase=1)
			{
				quest::say(Hello);
			}
			if($randomphrase=2)
			{
				quest::say(Hi);
			}
			if($randomphrase=3)
			{
				quest::say(Heya);
			}
	}
}
I used easy basic responses til I can get it to work out correctly. Appreciate the help in advance.
Reply With Quote
 


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 08:56 AM.


 

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