Jump to content
  • 0

Requesting NPC Birthday


Checkmate

Question


  • Group:  Members
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  554
  • Reputation:   14
  • Joined:  09/24/12
  • Last Seen:  

Hi.. rAthena Community...
Is there anyone here or someone can create for me some script or mybe sql... that can detect player birthday or the time of registration date.. TO give them some present of thier birthday?..?

Btw... Is there have any coincidence?..?

Thanks All  ^ ^ 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

47ce3819230e18ab0a3442af48bb.png

 

 

-	script	birthday	-1,{
	
	OnPCLoginEvent:
	if(#last_bdyear != gettime(7))
	{
		set @nb, query_sql("select birthdate from `login` where `account_id`='"+getcharid(3)+"'", @bdate$);
		explode(.@bdate$, @bdate$, "-");
		set .@curdate$, gettimestr("%m%d",21);
		if(.@curdate$ == (.@bdate$[1]+""+.@bdate$[2]))
		{
			getitem 7227,1;
			set #last_bdyear,gettimestr("%Y",21);
			set @byear, .@bdate$[0];
			set .@sexword$, (sex) ? "his":"her";
			announce "Hey everyone, "+strcharinfo(0)+" celebrates "+.@sexword$+" "+(#last_bdyear-@byear)+" birthday!",bc_blue|bc_all;
		}
	}
	
	end;
	
}
  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Didn't try so test this :

-    script    Sample    -1,{
    OnPCLoginEvent:
        query_sql "SELECT `DATE_FORMAT(birthdate, '%m')`, `DATE_FORMAT(birthdate, '%d')` FROM `login` WHERE `account_id` = '" +getcharid(3)+ "'", .@month, .@day;
        if ( ( gettime(6) == .@month ) && ( gettime(5) == .@day ) )
            getitem 502, 10;
        dispbottom "Happy Birthday " +strcharinfo(0)+ "!";
        end;
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  178
  • Reputation:   16
  • Joined:  06/25/12
  • Last Seen:  

getitem 7227,1;

 

suggest to use account bound items to prevent new account birthday exploit :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

 

getitem 7227,1;

 

suggest to use account bound items to prevent new account birthday exploit :D

 

ofc :) Need check for IP(or something else) or account bound

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  178
  • Reputation:   16
  • Joined:  06/25/12
  • Last Seen:  

anyway great script :D thanks

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