Foereaper
Founder
Hello everyone! Being bored last night I figured I should write a passphrase/code redeemer. This works the same way as the TCG NPC's in Booty Bay, and other redeemers on retail. Passphrases/codes are premade and stored in a database table. A passphrase can only be used once.
There are currently 3 types of redemptions available.
- Type 1: Items
- Type 2: Titles
- Type 3: Money
If you have any idea for other types, please leave a comment below.
Remember to change the creature entry to your creature's entry. By default, the script reloads the code cache every 2 minutes (120 seconds). Change the values shown below in the script accordingly:
Eluna Redeemer Script - GitHub
You do not need to manually run the SQL query below yourself, as the script will automatically create the table if it is missing.
However, if you want to execute the table query yourself, you can find it below:
Eluna Redeemer Query - GitHub
Your database table is then ready for you to create your own passphrases/codes as well as which rewards are tied to them:
- Passphrase is obviously the passphrase/code the player has to type into the creature to redeem their reward.
- Type is what type of reward is tied to the passphrase/code. Type 1 is item, Type 2 is title and Type 3 is money.
- Entry depends on the above type. If type is 1, then entry is item ID. If type is 2, then entry is title ID. If type is 3, then entry is 0.
- Count depends on the above type. If type is 1, then the count is the amount of items given. If type is 2, then count is 0. If type is 3, then count is the amount of copper given.
- Redeemed should stay 0. This is changed to 1 automatically when the passphrase/code is redeemed to prevent a code being used more than once.
- Player_GUID should stay NULL. This is changed to the player's GUID when the passphrase/code is redeemed.
- Date should stay NULL. This is changed to the current date/time when the passphrase/code is redeemed.
The passphrases/codes available are loaded once the server starts. This can manually be reloaded ingame by turning on your GM tag and talking to the redeemer. You will then have the option to refresh available passphrases.
Thanks to Rochet and Alex for input.
Thanks to Agency/Titan for testing.
There are currently 3 types of redemptions available.
- Type 1: Items
- Type 2: Titles
- Type 3: Money
If you have any idea for other types, please leave a comment below.
Remember to change the creature entry to your creature's entry. By default, the script reloads the code cache every 2 minutes (120 seconds). Change the values shown below in the script accordingly:
Code:
local Redeemer = {
Entry = x,
ReloadTimer = 120
}
Eluna Redeemer Script - GitHub
You do not need to manually run the SQL query below yourself, as the script will automatically create the table if it is missing.
However, if you want to execute the table query yourself, you can find it below:
Eluna Redeemer Query - GitHub
Your database table is then ready for you to create your own passphrases/codes as well as which rewards are tied to them:
- Passphrase is obviously the passphrase/code the player has to type into the creature to redeem their reward.
- Type is what type of reward is tied to the passphrase/code. Type 1 is item, Type 2 is title and Type 3 is money.
- Entry depends on the above type. If type is 1, then entry is item ID. If type is 2, then entry is title ID. If type is 3, then entry is 0.
- Count depends on the above type. If type is 1, then the count is the amount of items given. If type is 2, then count is 0. If type is 3, then count is the amount of copper given.
- Redeemed should stay 0. This is changed to 1 automatically when the passphrase/code is redeemed to prevent a code being used more than once.
- Player_GUID should stay NULL. This is changed to the player's GUID when the passphrase/code is redeemed.
- Date should stay NULL. This is changed to the current date/time when the passphrase/code is redeemed.
The passphrases/codes available are loaded once the server starts. This can manually be reloaded ingame by turning on your GM tag and talking to the redeemer. You will then have the option to refresh available passphrases.
Thanks to Rochet and Alex for input.
Thanks to Agency/Titan for testing.
Last edited: