View Single Post
  #6  
Old 03-13-2008, 12:23 AM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

This will do it Though, it does not work for bots. I'll have to go through the bot code and see if I can use another object to identify if the NPC is a bot or not.

Code:
sub EVENT_ITEM {
my $owner = $npc->GetOwnerID();
if ($owner > 0) {
}

else {
plugin::return_items(\%itemcount);
}
 }
Oh, and if interested in using my debugging code I used to make sure everything was kosher, here it is. Nothing fancy of course.

Code:
sub EVENT_SAY {
my $owner = $npc->GetOwnerID();
if($text=~/pet/i && $owner == 0){
quest::say("I don't belong to anybody!");
}
elsif($text=~/pet/i){
quest::say("I belong to player, $owner.");
}
 }
Of course, default.pl won't work for NPCs who already have a script associated with them, so I guess one of these days somebody is going to need to tack plugin::return_items(\%itemcount); at the end of every script. *sigh*

Last edited by cavedude; 03-13-2008 at 08:33 AM..
Reply With Quote