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-18-2018, 03:00 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default

Try this:
Code:
sub EVENT_SAY {
    if($text=~/hail/i) {
        quest::say("Hail, mortal.");
    }
}

sub EVENT_ITEM {
    if(plugin::check_handin(\%itemcount, 13006 => 1, 68223 => 1)) {
        quest::say("Thank you, $name.");
        quest::summonitem(68862);
    } elsif(plugin::check_handin(\%itemcount, 13006 => 1, 68221 => 1)) {
        quest::say("Thank you, $name.");
        quest::summonitem(68861);
    } elsif(plugin::check_handin(\%itemcount, 13006 => 1)) {
        quest::say("Thank you, $name.");
        quest::summonitem(quest::ChooseRandom(10028, 10037, 22503, 15981));
    }
    plugin::return_items();
}
Reply With Quote
  #2  
Old 02-18-2018, 07:28 PM
lctucker2999
Sarnak
 
Join Date: Jan 2018
Posts: 51
Default

Thanks that condensed code looks so much better. As soon as I get home I'll try it out.

Another question, is there either a) a limit to the amount of elseif lines or b) a point where one npc is doing too much? My ultimate goal is to still have quest armor be a thing, but to simplify it (mold + class specific token that i havent decided how im going to implement yet) and then have one NPC per expansion to do quest armor turn ins e.g. Defender of Frost would allow you to turn in Thurg, SS and Kael armor... so however many classes there are, 15? Multiplied by 3 sets of armor, times 7 pieces per set, plus if I add mischief items that's around 400 different possible turn in combinations.

I'm having fun with the possibilities on how to tweak things. thanks again the help!
Reply With Quote
  #3  
Old 02-18-2018, 10:54 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by lctucker2999 View Post
Thanks that condensed code looks so much better. As soon as I get home I'll try it out.

Another question, is there either a) a limit to the amount of elseif lines or b) a point where one npc is doing too much? My ultimate goal is to still have quest armor be a thing, but to simplify it (mold + class specific token that i havent decided how im going to implement yet) and then have one NPC per expansion to do quest armor turn ins e.g. Defender of Frost would allow you to turn in Thurg, SS and Kael armor... so however many classes there are, 15? Multiplied by 3 sets of armor, times 7 pieces per set, plus if I add mischief items that's around 400 different possible turn in combinations.

I'm having fun with the possibilities on how to tweak things. thanks again the help!

a. No limit (that I'm aware of, but remember if the last conditional is the one that applies, it will still iterate through all the prior ones and will check all if none apply)

b. You could take a look at quests in Kael for some leads. However, you may want to consider checking class for applicable exchanges, so nested if's/elsif's to a point. It's one way (of a few). You could also consider going the route of creating recipes, where combining said items result in some other, etc, etc. The straight answer (thus code) will rely highly on precisely what your game plan is in detail.
Reply With Quote
  #4  
Old 02-19-2018, 12:38 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Quote:
Originally Posted by ghanja View Post
a. No limit
There shouldn’t be, but there is. We ran into that a few years ago with 50ish elsif statements. I never really dug in to find out if it was a Perl limitation or what.
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 07:25 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