Jump to content
  • 0
Sign in to follow this  
themon

please make an array version

Question

2 answers to this question

Recommended Posts

  • 0

Here you go, hourlybonus.txt

 

NOTE: Array can handle maximum 128 values, so If you want more values, just create a new array and utilize it.

 

(Side Note: There may be some error, haven't tested it)

Edited by Dastgir Pojee

Share this post


Link to post
Share on other sites
  • 0

^ oninit part should be setarray. GJ. :D

 

here try?

 

 

prontera,150,150,3    script    Hourly Bonus    865,{if ($DLogin == 0) {    set $DLogin,rand (100000,999999); // dunno what this is. i am keeping it anyway. lol    end;}if (#DLogin) {    mes "You had already received your gift",        "Please! come back again after an hour.";    emotion e_bzz;    close;}    mes "Im glad to give you your Hourly Bonus!";OnItemBuild:    set .@ran,rand (1,20);    set .@rand, rand ( 0 , ( getarraysize(.item_id) - 1 ) );    if (.@ran < 10) callsub OnHourlyPrizeZeny, rand( 1 ,10 ), rand( 1, 100000 );    else callsub OnHourlyPrizeItem, .item_id[.@rand], .item_id1[.@rand];    close;    OnHourlyPrizeZeny: // Zeny Prize.    set .@claim,( getarg(1) * getarg(0) );    set Zeny, Zeny + .@claim;    Announce strcharinfo(0) + " got " + .@claim + "z!",8;    emotion e_thx;    set #DLogin, $DLogin;    close;OnHourlyPrizeItem: // Item Prize.    set .@claim,rand ( getarg(0), getarg(1) );    if ( getitemname( .@claim ) == "null") goto OnItemBuild;    getitem .@claim,1;    Announce strcharinfo(0) + " got " + getitemname( .@claim ) + ".",8;    emotion e_thx;    set #DLogin, $DLogin;    close;    OnMinute00: OnClock1048: OnClock1428: // Trigger npc    Announce "You can now claim your Hourly Bonus!",8;    set $DLogin,rand (100000,999999); // dunno what this is. i am keeping it anyway. lol    end;OnInit: // two array so you could add more items.    setarray .item_id[0],  4001, 4700, 401, 1101, 1151, 1201, 1250, 1301, 1351, 1401, 1451; // Item Id. 4001 <- 4001, 4555    setarray .item_id1[0], 4555, 4871, 599, 1149, 1199, 1249, 1296, 1317, 1398, 1436, 1493; // Item Id. 4555 <- 4001, 4555    end;}

 

 

Edited by quesoph

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.