Skip to content

Added Traveler's birthday gift system #2549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

sitxovski
Copy link

@sitxovski sitxovski commented May 8, 2025

This PR adds a birthday gift system to Grasscutter:

  • Checks if today is the player's birthday when they log in
  • Sends a birthday gift (Cake for Traveler, ID 118008) via in-game mail
  • Ensures players only receive one gift per birthday
  • Uses player properties to track gift receipt

The system is integrated with the existing mail system and is triggered on player login.

Comment on lines +18 to +19
private static final String MAIL_TITLE = "Best Wishes on Your Birthday";
private static final String MAIL_CONTENT = "Happy Birthday, Traveler! Please find your gift attached to this message. Thank you for all your support. We wish you a brighter future, no matter what you are going through.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part should be localized using the language system; not all players speak English

// Mail content constants
private static final String MAIL_TITLE = "Best Wishes on Your Birthday";
private static final String MAIL_CONTENT = "Happy Birthday, Traveler! Please find your gift attached to this message. Thank you for all your support. We wish you a brighter future, no matter what you are going through.";
private static final String MAIL_SENDER = "Server";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the configured server bot nickname instead of hardcoding the value

int dateValue = Integer.parseInt(dateString);

// Store the date in player properties
player.getProperties().put(PlayerProperties.LAST_BIRTHDAY_GIFT_DATE, dateValue);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the thing to store in player properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants