- script Upgrade Orb 112,{
disable_items;
setarray .@eq[1], EQI_HEAD_TOP, EQI_HEAD_MID, EQI_HEAD_LOW;
for(.@i = 1; .@i <= getarraysize(.@eq);.@i++){
if(getequipisequiped(.@eq[.@i])){
.@menu$ = .@menu$+F_getpositionname(.@eq[.@i])+" ~ [ " + getequipname(.@eq[.@i]) + " ]";
.@equipped = 1;
}
.@menu$ = .@menu$ + ":";
}
if (!.@equipped) {
mes "You aren't wearing any headgear";
close;
}
.@choice = select(.@menu$);
.@part = .@eq[.@choice];
.@hg_id = getequipid(.@part);
if (countitem(.@hg_id) > 1) {
mes "Kamu membawa lebih dari 1 "+getitemname(.@hg_id);
mes "Bawalah hanya 1 untuk upgrade";
close;
}
.@card0 = getequipcardid(.@part,0);
.@card1 = getequipcardid(.@part,1);
.@card2 = getequipcardid(.@part,2);
.@card3 = getequipcardid(.@part,3);
if (!.@card3) {
mes "Gada orb nya headgearnya euuy";
close;
}
.@rate = 50;
.@upgrade = getd(".up"+.@card3);
mes "[Debug]";
mes "Card Slot 0 = "+ .@card0;
mes "Card Slot 1 = "+ .@card1;
mes "Card Slot 2 = "+ .@card2;
mes "Card Slot 3 = "+ .@card3;
mes " ";
mes "Kalo sukses "+getitemname(.@card3)+" jadi "+getitemname(.@upgrade)
next;
if (select("Upgrade:Cancel")==2){
mes callfunc("F_Bye");
close;
}
mes "Pencet Enter atau click close";
close2;
delitem .@hg_id, 1;
delitem .@req_item, 1;
progressbar "ffff00", 3;
if (rand(99) < .@rate) {
getitem2 .@hg_id,1,1,0,0,.@card0,.@card1,.@card2,.@upgrade;
} else {
getitem2 .@hg_id,1,1,0,0,.@card0,0,0,0;
}
end;
OnInit:
.up501 = 502;
end;
}