Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Submissions

Quests::Submissions This is where you submit your quests for review

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-04-2005, 10:21 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Richardo informed me that I had some errors which I probably did I wasn't thinking too well when I did it, so I redid the quest... hopefully this version will work.

Code:
#############
#Quest Name: Black Jack's Blackjack
#Author: Cisyouc
#NPCs Involved: 1
#Items Involved: 0
#################
##NPC 1
#Name: Black_Jack00
#Race: 6 (dark elf - global model)
#Zone: Shadowhaven -- but can be anywhere really
#################

my $permissions = 0;
my $xplatinum = 0;
my $xgold = 0;
my $xsilver = 0;
my $xcopper = 0;
my $client1 = 0;
my $client2 = 0;
my $server = 0;
my $client = 0;

sub DealCard
{
	@cards = (1,2,3,4,5,6,7,8,9,10,11,12);
	$returnvalue = $cards[int(rand(scalar @cards))];
	return $choice;
}

sub EVENT_SAY
{
	if($text=~/hail/i)
		{
			quest::say("Greetings! Want to play balackjack? Hand me your bet to begin! All games return double on win!");
		}
	if($text=~/deal/i)
		{
			if($permissions == 1)
				{
					$client1 = DealCard();
					$client2 = DealCard();
					my $tempserver = DealCard();
					my $tempclient = ($client1+$client2);
					$client = $tempclient;
					$server = (DealCard() + $tempserver);
					if($server < 16)
						{
							$server = ($server + DealCard());
						}
					quest::say("The dealer passes you a $client1 and a $client2 giving you a total of $tempclient. The dealer is showing a $tempserver. Say [yes] for another card or [no] to stay.");
					$permissions = 2;
				}
				else
				{
					quest::say("Have you bet?");
				}
		}
	if($text=~/yes/i)
		{
			if($permissions == 2)
				{
					my $newcard = DealCard();
					$client = ($client + $newcard);
					quest::say("The dealer has handed you a $newcard, giving you a total of $client. Say [yes] for another card or [no] to stay.");
				}
				else if($permissions == 1)
				{
					quest::say("You must [deal] first!");
				}
		}
	if($text=~/no/i)
		{
			if($permissions == 2)
				{
					if($client < $server && $server <= 21)
						{
							quest::say("Dealer wins with $server. Thanks for playing.");
							$client = 0;
							$permissions = 0;
							$xplatinum = 0;
							$xgold = 0;
							$xsilver = 0;
							$xcopper = 0;
						}
					if($client < $server && $server > 21)
						{
							quest::say("You win with $client. Thanks for playing.");
							quest::givecash($xplatinum*2,$xgold*2,$xsilver*2,$xcopper*2);
							$permissions = 0;
							$client = 0;
							$xplatinum = 0;
							$xgold = 0;
							$xsilver = 0;
							$xcopper = 0;
						}
					if($client > $server && $client <= 21)
						{
							quest::say("You win with $client. Thanks for playing.");
							quest::givecash($xplatinum*2,$xgold*2,$xsilver*2,$xcopper*2);
							$permissions = 0;
							$client = 0;
							$xplatinum = 0;
							$xgold = 0;
							$xsilver = 0;
							$xcopper = 0;
						}
					if($client > $server && $client > 21)
						{
							quest::say("Dealer wins with $server. Thanks for playing.");
							$permissions = 0;
							$xplatinum = 0;
							$client = 0;
							$xgold = 0;
							$xsilver = 0;
							$xcopper = 0;
						}
				}
		}
}

sub EVENT_ITEM
{
	if($xplatinum > 0 || $xgold > 0 || $xsilver > 0 || $xcopper > 0 && $permissions == 0 && $platinum > 0 && $gold > 0 && $silver > 0 && $copper > 0)
		{
			quest::say("Your bet of $platinum platinum, $gold gold, $silver silver, $copper copper has been saved. You may [deal] the cards now.");
			$xplatinum = $platinum;
			$xgold = $gold;
			$xsilver = $silver;
			$xcopper = $copper;
			$permissions = 1;
		}
	else
		{
			quest::say("You've already bet!");
		}
}
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
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 01:34 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