Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 06-18-2017, 09:46 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default Custom Item Check Plugins

Included below are the following plugins:
  1. check_hasitem(client, item_id)
    • Used to check if a client has a specific item.
  2. check_hasitem_array(client, item_id_array)
    • Used to check if a client has any item within the specified item ID array.
  3. check_hasequipped(client, item_id)
    • Used to check if a client has a specific item equipped.
  4. check_hasequipped_array(client, item_id_array)
    • Used to check if a client has any item equipped within the specified item ID array.
Code:
sub check_hasitem {
    my $client = shift;
    my $itemid = shift;
    my @slots = (0..30, 251..340, 2000..2023, 2030..2270, 2500..2501, 2531..2550, 9999);
    foreach $slot (@slots) {
        if ($client->GetItemIDAt($slot) == $itemid) {
            return 1;
        }

        for ($i = 0; $i < 5; $i++) {
            if ($client->GetAugmentIDAt($slot, $i) == $itemid) {
                return 1;
            }
        }
    }
    return 0;
}

sub check_hasitem_array {
    my $client = shift;
    my @items = @_;
    my @slots = (0..30, 251..340, 2000..2023, 2030..2270, 2500..2501, 2531..2550, 9999);
    foreach $slot (@slots) {
        if ($client->GetItemIDAt($slot) ~~ @items) {
            return 1;
        }

        for ($i = 0; $i < 5; $i++) {
            if ($client->GetAugmentIDAt($slot, $i) ~~ @items) {
                return 1;
            }
        }
    }
    return 0;
}

sub check_hasequipped {
    my $client = shift;
    my $item = shift;
    my @slots = (0..21, 9999);
    foreach my $slot (@slots) {
        if ($client->GetItemIDAt($slot) == $item) {
            return 1;
        }

        for ($i = 0; $i < 5; $i++) {
            if ($client->GetAugmentIDAt($slot, $i) == $item) {
                return 1;
            }
        }
    }
}

sub check_hasequipped_array {
    my $client = shift;
    my @items = @_;
    my @slots = (0..21, 9999);
    foreach my $slot (@slots) {
        if ($client->GetItemIDAt($slot) ~~ @items) {
            return 1;
        }

        for ($i = 0; $i < 5; $i++) {
            if ($client->GetAugmentIDAt($slot, $i) ~~ @items) {
                return 1;
            }
        }
    }
}

return 1;
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 07:18 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