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 02-24-2013, 01:19 AM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

you're wanting to use something more like this, where @findThese is a list of itemIDs you are looking for and @lookIn is a lost of slotIDs you want to look in.

Code:
foreach my $findThis (@findThese) {
    foreach my $slotID (@lookIn) {
        if ($client->GetItemIDAt($slotID) == $findThis) {
            $client->DeleteItemInInventory($slotID);
        }
    }
}
but then you probably also want to be aware of items in a stack as well.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #2  
Old 02-24-2013, 01:37 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Quote:
Originally Posted by c0ncrete View Post
you're wanting to use something more like this, where @findThese is a list of itemIDs you are looking for and @lookIn is a lost of slotIDs you want to look in.

Code:
foreach my $findThis (@findThese) {
    foreach my $slotID (@lookIn) {
        if ($client->GetItemIDAt($slotID) == $findThis) {
            $client->DeleteItemInInventory($slotID);
        }
    }
}
but then you probably also want to be aware of items in a stack as well.
Yeah, I was thinking of adding in $itemcount to one of the lines to account for that.
Reply With Quote
  #3  
Old 02-24-2013, 05:55 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Quote:
Originally Posted by c0ncrete View Post

Code:
foreach my $findThis (@findThese) {
    foreach my $slotID (@lookIn) {
        if ($client->GetItemIDAt($slotID) == $findThis) {
            $client->DeleteItemInInventory($slotID);
        }
    }
}
Thanks for the code c0ncrete it works... however, there is one thing that it is doing, or rather not doing that I am trying to figure out.

The NPC will delete the items, but they aren't removed. In fact what happens is when I go to pick up the stack of items, I get the following:
Here is my script so you can look at it yourself and tell me if I did something wrong.

This also happens on single items as well.

Code:
######
#Buffer
#Kingmen
######

sub EVENT_SAY
{

my $buffs = quest::saylink("buffs");
my $help = quest::saylink("help");
my $items = quest::saylink("items");


@diamonds = (
              quest::varlink("22503"),	#Blue_Diamond
              quest::varlink("15981"),	#Raw_Diamond
              quest::varlink("10037"),	#Diamond
              quest::varlink("25814")	#Flawless_Diamond
            );
			
#@diamonds1 = (
#				GetItemID(22503),
#				GetItemID(10037),
#				GetItemID(25814),
#				GetItemID(15981));

#@slots	=	(1, 2, 3, 4, 5, 6, 7, 8, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
#			265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
#			284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
#			303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
#			322, 323, 324, 325, 326, 327, 328, 329, 330);

if($text=~/hail/i)
	{
		plugin::Whisper("Hi there $name, would you like some $buffs? Also, I am collecting some $items if you want to $help");
	}
	
if($text=~/buffs/i)
	{
		plugin::Whisper("Enjoy your buffs, $name");
		quest::selfcast(1561);  #legacy of thorns
		quest::selfcast(39);    #quickness
		quest::selfcast(2570);  #kei
		quest::selfcast(5415);  #Talisman of Wunshi
		quest::selfcast(5405);  #Talisman of Fortitude
		quest::selfcast(5417);  #Champion
	}
	
if($text=~/^items$/i)
  {{
    $client->Message(315, "Yes, I am searching for the follwing items.");
    $client->Message(315, "=== ITEMS ===");
	}
  for my $dia(@diamonds){
    $client->Message(315, "$dia");
   }}
   
if($text=~/help/i)
	{{
	$client->Message(315, "Great. Stand close as I take them.");
 	}
	{ 
  foreach my $dia1 (22503, 10037, 25814, 15981) {
    foreach my $slot (22, 23, 24, 25, 26, 27, 28, 29, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
			265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
			284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
			303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
			322, 323, 324, 325, 326, 327, 328, 329, 330) {
        if ($client->GetItemIDAt($slot) == $dia1) {
            $client->DeleteItemInInventory($slot);
        }
    }
  }}}
}
I have arrays @diamonds1 and @slots commented out so they do not interfer with my script right now, and also so my npc will talk to me. I haven't found a way to implement an item search into the array just yet, so I just replaced @finditem with the item numbers I am wanting.

Thanks,
~Kingmen
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:40 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