You can't think of a way to use that item.
Posted: Sat Feb 21, 2009 4:17 am
Here is my item thus far. I doubleclick it to activate it. I works fine except for displaying the above message.
Also, it appears to crash the server if I target a npc a few times.. maybe other items.. 
Also, is there a way to delete the corpse without deleting any loot also?
Thanks!
Code: Select all
//Amulet of the Gourmand
function onUseChecked( pUser )
{
var pSock = pUser.socket;
pSock.CustomTarget( 0, "What do you wish to eat?" );
}
//pick targeting
function onCallback0( pSock, myTarget )
{
var pUser = pSock.currentChar;
var isInRange = pUser.InRange( myTarget, 3 );
if( !isInRange )
{
pUser.SysMessage( "You are too far away to reach that." );
return false;
}
if( !myTarget.corpse )
{
pSock.SysMessage( "Not a valid target." );
return false;
}
pSock.SysMessage( "You devour the " + myTarget.name + ".");
pSock.SoundEffect( (0x003A + RandomNumber( 0, 2 )), true );
myTarget.Delete();
}
Also, is there a way to delete the corpse without deleting any loot also?
Thanks!