Code: Select all
function onDropItemOnNpc( pDropper, pDroppedOn, iDropped )
{
pDroppedOn.TurnToward( pDropper );
var taskLevel = pDropper.GetTag( "IT_LEVEL" );
if( taskLevel )
{
var numToGet = pDropper.GetTag( "IT_numToGet" );
if( numToGet > 0)
{
var myGump = new Gump; // create a new gump
myGump.AddPage(0);
myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 );
myGump.AddGump( 130, 20, 0x64 ); // Sign Image
myGump.AddText( 150, 30, 0, "Kill Task" );
myGump.AddText( 180, 60, 0, "Unfinished" );
myGump.AddText( 82, 120, 0, "Alas, you still have "+NumToString( numToGet )+" more" );
myGump.AddText( 30, 140, 0, "to get before you receive your reward!" );
myGump.AddText( 35, 300, 0, "Keep Going" );
myGump.AddText( 160, 300, 0, "Quite" );
myGump.AddButton( 200, 300, 0x0fa5, 1, 0, 2 ); //quite
myGump.AddButton( 100, 300, 0x0fa5, 1, 0, 3 ); // keep going
myGump.Send( pDropper ); // send this gump to client now
myGump.Free(); // clear this gump from uox-memory
return 0;
}
else
{
if(iDropped = 0x0f78);
{
pDroppedOn.TextMessage( "Wonderful work my friend, here is your reward." );
var goldToGive = 0;
switch( taskLevel )
{
case 1: goldToGive = 500; break;
case 2: goldToGive = 1000; break;
case 3: goldToGive = 2000; break;
case 4: goldToGive = 4000; break;
}
CreateDFNItem( pDropper.socket, pDropper, "0x0EED", goldToGive, "ITEM", true );
pDropper.SoundEffect( 0x0037, false );
pDropper.SetTag( "IT_numToGet", 0 );
pDropper.SetTag( "IT_IDTOGET", 0 );
pDropper.SetTag( "IT_LEVEL", 0 );
return 1;
}
}
}
pDroppedOn.TextMessage( "thats not the item I'm looking for." );
return 0;
}