gabrielb

VIP_System_Classic_Zaken_Custom_Addon_By_Gabriel

Apr 29th, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 136.66 KB | None | 0 0
  1. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/EventType.java
  2. IDEA additional info:
  3. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  4. <+>UTF-8
  5. ===================================================================
  6. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/EventType.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/EventType.java
  7. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/EventType.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  8. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/EventType.java    (date 1619731240365)
  9. @@ -57,66 +57,7 @@
  10.  import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcSpawn;
  11.  import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcTeleport;
  12.  import org.l2jmobius.gameserver.model.events.impl.creature.npc.OnNpcTeleportRequest;
  13. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
  14. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
  15. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAugment;
  16. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerBypass;
  17. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCallToChangeClass;
  18. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChangeToAwakenedClass;
  19. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerChat;
  20. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanCreate;
  21. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanDestroy;
  22. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanJoin;
  23. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanLeaderChange;
  24. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanLeft;
  25. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanLvlUp;
  26. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWHItemAdd;
  27. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWHItemDestroy;
  28. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerClanWHItemTransfer;
  29. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerCreate;
  30. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDelete;
  31. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerDlgAnswer;
  32. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
  33. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFishing;
  34. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
  35. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
  36. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemAdd;
  37. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDestroy;
  38. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDrop;
  39. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
  40. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup;
  41. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemTransfer;
  42. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip;
  43. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLevelChanged;
  44. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
  45. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
  46. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeAdd;
  47. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeLeft;
  48. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeRemove;
  49. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
  50. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMentorStatus;
  51. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMoveRequest;
  52. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPKChanged;
  53. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPressTutorialMark;
  54. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerProfessionCancel;
  55. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerProfessionChange;
  56. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPvPChanged;
  57. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPvPKill;
  58. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerQuestAbort;
  59. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerQuestComplete;
  60. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerReputationChanged;
  61. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerRestore;
  62. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSelect;
  63. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSkillLearn;
  64. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSocialAction;
  65. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSubChange;
  66. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonAgathion;
  67. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonSpawn;
  68. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSummonTalk;
  69. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTakeHero;
  70. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerTransform;
  71. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerUnsummonAgathion;
  72. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnTrapAction;
  73. +import org.l2jmobius.gameserver.model.events.impl.creature.player.*;
  74.  import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceCreated;
  75.  import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceDestroy;
  76.  import org.l2jmobius.gameserver.model.events.impl.instance.OnInstanceEnter;
  77. @@ -257,6 +198,7 @@
  78.     ON_PLAYER_LEVEL_CHANGED(OnPlayerLevelChanged.class, void.class),
  79.     ON_PLAYER_LOGIN(OnPlayerLogin.class, void.class),
  80.     ON_PLAYER_LOGOUT(OnPlayerLogout.class, void.class),
  81. +    ON_PLAYER_LOAD(OnPlayerLoad.class, void.class),
  82.     ON_PLAYER_PK_CHANGED(OnPlayerPKChanged.class, void.class),
  83.     ON_PLAYER_PRESS_TUTORIAL_MARK(OnPlayerPressTutorialMark.class, void.class),
  84.     ON_PLAYER_MOVE_REQUEST(OnPlayerMoveRequest.class, void.class, TerminateReturn.class),
  85. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/PrimeShop.xml
  86. IDEA additional info:
  87. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  88. <+>UTF-8
  89. ===================================================================
  90. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/PrimeShop.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/PrimeShop.xml
  91. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/PrimeShop.xml (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  92. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/PrimeShop.xml (date 1619741422693)
  93. @@ -1,3 +1,63 @@
  94.  <?xml version="1.0" encoding="UTF-8"?>
  95. -<list enabled="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/PrimeShop.xsd">
  96. +<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/PrimeShop.xsd">
  97. +
  98. +<!--
  99. + cat 11 = supplies
  100. + cat 12 = Equipment/outfit
  101. + cat 13 = VIP
  102. + cat 14 = Event
  103. + cat 15 = Reward Coins
  104. + On Cat 15, golden coins use the same value as "price" and silver uses the value from silverCoin node. -> paymenttype = 0
  105. + for the price to be used as golden or silver, vipTier needs to be > 0
  106. +  -->
  107. +
  108. +
  109. +    <item id="2090044" cat="11" paymentType="0" price="30" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  110. +        <item itemId="29505" count="1" /> <!-- Normal VIP Gain Scroll -->
  111. +    </item>
  112. +    <item id="2090045" cat="12" paymentType="0" price="60" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  113. +        <item itemId="29506" count="1" /> <!-- Medium VIP Gain Scroll -->
  114. +    </item>
  115. +    <item id="2090046" cat="13" paymentType="0" price="50" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  116. +        <item itemId="29507" count="1" /> <!-- Good VIP Gain Scroll -->
  117. +    </item>
  118. +    <item id="2090047" cat="14" paymentType="0" price="100"  recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  119. +        <item itemId="29508" count="1" /> <!-- Perfect VIP Gain Scroll -->
  120. +    </item>
  121. +
  122. +    <item id="2090048" cat="15" paymentType="0" price="0" silverCoin="100" recommended="4" vipTier="7" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  123. +        <item itemId="29505" count="1" /> <!-- Normal VIP Gain Scroll -->
  124. +    </item>
  125. +    <item id="2090049" cat="15" paymentType="0" price="0" silverCoin="200" recommended="4" vipTier="7" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  126. +        <item itemId="29506" count="1" /> <!-- Medium VIP Gain Scroll -->
  127. +    </item>
  128. +    <item id="2090050" cat="15" paymentType="0" price="50" silverCoin="0" recommended="4" vipTier="7" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  129. +        <item itemId="29507" count="1" /> <!-- Good VIP Gain Scroll -->
  130. +    </item>
  131. +    <item id="2090051" cat="15" paymentType="0" price="100" silverCoin="0" recommended="4" vipTier="7" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0">
  132. +        <item itemId="29508" count="1" /> <!-- Perfect VIP Gain Scroll -->
  133. +    </item>
  134. +
  135. +
  136. +    <item id="100001" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="1">
  137. +        <item itemId="29001" count="1" /> <!-- Daily Present - VIP 1 -->
  138. +    </item>
  139. +    <item id="100002" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="2">
  140. +        <item itemId="29002" count="1" /> <!-- Daily Present - VIP 2 -->
  141. +    </item>
  142. +    <item id="100003" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="3">
  143. +        <item itemId="29003" count="1" /> <!-- Daily Present - VIP 3 -->
  144. +    </item>
  145. +    <item id="100004" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="4">
  146. +        <item itemId="29004" count="1" /> <!-- Daily Present - VIP 4 -->
  147. +    </item>
  148. +    <item id="100005" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="5">
  149. +        <item itemId="29005" count="1" /> <!-- Daily Present - VIP 5 -->
  150. +    </item>
  151. +    <item id="100006" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="6">
  152. +        <item itemId="29006" count="1" /> <!-- Daily Present - VIP 6 -->
  153. +    </item>
  154. +    <item id="100007" cat="13" paymentType="0" price="0" recommended="4" startSale="315558000" endSale="2127452400" dayOfWeek="127" startHour="0" startMinute="0" stopHour="23" stopMinute="59" stock="-1" maxStock="-1" salePercent="0" minLevel="0" maxLevel="0" minBirthday="0" maxBirthday="0" restrictionDay="0" availableCount="0" isVipGift="true" vipTier="7">
  155. +        <item itemId="29007" count="1" /> <!-- Daily Present - VIP 7 -->
  156. +    </item>
  157.  </list>
  158. \ No newline at end of file
  159. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55000-55099.xml
  160. IDEA additional info:
  161. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  162. <+>UTF-8
  163. ===================================================================
  164. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55000-55099.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55000-55099.xml
  165. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55000-55099.xml  (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  166. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55000-55099.xml  (date 1619730747337)
  167. @@ -283,36 +283,327 @@
  168.         <!-- The right to VIP 1st level chest. XP/SP gain +3%, item drop rate +3%. -->
  169.         <icon>BranchIcon.Icon.g_skill_vip1</icon>
  170.         <operateType>P</operateType>
  171. +        <hitTime>500</hitTime>
  172. +        <effects>
  173. +            <effect name="ExpModify">
  174. +                <amount>3</amount>
  175. +            </effect>
  176. +            <effect name="SpModify">
  177. +                <amount>3</amount>
  178. +            </effect>
  179. +            <effect name="BonusDropRate">
  180. +                <amount>50</amount>
  181. +                <mode>PER</mode>
  182. +            </effect>
  183. +        </effects>
  184.     </skill>
  185.     <skill id="55025" toLevel="1" name="VIP Level 2">
  186.         <!-- The right to VIP 2nd level chest. XP/SP gain +7%, item drop rate +7%. World chat on any level, number of usage attempts +10. -->
  187.         <icon>BranchIcon.Icon.g_skill_vip2</icon>
  188.         <operateType>P</operateType>
  189. +        <hitTime>500</hitTime>
  190. +        <effects>
  191. +            <effect name="ExpModify">
  192. +                <amount>7</amount>
  193. +            </effect>
  194. +            <effect name="SpModify">
  195. +                <amount>7</amount>
  196. +            </effect>
  197. +            <effect name="BonusDropRate">
  198. +                <amount>150</amount>
  199. +                <mode>PER</mode>
  200. +            </effect>
  201. +            <effect name="WorldChatPoints">
  202. +                <amount>3</amount>
  203. +                <mode>DIFF</mode>
  204. +            </effect>
  205. +        </effects>
  206.     </skill>
  207.     <skill id="55026" toLevel="1" name="VIP Level 3">
  208.         <!-- The right to VIP 3rd level chest. XP/SP gain +15%, item drop rate +15%. Experience loss and chance to lose items upon death is decreased by 10%. World chat on any level, number of usage attempts +10. -->
  209.         <icon>BranchIcon.Icon.g_skill_vip3</icon>
  210.         <operateType>P</operateType>
  211. +        <hitTime>500</hitTime>
  212. +        <effects>
  213. +            <effect name="ExpModify">
  214. +                <amount>15</amount>
  215. +            </effect>
  216. +            <effect name="SpModify">
  217. +                <amount>15</amount>
  218. +            </effect>
  219. +            <effect name="BonusDropRate">
  220. +                <amount>200</amount>
  221. +                <mode>PER</mode>
  222. +            </effect>
  223. +            <effect name="WorldChatPoints">
  224. +                <amount>3</amount>
  225. +                <mode>DIFF</mode>
  226. +            </effect>
  227. +        </effects>
  228.     </skill>
  229.     <skill id="55027" toLevel="1" name="VIP Level 4">
  230.         <!-- The right to VIP 4th level chest. XP/SP gain +25%, item drop rate +15%. Experience loss and chance to lose items upon death is decreased by 15%. World chat on any level, number of usage attempts +10. -->
  231.         <icon>BranchIcon.Icon.g_skill_vip4</icon>
  232.         <operateType>P</operateType>
  233. +        <hitTime>500</hitTime>
  234. +        <effects>
  235. +            <effect name="ExpModify">
  236. +                <amount>25</amount>
  237. +            </effect>
  238. +            <effect name="SpModify">
  239. +                <amount>25</amount>
  240. +            </effect>
  241. +            <effect name="FishingExpSpBonus">
  242. +                <amount>20</amount>
  243. +                <mode>PER</mode>
  244. +            </effect>
  245. +            <effect name="BonusDropRate">
  246. +                <amount>250</amount>
  247. +                <mode>PER</mode>
  248. +            </effect>
  249. +            <effect name="WorldChatPoints">
  250. +                <amount>5</amount>
  251. +                <mode>DIFF</mode>
  252. +            </effect>
  253. +            <effect name="ReduceDropPenalty">
  254. +                <deathPenalty>-15</deathPenalty>
  255. +                <mode>PER</mode>
  256. +            </effect>
  257. +        </effects>
  258.     </skill>
  259.     <skill id="55028" toLevel="1" name="VIP Level 5">
  260.         <!-- The right to VIP 5th level chest. XP/SP gain +30%, item drop rate +30%. Experience loss and chance to lose items upon death is decreased by 20%. PvE damage is increased. World chat on any level, number of usage attempts +10. -->
  261.         <icon>BranchIcon.Icon.g_skill_vip5</icon>
  262.         <operateType>P</operateType>
  263. +        <hitTime>500</hitTime>
  264. +        <effects>
  265. +            <effect name="ExpModify">
  266. +                <amount>30</amount>
  267. +            </effect>
  268. +            <effect name="SpModify">
  269. +                <amount>30</amount>
  270. +            </effect>
  271. +            <effect name="BonusDropRate">
  272. +                <amount>250</amount>
  273. +                <mode>PER</mode>
  274. +            </effect>
  275. +            <effect name="WorldChatPoints">
  276. +                <amount>10</amount>
  277. +                <mode>DIFF</mode>
  278. +            </effect>
  279. +            <effect name="ReduceDropPenalty">
  280. +                <deathPenalty>-20</deathPenalty>
  281. +                <mode>PER</mode>
  282. +            </effect>
  283. +            <effect name="PveMagicalSkillDamageBonus">
  284. +                <amount>10</amount>
  285. +                <mode>PER</mode>
  286. +            </effect>
  287. +            <effect name="PvePhysicalAttackDamageBonus">
  288. +                <amount>10</amount>
  289. +                <mode>PER</mode>
  290. +            </effect>
  291. +            <effect name="PvePhysicalSkillDamageBonus">
  292. +                <amount>10</amount>
  293. +                <mode>PER</mode>
  294. +            </effect>
  295. +            <effect name="PvePhysicalSkillDamageBonus">
  296. +                <amount>10</amount>
  297. +                <mode>PER</mode>
  298. +            </effect>
  299. +            <effect name="PveRaidMagicalSkillDamageBonus">
  300. +                <amount>10</amount>
  301. +                <mode>PER</mode>
  302. +            </effect>
  303. +            <effect name="PveRaidPhysicalAttackDamageBonus">
  304. +                <amount>10</amount>
  305. +                <mode>PER</mode>
  306. +            </effect>
  307. +            <effect name="PveRaidPhysicalSkillDamageBonus">
  308. +                <amount>10</amount>
  309. +                <mode>PER</mode>
  310. +            </effect>
  311. +            <effect name="FishingExpSpBonus">
  312. +                <amount>20</amount>
  313. +                <mode>PER</mode>
  314. +            </effect>
  315. +        </effects>
  316.     </skill>
  317.     <skill id="55029" toLevel="1" name="VIP Level 6">
  318.         <!-- The right to VIP 6th level chest. XP/SP gain +30%, item drop rate +30%. Experience loss and chance to lose items upon death is decreased by 20%. PvE damage is increased, STR/DEX/CON/INT/WIT/MEN +2. World chat on any level, number of usage attempts +10. -->
  319.         <icon>BranchIcon.Icon.g_skill_vip6</icon>
  320. -       <operateType>P</operateType>
  321. +        <operateType>P</operateType>
  322. +        <hitTime>500</hitTime>
  323. +        <effects>
  324. +            <effect name="ExpModify">
  325. +                <amount>30</amount>
  326. +            </effect>
  327. +            <effect name="SpModify">
  328. +                <amount>30</amount>
  329. +            </effect>
  330. +            <effect name="BonusDropRate">
  331. +                <amount>250</amount>
  332. +                <mode>PER</mode>
  333. +            </effect>
  334. +            <effect name="WorldChatPoints">
  335. +                <amount>10</amount>
  336. +                <mode>DIFF</mode>
  337. +            </effect>
  338. +            <effect name="ReduceDropPenalty">
  339. +                <deathPenalty>-20</deathPenalty>
  340. +                <mode>PER</mode>
  341. +            </effect>
  342. +            <effect name="PveMagicalSkillDamageBonus">
  343. +                <amount>15</amount>
  344. +                <mode>PER</mode>
  345. +            </effect>
  346. +            <effect name="PvePhysicalAttackDamageBonus">
  347. +                <amount>15</amount>
  348. +                <mode>PER</mode>
  349. +            </effect>
  350. +            <effect name="PvePhysicalSkillDamageBonus">
  351. +                <amount>15</amount>
  352. +                <mode>PER</mode>
  353. +            </effect>
  354. +            <effect name="PvePhysicalSkillDamageBonus">
  355. +                <amount>15</amount>
  356. +                <mode>PER</mode>
  357. +            </effect>
  358. +            <effect name="PveRaidMagicalSkillDamageBonus">
  359. +                <amount>15</amount>
  360. +                <mode>PER</mode>
  361. +            </effect>
  362. +            <effect name="PveRaidPhysicalAttackDamageBonus">
  363. +                <amount>15</amount>
  364. +                <mode>PER</mode>
  365. +            </effect>
  366. +            <effect name="PveRaidPhysicalSkillDamageBonus">
  367. +                <amount>15</amount>
  368. +                <mode>PER</mode>
  369. +            </effect>
  370. +            <effect name="FishingExpSpBonus">
  371. +                <amount>20</amount>
  372. +                <mode>PER</mode>
  373. +            </effect>
  374. +            <effect name="StatUp">
  375. +                <amount>1</amount>
  376. +                <stat>STR</stat>
  377. +            </effect>
  378. +            <effect name="StatUp">
  379. +                <amount>1</amount>
  380. +                <stat>INT</stat>
  381. +            </effect>
  382. +            <effect name="StatUp">
  383. +                <amount>1</amount>
  384. +                <stat>CON</stat>
  385. +            </effect>
  386. +            <effect name="StatUp">
  387. +                <amount>1</amount>
  388. +                <stat>DEX</stat>
  389. +            </effect>
  390. +            <effect name="StatUp">
  391. +                <amount>1</amount>
  392. +                <stat>MEN</stat>
  393. +            </effect>
  394. +            <effect name="StatUp">
  395. +                <amount>1</amount>
  396. +                <stat>WIT</stat>
  397. +            </effect>
  398. +        </effects>
  399.     </skill>
  400.     <skill id="55030" toLevel="1" name="VIP Level 7">
  401.         <!-- The right to VIP 7th level chest. XP/SP gain +30%, item drop rate +30%. Experience loss and chance to lose items upon death is decreased by 20%. PvE/PvP damage is increased, STR/DEX/CON/INT/WIT/MEN +2. World chat on any level, number of usage attempts +10. -->
  402.         <icon>BranchIcon.Icon.g_skill_vip7</icon>
  403. -       <operateType>P</operateType>
  404. +        <operateType>P</operateType>
  405. +        <hitTime>500</hitTime>
  406. +        <effects>
  407. +            <effect name="ExpModify">
  408. +                <amount>30</amount>
  409. +            </effect>
  410. +            <effect name="SpModify">
  411. +                <amount>30</amount>
  412. +            </effect>
  413. +            <effect name="BonusDropRate">
  414. +                <amount>250</amount>
  415. +                <mode>PER</mode>
  416. +            </effect>
  417. +            <effect name="WorldChatPoints">
  418. +                <amount>10</amount>
  419. +                <mode>DIFF</mode>
  420. +            </effect>
  421. +            <effect name="ReduceDropPenalty">
  422. +                <deathPenalty>-20</deathPenalty>
  423. +                <mode>PER</mode>
  424. +            </effect>
  425. +            <effect name="PveMagicalSkillDamageBonus">
  426. +                <amount>15</amount>
  427. +                <mode>PER</mode>
  428. +            </effect>
  429. +            <effect name="PvePhysicalAttackDamageBonus">
  430. +                <amount>15</amount>
  431. +                <mode>PER</mode>
  432. +            </effect>
  433. +            <effect name="PvePhysicalSkillDamageBonus">
  434. +                <amount>15</amount>
  435. +                <mode>PER</mode>
  436. +            </effect>
  437. +            <effect name="PvePhysicalSkillDamageBonus">
  438. +                <amount>15</amount>
  439. +                <mode>PER</mode>
  440. +            </effect>
  441. +            <effect name="PveRaidMagicalSkillDamageBonus">
  442. +                <amount>15</amount>
  443. +                <mode>PER</mode>
  444. +            </effect>
  445. +            <effect name="PveRaidPhysicalAttackDamageBonus">
  446. +                <amount>15</amount>
  447. +                <mode>PER</mode>
  448. +            </effect>
  449. +            <effect name="PveRaidPhysicalSkillDamageBonus">
  450. +                <amount>15</amount>
  451. +                <mode>PER</mode>
  452. +            </effect>
  453. +            <effect name="PvpMagicalSkillDamageBonus">
  454. +                <amount>5</amount>
  455. +                <mode>PER</mode>
  456. +            </effect>
  457. +            <effect name="PvpPhysicalAttackDamageBonus">
  458. +                <amount>5</amount>
  459. +                <mode>PER</mode>
  460. +            </effect>
  461. +            <effect name="PvpPhysicalSkillDamageBonus">
  462. +                <amount>5</amount>
  463. +                <mode>PER</mode>
  464. +            </effect>
  465. +            <effect name="FishingExpSpBonus">
  466. +                <amount>20</amount>
  467. +                <mode>PER</mode>
  468. +            </effect>
  469. +            <effect name="StatUp">
  470. +                <amount>2</amount>
  471. +                <stat>STR</stat>
  472. +            </effect>
  473. +            <effect name="StatUp">
  474. +                <amount>2</amount>
  475. +                <stat>INT</stat>
  476. +            </effect>
  477. +            <effect name="StatUp">
  478. +                <amount>2</amount>
  479. +                <stat>CON</stat>
  480. +            </effect>
  481. +            <effect name="StatUp">
  482. +                <amount>2</amount>
  483. +                <stat>DEX</stat>
  484. +            </effect>
  485. +            <effect name="StatUp">
  486. +                <amount>2</amount>
  487. +                <stat>MEN</stat>
  488. +            </effect>
  489. +            <effect name="StatUp">
  490. +                <amount>2</amount>
  491. +                <stat>WIT</stat>
  492. +            </effect>
  493. +        </effects>
  494.     </skill>
  495.     <skill id="55031" toLevel="1" name="Report Status">
  496.         <!-- You are under suspicion of using this program illegally. Your actions have been restricted. -->
  497. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AttendanceRewards.ini
  498. IDEA additional info:
  499. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  500. <+>UTF-8
  501. ===================================================================
  502. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AttendanceRewards.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AttendanceRewards.ini
  503. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AttendanceRewards.ini   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  504. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/AttendanceRewards.ini   (date 1619730747169)
  505. @@ -13,6 +13,10 @@
  506.  # Default: False
  507.  PremiumOnlyAttendanceRewards = False
  508.  
  509. +# Enable the Attendance Reward system only for Vip accounts.
  510. +# Default: False
  511. +VIPOnlyAttendanceRewards = False
  512. +
  513.  # Make rewards sharable in the same account.
  514.  # Default: False (Each character will receive its own rewards.)
  515.  AttendanceRewardsShareAccount = False
  516. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java
  517. IDEA additional info:
  518. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  519. <+>UTF-8
  520. ===================================================================
  521. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java
  522. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  523. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java (date 1619730818236)
  524. @@ -45,8 +45,11 @@
  525.  import org.l2jmobius.gameserver.model.items.Item;
  526.  import org.l2jmobius.gameserver.model.skills.Skill;
  527.  import org.l2jmobius.gameserver.model.stats.Stat;
  528. +import org.l2jmobius.gameserver.model.vip.VipManager;
  529.  import org.l2jmobius.gameserver.util.Util;
  530.  
  531. +import static java.util.Objects.nonNull;
  532. +
  533.  /**
  534.   * NPC template.
  535.   * @author NosBit
  536. @@ -701,7 +704,6 @@
  537.         }
  538.        
  539.         final List<DropHolder> dropList = new ArrayList<>(getDropList(dropType));
  540. -      
  541.         // randomize drop order
  542.         Collections.shuffle(dropList);
  543.        
  544. @@ -718,15 +720,8 @@
  545.             }
  546.            
  547.             // check level gap that may prevent drop this item
  548. -           final double levelGapChanceToDrop;
  549. -           if (dropItem.getItemId() == Inventory.ADENA_ID)
  550. -           {
  551. -               levelGapChanceToDrop = Util.map(levelDifference, -Config.DROP_ADENA_MAX_LEVEL_DIFFERENCE, -Config.DROP_ADENA_MIN_LEVEL_DIFFERENCE, Config.DROP_ADENA_MIN_LEVEL_GAP_CHANCE, 100.0);
  552. -           }
  553. -           else
  554. -           {
  555. -               levelGapChanceToDrop = Util.map(levelDifference, -Config.DROP_ITEM_MAX_LEVEL_DIFFERENCE, -Config.DROP_ITEM_MIN_LEVEL_DIFFERENCE, Config.DROP_ITEM_MIN_LEVEL_GAP_CHANCE, 100.0);
  556. -           }
  557. +           final double levelGapChanceToDrop = calculateLevelGapChanceToDrop(dropItem, levelDifference);
  558. +
  559.             if ((Rnd.nextDouble() * 100) > levelGapChanceToDrop)
  560.             {
  561.                 continue;
  562. @@ -773,10 +768,64 @@
  563.            
  564.             calculatedDrops.add(new ItemHolder(Config.CHAMPION_REWARD_ID, Config.CHAMPION_REWARD_QTY));
  565.         }
  566. -      
  567. -       return calculatedDrops;
  568. +
  569. +        if (dropType == DropType.DROP) {
  570. +            processVipDrops(calculatedDrops, victim, killer);
  571. +        }
  572. +
  573. +        return calculatedDrops;
  574.     }
  575. -  
  576. +
  577. +
  578. +    private void processVipDrops(Collection<ItemHolder> items, Creature victim, Creature killer) {
  579. +        final List<DropHolder> dropList = new ArrayList<>();
  580. +        if (nonNull(killer.getActingPlayer())) {
  581. +            float silverCoinChance = VipManager.getInstance().getSilverCoinDropChance(killer.getActingPlayer());
  582. +            float rustyCoinChance = VipManager.getInstance().getRustyCoinDropChance(killer.getActingPlayer());
  583. +
  584. +            if (silverCoinChance > 0) {
  585. +                dropList.add(new DropHolder(DropType.DROP, Inventory.SILVER_COIN, Config.VIP_SYSTEM_SILVER_DROP_MIN, Config.VIP_SYSTEM_SILVER_DROP_MAX, silverCoinChance));
  586. +            }
  587. +
  588. +            if (rustyCoinChance > 0) {
  589. +                dropList.add(new DropHolder(DropType.DROP, Inventory.GOLD_COIN,  Config.VIP_SYSTEM_GOLD_DROP_MIN, Config.VIP_SYSTEM_GOLD_DROP_MAX, rustyCoinChance));
  590. +            }
  591. +        }
  592. +
  593. +        for (DropHolder dropItem : dropList) {
  594. +            final ItemHolder drop = calculateDropWithLevelGap(dropItem, victim, killer);
  595. +            if (drop == null) {
  596. +                continue;
  597. +            }
  598. +
  599. +            items.add(drop);
  600. +        }
  601. +    }
  602. +
  603. +    private ItemHolder calculateDropWithLevelGap(DropHolder dropItem, Creature victim, Creature killer) {
  604. +        final int levelDifference = victim.getLevel() - killer.getLevel();
  605. +        double levelGapChanceToDrop = calculateLevelGapChanceToDrop(dropItem, levelDifference);
  606. +        if ((Rnd.nextDouble() * 100) > levelGapChanceToDrop) {
  607. +            return null;
  608. +        }
  609. +
  610. +        return calculateDrop(dropItem, victim, killer);
  611. +    }
  612. +
  613. +    private double calculateLevelGapChanceToDrop(DropHolder dropItem, int levelDifference) {
  614. +        final double levelGapChanceToDrop;
  615. +
  616. +        if (dropItem.getItemId() == Inventory.ADENA_ID)
  617. +        {
  618. +            levelGapChanceToDrop = Util.map(levelDifference, -Config.DROP_ADENA_MAX_LEVEL_DIFFERENCE, -Config.DROP_ADENA_MIN_LEVEL_DIFFERENCE, Config.DROP_ADENA_MIN_LEVEL_GAP_CHANCE, 100.0);
  619. +        }
  620. +        else
  621. +        {
  622. +            levelGapChanceToDrop = Util.map(levelDifference, -Config.DROP_ITEM_MAX_LEVEL_DIFFERENCE, -Config.DROP_ITEM_MIN_LEVEL_DIFFERENCE, Config.DROP_ITEM_MIN_LEVEL_GAP_CHANCE, 100.0);
  623. +        }
  624. +        return levelGapChanceToDrop;
  625. +    }
  626. +
  627.     /**
  628.      * All item drop chance calculations are done by this method.
  629.      * @param dropItem
  630. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/PrimeShop.xsd
  631. IDEA additional info:
  632. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  633. <+>UTF-8
  634. ===================================================================
  635. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/PrimeShop.xsd b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/PrimeShop.xsd
  636. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/PrimeShop.xsd (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  637. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/PrimeShop.xsd (date 1619730747593)
  638. @@ -1,43 +1,46 @@
  639.  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  640. -   <xs:element name="list">
  641. -       <xs:complexType>
  642. -           <xs:sequence>
  643. -               <xs:element name="item" maxOccurs="unbounded" minOccurs="0">
  644. -                   <xs:complexType>
  645. -                       <xs:sequence>
  646. -                           <xs:element name="item" maxOccurs="unbounded" minOccurs="0">
  647. -                               <xs:complexType>
  648. -                                   <xs:attribute type="xs:int" name="itemId" use="optional" />
  649. -                                   <xs:attribute type="xs:int" name="count" use="optional" />
  650. -                               </xs:complexType>
  651. -                           </xs:element>
  652. -                       </xs:sequence>
  653. -                       <xs:attribute type="xs:int" name="id" use="optional" />
  654. -                       <xs:attribute type="xs:byte" name="cat" use="optional" />
  655. -                       <xs:attribute type="xs:byte" name="paymentType" use="optional" />
  656. -                       <xs:attribute type="xs:int" name="price" use="optional" />
  657. -                       <xs:attribute type="xs:byte" name="panelType" use="optional" />
  658. -                       <xs:attribute type="xs:byte" name="recommended" use="optional" />
  659. -                       <xs:attribute type="xs:int" name="startSale" use="optional" />
  660. -                       <xs:attribute type="xs:int" name="endSale" use="optional" />
  661. -                       <xs:attribute type="xs:byte" name="dayOfWeek" use="optional" />
  662. -                       <xs:attribute type="xs:byte" name="startHour" use="optional" />
  663. -                       <xs:attribute type="xs:byte" name="startMinute" use="optional" />
  664. -                       <xs:attribute type="xs:byte" name="stopHour" use="optional" />
  665. -                       <xs:attribute type="xs:byte" name="stopMinute" use="optional" />
  666. -                       <xs:attribute type="xs:byte" name="stock" use="optional" />
  667. -                       <xs:attribute type="xs:byte" name="maxStock" use="optional" />
  668. -                       <xs:attribute type="xs:byte" name="salePercent" use="optional" />
  669. -                       <xs:attribute type="xs:byte" name="minLevel" use="optional" />
  670. -                       <xs:attribute type="xs:byte" name="maxLevel" use="optional" />
  671. -                       <xs:attribute type="xs:byte" name="minBirthday" use="optional" />
  672. -                       <xs:attribute type="xs:byte" name="maxBirthday" use="optional" />
  673. -                       <xs:attribute type="xs:byte" name="restrictionDay" use="optional" />
  674. -                       <xs:attribute type="xs:byte" name="availableCount" use="optional" />
  675. -                   </xs:complexType>
  676. -               </xs:element>
  677. -           </xs:sequence>
  678. -           <xs:attribute type="xs:boolean" name="enabled" />
  679. -       </xs:complexType>
  680. -   </xs:element>
  681. +    <xs:element name="list">
  682. +        <xs:complexType>
  683. +            <xs:sequence>
  684. +                <xs:element name="item" maxOccurs="unbounded" minOccurs="0">
  685. +                    <xs:complexType>
  686. +                        <xs:sequence>
  687. +                            <xs:element name="item" maxOccurs="unbounded" minOccurs="0">
  688. +                                <xs:complexType>
  689. +                                    <xs:attribute type="xs:int" name="itemId" use="optional" />
  690. +                                    <xs:attribute type="xs:int" name="count" use="optional" />
  691. +                                </xs:complexType>
  692. +                            </xs:element>
  693. +                        </xs:sequence>
  694. +                        <xs:attribute type="xs:int" name="id" use="optional" />
  695. +                        <xs:attribute type="xs:byte" name="cat" use="optional" />
  696. +                        <xs:attribute type="xs:byte" name="paymentType" use="optional" />
  697. +                        <xs:attribute type="xs:int" name="price" use="optional" />
  698. +                        <xs:attribute type="xs:byte" name="panelType" use="optional" />
  699. +                        <xs:attribute type="xs:byte" name="recommended" use="optional" />
  700. +                        <xs:attribute type="xs:int" name="startSale" use="optional" />
  701. +                        <xs:attribute type="xs:int" name="endSale" use="optional" />
  702. +                        <xs:attribute type="xs:byte" name="dayOfWeek" use="optional" />
  703. +                        <xs:attribute type="xs:byte" name="startHour" use="optional" />
  704. +                        <xs:attribute type="xs:byte" name="startMinute" use="optional" />
  705. +                        <xs:attribute type="xs:byte" name="stopHour" use="optional" />
  706. +                        <xs:attribute type="xs:byte" name="stopMinute" use="optional" />
  707. +                        <xs:attribute type="xs:byte" name="stock" use="optional" />
  708. +                        <xs:attribute type="xs:byte" name="maxStock" use="optional" />
  709. +                        <xs:attribute type="xs:byte" name="salePercent" use="optional" />
  710. +                        <xs:attribute type="xs:byte" name="minLevel" use="optional" />
  711. +                        <xs:attribute type="xs:byte" name="maxLevel" use="optional" />
  712. +                        <xs:attribute type="xs:byte" name="minBirthday" use="optional" />
  713. +                        <xs:attribute type="xs:byte" name="maxBirthday" use="optional" />
  714. +                        <xs:attribute type="xs:byte" name="restrictionDay" use="optional" />
  715. +                        <xs:attribute type="xs:byte" name="availableCount" use="optional" />
  716. +                        <xs:attribute type="xs:boolean" name="isVipGift" use="optional" />
  717. +                        <xs:attribute type="xs:byte" name="vipTier" use="optional" />
  718. +                        <xs:attribute type="xs:int" name="silverCoin" use="optional" />
  719. +                    </xs:complexType>
  720. +                </xs:element>
  721. +            </xs:sequence>
  722. +            <xs:attribute type="xs:boolean" name="enabled" />
  723. +        </xs:complexType>
  724. +    </xs:element>
  725.  </xs:schema>
  726. \ No newline at end of file
  727. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/PcCafe.ini
  728. IDEA additional info:
  729. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  730. <+>UTF-8
  731. ===================================================================
  732. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/PcCafe.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/PcCafe.ini
  733. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/PcCafe.ini   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  734. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/PcCafe.ini   (date 1619730747037)
  735. @@ -9,6 +9,9 @@
  736.  # Allow only players with a Premium account.
  737.  PcCafeOnlyPremium = False
  738.  
  739. +# Allow only players with a Vip Tier account.
  740. +PcCafeOnlyVip = False
  741. +
  742.  # Max points that player may have.
  743.  # Limited by int limit.
  744.  MaxPcCafePoints = 200000
  745. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
  746. IDEA additional info:
  747. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  748. <+>UTF-8
  749. ===================================================================
  750. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java
  751. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  752. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java   (date 1619730827465)
  753. @@ -17,6 +17,8 @@
  754.  package org.l2jmobius.gameserver.network.clientpackets.primeshop;
  755.  
  756.  import java.util.Calendar;
  757. +import java.util.LinkedList;
  758. +import java.util.List;
  759.  
  760.  import org.l2jmobius.Config;
  761.  import org.l2jmobius.commons.network.PacketReader;
  762. @@ -24,9 +26,11 @@
  763.  import org.l2jmobius.gameserver.data.xml.PrimeShopData;
  764.  import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  765.  import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest;
  766. +import org.l2jmobius.gameserver.model.holders.ItemHolder;
  767.  import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
  768.  import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
  769.  import org.l2jmobius.gameserver.model.primeshop.PrimeShopItem;
  770. +import org.l2jmobius.gameserver.model.variables.AccountVariables;
  771.  import org.l2jmobius.gameserver.network.GameClient;
  772.  import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  773.  import org.l2jmobius.gameserver.network.serverpackets.primeshop.ExBRBuyProduct;
  774. @@ -72,39 +76,56 @@
  775.         final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId);
  776.         if (validatePlayer(item, _count, player))
  777.         {
  778. -           final int price = (item.getPrice() * _count);
  779. -           final int paymentId = validatePaymentId(item, price);
  780. -           if (paymentId < 0)
  781. -           {
  782. -               player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT));
  783. -               player.removeRequest(PrimeShopRequest.class);
  784. -               return;
  785. -           }
  786. -           else if (paymentId > 0)
  787. -           {
  788. -               if (!player.destroyItemByItemId("PrimeShop-" + item.getBrId(), paymentId, price, player, true))
  789. -               {
  790. -                   player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT));
  791. -                   player.removeRequest(PrimeShopRequest.class);
  792. -                   return;
  793. -               }
  794. -           }
  795. -           else if (paymentId == 0)
  796. -           {
  797. -               if (player.getPrimePoints() < price)
  798. -               {
  799. -                   player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT));
  800. -                   player.removeRequest(PrimeShopRequest.class);
  801. -                   return;
  802. -               }
  803. -               player.setPrimePoints(player.getPrimePoints() - price);
  804. -           }
  805. -          
  806. +
  807. +           boolean hasItems = true;
  808. +           //First loop to validate all items
  809. +            for (ItemHolder itemHolder : validatePaymentId(item)) {
  810. +                final int paymentId = itemHolder.getId();
  811. +                final long price = itemHolder.getCount() * _count;
  812. +                if (paymentId < 0)
  813. +                {
  814. +                    hasItems = false;
  815. +                }else if(paymentId > 0){
  816. +                    if(player.getInventory().getInventoryItemCount(paymentId,0) < price){
  817. +                        hasItems = false;
  818. +                    }
  819. +                }else{ // this is always 0
  820. +                    if (player.getPrimePoints() < price)
  821. +                    {
  822. +                        hasItems = false;
  823. +                    }
  824. +                }
  825. +            }
  826. +
  827. +            if(!hasItems){
  828. +                player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT));
  829. +                player.removeRequest(PrimeShopRequest.class);
  830. +                return;
  831. +            }
  832. +
  833. +            // Second loop, only if all criteria has been met!
  834. +            // this should always be reached if player has all the coins needed for the purchase
  835. +            for (ItemHolder itemHolder : validatePaymentId(item)) {
  836. +                final int paymentId = itemHolder.getId();
  837. +                final long price = itemHolder.getCount() * _count;
  838. +                if (paymentId > 0)
  839. +                {
  840. +                    player.destroyItemByItemId("PrimeShop-" + item.getBrId(), paymentId, price, player, true);
  841. +                }
  842. +                else if (paymentId == 0)
  843. +                {
  844. +                    player.setPrimePoints(player.getPrimePoints() - (int) price);
  845. +                    if (Config.VIP_SYSTEM_PRIME_AFFECT)
  846. +                        player.updateVipPoints(price);
  847. +                }
  848. +            }
  849. +
  850.             for (PrimeShopItem subItem : item.getItems())
  851.             {
  852.                 player.addItem("PrimeShop", subItem.getId(), subItem.getCount() * _count, player, true);
  853.             }
  854. -          
  855. +            if(item.isVipGift())
  856. +                player.getAccountVariables().set(AccountVariables.VIP_ITEM_BOUGHT, Calendar.getInstance().getTimeInMillis());
  857.             player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.SUCCESS));
  858.             player.sendPacket(new ExBRGamePoint(player));
  859.         }
  860. @@ -168,8 +189,13 @@
  861.             player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.AFTER_SALE_DATE));
  862.             return false;
  863.         }
  864. -      
  865. -       final int weight = item.getWeight() * count;
  866. +
  867. +        if(item.getVipTier() > player.getVipTier() || item.isVipGift() && !canReceiveGift(player, item)) {
  868. +            player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.SOLD_OUT));
  869. +            return false;
  870. +        }
  871. +
  872. +        final int weight = item.getWeight() * count;
  873.         final long slots = item.getCount() * count;
  874.         if (player.getInventory().validateWeight(weight))
  875.         {
  876. @@ -187,24 +213,59 @@
  877.        
  878.         return true;
  879.     }
  880. +
  881. +    /**
  882. +     * Check if player can receive Gift from L2 Store
  883. +     * @param player player in question
  884. +     * @param item requested item.
  885. +     * @return true if player can receive gift item.
  886. +     */
  887. +   private static boolean canReceiveGift(PlayerInstance player, PrimeShopGroup item){
  888. +        if(!Config.VIP_SYSTEM_ENABLED)
  889. +            return false;
  890. +       if(player.getVipTier() <= 0)
  891. +           return false;
  892. +       else if(item.getVipTier() != player.getVipTier()) {
  893. +           player.sendMessage("This item is not for your vip tier!");
  894. +            return false;
  895. +        } else{
  896. +           long timeBought = player.getAccountVariables().getLong(AccountVariables.VIP_ITEM_BOUGHT, 0L);
  897. +            return timeBought <= 0;
  898. +        }
  899. +    }
  900.    
  901. -   private static int validatePaymentId(PrimeShopGroup item, long amount)
  902. +   private static List<ItemHolder> validatePaymentId(PrimeShopGroup item)
  903.     {
  904. +
  905. +       List<ItemHolder> temp = new LinkedList<>();
  906.         switch (item.getPaymentType())
  907.         {
  908.             case 0: // Prime points
  909.             {
  910. -               return 0;
  911. +               if(item.getVipTier() > 0){
  912. +                   if(item.getPrice() > 0){
  913. +                        temp.add(new ItemHolder(Inventory.GOLD_COIN ,item.getPrice()));
  914. +                    }
  915. +                   if(item.getSilverCoin() > 0){
  916. +                        temp.add(new ItemHolder(Inventory.SILVER_COIN , item.getSilverCoin()));
  917. +                    }
  918. +                }else{
  919. +                    temp.add(new ItemHolder(0 ,item.getPrice())); // prime points
  920. +                }
  921. +               return temp;
  922.             }
  923.             case 1: // Adenas
  924.             {
  925. -               return Inventory.ADENA_ID;
  926. +                temp.add(new ItemHolder(Inventory.ADENA_ID ,item.getPrice())); // Is this even used????
  927. +                return temp;
  928.             }
  929.             case 2: // Hero coins
  930.             {
  931. -               return HERO_COINS;
  932. -           }
  933. +                temp.add(new ItemHolder(HERO_COINS, item.getPrice())); // Is this even used????
  934. +                return temp;
  935. +            }
  936.         }
  937. -       return -1;
  938. +       temp.add(new ItemHolder(-1,-1));
  939. +       return temp;
  940.     }
  941.  }
  942. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
  943. IDEA additional info:
  944. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  945. <+>UTF-8
  946. ===================================================================
  947. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
  948. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  949. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java   (date 1619738657857)
  950. @@ -21,6 +21,8 @@
  951.  import java.sql.PreparedStatement;
  952.  import java.sql.ResultSet;
  953.  import java.sql.SQLException;
  954. +import java.time.Instant;
  955. +import java.time.temporal.ChronoUnit;
  956.  import java.util.ArrayList;
  957.  import java.util.Arrays;
  958.  import java.util.Calendar;
  959. @@ -193,23 +195,7 @@
  960.  import org.l2jmobius.gameserver.model.eventengine.AbstractEvent;
  961.  import org.l2jmobius.gameserver.model.events.EventDispatcher;
  962.  import org.l2jmobius.gameserver.model.events.EventType;
  963. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayableExpChanged;
  964. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerAbilityPointsChanged;
  965. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerFameChanged;
  966. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaAdd;
  967. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerHennaRemove;
  968. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip;
  969. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
  970. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
  971. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMenteeStatus;
  972. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerMentorStatus;
  973. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPKChanged;
  974. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerProfessionCancel;
  975. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerProfessionChange;
  976. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPvPChanged;
  977. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerPvPKill;
  978. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerReputationChanged;
  979. -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerSubChange;
  980. +import org.l2jmobius.gameserver.model.events.impl.creature.player.*;
  981.  import org.l2jmobius.gameserver.model.events.listeners.FunctionEventListener;
  982.  import org.l2jmobius.gameserver.model.events.returns.TerminateReturn;
  983.  import org.l2jmobius.gameserver.model.events.timers.TimerHolder;
  984. @@ -269,6 +255,7 @@
  985.  import org.l2jmobius.gameserver.model.stats.Stat;
  986.  import org.l2jmobius.gameserver.model.variables.AccountVariables;
  987.  import org.l2jmobius.gameserver.model.variables.PlayerVariables;
  988. +import org.l2jmobius.gameserver.model.vip.VipManager;
  989.  import org.l2jmobius.gameserver.model.zone.ZoneId;
  990.  import org.l2jmobius.gameserver.model.zone.ZoneType;
  991.  import org.l2jmobius.gameserver.model.zone.type.WaterZone;
  992. @@ -344,6 +331,7 @@
  993.  import org.l2jmobius.gameserver.network.serverpackets.ValidateLocation;
  994.  import org.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo;
  995.  import org.l2jmobius.gameserver.network.serverpackets.friend.FriendStatus;
  996. +import org.l2jmobius.gameserver.network.serverpackets.vip.ReceiveVipInfo;
  997.  import org.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
  998.  import org.l2jmobius.gameserver.taskmanager.PlayerAutoSaveTaskManager;
  999.  import org.l2jmobius.gameserver.taskmanager.PvpFlagTaskManager;
  1000. @@ -846,7 +834,7 @@
  1001.     private boolean _hasCharmOfCourage = false;
  1002.    
  1003.     private final Set<Integer> _whisperers = ConcurrentHashMap.newKeySet();
  1004. -  
  1005. +    private byte vipTier = 0;
  1006.     private final List<QuestTimer> _questTimers = new ArrayList<>();
  1007.     private final List<TimerHolder<?>> _timerHolders = new ArrayList<>();
  1008.    
  1009. @@ -2949,7 +2937,22 @@
  1010.     {
  1011.         return _inventory.getAdena();
  1012.     }
  1013. -  
  1014. +
  1015. +   /**
  1016. +    * @return the Gold Coin amount of the PlayerInstance.
  1017. +    */
  1018. +   public long getGoldCoin()
  1019. +   {
  1020. +       return _inventory.getGoldCoin();
  1021. +   }
  1022. +   /**
  1023. +    * @return the Silver Coin of the PlayerInstance.
  1024. +    */
  1025. +   public long getSilverCoin()
  1026. +   {
  1027. +       return _inventory.getSilverCoin();
  1028. +   }
  1029. +
  1030.     /**
  1031.      * @return the Ancient Adena amount of the PlayerInstance.
  1032.      */
  1033. @@ -6614,8 +6617,10 @@
  1034.             {
  1035.                 return null;
  1036.             }
  1037. -          
  1038. -           if (player.isGM())
  1039. +
  1040. +            EventDispatcher.getInstance().notifyEventAsync(new OnPlayerLoad(player), player);
  1041. +
  1042. +            if (player.isGM())
  1043.             {
  1044.                 final long masks = player.getVariables().getLong(COND_OVERRIDE_KEY, PlayerCondOverride.getAllExceptionsMask());
  1045.                 player.setOverrideCond(masks);
  1046. @@ -6711,7 +6716,8 @@
  1047.             player.setOnlineStatus(true, false);
  1048.            
  1049.             PlayerAutoSaveTaskManager.getInstance().add(player);
  1050. -       }
  1051. +
  1052. +        }
  1053.         catch (Exception e)
  1054.         {
  1055.             LOGGER.log(Level.SEVERE, "Failed loading character.", e);
  1056. @@ -9987,8 +9993,9 @@
  1057.         {
  1058.             LOGGER.log(Level.SEVERE, "", e);
  1059.         }
  1060. -      
  1061. +
  1062.         EventDispatcher.getInstance().notifyEventAsync(new OnPlayerLogin(this), this);
  1063. +
  1064.         if (isMentee())
  1065.         {
  1066.             // Notify to scripts
  1067. @@ -13983,4 +13990,45 @@
  1068.             getVariables().set(ATTENDANCE_INDEX_VAR, rewardIndex);
  1069.         }
  1070.     }
  1071. +
  1072. +    public byte getVipTier() {
  1073. +        return vipTier;
  1074. +    }
  1075. +
  1076. +    public void setVipTier(byte vipTier) {
  1077. +        this.vipTier = vipTier;
  1078. +    }
  1079. +
  1080. +    public long getVipPoints()
  1081. +    {
  1082. +        return getAccountVariables().getLong(AccountVariables.VIP_POINTS, 0L);
  1083. +    }
  1084. +
  1085. +    public long getVipTierExpiration() {
  1086. +        return getAccountVariables().getLong(AccountVariables.VIP_EXPIRATION, 0L);
  1087. +    }
  1088. +
  1089. +    public void setVipTierExpiration(long expiration) {
  1090. +        getAccountVariables().set(AccountVariables.VIP_EXPIRATION, expiration);
  1091. +    }
  1092. +
  1093. +    public void updateVipPoints(long points) {
  1094. +        if(points == 0) {
  1095. +            return;
  1096. +        }
  1097. +        var currentVipTier = VipManager.getInstance().getVipTier(getVipPoints());
  1098. +        getAccountVariables().set(AccountVariables.VIP_POINTS, getVipPoints() + points);
  1099. +        var newTier = VipManager.getInstance().getVipTier(getVipPoints());
  1100. +        if(newTier != currentVipTier) {
  1101. +            vipTier = newTier;
  1102. +            if(newTier > 0) {
  1103. +                getAccountVariables().set(AccountVariables.VIP_EXPIRATION, Instant.now().plus(30, ChronoUnit.DAYS).toEpochMilli());
  1104. +                VipManager.getInstance().manageTier(this);
  1105. +            } else {
  1106. +                getAccountVariables().set(AccountVariables.VIP_EXPIRATION, 0L);
  1107. +            }
  1108. +        }
  1109. +        getAccountVariables().storeMe(); //force to store to prevent falty purchases after a crash.
  1110. +        sendPacket(new ReceiveVipInfo(this));
  1111. +    }
  1112.  }
  1113. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
  1114. IDEA additional info:
  1115. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1116. <+>UTF-8
  1117. ===================================================================
  1118. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java
  1119. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1120. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/ExIncomingPackets.java (date 1619740646468)
  1121. @@ -88,6 +88,9 @@
  1122.  import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOff;
  1123.  import org.l2jmobius.gameserver.network.clientpackets.shuttle.RequestShuttleGetOn;
  1124.  import org.l2jmobius.gameserver.network.clientpackets.training.NotifyTrainingRoomEnd;
  1125. +import org.l2jmobius.gameserver.network.clientpackets.vip.ExRequestVipInfo;
  1126. +import org.l2jmobius.gameserver.network.clientpackets.vip.RequestVipLuckGameInfo;
  1127. +import org.l2jmobius.gameserver.network.clientpackets.vip.RequestVipProductList;
  1128.  
  1129.  /**
  1130.   * @author Sdw
  1131. @@ -350,11 +353,11 @@
  1132.     REQUEST_VIP_ATTENDANCE_CHECK(0x107, RequestVipAttendanceCheck::new, ConnectionState.IN_GAME),
  1133.     REQUEST_ITEM_ENSOUL(0x108, RequestItemEnsoul::new, ConnectionState.IN_GAME),
  1134.     REQUEST_CASTLE_WAR_SEASON_REWARD(0x109, null, ConnectionState.IN_GAME),
  1135. -   REQUEST_VIP_PRODUCT_LIST(0x10A, null, ConnectionState.IN_GAME),
  1136. -   REQUEST_VIP_LUCKY_GAME_INFO(0x10B, null, ConnectionState.IN_GAME),
  1137. +   REQUEST_VIP_PRODUCT_LIST(0x10A, RequestVipProductList::new, ConnectionState.IN_GAME),
  1138. +   REQUEST_VIP_LUCKY_GAME_INFO(0x10B, RequestVipLuckGameInfo::new, ConnectionState.IN_GAME),
  1139.     REQUEST_VIP_LUCKY_GAME_ITEM_LIST(0x10C, null, ConnectionState.IN_GAME),
  1140.     REQUEST_VIP_LUCKY_GAME_BONUS(0x10D, null, ConnectionState.IN_GAME),
  1141. -   EX_REQUEST_VIP_INFO(0x10E, null, ConnectionState.IN_GAME),
  1142. +   EX_REQUEST_VIP_INFO(0x10E, ExRequestVipInfo::new, ConnectionState.IN_GAME),
  1143.     REQUEST_CAPTCHA_ANSWER(0x10F, null, ConnectionState.IN_GAME),
  1144.     REQUEST_REFRESH_CAPTCHA_IMAGE(0x110, null, ConnectionState.IN_GAME),
  1145.     REQUEST_PLEDGE_SIGN_IN_FOR_OPEN_JOINING_METHOD(0x111, RequestPledgeSignInForOpenJoiningMethod::new, ConnectionState.IN_GAME),
  1146. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
  1147. IDEA additional info:
  1148. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1149. <+>UTF-8
  1150. ===================================================================
  1151. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java
  1152. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1153. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRPresentBuyProduct.java    (date 1619730827469)
  1154. @@ -88,6 +88,12 @@
  1155.         player.addRequest(new PrimeShopRequest(player));
  1156.        
  1157.         final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId);
  1158. +
  1159. +       if(item.isVipGift()){
  1160. +           player.sendMessage("You cannot gift a Vip Gift!");
  1161. +           return;
  1162. +        }
  1163. +
  1164.         if (validatePlayer(item, _count, player))
  1165.         {
  1166.             final int price = (item.getPrice() * _count);
  1167. @@ -116,6 +122,8 @@
  1168.                     return;
  1169.                 }
  1170.                 player.setPrimePoints(player.getPrimePoints() - price);
  1171. +               if(Config.VIP_SYSTEM_PRIME_AFFECT)
  1172. +                   player.updateVipPoints(price);
  1173.             }
  1174.            
  1175.             player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.SUCCESS));
  1176. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/PcCafePointsManager.java
  1177. IDEA additional info:
  1178. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1179. <+>UTF-8
  1180. ===================================================================
  1181. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/PcCafePointsManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/PcCafePointsManager.java
  1182. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/PcCafePointsManager.java   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1183. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/PcCafePointsManager.java   (date 1619730748511)
  1184. @@ -38,6 +38,11 @@
  1185.         {
  1186.             return;
  1187.         }
  1188. +
  1189. +       if (Config.PC_CAFE_ONLY_VIP && player.getVipTier() <= 0)
  1190. +       {
  1191. +           return;
  1192. +       }
  1193.        
  1194.         if (player.getPcCafePoints() >= Config.PC_CAFE_MAX_POINTS)
  1195.         {
  1196. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/items/29500-29599.xml
  1197. IDEA additional info:
  1198. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1199. <+>UTF-8
  1200. ===================================================================
  1201. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/items/29500-29599.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/items/29500-29599.xml
  1202. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/items/29500-29599.xml   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1203. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/items/29500-29599.xml   (date 1619733403482)
  1204. @@ -73,46 +73,70 @@
  1205.     <item id="29505" name="Normal VIP Gain Scroll" type="EtcItem">
  1206.         <!-- Allows to regain 1 VIP Point when used. Cannot be exchanged, dropped or sold in a private store. Can be stored in a private warehouse. -->
  1207.         <set name="icon" val="BranchIcon.Icon.g_bm_vip_potion_i00" />
  1208. -       <set name="default_action" val="SKILL_REDUCE" />
  1209. -       <set name="material" val="PAPER" />
  1210. -       <set name="weight" val="5" />
  1211. -       <set name="is_tradable" val="false" />
  1212. -       <set name="is_dropable" val="false" />
  1213. -       <set name="is_sellable" val="false" />
  1214. -       <set name="is_stackable" val="true" />
  1215. +        <set name="is_stackable" val="true" />
  1216. +        <set name="is_tradable" val="false" />
  1217. +        <set name="is_dropable" val="false" />
  1218. +        <set name="is_sellable" val="false" />
  1219. +        <set name="is_oly_restricted" val="true" />
  1220. +        <set name="default_action" val="SKILL_REDUCE" />
  1221. +        <set name="etcitem_type" val="SCROLL" />
  1222. +        <set name="handler" val="ItemSkills" />
  1223. +        <set name="commissionItemType" val="SCROLL_OTHER" />
  1224. +        <set name="material" val="PAPER" />
  1225. +        <skills>
  1226. +            <skill id="55322" level="1" /> <!-- Normal VIP Gain Scroll -->
  1227. +        </skills>
  1228.     </item>
  1229.     <item id="29506" name="Medium VIP Gain Scroll" type="EtcItem">
  1230.         <!-- Allows to regain 10 VIP Points when used. Cannot be exchanged, dropped or sold in a private store. Can be stored in a private warehouse. -->
  1231.         <set name="icon" val="BranchIcon.Icon.g_bm_vip_potion_i00" />
  1232. -       <set name="default_action" val="SKILL_REDUCE" />
  1233. -       <set name="material" val="PAPER" />
  1234. -       <set name="weight" val="5" />
  1235. -       <set name="is_tradable" val="false" />
  1236. -       <set name="is_dropable" val="false" />
  1237. -       <set name="is_sellable" val="false" />
  1238. -       <set name="is_stackable" val="true" />
  1239. +        <set name="is_stackable" val="true" />
  1240. +        <set name="is_tradable" val="false" />
  1241. +        <set name="is_dropable" val="false" />
  1242. +        <set name="is_sellable" val="false" />
  1243. +        <set name="is_oly_restricted" val="true" />
  1244. +        <set name="default_action" val="SKILL_REDUCE" />
  1245. +        <set name="etcitem_type" val="SCROLL" />
  1246. +        <set name="handler" val="ItemSkills" />
  1247. +        <set name="commissionItemType" val="SCROLL_OTHER" />
  1248. +        <set name="material" val="PAPER" />
  1249. +        <skills>
  1250. +            <skill id="55323" level="1" /> <!-- Medium VIP Gain Scroll -->
  1251. +        </skills>
  1252.     </item>
  1253.     <item id="29507" name="Good VIP Gain Scroll" type="EtcItem">
  1254.         <!-- Allows to regain 100 VIP Points when used. Cannot be exchanged, dropped or sold in a private store. Can be stored in a private warehouse. -->
  1255.         <set name="icon" val="BranchIcon.Icon.g_bm_vip_potion_i00" />
  1256. -       <set name="default_action" val="SKILL_REDUCE" />
  1257. -       <set name="material" val="PAPER" />
  1258. -       <set name="weight" val="5" />
  1259. -       <set name="is_tradable" val="false" />
  1260. -       <set name="is_dropable" val="false" />
  1261. -       <set name="is_sellable" val="false" />
  1262. -       <set name="is_stackable" val="true" />
  1263. +        <set name="is_stackable" val="true" />
  1264. +        <set name="is_tradable" val="false" />
  1265. +        <set name="is_dropable" val="false" />
  1266. +        <set name="is_sellable" val="false" />
  1267. +        <set name="is_oly_restricted" val="true" />
  1268. +        <set name="default_action" val="SKILL_REDUCE" />
  1269. +        <set name="etcitem_type" val="SCROLL" />
  1270. +        <set name="handler" val="ItemSkills" />
  1271. +        <set name="commissionItemType" val="SCROLL_OTHER" />
  1272. +        <set name="material" val="PAPER" />
  1273. +        <skills>
  1274. +            <skill id="55324" level="1" /> <!-- Good VIP Gain Scroll -->
  1275. +        </skills>
  1276.     </item>
  1277.     <item id="29508" name="Perfect VIP Gain Scroll" type="EtcItem">
  1278.         <!-- Allows to regain 280 VIP Points when used. Cannot be exchanged, dropped or sold in a private store. Can be stored in a private warehouse. -->
  1279.         <set name="icon" val="BranchIcon.Icon.g_bm_vip_potion_i00" />
  1280. -       <set name="default_action" val="SKILL_REDUCE" />
  1281. -       <set name="material" val="PAPER" />
  1282. -       <set name="weight" val="5" />
  1283. -       <set name="is_tradable" val="false" />
  1284. -       <set name="is_dropable" val="false" />
  1285. -       <set name="is_sellable" val="false" />
  1286. -       <set name="is_stackable" val="true" />
  1287. +        <set name="is_stackable" val="true" />
  1288. +        <set name="is_tradable" val="false" />
  1289. +        <set name="is_dropable" val="false" />
  1290. +        <set name="is_sellable" val="false" />
  1291. +        <set name="is_oly_restricted" val="true" />
  1292. +        <set name="default_action" val="SKILL_REDUCE" />
  1293. +        <set name="etcitem_type" val="SCROLL" />
  1294. +        <set name="handler" val="ItemSkills" />
  1295. +        <set name="commissionItemType" val="SCROLL_OTHER" />
  1296. +        <set name="material" val="PAPER" />
  1297. +        <skills>
  1298. +            <skill id="55325" level="1" /> <!-- Perfect VIP Gain Scroll -->
  1299. +        </skills>
  1300.     </item>
  1301.     <item id="29509" name="Feather of Blessing (temporary used by NPC)" type="EtcItem">
  1302.         <!-- Dimensional item. Blessed feather that allows to resurrect right in the place of death. -->
  1303. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java
  1304. IDEA additional info:
  1305. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1306. <+>UTF-8
  1307. ===================================================================
  1308. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java
  1309. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java  (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1310. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/instancemanager/DailyTaskManager.java  (date 1619730748497)
  1311. @@ -39,7 +39,9 @@
  1312.  import org.l2jmobius.gameserver.model.holders.SkillHolder;
  1313.  import org.l2jmobius.gameserver.model.holders.SubClassHolder;
  1314.  import org.l2jmobius.gameserver.model.olympiad.Olympiad;
  1315. +import org.l2jmobius.gameserver.model.variables.AccountVariables;
  1316.  import org.l2jmobius.gameserver.model.variables.PlayerVariables;
  1317. +import org.l2jmobius.gameserver.model.vip.VipManager;
  1318.  import org.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo;
  1319.  import org.l2jmobius.gameserver.network.serverpackets.ExWorldChatCnt;
  1320.  
  1321. @@ -68,6 +70,7 @@
  1322.         resetRecommends();
  1323.         resetWorldChatPoints();
  1324.         resetTrainingCamp();
  1325. +        checkVip();
  1326.     }
  1327.    
  1328.     @ScheduleTarget
  1329. @@ -81,7 +84,23 @@
  1330.             LOGGER.info("Olympiad System: Data updated.");
  1331.         }
  1332.     }
  1333. -  
  1334. +
  1335. +   private void checkVip(){
  1336. +        // Delete all entries for received gifts
  1337. +        AccountVariables.deleteVipPurchases(AccountVariables.VIP_ITEM_BOUGHT);
  1338. +
  1339. +       // Checks the tier expiration for online players
  1340. +        // offline players get handled on next time they log in.
  1341. +        for (PlayerInstance player : World.getInstance().getPlayers())
  1342. +        {
  1343. +            if(player.getVipTier() > 0) {
  1344. +                VipManager.getInstance().checkVipTierExpiration(player);
  1345. +            }
  1346. +
  1347. +            player.getAccountVariables().restoreMe();
  1348. +        }
  1349. +    }
  1350. +
  1351.     @ScheduleTarget
  1352.     private void onClanLeaderApply()
  1353.     {
  1354. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExWorldChatCnt.java
  1355. IDEA additional info:
  1356. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1357. <+>UTF-8
  1358. ===================================================================
  1359. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExWorldChatCnt.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExWorldChatCnt.java
  1360. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExWorldChatCnt.java  (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1361. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExWorldChatCnt.java  (date 1619730827517)
  1362. @@ -30,7 +30,7 @@
  1363.    
  1364.     public ExWorldChatCnt(PlayerInstance player)
  1365.     {
  1366. -       _points = player.getLevel() < Config.WORLD_CHAT_MIN_LEVEL ? 0 : Math.max(player.getWorldChatPoints() - player.getWorldChatUsed(), 0);
  1367. +       _points = player.getLevel() < Config.WORLD_CHAT_MIN_LEVEL || player.getVipTier() <= 0 ? 0 : Math.max(player.getWorldChatPoints() - player.getWorldChatUsed(), 0);
  1368.     }
  1369.    
  1370.     @Override
  1371. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/AccountVariables.java
  1372. IDEA additional info:
  1373. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1374. <+>UTF-8
  1375. ===================================================================
  1376. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/AccountVariables.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/AccountVariables.java
  1377. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/AccountVariables.java  (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1378. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/variables/AccountVariables.java  (date 1619730827446)
  1379. @@ -37,11 +37,16 @@
  1380.     private static final String SELECT_QUERY = "SELECT * FROM account_gsdata WHERE account_name = ?";
  1381.     private static final String DELETE_QUERY = "DELETE FROM account_gsdata WHERE account_name = ?";
  1382.     private static final String INSERT_QUERY = "INSERT INTO account_gsdata (account_name, var, value) VALUES (?, ?, ?)";
  1383. -  
  1384. +   private static final String DELETE_QUERY_VAR = "DELETE FROM account_gsdata where var = ?";
  1385. +
  1386.     // Public variable names
  1387.     public static final String HWID = "HWID";
  1388.     public static final String HWIDSLIT_VAR = " ";
  1389. -  
  1390. +   public static final String VIP_POINTS = "VipPoints";
  1391. +   public static final String VIP_TIER = "VipTier";
  1392. +   public static final String VIP_EXPIRATION = "VipExpiration";
  1393. +   public static final String VIP_ITEM_BOUGHT = "Vip_Item_Bought";
  1394. +
  1395.     private final String _accountName;
  1396.    
  1397.     public AccountVariables(String accountName)
  1398. @@ -143,4 +148,28 @@
  1399.         }
  1400.         return true;
  1401.     }
  1402. +
  1403. +    /**
  1404. +     * Delete all entries for an requested var
  1405. +     * @param var
  1406. +     * @return success
  1407. +     */
  1408. +   public static boolean deleteVipPurchases(String var)
  1409. +   {
  1410. +       try (Connection con = DatabaseFactory.getConnection())
  1411. +       {
  1412. +           // Clear previous entries.
  1413. +           try (PreparedStatement st = con.prepareStatement(DELETE_QUERY_VAR))
  1414. +           {
  1415. +               st.setString(1, var);
  1416. +               st.execute();
  1417. +           }
  1418. +       }
  1419. +       catch (Exception e)
  1420. +       {
  1421. +           LOGGER.log(Level.WARNING, "AccountVariables: Couldn't delete vip variables!", e);
  1422. +           return false;
  1423. +       }
  1424. +       return true;
  1425. +   }
  1426.  }
  1427. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/attendance/RequestVipAttendanceCheck.java
  1428. IDEA additional info:
  1429. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1430. <+>UTF-8
  1431. ===================================================================
  1432. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/attendance/RequestVipAttendanceCheck.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/attendance/RequestVipAttendanceCheck.java
  1433. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/attendance/RequestVipAttendanceCheck.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1434. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/attendance/RequestVipAttendanceCheck.java    (date 1619730827458)
  1435. @@ -60,7 +60,10 @@
  1436.         {
  1437.             player.sendPacket(SystemMessageId.YOUR_VIP_RANK_IS_TOO_LOW_TO_RECEIVE_THE_REWARD);
  1438.             return;
  1439. -       }
  1440. +       }else if(Config.VIP_ONLY_ATTENDANCE_REWARDS && player.getVipTier() <= 0){
  1441. +            player.sendPacket(SystemMessageId.YOUR_VIP_RANK_IS_TOO_LOW_TO_RECEIVE_THE_REWARD);
  1442. +            return;
  1443. +        }
  1444.        
  1445.         // Check login delay.
  1446.         if (player.getUptime() < (Config.ATTENDANCE_REWARD_DELAY * 60 * 1000))
  1447. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/GameServer.java
  1448. IDEA additional info:
  1449. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1450. <+>UTF-8
  1451. ===================================================================
  1452. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/GameServer.java
  1453. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/GameServer.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1454. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/GameServer.java    (date 1619731305530)
  1455. @@ -45,62 +45,7 @@
  1456.  import org.l2jmobius.gameserver.data.sql.ClanTable;
  1457.  import org.l2jmobius.gameserver.data.sql.CrestTable;
  1458.  import org.l2jmobius.gameserver.data.sql.OfflineTraderTable;
  1459. -import org.l2jmobius.gameserver.data.xml.ActionData;
  1460. -import org.l2jmobius.gameserver.data.xml.AdminData;
  1461. -import org.l2jmobius.gameserver.data.xml.AppearanceItemData;
  1462. -import org.l2jmobius.gameserver.data.xml.ArmorSetData;
  1463. -import org.l2jmobius.gameserver.data.xml.AttendanceRewardData;
  1464. -import org.l2jmobius.gameserver.data.xml.BeautyShopData;
  1465. -import org.l2jmobius.gameserver.data.xml.BuyListData;
  1466. -import org.l2jmobius.gameserver.data.xml.CategoryData;
  1467. -import org.l2jmobius.gameserver.data.xml.ClanHallData;
  1468. -import org.l2jmobius.gameserver.data.xml.ClanRewardData;
  1469. -import org.l2jmobius.gameserver.data.xml.ClassListData;
  1470. -import org.l2jmobius.gameserver.data.xml.CombinationItemsData;
  1471. -import org.l2jmobius.gameserver.data.xml.CubicData;
  1472. -import org.l2jmobius.gameserver.data.xml.DailyMissionData;
  1473. -import org.l2jmobius.gameserver.data.xml.DoorData;
  1474. -import org.l2jmobius.gameserver.data.xml.EnchantItemData;
  1475. -import org.l2jmobius.gameserver.data.xml.EnchantItemGroupsData;
  1476. -import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData;
  1477. -import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData;
  1478. -import org.l2jmobius.gameserver.data.xml.EnchantSkillGroupsData;
  1479. -import org.l2jmobius.gameserver.data.xml.EnsoulData;
  1480. -import org.l2jmobius.gameserver.data.xml.EventEngineData;
  1481. -import org.l2jmobius.gameserver.data.xml.ExperienceData;
  1482. -import org.l2jmobius.gameserver.data.xml.FakePlayerData;
  1483. -import org.l2jmobius.gameserver.data.xml.FenceData;
  1484. -import org.l2jmobius.gameserver.data.xml.FishingData;
  1485. -import org.l2jmobius.gameserver.data.xml.HennaData;
  1486. -import org.l2jmobius.gameserver.data.xml.HitConditionBonusData;
  1487. -import org.l2jmobius.gameserver.data.xml.InitialEquipmentData;
  1488. -import org.l2jmobius.gameserver.data.xml.InitialShortcutData;
  1489. -import org.l2jmobius.gameserver.data.xml.ItemCrystallizationData;
  1490. -import org.l2jmobius.gameserver.data.xml.KarmaData;
  1491. -import org.l2jmobius.gameserver.data.xml.LuckyGameData;
  1492. -import org.l2jmobius.gameserver.data.xml.MultisellData;
  1493. -import org.l2jmobius.gameserver.data.xml.NpcData;
  1494. -import org.l2jmobius.gameserver.data.xml.NpcNameLocalisationData;
  1495. -import org.l2jmobius.gameserver.data.xml.OptionData;
  1496. -import org.l2jmobius.gameserver.data.xml.PetDataTable;
  1497. -import org.l2jmobius.gameserver.data.xml.PetSkillData;
  1498. -import org.l2jmobius.gameserver.data.xml.PlayerTemplateData;
  1499. -import org.l2jmobius.gameserver.data.xml.PlayerXpPercentLostData;
  1500. -import org.l2jmobius.gameserver.data.xml.PrimeShopData;
  1501. -import org.l2jmobius.gameserver.data.xml.RecipeData;
  1502. -import org.l2jmobius.gameserver.data.xml.ResidenceFunctionsData;
  1503. -import org.l2jmobius.gameserver.data.xml.SayuneData;
  1504. -import org.l2jmobius.gameserver.data.xml.SecondaryAuthData;
  1505. -import org.l2jmobius.gameserver.data.xml.SendMessageLocalisationData;
  1506. -import org.l2jmobius.gameserver.data.xml.ShuttleData;
  1507. -import org.l2jmobius.gameserver.data.xml.SiegeScheduleData;
  1508. -import org.l2jmobius.gameserver.data.xml.SkillData;
  1509. -import org.l2jmobius.gameserver.data.xml.SkillTreeData;
  1510. -import org.l2jmobius.gameserver.data.xml.SpawnData;
  1511. -import org.l2jmobius.gameserver.data.xml.StaticObjectData;
  1512. -import org.l2jmobius.gameserver.data.xml.TeleporterData;
  1513. -import org.l2jmobius.gameserver.data.xml.TransformData;
  1514. -import org.l2jmobius.gameserver.data.xml.VariationData;
  1515. +import org.l2jmobius.gameserver.data.xml.*;
  1516.  import org.l2jmobius.gameserver.geoengine.GeoEngine;
  1517.  import org.l2jmobius.gameserver.handler.ConditionHandler;
  1518.  import org.l2jmobius.gameserver.handler.DailyMissionHandler;
  1519. @@ -147,6 +92,7 @@
  1520.  import org.l2jmobius.gameserver.model.events.EventDispatcher;
  1521.  import org.l2jmobius.gameserver.model.olympiad.Hero;
  1522.  import org.l2jmobius.gameserver.model.olympiad.Olympiad;
  1523. +import org.l2jmobius.gameserver.model.vip.VipManager;
  1524.  import org.l2jmobius.gameserver.model.votereward.VoteSystem;
  1525.  import org.l2jmobius.gameserver.network.ClientNetworkManager;
  1526.  import org.l2jmobius.gameserver.network.NpcStringId;
  1527. @@ -274,7 +220,8 @@
  1528.         CommissionManager.getInstance();
  1529.         LuckyGameData.getInstance();
  1530.         AttendanceRewardData.getInstance();
  1531. -      
  1532. +        VipData.getInstance();
  1533. +
  1534.         printSection("Characters");
  1535.         ClassListData.getInstance();
  1536.         InitialEquipmentData.getInstance();
  1537. @@ -291,7 +238,8 @@
  1538.         CharSummonTable.getInstance().init();
  1539.         BeautyShopData.getInstance();
  1540.         MentorManager.getInstance();
  1541. -      
  1542. +        VipManager.getInstance();
  1543. +
  1544.         if (Config.FACTION_SYSTEM_ENABLED)
  1545.         {
  1546.             FactionManager.getInstance();
  1547. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/primeshop/PrimeShopGroup.java
  1548. IDEA additional info:
  1549. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1550. <+>UTF-8
  1551. ===================================================================
  1552. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/primeshop/PrimeShopGroup.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/primeshop/PrimeShopGroup.java
  1553. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/primeshop/PrimeShopGroup.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1554. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/primeshop/PrimeShopGroup.java    (date 1619730827428)
  1555. @@ -47,7 +47,10 @@
  1556.     private final int _maxBirthday;
  1557.     private final int _restrictionDay;
  1558.     private final int _availableCount;
  1559. -   private final List<PrimeShopItem> _items;
  1560. +   private final boolean _isVipGift;
  1561. +    private final int _vipTier;
  1562. +    private final int _silverCoin;
  1563. +    private final List<PrimeShopItem> _items;
  1564.    
  1565.     public PrimeShopGroup(StatSet set, List<PrimeShopItem> items)
  1566.     {
  1567. @@ -73,6 +76,10 @@
  1568.         _maxBirthday = set.getInt("maxBirthday", 0);
  1569.         _restrictionDay = set.getInt("restrictionDay", 0);
  1570.         _availableCount = set.getInt("availableCount", 0);
  1571. +        _isVipGift = set.getBoolean("isVipGift", false);
  1572. +        _vipTier = set.getInt("vipTier", 0);
  1573. +        _silverCoin = set.getInt("silverCoin", 0);
  1574. +
  1575.         _items = items;
  1576.     }
  1577.    
  1578. @@ -195,9 +202,21 @@
  1579.     {
  1580.         return _availableCount;
  1581.     }
  1582. -  
  1583. -   public List<PrimeShopItem> getItems()
  1584. +
  1585. +    public boolean isVipGift() {
  1586. +        return _isVipGift;
  1587. +    }
  1588. +
  1589. +    public int getVipTier(){
  1590. +       return _vipTier;
  1591. +    }
  1592. +
  1593. +    public List<PrimeShopItem> getItems()
  1594.     {
  1595.         return _items;
  1596.     }
  1597. +
  1598. +   public int getSilverCoin(){
  1599. +       return _silverCoin;
  1600. +    }
  1601.  }
  1602. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/VipSystem.ini
  1603. IDEA additional info:
  1604. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1605. <+>UTF-8
  1606. ===================================================================
  1607. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/VipSystem.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/VipSystem.ini
  1608. new file mode 100644
  1609. --- /dev/null   (date 1619730747041)
  1610. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/VipSystem.ini    (date 1619730747041)
  1611. @@ -0,0 +1,27 @@
  1612. +# ---------------------------------------------------------------------------
  1613. +# VIP System
  1614. +# ---------------------------------------------------------------------------
  1615. +
  1616. +# VIP System Enabled.
  1617. +# l2.ini
  1618. +# [VipSystem]
  1619. +# UseVipInfoWnd=true
  1620. +# -> needs to be true
  1621. +# Prime shop needs to be true aswell!
  1622. +# Check vip.xml for more info!
  1623. +
  1624. +VIPEnabled = True
  1625. +
  1626. +# Max vip level that can be reached (Client Limitations, lv 8 -> 10 Doesn't exist. If u want to use, make it yourself!)
  1627. +MaxVipLevel = 7
  1628. +
  1629. +# When purchasing from the Prime Shop, the price amount will add to your vip points
  1630. +PrimeAffectPoints = true
  1631. +
  1632. +# Drop Amount of Silver coins if the Vip Tier allows it
  1633. +VipSilverDropMin = 1
  1634. +VipSilverDropMax = 5
  1635. +
  1636. +# Drop Amount of Golden coins if the Vip Tier allows it
  1637. +VipGoldenDropMin = 1
  1638. +VipGoldenDropMax = 5
  1639. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java
  1640. IDEA additional info:
  1641. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1642. <+>UTF-8
  1643. ===================================================================
  1644. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java
  1645. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1646. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java (date 1619730827367)
  1647. @@ -80,6 +80,8 @@
  1648.    
  1649.     // Common Items
  1650.     public static final int ADENA_ID = 57;
  1651. +   public static final int SILVER_COIN = 29983;
  1652. +   public static final int GOLD_COIN = 29984;
  1653.     public static final int ANCIENT_ADENA_ID = 5575;
  1654.     public static final int BEAUTY_TICKET_ID = 36308;
  1655.     public static final int AIR_STONE_ID = 39461;
  1656. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/PrimeShopData.java
  1657. IDEA additional info:
  1658. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1659. <+>UTF-8
  1660. ===================================================================
  1661. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/PrimeShopData.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/PrimeShopData.java
  1662. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/PrimeShopData.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  1663. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/PrimeShopData.java    (date 1619730748371)
  1664. @@ -42,10 +42,12 @@
  1665.  public class PrimeShopData implements IXmlReader
  1666.  {
  1667.     private static final Logger LOGGER = Logger.getLogger(PrimeShopData.class.getName());
  1668. -  
  1669. -   private final Map<Integer, PrimeShopGroup> _primeItems = new LinkedHashMap<>();
  1670. -  
  1671. -   protected PrimeShopData()
  1672. +    private static final int VIP_GIFT_INIT_ID = 100000;
  1673. +
  1674. +    private final Map<Integer, PrimeShopGroup> _primeItems = new LinkedHashMap<>();
  1675. +    private final Map<Integer, PrimeShopGroup> _vipGifts = new LinkedHashMap<>(10);
  1676. +
  1677. +    protected PrimeShopData()
  1678.     {
  1679.         load();
  1680.     }
  1681. @@ -105,12 +107,17 @@
  1682.                                         LOGGER.severe(getClass().getSimpleName() + ": Item template null for itemId: " + itemId + " brId: " + set.getInt("id"));
  1683.                                         return;
  1684.                                     }
  1685. -                                  
  1686. +
  1687.                                     items.add(new PrimeShopItem(itemId, count, item.getWeight(), item.isTradeable() ? 1 : 0));
  1688.                                 }
  1689.                             }
  1690. -                          
  1691. -                           _primeItems.put(set.getInt("id"), new PrimeShopGroup(set, items));
  1692. +                           PrimeShopGroup group = new PrimeShopGroup(set, items);
  1693. +                           if(group.isVipGift()){
  1694. +                                _vipGifts.put(set.getInt("id"), group);
  1695. +                            }else{
  1696. +                                _primeItems.put(set.getInt("id"), group);
  1697. +                            }
  1698. +
  1699.                         }
  1700.                     }
  1701.                 }
  1702. @@ -131,7 +138,10 @@
  1703.    
  1704.     public PrimeShopGroup getItem(int brId)
  1705.     {
  1706. -       return _primeItems.get(brId);
  1707. +       PrimeShopGroup item = _primeItems.get(brId);
  1708. +       if(item == null)
  1709. +           item = _vipGifts.get(brId);
  1710. +       return item;
  1711.     }
  1712.    
  1713.     public Map<Integer, PrimeShopGroup> getPrimeItems()
  1714. @@ -148,4 +158,8 @@
  1715.     {
  1716.         protected static final PrimeShopData INSTANCE = new PrimeShopData();
  1717.     }
  1718. +
  1719. +    public PrimeShopGroup getVipGiftOfTier(byte tier) {
  1720. +        return _vipGifts.get(VIP_GIFT_INIT_ID + tier);
  1721. +    }
  1722.  }
  1723. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/vip.xsd
  1724. IDEA additional info:
  1725. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1726. <+>UTF-8
  1727. ===================================================================
  1728. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/vip.xsd b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/vip.xsd
  1729. new file mode 100644
  1730. --- /dev/null   (date 1619730747598)
  1731. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/xsd/vip.xsd   (date 1619730747598)
  1732. @@ -0,0 +1,26 @@
  1733. +<?xml version="1.0" encoding="UTF-8"?>
  1734. +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  1735. +    <xs:element name="list">
  1736. +        <xs:complexType>
  1737. +            <xs:sequence>
  1738. +                <xs:element name="vip" type="TierInfo" minOccurs="0" maxOccurs="unbounded"/>
  1739. +            </xs:sequence>
  1740. +        </xs:complexType>
  1741. +
  1742. +    </xs:element>
  1743. +
  1744. +    <xs:complexType name="TierInfo">
  1745. +        <xs:sequence>
  1746. +            <xs:element name="bonus" type="TierBonusInfo"/>
  1747. +        </xs:sequence>
  1748. +        <xs:attribute name="tier" type="xs:byte" use="required"/>
  1749. +        <xs:attribute name="points-required" type="xs:long" use="required"/>
  1750. +        <xs:attribute name="points-lose" type="xs:long" use="required"/>
  1751. +    </xs:complexType>
  1752. +
  1753. +    <xs:complexType name="TierBonusInfo">
  1754. +        <xs:attribute name="silverChance" type="xs:float" default="0"/>
  1755. +        <xs:attribute name="goldChance" type="xs:float" default="0"/>
  1756. +        <xs:attribute name="skill" type="xs:int" default="0"/>
  1757. +    </xs:complexType>
  1758. +</xs:schema>
  1759. \ No newline at end of file
  1760. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/VipUp.java
  1761. IDEA additional info:
  1762. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1763. <+>UTF-8
  1764. ===================================================================
  1765. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/VipUp.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/VipUp.java
  1766. new file mode 100644
  1767. --- /dev/null   (date 1619730747173)
  1768. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/VipUp.java    (date 1619730747173)
  1769. @@ -0,0 +1,46 @@
  1770. +package handlers.effecthandlers;
  1771. +
  1772. +import org.l2jmobius.gameserver.model.StatSet;
  1773. +import org.l2jmobius.gameserver.model.actor.Creature;
  1774. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  1775. +import org.l2jmobius.gameserver.model.effects.AbstractEffect;
  1776. +import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
  1777. +import org.l2jmobius.gameserver.model.skills.Skill;
  1778. +
  1779. +/**
  1780. + * @author Gabriel Costa Souza
  1781. + * Discord: Gabriel 'GCS'#2589
  1782. + * Skype - email: gabriel_costa25@hotmail.com
  1783. + */
  1784. +public class VipUp extends AbstractEffect
  1785. +{
  1786. +   private final long _amount;
  1787. +
  1788. +   public VipUp(StatSet params)
  1789. +   {
  1790. +       _amount = params.getLong("amount", 0L);
  1791. +   }
  1792. +
  1793. +    @Override
  1794. +    public boolean isInstant()
  1795. +    {
  1796. +        return true;
  1797. +    }
  1798. +
  1799. +    @Override
  1800. +    public void instant(Creature effector, Creature effected, Skill skill, ItemInstance item)
  1801. +    {
  1802. +        if (effected == null)
  1803. +        {
  1804. +            return;
  1805. +        }
  1806. +
  1807. +        final PlayerInstance player = effected.getActingPlayer();
  1808. +        if (player == null)
  1809. +        {
  1810. +            return;
  1811. +        }
  1812. +
  1813. +        player.updateVipPoints(_amount);
  1814. +    }
  1815. +}
  1816. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/VipData.java
  1817. IDEA additional info:
  1818. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1819. <+>UTF-8
  1820. ===================================================================
  1821. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/VipData.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/VipData.java
  1822. new file mode 100644
  1823. --- /dev/null   (date 1619730748376)
  1824. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/data/xml/VipData.java  (date 1619730748376)
  1825. @@ -0,0 +1,150 @@
  1826. +package org.l2jmobius.gameserver.data.xml;
  1827. +
  1828. +import org.l2jmobius.Config;
  1829. +import org.l2jmobius.commons.util.IXmlReader;
  1830. +import org.l2jmobius.gameserver.model.RecipeInstance;
  1831. +import org.l2jmobius.gameserver.model.RecipeList;
  1832. +import org.l2jmobius.gameserver.model.RecipeStatInstance;
  1833. +import org.l2jmobius.gameserver.model.StatSet;
  1834. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  1835. +import org.l2jmobius.gameserver.model.vip.VipInfo;
  1836. +import org.w3c.dom.Document;
  1837. +import org.w3c.dom.NamedNodeMap;
  1838. +import org.w3c.dom.Node;
  1839. +
  1840. +import java.io.File;
  1841. +import java.util.ArrayList;
  1842. +import java.util.HashMap;
  1843. +import java.util.List;
  1844. +import java.util.Map;
  1845. +import java.util.logging.Logger;
  1846. +
  1847. +import static java.util.Objects.nonNull;
  1848. +
  1849. +/**
  1850. + * @author Gabriel Costa Souza
  1851. + * Discord: Gabriel 'GCS'#2589
  1852. + * Skype - email: gabriel_costa25@hotmail.com
  1853. + */
  1854. +public class VipData implements IXmlReader
  1855. +{
  1856. +   private static final Logger LOGGER = Logger.getLogger(VipData.class.getName());
  1857. +
  1858. +   private final Map<Byte, VipInfo> vipTiers = new HashMap<>();
  1859. +
  1860. +   protected VipData()
  1861. +   {
  1862. +       load();
  1863. +   }
  1864. +  
  1865. +   @Override
  1866. +   public void load()
  1867. +   {
  1868. +        if(!Config.VIP_SYSTEM_ENABLED)
  1869. +            return;
  1870. +        vipTiers.clear();
  1871. +       parseDatapackFile("data/vip.xml");
  1872. +       LOGGER.info(getClass().getSimpleName() + ": Loaded " + vipTiers.size() + " vips.");
  1873. +   }
  1874. +  
  1875. +   @Override
  1876. +   public void parseDocument(Document doc, File f)
  1877. +   {
  1878. +        for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
  1879. +        {
  1880. +            if ("list".equalsIgnoreCase(n.getNodeName()))
  1881. +            {
  1882. +                VIP_FILE: for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
  1883. +                {
  1884. +                    if ("vip".equalsIgnoreCase(d.getNodeName()))
  1885. +                    {
  1886. +                        final NamedNodeMap attrs = d.getAttributes();
  1887. +                        Node att;
  1888. +                        byte tier = -1;
  1889. +                        int required = -1;
  1890. +                        int lose = -1;
  1891. +
  1892. +                        att = attrs.getNamedItem("tier");
  1893. +                        if (att == null)
  1894. +                        {
  1895. +                            LOGGER.severe(getClass().getSimpleName() + ": Missing tier for vip, skipping");
  1896. +                            continue;
  1897. +                        }
  1898. +                        tier = Byte.parseByte(att.getNodeValue());
  1899. +
  1900. +                        att = attrs.getNamedItem("points-required");
  1901. +                        if (att == null)
  1902. +                        {
  1903. +                            LOGGER.severe(getClass().getSimpleName() + ": Missing points-required for vip: " + tier + ", skipping");
  1904. +                            continue;
  1905. +                        }
  1906. +
  1907. +                        required = Integer.parseInt(att.getNodeValue());
  1908. +
  1909. +                        att = attrs.getNamedItem("points-lose");
  1910. +                        if (att == null)
  1911. +                        {
  1912. +                            LOGGER.severe(getClass().getSimpleName() + ": Missing points-lose for vip: " + tier + ", skipping");
  1913. +                            continue;
  1914. +                        }
  1915. +
  1916. +                        lose = Integer.parseInt(att.getNodeValue());
  1917. +
  1918. +                        var vipInfo = new VipInfo(tier, required, lose);
  1919. +
  1920. +
  1921. +                        for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
  1922. +                        {
  1923. +                            if ("bonus".equalsIgnoreCase(c.getNodeName()))
  1924. +                            {
  1925. +                                final int skill = Integer.parseInt(c.getAttributes().getNamedItem("skill").getNodeValue());
  1926. +                                final float silverChance = Float.parseFloat(c.getAttributes().getNamedItem("silverChance").getNodeValue());
  1927. +                                final float goldChance = Float.parseFloat(c.getAttributes().getNamedItem("goldChance").getNodeValue());
  1928. +                                try
  1929. +                                {
  1930. +                                    vipInfo.setSkill(skill);
  1931. +                                    vipInfo.setSilverCoinChance(silverChance);
  1932. +                                    vipInfo.setGoldCoinChance(goldChance);
  1933. +                                }
  1934. +                                catch (Exception e)
  1935. +                                {
  1936. +                                    LOGGER.severe(getClass().getSimpleName() + ": Error in bonus parameter for vip: " + tier + ", skipping");
  1937. +                                    continue VIP_FILE;
  1938. +                                }
  1939. +                            }
  1940. +                        }
  1941. +                        vipTiers.put(tier, vipInfo);
  1942. +
  1943. +                    }
  1944. +                }
  1945. +            }
  1946. +        }
  1947. +   }
  1948. +
  1949. +   /**
  1950. +    * Gets the single instance of VipData.
  1951. +    * @return single instance of VipData
  1952. +    */
  1953. +   public static VipData getInstance()
  1954. +   {
  1955. +       return SingletonHolder.INSTANCE;
  1956. +   }
  1957. +  
  1958. +   /**
  1959. +    * The Class SingletonHolder.
  1960. +    */
  1961. +   private static class SingletonHolder
  1962. +   {
  1963. +       protected static final VipData INSTANCE = new VipData();
  1964. +   }
  1965. +
  1966. +
  1967. +   public int getSkillId(byte tier){
  1968. +       return vipTiers.get(tier).getSkill();
  1969. +    }
  1970. +
  1971. +    public Map<Byte, VipInfo> getVipTiers() {
  1972. +        return vipTiers;
  1973. +    }
  1974. +}
  1975. +
  1976. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/vip.xml
  1977. IDEA additional info:
  1978. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  1979. <+>UTF-8
  1980. ===================================================================
  1981. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/vip.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/vip.xml
  1982. new file mode 100644
  1983. --- /dev/null   (date 1619733598098)
  1984. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/vip.xml   (date 1619733598098)
  1985. @@ -0,0 +1,58 @@
  1986. +<?xml version='1.0' encoding='utf-8'?>
  1987. +<list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xsd/vip.xsd">
  1988. +    <!--
  1989. +        tier: tier of the vip
  1990. +        points-requires: points required to get to that tier
  1991. +        points-lose: points player will lose after a while.
  1992. +
  1993. +        PS. Client data made for Sylph! Probably works on essence aswell! Might need to check for classic!.
  1994. +
  1995. +l2.ini
  1996. +[VipSystem]
  1997. +UseVipInfoWnd=false
  1998. +
  1999. + -> needs to be true
  2000. +
  2001. +# Prime shop needs to be true aswell!
  2002. +
  2003. +ProductName_Classic-eu.dat
  2004. +44-47 -> L2 Point purchases
  2005. +product_name_begin id=2090044  outer_name=[Normal VIP Gain Scroll] description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2006. +product_name_begin id=2090045  outer_name=[Medium VIP Gain Scroll] description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2007. +product_name_begin id=2090046  outer_name=[Good VIP Gain Scroll]   description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2008. +product_name_begin id=2090047  outer_name=[Perfect VIP Gain Scroll]    description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2009. +
  2010. +48-51 -> VIP Coin purchases
  2011. +product_name_begin id=2090048  outer_name=[Normal VIP Gain Scroll] description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2012. +product_name_begin id=2090049  outer_name=[Medium VIP Gain Scroll] description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2013. +product_name_begin id=2090050  outer_name=[Good VIP Gain Scroll]   description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2014. +product_name_begin id=2090051  outer_name=[Perfect VIP Gain Scroll]    description=[]  icon=[BranchIcon.Icon.g_bm_vip_potion_i00]  icon_panel=[None]   mainsubject=[]  product_name_end
  2015. +
  2016. +
  2017. + -->
  2018. +    
  2019. +    <vip tier="0" points-required="0" points-lose="0">
  2020. +        <bonus/>
  2021. +    </vip>
  2022. +    <vip tier="1" points-required="300" points-lose="300">
  2023. +        <bonus skill="55024"/>
  2024. +    </vip>
  2025. +    <vip tier="2" points-required="1000" points-lose="600">
  2026. +        <bonus skill="55025"/>
  2027. +    </vip>
  2028. +    <vip tier="3" points-required="2000" points-lose="660">
  2029. +        <bonus skill="55026" silverChance="1.0" goldChance="1.0"/>
  2030. +    </vip>
  2031. +    <vip tier="4" points-required="3500" points-lose="1320">
  2032. +        <bonus skill="55027" silverChance="2.0" goldChance="2.0"/>
  2033. +    </vip>
  2034. +    <vip tier="5" points-required="7000" points-lose="2640">
  2035. +        <bonus skill="55028" silverChance="3.5" goldChance="3.5"/>
  2036. +    </vip>
  2037. +    <vip tier="6" points-required="20000" points-lose="5280">
  2038. +        <bonus skill="55029" silverChance="5.0" goldChance="5.0"/>
  2039. +    </vip>
  2040. +    <vip tier="7" points-required="40000" points-lose="10560">
  2041. +        <bonus skill="55030" silverChance="7.0" goldChance="7.0"/>
  2042. +    </vip>
  2043. +</list>
  2044. \ No newline at end of file
  2045. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerInventory.java
  2046. IDEA additional info:
  2047. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2048. <+>UTF-8
  2049. ===================================================================
  2050. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerInventory.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerInventory.java
  2051. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerInventory.java   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  2052. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/itemcontainer/PlayerInventory.java   (date 1619730827417)
  2053. @@ -53,6 +53,8 @@
  2054.    
  2055.     private final PlayerInstance _owner;
  2056.     private ItemInstance _adena;
  2057. +   private ItemInstance _goldCoin;
  2058. +   private ItemInstance _silverCoin;
  2059.     private ItemInstance _ancientAdena;
  2060.     private ItemInstance _beautyTickets;
  2061.     private Collection<Integer> _blockItems = null;
  2062. @@ -92,6 +94,16 @@
  2063.     {
  2064.         return _adena != null ? _adena.getCount() : 0;
  2065.     }
  2066. +
  2067. +   public long getGoldCoin()
  2068. +   {
  2069. +       return _goldCoin != null ? _goldCoin.getCount() : 0;
  2070. +   }
  2071. +
  2072. +   public long getSilverCoin()
  2073. +   {
  2074. +       return _silverCoin != null ? _silverCoin.getCount() : 0;
  2075. +   }
  2076.    
  2077.     public ItemInstance getAncientAdenaInstance()
  2078.     {
  2079. @@ -403,6 +415,14 @@
  2080.             {
  2081.                 _adena = addedItem;
  2082.             }
  2083. +           else if ((addedItem.getId() == SILVER_COIN) && !addedItem.equals(_silverCoin))
  2084. +           {
  2085. +                _silverCoin = addedItem;
  2086. +           }
  2087. +           else if ((addedItem.getId() == GOLD_COIN) && !addedItem.equals(_goldCoin))
  2088. +           {
  2089. +                _goldCoin = addedItem;
  2090. +           }
  2091.             else if ((addedItem.getId() == ANCIENT_ADENA_ID) && !addedItem.equals(_ancientAdena))
  2092.             {
  2093.                 _ancientAdena = addedItem;
  2094. @@ -467,6 +487,14 @@
  2095.             {
  2096.                 _adena = item;
  2097.             }
  2098. +            else if ((item.getId() == SILVER_COIN) && !item.equals(_silverCoin))
  2099. +            {
  2100. +                _silverCoin = item;
  2101. +            }
  2102. +            else if ((item.getId() == GOLD_COIN) && !item.equals(_goldCoin))
  2103. +            {
  2104. +                _goldCoin = item;
  2105. +            }
  2106.             else if ((item.getId() == ANCIENT_ADENA_ID) && !item.equals(_ancientAdena))
  2107.             {
  2108.                 _ancientAdena = item;
  2109. @@ -515,11 +543,23 @@
  2110.     {
  2111.         final ItemInstance item = super.transferItem(process, objectId, count, target, actor, reference);
  2112.        
  2113. +       if ((_adena != null) && ((_adena.getCount() <= 0) || (_adena.getOwnerId() != getOwnerId())))
  2114. +       {
  2115. +           _adena = null;
  2116. +       }
  2117. +       if ((_silverCoin != null) && ((_silverCoin.getCount() <= 0) || (_silverCoin.getOwnerId() != getOwnerId())))
  2118. +       {
  2119. +            _silverCoin = null;
  2120. +       }
  2121. +       if ((_goldCoin != null) && ((_goldCoin.getCount() <= 0) || (_goldCoin.getOwnerId() != getOwnerId())))
  2122. +       {
  2123. +            _goldCoin = null;
  2124. +       }
  2125.         if ((_adena != null) && ((_adena.getCount() <= 0) || (_adena.getOwnerId() != getOwnerId())))
  2126.         {
  2127.             _adena = null;
  2128.         }
  2129. -      
  2130. +
  2131.         if ((_ancientAdena != null) && ((_ancientAdena.getCount() <= 0) || (_ancientAdena.getOwnerId() != getOwnerId())))
  2132.         {
  2133.             _ancientAdena = null;
  2134. @@ -573,6 +613,14 @@
  2135.         {
  2136.             _adena = null;
  2137.         }
  2138. +       if ((_silverCoin != null) && (_silverCoin.getCount() <= 0))
  2139. +       {
  2140. +            _silverCoin = null;
  2141. +       }
  2142. +       if ((_goldCoin != null) && (_goldCoin.getCount() <= 0))
  2143. +       {
  2144. +            _goldCoin = null;
  2145. +       }
  2146.        
  2147.         if ((_ancientAdena != null) && (_ancientAdena.getCount() <= 0))
  2148.         {
  2149. @@ -637,6 +685,14 @@
  2150.         {
  2151.             _adena = null;
  2152.         }
  2153. +       if ((_silverCoin != null) && ((_silverCoin.getCount() <= 0) || (_silverCoin.getOwnerId() != getOwnerId())))
  2154. +       {
  2155. +            _silverCoin = null;
  2156. +       }
  2157. +       if ((_goldCoin != null) && ((_goldCoin.getCount() <= 0) || (_goldCoin.getOwnerId() != getOwnerId())))
  2158. +       {
  2159. +            _goldCoin = null;
  2160. +       }
  2161.        
  2162.         if ((_ancientAdena != null) && ((_ancientAdena.getCount() <= 0) || (_ancientAdena.getOwnerId() != getOwnerId())))
  2163.         {
  2164. @@ -670,6 +726,16 @@
  2165.         {
  2166.             _adena = null;
  2167.         }
  2168. +
  2169. +       if ((_silverCoin != null) && ((_silverCoin.getCount() <= 0) || (_silverCoin.getOwnerId() != getOwnerId())))
  2170. +       {
  2171. +            _silverCoin = null;
  2172. +       }
  2173. +
  2174. +       if ((_goldCoin != null) && ((_goldCoin.getCount() <= 0) || (_goldCoin.getOwnerId() != getOwnerId())))
  2175. +       {
  2176. +            _goldCoin = null;
  2177. +       }
  2178.        
  2179.         if ((_ancientAdena != null) && ((_ancientAdena.getCount() <= 0) || (_ancientAdena.getOwnerId() != getOwnerId())))
  2180.         {
  2181. @@ -720,6 +786,14 @@
  2182.         {
  2183.             _adena = null;
  2184.         }
  2185. +       else if (item.getId() == SILVER_COIN)
  2186. +       {
  2187. +           _silverCoin = null;
  2188. +       }
  2189. +       else if (item.getId() == GOLD_COIN)
  2190. +       {
  2191. +           _goldCoin = null;
  2192. +       }
  2193.         else if (item.getId() == ANCIENT_ADENA_ID)
  2194.         {
  2195.             _ancientAdena = null;
  2196. @@ -771,6 +845,8 @@
  2197.     {
  2198.         super.restore();
  2199.         _adena = getItemByItemId(ADENA_ID);
  2200. +       _silverCoin = getItemByItemId(SILVER_COIN);
  2201. +       _goldCoin = getItemByItemId(GOLD_COIN);
  2202.         _ancientAdena = getItemByItemId(ANCIENT_ADENA_ID);
  2203.         _beautyTickets = getItemByItemId(BEAUTY_TICKET_ID);
  2204.     }
  2205. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBrPremiumState.java
  2206. IDEA additional info:
  2207. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2208. <+>UTF-8
  2209. ===================================================================
  2210. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBrPremiumState.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBrPremiumState.java
  2211. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBrPremiumState.java    (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  2212. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBrPremiumState.java    (date 1619730827506)
  2213. @@ -38,7 +38,7 @@
  2214.         OutgoingPackets.EX_BR_PREMIUM_STATE.writeId(packet);
  2215.        
  2216.         packet.writeD(_player.getObjectId());
  2217. -       packet.writeC(_player.hasPremiumStatus() ? 0x01 : 0x00);
  2218. +       packet.writeC(_player.hasPremiumStatus() || _player.getVipTier() > 0 ? 0x01 : 0x00 );
  2219.         return true;
  2220.     }
  2221.  }
  2222. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/impl/creature/player/OnPlayerLoad.java
  2223. IDEA additional info:
  2224. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2225. <+>UTF-8
  2226. ===================================================================
  2227. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/impl/creature/player/OnPlayerLoad.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/impl/creature/player/OnPlayerLoad.java
  2228. new file mode 100644
  2229. --- /dev/null   (date 1619730818240)
  2230. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/events/impl/creature/player/OnPlayerLoad.java    (date 1619730818240)
  2231. @@ -0,0 +1,30 @@
  2232. +package org.l2jmobius.gameserver.model.events.impl.creature.player;
  2233. +
  2234. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  2235. +import org.l2jmobius.gameserver.model.events.EventType;
  2236. +import org.l2jmobius.gameserver.model.events.impl.IBaseEvent;
  2237. +
  2238. +/**
  2239. + * @author Gabriel Costa Souza
  2240. + * Discord: Gabriel 'GCS'#2589
  2241. + * Skype - email: gabriel_costa25@hotmail.com
  2242. + */
  2243. +public class OnPlayerLoad implements IBaseEvent {
  2244. +    private final PlayerInstance _player;
  2245. +
  2246. +    public OnPlayerLoad(PlayerInstance player)
  2247. +    {
  2248. +        _player = player;
  2249. +    }
  2250. +
  2251. +    public PlayerInstance getPlayer()
  2252. +    {
  2253. +        return _player;
  2254. +    }
  2255. +
  2256. +    @Override
  2257. +    public EventType getType()
  2258. +    {
  2259. +        return EventType.ON_PLAYER_LOAD;
  2260. +    }
  2261. +}
  2262. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java
  2263. IDEA additional info:
  2264. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2265. <+>UTF-8
  2266. ===================================================================
  2267. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java
  2268. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  2269. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java (date 1619730747186)
  2270. @@ -63,6 +63,7 @@
  2271.         EffectHandler.getInstance().registerHandler("BlockSkill", BlockSkill::new);
  2272.         EffectHandler.getInstance().registerHandler("BlockTarget", BlockTarget::new);
  2273.         EffectHandler.getInstance().registerHandler("Bluff", Bluff::new);
  2274. +       EffectHandler.getInstance().registerHandler("VipUp", VipUp::new);
  2275.         EffectHandler.getInstance().registerHandler("BonusDropAdena", BonusDropAdena::new);
  2276.         EffectHandler.getInstance().registerHandler("BonusDropAmount", BonusDropAmount::new);
  2277.         EffectHandler.getInstance().registerHandler("BonusDropRate", BonusDropRate::new);
  2278. Index: L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55300-55399.xml
  2279. IDEA additional info:
  2280. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2281. <+>UTF-8
  2282. ===================================================================
  2283. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55300-55399.xml b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55300-55399.xml
  2284. --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55300-55399.xml  (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  2285. +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/55300-55399.xml  (date 1619732759227)
  2286. @@ -741,21 +741,41 @@
  2287.         <icon>BranchIcon.Icon.g_bm_vip_potion_i00</icon>
  2288.         <operateType>A1</operateType>
  2289.         <reuseDelay>1000</reuseDelay>
  2290. +        <effects>
  2291. +            <effect name="VipUp">
  2292. +                <amount>1</amount>
  2293. +            </effect>
  2294. +        </effects>
  2295.     </skill>
  2296.     <skill id="55323" toLevel="1" name="Medium VIP Gain Scroll">
  2297.         <icon>BranchIcon.Icon.g_bm_vip_potion_i00</icon>
  2298.         <operateType>A1</operateType>
  2299.         <reuseDelay>1000</reuseDelay>
  2300. +        <effects>
  2301. +            <effect name="VipUp">
  2302. +                <amount>10</amount>
  2303. +            </effect>
  2304. +        </effects>
  2305.     </skill>
  2306.     <skill id="55324" toLevel="1" name="Good VIP Gain Scroll">
  2307.         <icon>BranchIcon.Icon.g_bm_vip_potion_i00</icon>
  2308.         <operateType>A1</operateType>
  2309.         <reuseDelay>1000</reuseDelay>
  2310. +        <effects>
  2311. +            <effect name="VipUp">
  2312. +                <amount>100</amount>
  2313. +            </effect>
  2314. +        </effects>
  2315.     </skill>
  2316.     <skill id="55325" toLevel="1" name="Perfect VIP Gain Scroll">
  2317.         <icon>BranchIcon.Icon.g_bm_vip_potion_i00</icon>
  2318.         <operateType>A1</operateType>
  2319.         <reuseDelay>1000</reuseDelay>
  2320. +        <effects>
  2321. +            <effect name="VipUp">
  2322. +                <amount>280</amount>
  2323. +            </effect>
  2324. +        </effects>
  2325.     </skill>
  2326.     <skill id="55326" toLevel="1" name="Gold Fishing Shot">
  2327.         <operateType>A1</operateType>
  2328. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipProductList.java
  2329. IDEA additional info:
  2330. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2331. <+>UTF-8
  2332. ===================================================================
  2333. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipProductList.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipProductList.java
  2334. new file mode 100644
  2335. --- /dev/null   (date 1619730827493)
  2336. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipProductList.java   (date 1619730827493)
  2337. @@ -0,0 +1,69 @@
  2338. +package org.l2jmobius.gameserver.network.serverpackets.vip;
  2339. +
  2340. +import org.l2jmobius.Config;
  2341. +import org.l2jmobius.commons.network.PacketWriter;
  2342. +import org.l2jmobius.gameserver.data.xml.PrimeShopData;
  2343. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  2344. +import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
  2345. +import org.l2jmobius.gameserver.model.primeshop.PrimeShopItem;
  2346. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2347. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2348. +
  2349. +
  2350. +import static java.util.Objects.nonNull;
  2351. +
  2352. +
  2353. +public class ReceiveVipProductList implements IClientOutgoingPacket
  2354. +{
  2355. +    private final PlayerInstance _player;
  2356. +
  2357. +    public ReceiveVipProductList(PlayerInstance player)
  2358. +    {
  2359. +        _player = player;
  2360. +    }
  2361. +    @Override
  2362. +    public boolean write(PacketWriter packet)
  2363. +    {
  2364. +        if(!Config.VIP_SYSTEM_ENABLED)
  2365. +            return false;
  2366. +        var products = PrimeShopData.getInstance().getPrimeItems().values();
  2367. +        var gift = PrimeShopData.getInstance().getVipGiftOfTier(_player.getVipTier());
  2368. +
  2369. +        OutgoingPackets.RECIVE_VIP_PRODUCT_LIST.writeId(packet);
  2370. +        packet.writeQ(_player.getAdena());
  2371. +        packet.writeQ(_player.getGoldCoin()); // Gold Coin Amount
  2372. +        packet.writeQ(_player.getSilverCoin()); // Silver Coin Amount
  2373. +        packet.writeC(1); // Show Reward tab
  2374. +
  2375. +        if(nonNull(gift)) {
  2376. +            packet.writeD(products.size() + 1);
  2377. +            writeProduct(gift, packet);
  2378. +        } else {
  2379. +            packet.writeD(products.size());
  2380. +        }
  2381. +
  2382. +        for (var product : products) {
  2383. +            writeProduct(product, packet);
  2384. +        }
  2385. +        return true;
  2386. +    }
  2387. +
  2388. +    private void writeProduct(PrimeShopGroup product, PacketWriter buffer) {
  2389. +        buffer.writeD(product.getBrId());
  2390. +        buffer.writeC(product.getCat());
  2391. +        buffer.writeC(product.getPaymentType());
  2392. +        buffer.writeD(product.getPrice()); // L2 Coin | Gold Coin seems to use the same field based on payment type
  2393. +        buffer.writeD(product.getSilverCoin());
  2394. +        buffer.writeC(product.getPanelType()); // NEW - 6; HOT - 5 ... Unk
  2395. +        buffer.writeC(product.getVipTier());
  2396. +        buffer.writeC(10);
  2397. +
  2398. +        buffer.writeC(product.getItems().size());
  2399. +
  2400. +        for (PrimeShopItem item : product.getItems()) {
  2401. +            buffer.writeD(item.getId());
  2402. +            buffer.writeD((int) item.getCount());
  2403. +        }
  2404. +    }
  2405. +}
  2406. +
  2407. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipLuckyGameInfo.java
  2408. IDEA additional info:
  2409. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2410. <+>UTF-8
  2411. ===================================================================
  2412. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipLuckyGameInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipLuckyGameInfo.java
  2413. new file mode 100644
  2414. --- /dev/null   (date 1619730827489)
  2415. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipLuckyGameInfo.java (date 1619730827489)
  2416. @@ -0,0 +1,54 @@
  2417. +/*
  2418. + * This file is part of the L2J Mobius project.
  2419. + *
  2420. + * This program is free software: you can redistribute it and/or modify
  2421. + * it under the terms of the GNU General Public License as published by
  2422. + * the Free Software Foundation, either version 3 of the License, or
  2423. + * (at your option) any later version.
  2424. + *
  2425. + * This program is distributed in the hope that it will be useful,
  2426. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2427. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2428. + * General Public License for more details.
  2429. + *
  2430. + * You should have received a copy of the GNU General Public License
  2431. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2432. + */
  2433. +package org.l2jmobius.gameserver.network.serverpackets.vip;
  2434. +
  2435. +import org.l2jmobius.commons.network.PacketWriter;
  2436. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  2437. +import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
  2438. +import org.l2jmobius.gameserver.model.variables.AccountVariables;
  2439. +import org.l2jmobius.gameserver.model.vip.VipManager;
  2440. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2441. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2442. +
  2443. +import java.time.Instant;
  2444. +import java.time.temporal.ChronoUnit;
  2445. +
  2446. +/**
  2447. + * @author Gabriel Costa Souza
  2448. + * Discord: Gabriel 'GCS'#2589
  2449. + * Skype - email: gabriel_costa25@hotmail.com
  2450. + */
  2451. +public class ReceiveVipLuckyGameInfo implements IClientOutgoingPacket
  2452. +{
  2453. +    private final PlayerInstance _player;
  2454. +    private final int LCOIN = 91663;
  2455. +
  2456. +    public ReceiveVipLuckyGameInfo(PlayerInstance player)
  2457. +    {
  2458. +        _player = player;
  2459. +    }
  2460. +   @Override
  2461. +   public boolean write(PacketWriter packet)
  2462. +   {
  2463. +        OutgoingPackets.RECIVE_VIP_LUCKY_GAME_INFO.writeId(packet);
  2464. +        packet.writeC(1); // enabled
  2465. +        packet.writeH((int) _player.getAdena());
  2466. +        ItemInstance item = _player.getInventory().getItemByItemId(LCOIN);
  2467. +        packet.writeH(item == null? 0 : (int) item.getCount()); //L Coin count
  2468. +       return true;
  2469. +   }
  2470. +}
  2471. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBRNewIconCashBtnWnd.java
  2472. IDEA additional info:
  2473. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2474. <+>UTF-8
  2475. ===================================================================
  2476. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBRNewIconCashBtnWnd.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBRNewIconCashBtnWnd.java
  2477. new file mode 100644
  2478. --- /dev/null   (date 1619730827496)
  2479. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/ExBRNewIconCashBtnWnd.java   (date 1619730827496)
  2480. @@ -0,0 +1,27 @@
  2481. +package org.l2jmobius.gameserver.network.serverpackets;
  2482. +
  2483. +import org.l2jmobius.commons.network.PacketWriter;
  2484. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2485. +
  2486. +/**
  2487. + * @author Gabriel Costa Souza
  2488. + * Discord: Gabriel 'GCS'#2589
  2489. + * Skype - email: gabriel_costa25@hotmail.com
  2490. + */
  2491. +public class ExBRNewIconCashBtnWnd implements IClientOutgoingPacket
  2492. +{
  2493. +    private final short active;
  2494. +
  2495. +    public ExBRNewIconCashBtnWnd(short active)
  2496. +    {
  2497. +        this.active = active;
  2498. +    }
  2499. +
  2500. +    @Override
  2501. +    public boolean write(PacketWriter packet)
  2502. +    {
  2503. +        OutgoingPackets.EX_BR_NEW_ICON_CASH_BTN_WND.writeId(packet);
  2504. +        packet.writeH(active);
  2505. +        return true;
  2506. +    }
  2507. +}
  2508. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java
  2509. IDEA additional info:
  2510. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2511. <+>UTF-8
  2512. ===================================================================
  2513. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java
  2514. --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java   (revision 5dccd31cc69ab347a4a7e7c2ddd23325d9458024)
  2515. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java   (date 1619730889581)
  2516. @@ -132,6 +132,7 @@
  2517.     private static final String CUSTOM_OFFLINE_TRADE_CONFIG_FILE = "./config/Custom/OfflineTrade.ini";
  2518.     private static final String CUSTOM_PASSWORD_CHANGE_CONFIG_FILE = "./config/Custom/PasswordChange.ini";
  2519.     private static final String CUSTOM_PC_CAFE_CONFIG_FILE = "./config/Custom/PcCafe.ini";
  2520. +   private static final String CUSTOM_VIP_CONFIG_FILE = "./config/Custom/VipSystem.ini";
  2521.     private static final String CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE = "./config/Custom/PremiumSystem.ini";
  2522.     private static final String CUSTOM_PRIVATE_STORE_RANGE_CONFIG_FILE = "./config/Custom/PrivateStoreRange.ini";
  2523.     private static final String CUSTOM_PVP_ANNOUNCE_CONFIG_FILE = "./config/Custom/PvpAnnounce.ini";
  2524. @@ -154,6 +155,7 @@
  2525.    
  2526.     public static boolean ENABLE_ATTENDANCE_REWARDS;
  2527.     public static boolean PREMIUM_ONLY_ATTENDANCE_REWARDS;
  2528. +   public static boolean VIP_ONLY_ATTENDANCE_REWARDS;
  2529.     public static boolean ATTENDANCE_REWARDS_SHARE_ACCOUNT;
  2530.     public static int ATTENDANCE_REWARD_DELAY;
  2531.     public static boolean ATTENDANCE_POPUP_START;
  2532. @@ -1235,6 +1237,7 @@
  2533.     public static boolean PREMIUM_ONLY_FISHING;
  2534.     public static boolean PC_CAFE_ENABLED;
  2535.     public static boolean PC_CAFE_ONLY_PREMIUM;
  2536. +   public static boolean PC_CAFE_ONLY_VIP;
  2537.     public static int PC_CAFE_MAX_POINTS;
  2538.     public static boolean PC_CAFE_ENABLE_DOUBLE_POINTS;
  2539.     public static int PC_CAFE_DOUBLE_POINTS_CHANCE;
  2540. @@ -1242,7 +1245,14 @@
  2541.     public static boolean PC_CAFE_RANDOM_POINT;
  2542.     public static boolean PC_CAFE_REWARD_LOW_EXP_KILLS;
  2543.     public static int PC_CAFE_LOW_EXP_KILLS_CHANCE;
  2544. -   public static boolean SELLBUFF_ENABLED;
  2545. +   public static boolean VIP_SYSTEM_ENABLED;
  2546. +   public static boolean VIP_SYSTEM_PRIME_AFFECT;
  2547. +    public static int VIP_SYSTEM_MAX_TIER;
  2548. +    public static int VIP_SYSTEM_GOLD_DROP_MIN;
  2549. +    public static int VIP_SYSTEM_GOLD_DROP_MAX;
  2550. +    public static int VIP_SYSTEM_SILVER_DROP_MIN;
  2551. +    public static int VIP_SYSTEM_SILVER_DROP_MAX;
  2552. +    public static boolean SELLBUFF_ENABLED;
  2553.     public static int SELLBUFF_MP_MULTIPLER;
  2554.     public static int SELLBUFF_PAYMENT_ID;
  2555.     public static long SELLBUFF_MIN_PRICE;
  2556. @@ -1529,6 +1539,7 @@
  2557.             final PropertiesParser Attandance = new PropertiesParser(ATTENDANCE_CONFIG_FILE);
  2558.             ENABLE_ATTENDANCE_REWARDS = Attandance.getBoolean("EnableAttendanceRewards", false);
  2559.             PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
  2560. +           VIP_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("VIPOnlyAttendanceRewards", false);
  2561.             ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
  2562.             ATTENDANCE_REWARD_DELAY = Attandance.getInt("AttendanceRewardDelay", 30);
  2563.             ATTENDANCE_POPUP_START = Attandance.getBoolean("AttendancePopupStart", true);
  2564. @@ -3202,6 +3213,7 @@
  2565.             final PropertiesParser PcCafe = new PropertiesParser(CUSTOM_PC_CAFE_CONFIG_FILE);
  2566.             PC_CAFE_ENABLED = PcCafe.getBoolean("PcCafeEnabled", false);
  2567.             PC_CAFE_ONLY_PREMIUM = PcCafe.getBoolean("PcCafeOnlyPremium", false);
  2568. +           PC_CAFE_ONLY_VIP = PcCafe.getBoolean("PcCafeOnlyVip", false);
  2569.             PC_CAFE_MAX_POINTS = PcCafe.getInt("MaxPcCafePoints", 200000);
  2570.             if (PC_CAFE_MAX_POINTS < 0)
  2571.             {
  2572. @@ -3229,7 +3241,22 @@
  2573.             {
  2574.                 PC_CAFE_LOW_EXP_KILLS_CHANCE = 100;
  2575.             }
  2576. -          
  2577. +
  2578. +
  2579. +           final PropertiesParser vipSystem = new PropertiesParser(CUSTOM_VIP_CONFIG_FILE);
  2580. +           VIP_SYSTEM_ENABLED = vipSystem.getBoolean("VIPEnabled", false);
  2581. +           if(VIP_SYSTEM_ENABLED) {
  2582. +                VIP_SYSTEM_PRIME_AFFECT = vipSystem.getBoolean("PrimeAffectPoints", false);
  2583. +                VIP_SYSTEM_MAX_TIER = vipSystem.getInt("MaxVipLevel", 7);
  2584. +                VIP_SYSTEM_SILVER_DROP_MIN = vipSystem.getInt("VipSilverDropMin", 1);
  2585. +                VIP_SYSTEM_SILVER_DROP_MAX = vipSystem.getInt("VipSilverDropMax", 5);
  2586. +                VIP_SYSTEM_GOLD_DROP_MIN = vipSystem.getInt("VipGoldenDropMin", 1);
  2587. +                VIP_SYSTEM_GOLD_DROP_MAX = vipSystem.getInt("VipGoldenDropMax", 5);
  2588. +                if (VIP_SYSTEM_MAX_TIER > 7)
  2589. +                    VIP_SYSTEM_MAX_TIER = 7;
  2590. +            }
  2591. +
  2592. +
  2593.             // Load PremiumSystem config file (if exists)
  2594.             final PropertiesParser PremiumSystem = new PropertiesParser(CUSTOM_PREMIUM_SYSTEM_CONFIG_FILE);
  2595.             PREMIUM_SYSTEM_ENABLED = PremiumSystem.getBoolean("EnablePremiumSystem", false);
  2596. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipManager.java
  2597. IDEA additional info:
  2598. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2599. <+>UTF-8
  2600. ===================================================================
  2601. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipManager.java
  2602. new file mode 100644
  2603. --- /dev/null   (date 1619730827452)
  2604. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipManager.java  (date 1619730827452)
  2605. @@ -0,0 +1,166 @@
  2606. +package org.l2jmobius.gameserver.model.vip;
  2607. +
  2608. +import org.l2jmobius.Config;
  2609. +import org.l2jmobius.gameserver.data.xml.PrimeShopData;
  2610. +import org.l2jmobius.gameserver.data.xml.SkillData;
  2611. +import org.l2jmobius.gameserver.data.xml.VipData;
  2612. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  2613. +import org.l2jmobius.gameserver.model.events.Containers;
  2614. +import org.l2jmobius.gameserver.model.events.EventType;
  2615. +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLoad;
  2616. +import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
  2617. +import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener;
  2618. +import org.l2jmobius.gameserver.model.primeshop.PrimeShopGroup;
  2619. +import org.l2jmobius.gameserver.model.variables.AccountVariables;
  2620. +import org.l2jmobius.gameserver.network.clientpackets.primeshop.RequestBRBuyProduct;
  2621. +import org.l2jmobius.gameserver.network.serverpackets.ExBRNewIconCashBtnWnd;
  2622. +import org.l2jmobius.gameserver.network.serverpackets.vip.ReceiveVipInfo;
  2623. +
  2624. +import java.time.Instant;
  2625. +import java.time.temporal.ChronoUnit;
  2626. +import java.util.function.Consumer;
  2627. +
  2628. +import static java.util.Objects.nonNull;
  2629. +
  2630. +/**
  2631. + * @author Gabriel Costa Souza
  2632. + * Discord: Gabriel 'GCS'#2589
  2633. + * Skype - email: gabriel_costa25@hotmail.com
  2634. + */
  2635. +public final class VipManager {
  2636. +
  2637. +    private static final byte VIP_MAX_TIER = (byte) Config.VIP_SYSTEM_MAX_TIER;
  2638. +
  2639. +    private final ConsumerEventListener vipLoginListener = new ConsumerEventListener(null, EventType.ON_PLAYER_LOGIN, (Consumer<OnPlayerLogin>) this::onVipLogin, this);
  2640. +
  2641. +    private VipManager() {
  2642. +        if(!Config.VIP_SYSTEM_ENABLED)
  2643. +            return;
  2644. +        Containers.Global().addListener(new ConsumerEventListener(Containers.Global(), EventType.ON_PLAYER_LOAD, (Consumer<OnPlayerLoad>) this::onPlayerLoaded, this));
  2645. +    }
  2646. +
  2647. +    private void onPlayerLoaded(OnPlayerLoad event) {
  2648. +        final var player = event.getPlayer();
  2649. +        player.setVipTier(getVipTier(player));
  2650. +        if(player.getVipTier() > 0) {
  2651. +            manageTier(player);
  2652. +            player.addListener(vipLoginListener);
  2653. +        } else {
  2654. +            player.sendPacket(new ReceiveVipInfo(player));
  2655. +            player.sendPacket(new ExBRNewIconCashBtnWnd((byte)0));
  2656. +        }
  2657. +    }
  2658. +
  2659. +    private boolean canReceiveGift(PlayerInstance player){
  2660. +        if(!Config.VIP_SYSTEM_ENABLED)
  2661. +            return false;
  2662. +        if(player.getVipTier() <= 0)
  2663. +            return false;
  2664. +        else{
  2665. +            long timeBought = player.getAccountVariables().getLong(AccountVariables.VIP_ITEM_BOUGHT, 0L);
  2666. +            return timeBought <= 0;
  2667. +        }
  2668. +    }
  2669. +
  2670. +    private void onVipLogin(OnPlayerLogin event) {
  2671. +        final var player = event.getPlayer();
  2672. +        if(canReceiveGift(player)) {
  2673. +            player.sendPacket(new ExBRNewIconCashBtnWnd((byte) 1));
  2674. +        }else {
  2675. +             player.sendPacket(new ExBRNewIconCashBtnWnd((byte) 0));
  2676. +        }
  2677. +        player.removeListener(vipLoginListener);
  2678. +        player.sendPacket(new ReceiveVipInfo(player));
  2679. +    }
  2680. +
  2681. +    public void manageTier(PlayerInstance player) {
  2682. +        if(!checkVipTierExpiration(player)) {
  2683. +            player.sendPacket(new ReceiveVipInfo(player));
  2684. +        }
  2685. +
  2686. +        if(player.getVipTier() > 1) {
  2687. +            var oldSkillId = VipData.getInstance().getSkillId((byte) (player.getVipTier() - 1));
  2688. +            if(oldSkillId > 0) {
  2689. +                var oldSkill = SkillData.getInstance().getSkill(oldSkillId, 1);
  2690. +                if(nonNull(oldSkill)) {
  2691. +                    player.removeSkill(oldSkill);
  2692. +                }
  2693. +            }
  2694. +        }
  2695. +
  2696. +        var skillId = VipData.getInstance().getSkillId(player.getVipTier());
  2697. +        if(skillId > 0) {
  2698. +            var skill = SkillData.getInstance().getSkill(skillId, 1);
  2699. +            if(nonNull(skill)) {
  2700. +                player.addSkill(skill);
  2701. +            }
  2702. +        }
  2703. +    }
  2704. +
  2705. +
  2706. +    public byte getVipTier(PlayerInstance player) {
  2707. +        return getVipInfo(player).getTier();
  2708. +    }
  2709. +
  2710. +    public byte getVipTier(long points) {
  2711. +        byte temp = getVipInfo(points).getTier();
  2712. +        if(temp > VIP_MAX_TIER)
  2713. +            temp = VIP_MAX_TIER;
  2714. +        return temp;
  2715. +    }
  2716. +
  2717. +    private VipInfo getVipInfo(PlayerInstance player) {
  2718. +        var points =  player.getVipPoints();
  2719. +        return getVipInfo(points);
  2720. +    }
  2721. +
  2722. +    public float getSilverCoinDropChance(PlayerInstance player) {
  2723. +        return getVipInfo(player).getSilverCoinChance();
  2724. +    }
  2725. +
  2726. +    public float getRustyCoinDropChance(PlayerInstance player) {
  2727. +        return getVipInfo(player).getGoldCoinChance();
  2728. +    }
  2729. +
  2730. +
  2731. +    private VipInfo getVipInfo(long points) {
  2732. +        for (byte i = 0; i < VipData.getInstance().getVipTiers().size(); i++) {
  2733. +            if(points < VipData.getInstance().getVipTiers().get(i).getPointsRequired()) {
  2734. +                byte temp = (byte) (i - 1);
  2735. +                if(temp > VIP_MAX_TIER)
  2736. +                    temp = VIP_MAX_TIER;
  2737. +                return VipData.getInstance().getVipTiers().get(temp);
  2738. +            }
  2739. +        }
  2740. +        return VipData.getInstance().getVipTiers().get(VIP_MAX_TIER);
  2741. +    }
  2742. +
  2743. +    public long getPointsDepreciatedOnLevel(byte vipTier) {
  2744. +        return VipData.getInstance().getVipTiers().get(vipTier).getPointsDepreciated();
  2745. +    }
  2746. +
  2747. +    public long getPointsToLevel(byte level) {
  2748. +        if(VipData.getInstance().getVipTiers().containsKey(level)) {
  2749. +            return VipData.getInstance().getVipTiers().get(level).getPointsRequired();
  2750. +        }
  2751. +        return 0;
  2752. +    }
  2753. +
  2754. +    public boolean checkVipTierExpiration(PlayerInstance player) {
  2755. +        var now = Instant.now();
  2756. +        if(now.isAfter(Instant.ofEpochMilli(player.getVipTierExpiration()))) {
  2757. +            player.updateVipPoints(-getPointsDepreciatedOnLevel(player.getVipTier()));
  2758. +            player.setVipTierExpiration(Instant.now().plus(30, ChronoUnit.DAYS).toEpochMilli());
  2759. +            return true;
  2760. +        }
  2761. +        return false;
  2762. +    }
  2763. +
  2764. +    public static VipManager getInstance() {
  2765. +        return Singleton.INSTANCE;
  2766. +    }
  2767. +
  2768. +    private static class Singleton {
  2769. +        private static final VipManager INSTANCE = new VipManager();
  2770. +    }
  2771. +}
  2772. \ No newline at end of file
  2773. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipInfo.java
  2774. IDEA additional info:
  2775. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2776. <+>UTF-8
  2777. ===================================================================
  2778. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipInfo.java
  2779. new file mode 100644
  2780. --- /dev/null   (date 1619730827449)
  2781. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/vip/VipInfo.java (date 1619730827449)
  2782. @@ -0,0 +1,58 @@
  2783. +package org.l2jmobius.gameserver.model.vip;
  2784. +
  2785. +/**
  2786. + * @author Gabriel Costa Souza
  2787. + * Discord: Gabriel 'GCS'#2589
  2788. + * Skype - email: gabriel_costa25@hotmail.com
  2789. + */
  2790. +public class VipInfo {
  2791. +
  2792. +    private final byte tier;
  2793. +    private final long pointsRequired;
  2794. +    private final long pointsDepreciated;
  2795. +    private float silverCoinChance;
  2796. +    private float goldCoinChance;
  2797. +    private int skill;
  2798. +
  2799. +    public VipInfo(byte tier, long pointsRequired, long pointsDepreciated) {
  2800. +        this.tier = tier;
  2801. +        this.pointsRequired = pointsRequired;
  2802. +        this.pointsDepreciated = pointsDepreciated;
  2803. +    }
  2804. +
  2805. +    public byte getTier() {
  2806. +        return tier;
  2807. +    }
  2808. +
  2809. +    public long getPointsRequired() {
  2810. +        return pointsRequired;
  2811. +    }
  2812. +
  2813. +    public long getPointsDepreciated() {
  2814. +        return pointsDepreciated;
  2815. +    }
  2816. +
  2817. +    public int getSkill() {
  2818. +        return skill;
  2819. +    }
  2820. +
  2821. +    public void setSkill(int skill) {
  2822. +        this.skill = skill;
  2823. +    }
  2824. +
  2825. +    public void setSilverCoinChance(float silverCoinChance) {
  2826. +        this.silverCoinChance = silverCoinChance;
  2827. +    }
  2828. +
  2829. +    public float getSilverCoinChance() {
  2830. +        return silverCoinChance;
  2831. +    }
  2832. +
  2833. +    public void setGoldCoinChance(float goldCoinChance) {
  2834. +        this.goldCoinChance = goldCoinChance;
  2835. +    }
  2836. +
  2837. +    public float getGoldCoinChance() {
  2838. +        return goldCoinChance;
  2839. +    }
  2840. +}
  2841. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/ExRequestVipInfo.java
  2842. IDEA additional info:
  2843. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2844. <+>UTF-8
  2845. ===================================================================
  2846. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/ExRequestVipInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/ExRequestVipInfo.java
  2847. new file mode 100644
  2848. --- /dev/null   (date 1619730827474)
  2849. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/ExRequestVipInfo.java    (date 1619730827474)
  2850. @@ -0,0 +1,22 @@
  2851. +package org.l2jmobius.gameserver.network.clientpackets.vip;
  2852. +
  2853. +import org.l2jmobius.commons.network.PacketReader;
  2854. +import org.l2jmobius.gameserver.network.GameClient;
  2855. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  2856. +import org.l2jmobius.gameserver.network.serverpackets.vip.ReceiveVipInfo;
  2857. +
  2858. +public class ExRequestVipInfo implements IClientIncomingPacket {
  2859. +    @Override
  2860. +    public boolean read(GameClient client, PacketReader packet)
  2861. +    {
  2862. +        // Nothing to read
  2863. +        return true;
  2864. +    }
  2865. +
  2866. +    @Override
  2867. +    public void run(GameClient client)
  2868. +    {
  2869. +        client.sendPacket(new ReceiveVipInfo(client.getPlayer()));
  2870. +
  2871. +    }
  2872. +}
  2873. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipProductList.java
  2874. IDEA additional info:
  2875. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2876. <+>UTF-8
  2877. ===================================================================
  2878. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipProductList.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipProductList.java
  2879. new file mode 100644
  2880. --- /dev/null   (date 1619730827481)
  2881. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipProductList.java   (date 1619730827481)
  2882. @@ -0,0 +1,21 @@
  2883. +package org.l2jmobius.gameserver.network.clientpackets.vip;
  2884. +
  2885. +import org.l2jmobius.commons.network.PacketReader;
  2886. +import org.l2jmobius.gameserver.network.GameClient;
  2887. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  2888. +import org.l2jmobius.gameserver.network.serverpackets.vip.ReceiveVipProductList;
  2889. +
  2890. +public class RequestVipProductList implements IClientIncomingPacket {
  2891. +    @Override
  2892. +    public boolean read(GameClient client, PacketReader packet)
  2893. +    {
  2894. +        // Nothing to read
  2895. +        return true;
  2896. +    }
  2897. +
  2898. +    @Override
  2899. +    public void run(GameClient client)
  2900. +    {
  2901. +        client.sendPacket(new ReceiveVipProductList(client.getPlayer()));
  2902. +    }
  2903. +}
  2904. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipLuckGameInfo.java
  2905. IDEA additional info:
  2906. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2907. <+>UTF-8
  2908. ===================================================================
  2909. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipLuckGameInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipLuckGameInfo.java
  2910. new file mode 100644
  2911. --- /dev/null   (date 1619730827477)
  2912. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/vip/RequestVipLuckGameInfo.java  (date 1619730827477)
  2913. @@ -0,0 +1,22 @@
  2914. +package org.l2jmobius.gameserver.network.clientpackets.vip;
  2915. +
  2916. +
  2917. +import org.l2jmobius.commons.network.PacketReader;
  2918. +import org.l2jmobius.gameserver.network.GameClient;
  2919. +import org.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket;
  2920. +import org.l2jmobius.gameserver.network.serverpackets.vip.ReceiveVipLuckyGameInfo;
  2921. +
  2922. +public class RequestVipLuckGameInfo implements IClientIncomingPacket {
  2923. +    @Override
  2924. +    public boolean read(GameClient client, PacketReader packet)
  2925. +    {
  2926. +        // Nothing to read
  2927. +        return true;
  2928. +    }
  2929. +
  2930. +    @Override
  2931. +    public void run(GameClient client)
  2932. +    {
  2933. +        client.sendPacket(new ReceiveVipLuckyGameInfo(client.getPlayer()));
  2934. +    }
  2935. +}
  2936. Index: L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipInfo.java
  2937. IDEA additional info:
  2938. Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
  2939. <+>UTF-8
  2940. ===================================================================
  2941. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipInfo.java
  2942. new file mode 100644
  2943. --- /dev/null   (date 1619730827484)
  2944. +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/vip/ReceiveVipInfo.java  (date 1619730827484)
  2945. @@ -0,0 +1,56 @@
  2946. +/*
  2947. + * This file is part of the L2J Mobius project.
  2948. + *
  2949. + * This program is free software: you can redistribute it and/or modify
  2950. + * it under the terms of the GNU General Public License as published by
  2951. + * the Free Software Foundation, either version 3 of the License, or
  2952. + * (at your option) any later version.
  2953. + *
  2954. + * This program is distributed in the hope that it will be useful,
  2955. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2956. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2957. + * General Public License for more details.
  2958. + *
  2959. + * You should have received a copy of the GNU General Public License
  2960. + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  2961. + */
  2962. +package org.l2jmobius.gameserver.network.serverpackets.vip;
  2963. +
  2964. +import org.l2jmobius.Config;
  2965. +import org.l2jmobius.commons.network.PacketWriter;
  2966. +import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
  2967. +import org.l2jmobius.gameserver.model.vip.VipManager;
  2968. +import org.l2jmobius.gameserver.network.OutgoingPackets;
  2969. +import org.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket;
  2970. +
  2971. +import java.time.Instant;
  2972. +import java.time.temporal.ChronoUnit;
  2973. +
  2974. +public class ReceiveVipInfo implements IClientOutgoingPacket
  2975. +{
  2976. +    private final PlayerInstance _player;
  2977. +
  2978. +    public ReceiveVipInfo(PlayerInstance player)
  2979. +    {
  2980. +        _player = player;
  2981. +    }
  2982. +   @Override
  2983. +   public boolean write(PacketWriter packet)
  2984. +   {
  2985. +        if(!Config.VIP_SYSTEM_ENABLED)
  2986. +            return false;
  2987. +        var vipManager = VipManager.getInstance();
  2988. +        var vipTier = _player.getVipTier();
  2989. +        var vipDuration = (int) ChronoUnit.SECONDS.between(Instant.now(), Instant.ofEpochMilli(_player.getVipTierExpiration()));
  2990. +
  2991. +        OutgoingPackets.RECIVE_VIP_INFO.writeId(packet);
  2992. +       packet.writeC(vipTier);
  2993. +       packet.writeQ(_player.getVipPoints());
  2994. +       packet.writeD(vipDuration);
  2995. +       packet.writeQ(vipManager.getPointsToLevel((byte)(vipTier+1)));
  2996. +       packet.writeQ(vipManager.getPointsDepreciatedOnLevel(vipTier));
  2997. +       packet.writeC(vipTier);
  2998. +       packet.writeQ(vipManager.getPointsToLevel(vipTier));
  2999. +       return true;
  3000. +   }
  3001. +}
  3002.  
Add Comment
Please, Sign In to add comment