Stolao

Stolao's Daily Login Reward [v2.0B]

Recommended Posts

Yea, change them to something else

Share this post


Link to post
Share on other sites

Okay, wow, I feel a bit like a dummy. Those items were custom added, I'm sorry. Something someone customized and never got fixed on my end. Thanks for your help!

Share this post


Link to post
Share on other sites

I have try this script.

and i want to ask, how to make a prize start from day 1 again after player can finish all daily reward.

 

example :

i set 

 

day 1 : get jellopy

day 2 : get oridecon

day 3 : get white pot

day 4 : get honey

day 5 : get 1M zeny

 

after day 5 , player get jellopy again or stop can't, claim again before i'm set the prize again??

Share this post


Link to post
Share on other sites

to have it reset after last day, you would simply add a comparison to days logged to getarraysize if == then reset back to 0

 

 

to have it stop counting basically the same thing just instead of setting to 0 don't add more

 

try scripting it yourself if you cant get it i can do for you (learn from trying 1st~)

Share this post


Link to post
Share on other sites

Heloo and I fix this error and set 31 days and can not go to increase day or something ?? I get this

 

[Warning]: script:getelementofarray: index out of range (-1)

[Debug]: Data: variable name='.Rewards$' index=0
[Debug]: Source (NPC): LOGIN (invisible/not on a map)

Share this post


Link to post
Share on other sites

Heloo and I fix this error and set 31 days and can not go to increase day or something ?? I get this

[Warning]: script:getelementofarray: index out of range (-1)

[Debug]: Data: variable name='.Rewards$' index=0

[Debug]: Source (NPC): LOGIN (invisible/not on a map)

Link your conf

Share this post


Link to post
Share on other sites

First off use code box 2nd I fixed this in 1.5E

Your using 1.59 so update :)

Share this post


Link to post
Share on other sites

hi , stolao , I added the minimum level to get the reward , could you check my script , it runs fine when I try , but I'm not sure : D

sorry I am not a scripter

//===== EinherjarRO Scripts ================================== 
//= Daily Prize, OnPCLoginEvent
//===== By: ================================================== 
//= Stolao
//===== Current Version: ===================================== 
//= 1.59
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= A reward system for players who play more frequently
//===== Comments: ============================================
//= Maybe Make .MinWait an array mins,days,weeks,months,years;
//===== Additional Comments: =================================
//= For Older See Forums
//= 1.51 Changed set [email protected] formula and move lower into script
//= 1.52 Replace all disbottom -> message
//= 1.53 Changed Format to Include minuets instead of just hours
//= 1.54 Made Time till next rewards display dynamic
//= 1.55 Changed a forgotten  .PointType$ -> getd([email protected][1])
//= 1.56 changed [email protected] -> [email protected]$
//= 1.57 Added Atoi where nessisary
//= 1.58 Fixed a swapped [email protected] and [email protected]+1
//= 1.59 Serveral Edit Undocumented to fix
//===== Contact Info: ========================================
//= [Stolao] 
//= Email: [email protected]<script data-cfhash='f9e31' type="text/javascript">
/*  */</script>
//============================================================
-	script	LOGIN	-1,{
OnWhisperGlobal:
OnLoginCmnd:
OnPCLoginEvent:
	sleep2 1000 + .Rest * 60000;
	set [email protected], (gettime(7) * 365 * 24 * 60) + (gettime(8) * 24 * 60) + (gettime(3) * 60) +gettime(2);
	if (BaseLevel >= 165){
		if([email protected] >= (#LastDailyReward + .MinWait)){
		if([email protected] < #LastDailyReward + .MaxWait){	set #DRewardCon, #DRewardCon + 1;
		} else {	set #DRewardCon, 1;	}
		set [email protected], (#DRewardCon > getarraysize(.Rewards$)) ? (getarraysize(.Rewards$)-1) : #DRewardCon;
		explode([email protected]$,.Rewards$[[email protected]],"|");
		for(set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1){
			set [email protected][[email protected]], atoi([email protected]$[[email protected]]);
		}
		if(.Mode & 1 && [email protected][4]){	//[Note]: I need to figure out a checkweight for all items tired atm lol, for now ill leave it missing
			for(set [email protected],4; [email protected] < getarraysize([email protected]); set [email protected],[email protected] + 2){	getitem  [email protected][[email protected]], [email protected][[email protected]+1];	message strcharinfo(0),"Recived "+  [email protected][[email protected]+1] +" "+ getitemname([email protected][[email protected]]);	}
		}
		if(.Mode & 2){
			if([email protected][0]){	set zeny,zeny + [email protected][0];	message strcharinfo(0),"Recived "+ [email protected][0] +"z";	}
			if([email protected][1]){	setd getd(.Points$[0]),getd(.Points$[0]) + [email protected][1];	message strcharinfo(0),"Recived "+ [email protected][1] +" "+.Points$[1];	}
		}
		if(.Mode & 4 && ([email protected][3] || [email protected][4])) getexp [email protected][3], [email protected][4];
		if(.Mode & 8){
			for(set [email protected],0; [email protected] < getarraysize(.BuffInfo); set [email protected],[email protected] + 4){
				if(#DRewardCon % .BuffInfo[[email protected] + 1] == 0)
					sc_start .BuffInfo[[email protected]], .BuffInfo[[email protected] + 2] * 60000, .BuffInfo[[email protected] + 3];
			}
		}
		message strcharinfo(0),"You have collected your daily reward, for "+#DRewardCon+" day"+((#DRewardCon > 1)?"s":"")+" in a row.";
		set #LastDailyReward, [email protected];
	} else {
		set [email protected],(#LastDailyReward + .MinWait - [email protected])/60/24;
		set [email protected],((#LastDailyReward + .MinWait - [email protected])/60)%24;
		set [email protected],(#LastDailyReward + .MinWait - [email protected])%60;
		message strcharinfo(0),"You have "+ (([email protected]) ? [email protected] +":Days " : "") +""+ (([email protected]) ? [email protected] +":Hours " : "") +""+ (([email protected]) ? [email protected] +":Minutes " : "") +"till your next reward";
	}
	}
end;
OnInit:
	//Basic Settings
	//   1: Item | 2: Points | 4: Exp  
	//   8: Gain Buffs Every X Consecutive Days logged in
	// (a bit value, e.g. 3 = Items & Points from Multi)
	set .Mode,1 + 2 + 4 + 8;

	//To Enable @ Command '@loginreward' unslash next lines
	// * Needs extra commands for typos
	bindatcmd("relog"	,"LOGIN::OnLoginCmnd",0,99);

	//Minimum Minuets Between Collecting Daily Reward
	//   Day: 22*60 - 24*60
	//   Week: 10080
	set .MinWait,1320;

	//Minuets Before Lose Consecutive Daily Reward
	//   Day: 48*60 - 50*60
	//   Week: 20160
	set .MaxWait,3000;

	//Number of mins after logging before collecting prize
	set .Rest,0;

	//Point Type
	//   [0] Points earned
	//   [1] Point name in mes
	setarray .Points$,"#KAFRAPOINTS","K-Points";

	// Consecutive Days Buff
	// Each buff contains 4 variables (32 Total Max)
	// <Type>,<Days>,<Duration>,<Rate>, // Buff 1
	// <Type>,<Days>,<Duration>,<Rate>, // Buff 2
	//   ...;
	//
	//  Example: 188,7,45,3
	//    -Every 7th consecutive day logged in Player gains +3 Str for 45 mins
	//
	//  Type is 188, which references which SC_ to use, SC_INCSTR in this example
	//     -For a full list of SC_ visit the db/const.txt
	//  Days is days buff is applied, in this example 7, so every 7th day, 14,21,28....
	//  Duration is buff duration is Minuits, in this example 45 mins
	//  Rate is buff strength, in this example player gains 3 Str
	setarray .BuffInfo	,260,2,360,1	// Life Insurance for 360 Mins Every 2nd Day
				,198,3,120,10	// +10% Hp for 120 Mins Every 3th Day
				,196,5,120,25	// +25 Flee for 120 Mins Every 5th Day
				,257,7,240,50;	// +50% Exp for 240 Mins Every 7th Day

	// Daily Prize items (max 128 days):
	//   "<Zeny>|<Points>|<BaseExp>|<JobExp>|<itemID-1>|<amount-1>|<itemID-2>|<amount-2>...etc", // Day 1
	//   "<Zeny>|<Points>|<BaseExp>|<JobExp>|<itemID-1>|<amount-1>|<itemID-2>|<amount-2>...etc"  // Day 2
	//   ...;
	// Total length of any days string must be 255 or shorter
	// * If players login longer than the last set
	//   day, they will keep getting the last prize.
	setarray .Rewards$,
		"100",					// Day 1: 100 Zeny
		"0|0|0|0|501|5",			// Day 2: 5 Red Potion
		"0|0|0|0|503|5|506|5",			// Day 3: 5 White Potion + 5 Green Potion
		"0|0|0|0|7539|2|12103|100";		//


end;
}

Share this post


Link to post
Share on other sites

Just after

OnPCLoginEvent:
Add

If(baselevel < 99) end;
Just edit 99 to level of choice

hi , stolao , I added the minimum level to get the reward , could you check my script , it runs fine when I try , but I'm not sure : D

sorry I am not a scripter

//===== EinherjarRO Scripts ================================== 
//= Daily Prize, OnPCLoginEvent
//===== By: ================================================== 
//= Stolao
//===== Current Version: ===================================== 
//= 1.59
//===== Compatible With: ===================================== 
//= rAthena SVN
//===== Description: ========================================= 
//= A reward system for players who play more frequently
//===== Comments: ============================================
//= Maybe Make .MinWait an array mins,days,weeks,months,years;
//===== Additional Comments: =================================
//= For Older See Forums
//= 1.51 Changed set [email protected] formula and move lower into script
//= 1.52 Replace all disbottom -> message
//= 1.53 Changed Format to Include minuets instead of just hours
//= 1.54 Made Time till next rewards display dynamic
//= 1.55 Changed a forgotten  .PointType$ -> getd([email protected][1])
//= 1.56 changed [email protected] -> [email protected]$
//= 1.57 Added Atoi where nessisary
//= 1.58 Fixed a swapped [email protected] and [email protected]+1
//= 1.59 Serveral Edit Undocumented to fix
//===== Contact Info: ========================================
//= [Stolao] 
//= Email: [email protected]<script data-cfhash='f9e31' type="text/javascript">
/*  */</script>
//============================================================
-	script	LOGIN	-1,{
OnWhisperGlobal:
OnLoginCmnd:
OnPCLoginEvent:
	sleep2 1000 + .Rest * 60000;
	set [email protected], (gettime(7) * 365 * 24 * 60) + (gettime(8) * 24 * 60) + (gettime(3) * 60) +gettime(2);
	if (BaseLevel >= 165){
		if([email protected] >= (#LastDailyReward + .MinWait)){
		if([email protected] < #LastDailyReward + .MaxWait){	set #DRewardCon, #DRewardCon + 1;
		} else {	set #DRewardCon, 1;	}
		set [email protected], (#DRewardCon > getarraysize(.Rewards$)) ? (getarraysize(.Rewards$)-1) : #DRewardCon;
		explode([email protected]$,.Rewards$[[email protected]],"|");
		for(set [email protected],0; [email protected] < getarraysize([email protected]$); set [email protected],[email protected] + 1){
			set [email protected][[email protected]], atoi([email protected]$[[email protected]]);
		}
		if(.Mode & 1 && [email protected][4]){	//[Note]: I need to figure out a checkweight for all items tired atm lol, for now ill leave it missing
			for(set [email protected],4; [email protected] < getarraysize([email protected]); set [email protected],[email protected] + 2){	getitem  [email protected][[email protected]], [email protected][[email protected]+1];	message strcharinfo(0),"Recived "+  [email protected][[email protected]+1] +" "+ getitemname([email protected][[email protected]]);	}
		}
		if(.Mode & 2){
			if([email protected][0]){	set zeny,zeny + [email protected][0];	message strcharinfo(0),"Recived "+ [email protected][0] +"z";	}
			if([email protected][1]){	setd getd(.Points$[0]),getd(.Points$[0]) + [email protected][1];	message strcharinfo(0),"Recived "+ [email protected][1] +" "+.Points$[1];	}
		}
		if(.Mode & 4 && ([email protected][3] || [email protected][4])) getexp [email protected][3], [email protected][4];
		if(.Mode & 8){
			for(set [email protected],0; [email protected] < getarraysize(.BuffInfo); set [email protected],[email protected] + 4){
				if(#DRewardCon % .BuffInfo[[email protected] + 1] == 0)
					sc_start .BuffInfo[[email protected]], .BuffInfo[[email protected] + 2] * 60000, .BuffInfo[[email protected] + 3];
			}
		}
		message strcharinfo(0),"You have collected your daily reward, for "+#DRewardCon+" day"+((#DRewardCon > 1)?"s":"")+" in a row.";
		set #LastDailyReward, [email protected];
	} else {
		set [email protected],(#LastDailyReward + .MinWait - [email protected])/60/24;
		set [email protected],((#LastDailyReward + .MinWait - [email protected])/60)%24;
		set [email protected],(#LastDailyReward + .MinWait - [email protected])%60;
		message strcharinfo(0),"You have "+ (([email protected]) ? [email protected] +":Days " : "") +""+ (([email protected]) ? [email protected] +":Hours " : "") +""+ (([email protected]) ? [email protected] +":Minutes " : "") +"till your next reward";
	}
	}
end;
OnInit:
	//Basic Settings
	//   1: Item | 2: Points | 4: Exp  
	//   8: Gain Buffs Every X Consecutive Days logged in
	// (a bit value, e.g. 3 = Items & Points from Multi)
	set .Mode,1 + 2 + 4 + 8;

	//To Enable @ Command '@loginreward' unslash next lines
	// * Needs extra commands for typos
	bindatcmd("relog"	,"LOGIN::OnLoginCmnd",0,99);

	//Minimum Minuets Between Collecting Daily Reward
	//   Day: 22*60 - 24*60
	//   Week: 10080
	set .MinWait,1320;

	//Minuets Before Lose Consecutive Daily Reward
	//   Day: 48*60 - 50*60
	//   Week: 20160
	set .MaxWait,3000;

	//Number of mins after logging before collecting prize
	set .Rest,0;

	//Point Type
	//   [0] Points earned
	//   [1] Point name in mes
	setarray .Points$,"#KAFRAPOINTS","K-Points";

	// Consecutive Days Buff
	// Each buff contains 4 variables (32 Total Max)
	// <Type>,<Days>,<Duration>,<Rate>, // Buff 1
	// <Type>,<Days>,<Duration>,<Rate>, // Buff 2
	//   ...;
	//
	//  Example: 188,7,45,3
	//    -Every 7th consecutive day logged in Player gains +3 Str for 45 mins
	//
	//  Type is 188, which references which SC_ to use, SC_INCSTR in this example
	//     -For a full list of SC_ visit the db/const.txt
	//  Days is days buff is applied, in this example 7, so every 7th day, 14,21,28....
	//  Duration is buff duration is Minuits, in this example 45 mins
	//  Rate is buff strength, in this example player gains 3 Str
	setarray .BuffInfo	,260,2,360,1	// Life Insurance for 360 Mins Every 2nd Day
				,198,3,120,10	// +10% Hp for 120 Mins Every 3th Day
				,196,5,120,25	// +25 Flee for 120 Mins Every 5th Day
				,257,7,240,50;	// +50% Exp for 240 Mins Every 7th Day

	// Daily Prize items (max 128 days):
	//   "<Zeny>|<Points>|<BaseExp>|<JobExp>|<itemID-1>|<amount-1>|<itemID-2>|<amount-2>...etc", // Day 1
	//   "<Zeny>|<Points>|<BaseExp>|<JobExp>|<itemID-1>|<amount-1>|<itemID-2>|<amount-2>...etc"  // Day 2
	//   ...;
	// Total length of any days string must be 255 or shorter
	// * If players login longer than the last set
	//   day, they will keep getting the last prize.
	setarray .Rewards$,
		"100",					// Day 1: 100 Zeny
		"0|0|0|0|501|5",			// Day 2: 5 Red Potion
		"0|0|0|0|503|5|506|5",			// Day 3: 5 White Potion + 5 Green Potion
		"0|0|0|0|7539|2|12103|100";		//


end;
}

Share this post


Link to post
Share on other sites

I have try this script.

and i want to ask, how to make a prize start from day 1 again after player can finish all daily reward.

 

example :

i set 

 

day 1 : get jellopy

day 2 : get oridecon

day 3 : get white pot

day 4 : get honey

day 5 : get 1M zeny

 

after day 5 , player get jellopy again or stop can't, claim again before i'm set the prize again??

 

 

to have it reset after last day, you would simply add a comparison to days logged to getarraysize if == then reset back to 0

 

 

to have it stop counting basically the same thing just instead of setting to 0 don't add more

 

try scripting it yourself if you cant get it i can do for you (learn from trying 1st~)

 

Can you do a reset after the last day, as mentioned privateserver ? thank you

Share this post


Link to post
Share on other sites

Hi there, can make some suggestion?

Every time we make some reload or start the emu the npc recognized the dy like the first day then it give you that reward can you add a variable that recognize the day of the mont?

By the way a count of this variable if the player has the 31 days recieved the reward give new price and then recet the variable.

Other thing is that the script give every hour, what if someone wants to give a price just for 1 hour played?

If a player relogs the count starts again and recieve another reward sorry if i say to much things xP im trying add it by myself but i get confused if i apply variable the next day will not receive then must add variable for every day, and how to check if they are playing and not vending or afk, to many questions! Jjaja sorry if im bothering you to much!!

Edited by Namine210

Share this post


Link to post
Share on other sites

Update Daily Rewards

1.5D -> 1.5F

Share this post


Link to post
Share on other sites

I'm using it in hercules, when I create a char a try to log,  it gives me the 2nd day prize. Why is that? thanks for this script!

Share this post


Link to post
Share on other sites

I'm using it in hercules, when I create a char a try to log,  it gives me the 2nd day prize. Why is that? thanks for this script!

 what version of script are you using (numbers don't say latest) im 99% sure i fixed this bug already

Share this post


Link to post
Share on other sites

 

I'm using it in hercules, when I create a char a try to log,  it gives me the 2nd day prize. Why is that? thanks for this script!

 what version of script are you using (numbers don't say latest) im 99% sure i fixed this bug already

 

I'm using the 1.59 version in the first link. Thanks for this!

Share this post


Link to post
Share on other sites

is there IP check option yet?

Nope but simple enough to make it account bound.

Share this post


Link to post
Share on other sites

 

is there IP check option yet?

Nope but simple enough to make it account bound.

 

Please show me how ^^ thanks

Share this post


Link to post
Share on other sites

 

 

is there IP check option yet?

Nope but simple enough to make it account bound.

 

Please show me how ^^ thanks

 

 

 

change out

*getitem <item id>,<amount>{,<account ID>};
*getitem "<item name>",<amount>{,<account ID>};


This command will give an amount of specified items to the invoking character. 
If an optional account ID is specified, and the target character is currently 
online, items will be created in their inventory instead. If they are not 
online, nothing will happen.


In the first and most commonly used version of this command, items are 
referred to by their database ID number found inside 'db/(pre-)re/item_db.txt'.


    getitem 502,10 // The person will receive 10 apples
    getitem 617,1  // The person will receive 1 Old Violet Box


This transaction is logged if the log script generated transactions option is 
enabled.


You may also create an item by its name in the 'english name' field in the 
item database:


    getitem "RED_POTION",10;


Which will do what you'd expect. If it can't find that name in the database, 
apples will be created anyway. It is often a VERY GOOD IDEA to use it like this.


This is used in pretty much all NPC scripts that have to do with items and 
quite a few item scripts. For more examples check just about any official script.

for

*getitembound <item id>,<amount>,<bound type>{,<account ID>};
*getitembound "<item name>",<amount>,<bound type>{,<account ID>};

This command behaves identically to 'getitem', but the items created will be
bound to the target character as specified by the bound type. All items created
in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
some cases cannot be traded or stored.

Valid bound types are:
Bound_Account : Account Bound item
Bound_Guild : Guild Bound item
Bound_Party : Party Bound item
Bound_Char : Character Bound item

Share this post


Link to post
Share on other sites

 

 

 

is there IP check option yet?

Nope but simple enough to make it account bound.

 

Please show me how ^^ thanks

 

 

 

change out

*getitem <item id>,<amount>{,<account ID>};
*getitem "<item name>",<amount>{,<account ID>};


This command will give an amount of specified items to the invoking character. 
If an optional account ID is specified, and the target character is currently 
online, items will be created in their inventory instead. If they are not 
online, nothing will happen.


In the first and most commonly used version of this command, items are 
referred to by their database ID number found inside 'db/(pre-)re/item_db.txt'.


    getitem 502,10 // The person will receive 10 apples
    getitem 617,1  // The person will receive 1 Old Violet Box


This transaction is logged if the log script generated transactions option is 
enabled.


You may also create an item by its name in the 'english name' field in the 
item database:


    getitem "RED_POTION",10;


Which will do what you'd expect. If it can't find that name in the database, 
apples will be created anyway. It is often a VERY GOOD IDEA to use it like this.


This is used in pretty much all NPC scripts that have to do with items and 
quite a few item scripts. For more examples check just about any official script.

for

*getitembound <item id>,<amount>,<bound type>{,<account ID>};
*getitembound "<item name>",<amount>,<bound type>{,<account ID>};

This command behaves identically to 'getitem', but the items created will be
bound to the target character as specified by the bound type. All items created
in this manner cannot be dropped, sold, vended, auctioned, or mailed, and in
some cases cannot be traded or stored.

Valid bound types are:
Bound_Account : Account Bound item
Bound_Guild : Guild Bound item
Bound_Party : Party Bound item
Bound_Char : Character Bound item

you'r the best ^^

Share this post


Link to post
Share on other sites

I got this prompt on the latest revision of daily reward, seems function insert plural is not on the file.3_zpsy3g8o24n.png

Share this post


Link to post
Share on other sites

I got this prompt on the latest revision of daily reward, seems function insert plural is not on the file.3_zpsy3g8o24n.png

 

Your Emulator is from RagEmu. that's why you get that errors on your map-console.

you have to add your self the F_InsertPlural from rAthena and reload the function.

Share this post


Link to post
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
Reply to this topic...

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

Loading...