Jump to content
  • 0

Modification of IP Based Daily Giveaway Script..


Question

Posted

I need help in modifying the reward.

In the code below the user will recieve 1 TCG card but I want it to be random item..

like they have a chance to get

10 Silver Coins, 1 Yggdrasil box, 10 Link Scrolls.. etc etc...

Can you help me with that??

thank you very much! :)

prontera,131,171,4 script Daily Giveaway 76,{
 set(@now,gettimetick(2));
 query_sql("SELECT REPLACE(`last_ip`,'.','_') FROM `login` WHERE `account_id` = "+getcharid(3),@lastIP$);
 if((getd("$G_LIP_"+@lastIP$)+(60*60*24)) <= @now) {
  setd("$G_LIP_"+@lastIP$,@now);
  getitem 7227,1;
  //set(#pvppoints,#pvppoints+10);
  mes "[Daily Rewards NPC]";
  mes("Here's your Daily Event Reward! Thanks for playing Point RO!");
  dispbottom "[ Daily Attendance ] : You have received 1 Event Ticket!";
  close2();
 }
 else{
 mes "[Daily Rewards NPC]";
 mes ("You have already recieved your daily reward.");
close2();
}
 end();
}

3 answers to this question

Recommended Posts

Posted (edited)

try replace

getitem 7227,1;

with this

setarray .@items[0],607,608,512;
setarray .@amounts[0],1,2,3;
set .@i,rand( getarraysize( .@items ) );
getitem .@items[.@i],.@amounts[.@i];

Edited by Emistry
Fixed missing Brackets.
  • Upvote 1
Posted

I will try this, thank you emistry :)

sir error at line 9

here is the modified script...

prontera,137,171,4 script Daily Rewards 76,{
 set(@now,gettimetick(2));
 query_sql("SELECT REPLACE(`last_ip`,'.','_') FROM `login` WHERE `account_id` = "+getcharid(3),@lastIP$);
 if((getd("$G_LIP_"+@lastIP$)+(60*60*24)) <= @now) {
  setd("$G_LIP_"+@lastIP$,@now);
 //Prize
 setarray .@items[0],675,607,13607,12013;
 setarray .@amounts[0],5,50,1,1;
 set .@i,rand( getarraysize( .@items );
 getitem .@items[.@i],.@amounts[.@i];
  //set(#pvppoints,#pvppoints+10);
  mes "[Daily Rewards NPC]";
  mes("Here's your Daily Event Reward! Thanks for playing Point RO!");
  dispbottom "[ Daily Attendance ] : You have received your daily award, thank you for playing point ro!";
  close2();
 }
 else{
 mes "[Daily Rewards NPC]";
 mes ("You have already recieved your daily reward. Please come back again tomorrow.");
close2();
}
 end();
}

Error:

Loading NPC file: ###########################
script error on ################## line 9
   parse_callfunc: expected ')' to close argument list
 4 :			    if((getd("$G_LIP_"+@lastIP$)+(60*60*24)) <= @now) {
 5 :					    setd("$G_LIP_"+@lastIP$,@now);
 6 :			    //Prize
 7 :			    setarray .@items[0],675,607,13607,12013;
 8 :			    setarray .@amounts[0],5,50,1,1;
*    9 :			    set .@i,rand( getarraysize( .@items )';'
   10 :			    getitem .@items[.@i],.@amounts[.@i];
   11 :					    //set(#pvppoints,#pvppoints+10);
   12 :					    mes "[Daily Rewards NPC]";
   13 :					    mes("Here's your Daily Event Reward! Thanks for playing Point RO!");
   14 :					    dispbottom "[ Daily Attendance ] : You have received your daily award, thank you for playing point ro!";

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...