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
  #12  
Old 03-13-2008, 03:14 PM
Kagehi
Sarnak
 
Join Date: Feb 2008
Location: Arizona, USA
Posts: 33
Default

Ok. This **seems** to work, after a lot of hair pulling and confusion as to what the frack was going on. Obviously, it should be tested more rigorously than I have. lol

Code:
sub check_handin {
  my $hashref = shift;
  my $copy_hash = $hashref;
  my %required = @_;
  foreach my $req (keys %required) {
        do {
	  if (defined $hashref->{$req}) {
	    if ($hashref->{$req} <= $required{$req}) {
	      $required{$req} = $required{$req} - $hashref->{$req};
              delete $hashref->{$req};
	      if ($required{$req} == 0) {delete $required{$req};}
	    }
	    elsif ($hashref->{$req} > $required{$req}){
                $hashref->{$req} = $hashref->{$req} - $required{$req};
	        delete $required{$req};
	    } else {
	      $hashref = $copy_hash;
              return(0);
	    }
	  }
	  else {
	    $hashref = $copy_hash;
	    return(0);
	  }
	} until !defined $required{$req};
  }
Again, if the server where set up with a configuration option is turn off stacks, then this will pass, but the turn in won't work. What happens in that case... Another test might need to be added to this, to make sure that stacks are turned on, before even bothering to do any more checking.

Time to go bounce around the rubber room a bit, and recover from trying to figure this code out in a language that looks, to me, like someone threw cartoon curse words at the screen. !%$%@!^%& = "open a gate to the Pegasus Galaxy", right? lol
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 12:01 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