Skip to content
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

feat (core\db): Server Mail Reward System #162

Merged

Conversation

acidmanifesto
Copy link
Contributor

@acidmanifesto acidmanifesto commented Aug 29, 2023

This is based on my module with remake assistance from @Kitzunu to make it a core feature back on azerothcore.
The Server Mail Reward System is known to be a blizzlike retail feature, the only challenge is, are we able to present it as a blizzlike retail feature in the terms of a open source project. We are able to incorporate play time as a option with the option to input subject and body messages, which would work out in replicating seasonal and promotional blizzlike messages that were never present in the dbc\db2 files. This also helps with the ease of localization since we have a active collumn to have the reward run active or not. by default tables are blank, however two simple examples are provided below at the bottom.

Co-Authored-By: Kitzunu [email protected]

  • Server Mail Reward System Implemented (Async style)
  • Reward base on time and\or player level
  • Reward Specific to Alliance and\or Horde
  • Custom Subject line and text
  • Introduce new gm command .reload mail_server_template which will go into effect when the player relogs
    image

In-Game:
image

New Tables

Character Database:

Explanation of tables:

The `mail_server_character` table

This table keeps entries of which player has recieved a server mail. This prevents the same mail to be sent twice to the same player.

Structure

image

Field Type Attributes Key Null Default Extra Comment
guid INT UNSIGNED PRI NO      
mailId INT UNSIGNED PRI NO      

Description of the fields

guid

characters.guid.

mailId

mail_server_template.id.

The `mail_server_template` table

This table contains information for server mail to be sent to players that meet the requirement. Mails are sent OnLogin.

Structure

image

Field Type Attributes Key Null Default Extra Comment
id INT UNSIGNED PRI NO   AUTO_INCREMENT  
reqLevel TINYINT UNSIGNED   NO 0    
reqPlayTime INT UNSIGNED   NO 0    
moneyA INT UNSIGNED   NO 0    
moneyH INT UNSIGNED   NO 0    
itemA INT UNSIGNED   NO 0    
itemCountA INT UNSIGNED   NO 0    
itemH INT UNSIGNED   NO 0    
itemCountH INT UNSIGNED   NO 0    
subject TEXT     NO      
body TEXT     NO      
active TINYINT UNSIGNED   NO 1    

Description of the fields

id

Unique ID.

reqLevel

Players required level to be able to recieve the mail.

reqPlayTime

Players required play time in milliseconds to recieve the mail.

moneyA

Money in copper that is sent to Alliance player.

moneyH

Money in copper that is sent to Horde player.

itemA

item_template.entry that is sent to Alliance player.

itemCountA

How many of the specified itemA is sent.

itemH

item_template.entry.

itemCountH

How many of the specified itemH is sent that is sent to Horde player.

subject

The title/subject of the mail.

body

The body of the mail.

active

boolean

  • 1 = Mail is active and will be sent to the players if they meet the requirement.
  • 0 = Disabled.

Examples
image
Apply to Character DB

-- send testing test message when player is level 1 with zero time played in ms
DELETE FROM `mail_server_template` WHERE `id`=1;
INSERT INTO `mail_server_template` (`id`, `reqLevel`, `reqPlayTime`, `moneyA`, `moneyH`, `itemA`, `itemCountA`, `itemH`, `itemCountH`, `subject`, `body`, `active`) VALUES 
(1, 1, 0, 0, 0, 0, 0, 0, 0, 'testing', 'this is a test', 1);
-- send money test of 12 copper when player is level 1 after 1 hours in ms passes in toon play time
DELETE FROM `mail_server_template` WHERE `id`=2;
INSERT INTO `mail_server_template` (`id`, `reqLevel`, `reqPlayTime`, `moneyA`, `moneyH`, `itemA`, `itemCountA`, `itemH`, `itemCountH`, `subject`, `body`, `active`) VALUES 
(2, 1, 3600000, 12, 12, 0, 0, 0, 0, 'money test', 'test', 1);

Issues addressed

  • Closes

SOURCE:

Tests performed

How to Test the Changes:

Known issues and TODO list

  • [ ]
  • [ ]

  • Thank you for collaborating with the project.
  • For an efficient working methodology.
  • It is obvious to make long pull request, unless it is necessary.
  • A short pull request would be easy to test and approve.

@acidmanifesto acidmanifesto self-assigned this Aug 29, 2023
void AddSC_duel_reset();
void AddSC_world_map_scripts();
void AddSC_quest_scripts();
// player
void AddSC_chat_log();
void AddSC_action_ip_logger();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a dupe line. Its a world script not a player script on in the solution

@seobryn seobryn merged commit 6303bcc into FirelandsProject:master Aug 30, 2023
3 checks passed
@acidmanifesto acidmanifesto deleted the server-mail-reward-system branch August 30, 2023 18:58
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.

2 participants