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 02-23-2013, 10:42 PM
Zamthos
Discordant
 
Join Date: Jan 2013
Posts: 284
Default

If the roll is what you said you get back five times what you put in.

Here you go:
Code:
sub EVENT_SAY 
{
    
	my $NPCNAME = $npc->GetCleanName();
	
	if($text=~/hail/i) 
	{
		$client->Message(315, "$NPCNAME whispers to you, 'Hey there $name, up for some gambling? Pick a number from 1-10 by saying \"number #\", give me some money and if you're lucky and I roll your number you will get back five times the amount of money you put in.'");
    } 
	elsif($text=~/number ([0-9]+)/i)
	{
		$numbers{$name} = $1;
		$client->Message(315, "$NPCNAME whispers to you, 'Ok, you picked $1... Hand me your bet and let me grab my dice...'");
    }
}

sub EVENT_ITEM 
{
	my $NPCNAME = $npc->GetCleanName();
	
    if(defined($numbers{$name})) 
	{
		$client->Message(315, "$NPCNAME whispers to you, 'Ok, your bet is $platinum pp, $gold gp, $silver sp, $copper cp.  Rolling my dice!'");
		$client->Message(315, "$NPCNAME tosses his dice on the ground and looks at the number that comes up.");
		$roll = int(rand(9)+0.5) + 1;
		plugin::Whisper("The roll is $roll!");
		
		if($roll == $numbers{$name}) 
		{
			quest::givecash($copper*5,$silver*5,$gold*5,$platinum*5);
		} 
		else 
		{
			$client->Message(315, "$NPCNAME whispers to you, 'Oh, too bad, you lose, oh well, let me know if you want to try again.'");
		}
    } 
	else 
	{
		$client->Message(315, "$NPCNAME whispers to you, 'You have to pick a number first!'");
		quest::givecash($copper, $silver, $gold, $platinum);
		plugin::return_items(\%itemcount);
    }
}
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 01:17 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