npc 1
prontera,155,175,5 script Sample#npc1 4_F_KAFRA9,{
mes "Do you want Carrot?";
if ( select( "Trade my Apple to Carrots","Cancel" ) == 1 ) {
input .@count,0,countitem( 512 );
if ( .@count ) {
getitem 515,.@count;
delitem 512,.@count;
}
mes "Exchanged "+.@count+"x Apple to Carrot";
}
close;
OnInit:
npcspeed 200;
getmapxy( .npc_map$, .npc_x, .npc_y,1 );
initnpctimer;
end;
OnTimer10000:
.@x = .npc_x + rand( -10,10 );
.@y = .npc_y + rand( -10,10 );
npcwalkto .@x,.@y;
setnpctimer 0;
end;
}
npc 2
prontera,155,175,5 script Sample#npc2 4_F_KAFRA9,{
mes "Do you have apple?";
if ( select( "Sell Apple to NPC","Cancel" ) == 1 ) {
input .@count,0,countitem( 512 );
if ( .@count ) {
delitem 512,.@count;
Zeny += ( .@count * 1000000 );
}
mes "Sold "+.@count+"x Apple to NPC";
}
close;
OnInit:
waitingroom "B>Apple for 1M",0;
npcspeed 200;
getmapxy( .npc_map$, .npc_x, .npc_y,1 );
initnpctimer;
end;
OnTimer10000:
.@x = .npc_x + rand( -10,10 );
.@y = .npc_y + rand( -10,10 );
npcwalkto .@x,.@y;
setnpctimer 0;
end;
}