Jump to content

Question

Posted

hi can someone help me modify this daily reward to reset every 12am and have an accurate message regarding the time to be available again

Quote

turbo_room,107,127,5    script    Daily Reward NPC    75,{
//=========================== Settings ================================================================
set .@rewname$,"[ Daily Reward ]";
set .rewardid,12744;
set @rewardamount,1;
//======================= Settings End ================================================================
//*****************************************************************************************************
if(gettimetick(2) > #lastTimeTalked) {
mes .@rewname$;
mes "Hello "+strcharinfo(0)+",I";
mes "am here to give you a daily";
mes "Reward. Do you want to have it?";
next;
switch(select("-Yes,sure!:-No,bye!:-Cancel")) {
case 1:
mes .@rewname$;
mes "Okay going to give you the following items!";
mes "3x Light White Potion Box";
mes "3x Light Blue Potion Box";
mes "2x NT Field Manaual";
mes "2x NT Job Manaual";
mes "2x NT Bubble Gum";

next;
mes "Welcome...this is Daily gift...";
getitem 13534,3;
getitem 13810,3;
getitem 12263,2;
getitem 14606,2;
getitem 12264,2;
mes "Okay have fun with it!";
set #lastTimeTalked,gettimetick(2)+86400;
close;
case 2:
mes .@rewname$;
mes "Okay goodbye!";
close;
case 3:
close;
}
}
mes .@rewname$;
     .@delay = 24 - (gettimetick(2) - #lastTimeTalked);
   .@hours = .@delay / 60*60;
   .@hours = .@delay / (60*60);
     .@minutes = (.@delay - (.@hours*60*60)) / 60;
     mes "Sorry, you have to wait ^ff0000"+.@hours+" hour"+(.@hours>1?"s":"")+" "+.@minutes+" minute"+(.@minutes>1?"s":"")+" "+.@seconds+" second"+(.@seconds>1?"s":"")+"^000000 to claim your free supplies again.";
close;
OnTimer0050:
        showscript "Daily Rewards", getnpcid(0);
        initnpctimer;
        end;
OnInit:
        initnpctimer;
        end;
}



 

1 answer to this question

Recommended Posts

  • 0
Posted
On 12/14/2024 at 6:07 AM, Sallycantdance said:

hi can someone help me modify this daily reward to reset every 12am and have an accurate message regarding the time to be available again



 

try this

Welgaia,169,236,4	script	Daily Reward NPC	75,{
set .@rewname$,"[ Daily Reward ]";

if(rewards == 1 ) {
	mes .@rewname$;
   	mes "Sorry, you already claim it for today.";
   	end;
}
mes .@rewname$;
mes "Hello "+strcharinfo(0)+",I";
mes "am here to give you a daily";
mes "Reward. Do you want to have it?";
next;
switch(select("-Yes,sure!:-No,bye!")) {
	case 1:
	mes .@rewname$;
	mes "Okay going to give you the following items!";
	mes "3x Light White Potion Box";
	mes "3x Light Blue Potion Box";
	mes "2x NT Field Manaual";
	mes "2x NT Job Manaual";
	mes "2x NT Bubble Gum";

	next;
	mes "Welcome...this is Daily gift...";
	getitem 13534,3;
	getitem 13810,3;
	getitem 12263,2;
	getitem 14606,2;
	getitem 12264,2;
	mes "Okay have fun with it!";
	set rewards,1;
	end;

	case 2:
	mes .@rewname$;
	mes "Okay goodbye!";
	close;
}
    
OnTimer0050:
        showscript "Daily Rewards", getnpcid(0);
        initnpctimer;
        end;
OnInit:
        initnpctimer;
        end;
        
OnClock0000:
		query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'rewards'");
		addrid(0);
		rewards = 0;
	end;

}

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...