Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2004, 06:45 AM
jimbox114
Hill Giant
 
Join Date: Jun 2004
Posts: 231
Default Casino Quest

Was just wondering if anybody has ever tried to write a quest that would be similar to the Shadowhaven Casino quest from live?
Reply With Quote
  #2  
Old 08-24-2004, 07:02 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Nah, but it would be pretty easy to write =)
__________________
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
  #3  
Old 08-24-2004, 07:37 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

You know what.. im bored, so...

Here is something I just created. It requires the NPC to have 'qglobal' set to '1' in `npc_types` and it requires you to change the item IDs. You can easily add more and you can easily increase and decreate the chances.

This code has not been tested.
Code:
#1000 is used for the coin to play
#1001-1011 Rewards
#1021 Reward Ticket
#1022 Lesser Prize
#######################
#perlQuest by Cisyouc
#Please do not remove this header
#EQEMulator.net
#NPCID: 000000
#Usage: Casino
#Quest: King's Court
#######################

sub EVENT_SAY
{
if($text=~/hail/i)
  {
  quest::say("Hail, $name! To play the King`s Court, hand me a token to begin!");
  }
}
sub EVENT_ITEM
  {
  if($itemcount{1000} == 1)
    {
    $playing = (int(rand(80));
    if($playing == 80)
      {
      quest::say("Congrats! Here is a reward ticket! Hand this to me when you want your reward!");
      quest::summonitem(1021);
      }
    if($playing &lt;= 20)
      {
      quest::say("You've won a lesser prize!");
      quest::summonitem(1022);
      }
      else
      {
      quest::say("Sorry! Not a winner! Please play again.")l
      }
    }
if($itemcount{1021} == 1)
  {
  if($casinoprize == 0)
    {
    quest::setglobal("casinoprize","1001","1","C999999");
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1002","1","C999999");
    }
  if($casinoprize == 1002)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1003","1","C999999");
    }
  if($casinoprize == 1003)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1004","1","C999999");
    }
  if($casinoprize == 1004)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1005","1","C999999");
    }
  if($casinoprize == 1005)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1006","1","C999999");
    }
  if($casinoprize == 1006)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1007","1","C999999");
    }
  if($casinoprize == 1007)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1008","1","C999999");
    }
  if($casinoprize == 1008)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1009","1","C999999");
    }
  if($casinoprize == 1009)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1010","1","C999999");
    }
  if($casinoprize == 1010)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","1011","1","C999999");
    }
  if($casinoprize == 1011)
    {
    quest::say("Congrats! A reward ticket! Here is your reward, you lucky one!");
    quest::summonitem($casinoprize);
    quest::setglobal("casinoprize","0","1","C999999");
    }
  }
}
__________________
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
  #4  
Old 08-28-2004, 06:41 AM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

This quest looks good, but you made one mistake, a mistake that will force the same outcome each time the script is run. so no matter what, it will be almost impossible to get 80.

You didn't seed your random number generator, without seeding the generator the random outcome isn't really random at all, it comes out the same time each time it picks.

ex. a six sided die is rolled (int(rand(6)) 10 times, the outcome is

6
1
4
2
4
5
3
3
4
1

and if i run the script again guess what i get ?

6
1
4
2
4
5
3
3
4
1

so what you need to do is at the beginning of the script put in the line

srand($time|$$) this will put a number in the seeder based on the current server time making the number truly random.
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
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 10:50 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