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 08-17-2007, 06:50 PM
EliteSting
Sarnak
 
Join Date: May 2005
Posts: 58
Default Multiple item return on single item handin

Npc seems to skip the quest:summonitem part and goes right to the end where it hands me back my item.

Code:
sub EVENT_SAY 
{  if($text=~/Hail/i){quest::say("Hello hello! I see you wish to begin your [epic] journey , what do you wish to know?"); } if($text=~/epic/i){quest::say("Well, I can tell you that a long , long time ago there were weapons of incredible power given to the mortals of this world. But through time thier locations have been lost, and thier power has grown dim. Such treasures are not to be handled lightly. Recently however, some of these magnificent pieces of art have come into my possession. Perhaps we can arrange a [trade]?"); } if($text=~/trade/i){quest::say("You wish to trade eh? Well then , for one of these magnificent treatures you must perform a task. There is a most grusome pair of creatures which inhabit The Overthere . They block access into the great chasm , if they should be killed and a piece of thier flesh brought to me, I will reward you. Now go and return with what I ask.");}
}

sub EVENT_ITEM {
if ($class == 'Shaman' || $class == 'Rogue' || $class == 'Monk' || $class == 'Druid' || $class == 'Berserker' || $class == 'Wizard' || $class == 'Magician' || $class == 'Necromancer' || $class == 'Enchanter' || $class == 'Shadowknight' || $class == 'Cleric' || $class == 'Bard' || $class == 'Paladin') {
  if (plugin::check_handin(\%itemcount, 1737 == 1)) {
    my %rewards = (
      "Shaman" => 10651, "Rogue" => 11057, "Monk" => 10652, "Druid" => 20490, "Berserker" => 68299, "Wizard" => 14341, "Magician" => 28034, "Necromancer" => 20544, "Enchanter" => 10650, "Shadowknight" => 14383, "Cleric" => 5532, "Bard" => 20542, "Paladin" => 10099
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("Feels deeply satisfied knowing one of his worst enemies has been slain.'");
      quest::say("As we agreed. Our deal is complete.")
    }
	else {
        quest::say("I did not ask for this from you, $name.");
	plugin::return_items(\%itemcount);
	}
	}
}
}

sub EVENT_ITEM {
if ($class == 'Warrior') {
  if (plugin::check_handin(\%itemcount, 1737 == 1)) {
       quest::summonitem(10909);
       quest::summonitem(10910);
       quest::summonitem(17859);
       quest::emote("Feels deeply satisfied knowing one of his worst enemies has been slain.'");
       quest::say("As we agreed. Our deal is complete.")
  }
        else {
        quest::say("I did not ask for this from you, $name.");
	plugin::return_items(\%itemcount);
	}
  }
}

sub EVENT_ITEM {
if ($class == 'Ranger') {
  if (plugin::check_handin(\%itemcount, 1737 == 1)) {
    quest::summonitem(20487);
    quest::summonitem(20488);
    quest::emote("Feels deeply satisfied knowing one of his worst enemies has been slain.'");
    quest::say("As we agreed. Our deal is complete.")
  }
        else {
        quest::say("I did not ask for this from you, $name.");
	plugin::return_items(\%itemcount);
	}
  }
}

sub EVENT_ITEM {
if ($class == 'Beastlord') {
  if (plugin::check_handin(\%itemcount, 1737 == 1)) {
    quest::summonitem(8495);
    quest::summonitem(8496);
    quest::emote("Feels deeply satisfied knowing one of his worst enemies has been slain.'");
    quest::say("As we agreed. Our deal is complete.")
  }
        else {
        quest::say("I did not ask for this from you, $name.");
	plugin::return_items(\%itemcount);
	}
}
}
Any suggestions please ?
__________________
Drizlaru
(Jest Server OP)
JestEmulator.net

Last edited by EliteSting; 08-18-2007 at 02:53 AM.. Reason: Editted to post entire script.
Reply With Quote
  #2  
Old 08-18-2007, 07:42 AM
CrabClaw's Avatar
CrabClaw
Hill Giant
 
Join Date: Jun 2006
Location: Plane of Knowledge
Posts: 191
Default

Hmm, try trying an elseif instead of an else?
Reply With Quote
  #3  
Old 08-18-2007, 10:05 AM
Darkonig
Hill Giant
 
Join Date: Dec 2006
Posts: 102
Default

There should only be one EVENT_ITEM subroutine per quest file. You need to combine them all into one. Then place each valid turn in combination in an if clause.
Code:
If (plugin::check_handin(...)) {
  do something
} elsif (plugin::check_handin(...)) {
  do something else
} elsif (plugin::check_handin(...)) {
  do whatever this is
}

if (scalar keys %itemcount > 0) {
  quest::say("I don't need these items");
  plugin::return_items(\%itemcount)
}
the check_handin plugin will remove any items required from %itemcount
when the routine is finished, it will check to see if there are still any items that were turned in but not needed. If so, it will return them.

If you want to allow for multiple quests to be completed with a single hand in, just change the elsif to an if. Each step will remove any items it needed from the turn in.

Nothing will be returned to the player unless you either explicitly summon it and/or use the return_items plugin.

Last edited by Darkonig; 08-18-2007 at 06:09 PM..
Reply With Quote
  #4  
Old 08-18-2007, 02:52 PM
EliteSting
Sarnak
 
Join Date: May 2005
Posts: 58
Default

Thanks ! I'll try that.
__________________
Drizlaru
(Jest Server OP)
JestEmulator.net
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 06:59 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