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 06-07-2010, 03:05 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I added a new chance field to the script I posted above as well as simplified them a bit.

Code:
###Usage: plugin::RandomSay(chance(1-100), "message1","message2", etc..);
# Example: plugin::RandomSay(50, "I'll get you!", "Get over here!", "That's it!");
sub RandomSay {
	my $chance = $_[0];

	# First roll to see if a message will be sent or not depending on chance
	my $RandomNum = plugin::RandomRange(1, 100);
	
	# Choose the random message to send and send it
	if ($RandomNum <= $chance)
	{
		$MessageCount = @_;
		my $RandMessage = plugin::RandomRange(1, $MessageCount - 1);
		quest::say($_[$RandMessage]);
	}
}

###Usage: plugin::RandomEmote(chance(1-100), "message1","message2", etc..);
# Example: plugin::RandomEmote(50, "dies", "falls to the ground", "keels over dead");
sub RandomEmote {
	my $chance = $_[0];
	
	# First roll to see if a message will be sent or not depending on chance
	my $RandomNum = plugin::RandomRange(1, 100);
	
	# Choose the random message to send and send it
	if ($RandomNum <= $chance)
	{
		$MessageCount = @_;
		my $RandMessage = plugin::RandomRange(1, $MessageCount - 1);
		quest::emote($_[$RandMessage]);
	}
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 12-13-2010 at 11:16 AM..
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 01:39 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