Jump to content
  • 0

Hourly Reward


Bringer

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  745
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

Spoiler

// https://rathena.org/board/topic/110719-hourly-vending-timer-stop/#comment-324042

-	script	hourly_point_main	-1,{
    
	OnInit:
		.duration = 3600;
		.vip_multi = 2;
		.npc_name$ = strnpcinfo(3);
		//.delay   = 1000;       //Delay for idle re-check check. ( Default: 1000 [ = 1 Second ] )
		//.idle    = 60*1;       //Player is idle after not moving for this many seconds. ( Default: 60*5 [ = 5 Minutes ] )    
		set .point_amt, 1; //Normal points gained.
		bindatcmd "reward",    .npc_name$ + "::OnCheck";
		end;

	OnUpdate:
		//Check for idle.
		if (@hourly_point_stopped || checkvending() >= 1) {
			@hourly_point_stopped = 1;
			dispbottom "The hourly points event stopped because you were vending, chatting, or idle!";
			end;
		}
		set #HourlyPoints, #HourlyPoints + .point_amt * 1 * ( vip_status(1) ? .vip_multi : 1 );
		dispbottom "You received "+.point_amt+" Reward Hourly Points by staying ingame for 1 hour";
		dispbottom "Current Balance = "+#HourlyPoints+" Reward Hourly Points";
		set @consecutive_hour, @consecutive_hour + 1;

		@timer = gettimetick(2) + .duration;
		addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		end;
       
	OnPCLoginEvent:
		@timer = gettimetick(2) + .duration;
		addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
		dispbottom "Hourly Rewards have been started for this character.";
		end;

	OnPCLogoutEvent:
		@timer = gettimetick(2) + .duration;
		end;

	OnCheck:
		.@min = (@timer - gettimetick(2))/60;
		.@sec = (@timer - gettimetick(2))%60;
		dispbottom "Remaining Online Time:",0x9ae2d7;
		dispbottom "====================================",0x9ae2d7;
		dispbottom "Reward Hourly Points : [ "+#HourlyPoints+" ]",0x9ae2d7;
			if ( @hourly_point_stopped ) {
				dispbottom "The hourly points event stopped because you were previously vending, chatting, or idle!";
			}
			else {
				dispbottom "Hourly Reward : " +
					((.@min)?            "" + .@min + " minute"         + ((.@min > 1)?"s":""):"") +
					((.@min && .@sec)?    " and ":"") +
					((.@sec)?            "" + .@sec + " second"    + ((.@sec > 1)?"s":""):"") +
					"",0x9ae2d7;
				dispbottom "====================================",0x9ae2d7;
			}
		end;            
	}

 

can anyone help this Mod script

  1. Timer Account Base  [ if player change Char Timer still continue ]
  2. Even They logout timer will remain or gettimetick save
Edited by Bringer
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

×
×
  • Create New...