Jump to content
  • 0
Strand

Event that occurs randomly twice a day

Question

Good day! I'm creating one of my events (Floating Rates) to occur two times a day at random times. I've been thinking about using OnClock or OnMinute but I can't figure out exactly how. Does anyone could help me? 

//===== rAthena Script =======================================
//= Floating Server Rates
//===== By: ==================================================
//= Lupus
//===== Current Version: =====================================
//= 1.0
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= It's a simply example of setbattleflag
//= This script will change your server rates from 1x to 1.5x every 6 hours
//= Note: It doesn't affect Card granted drops, MVP & Treasure Chests drops ^_-
//=       It also doesn't affect CARD drops, because they are just 0.01%
//===== Additional Comments: =================================
//= You can make incredible scripts with 'setbattleflag'!
//============================================================

-	script	FloatingRates	-1,{
OnInit:
//add any other HOURS
OnHour00:
OnHour06:
OnHour12:
OnHour18:
//-------------------
	set [email protected],rand(100,150);
	set [email protected],rand(100,150);
	set [email protected],rand(100,150);
	//Base exp
	setbattleflag("base_exp_rate",[email protected]);
	//Job exp
	setbattleflag("job_exp_rate",[email protected]);
	//Drops
	setbattleflag("item_rate_common",[email protected]);
	setbattleflag("item_rate_heal",[email protected]);
	setbattleflag("item_rate_use",[email protected]);
	setbattleflag("item_rate_equip",[email protected],true); // Apply new rates to configs set above
	//we don't change card drops rate, because these values won't change them anyway
	
	announce "Current rates are: 1."+([email protected])+"x 1."+([email protected])+"x 1."+([email protected])+"x",bc_all,0xFF6060;
	end;
}

 

Edited by Strand
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
OnInit:
OnHour00:
	.rand_time_1 = rand(0, 11);
	.rand_time_2 = rand(12, 23);
	
OnMinute00:
	if (gettime(DT_HOUR) == .rand_time_1 || gettime(DT_HOUR) == .rand_time_2) {
		// scripts.
	}
	end;

 

Link to comment
Share on other sites

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

Important Information

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