All about Premium Account and how to work with it

Deazer

Head Developer
Staff member
1) How to enable:

Path - gameserver/config/services.properties
By default, the system is disabled!
# Rate Bonus Service
# To configure bonuses/period/cost, edit the file /config/services_rate_bonus.xml
RateBonusEnabled = False
# Ability to use the .pa .premium command in-game chat
RateBonusVoiceCommandEnabled = False
# Display the PA expiration time in the chat upon entering the game
RateBonusReportExpireTime = False

2) Configuring bonuses and levels:

Location: gameserver/config/services_rate_bonus.xml

Description of bonuses and example
Code:
<rate_bonus id="1" consume_item_id="4037" consume_item_amount="250">
<exp value="1.2" />
<sp value="1.2" />
<exp_raid value="1.2" />
<sp_raid value="1.2" />
<quest_reward value="1.2" />
<quest_adena_reward value="1.2" />
<quest_drop value="1.2" />
<drop_adena value="1.2" />
<drop_items value="1.2" />
<drop_seal_stones value="1"/>
<drop_raid_item value="1.0" />
<drop_spoil value="1.2" />
<enchant_item_mul value="1.0" />
<enchant_skill_mul value="1.0" />
<bonus_days value="2" />
<!-- additional reward -->
<!-- <reward item_id="4037" item_count="1" />
<reward item_id="57" item_count="100" />
<name_color value="00FCA0" />
<hwid_limits value="1" />
-->
</rate_bonus>

Where - rate_bonus id="1" is its ID that will be called when bypassing.
consume_item_id="4037" is the currency that will be consumed for this premium.
consume_item_amount="250" is the quantity that will be consumed.
<exp value="1.2" /> - rates for Experience. Here, a direct calculation takes place - let's say the server rates are x10. When the premium is activated, it will be x12 because 10 * 1.2 = 12, which is 20% more.
<sp value="1.2" /> - rates for Skill Points. Here, a direct calculation takes place - let's say the server rates are x5. When the premium is activated, it will be x6 because 5 * 1.2 = 6, which is 20% more.
<exp_raid value="1.2" /> - rates for Experience obtained from Bosses. Let's assume our rate is x1. When the premium is activated, it will be x1.2 because 1 * 1.2 = 1.2, which is 20% more.
<sp_raid value="1.2" /> - rates for Skill Points obtained from Bosses. Let's assume our rate is x1. When the premium is activated, it will be x1.2 because 1 * 1.2 = 1.2, which is 20% more.
<quest_reward value="1.2" /> - Reward given for quests. Upon completing a quest, the reward is increased by 20%.
<quest_adena_reward value="1.2" /> - Adena given for quests. Upon completing a quest, the Adena reward is increased by 20%.
<quest_drop value="1.2" /> - Rates for dropping quest items from monsters during the quest. Increased by 20%.
<drop_adena value="1.2" /> - Rates for dropping Adena from monsters and raids. Increases the amount of dropped Adena by 20%. For example, if your rates are x100, they will become x120.
<drop_items value="1.2" /> - Rates for dropping items from monsters. Increases the amount of dropped items by 20%. For example, if your rates are x10, they will become x12.
<drop_seal_stones value="1"/> - Rates for dropping 7 Seals Stones from monsters and raids. Increases the amount of dropped stones by 20%. For example, if your rates are x10, they will become x12.
<drop_raid_item value="1.0" /> - Rates for dropping items from Raid Bosses. Increases the amount of dropped items by 20%. For example, if your rates are x100, they will become x120.
<drop_spoil value="1.2" /> - Rates for dropping spoil items. Increases the amount of dropped spoil items by 20%. For example, if your rates are x1, they will become x1.2.
<enchant_item_mul value="1.2" /> - Increases the chance of enchanting items. For example, if the default chance to enchant to +5 is 50%, with active PA, it will be 60%, which is a 20% increase.
<enchant_skill_mul value="1.2" /> - Increases the chance of enchanting skills. For example, if the default chance to enchant to +5 is 50%, with active PA, it will be 60%, which is a 20% increase.
<bonus_days value="2" /> - The duration of the Premium after purchase. You can also set fractional numbers. For example, <bonus_days value="0.12" /> = 12 hours.
<!-- additional reward -->
This block is not active until you remove the tags <!-- and -->
<!-- <reward item_id="4037" item_count="1" /> - Item that will be given to the player after receiving the Premium.
<reward item_id="57" item_count="100" /> - Item that will be given to the player after receiving the Premium.
<name_color value="00FCA0" /> - The color of the player's name after purchasing the Premium.
<hwid_limits value="1" /> - The number of active windows for this account.
-->

3) You can also issue skills to players with a premium account:
Path: gameserver\data\skill_tree\premium_account_skill_tree.xml
For example, let's give the player the Heroic Miracle skill
XML:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE list SYSTEM "tree.dtd">
<list>
     <premium_account_skill_tree>
      <skill id="395" min_level="0" level="1" cost="0" name="Heroic Miracle"/>
     </premium_account_skill_tree>
</list>

You can add an unlimited number of skills. Thus, all players with a premium account will be given a skill.

4) Now let's move on to the location of the dialogs and how to edit them:
The HTML dialog itself is located in gameserver\data\html\scripts\services
List of files:
RateBonus.htm
RateBonusAlready.htm
RateBonusGet.htm
RateBonusNo.htm

Editing the description of bonuses and the button layout for purchases can be found in:
gameserver\data\string
List of strings for editing:
scripts.services.RateBonus.BonusExpireTime
scripts.services.RateBonus.LuckEnded
scripts.services.RateBonus.BonusExpireTime
scripts.services.RateBonus.BonusHtml
The main string for editing the button: scripts.services.RateBonus.BonusHtml
In fact, these strings are HTML, and you can format them exactly as you would with regular HTML, but they are located in gameserver\data\string

There is even a separate topic that shows examples and detailed explanations from customers: https://lucera2.com/threads/stranica-pokupki-pa.1759/#post-12666

5) Various additional configs:

altsettings.properties
# AutoLoot is only available for Premium Account
AutoLootOnlyForPremium=False
# Option to use command .autoloot .xpfreez .ru .en
AltAllowServicesCommand = True
ExpFreezingLootOnlyForPremium = False
# Time multiplier for buffs with Premium Account (AltNpcBufferEffectTime * AltNpcPremiumBufferEffectMul)
# Example : AltNpcPremiumBufferEffectMul = 1.2 +20% AltNpcBufferEffectTime for Premium Account
AltNpcPremiumBufferEffectMul = 1.
# When enabled for premium account owners, HTML will be displayed with the prefix -pa.htm
# Example: for normal player npc-40010.htm, for premium npc-40010-pa.htm
AltNpcBufferPremiumHtmlPrefix = False
# Prefix by item availability, checked separately from AltNpcBufferPremiumHtmlPrefix
# Example: AltNpcBufferPremiumItemPrefix = 4037
AltNpcBufferPremiumItemPrefix = 0
# Consumption for Premium Account soulshots, spirit shots and stele - If false they become infinite (premium only)
PremiumAccountConsumeArrows = true
PremiumAccountConsumeSoulShots = true
PremiumAccountConsumeSpiritShots = true
PremiumAccountConsumeBeastShots = true
# Example: if you put 1.2 it will be 20% bonus
AltPcBangPointsBonusForPremiumAccount = 1.
# Allows only users with a premium account to play
AltCheckPremiumForStartGame = False

auto_farm.properties
# If this option is enabled, only premium account can use the service.
AutoFarmOnlyForPremium = False
# Is the service free only for premium account?
AutoFarmIsFreeForPremium = False

other properties
StartingPremiumAccountId = 0
# The starting status of a premium account is given once for the entire account.
StartingPremiumAccountGlobal = True


pvpcommunityboard.properties
# Teleport only for prem accounts
CommunityTeleporterPremiumOnly=false

services.properties
# Item giving Premium Account on double click
# You can add many items:
# PremiumAccountItemHandlerId = 6642, 6643, 6644
# PremiumAccountBonusId = 1, 2, 3 (available IDs can be taken from config/services_rate_bonus.xml)
PremiumAccountItemEnable = False
PremiumAccountItemHandlerId = 6643
PremiumAccountBonusId = 1

6) Parameter for skills and items

This is what the parameter looks like
XML:
 <cond msgId="1518">
       <player is_premium="true"/>
     </cond>
Usage example

XML:
 <etcitem id="6410" name="2006 Battle Tournament - Quick Healing Potion">
     <!-- [quick_healing_potion_2005] -->
     <set name="reuse_delay" value="500"/>
     <set name="class" value="CONSUMABLE"/>
     <set name="crystal_type" value="NONE"/>
     <set name="icon" value="icon.etc_potion_gold_i00"/>
     <set name="stackable" value="true"/>
     <set name="type" value="POTION"/>
     <set name="weight" value="180"/>
     <cond msgId="1508">
       <not>
         <player olympiad="true"/>
       </not>
     </cond>
     <cond msgId="1518">
       <player is_premium="true"/>
     </cond>
   </etcitem>

7) Service Administration
1)To instantly grant a premium account to a player in the game, use the GM command:
//set_pa <pa_id> <target>
Where <pa_id> is the number of the premium from the file gameserver/config/services_rate_bonus.xml rate_bonus id="?", and <target> is the player you select as the target.

2) To issue, remove, or edit bonuses for an offline player or directly in the database, you can use the `accounts_bonuses` table. Below is its description and an example:
SQL:
CREATE TABLE IF NOT EXISTS `accounts_bonuses` (
  `account` VARCHAR(45) NOT NULL,
  `expireTime` INT(11) NOT NULL,
  `rateXp` DOUBLE NOT NULL,
  `rateSp` DOUBLE NOT NULL,
  `rateRaidXp` DOUBLE NOT NULL,
  `rateRaidSp` DOUBLE NOT NULL,
  `questRewardRate` DOUBLE NOT NULL,
  `questRewardAdenaRate` DOUBLE NOT NULL,
  `questDropRate` DOUBLE NOT NULL,
  `dropAdena` DOUBLE NOT NULL,
  `dropItems` DOUBLE NOT NULL,
  `dropSealStones` DOUBLE NOT NULL,
  `dropRaidItems` DOUBLE NOT NULL,
  `dropSpoil` DOUBLE NOT NULL,
  `enchantItemBonus` DOUBLE DEFAULT '1.0',
  `enchantSkillBonus` DOUBLE DEFAULT '1.0',
  `hwidsLimit` INT NULL DEFAULT '1',
  PRIMARY KEY (`account`)
);
Here is an example of manually granting a bonus in the database:
SQL:
INSERT INTO accounts_bonuses
(account, expireTime, rateXp, rateSp, rateRaidXp, rateRaidSp, questRewardRate, questRewardAdenaRate, questDropRate, dropAdena, dropItems, dropSealStones, dropRaidItems, dropSpoil, enchantItemBonus, enchantSkillBonus, hwidsLimit)
VALUES
('test', 1690038888, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 1.2, 2, 1.2, 1.2, 1, 1, 1);

Where:
- 'test' is the account name.
- 1690038888 is the time when the premium account will expire. Unix TimeStamp format, here is you can make own calculations https://www.epochconverter.com/
- Following are the corresponding columns: rateXp, rateSp, rateRaidXp, rateRaidSp, questRewardRate, questRewardAdenaRate, questDropRate, dropAdena, dropItems, dropSealStones, dropRaidItems, dropSpoil, enchantItemBonus, enchantSkillBonus, and hwidsLimit.

If you have any questions, I'll be happy to answer and provide further explanations.
 
Last edited:
Back
Top