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!