Jump to content
  • 0

R>Floating EXP and Drop rate


bigwasanro

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  09/24/16
  • Last Seen:  

need help for floating Double Exp and Drop rate on the week ends friday saturday sunday thank you in advance

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Why so rude?
 
I'm using so many variables cause I thought it was better than repeating the setbattleflag / getbattleflag for each flag he wants do edit, but you're right there's no need for that.
 
EDIT--
Euraka! Now I remember why I needed to use so many variables... I can't get the original rates to reset the event on monday =/
 
I followed your instructions but correct me if I did something wrong.
// Author: Lupus
// Edited: _Okuz_
-	script	Weekend Floating Exp	-1,{

OnInit:
	// To force the event to run even if you have to shutdown your server for some reason...
	if (gettime(4) != 5 && gettime(4) != 6 && gettime(4) != 0) end;

OnFri0000:
	// start double rates on Friday 00:00
	setbattleflag "base_exp_rate", getbattleflag("base_exp_rate") * 2;
	setbattleflag "job_exp_rate", getbattleflag("job_exp_rate") * 2;
	setbattleflag "item_rate_heal", getbattleflag("item_rate_heal") * 2;
	setbattleflag "item_rate_use", getbattleflag("item_rate_use") * 2;
	setbattleflag "item_rate_equip", getbattleflag("item_rate_equip") * 2;
	setbattleflag "item_rate_card", getbattleflag("item_rate_card") * 2;
	setbattleflag "item_rate_mvp", getbattleflag("item_rate_mvp") * 2;
	setbattleflag "item_rate_adddrop", getbattleflag("item_rate_adddrop") * 2;
	setbattleflag "item_rate_treasure", getbattleflag("item_rate_treasure") * 2;
	atcommand "@reloadmobdb";
	announce "[Event] : Double rates enabled!",bc_all,0xFF6060;
	end;

OnMon0000:
	// stop double rates on Monday 00:00
	setbattleflag "base_exp_rate", getbattleflag("base_exp_rate");
	setbattleflag "job_exp_rate", getbattleflag("job_exp_rate");
	setbattleflag "item_rate_heal", getbattleflag("item_rate_heal");
	setbattleflag "item_rate_use", getbattleflag("item_rate_use");
	setbattleflag "item_rate_equip", getbattleflag("item_rate_equip");
	setbattleflag "item_rate_card", getbattleflag("item_rate_card");
	setbattleflag "item_rate_mvp", getbattleflag("item_rate_mvp");
	setbattleflag "item_rate_adddrop", getbattleflag("item_rate_adddrop");
	setbattleflag "item_rate_treasure", getbattleflag("item_rate_treasure");
	atcommand "@reloadmobdb";
	announce "[Event] : Double rates disabled!",bc_all,0xFF6060;
	end;
}

Test results:
http://imgur.com/a/lyLI5

Edited by _Okuz_
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

Hey, whats up!?

Here is your request:

// Author: _Okuz_
// Version: 1.0.2 - 20:40 14/10/2016
-	script	Weekend Floating Exp	-1,{

OnInit:
	// Setup the rates you want to double here...
	setarray .server_conf$[0], "base_exp_rate", getbattleflag("base_exp_rate"), 
				   "job_exp_rate", getbattleflag("job_exp_rate"), 
				   "item_rate_common", getbattleflag("item_rate_common"),
				   "item_rate_heal", getbattleflag("item_rate_heal"), 
				   "item_rate_use", getbattleflag("item_rate_use"), 
				   "item_rate_equip", getbattleflag("item_rate_equip"), 
				   "item_rate_card", getbattleflag("item_rate_card"),
 				   "item_rate_mvp", getbattleflag("item_rate_mvp"), 
				   "item_rate_adddrop", getbattleflag("item_rate_adddrop"), 
				   "item_rate_treasure", getbattleflag("item_rate_treasure");

	// To force the event to run even if you have to shutdown your server for some reason...
	if (gettime(4) != 5 && gettime(4) != 6 && gettime(4) != 0) end;

OnFri0000:
	// start double rates on Friday 00:00
	if (!.active)
		callsub(S_changeRates, 2);
	end;

OnMon0000:
	// stop double rates on Monday 00:00
	callsub(S_changeRates, 1); end;

// Arg(0): mult
S_changeRates:
	set .@size, getarraysize(.server_conf$);
	for (set .@i, 0; .@i < .@size; set .@i, .@i + 2) {
		setbattleflag .server_conf$[.@i], atoi(.server_conf$[.@i + 1]) * getarg(0);
	}
	set .active, !.active;
	atcommand "@reloadmobdb";
	announce "[Event] : Rates " + (.active ? "increased" : "restored") + "!",bc_all,0xFF6060;
	return;
}

EDIT--

Tested and working.

Edited by _Okuz_
  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  09/24/16
  • Last Seen:  

hey, what up bro

the script is not working 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

What do you mean by "is not working"? Did you get any error or something?

 


 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

There's a floating rates NPC script already in the rA repo:

https://github.com/rathena/rathena/blob/master/npc/custom/etc/floating_rates.txt

 

Just change the OnHour labels to something else:

OnClock<hour><minute>:
OnMinute<minute>:
OnHour<hour>:
On<weekday><hour><minute>:
OnDay<month><day>:

This will execute when the server clock hits the specified date or time. Hours 
and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays 
are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31. 
Remember the zero. :)

So You'd use OnFri0000: and then use OnMon0000: to set the specific rates back again.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  92
  • Reputation:   17
  • Joined:  08/11/12
  • Last Seen:  

There's a floating rates NPC script already in the rA repo:

https://github.com/rathena/rathena/blob/master/npc/custom/etc/floating_rates.txt

 

Just change the OnHour labels to something else:

OnClock<hour><minute>:
OnMinute<minute>:
OnHour<hour>:
On<weekday><hour><minute>:
OnDay<month><day>:

This will execute when the server clock hits the specified date or time. Hours 
and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays 
are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31. 
Remember the zero. 

So You'd use OnFri0000: and then use OnMon0000: to set the specific rates back again.

 
Hello Akkarin!

He wants to double the rates, so he needs to edit a little bit more than just the clock events.

 
And I have tested the script that I left before and guess what... it is working...

Thank you!

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

And I have tested the script that I left before and guess what... it is working...

I have no doubt that it works, i'm just baffled by the unnecessary use of an array and so many variables where a very simple script would do the same job. I see no valid reason to reinvent the wheel when there's a perfectly good wheel in the repo that can be tweaked to requirements, that's all.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  104
  • Reputation:   15
  • Joined:  01/18/16
  • Last Seen:  

Hey, whats up!?

Here is your request:

// Author: _Okuz_
// Version: 1.0.2 - 20:40 14/10/2016
-	script	Weekend Floating Exp	-1,{

OnInit:
	// Setup the rates you want to double here...
	setarray .server_conf$[0], "base_exp_rate", getbattleflag("base_exp_rate"), 
				   "job_exp_rate", getbattleflag("job_exp_rate"), 
				   "item_rate_common", getbattleflag("item_rate_common"),
				   "item_rate_heal", getbattleflag("item_rate_heal"), 
				   "item_rate_use", getbattleflag("item_rate_use"), 
				   "item_rate_equip", getbattleflag("item_rate_equip"), 
				   "item_rate_card", getbattleflag("item_rate_card"),
 				   "item_rate_mvp", getbattleflag("item_rate_mvp"), 
				   "item_rate_adddrop", getbattleflag("item_rate_adddrop"), 
				   "item_rate_treasure", getbattleflag("item_rate_treasure");

	// To force the event to run even if you have to shutdown your server for some reason...
	if (gettime(4) != 5 && gettime(4) != 6 && gettime(4) != 0) end;

OnFri0000:
	// start double rates on Friday 00:00
	if (!.active)
		callsub(S_changeRates, 2);
	end;

OnMon0000:
	// stop double rates on Monday 00:00
	callsub(S_changeRates, 1); end;

// Arg(0): mult
S_changeRates:
	set .@size, getarraysize(.server_conf$);
	for (set .@i, 0; .@i < .@size; set .@i, .@i + 2) {
		setbattleflag .server_conf$[.@i], atoi(.server_conf$[.@i + 1]) * getarg(0);
	}
	set .active, !.active;
	atcommand "@reloadmobdb";
	announce "[Event] : Rates " + (.active ? "increased" : "restored") + "!",bc_all,0xFF6060;
	return;
}

EDIT--

Tested and working.

thank you, works fine here.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  10
  • Reputation:   0
  • Joined:  09/24/16
  • Last Seen:  

thank you so much you are the best  _okuz_  /thx

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  03/11/12
  • Last Seen:  

How to set everyday 9am to 11am floating rate

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1614
  • Joined:  03/26/12
  • Last Seen:  

Use the OnClock or OnHour labels.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  77
  • Reputation:   1
  • Joined:  03/11/12
  • Last Seen:  

13 hours ago, Akkarin said:

Use the OnClock or OnHour labels.

Thank you sir

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  07/25/20
  • Last Seen:  

On 10/12/2016 at 3:59 AM, _Okuz_ said:

Hey, whats up!?

Here is your request:


// Author: _Okuz_
// Version: 1.0.2 - 20:40 14/10/2016
-	script	Weekend Floating Exp	-1,{

OnInit:
	// Setup the rates you want to double here...
	setarray .server_conf$[0], "base_exp_rate", getbattleflag("base_exp_rate"), 
				   "job_exp_rate", getbattleflag("job_exp_rate"), 
				   "item_rate_common", getbattleflag("item_rate_common"),
				   "item_rate_heal", getbattleflag("item_rate_heal"), 
				   "item_rate_use", getbattleflag("item_rate_use"), 
				   "item_rate_equip", getbattleflag("item_rate_equip"), 
				   "item_rate_card", getbattleflag("item_rate_card"),
 				   "item_rate_mvp", getbattleflag("item_rate_mvp"), 
				   "item_rate_adddrop", getbattleflag("item_rate_adddrop"), 
				   "item_rate_treasure", getbattleflag("item_rate_treasure");

	// To force the event to run even if you have to shutdown your server for some reason...
	if (gettime(4) != 5 && gettime(4) != 6 && gettime(4) != 0) end;

OnFri0000:
	// start double rates on Friday 00:00
	if (!.active)
		callsub(S_changeRates, 2);
	end;

OnMon0000:
	// stop double rates on Monday 00:00
	callsub(S_changeRates, 1); end;

// Arg(0): mult
S_changeRates:
	set .@size, getarraysize(.server_conf$);
	for (set .@i, 0; .@i < .@size; set .@i, .@i + 2) {
		setbattleflag .server_conf$[.@i], atoi(.server_conf$[.@i + 1]) * getarg(0);
	}
	set .active, !.active;
	atcommand "@reloadmobdb";
	announce "[Event] : Rates " + (.active ? "increased" : "restored") + "!",bc_all,0xFF6060;
	return;
}

EDIT--

Tested and working.

Hello sir @_Okuz_, I want to only modify the rates to plus 30% but when I enter 1.3 it does give me an error. Can you help me please?

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