- script treasurebox_event -1,{
OnInit:
// treasure box id + amount to spawn
setarray .treasure_box,1902,1;
// map list
setarray .map$,
"geffen";
// zeny gain upon killing box
.gain_zeny = 1000000;
// item gain upon killing box
setarray .item,607,3,671,5;
.map_size = getarraysize( .map$ );
.item_size = getarraysize( .item );
.npc_name$ = strnpcinfo(0);
// end;
OnClock0200:
OnClock0400:
OnClock0600:
OnClock0800:
OnClock1000:
OnClock1200:
OnClock1400:
OnClock1600:
OnClock1800:
OnClock2000:
OnClock2200:
OnClock0000:
// etc
.@index = rand( .map_size );
.map_name$ = setchar( .map$[.@index], strtoupper( charat( .map$[.@index],0 ) ), 0 );
announce "A Rare Treasure Box has Been Spawned "+.treasure_box[1]+" x "+getmonsterinfo( .treasure_box[0],MOB_NAME )+" at "+.map_name$,bc_all;
// monster .map$,0,0,"--ja--",.treasure_box[0],.treasure_box[1],.npc_name$+"::OnKill";
monster .map$[.@index],0,0,"--ja--",.treasure_box[0],.treasure_box[1],.npc_name$+"::OnKill";
end;
OnKill:
.@box_amount = mobcount( strcharinfo(3),.npc_name$+"::OnKill" );
Zeny += .gain_zeny;
if( .item_size > 1 )
for( .@i = 0; .@i < ( .item_size - 1 ); .@i += 2 )
getitem .item[.@i],.item[.@i+1];
announce strcharinfo(0)+" Gained "+.gain_zeny+" Zeny, 3 Yggdrasil Berries & 5 RO Coins for Killing the Treasure Box. "+( ( .@box_amount )?"Left "+.@box_amount+" at "+.map_name$:"" )+".",bc_all;
end;
}