Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 02-27-2008, 01:59 PM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

Wanted to make a suggestions for something that may make quest globals a little more functional for you
[QUOTE=trevius;143734]

Code:
sub EVENT_SAY {
  if ($text=~/hail/i && $level_quest == undef) {
    quest::say("Hello, $name, you don't have a flag defined for this quest yet.  Would you like a flag?");}

  if ($text=~/flag/i && $level_quest == undef) {
    quest::say("Hello, $name, you don't have a flag defined for this quest yet.  Would you like a flag?");
quest::setglobal("level_quest", 1, 5, "F"); 
}

  if ($text=~/hail/i && $level_quest == 1) {
    quest::say("Hello, $name, you are flagged with 1 for this quest.");}

    }
    $level_quest = undef;
    }
}
For this, I'd write it,

Code:
sub EVENT_SAY {
  if ($text=~/hail/i && $level_quest == undef) {
    quest::say("Hello, $name, you don't have a flag defined for this quest yet.  Would you like a flag?");}

  if ($text=~/flag/i) {
  if ($qglobals{level_quest} == 1) {
  quest::say("Hello, $name, you are flagged with 1 for this quest.");
  }
  elsif ($qglobals{level_quest} != 1) {
    quest::say("Hello, $name, you don't have a flag defined for this quest yet.  Would you like a flag?");
quest::setglobal("level_quest", 1, 5, "F"); 
}
}
}
Using the hases prevents you from having to undef variable each time. You can write is alot cleaner too.

I've written countless progression quests and here is another example of how you can write it to end up with cleaner text, etc.

Code:
sub EVENT_SAY {
if ($text=~/hail/i) {
    if ($qglobals{generaltom} == 4) {
       quest::say("You have proven yourself well, $name.  For this next task, I'll need you to destroy the vicious sabertooth outside of the vilalge.  He has run off with alot of our children");
    }
    elsif ($qglobals{generaltom} == 3) {
    quest::say("Now, I'll need you to kill some deer to make the ceremonial headdress.");
    }
    elsif ($qglobals{generaltom} == 2) {
    quest::say("Great, I'll need you to forage some green ikk berries to make the die for the ceremonial clothing.");
    }
    elsif ($qglobals{generaltom} == 1) {
    quest::say("Seek out the alchemist and obtain the recipe for making the ceremonial headdress
    }
    else {
    quest::say("You really handled that tiger well, $name!   Good luck with your journeys");
     }
 }
}
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 05:12 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