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
  #2  
Old 08-07-2007, 12:27 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Search the forums here for the plugin called "check_handin.pl". I am not sure when the emulator started using this method to check for handins, but the documentation is severly lacking in that area - the question has come up a lot lately.

The perl script itself should be in the folder named "plugins" from the CVS, but in case you can't find it:

Code:
# plugin::check_handin($item1 => #required_amount,...);
# autoreturns extra unused items on success
sub check_handin {
    my $hashref = shift;
    my %required = @_;
    foreach my $req (keys %required) {
	if ((!defined $hashref->{$req}) || ($hashref->{$req} != $required{$req})) {
            return(0);
	}
    }
    foreach my $req (keys %required) {
	delete $hashref->{$req};
    }
    return 1;
}

sub return_items {    
    my $hashref = shift;
    foreach my $k (keys(%{$hashref})) {
	next if($k == 0);
	my $r;
	for($r = 0; $r < $hashref->{$k}; $r++) {
		quest::summonitem($k);
	}
	delete $hashref->{$k};
    }
}

1;
To use it, here's an example (one of my personal favorite quest NPCs - Schmendrik!):
Code:
sub EVENT_ITEM {
  # 28044 :  Lord Bergurgle's Crown
  if (plugin::check_handin(\%itemcount,28044=>1)) {
    quest::emote("shoves the crown into a scorch marked leather satchel and cackles uncontrollably as madness twists his features and flames dance in his eyes. 'You, $name, have reduced the Riptides into chaos! Without a king to keep them in control they will ravage the settlements surrounding this lake! After the slaughter I shall return and easily burn the remainder of the villages and fishing shanties to the ground! None shall escape the fires of the Tyrant!!'");
    quest::summonitem(28045); # 28045  Oil of Fennin Ro
    quest::spawn2(51138,0,0,111,3627.3,51,192.4);

    #my $entid=quest::unique_spawn(51138,0,0,111,3627.3,51,192.4); # Natasha Whitewater, spawns in the hut nearby (loc to be adjusted)
    #my $mob=$entity_list->GetMobID($entid);
    #my $mobnpc=$mob->CastToNPC();
    #$mobnpc->AddToHateList($npc,1); # she attacks Shmendrik
  }

  plugin::return_items(\%itemcount); # return unused items
}
There are plenty of quests in the CVS that use this method, and I am pretty sure it'll handle multiple handins just as easily as one.
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 11:34 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