Jump to content

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


Stolao

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

  • It's impractical to force users to type in 127 reward IDs. I suggest something more like this:
    	// Daily Prize items (max 64 days):
    //   <itemID>,<amount>, // Day 1
    //   <itemID>,<amount>, // Day 2
    //   ...;
    // * If players login longer than the last set
    //   day, they will keep getting the last prize.
    setarray .Rewards[0],
    	512,1,	// Day 1
    	513,2,	// Day 2
    	514,3;	// Day 3
    


  • I really don't understand .Reminder[1] at all. I think you should remove it.
    	// What does this even do?
    if( ( LOGINCOUNT + #LOGINCOUNT + $LOGINCOUNT )%.Reminder[1] == 0 ...


  • .Wipe -- This is really not a good feature how it's currently written. Perhaps allow whispering "wipe" execute an SQL query to delete the values, or just let users do it manually.
    OnWhisperGlobal:
    if (getgmlevel() >= 99 && @whispervar0$ == "wipe") {
    	query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'LOGINCOUNT'");
    	query_sql("DELETE FROM `global_reg_value` WHERE `str` = '#LOGINCOUNT'");
    	query_sql("DELETE FROM `mapreg` WHERE `str` = '$LOGINCOUNT'");
    	dispbottom "Cleared all login count data.";
    }
    end;


  • Your config section is a little confusing, could be formatted better, and needs spell check. Example of an easier-to-read format:
    // -----------------------------------------------------------
    //  Login Count & Welcome Message
    // -----------------------------------------------------------
    
    // Login types to track.
    // 1: Character | 2: Account | 4: Server
    // (a bit value, e.g. 5 = character + server)
    set .LogCount,0;
    
    // Number of logins to display welcome message.
    set .Reminder,3;
    
    // Server name to display.
    set .Servername$,"Server";
    
    // Login message
    set .Message$,"Before playing, make sure you've read the rules, located in our forum at ^0000FF~TBA~^000000";
    


  • Tab properly. In particular, 'else' should always be in-line with 'if'.
  • You don't need to include empty strings in script lines.
    setd ""+.PointType$+"" --> setd .PointType$


  • Upvote 1
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Thank you very much Euphy ill get right on updating

as for Reminder[1], if the server, account and character login combined are equal to a multiple of Reminder[1] it will message the player with a .Message$ again, kinda pointless but i figured I'd add another option

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


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Update v1.17

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  353
  • Reputation:   70
  • Joined:  07/14/12
  • Last Seen:  

KEWL thx for this :D

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Update, again 1.19 realized had no checkweight in script, added and fixed a small typo

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

query_sql("DELETE FROM `mapreg` WHERE `str` = '$LOGINCOUNT'");

[sql]: DB error - Unknown column 'str' in 'where clause'
[Debug]: at d:\eathena\rathena sql 16819\src\map\script.c:14509 - DELETE FROM `m
apreg` WHERE `str` = '$LOGINCOUNT'
[Debug]: Source (NPC): LOGIN (invisible/not on a map)

you didn't even test this, I doubt it

and all query_sql executing like this probably not going to work out for online players

perhaps using attachrid on all accounts method for online players

and for mapreg, do set $LOGINCOUNT, 0;


[Error]: buildin_checkweight: Invalid item '0'.
[Debug]: Source (NPC): LOGIN (invisible/not on a map)

			if(#DRewardCon*2 > getarraysize(.Rewards)){ 
			set .@p,.Reward[getarraysize(.Reward)-1]; 
			set .@q,.Reward[getarraysize(.Reward)];
			} else { 
			set .@p,.Reward[#DRewardCon*2]; 
			set .@q,.Reward[#DRewardCon*2+1]; 
		}
		if(.@p && !checkweight(.@p,.@q)){
			dispbottom "You cant carry your daily reward, put some items away and log in again";

if #DRewardCon is less than getarraysize(.Rewards), .@p is not set

wrong logic also

hmm, but nice try though

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

name='AnnieRuru' timestamp='1359649420' post='176306']

query_sql("DELETE FROM `mapreg` WHERE `str` = '$LOGINCOUNT'");

[sql]: DB error - Unknown column 'str' in 'where clause'
[Debug]: at d:\eathena\rathena sql 16819\src\map\script.c:14509 - DELETE FROM `m
apreg` WHERE `str` = '$LOGINCOUNT'
[Debug]: Source (NPC): LOGIN (invisible/not on a map)

you didn't even test this, I doubt it

and all query_sql executing like this probably not going to work out for online players

perhaps using attachrid on all accounts method for online players

and for mapreg, do set $LOGINCOUNT, 0;


[Error]: buildin_checkweight: Invalid item '0'.
[Debug]: Source (NPC): LOGIN (invisible/not on a map)

			if(#DRewardCon*2 > getarraysize(.Rewards)){
			set .@p,.Reward[getarraysize(.Reward)-1];
			set .@q,.Reward[getarraysize(.Reward)];
			} else {
			set .@p,.Reward[#DRewardCon*2];
			set .@q,.Reward[#DRewardCon*2+1];
		}
		if(.@p && !checkweight(.@p,.@q)){
			dispbottom "You cant carry your daily reward, put some items away and log in again";

if #DRewardCon is less than getarraysize(.Rewards), .@p is not set

wrong logic also

hmm, but nice try though

I believe Ive fix the logic issue with #DRewardCon is greater then getarraysize(.Rewards)

  if(#DRewardCon*2 >= getarraysize(.Rewards)){
set .@p,.Reward[getarraysize(.Reward)-2];
set .@q,.Reward[getarraysize(.Reward)-1];
} else {
set .@p,.Reward[#DRewardCon*2];
set .@q,.Reward[#DRewardCon*2+1];
  }

However Im having trouble with the online players info being removed, im obviously missing something with this code

OnWhisperGlobal:
if (getgmlevel() >= 99 && @whispervar0$ == "wipe") {
 query_sql("DELETE FROM `global_reg_value` WHERE `str` = 'LOGINCOUNT'");
 query_sql("DELETE FROM `global_reg_value` WHERE `str` = '#LOGINCOUNT'");
 set $LOGINCOUNT,0;
 set .@self, getcharid(3);
 set .@size, query_sql("select account_id from `char` where online = 1", .@aid);
 for(set .@i,0; .@i<.@size; set .@i,.@i+1) {
  if(attachrid(.@aid[.@i])){
set LOGINCOUNT,0;
set #LOGINCOUNT,0;
  }

 }
 attachrid(.@self);
 dispbottom "Cleared all login count data.";
}
end;

[/s]

solved

Edited by Stolao
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Updated 1.1C fixed issues AnnieRuru found

Updated 1.1F should have all bugs fixed

Edited by Stolao
Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   8
  • Joined:  12/27/11
  • Last Seen:  

Thank you for your release! Anyways I have a suggestion. How about letting the players whisper the said npc to let them know the remaining time for their next reward? or use a custom @command for checking the remaining time? 

Edited by arzzzae
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Thanks for suggestion.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   8
  • Joined:  12/27/11
  • Last Seen:  

Thanks for suggestion.

No problem man. I still have several suggestions in my mind, but I guess it will be a hassle for you.
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Thanks for suggestion.

No problem man. I still have several suggestions in my mind, but I guess it will be a hassle for you.
No please hassle me, I plan on working on Ragnarok stuff all weekend ( weds Thurs for me) and want something for my release.

Edit: typo lol

Edited by Stolao
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  03/10/13
  • Last Seen:  

it didn't work.. but no errors..
how to activate it?
sorry, I'm still noob here..

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

it didn't work.. but no errors..

how to activate it?

sorry, I'm still noob here..

 

please load the script bro

 

refer wiki how to add script :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  03/10/13
  • Last Seen:  

it didn't work.. but no errors..

how to activate it?

sorry, I'm still noob here..

 

please load the script bro

 

refer wiki how to add script :)

the script still same as 1.1F version..

already add that npc to scripts_custom but nothing happen...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  98
  • Topics Per Day:  0.02
  • Content Count:  1302
  • Reputation:   77
  • Joined:  12/04/12
  • Last Seen:  

try reload script. what exactly u want sir ? dont understand.

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

it didn't work.. but no errors..

how to activate it?

sorry, I'm still noob here..

make sure you have configured and installed correctly, if it still doesn't work with no debug message, post your config here for me.

 

sorry for slow response/updates irl has been bust

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  83
  • Reputation:   8
  • Joined:  12/27/11
  • Last Seen:  

Hi, I am using your latest script. 1.17 and lately, I am having problems.

 

Here is my errors with my console.

[Debug]: Function: set (2 parameters):
[Debug]: Data: variable name='.PointType$' index=0
[Debug]: Data: param name='Zeny' type=20
[Debug]: Source (NPC): LOGIN (invisible/not on a map)

 

And here is my config:

// -----------------------------------------------------------
//  Login Count & Welcome Message
// -----------------------------------------------------------

	// Login types to track.
	// 1: Character | 2: Account | 4: Server
	// (a bit value, e.g. 5 = character + server)
	set .LogCount,2;

	// Number of logins to display welcome message.
	set .Reminder,1;

	// Server name to display.
	set .Servername$,"Ragnarok Online";

	// Login message
	set .Message$,"Before playing, make sure you've read the rules.";

// -----------------------------------------------------------
//  Daily Reward
// -----------------------------------------------------------

	//Daily Prize
	//Toggle
	//   0: Off  | 1: On
	set .DailyPrize,1;

	//Minimum Hours Between Collecting Daily Reward
	//   Day: 22-24
	//   Week: 168
	set .MinWait,24;

	//Hours Before Lose Consecutive Daily Rewar
	//   Day: 48-50
	//   Week: 336
	set .MaxWait,48;

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

	//Variable of Points/Zeny earned 
	//   eg: CASHPOINTS, Zeny, LoginPoints
	set .PointType$,Zeny;

	//Name of Points/Zeny earned
	//   eg: Cashpoints, Zeny, Login Points
	set .PointName$,Zeny;

	//Toggle 
	//   0: Gain Zeny Only When ID = 0
	//   1: Gain Zeny Every Loging regardless of prize ID
	set .Mode,0;

	//Consecutive Day Points/Zeny Multiplier
	// * If players login longer than the last set
	//   day, they will keep a larger Multiplier.
	set .ZMulti,0;

	// Daily Prize items (max 64 days):
	//   <itemID>,<amount>, // Day 1
	//   <itemID>,<amount>, // Day 2
	//   ...;
	// * If players login longer than the last set
	//   day, they will keep getting the last prize.
	setarray .Rewards[0],
		617,1,		// Day 1
		

end;
}

 

 

I don't want the zeny rewards, etc. I just want to give 1 item to the players.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

	//Variable of Points/Zeny earned 
	//   eg: CASHPOINTS, Zeny, LoginPoints
	set .PointType$,Zeny;

	//Name of Points/Zeny earned
	//   eg: Cashpoints, Zeny, Login Points
	set .PointName$,Zeny;

 

Try putting "Zeny" with quotes

 

sorry for slow response irl is busy

Edited by Stolao
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  3
  • Reputation:   0
  • Joined:  03/10/13
  • Last Seen:  

haha.. thanks guys.. it's working now..
/ok really nice script..

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Welcome, and thank you.

 

I plan to update sometime when i get a chance, real life's hectic but YAY~ bought my 1st car

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

Very nice script!! love it.

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Update

1.1F -> 1.2F

1.20 Changed .Reminder to .Welcome
1.21 Fixed missing details in Welcome Message
1.22 Changed .Mode to be bitwise
1.23 Added Item enable disable to .Mode
1.24 Changed whisper to allow for player Whispers
1.25 Added "time" Whisper Command for players
1.26 Made Whisper commands configurable
1.27 Made GmLvl for wipe Configurable
1.28 Fixed "Points" bitwise
1.29 Added Exp to .Mode
1.2A Optimized Rewards Script a little
1.2B Bug Fix with Display message on reviving rewards
1.2C Optimize a little more
1.2D Added server xp rate to config
1.2F Re-added Checkweight
Edited by Stolao
Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   2
  • Joined:  02/18/12
  • Last Seen:  

Thank you ! :) Good Job /no1

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Your welcome, if have any suggestions let me know :)

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

×
×
  • Create New...