localConfig_senderGUID=10667-- GUID/ID of the Player/Creature. If Config_preventReturn = true then you need to put Creature ID. If it's false Player GUID. 0 = No sender aka "From: Unknown".
localConfig_mailStationery=41-- Stationary used in the mail sent to the player. (41 Normal Mail, 61 GM/Blizzard Support, 62 Auction, 64 Valentines, 65 Christmas) Note: Use 62, 64, and 65 At your own risk.
localConfig_maxGMRank=0-- Checks the player's assigned GM rank. Anything above the assigned default will not receive mail/be counted for the player counter. Default 0 - Players Only. Max 3 - All GMS/Mods/Etc will receive as well.
localConfig_preventReturn=true-- Modify's the Mail database to prevent returning of rewards. Note: If you are experiencing server lag after installing this module please disable this option to see if it helps.
-- Config_mailText == 1 Config
localConfig_mailSubject1="Dinkledork's reward for You!"
localConfig_mailText1="!\n\nYou've done well while advancing on your journies. Here is a small reward to celebrate your heroic deeds. Go forth!\n\nKind regards,\nDinkledork"
localConfig_mailText2C=" level of mastery.\nYour adventures have made me take notice of you, take this small reward as a token of my appreciation.\nGo forth!\n\nKind regards,\nDinkledork"
CharDBQuery('CREATE DATABASE IF NOT EXISTS `'..Config_customDbName..'`;');
CharDBQuery('CREATE TABLE IF NOT EXISTS `'..Config_customDbName..'`.`levelup_reward` (`level` INT NOT NULL, `counter` INT DEFAULT 0, PRIMARY KEY (`level`) );');
localn
forn=2,80,1do
LUR_playerCounter[n]=0
end
Data_SQL=CharDBQuery('SELECT `level`, `counter` FROM `'..Config_customDbName..'`.`levelup_reward`;');
ifData_SQL~=nilthen
locallevelRow
repeat
levelRow=Data_SQL:GetUInt32(0)
LUR_playerCounter[levelRow]=Data_SQL:GetUInt32(1)
untilnotData_SQL:NextRow()
end
localPLAYER_EVENT_ON_LEVEL_CHANGE=13
localfunctionPreventReturn(playerGUID)
ifConfig_preventReturn==truethen
CharDBExecute('UPDATE `mail` SET `messageType` = 3 WHERE `sender` = '..Config_senderGUID..' AND `receiver` = '..playerGUID..' AND `messageType` = 0;')
print("LevelUpReward has granted "..Config_Gold[oldLevel+1].." copper and "..Config_ItemAmount[oldLevel+1].." of item "..Config_ItemId[oldLevel+1].." to character "..playerName.." with guid "..playerGUID..".")
print("LevelUpReward has granted "..Config_Gold[oldLevel+1].." copper and "..Config_ItemAmount[oldLevel+1].." of item "..Config_ItemId[oldLevel+1].." to character "..playerName.." with guid "..playerGUID..".")