Jump to content
  • 0

R>Floating EXP and Drop rate


Question

13 answers to this question

Recommended Posts

  • 0
Posted (edited)
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
  • 0
Posted (edited)

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
  • 0
Posted

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.

  • 0
Posted

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
  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted
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?

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