EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   check_handin.pl broken/exploit (https://www.eqemulator.org/forums/showthread.php?t=26763)

cybernine186 11-13-2008 07:48 PM

check_handin.pl broken/exploit
 
The plugin to handle things like plugin::check_handin is broken and has a HUGE exploit in it. Example I have had several issues were someone hand's in a bunch of gold or copper and they are given the reward regardless of the item number or count. Can anyone else confirm this, I know that this works because I have tried it my self and found it to be proven.

Here is the code that I currently use for the hand in.

check_handin.pl
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;


KLS 11-13-2008 10:34 PM

It's a known issue, yes.


All times are GMT -4. The time now is 06:21 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.