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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 12-29-2004, 06:47 PM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default Blackjack

I dont have EQEMu on this computer and I'm away from home. I wrote this quest for the boards. Does someone mind testing this quest out?
Code:
#See Below
__________________
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
  #2  
Old 12-31-2004, 10:20 AM
Scorpx725
Discordant
 
Join Date: Feb 2003
Location: Wish I knew.
Posts: 251
Default

Interesting, Cisyouc.

Quite creative, aswell.
__________________
* KingMort has left #eqemu
<Richardo> KingDrama has left #EQEMU
<Richardo> the rule my pants!
Reply With Quote
  #3  
Old 12-31-2004, 10:44 AM
Rogean's Avatar
Rogean
Administrator
 
Join Date: Jul 2003
Location: Massachusetts
Posts: 708
Default

Why do we have ChooseRandom() functions? Can't we just use perl's integrated random functions? Would be much more efficient, It was I used back at like 5.3.
__________________
EQEmulator Developer / Administrator
Reply With Quote
  #4  
Old 12-31-2004, 01:03 PM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Yeah, I was going to just use perl, but I just figured why not put it to use?
__________________
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
  #5  
Old 01-01-2005, 11:03 AM
Scorpx725
Discordant
 
Join Date: Feb 2003
Location: Wish I knew.
Posts: 251
Default

Whats the difference between the 2 commands?
__________________
* KingMort has left #eqemu
<Richardo> KingDrama has left #EQEMU
<Richardo> the rule my pants!
Reply With Quote
  #6  
Old 01-01-2005, 12:46 PM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

There isnt, hes just saying why have a quest::ChooseRandom() if can be just as easily done in perl?
__________________
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
  #7  
Old 01-02-2005, 12:33 PM
Scorpx725
Discordant
 
Join Date: Feb 2003
Location: Wish I knew.
Posts: 251
Default

Ah ok.

I thought there was something different that made one command better then the other.
__________________
* KingMort has left #eqemu
<Richardo> KingDrama has left #EQEMU
<Richardo> the rule my pants!
Reply With Quote
  #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 &lt; 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 &lt; $server &amp;&amp; $server &lt;= 21)
						{
							quest::say("Dealer wins with $server. Thanks for playing.");
							$client = 0;
							$permissions = 0;
							$xplatinum = 0;
							$xgold = 0;
							$xsilver = 0;
							$xcopper = 0;
						}
					if($client &lt; $server &amp;&amp; $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 &amp;&amp; $client &lt;= 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 &amp;&amp; $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 &amp;&amp; $permissions == 0 &amp;&amp; $platinum > 0 &amp;&amp; $gold > 0 &amp;&amp; $silver > 0 &amp;&amp; $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
  #9  
Old 03-15-2005, 09:11 PM
farce
Hill Giant
 
Join Date: Feb 2003
Posts: 126
Default

Which card in blackjack is worth 12?

=)
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 04:36 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3