function script timel { set .@left, getarg(0); if ( .@left <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; return ( ( .@day )?.@day +" day ":"" )+( ( .@day || .@hour )?.@hour +" hour ":"" )+( ( .@day == 0 && ( .@hour || .@min ) )?.@min +" min ":"" )+( ( .@day || .@hour )?"":.@sec +" sec" ); } //By Skorm //spoilbox v3.8 - script Royal_Chest -1,{ end; OnMVPKilled: getmapxy .map$, .x, .y, 0; set .a,0; set .b,0; set .id, atoi(strnpcinfo(2)); set .@mid, .mvpid[.id]; set .@ar$, ".mob"+.@mid; set .@len, getarraysize(getd(.@ar$)); set .@inf, getmonsterinfo(.@mid,22); if(.@len){ for(set .@u,1; .@u<.@len;set .@u,.@u+2 ) { set .@itm, getd(.@ar$+"["+(.@u-1)+"]"); set .@typ, getiteminfo(.@itm,2); set .@btflg, (getbattleflag(.gbfid$[.@typ]+((.@inf)?"_boss":""))/1000); set .@itmrt, getd(.@ar$+"["+.@u+"]"); query_sql("SELECT ROUND("+.@itmrt+"*("+.@btflg+"/100));",.@rte); if(!.@rte) set .@rte,1; if(((.@rte<=10000)?((rand(1,10000/.@rte)==1)?1:0):1)) { set .drops[.@b],.@itm; set .droprs[.@b],.@rte; set .@b,.@b+1; } } } else { end; } if(strcharinfo(1)==""){ goto Alone; } deletearray $@partymemberaid[0],128; getpartymember getcharid(1),1; getpartymember getcharid(1),2; set .@count, $@partymembercount; set .count,0; copyarray .@party[0],$@partymemberaid[0],.@count; copyarray .@cparty[0],$@partymembercid[0],.@count; for( set .@i,0; .@i < .@count; set .@i,.@i +1 ) { if(isloggedin(.@party[.@i],.@cparty[.@i])){ getmapxy(.@map$,.@x,.@y,0,rid2name(.@party[.@i])); if(.@map$==strcharinfo(3)) set .@p,.@p+1; set .party[.count],.@party[.@i]; set .count, .count +1 ; } } if(.@p<2||.count<2){ goto Alone; } movenpc strnpcinfo(0), .x, .y; restart: if(.a>=getarraysize(.party)) goto Lootz; if(attachrid(.party[.a])) { setnpctimer 0; attachnpctimer(rid2name(.party[.a])); startnpctimer; showdigit .tlimit,3; } set .loop, .tlimit; while ( .loop ) { delwaitingroom strnpcinfo(0); waitingroom callfunc("timel", .loop ), 0; set .loop, .loop -1; if(attachrid(.party[.a])) { sleep 475; } else { if(.a<.count) { npctalk "Party Member disconnected!"; while(.b.ratelimit&&.ratelimit>0) { setd ".partyroll"+.b+"["+.a+"]",0; } else { select("============(^0000FF"+getitemname(.drops[.b])+"^000000)===============:-Roll:-Pass"); if(!((@menu)-1)||@menu>3) goto L_lo; if(@menu==2){ setd ".partyroll"+.b+"["+.a+"]",rand(100); npctalk strcharinfo(0)+" rolled a ["+getd(".partyroll"+.b+"["+.a+"]")+"] on "+getitemname(.drops[.b])+"."; dispbottom "You rolled a ["+getd(".partyroll"+.b+"["+.a+"]")+"] on "+getitemname(.drops[.b])+"."; } else { setd ".partyroll"+.b+"["+.a+"]",0; npctalk strcharinfo(0)+" passed a on "+getitemname(.drops[.b])+"."; dispbottom "You passed a on "+getitemname(.drops[.b])+"."; } } set .loop, .tlimit; } set .b,.b+1; if(.b>=getarraysize(.drops)) close2; } } else { while(.bgetd(".wpartyroll"+.s)) { setd ".wpartyroll"+.s,getd(".partyroll"+.s+"["+.i+"]"); setd ".wrid"+.s,.party[.i]; } } } //Distribute Prize. for(set .s,0; .s < getarraysize(.drops); set .s,.s+1){ detachrid; if(getd(".wpartyroll"+.s) && attachrid(getd(".wrid"+.s))) { npctalk strcharinfo(0)+" won ["+getitemname(.drops[.s])+"]."; getitem .drops[.s],1; } else { makeitem .drops[.s],1,.map$,.x,.y; } } stopnpctimer; delwaitingroom strnpcinfo(0); movenpc strnpcinfo(0), 0,0; end; Alone: for(set .@s,0; .@s < getarraysize(.drops); set .@s,.@s+1){ getitem .drops[.@s],1; } delwaitingroom strnpcinfo(0); movenpc strnpcinfo(0), 0,0; end; OnInit: //=-=-=-=-=-=Configuration=-=-=-=-=-=-= //Example Poring Apple, 10%, Apple, 1.5%....etc setarray .mob1002, 909, 7000 , 1202 , 100000 , 938 , 100000 ,512 , 100000 ,713 , 100000 , 512 , 100000, 619, 100000, 4001, 300000; // Mob List 10000=100% can support up to 128 values setarray .mvpid[0], 1002; // MVP ids make sure each id corresponds to the duplicated npcs and maps. set .tlimit,60; // In half seconds so 60 is 30 seconds. (To keep up with digital counter.) set .ratelimit,0; // Ignores items dropped with rates higher then this value. 0 = off 10000 = 100% //=-=-=-=-=-=-=Skorm=-=-=-=-=-=-=-=-=-= setarray .gbfid$[0], "item_rate_heal" , "1" , "item_rate_use" , "item_rate_common", "item_rate_equip", "item_rate_equip", "item_rate_card", "item_rate_use" , "item_rate_equip" , "9" , "item_rate_equip", "item_rate_use" , "12" , "13" , "14" , "15" , "16" , "17" , "item_rate_use"; end; } prt_fild08 mapflag nomvploot prt_fild08,50,50,1,1 monster Lootz 1002,1,360000,360000,"Royal Chest#0_mvp::OnMVPKilled" prt_fild08,0,0,0 duplicate(Royal_Chest) Royal Chest#0_mvp 801