can someone help fix this? i want this npc announce the name of the player who got reward with 1%-10% chance! thank you!
setarray .P1[0],1,7179,1; //pods >>>>>>>> [0],1 = 1%
setarray .P2[0],5,26224,1; //1>>>>>>>>>>>[0],5 = 5%
prontera,141,181,5 script Lotti Girl 714,{
specialeffect 372;
delitem .Cost[0], .Cost[1];
set .@i, rand(1,.Total);
if (rand(1,100) > getd(".P"+.@i+"[0]")) {
for(set .@j,0; .@j<getarraysize(.Default); set .@j,.@j+2) {
getitem .Default[.@j], .Default[.@j+1];
if (!.@k[0]) setarray .@k[0], .Default[.@j], .Default[.@j+1]; } }
else {
for(set .@j,1; .@j<getarraysize(getd(".P"+.@i)); set .@j,.@j+2) {
getitem getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]");
if (!.@k[0]) setarray .@k[0], getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]"); } }
specialeffect2 248;
OnInit:
// Format: <%>,<item ID>,<count>{,...};
setarray .P1[0],1,7179,1; //pods
setarray .P2[0],5,26224,1; //1
setarray .P3[0],5,26225,1; //2
setarray .P4[0],5,26226,1; //3
setarray .P5[0],5,26227,1; //4
setarray .P6[0],5,26228,1; //5
setarray .P7[0],5,26229,1; //6
setarray .Default[0],607,1; //Berry
setarray .Cost[0],26080,10; //Credit
set .Total,7;
end;
}