Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[92.03] Add account benefits

Junior Spellweaver
Joined
Dec 5, 2015
Messages
181
Reaction score
145
The account benefits is displayed in-game beside the VIP icon and on the right side in the lobby. It can be founder (Having a purchased account), TERA Club, PC cafe, etc...
It's more convenient to have them set automatically than using the "add_privilege" QA method.

Import this SQL file into your accountdb_2800 database:
Code:
DROP TABLE IF EXISTS `account_benefits`;
CREATE TABLE `account_benefits` (
  `accountDBID` int(11) NOT NULL,
  `benefitId` int(11) NOT NULL,
  `availableUntil` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

In the API, replace the "GetUserInfo" method with this one:
Code:
def GetUserInfo() {
        println '----------------GetUserInfo----------------'
        String msg = ''
        int returnCode = 0
        boolean paramLengthCheck = true

        params.putAll(request.JSON)
        params.each {
            if(it.getValue().toString().contains('./') || it.getValue().toString().contains('.?') || it.getValue().toString().length() > 1500)
                paramLengthCheck = false
            msg = "$it.key parameter error"
        }

        if(!paramLengthCheck){
            JSONObject result = new JSONObject()
            result.put('Return',false)
            result.put('ReturnCode',50500)
            result.put('msg', msg)
            def resultJson = result as JSON
            response.setContentLength(resultJson.toString()?.bytes.length)
            render text : resultJson , contentType: 'application/json', encoding: 'UTF-8'
            println result
        }
        else {
            JSONObject result = new JSONObject()
            def paramMap = [:]
            try {
                params.each { p ->
                    if (p.key != 'action' && p.key != 'controller') {
                        paramMap.put(p.key, p.value)
                        println 'Key: ' + p.key + ', value: ' + p.value
                    }
                }
            } catch (RuntimeException e) {
                returnCode = 58007
                msg = 'invalid encoded parameter(base64)'
                e.printStackTrace()
            }

            if(!params.user_srl || !params.server_id ||!params.ip || !params.serviceCode ){
                returnCode = 2
                msg = "user_srl=$params.user_srl&server_id=$params.server_id&ip=$params.ip&serviceCode=$params.serviceCode"
            }

            def accountList = []
            String selectQuery = "select * from AccountInfo where accountDBID = $params.user_srl"
            Sql sql = new Sql(dataSource)
            sql.eachRow(
                    selectQuery, {
                it.eachWithIndex { row, index ->
                    accountList << [
                            charCount:        row.charCount,
                            //lastLoginTime:    row.lastLoginTime,
                            //playTimeLast:    row.playTimeLast,
                            isBlocked:        row.isBlocked,
                    ]
                }
            }
            )
            sql.close()

            def benefit_array = []
            selectQuery = "select * from account_benefits where accountDBID = $params.user_srl"
            sql = new Sql(dataSource)
            sql.eachRow(
                    selectQuery, {
                        it.eachWithIndex { row, index ->
                        benefit_array << [
                                row.benefitId,
                                row.availableUntil - (System.currentTimeMillis()/1000).toInteger()
                        ]
                    }
                }
            )
            if (accountList.size() != 1) {
                msg = 'invalid login request'
                returnCode = 50000
            }
            else {
                def accountInfo = accountList.get(0)
                def charCount = accountInfo.getAt('charCount')
                def CharacterCount = "0|2800,$charCount|"
                result.put("last_connected_server", null)
                result.put("last_play_time", null)
                result.put("logout_time_diff", null)
                result.put("char_count_info", CharacterCount)
                result.put("privilege", 0)
                result.put("permission", accountInfo.getAt('isBlocked'))
                result.put("result_code", returnCode)
                result.put("benefit", benefit_array)
                result.put("vip_pub_exp", 0)
            }
            if (returnCode > 0)
                result.put("msg", msg)
            response.setContentLength((result as JSON).toString()?.size())
            render text: result as JSON, contentType: 'application/json', encoding: 'UTF-8'
            println result
        }
    }

You can find the list of all the different benefits in the "StrSheet_AccountBenefit.xml" file in the datacenter, or use the list below

Code:
<String id="31" string="Proof of the expedition member" />
  <String id="32" string="Skillful Adventurer" />
  <String id="33" string="TERA Rewards" showLeftTimeOver1Year="False" />
  <String id="34" string="Frontier" hideCoolTime="True" />
  <String id="35" string="EP XP increases by 30" hideCoolTime="True" />
  <String id="70" string="" showLeftTimeOver1Year="False" />
  <String id="77" string="Monthly Pass" showLeftTimeOver1Year="False" />
  <String id="101" string="" showLeftTimeOver1Year="True" />
  <String id="102" string="" hideCoolTime="True" />
  <String id="103" string="Japan Returning user" />
  <String id="104" string="JP Tooltip" showLeftTimeOver1Year="True" />
  <String id="105" string="" showLeftTimeOver1Year="True" />
  <String id="106" string="" showLeftTimeOver1Year="True" />
  <String id="107" string="" showLeftTimeOver1Year="True" />
  <String id="108" string="" showLeftTimeOver1Year="True" />
  <String id="109" string="" showLeftTimeOver1Year="True" />
  <String id="333" string="Elite Status" />
  <String id="334" string="Founder" />
  <String id="335" string="Console Elite" />
  <String id="350" string="Server Benefit" />
  <String id="433" string="TERA Club" />
  <String id="434" string="Veteran" />
  <String id="435" string="Package Benefit I" />
  <String id="436" string="Package Benefit II" />
  <String id="437" string="Package Benefit III" />
  <String id="500" string="VIP" showLeftTimeOver1Year="False" />
  <String id="510" string="TW XP Boost Server" />
  <String id="520" string="VIP2" />
  <String id="530" string="" showLeftTimeOver1Year="False" />
  <String id="533" string="VIP" />
  <String id="534" string="Founder" hideCoolTime="True" />
  <String id="600" string="Trade restricted" hideCoolTime="True" />
  <String id="601" string="Basic Package" hideCoolTime="True" />
  <String id="691" string="Safe Mode" />
  <String id="701" string="VIP" showLeftTimeOver1Year="False" />
  <String id="800" string="PC Café (Minor)" />
  <String id="801" string="PC Café (Intermediate)" />
  <String id="802" string="PC Café (Major)" />
  <String id="803" string="PC Café (VIP)" />
  <String id="804" string="User ELITE (Minor)" />
  <String id="805" string="User ELITE (Intermediate)" />
  <String id="806" string="User ELITE (Major)" />
  <String id="807" string="User ELITE (VIP)" />
  <String id="808" string="" />
  <String id="809" string="" showLeftTimeOver1Year="False" />
  <String id="810" string="" showLeftTimeOver1Year="False" />
  <String id="1000" string="TERA PC cafe" hideCoolTime="True" />
  <String id="1001" string="" hideCoolTime="True" />

In the new table account_benefit, set the "accountDBID" to yours found in the "accountinfo" table, "benefitId" with your wanted benefit from the list or datacenter file and "availableUntil" to the date you want this benefit to be available (set the date in 10 years if you want it permanently).
 
Junior Spellweaver
Joined
Dec 5, 2015
Messages
181
Reaction score
145
Thanks for sharing. Let me ask, is there a way to enable 2 accounts benefits at same time? like Founder and Elite/Club Status

Yeah sure. This is an array of array. Each benefit array is in this format: [benefit_id, time_remaining].

So sending [[334, 600000], [433, 600000], [1000, 600000]] will result having founder (334), TERA CLUB EU (443) and KR pc cafe (1000) for 1h
 
Newbie Spellweaver
Joined
Mar 16, 2021
Messages
7
Reaction score
0
Shared files does not contain file StrSheet_AccountBenefit.xml, how do we proceed with that?
 
Junior Spellweaver
Joined
Apr 1, 2011
Messages
110
Reaction score
35
Shared files does not contain file StrSheet_AccountBenefit.xml, how do we proceed with that?

TeraAPI\grails-4.0.3\TeraAPI\grails-app\controllers\com\tera\AccountController.groovy
 
Joined
Mar 29, 2019
Messages
1,011
Reaction score
1,147
Its the same file previously shared by Luciole

Code:
<?xml version="1.0" encoding="utf-8"?>
<StrSheet_AccountBenefit>
  <String id="31" string="Proof of the expedition member" />
  <String id="32" string="Skillful Adventurer" />
  <String id="33" string="TERA Rewards" showLeftTimeOver1Year="False" />
  <String id="34" string="Frontier" hideCoolTime="True" />
  <String id="35" string="EP XP increases by 30" hideCoolTime="True" />
  <String id="70" string="" showLeftTimeOver1Year="False" />
  <String id="77" string="Monthly Pass" showLeftTimeOver1Year="False" />
  <String id="101" string="" showLeftTimeOver1Year="True" />
  <String id="102" string="" hideCoolTime="True" />
  <String id="103" string="Japan Returning user" />
  <String id="104" string="JP Tooltip" showLeftTimeOver1Year="True" />
  <String id="105" string="" showLeftTimeOver1Year="True" />
  <String id="106" string="" showLeftTimeOver1Year="True" />
  <String id="107" string="" showLeftTimeOver1Year="True" />
  <String id="108" string="" showLeftTimeOver1Year="True" />
  <String id="109" string="" showLeftTimeOver1Year="True" />
  <String id="333" string="Elite Status" />
  <String id="334" string="Founder" />
  <String id="335" string="Console Elite" />
  <String id="350" string="Server Benefit" />
  <String id="433" string="TERA Club" />
  <String id="434" string="Veteran" />
  <String id="435" string="Package Benefit I" />
  <String id="436" string="Package Benefit II" />
  <String id="437" string="Package Benefit III" />
  <String id="500" string="VIP" showLeftTimeOver1Year="False" />
  <String id="510" string="TW XP Boost Server" />
  <String id="520" string="VIP2" />
  <String id="530" string="" showLeftTimeOver1Year="False" />
  <String id="533" string="VIP" />
  <String id="534" string="Founder" hideCoolTime="True" />
  <String id="600" string="Trade restricted" hideCoolTime="True" />
  <String id="601" string="Basic Package" hideCoolTime="True" />
  <String id="691" string="Safe Mode" />
  <String id="701" string="VIP" showLeftTimeOver1Year="False" />
  <String id="800" string="PC Café (Minor)" />
  <String id="801" string="PC Café (Intermediate)" />
  <String id="802" string="PC Café (Major)" />
  <String id="803" string="PC Café (VIP)" />
  <String id="804" string="User ELITE (Minor)" />
  <String id="805" string="User ELITE (Intermediate)" />
  <String id="806" string="User ELITE (Major)" />
  <String id="807" string="User ELITE (VIP)" />
  <String id="808" string="" />
  <String id="809" string="" showLeftTimeOver1Year="False" />
  <String id="810" string="" showLeftTimeOver1Year="False" />
  <String id="1000" string="TERA PC cafe" hideCoolTime="True" />
  <String id="1001" string="" hideCoolTime="True" />
  <String id="10031" string="Reward: receive two Valkyon's Response when using instance matching." />
  <String id="10032" string="Decrease cooldown of instance in half & increase instance entries by 100%" />
  <String id="10033" string="Earnest Money: exemption<BR>Trading brokerage fee: 5%<BR>Brokerage Registration Number: 50<BR>Broker's price negotiation: Available<BR>Reward: receive Valkyon's Response when using instance matching system between servers.<BR>Decrease cooldown of instance & increase instance entries<BR>Increases maximum number and charging speed of Adventure Coin<BR>Apply Instance Beginner System<BR>Apply XP Boost and Reputation Boost<BR>Doubles access to Ghillieglade." />
  <String id="10034" string="Reward: receive Valkyon's Response when using instance matching system between servers.<BR>Apply Instance Beginner System" />
  <String id="10035" string="EP XP increases by 30%." />
  <String id="10070" string="" />
  <String id="10077" string="100% XP Boost (1 Hour) access<BR>Earnest Money: 2%<BR>Trading brokerage fee: 10%<BR>Brokerage Registration Number: 50<BR>Broker's price negotiation: Available<BR>Reward: receive Valkyon's Response when using instance matching system between servers.<BR>Decrease cooldown of instance & increase instance entries<BR>Increases maximum number and charging speed of Adventure Coin<BR>Apply Instance Beginner System<BR>Apply XP Boost and EP Boost<BR>Increased Item XP gains<BR>Doubles access to Ghillieglade." />
  <String id="10101" string="" />
  <String id="10102" string="" />
  <String id="10103" string="Japan Returning user tooltip" />
  <String id="10104" string="JP Tooltip" />
  <String id="10105" string="" />
  <String id="10106" string="" />
  <String id="10107" string="" />
  <String id="10108" string="" />
  <String id="10109" string="" />
  <String id="10333" string="Monthly Account Rewards:<BR>Permanent 100% XP Boost.<BR>Permanent 100% Reputation Boost.<BR>Permanent 100% Quester's Gold Boost.<BR>Village Atlas.<BR>Travel Journal.<BR>Two Valkyon's Responses from Instance Matching.<BR>Twice as many available daily quests.<BR>Instance access twice as often.<BR>Up to 50 items active on brokerage.<BR>Exempt from earnest money requirements on brokerage.<BR>Brokerage fee of only 10%.<BR>Sampler mount (changes periodically).<BR>Daily boosts and loot boxes." />
  <String id="10334" string="Permanent Account Rewards: <BR>8 free character slots per server.<BR>4 bank tabs per server.<BR>Terminus, the argon hybrid warhorse.<BR>"Founder" title.<BR>Up to 30 items active on brokerage." hideCoolTime="True" />
  <String id="10335" string="Monthly Account Rewards:<BR>Permanent 100% XP Boost.<BR>Permanent 100% Reputation Boost.<BR>Permanent 100% Quester's Gold Boost.<BR>Village Atlas.<BR>Travel Journal.<BR>Two Valkyon's Responses from Instance Matching.<BR>Twice as many available daily quests.<BR>Instance access twice as often.<BR>Up to 50 items active on brokerage.<BR>Exempt from earnest money requirements on brokerage.<BR>Brokerage fee of only 10%.<BR>Sampler mount (changes periodically).<BR>Daily boosts and loot boxes." />
  <String id="10433" string="Active Bonuses During Membership:<BR>Instance cooldowns halved and entries doubled<BR>Increased maximum and faster regeneration of Adventure Coins<BR>Special mount and pet<BR>Free teleportation to cities, towns and villages plus your own teleport locations<BR>Various boosts such as 100% increased character experience<BR>NPC summoning scrolls and keys<BR>Up to 50 active offers on the brokerage<BR>Reduced earnest money and instant buy fees from the brokerage<BR>Permanent crystalbind<BR>Additional daily deliveries to fishing NPCs<BR>Twice as many daily quests<BR>+50% skill advancement XP<BR>+100% EP XP<BR>... and much more!" />
  <String id="10434" string="Permanent Account Rewards: <BR>8 characters available per server.<BR>4 bank tabs per server.<BR>"Veteran of the Valkyon Federation" title.<BR>Up to 30 items active on brokerage." hideCoolTime="True" />
  <String id="10435" string="Permanent Account Rewards: <BR>8 characters available per server.<BR>4 bank tabs per server." hideCoolTime="True" />
  <String id="10436" string="Permanent Account Rewards: <BR>10 characters available per server.<BR>5 bank tabs per server." hideCoolTime="True" />
  <String id="10437" string="Permanent Account Rewards: <BR>12 characters available per server.<BR>6 bank tabs per server." hideCoolTime="True" />
  <String id="10500" string="" />
  <String id="10530" string="" />
  <String id="10533" string="" />
  <String id="10534" string="" />
  <String id="10600" string="In order to prevent account theft, trading items or gold to inactive accounts is restricted.<br>Press the icon and verify your account to enable trading." />
  <String id="10601" string="Permanent Account Rewards: <BR>8 characters available per server.<BR>4 bank tabs per server.<BR>"Veteran of the Valkyon Federation" title.<BR>Up to 30 items active on brokerage." />
  <String id="10691" string="Monthly Account Rewards:<BR>Two Valkyon's Responses from Instance Matching.<BR>Twice as many available daily quests.<BR>Instance access twice as often.<BR>Sampler mount (changes periodically).<BR>Up to 50 items active on brokerage.<BR>Exempt from earnest money requirements on brokerage.<BR>Brokerage fee of only 10%.<BR><BR>Village atlas.<BR>Ten strongbox keys.<BR>Traveler's Insurance scrolls.<BR>Boosts that replenish daily." />
  <String id="10733" string="" />
  <String id="10800" string="" />
  <String id="10801" string="" />
  <String id="10802" string="" />
  <String id="10803" string="" />
  <String id="10804" string="" />
  <String id="10805" string="" />
  <String id="10806" string="" />
  <String id="10807" string="" />
  <String id="10808" string="" />
  <String id="10809" string="" />
  <String id="10810" string="" />
  <String id="11000" string="Brokerage Registration Number: 50<BR>Broker's price negotiation: available<BR>Increases critical success chance by 10% on crafting items<BR>PC cafe inventory: available<BR>Acquire 100% additional experience<BR>Gain 100% additional hunting XP rewards<BR>Gain 10% additional EP XP rewards<BR>Significantly decreases crafting time." />
  <String id="11001" string="" />
  <String id="100031" string="" />
  <String id="100032" string="" />
  <String id="100033" string="Package Benefit" />
  <String id="100034" string="Package Benefit" />
  <String id="100070" string="Package Benefit" />
  <String id="100077" string="Package Benefit" />
  <String id="100101" string="" />
  <String id="100102" string="" />
  <String id="100103" string="Japan Returning user benefit" />
  <String id="100104" string="JP Tooltip" />
  <String id="100105" string="" />
  <String id="100106" string="" />
  <String id="100107" string="" />
  <String id="100108" string="" />
  <String id="100109" string="" />
  <String id="100333" string="Package Benefit" />
  <String id="100334" string="Package Benefit" />
  <String id="100335" string="Package Benefit" />
  <String id="100350" string="You are under the effect of double experience points." />
  <String id="100433" string="Package Benefit" />
  <String id="100434" string="Package Benefit" />
  <String id="100435" string="Package Benefit" />
  <String id="100436" string="Package Benefit" />
  <String id="100437" string="Package Benefit" />
  <String id="100500" string="" />
  <String id="100530" string="" />
  <String id="100533" string="" />
  <String id="100534" string="" />
  <String id="100600" string="Mail, Brokerage, Trade, Deathmatch, Guild Bank" />
  <String id="100601" string="Package Benefit" />
  <String id="100691" string="Safe Mode" />
  <String id="100733" string="" />
  <String id="100800" string="" />
  <String id="100801" string="" />
  <String id="100802" string="" />
  <String id="100803" string="" />
  <String id="100804" string="" />
  <String id="100805" string="" />
  <String id="100806" string="" />
  <String id="100807" string="" />
  <String id="100808" string="" />
  <String id="100809" string="" />
  <String id="100810" string="" />
  <String id="101000" string="Package Benefit" />
  <String id="101001" string="" />
  <String id="1000600" string="In order to prevent account theft, trading is restricted to inactive accounts." />
  <String id="1000601" string="In order to prevent account theft, trading items or gold is restricted." />
  <String id="77777777" string="<font color = '#00A0FF'>{EventName}</font>" hideCoolTime="True" />
  <String id="88888888" string="Play Time Event" hideCoolTime="True" />
  <String id="1077777777" string="<font color = '#ABF200'>{EventType}</font> <font color = '#FFBB00'>{EventValue}</font>{RegionList}" hideCoolTime="True" />
  <String id="1088888888" string="The Play Time Event rewards players for accumulating play time each day and over the course of the event." hideCoolTime="True" />
  <String id="1188888888" string="Claim" />
  <String id="1288888888" string="Confirm" />
</StrSheet_AccountBenefit>
 
Newbie Spellweaver
Joined
Mar 11, 2021
Messages
16
Reaction score
2
i can not get the time available till to work , could you give me an example? does it calculate in seconds or minutes? i cannot place a date in the row , only a number , i have tried 60000 and in api it shows benefit : [433, -162121321] so the benefit does not appear in the account.
 
Joined
Jun 27, 2010
Messages
939
Reaction score
1,193
i can not get the time available till to work , could you give me an example? does it calculate in seconds or minutes? i cannot place a date in the row , only a number , i have tried 60000 and in api it shows benefit : [433, -162121321] so the benefit does not appear in the account.

use this
 
Last edited:
Joined
Sep 21, 2013
Messages
2,319
Reaction score
3,019
and where i can set my character with the value for elite

It's all explained here, import the SQL file into your accountdb_2800 database.

In the new table account_benefits, set the "accountDBID" to yours found in the "accountinfo" table,
"benefitId" with your wanted benefit from the list and "availableUntil" to the date you want this benefit to be available.

As in the image...
Luciole - [92.03] Add account benefits - RaGEZONE Forums
 
Legendary Battlemage
Top Poster Of Month
Joined
Feb 16, 2014
Messages
672
Reaction score
296
Hello guys i was bit working on this, and all looks fine, but some benefit are empty like for example
<String id="534" string="Founder" hideCoolTime="True" />
how i can edit empty benefit.
 
Joined
Mar 29, 2019
Messages
1,011
Reaction score
1,147
Hello guys i was bit working on this, and all looks fine, but some benefit are empty like for example
<String id="534" string="Founder" hideCoolTime="True" />
how i can edit empty benefit.

I didn't test this yet, but take a look at AccountTrait.xml (Account benefits like fee discounts.) and PremiumSlot.xml ("Elite Perk" Account consumables like panaceas, flying mounts)

Luciole - [92.03] Add account benefits - RaGEZONE Forums
 
Newbie Spellweaver
Joined
Dec 13, 2015
Messages
17
Reaction score
1
Hey,

i did what was described above and yes, i have the selected benefits ingame.
BUT: just as long as i didnt logout. when i do so it resets avalableUntil to 0

any solution for that?
thanks!
 
Newbie Spellweaver
Joined
Jan 29, 2022
Messages
5
Reaction score
0
I dont know if anyone will see this but i did everything in here and added my accountID , benefit id and the time to the account_benefits table but when I go into my character in game i dont see the the Elite bar anywhere maybe im missing something?

Also does anyone know if there is a way to do something with the tera rewards thing, change its tier because the icon is up there but its just tier 0 always.
 
Junior Spellweaver
Joined
Jan 22, 2021
Messages
167
Reaction score
51
I dont know if anyone will see this but i did everything in here and added my accountID , benefit id and the time to the account_benefits table but when I go into my character in game i dont see the the Elite bar anywhere maybe im missing something?

Also does anyone know if there is a way to do something with the tera rewards thing, change its tier because the icon is up there but its just tier 0 always.

What is the Epoch time you inserted into database? Maybe you've put a wrong one
 
Newbie Spellweaver
Joined
Jan 29, 2022
Messages
5
Reaction score
0
What is the Epoch time you inserted into database? Maybe you've put a wrong one

I saw this message and I was like hmm maybe let me go back to that site and check again and you were right! I was being dumb and what i was doing was inserting the number of the "convert seconds to days hours and minutes section" So when i went back to the site after reading your message I tried the second option there where you type out the specific month, day and year and time and then click human date to timestamp and I used the epoch timestamp that it showed and it worked. The number that i ended up using was 1853871741 just incase someone who has the same problem can just use that number.

I still wonder about the Tera Rewards thing and if there is a way to raise it through commands or editing something to go up in tiers
 
Junior Spellweaver
Joined
Jan 22, 2021
Messages
167
Reaction score
51
I saw this message and I was like hmm maybe let me go back to that site and check again and you were right! I was being dumb and what i was doing was inserting the number of the "convert seconds to days hours and minutes section" So when i went back to the site after reading your message I tried the second option there where you type out the specific month, day and year and time and then click human date to timestamp and I used the epoch timestamp that it showed and it worked. The number that i ended up using was 1853871741 just incase someone who has the same problem can just use that number.

Gj! Just to be sure, let me still clearup what is Epoch time for others that may try to use the number you gave.

Epoch time is the number of seconds elapsed since 1st january 1970 00:00 UTC.
Thus this Epoch number is constantly incrementing, so depending which date DiehauserBelial chosed (let's say 30/01/2022), the number he gave will be outdated after tomorrow so you will need to pick a new date in the future to make benefits work.
 
Back
Top