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 07-14-2009, 02:15 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default Multiple Quest Rewards

I was wondering if anyone knew any nifty ways to have an npc offer multiple reward choices when turning in quest items via PERL... not the task system... I would use the task system but im not quite finished learning it yet and it is a whole lot more time consuming.

Would I have to use quest globals after the turn in to signal the npc to offer the different rewards??? Or is there a better and easier way to go about doing this?
Reply With Quote
  #2  
Old 07-14-2009, 03:20 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yes, if you don't want to use the task system, then qglobals is probably your only other good option. You could do a point system if you wanted, or simply use a qglobal for the exchange. I have some examples of quests posted in the custom quest section using qglobals for a point system to choose item rewards like you are wanting.

Maybe some of the examples here and script comments will be of help:
http://www.eqemulator.net/forums/showthread.php?t=26123
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 07-14-2009, 04:57 AM
MNWatchdog
Hill Giant
 
Join Date: Feb 2006
Posts: 179
Default

You could have the NPC accept a quest reward in enchange for a different item in a round robin manner.

Turn in item 1 get ya 2, 2 for 3, 3 for 4, 4 for 1.
Reply With Quote
  #4  
Old 07-14-2009, 06:33 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Or, you could even do a hasitem check and not have them do a turn in at all. Just check if they have the item before allowing them the options to get a reward. Then, list the possible rewards and once they chose one, just nuke the item that they need to have to get the reward.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 07-14-2009, 11:04 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

Thanks guys, ill probably use Qglobals on the turn in and then have the npc offer the different items after that.

Trev are you using the task system on SH yet?
Reply With Quote
  #6  
Old 07-14-2009, 11:41 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

here is a little sample for you where npc takes 1 quest item and then gives you a random reward. he will also accept back any of the reward items and again randomly choose a reward item. Of course you may spent some time giving items back to him till you get exactly what you want.

item 1060 is the quest item, items 1189-1193 are rewards

Code:
sub EVENT_ITEM 
{


	if(plugin::check_handin(\%itemcount, 1060 => 1) || 
	plugin::check_handin(\%itemcount, 1189 => 1) || 
	plugin::check_handin(\%itemcount, 1190 => 1) || 
	plugin::check_handin(\%itemcount, 1191 => 1) || 
	plugin::check_handin(\%itemcount, 1192 => 1) || 
	plugin::check_handin(\%itemcount, 1193 => 1)	)
	{
	quest::say("I award you this! If this is not something you like, give it back to me and I will find something 
	else for you");

	my $a = quest::ChooseRandom(1189, 1190, 1191, 1192, 1193);
	quest::summonitem($a); 
	}




	else 
	{
	plugin::return_items(\%itemcount);	}

}

alternativly this can be set up that he trades reward items one for one (give 1 get 2, give 2 get 3. give 3 get 4 and so on)
Reply With Quote
  #7  
Old 07-14-2009, 02:02 PM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

Yea In the Past Ive Used The Trade Item In Deal - But I Wanted a Much More Cleaner Setup... Heres What I Came Up With (And Thx Trevius I Used Parts and Pieces of your Kill Credit Script)
Code:
###Zone - Guildhall###
###NPC - A lost coldain###
###Quest - Claiming Revenge###

sub EVENT_SAY {

my $hand = quest::saylink("hand");
my $claw = quest::saylink("claw");
my $Ready = quest::saylink("ready");
my $Hammer_of_the_Fallen = quest::saylink("Hammer of the Fallen");
my $Dwarvenbound_Mask = quest::saylink("Dwarvenbound Mask");
my $Choose_Hammer_of_the_Fallen = quest::saylink("Choose Hammer of the Fallen");
my $Choose_Dwarvenbound_Mask = quest::saylink("Choose Dwarvenbound Mask");
my $Time_Lost_Coldain_Wand = quest::saylink("Time-Lost Coldain Wand");
my $Choose_Time_Lost_Coldain_Wand = quest::saylink("Choose Time-Lost Coldain Wand");

  if($text=~/hail/i) {
$client->Message(2, "Hello stranger, would you like to lend an old man a [$hand]?");
}

  if($text=~/^hand$/i) {
  	$client->Message(2, "A dragon by the name Hsagra has slain an ole' friend of mine, retrieve her [$claw] by any means possible and I will reward you");
  }
  
    if ($text =~/^claw$/i) {
  	quest::itemlink(2431);
  }
 
   if($text=~/^Hammer of the Fallen$/i) {
  	quest::itemlink(2685);
  }
  
   if($text=~/^Dwarvenbound Mask$/i) {
  	quest::itemlink(2686);
  }

   if($text=~/^Time-Lost Coldain Wand$/i) {
  	quest::itemlink(2687);
  }

   if($text =~ /^ready$/i && defined($qglobals{htalisman_have})) {
  	$client->Message(13, "Choose Your Quest Reward - BE CAREFULL");
  	$client->Message(2, "--------------------------------------");
  	$client->Message(15, "[$Choose_Hammer_of_the_Fallen]");
  	$client->Message(15, "[$Choose_Dwarvenbound_Mask]");
  	$client->Message(15, "[$Choose_Time_Lost_Coldain_Wand]");
  }
  
   if($text =~ /^Choose Hammer of the Fallen$/i && defined($qglobals{htalisman_have})) {
    $client->Message(15, "You Have Recieved [$Hammer_of_the_Fallen]!");
  	quest::summonitem(2685);
		quest::delglobal("htalisman_have"); undef($qglobals{htalisman_have});
  }
  
   if($text =~ /^Choose Dwarvenbound Mask$/i && defined($qglobals{htalisman_have})) {
    $client->Message(15, "You Have Recieved [$Dwarvenbound_Mask]!");
  	quest::summonitem(2686);
		quest::delglobal("htalisman_have"); undef($qglobals{htalisman_have});
  }
  
     if($text =~ /^Choose Time-Lost Coldain Wand$/i && defined($qglobals{htalisman_have})) {
    $client->Message(15, "You Have Recieved [$Time_Lost_Coldain_Wand]!");
  	quest::summonitem(2687);
		quest::delglobal("htalisman_have"); undef($qglobals{htalisman_have});
  }
  
}
  
  sub EVENT_ITEM {
  	
my $Ready = quest::saylink("Ready");
my $Hammer_of_the_Fallen = quest::saylink("Hammer of the Fallen");
my $Dwarvenbound_Mask = quest::saylink("Dwarvenbound Mask");
my $Time_Lost_Coldain_Wand = quest::saylink("Time-Lost Coldain Wand");
  	
  if (($itemcount{2431} == 1)) {
     $client->Message(2, "You have found it! The same claw that took my friend in one fell swoop! Here are some items to choose from to compensate for your efforts!");
     $client->Message(13, "Let Me Know When You Are [$Ready] To Choose!!!");
    quest::setglobal("htalisman_have", 0, 1, "F");
     $client->Message(15, "Quest Reward Links"); 
     $client->Message(4, "------------------------"); 
     $client->Message(5, "[$Hammer_of_the_Fallen]"); 
     $client->Message(5, "[$Dwarvenbound_Mask]");
     $client->Message(5, "[$Time_Lost_Coldain_Wand]");
  } 
  
}
Btw on the new Icelance 2.0 Server im deving - I use a combination of client-> message and saylinks to keep my quests good looking, easy to manuver, and spam-free
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 05:43 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3