Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Premium Service

Iniciado por Swarlog, Jul 25, 2025, 12:25 AM

Tema anterior - Siguiente tema

Swarlog

CitarCORE:

### Eclipse Workspace Patch 1.0
#P L2J_Server
Index: java/com/l2jserver/gameserver/model/actor/L2Character.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Character.java	(revision 5044)
+++ java/com/l2jserver/gameserver/model/actor/L2Character.java	(working copy)
@@ -205,6 +205,7 @@
 	public static final byte ZONE_ALTERED = 19;
 	public static final byte ZONE_NOBOOKMARK = 20;
 	public static final byte ZONE_NOITEMDROP = 21;
+	private int _PremiumService;
 	
 	private final byte[] _zones = new byte[22];
 	protected byte _zoneValidateCounter = 4;
@@ -6998,4 +6999,18 @@
 	{
 		return _effects.isAffected(flag);
 	}
+	
+	/**
+	 * For Premium Service
+	 */
+		
+	public void setPremiumService(int PS)
+	{ 
+		_PremiumService=PS;
+	}      
+		
+	public int getPremiumService()
+	{ 
+		return _PremiumService;	       
+	}
 }
Index: java/com/l2jserver/gameserver/model/L2Party.java
===================================================================
--- java/com/l2jserver/gameserver/model/L2Party.java	(revision 5044)
+++ java/com/l2jserver/gameserver/model/L2Party.java	(working copy)
@@ -670,17 +670,23 @@
 	 * @param rewardedMembers The list of L2PcInstance to reward
 	 *
 	 */
-	public void distributeXpAndSp(long xpReward, int spReward, List<L2Playable> rewardedMembers, int topLvl, int partyDmg, L2Attackable target)
+	public void distributeXpAndSp(long xpReward_pr, int spReward_pr, long xpReward, int spReward, List<L2Playable> rewardedMembers, int topLvl, int partyDmg, L2Attackable target)
 	{
 		L2SummonInstance summon = null;
 		List<L2Playable> validMembers = getValidMembers(rewardedMembers, topLvl);
 		
 		float penalty;
 		double sqLevel;
+		int temp_sp;
+		long temp_exp;
 		double preCalculation;
 		
 		xpReward *= getExpBonus(validMembers.size());
 		spReward *= getSpBonus(validMembers.size());
+		xpReward_pr *= getExpBonus(validMembers.size());
+		spReward_pr *= getSpBonus(validMembers.size());
+		temp_exp = xpReward;
+		temp_sp = spReward;
 		
 		double sqLevelSum = 0;
 		for (L2Playable character : validMembers)
@@ -695,6 +701,16 @@
 			for (L2Character member : rewardedMembers)
 			{
 				if(member.isDead()) continue;
+
+				if (member.getPremiumService()==1)
+				{
+					xpReward=xpReward_pr;
+					spReward=spReward_pr;
+				} else
+				{
+					xpReward=temp_exp;
+					spReward=temp_sp;	
+				}
 				
 				penalty = 0;
 				
Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java	(revision 5044)
+++ java/com/l2jserver/Config.java	(working copy)
@@ -82,6 +82,17 @@
 	public static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.properties";
 	public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
 	
+ 	//--------------------------------------------------
+	// Premium Settings
+	//--------------------------------------------------
+	public static boolean USE_PREMIUMSERVICE; 
+	public static float PREMIUM_RATE_XP; 
+	public static float PREMIUM_RATE_SP; 
+	public static TIntFloatHashMap PR_RATE_DROP_ITEMS_ID; 
+	public static float PREMIUM_RATE_DROP_SPOIL; 
+	public static float PREMIUM_RATE_DROP_ITEMS; 
+	public static float PREMIUM_RATE_DROP_QUEST;
+	public static float PREMIUM_RATE_DROP_ITEMS_BY_RAID;
 	
 	//--------------------------------------------------
 	// L2J Variable Definitions
@@ -2080,6 +2091,14 @@
 					L2Properties ratesSettings = new L2Properties();
 					is = new FileInputStream(new File(RATES_CONFIG_FILE));
 					ratesSettings.load(is);
+
+					USE_PREMIUMSERVICE = Boolean.parseBoolean(ratesSettings.getProperty("UsePremiumServices", "False")); 
+					PREMIUM_RATE_XP = Float.parseFloat(ratesSettings.getProperty("PremiumRateXp", "2")); 
+					PREMIUM_RATE_SP = Float.parseFloat(ratesSettings.getProperty("PremiumRateSp", "2"));  
+					PREMIUM_RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("PremiumRateDropSpoil", "2")); 
+					PREMIUM_RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("PremiumRateDropItems", "2")); 
+					PREMIUM_RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("PremiumRateDropQuest", "2"));
+					PREMIUM_RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("PremiumRateRaidDropItems", "2"));
 					
 					RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
 					RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
@@ -2193,6 +2212,33 @@
 					{
 						RATE_DROP_ITEMS_ID.put(57, RATE_DROP_ITEMS); //for Adena rate if not defined
 					}
+										// For Premium Service
+											PR_RATE_DROP_ITEMS_ID = new TIntFloatHashMap(propertySplit.length);
+												if (!propertySplit[0].isEmpty())
+													{
+														for (String item : propertySplit)
+														{
+															String[] itemSplit = item.split(",");
+															if (itemSplit.length != 2)
+																_log.warning(StringUtil.concat("Config.load(): invalid config property -> PremiumRateDropItemsById \"", item, "\""));
+															else
+															{
+															try
+																{
+																	PR_RATE_DROP_ITEMS_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
+																}
+																catch (NumberFormatException nfe)
+																{
+																	if (!item.isEmpty())
+																		_log.warning(StringUtil.concat("Config.load(): invalid config property -> PremiumRateDropItemsById \"", item, "\""));
+																}
+															}
+														}
+												}
+													if (PR_RATE_DROP_ITEMS_ID.get(57) == 1)
+													{
+														PR_RATE_DROP_ITEMS_ID.put(57, PREMIUM_RATE_DROP_ITEMS); //for Adena rate if not defined
+													}
 				}
 				catch (Exception e)
 				{
@@ -2872,7 +2918,14 @@
 	public static boolean setParameterValue(String pName, String pValue)
 	{
 		// rates.properties
-		if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
+		if (pName.equalsIgnoreCase("PremiumRateXp")) PREMIUM_RATE_XP = Float.parseFloat(pValue); 
+		else if (pName.equalsIgnoreCase("PremiumRateSp")) PREMIUM_RATE_SP = Float.parseFloat(pValue); 
+		else if (pName.equalsIgnoreCase("PremiumRateDropSpoil")) PREMIUM_RATE_DROP_SPOIL = Float.parseFloat(pValue); 
+		else if (pName.equalsIgnoreCase("PremiumRateDropItems")) PREMIUM_RATE_DROP_ITEMS = Float.parseFloat(pValue); 
+		else if (pName.equalsIgnoreCase("PremiumRateDropQuest")) PREMIUM_RATE_DROP_QUEST = Float.parseFloat(pValue);
+		else if (pName.equalsIgnoreCase("PremiumRateDropAdena")) PR_RATE_DROP_ITEMS_ID.put(57, Float.parseFloat(pValue));
+		else if (pName.equalsIgnoreCase("PremiumRateRaidDropItems")) PREMIUM_RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
+		else if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
 		else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
 		else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
 		else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
Index: java/com/l2jserver/gameserver/model/actor/L2Npc.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Npc.java	(revision 5044)
+++ java/com/l2jserver/gameserver/model/actor/L2Npc.java	(working copy)
@@ -1365,17 +1365,23 @@
 	/**
 	 * Return the Exp Reward of this L2NpcInstance contained in the L2NpcTemplate (modified by RATE_XP).<BR><BR>
 	 */
-	public int getExpReward()
+	public int getExpReward(int isPremium)
 	{
-		return (int) (getTemplate().rewardExp * Config.RATE_XP);
+		if (isPremium==1) 
+			return (int) (getTemplate().rewardExp * Config.PREMIUM_RATE_XP);
+		else
+			return (int) (getTemplate().rewardExp * Config.RATE_XP);
 	}
 	
 	/**
 	 * Return the SP Reward of this L2NpcInstance contained in the L2NpcTemplate (modified by RATE_SP).<BR><BR>
 	 */
-	public int getSpReward()
+	public int getSpReward(int isPremium)
 	{
-		return (int) (getTemplate().rewardSp * Config.RATE_SP);
+		if (isPremium==1) 
+			return (int) (getTemplate().rewardSp * Config.PREMIUM_RATE_SP);
+		else
+			return (int) (getTemplate().rewardSp * Config.RATE_SP);
 	}
 	
 	/**
Index: java/com/l2jserver/gameserver/Prem.java
===================================================================
--- java/com/l2jserver/gameserver/Prem.java	(revision 0)
+++ java/com/l2jserver/gameserver/Prem.java	(revision 0)
@@ -0,0 +1,53 @@
+package com.l2jserver.gameserver;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import com.l2jserver.Config;
+import com.l2jserver.L2DatabaseFactory;
+
+public class Prem
+{
+	
+	private long _end_pr_date;
+	public static final Prem getInstance()
+	{
+		return SingletonHolder._instance;
+	}
+	public long getPremServiceData(String playerAcc)
+	{
+		
+		Connection con = null;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement("SELECT premium_service,enddate FROM account_premium WHERE account_name=?");
+			statement.setString(1, playerAcc);
+			ResultSet rset = statement.executeQuery();
+			while (rset.next())
+			{
+				if (Config.USE_PREMIUMSERVICE)
+				{
+					_end_pr_date = rset.getLong("enddate");
+				}
+			}
+			statement.close();			
+		}
+		catch (Exception e)
+		{
+
+		}
+		finally
+		{
+			L2DatabaseFactory.close(con);
+		}
+		return _end_pr_date;
+	}
+	//Êîíåö
+	@SuppressWarnings("synthetic-access")
+	private static class SingletonHolder
+	{
+		protected static final Prem _instance = new Prem();
+	}
+}
\ No newline at end of file
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 5044)
+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
@@ -311,6 +311,11 @@
 	
 	// Character Shortcut SQL String Definitions:
 	private static final String DELETE_CHAR_SHORTCUTS = "DELETE FROM character_shortcuts WHERE charId=? AND class_index=?";
+
+    // Character PremiumService String Definitions: 
+    private static final String INSERT_PREMIUMSERVICE = "INSERT INTO account_premium (account_name,premium_service,enddate) values(?,?,?) ON DUPLICATE KEY UPDATE premium_service = ?, enddate = ?"; 
+    private static final String RESTORE_PREMIUMSERVICE = "SELECT premium_service,enddate FROM account_premium WHERE account_name=?"; 
+    private static final String UPDATE_PREMIUMSERVICE = "INSERT INTO account_premium (account_name,premium_service,enddate) values(?,?,?) ON DUPLICATE KEY UPDATE premium_service = ?, enddate = ?";
 	
 	// Character Transformation SQL String Definitions:
 	private static final String SELECT_CHAR_TRANSFORM = "SELECT transform_id FROM characters WHERE charId=?";
@@ -1510,6 +1515,102 @@
 			L2DatabaseFactory.close(con);
 		}
 	}
+ 
+    private void createPSdb()
+        {
+            Connection con = null;
+            try
+            {
+                con = L2DatabaseFactory.getInstance().getConnection();
+                PreparedStatement statement = con.prepareStatement(INSERT_PREMIUMSERVICE);
+                statement.setString(1, _accountName);
+                statement.setInt(2, 0);
+                statement.setLong(3, 0);
+                statement.setInt(4, 0);
+                statement.setLong(5, 0);
+                statement.executeUpdate();
+                statement.close();
+			} 
+				catch (Exception e) 
+			{ 
+				_log.warning("Could not insert char data: "+e); 
+				e.printStackTrace(); 
+				return; 
+				} 
+				finally 
+				{
+				L2DatabaseFactory.close(con);
+			}
+		} 
+ 
+    private static void PStimeOver(String account)
+        {
+            Connection con = null;
+            try
+            {
+           	 	con = L2DatabaseFactory.getInstance().getConnection();
+             	PreparedStatement statement = con.prepareStatement(UPDATE_PREMIUMSERVICE);
+             	statement.setString(1, account);
+          	 	statement.setInt(2, 0);
+           	 	statement.setLong(3, 0);
+           	 	statement.setInt(4, 0);
+           	 	statement.setLong(5, 0);
+           	 	statement.execute();
+           	 	statement.close();
+			} 
+			catch (SQLException e) 
+			{ 
+				_log.warning("PremiumService:  Could not increase data"); 
+			} 
+			finally 
+			{
+				L2DatabaseFactory.close(con);
+			}            
+	} 
+
+	private static void restorePremServiceData(L2PcInstance player, String account) 
+		{ 
+			boolean sucess = false;  
+			Connection con = null; 
+			try 
+				{ 
+				con = L2DatabaseFactory.getInstance().getConnection(); 
+				PreparedStatement statement = con.prepareStatement(RESTORE_PREMIUMSERVICE); 
+				statement.setString(1, account); 
+				ResultSet rset = statement.executeQuery(); 
+				while (rset.next()) 
+				{ 
+					sucess = true; 
+				if (Config.USE_PREMIUMSERVICE)
+					{ 
+						if (rset.getLong("enddate") <= System.currentTimeMillis())
+						{ 
+							PStimeOver(account); 
+							player.setPremiumService(0); 
+						} 
+						else 
+							player.setPremiumService(rset.getInt("premium_service")); 
+					} 
+					else 
+					player.setPremiumService(0); 
+				} 
+					statement.close(); 
+			} 
+			catch (Exception e) 
+			{ 
+			_log.warning("PremiumService: Could not restore PremiumService data for:" + account + "."+e); 
+			e.printStackTrace(); 
+			} 
+			finally 
+			{
+				L2DatabaseFactory.close(con);
+			}
+			if (sucess==false)
+			{
+				player.createPSdb();
+				player.setPremiumService(0);
+			}
+	}
 	
 	private void deleteRecipeData(int recipeId, boolean isDwarf)
 	{
@@ -7057,6 +7158,7 @@
 				
 				player = new L2PcInstance(objectId, template, rset.getString("account_name"), app);
 				player.setName(rset.getString("char_name"));
+				restorePremServiceData(player, rset.getString("account_name"));
 				player._lastAccess = rset.getLong("lastAccess");
 				
 				player.getStat().setExp(rset.getLong("exp"));
@@ -11177,7 +11279,7 @@
 	@Override
 	public void addExpAndSp(long addToExp, int addToSp)
 	{
-		getStat().addExpAndSp(addToExp, addToSp, false);
+		getStat().addExpAndSp(addToExp, addToSp);
 	}
 	
 	public void addExpAndSp(long addToExp, int addToSp, boolean useVitality)
@@ -11187,12 +11289,12 @@
 	
 	public void removeExpAndSp(long removeExp, int removeSp)
 	{
-		getStat().removeExpAndSp(removeExp, removeSp, true);
+		getStat().removeExpAndSp(removeExp, removeSp);
 	}
 	
 	public void removeExpAndSp(long removeExp, int removeSp, boolean sendMessage)
 	{
-		getStat().removeExpAndSp(removeExp, removeSp, sendMessage);
+		getStat().removeExpAndSp(removeExp, removeSp);
 	}
 	
 	@Override
Index: dist/game/config/rates.properties
===================================================================
--- dist/game/config/rates.properties	(revision 5044)
+++ dist/game/config/rates.properties	(working copy)
@@ -164,3 +164,16 @@
 # Notes:
 #	Works only if EnableVitality = True
 RateVitalityHerbs = 1
+
+
+# ---------------------------------------------------------------------------
+# PREMIUM
+# ---------------------------------------------------------------------------
+UsePremiumServices = True
+PremiumRateXp = 2
+PremiumRateSp = 2
+PremiumRateDropAdena = 2
+PremiumRateDropItems = 2
+PremiumRateDropSpoil = 2
+PremiumRateDropQuest = 2
+PremiumRateRaidDropItems = 1
Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java	(revision 5044)
+++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -69,6 +69,7 @@
 import com.l2jserver.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
 import com.l2jserver.gameserver.network.serverpackets.ExNoticePostArrived;
 import com.l2jserver.gameserver.network.serverpackets.ExNotifyPremiumItem;
+import com.l2jserver.gameserver.network.serverpackets.ExBrPremiumState;
 import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
 import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;
 import com.l2jserver.gameserver.network.serverpackets.ExVoteSystemInfo;
@@ -77,6 +78,7 @@
 import com.l2jserver.gameserver.network.serverpackets.ItemList;
 import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
 import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListAll;
+import com.l2jserver.gameserver.network.serverpackets.PremiumState;
 import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
 import com.l2jserver.gameserver.network.serverpackets.PledgeSkillList;
 import com.l2jserver.gameserver.network.serverpackets.PledgeStatusChanged;
@@ -156,6 +158,15 @@
 			if (Config.DEBUG)
 				_log.warning("User already exists in Object ID map! User "+activeChar.getName()+" is a character clone.");
 		}
+
+		if (activeChar.getPremiumService()==1)                                                                                    
+		{
+		     activeChar.sendPacket(new ExBrPremiumState(activeChar.getObjectId(), 1));              
+		}
+		else                                                                                                                        
+		{
+		     activeChar.sendPacket(new ExBrPremiumState(activeChar.getObjectId(),0));                                            
+		}
 		
 		// Apply special GM properties to the GM when entering
 		if (activeChar.isGM())
@@ -630,4 +641,13 @@
 	{
 		return false;
 	}
+
+	private void PremiumServiceIcon(L2PcInstance activeChar)
+	{
+		if(activeChar.getPremiumService()==1)
+		{
+			activeChar.sendPacket(new PremiumState(activeChar.getObjectId(), 1));
+			activeChar.sendMessage("Premium account: now active");
+		}
+	}
 }
Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Attackable.java	(revision 5044)
+++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java	(working copy)
@@ -660,8 +660,8 @@
 			if (!rewards.isEmpty())
 			{
 				L2Party attackerParty;
-				long exp;
-				int levelDiff, partyDmg, partyLvl, sp;
+				long exp, exp_premium = 0;
+				int levelDiff, partyDmg, partyLvl, sp, sp_premium;
 				float partyMul, penalty;
 				RewardInfo reward2;
 				int[] tmp;
@@ -713,7 +713,7 @@
 							// mob = 24, atk = 50, diff = 26 (no xp)
 							levelDiff = attacker.getLevel() - getLevel();
 							
-							tmp = calculateExpAndSp(levelDiff, damage);
+							tmp = calculateExpAndSp(levelDiff, damage, attacker.getPremiumService());
 							exp = tmp[0];
 							exp *= 1 - penalty;
 							sp = tmp[1];
@@ -732,6 +732,7 @@
 								{
 									player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.OVER_HIT));
 									exp += calculateOverhitExp(exp);
+									exp_premium += calculateOverhitExp(exp_premium);
 								}
 							}
 							
@@ -851,7 +852,10 @@
 						levelDiff = partyLvl - getLevel();
 						
 						// Calculate Exp and SP rewards
-						tmp = calculateExpAndSp(levelDiff, partyDmg);
+						tmp = calculateExpAndSp(levelDiff, partyDmg, 1); 
+						exp_premium = tmp[0]; 
+						sp_premium = tmp[1]; 
+						tmp = calculateExpAndSp(levelDiff, partyDmg, 0);
 						exp = tmp[0];
 						sp = tmp[1];
 						
@@ -863,6 +867,8 @@
 						
 						exp *= partyMul;
 						sp *= partyMul;
+						exp_premium *= partyMul; 
+						sp_premium *= partyMul;
 						
 						// Check for an over-hit enabled strike
 						// (When in party, the over-hit exp bonus is given to the whole party and splitted proportionally through the party members)
@@ -878,7 +884,7 @@
 						}
 						// Distribute Experience and SP rewards to L2PcInstance Party members in the known area of the last attacker
 						if (partyDmg > 0)
-							attackerParty.distributeXpAndSp(exp, sp, rewardedMembers, partyLvl, partyDmg, this);
+							attackerParty.distributeXpAndSp(exp_premium, sp_premium, exp, sp, rewardedMembers, partyLvl, partyDmg, this);
 					}
 				}
 			}
@@ -1223,9 +1229,18 @@
 		
 		// Applies Drop rates
 		if (Config.RATE_DROP_ITEMS_ID.get(drop.getItemId()) != 0)
+		if (lastAttacker.getPremiumService()==1) 
+			dropChance *= Config.PR_RATE_DROP_ITEMS_ID.get(drop.getItemId()); 
+		else
 			dropChance *= Config.RATE_DROP_ITEMS_ID.get(drop.getItemId());
 		else if (isSweep)
-			dropChance *= Config.RATE_DROP_SPOIL;
+		if (lastAttacker.getPremiumService()==1) 
+			dropChance *= Config.PREMIUM_RATE_DROP_SPOIL; 
+ 		else
+			dropChance *= Config.RATE_DROP_SPOIL;	
+		else
+		if (lastAttacker.getPremiumService()==1) 
+			dropChance *= isRaid() && !isRaidMinion() ? Config.PREMIUM_RATE_DROP_ITEMS_BY_RAID : Config.PREMIUM_RATE_DROP_ITEMS;
 		else
 			dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
 		
@@ -1326,7 +1341,10 @@
 			categoryDropChance = ((categoryDropChance - ((categoryDropChance * levelModifier)/100)) / deepBlueDrop);
 		
 		// Applies Drop rates
-		categoryDropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
+		if (lastAttacker.getPremiumService()==1) 
+			categoryDropChance *= isRaid() && !isRaidMinion() ? Config.PREMIUM_RATE_DROP_ITEMS_BY_RAID : Config.PREMIUM_RATE_DROP_ITEMS; 
+		else
+			categoryDropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
 		
 		if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
 			categoryDropChance *= Config.L2JMOD_CHAMPION_REWARDS;
@@ -1361,8 +1379,14 @@
 			int dropChance = drop.getChance();
 			
 			if (Config.RATE_DROP_ITEMS_ID.get(drop.getItemId()) != 0)
+			if (lastAttacker.getPremiumService()==1)
+				dropChance *= Config.PR_RATE_DROP_ITEMS_ID.get(drop.getItemId());
+			else
 				dropChance *= Config.RATE_DROP_ITEMS_ID.get(drop.getItemId());
 			else
+			if (lastAttacker.getPremiumService()==1)
+				dropChance *= isRaid() && !isRaidMinion() ? Config.PREMIUM_RATE_DROP_ITEMS_BY_RAID : Config.PREMIUM_RATE_DROP_ITEMS;
+			else
 				dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
 			
 			if (Config.L2JMOD_CHAMPION_ENABLE && isChampion())
@@ -2031,7 +2055,7 @@
 	 * @param damage The damages given by the attacker (L2PcInstance, L2SummonInstance or L2Party)
 	 *
 	 */
-	private int[] calculateExpAndSp(int diff, int damage)
+	private int[] calculateExpAndSp(int diff, int damage, int IsPremium)
 	{
 		double xp;
 		double sp;
@@ -2039,11 +2063,11 @@
 		if (diff < -5)
 			diff = -5; // makes possible to use ALT_GAME_EXPONENT configuration
 		
-		xp = (double)getExpReward() * damage / getMaxHp();
+		xp = (double)getExpReward(IsPremium) * damage / getMaxHp();
 		if (Config.ALT_GAME_EXPONENT_XP != 0)
 			xp *= Math.pow(2., -diff / Config.ALT_GAME_EXPONENT_XP);
 		
-		sp = (double)getSpReward() * damage / getMaxHp();
+		sp = (double)getSpReward(IsPremium) * damage / getMaxHp();
 		if (Config.ALT_GAME_EXPONENT_SP != 0)
 			sp *= Math.pow(2., -diff / Config.ALT_GAME_EXPONENT_SP);
 

CitarDATA:

### Eclipse Workspace Patch 1.0
#P L2J_DataPack
Index: dist/game/data/scripts/handlers/MasterHandler.java
===================================================================
--- dist/game/data/scripts/handlers/MasterHandler.java	(revision 8494)
+++ dist/game/data/scripts/handlers/MasterHandler.java	(working copy)
@@ -79,6 +79,7 @@
 import handlers.admincommandhandlers.AdminPathNode;
 import handlers.admincommandhandlers.AdminPetition;
 import handlers.admincommandhandlers.AdminPledge;
+import handlers.admincommandhandlers.AdminPremium;
 import handlers.admincommandhandlers.AdminPolymorph;
 import handlers.admincommandhandlers.AdminQuest;
 import handlers.admincommandhandlers.AdminRepairChar;
@@ -243,6 +244,7 @@
 import handlers.voicedcommandhandlers.ChatAdmin;
 import handlers.voicedcommandhandlers.Debug;
 import handlers.voicedcommandhandlers.Lang;
+import handlers.voicedcommandhandlers.Premium;
 import handlers.voicedcommandhandlers.TvTVoicedInfo;
 import handlers.voicedcommandhandlers.Wedding;
 import handlers.voicedcommandhandlers.stats;
@@ -345,6 +347,7 @@
 		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminPetition());
 		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminPForge());
 		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminPledge());
+		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminPremium());
 		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminPolymorph());
 		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminQuest());
 		AdminCommandHandler.getInstance().registerAdminCommandHandler(new AdminRepairChar());
@@ -535,6 +538,7 @@
 	
 	private static void loadVoicedHandlers()
 	{
+		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Premium());
 		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new stats());
 		if (Config.L2JMOD_ALLOW_WEDDING)
 			VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Wedding());
Index: dist/game/data/html/admin/main_menu.htm
===================================================================
--- dist/game/data/html/admin/main_menu.htm	(revision 8494)
+++ dist/game/data/html/admin/main_menu.htm	(working copy)
@@ -37,5 +37,7 @@
 <td><button value="Delete" action="bypass -h admin_delete" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 <td><button value="Heal" action="bypass -h admin_heal" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
 <td><button value="Full Food" action="bypass -h admin_fullfood" width=65 height=21 back="L2UI_CT1.Button_DF_Down" fore="L2UI_CT1.Button_DF"></td>
+</tr><tr>
+<td><button value="Pr.Service" action="bypass -h admin_premium_menu" width=65 height=20 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
 </tr></table>
 </center></body></html>
\ No newline at end of file
Index: dist/game/data/html/admin/premium_menu.htm
===================================================================
--- dist/game/data/html/admin/premium_menu.htm	(revision 0)
+++ dist/game/data/html/admin/premium_menu.htm	(revision 0)
@@ -0,0 +1,13 @@
+<html><title>Premium Service Menu</title><body>
+<center>
+<br>
+<font color="LEVEL">Premium Service Menu</font><br>
+<br>
+Enter Account Name:<br>
+<edit var="acc_name" width=200>
+<br><button value="Add 1 month Premium Services" action="bypass -h admin_premium_add1 $acc_name" width=200 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+<button value="Add 2 month Premium Services" action="bypass -h admin_premium_add2 $acc_name" width=200 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+<button value="Add 3 month Premium Services" action="bypass -h admin_premium_add3 $acc_name" width=200 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+
+</center>
+</body></html>
\ No newline at end of file
Index: dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java
===================================================================
--- dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java	(revision 0)
+++ dist/game/data/scripts/handlers/voicedcommandhandlers/Premium.java	(revision 0)
@@ -0,0 +1,84 @@
+package handlers.voicedcommandhandlers;
+ 
+import javolution.text.TextBuilder;
+import java.text.SimpleDateFormat;
+ 
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.Prem;
+import com.l2jserver.gameserver.handler.IVoicedCommandHandler;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
+ 
+public class Premium implements IVoicedCommandHandler
+{
+    private static final String[] VOICED_COMMANDS = { 
+        "premium" 
+    };
+ 
+    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
+    {
+        if (command.startsWith("premium"))
+        {   
+            SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+            if(activeChar.getPremiumService() == 0)
+            {
+                NpcHtmlMessage preReply = new NpcHtmlMessage(5);
+                TextBuilder html3 = new TextBuilder("<html><body><title>Normal Account</title><center>");
+                html3.append("<table>");
+                html3.append("<tr><td><center>Your account :<font color=\"LEVEL\">Normal<br></font></td></tr>");
+                html3.append("<tr><td><center>Details<br1></td></tr>");
+                html3.append("<tr><td>Rate EXP: <font color=\"LEVEL\"> Your Rate <br1></font></td></tr>");
+                html3.append("<tr><td>Rate SP: <font color=\"LEVEL\"> Your Rate  <br1></font></td></tr>");
+                html3.append("<tr><td>Rate Spoil: <font color=\"LEVEL\"> Your Rate <br1></font></td></tr><br>");
+                html3.append("<tr><td>Expires : <font color=\"00A5FF\"> Never (Normal Account)<br1></font></td></tr>");
+                html3.append("<tr><td>Current Date : <font color=\"70FFCA\"> :"+ String.valueOf(format.format(System.currentTimeMillis()))+ " <br><br></font></td></tr><br><br1><br1>");
+                html3.append("<tr><td><font color=\"LEVEL\"><center>Premium Info & Rules<br1></font></td></tr>");
+                html3.append("<tr><td>Upgrade to Premium Account : <font color=\"70FFCA\"> http://www.yourLINK.net</font></td></tr>");
+                html3.append("<tr><td>Premium Account : <font color=\"70FFCA\"> Benefits<br1></font></td></tr>");
+                html3.append("<tr><td>Rate EXP: <font color=\"LEVEL\"> "+Config.PREMIUM_RATE_XP+" (Account Premium )<br1></font></td></tr>");
+                html3.append("<tr><td>Rate SP: <font color=\"LEVEL\"> "+Config.PREMIUM_RATE_SP+" (Account Premium )<br1></font></td></tr>");
+                html3.append("<tr><td>Drop Spoil Rate: <font color=\"LEVEL\"> "+Config.PREMIUM_RATE_DROP_SPOIL+" (Account Premium )<br1></font></td></tr>");
+                html3.append("<tr><td> <font color=\"70FFCA\">1.Premium  benefits CAN NOT BE TRANSFERED.<br1></font></td></tr><br>");
+                html3.append("<tr><td> <font color=\"70FFCA\">2.Premium benefits effect ALL characters in same account.<br1></font></td></tr><br>");
+                html3.append("<tr><td> <font color=\"70FFCA\">3.Does not effect Party members.</font></td></tr>");
+                html3.append("</table>");
+                html3.append("</center></body></html>");
+               
+                preReply.setHtml(html3.toString());
+                activeChar.sendPacket(preReply);
+            }else
+            {
+                long _end_prem_date;
+                _end_prem_date = Prem.getInstance().getPremServiceData(activeChar.getAccountName());
+                NpcHtmlMessage preReply = new NpcHtmlMessage(5);
+               
+                TextBuilder html3 = new TextBuilder("<html><body><title>Premium Account Details</title><center>");
+                html3.append("<table>");
+                html3.append("<tr><td><center>Thank you for supporting YOUR server.<br><br></td></tr>");
+                html3.append("<tr><td><center>Your account : <font color=\"LEVEL\">Premium<br></font></td></tr>");
+                html3.append("<tr><td><center>Details<br1></center></td></tr>");
+                html3.append("<tr><td>Rate EXP: <font color=\"LEVEL\"> x"+Config.PREMIUM_RATE_XP+" <br1></font></td></tr>");
+                html3.append("<tr><td>Rate SP: <font color=\"LEVEL\"> x"+Config.PREMIUM_RATE_SP+"  <br1></font></td></tr>");
+                html3.append("<tr><td>Rate Spoil: <font color=\"LEVEL\"> x"+Config.PREMIUM_RATE_DROP_SPOIL+" <br1></font></td></tr>");
+                html3.append("<tr><td>Expires : <font color=\"00A5FF\"> "+ String.valueOf(format.format(_end_prem_date))+" (Premium added)</font></td></tr>");
+                html3.append("<tr><td>Current Date : <font color=\"70FFCA\"> :"+ String.valueOf(format.format(System.currentTimeMillis()))+ " <br><br></font></td></tr>");
+                html3.append("<tr><td><font color=\"LEVEL\"><center>Premium Info & Rules<br1></font></center></td></tr>");
+                html3.append("<tr><td><font color=\"70FFCA\">1.Premium Account CAN NOT BE TRANSFERED.<br1></font></td></tr>");
+                html3.append("<tr><td><font color=\"70FFCA\">2.Premium Account effects ALL characters in same account.<br1></font></td></tr>");
+                html3.append("<tr><td><font color=\"70FFCA\">3.Does not effect Party members.<br><br></font></td></tr>");
+                html3.append("</table>");
+                html3.append("</center></body></html>");
+               
+                preReply.setHtml(html3.toString());
+                activeChar.sendPacket(preReply);
+ 
+            }
+        }
+        return true;
+    }
+ 
+    public String[] getVoicedCommandList()
+    {
+        return VOICED_COMMANDS;
+    }
+}
\ No newline at end of file
Index: dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java
===================================================================
--- dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java	(revision 0)
+++ dist/game/data/scripts/handlers/admincommandhandlers/AdminPremium.java	(revision 0)
@@ -0,0 +1,107 @@
+package handlers.admincommandhandlers;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.PreparedStatement;
+
+import java.util.Calendar;
+import java.util.logging.Logger;
+
+import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.handler.IAdminCommandHandler;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+
+public class AdminPremium implements IAdminCommandHandler
+{
+	private static final String[] ADMIN_COMMANDS = { "admin_premium_menu", "admin_premium_add1", "admin_premium_add2", "admin_premium_add3" };
+	
+private static final String UPDATE_PREMIUMSERVICE = "UPDATE account_premium SET premium_service=?,enddate=? WHERE account_name=?";
+private static final Logger _log = Logger.getLogger(AdminPremium.class.getName());
+
+	public boolean useAdminCommand(String command, L2PcInstance activeChar)
+	{
+		if (command.equals("admin_premium_menu"))
+		{
+			AdminHelpPage.showHelpPage(activeChar, "premium_menu.htm");
+		}
+		else if (command.startsWith("admin_premium_add1"))
+		{
+			try
+            {
+                String val = command.substring(19);
+                addPremiumServices(1, val);
+            }
+            catch(StringIndexOutOfBoundsException e)
+            {
+                activeChar.sendMessage("Err");
+            }
+        }
+		else if(command.startsWith("admin_premium_add2"))
+        {
+            try
+            {
+                String val = command.substring(19);
+                addPremiumServices(2, val);
+            }
+            catch(StringIndexOutOfBoundsException e)
+            {
+                activeChar.sendMessage("Err");
+            }
+        }
+		else if(command.startsWith("admin_premium_add3"))
+        {
+            try
+            {
+                String val = command.substring(19);
+                addPremiumServices(3, val);
+            }
+            catch(StringIndexOutOfBoundsException e)
+            {
+                activeChar.sendMessage("Err");
+            }
+        }
+        return true;
+    }
+	
+	public String[] getAdminCommandList()
+	{
+		return ADMIN_COMMANDS;
+	}
+	
+	private void addPremiumServices(int Months,String AccName)
+	{
+		Connection con = null;
+		try
+		{
+			Calendar finishtime = Calendar.getInstance();
+			finishtime.setTimeInMillis(System.currentTimeMillis());
+			finishtime.set(Calendar.SECOND, 0);
+			finishtime.add(Calendar.MONTH, Months);
+			
+			con = L2DatabaseFactory.getInstance().getConnection();
+			PreparedStatement statement = con.prepareStatement(UPDATE_PREMIUMSERVICE);
+			statement.setInt(1, 1);
+			statement.setLong(2, finishtime.getTimeInMillis());
+			statement.setString(3, AccName);
+			statement.execute();
+			statement.close();
+		}
+		catch (SQLException e)
+		{
+			_log.info("PremiumService:  Could not increase data");
+		}
+		finally
+		{
+			try
+			{
+				if (con != null)
+					con.close();
+			}
+			catch (SQLException e)
+			{
+				e.printStackTrace();
+			}
+		}		
+		
+	}
+}
\ No newline at end of file

CitarSQL:

DROP TABLE IF EXISTS `account_premium`;

CREATE TABLE `account_premium` (
  `account_name` varchar(45) NOT NULL DEFAULT '',
  `premium_service` int(1) NOT NULL DEFAULT '0',
  `enddate` decimal(20,0) NOT NULL DEFAULT '0',
  PRIMARY KEY (`account_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `account_premium` VALUES ('TEST', '1', '1300532040218');

INSERT INTO `admin_command_access_rights` VALUES ('admin_add_premium', '1', 'false');

INSERT INTO `admin_command_access_rights` VALUES ('admin_premium_menu', '1', 'false');

INSERT INTO `admin_command_access_rights` VALUES ('admin_premium_add1', '1', 'false');

INSERT INTO `admin_command_access_rights` VALUES ('admin_premium_add2', '1', 'false');

INSERT INTO `admin_command_access_rights` VALUES ('admin_premium_add3', '1', 'false');