viewing paste Unknown #30686 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
prontera,156,87,4   script  每日頭飾    857,{
        function    turn;
        function    showerror;
        function    checkrand;
function    turn    {
        if(getarg(0)==1||getarg(0)==3||getarg(0)==5||getarg(0)==7||getarg(0)==8||getarg(0)==10||getarg(0)==12) return 31;
        else if(getarg(0)==2) return 28;
        else return 30;
}
function    showerror   {
    dispbottom ""+getarg(0);
    close;
}
function    checkrand   {
for(set .@i,1;.@i<getarg(2)+1;set .@i,.@i+1){
if(getarg(0)==getd(getarg(1)+"["+.@i+"]")) return 1;
}return 0;
}
for(set .@i,1;.@i<6;set .@i,.@i+1)  
    mes "頭飾所需材料 : "+getitemname($td[.@i]) +" "+$tdneedn[.@i]+" 個";
mes "Exchange?";
set .@select,prompt("Exchange","cancel");
        if(.@select==255 || .@select==2) close;
        for(set .@i,1;.@i<6;set .@i,.@i+1){
        if(countitem($td[.@i])<$tdneedn[.@i]||zeny<$payzeny) {
        mes "材料或金額不足";close;
        }
}
for(set .@i,1;.@i<6;set .@i,.@i+1)
    delitem $td[.@i],$tdneedn[.@i];
getitem $ar[$isrand?rand(1,getarraysize($ar)-1):((gettime(5)- (gettime(3)>=6?0:1)  )<1? turn( gettime(6)==1?12:gettime(6)-1 ) : (gettime(5)-(gettime(3)>=6?0:1) ))],1;
set Zeny,Zeny-$payzeny;
mes "兌換成功";
close;
OnClock0600:
deletearray $td[1],128;
deletearray $tdneedn[1],128;
for(set .@o,1;.@o<6;set .@o,.@o+1){
for(;;){
set .@ra,rand(1,getarraysize($exchange)-1);
if(!checkrand($exchange[.@ra],"$td",5) && getitemname($exchange[.@ra])!="null")break;
}
setarray $td[.@o],$exchange[.@ra];
setarray $tdneedn[.@o],rand(10,100);//隨機數量
announce "每日頭飾所需材料 : "+getitemname($td[.@o]) +" "+$tdneedn[.@o]+" 個",0;
}
end;
OnWhisperGlobal:
if(getgmlevel() < 98) end;
setarray .@word$[1],"欲修改頭飾編號","欲修改材料編號","欲修改頭飾","欲修改材料";
for(set .@i,1;.@i<(set(.@a,getarraysize($ar))>set(.@b,getarraysize($exchange))?.@a:.@b);set .@i,.@i+1){
        mes .@i+" 日頭飾為 : "+getitemname($ar[.@i]);
        announce .@i+" 號材料為 : "+getitemname($exchange[.@i]),bc_self;
        }
next;
    set .@select,prompt("更改頭飾","更改材料","刷新材料");
    if(.@select==255) end;
    if(.@select==3) { close2; callsub OnClock0700; }
    mes .@word$[.@select];
    input .@q;
    if(.@q>getarraysize(.@select==1?$ar:$exchange)-1||.@q<1) showerror("Wrong number!");
    mes .@word$[.@select+2];
    input .@qq;
    if(getitemname(.@qq)=="null") showerror("Not item variable!");
    setd "$"+(.@select==1?"ar":"exchange")+"["+.@q+"]",.@qq;
    mes "更改為 : "+getitemname(getd("$"+(.@select==1?"ar":"exchange")+"["+.@q+"]"));
    close;
end;
OnInit:
set $isrand,0;//是否獲得隨機頭飾
if($ar[1]) end;
setarray $ar[1],2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281;//頭飾
setarray $exchange[1],501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531;//材料
set $payzeny,100000;//製作金額
end;
}
Viewed 1047 times, submitted by Guest.