Advertisement
Guest User

Untitled

a guest
May 5th, 2011
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 22.33 KB | None | 0 0
  1. Index: java/config/pccafe.properties
  2. ===================================================================
  3. --- pccafe.properties   (revision 0)
  4. +++ pccafe.properties   (revision 0)
  5. @@ -0,0 +1,23 @@
  6. +#PC Bang Event Enabled
  7. +Enabled=True
  8. +
  9. +#Max points that player may have
  10. +#limited to int limit
  11. +MaxPcBangPoints=200000
  12. +
  13. +#Use random in rewarding with points
  14. +#If enabled points will be random from points/2 to points
  15. +AcquisitionPointsRandom=False
  16. +
  17. +#Creates a chance to aquire double point
  18. +DoublingAcquisitionPoints=True
  19. +
  20. +#Double points chance
  21. +#if DoublingAcquisitionPoints=True
  22. +DoublingAcquisitionPointsChance=1
  23. +
  24. +#PC Bang point rate
  25. +#e.g. with 1.0 it's 10000 exp = 1 PC Bang point
  26. +#2.0 - 10000 exp = 2 PC Bang points
  27. +#0.5 - 5000  exp = 1 PC Bang point
  28. +AcquisitionPointsRate = 1.0
  29. Index: java/com/l2jserver/Config.java
  30. ===================================================================
  31. --- java/com/l2jserver/Config.java  (revision 4422)
  32. +++ java/com/l2jserver/Config.java  (working copy)
  33. @@ -81,8 +81,8 @@
  34.     public static final String COMMUNITY_CONFIGURATION_FILE = "./config/CommunityServer.properties";
  35.     public static final String GRANDBOSS_CONFIG_FILE = "./config/Grandboss.properties";
  36.     public static final String CHAT_FILTER_FILE = "./config/chatfilter.txt";
  37. +   public static final String PCBANG_CONFIG_FILE = "./config/pccafe.properties";
  38.    
  39. -  
  40.     //--------------------------------------------------
  41.     // L2J Variable Definitions
  42.     //--------------------------------------------------
  43. @@ -1002,6 +1036,17 @@
  44.     public static int Interval_Of_Frintezza_Spawn;
  45.     public static int Random_Of_Frintezza_Spawn;
  46.    
  47. +   /////////////////////////////////////////////////
  48. +   //              PC Bang Settings
  49. +   /////////////////////////////////////////////////
  50. +   public static boolean PC_BANG_ENABLED;
  51. +   public static int MAX_PC_BANG_POINTS;
  52. +   public static boolean ENABLE_DOUBLE_PC_BANG_POINTS;
  53. +   public static int DOUBLE_PC_BANG_POINTS_CHANCE;
  54. +   public static double PC_BANG_POINT_RATE;
  55. +   public static boolean RANDOM_PC_BANG_POINT;
  56. +
  57. +  
  58.     //chatfilter
  59.     public static ArrayList<String> FILTER_LIST;
  60.    
  61. @@ -2661,8 +2878,33 @@
  62.                     throw new Error("Failed to Load " + GRANDBOSS_CONFIG_FILE + " File.");
  63.                 }
  64.                
  65. +               // PC Bang
  66.                 try
  67.                 {
  68. +                   L2Properties pccaffeSettings = new L2Properties();
  69. +                   is = new FileInputStream(new File(PCBANG_CONFIG_FILE));
  70. +                   pccaffeSettings.load(is);
  71. +
  72. +                   PC_BANG_ENABLED = Boolean.parseBoolean(pccaffeSettings.getProperty("Enabled", "false"));
  73. +                   MAX_PC_BANG_POINTS = Integer.parseInt(pccaffeSettings.getProperty("MaxPcBangPoints", "200000"));
  74. +                   if(MAX_PC_BANG_POINTS<0)
  75. +                       MAX_PC_BANG_POINTS=0;
  76. +                   ENABLE_DOUBLE_PC_BANG_POINTS = Boolean.parseBoolean(pccaffeSettings.getProperty("DoublingAcquisitionPoints", "false"));
  77. +                   DOUBLE_PC_BANG_POINTS_CHANCE = Integer.parseInt(pccaffeSettings.getProperty("DoublingAcquisitionPointsChance", "1"));
  78. +                   if(DOUBLE_PC_BANG_POINTS_CHANCE<0 || DOUBLE_PC_BANG_POINTS_CHANCE>100)
  79. +                       DOUBLE_PC_BANG_POINTS_CHANCE=1;
  80. +                   PC_BANG_POINT_RATE = Double.parseDouble(pccaffeSettings.getProperty("AcquisitionPointsRate", "1.0"));
  81. +                   if(PC_BANG_POINT_RATE<0)
  82. +                       PC_BANG_POINT_RATE=1;
  83. +                   RANDOM_PC_BANG_POINT = Boolean.parseBoolean(pccaffeSettings.getProperty("AcquisitionPointsRandom", "false"));
  84. +               }
  85. +               catch (Exception e)
  86. +               {
  87. +                   e.printStackTrace();
  88. +                   throw new Error("Failed to Load " + PCBANG_CONFIG_FILE + " File.");
  89. +               }
  90. +               try
  91. +               {
  92.                     FILTER_LIST = new ArrayList<String>();
  93.                     LineNumberReader lnr = new LineNumberReader(new BufferedReader(new FileReader(new File(CHAT_FILTER_FILE))));
  94.                     String line = null;
  95. Index: java/com/l2jserver/gameserver/datatables/MultiSell.java
  96. ===================================================================
  97. --- java/com/l2jserver/gameserver/datatables/MultiSell.java (revision 4422)
  98. +++ java/com/l2jserver/gameserver/datatables/MultiSell.java (working copy)
  99. @@ -41,6 +41,7 @@
  100. import com.l2jserver.gameserver.network.serverpackets.MultiSellList;
  101. import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  102. import com.l2jserver.gameserver.network.serverpackets.UserInfo;
  103. +import com.l2jserver.gameserver.network.serverpackets.ExPCCafePointInfo;
  104.  
  105. public class MultiSell
  106. {
  107. @@ -118,6 +119,13 @@
  108.     {
  109.         switch (id)
  110.         {
  111. +           case PC_BANG_POINTS: //PcBang points
  112. +               if (player.getPcBangPoints() < amount)
  113. +               {
  114. +                   player.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
  115. +                   break;
  116. +               }
  117. +               return true;
  118.             case CLAN_REPUTATION:
  119.                 if (player.getClan() == null)
  120.                 {
  121. @@ -150,6 +158,14 @@
  122.     {
  123.         switch (id)
  124.         {
  125. +           case PC_BANG_POINTS: //PcBang points
  126. +               final int cost = player.getPcBangPoints() - (int)(amount);
  127. +               player.setPcBangPoints(cost);
  128. +               SystemMessage smsgpc = new SystemMessage(SystemMessageId.USING_S1_PCPOINT);
  129. +               smsgpc.addNumber((int)amount);
  130. +               player.sendPacket(smsgpc);
  131. +               player.sendPacket(new ExPCCafePointInfo(player.getPcBangPoints(), (int)amount, false, false, 1));
  132. +               return true;
  133.             case CLAN_REPUTATION:
  134.                 player.getClan().takeReputationScore((int)amount, true);
  135.                 SystemMessage smsg = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
  136. @@ -347,6 +363,7 @@
  137.     {
  138.         switch (ing.getItemId())
  139.         {
  140. +           case PC_BANG_POINTS:
  141.             case CLAN_REPUTATION:
  142.             case FAME:
  143.                 return true;
  144. Index: java/com/l2jserver/gameserver/GameServer.java
  145. ===================================================================
  146. --- java/com/l2jserver/gameserver/GameServer.java   (revision 4422)
  147. +++ java/com/l2jserver/gameserver/GameServer.java   (working copy)
  148. @@ -105,6 +105,7 @@
  149. import com.l2jserver.gameserver.instancemanager.ItemsOnGroundManager;
  150. import com.l2jserver.gameserver.instancemanager.MailManager;
  151. import com.l2jserver.gameserver.instancemanager.MercTicketManager;
  152. +import com.l2jserver.gameserver.instancemanager.PcCafePointsManager;
  153. import com.l2jserver.gameserver.instancemanager.PetitionManager;
  154. import com.l2jserver.gameserver.instancemanager.QuestManager;
  155. import com.l2jserver.gameserver.instancemanager.RaidBossPointsManager;
  156. @@ -287,6 +289,7 @@
  157.         TerritoryWarManager.getInstance();
  158.         CastleManorManager.getInstance();
  159.         MercTicketManager.getInstance();
  160. +       PcCafePointsManager.getInstance();
  161.         L2Manor.getInstance();
  162.        
  163.         printSection("Olympiad");
  164. Index: java/com/l2jserver/gameserver/instancemanager/PcCafePointsManager.java
  165. ===================================================================
  166. --- java/com/l2jserver/gameserver/instancemanager/PcCafePointsManager.java  (revision 0)
  167. +++ java/com/l2jserver/gameserver/instancemanager/PcCafePointsManager.java  (revision 0)
  168. @@ -0,0 +1,74 @@
  169. +package com.l2jserver.gameserver.instancemanager;
  170. +
  171. +import com.l2jserver.Config;
  172. +import com.l2jserver.gameserver.model.actor.L2Character;
  173. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  174. +import com.l2jserver.gameserver.model.base.ClassId;
  175. +import com.l2jserver.gameserver.network.SystemMessageId;
  176. +import com.l2jserver.gameserver.network.serverpackets.ExPCCafePointInfo;
  177. +import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  178. +import com.l2jserver.util.Rnd;
  179. +
  180. +public class PcCafePointsManager
  181. +{
  182. +   private static PcCafePointsManager _instance;
  183. +
  184. +   public static PcCafePointsManager getInstance()
  185. +   {
  186. +       if (_instance == null)
  187. +           _instance = new PcCafePointsManager();
  188. +       return _instance;
  189. +   }
  190. +
  191. +   public PcCafePointsManager()
  192. +   {
  193. +   }
  194. +
  195. +   public void givePcCafePoint(final L2PcInstance player, final long givedexp)
  196. +   {
  197. +       if (!Config.PC_BANG_ENABLED)
  198. +           return;
  199. +
  200. +       if (player.isInsideZone(L2Character.ZONE_PEACE)
  201. +       || player.isInsideZone(L2Character.ZONE_PVP)
  202. +       || player.isInsideZone(L2Character.ZONE_SIEGE)
  203. +       || player.isOnlineInt() == 0 || player.isInJail())
  204. +           return;
  205. +       if(player.getPcBangPoints()>=Config.MAX_PC_BANG_POINTS)
  206. +       {
  207. +           final SystemMessage sm = new SystemMessage(SystemMessageId.THE_MAXMIMUM_ACCUMULATION_ALLOWED_OF_PC_CAFE_POINTS_HAS_BEEN_EXCEEDED);
  208. +           player.sendPacket(sm);
  209. +           return;
  210. +       }
  211. +       int _points = (int) (givedexp * 0.0001 * Config.PC_BANG_POINT_RATE);
  212. +       if(player.getActiveClass()==ClassId.archmage.getId()
  213. +       || player.getActiveClass()==ClassId.soultaker.getId()
  214. +       || player.getActiveClass()==ClassId.stormScreamer.getId()
  215. +       || player.getActiveClass()==ClassId.mysticMuse.getId())
  216. +           _points/=2;
  217. +       if (Config.RANDOM_PC_BANG_POINT)
  218. +           _points = Rnd.get(_points / 2, _points);
  219. +       boolean doublepoint=false;
  220. +       SystemMessage sm = null;
  221. +       if(_points>0)
  222. +       {
  223. +           if (Config.ENABLE_DOUBLE_PC_BANG_POINTS
  224. +                   && Rnd.get(100) < Config.DOUBLE_PC_BANG_POINTS_CHANCE)
  225. +           {
  226. +               _points *= 2;
  227. +               sm = new SystemMessage(SystemMessageId.ACQUIRED_S1_PCPOINT_DOUBLE);
  228. +               doublepoint=true;
  229. +           }
  230. +           else
  231. +           {
  232. +               sm = new SystemMessage(SystemMessageId.YOU_HAVE_ACQUIRED_S1_PC_CAFE_POINTS);
  233. +           }
  234. +           if(player.getPcBangPoints() + _points>Config.MAX_PC_BANG_POINTS)
  235. +               _points=Config.MAX_PC_BANG_POINTS-player.getPcBangPoints();
  236. +           sm.addNumber(_points);
  237. +           player.sendPacket(sm);
  238. +           player.setPcBangPoints(player.getPcBangPoints() + _points);
  239. +           player.sendPacket(new ExPCCafePointInfo(player.getPcBangPoints(), _points, true, doublepoint, 1));
  240. +       }
  241. +   }
  242. +}
  243. Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  244. ===================================================================
  245. --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (revision 4422)
  246. +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  247. @@ -280,8 +281,8 @@
  248.    
  249.     // Character Character SQL String Definitions:
  250.     private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,last_recom_date,createTime) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  251. -   private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?";
  252. -   private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,createTime,language FROM characters WHERE charId=?";
  253. +   private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,newbie=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,pccafe_points=?,language=? WHERE charId=?";
  254. +   private static final String RESTORE_CHARACTER = "SELECT account_name, charId, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, fame, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, title_color, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, newbie, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,bookmarkslot,vitality_points,pccafe_points,createTime,language FROM characters WHERE charId=?";
  255.    
  256.     // Character Teleport Bookmark:
  257.     private static final String INSERT_TP_BOOKMARK = "INSERT INTO character_tpbookmark (charId,Id,x,y,z,icon,tag,name) values (?,?,?,?,?,?,?,?)";
  258. @@ -456,7 +457,7 @@
  259.     private PunishLevel _punishLevel = PunishLevel.NONE;
  260.     private long _punishTimer = 0;
  261.     private ScheduledFuture<?> _punishTask;
  262. -  
  263. +   private int _pcBangPoints = 0;
  264.     public enum PunishLevel
  265.     {
  266.         NONE(0, ""),
  267. @@ -7382,7 +7418,7 @@
  268.                 player.setDeathPenaltyBuffLevel(rset.getInt("death_penalty_level"));
  269.                
  270.                 player.setVitalityPoints(rset.getInt("vitality_points"), true);
  271. -              
  272. +               player.setPcBangPoints(rset.getInt("pccafe_points"));
  273.                 // Add the L2PcInstance object in _allObjects
  274.                 //L2World.getInstance().storeObject(player);
  275.                
  276. @@ -7834,8 +7871,9 @@
  277.             statement.setLong(52, getDeathPenaltyBuffLevel());
  278.             statement.setInt(53, getBookMarkSlot());
  279.             statement.setInt(54, getVitalityPoints());
  280. -           statement.setString(55, getLang());
  281. -           statement.setInt(56, getObjectId());
  282. +           statement.setInt(55, getPcBangPoints());
  283. +           statement.setString(56, getLang());
  284. +           statement.setInt(57, getObjectId());
  285.            
  286.             statement.execute();
  287.             statement.close();
  288. @@ -14943,7 +15003,106 @@
  289.     {
  290.         _offlineShopStart = time;
  291.     }
  292. +   public int getPcBangPoints()
  293. +   {
  294. +       return _pcBangPoints;
  295.    
  296. +   }
  297. +   public void setPcBangPoints(final int i)
  298. +   {
  299. +       if(i<200000)
  300. +           _pcBangPoints = i;
  301. +       else
  302. +           _pcBangPoints = 200000;
  303. +   }
  304.     /**
  305.      * Remove player from BossZones (used on char logout/exit)
  306.      */
  307. Index: java/com/l2jserver/gameserver/model/actor/L2Attackable.java
  308. ===================================================================
  309. --- java/com/l2jserver/gameserver/model/actor/L2Attackable.java (revision 4422)
  310. +++ java/com/l2jserver/gameserver/model/actor/L2Attackable.java (working copy)
  311. @@ -36,6 +36,7 @@
  312. import com.l2jserver.gameserver.datatables.ItemTable;
  313. import com.l2jserver.gameserver.datatables.SkillTable;
  314. import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
  315. +import com.l2jserver.gameserver.instancemanager.PcCafePointsManager;
  316. import com.l2jserver.gameserver.model.L2CharPosition;
  317. import com.l2jserver.gameserver.model.L2CommandChannel;
  318. import com.l2jserver.gameserver.model.L2DropCategory;
  319. @@ -709,7 +710,10 @@
  320.                                     }
  321.                                     ((L2PcInstance)attacker).addExpAndSp(addexp,addsp, useVitalityRate());
  322.                                     if (addexp > 0)
  323. +                                   {
  324.                                         ((L2PcInstance)attacker).updateVitalityPoints(getVitalityPoints(damage), true, false);
  325. +                                       PcCafePointsManager.getInstance().givePcCafePoint(((L2PcInstance) attacker), addexp);
  326. +                                   }
  327.                                 }
  328.                                 else
  329.                                     attacker.addExpAndSp(addexp,addsp);
  330. Index: java/com/l2jserver/gameserver/model/L2Party.java
  331. ===================================================================
  332. --- java/com/l2jserver/gameserver/model/L2Party.java    (revision 4422)
  333. +++ java/com/l2jserver/gameserver/model/L2Party.java    (working copy)
  334. @@ -29,6 +29,7 @@
  335. import com.l2jserver.gameserver.datatables.ItemTable;
  336. import com.l2jserver.gameserver.datatables.SkillTable;
  337. import com.l2jserver.gameserver.instancemanager.DuelManager;
  338. +import com.l2jserver.gameserver.instancemanager.PcCafePointsManager;
  339. import com.l2jserver.gameserver.model.actor.L2Attackable;
  340. import com.l2jserver.gameserver.model.actor.L2Character;
  341. import com.l2jserver.gameserver.model.actor.L2Playable;
  342. @@ -736,7 +737,10 @@
  343.                             }
  344.                             ((L2PcInstance)member).addExpAndSp(addexp, addsp, useVitalityRate);
  345.                             if (addexp > 0)
  346. +                           {
  347.                                 ((L2PcInstance)member).updateVitalityPoints(vitalityPoints, true, false);
  348. +                               PcCafePointsManager.getInstance().givePcCafePoint(((L2PcInstance) member), addexp);
  349. +                           }
  350.                         }
  351.                         else
  352.                             member.addExpAndSp(addexp, addsp);
  353. Index: java/com/l2jserver/gameserver/model/quest/QuestState.java
  354. ===================================================================
  355. --- java/com/l2jserver/gameserver/model/quest/QuestState.java   (revision 4422)
  356. +++ java/com/l2jserver/gameserver/model/quest/QuestState.java   (working copy)
  357. @@ -28,6 +28,7 @@
  358. import com.l2jserver.gameserver.GameTimeController;
  359. import com.l2jserver.gameserver.cache.HtmCache;
  360. import com.l2jserver.gameserver.datatables.ItemTable;
  361. +import com.l2jserver.gameserver.instancemanager.PcCafePointsManager;
  362. import com.l2jserver.gameserver.instancemanager.QuestManager;
  363. import com.l2jserver.gameserver.model.L2DropData;
  364. import com.l2jserver.gameserver.model.L2ItemInstance;
  365. @@ -904,6 +905,7 @@
  366.     public void addExpAndSp(int exp, int sp)
  367.     {
  368.         getPlayer().addExpAndSp((int) getPlayer().calcStat(Stats.EXPSP_RATE, exp * Config.RATE_QUEST_REWARD_XP, null, null), (int) getPlayer().calcStat(Stats.EXPSP_RATE, sp * Config.RATE_QUEST_REWARD_SP, null, null));
  369. +       PcCafePointsManager.getInstance().givePcCafePoint(getPlayer(), (long)(exp * Config.RATE_QUEST_REWARD_XP));
  370.     }
  371.    
  372.     /**
  373. Index: java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java
  374. ===================================================================
  375. --- java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (revision 4422)
  376. +++ java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java (working copy)
  377. @@ -70,6 +71,7 @@
  378. import com.l2jserver.gameserver.network.serverpackets.ExGetBookMarkInfoPacket;
  379. import com.l2jserver.gameserver.network.serverpackets.ExNoticePostArrived;
  380. import com.l2jserver.gameserver.network.serverpackets.ExNotifyPremiumItem;
  381. +import com.l2jserver.gameserver.network.serverpackets.ExPCCafePointInfo;
  382. import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
  383. import com.l2jserver.gameserver.network.serverpackets.ExStorageMaxCount;
  384. import com.l2jserver.gameserver.network.serverpackets.FriendList;
  385. @@ -355,7 +357,13 @@
  386.         }
  387.        
  388.         activeChar.updateEffectIcons();
  389. -      
  390. +       if(Config.PC_BANG_ENABLED)
  391. +       {
  392. +           if (activeChar.getPcBangPoints() > 0)
  393. +               activeChar.sendPacket(new ExPCCafePointInfo(activeChar.getPcBangPoints(), 0, false, false, 1));
  394. +           else
  395. +               activeChar.sendPacket(new ExPCCafePointInfo());
  396. +       }
  397.         activeChar.sendPacket(new EtcStatusUpdate(activeChar));
  398.        
  399.         //Expand Skill
  400. Index: java/com/l2jserver/gameserver/network/serverpackets/ExPCCafePointInfo.java
  401. ===================================================================
  402. --- java/com/l2jserver/gameserver/network/serverpackets/ExPCCafePointInfo.java  (revision 4422)
  403. +++ java/com/l2jserver/gameserver/network/serverpackets/ExPCCafePointInfo.java  (working copy)
  404. @@ -21,27 +21,50 @@
  405. public class ExPCCafePointInfo extends L2GameServerPacket
  406. {
  407.     private static final String _S__FE_31_EXPCCAFEPOINTINFO = "[S] FE:32 ExPCCafePointInfo";
  408. -   private int _unk1, _unk2, _unk3, _unk4, _unk5 = 0;
  409. -  
  410. -   public ExPCCafePointInfo(int val1, int val2, int val3, int val4, int val5)
  411. +   private final int _points;
  412. +   private final int _mAddPoint;
  413. +   private int _mPeriodType;
  414. +   private int _remainTime;
  415. +   private int _pointType = 0;
  416. +   public ExPCCafePointInfo()
  417.     {
  418. -       _unk1 = val1;
  419. -       _unk2 = val2;
  420. -       _unk3 = val3;
  421. -       _unk4 = val4;
  422. -       _unk5 = val5;
  423. +       _points = 0;
  424. +       _mAddPoint = 0;
  425. +       _remainTime = 0;
  426. +       _mPeriodType = 0;
  427. +       _pointType = 0;
  428.     }
  429. -  
  430. +   public ExPCCafePointInfo(final int points, final int modify_points, final boolean mod, final boolean _double, final int hours_left)
  431. +   {
  432. +       _points = points;
  433. +       _mAddPoint = modify_points;
  434. +       _remainTime = hours_left;
  435. +       if (mod && _double)
  436. +       {
  437. +           _mPeriodType = 1;
  438. +           _pointType = 0;
  439. +       }
  440. +       else if (mod)
  441. +       {
  442. +           _mPeriodType = 1;
  443. +           _pointType = 1;
  444. +       }
  445. +       else
  446. +       {
  447. +           _mPeriodType = 2;
  448. +           _pointType = 2;
  449. +       }
  450. +   }
  451.     @Override
  452.     protected void writeImpl()
  453.     {
  454.         writeC(0xFE);
  455.         writeH(0x32);
  456. -       writeD(_unk1); // num points
  457. -       writeD(_unk2); // points inc display
  458. -       writeC(_unk3); // period(0=don't show window,1=acquisition,2=use points)
  459. -       writeD(_unk4); // period hours left
  460. -       writeC(_unk5); // points inc display color(0=yellow,1=cyan-blue,2=red,all other black)
  461. +       writeD(_points); // num points
  462. +       writeD(_mAddPoint); // points inc display
  463. +       writeC(_mPeriodType); // period(0=don't show window,1=acquisition,2=use points)
  464. +       writeD(_remainTime); // period hours left
  465. +       writeC(_pointType); // points inc display color(0=yellow,1=cyan-blue,2=red,all other black)
  466.     }
  467.    
  468.     /**
  469. Index: java/com/l2jserver/gameserver/network/SystemMessageId.java
  470. ===================================================================
  471. --- java/com/l2jserver/gameserver/network/SystemMessageId.java  (revision 4422)
  472. +++ java/com/l2jserver/gameserver/network/SystemMessageId.java  (working copy)
  473. @@ -13600,14 +13600,22 @@
  474.      * Message: You cannot receive a vitamin item during an exchange.
  475.      */
  476.     YOU_CANNOT_RECEIVE_A_VITAMIN_ITEM_DURING_AN_EXCHANGE(2390),
  477. -  
  478.     /**
  479. +    * ID: 2389<br>
  480. +    * Message: The maximum accumulation allowed of PC cafe points has been exceeded. You can no longer acquire PC cafe points.
  481. +    */
  482. +   THE_MAXMIMUM_ACCUMULATION_ALLOWED_OF_PC_CAFE_POINTS_HAS_BEEN_EXCEEDED(2389),
  483. +   /**
  484.      * ID: 2390<br>
  485.      * Message: Your number of My Teleports slots has reached its maximum limit.
  486.      */
  487.     YOUR_NUMBER_OF_MY_TELEPORTS_SLOTS_HAS_REACHED_ITS_MAXIMUM_LIMIT(2390),
  488. -  
  489.     /**
  490. +    * ID: 2393<br>
  491. +    * Message: You have acquired $s1 PC Cafe points.
  492. +    */
  493. +   YOU_HAVE_ACQUIRED_S1_PC_CAFE_POINTS(2393),
  494. +   /**
  495.      * ID: 2396<br>
  496.      * Message: That pet/servitor skill cannot be used because it is recharging.
  497.      */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement