Advertisement
luannbr

Untitled

Feb 20th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 56.17 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. Index: java/net/sf/l2j/gameserver/instancemanager/VipManager.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/instancemanager/VipManager.java  (nonexistent)
  6. +++ java/net/sf/l2j/gameserver/instancemanager/VipManager.java  (working copy)
  7. @@ -0,0 +1,200 @@
  8. +/*
  9. + * This program is free software: you can redistribute it and/or modify it under
  10. + * the terms of the GNU General Public License as published by the Free Software
  11. + * Foundation, either version 3 of the License, or (at your option) any later
  12. + * version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful, but WITHOUT
  15. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  17. + * details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License along with
  20. + * this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +package net.sf.l2j.gameserver.instancemanager;
  23. +
  24. +import java.util.Calendar;
  25. +import java.util.StringTokenizer;
  26. +
  27. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminVipStatus;
  28. +import net.sf.l2j.gameserver.model.L2World;
  29. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  30. +import net.sf.l2j.gameserver.model.actor.instance.L2VipInstance;
  31. +import net.sf.l2j.gameserver.model.entity.Castle;
  32. +import net.sf.l2j.gameserver.network.serverpackets.SiegeInfo;
  33. +
  34. +/**
  35. + * @author Baggos
  36. + */
  37. +public class VipManager
  38. +{
  39. +   public static final VipManager getInstance()
  40. +   {
  41. +       return SingletonHolder._instance;
  42. +   }
  43. +  
  44. +   public boolean Vip(String command, L2PcInstance player)
  45. +   {
  46. +       if (command.startsWith("vip"))
  47. +       {
  48. +           if (!player.isVipStatus())
  49. +           {
  50. +               player.sendMessage("Sorry! Only VIP player can do this action.");
  51. +               return false;
  52. +           }
  53. +           StringTokenizer st = new StringTokenizer(command);
  54. +           st.nextToken();
  55. +           try
  56. +           {
  57. +               String type = st.nextToken();
  58. +               switch (type)
  59. +               {
  60. +                   case "Noblesse":
  61. +                       L2VipInstance.Nobless(player);
  62. +                       break;
  63. +                   case "ChangeSex":
  64. +                       L2VipInstance.Sex(player);
  65. +                       break;
  66. +                   case "CleanPk":
  67. +                       L2VipInstance.CleanPk(player);
  68. +                       break;
  69. +                   case "FullRec":
  70. +                       L2VipInstance.Rec(player);
  71. +                       break;
  72. +               }
  73. +           }
  74. +           catch (Exception e)
  75. +           {
  76. +           }
  77. +       }
  78. +       return true;
  79. +   }
  80. +  
  81. +   public void Teleport(String command, L2PcInstance player)
  82. +   {
  83. +       if (command.startsWith("tp"))
  84. +       {
  85. +           if (!player.isVipStatus())
  86. +           {
  87. +               player.sendMessage("Sorry! Only VIP player can do this action.");
  88. +               return;
  89. +           }
  90. +           StringTokenizer st = new StringTokenizer(command);
  91. +           st.nextToken();
  92. +          
  93. +           String val = "";
  94. +           try
  95. +           {
  96. +               if (st.hasMoreTokens())
  97. +               {
  98. +                   val = st.nextToken();
  99. +               }
  100. +               L2PcInstance activeChar = L2World.getInstance().getPlayer(val);
  101. +               L2VipInstance.teleportTo(val, player, activeChar);
  102. +           }
  103. +           catch (Exception e)
  104. +           {
  105. +               // Case if the player is not in the same party.
  106. +               player.sendMessage("Incorrect target");
  107. +           }
  108. +       }
  109. +   }
  110. +  
  111. +   public void ClanTeleport(String command, L2PcInstance player)
  112. +   {
  113. +       if (command.startsWith("clantp"))
  114. +       {
  115. +           if (!player.isVipStatus())
  116. +           {
  117. +               player.sendMessage("Sorry! Only VIP player can do this action.");
  118. +               return;
  119. +           }
  120. +           StringTokenizer st = new StringTokenizer(command);
  121. +           st.nextToken();
  122. +          
  123. +           String clan = "";
  124. +           try
  125. +           {
  126. +               if (st.hasMoreTokens())
  127. +               {
  128. +                   clan = st.nextToken();
  129. +               }
  130. +               L2PcInstance activeChar = L2World.getInstance().getPlayer(clan);
  131. +               L2VipInstance.teleportToClan(clan, player, activeChar);
  132. +           }
  133. +           catch (Exception e)
  134. +           {
  135. +               // Case if the player is not in the same clan.
  136. +               player.sendMessage("Incorrect target");
  137. +           }
  138. +       }
  139. +   }
  140. +  
  141. +   public boolean Siege(String command, L2PcInstance player)
  142. +   {
  143. +       if (command.startsWith("siege"))
  144. +       {
  145. +           if (!player.isVipStatus())
  146. +           {
  147. +               player.sendMessage("Sorry! Only VIP player can do this action.");
  148. +               return false;
  149. +           }
  150. +           StringTokenizer st = new StringTokenizer(command);
  151. +           st.nextToken();
  152. +           try
  153. +           {
  154. +               String type = st.nextToken();
  155. +               int castleId = 0;
  156. +              
  157. +               if (type.startsWith("Gludio"))
  158. +                   castleId = 1;
  159. +               else if (type.startsWith("Dion"))
  160. +                   castleId = 2;
  161. +               else if (type.startsWith("Giran"))
  162. +                   castleId = 3;
  163. +               else if (type.startsWith("Oren"))
  164. +                   castleId = 4;
  165. +               else if (type.startsWith("Aden"))
  166. +                   castleId = 5;
  167. +               else if (type.startsWith("Innadril"))
  168. +                   castleId = 6;
  169. +               else if (type.startsWith("Goddard"))
  170. +                   castleId = 7;
  171. +               else if (type.startsWith("Rune"))
  172. +                   castleId = 8;
  173. +               else if (type.startsWith("Schuttgart"))
  174. +                   castleId = 9;
  175. +              
  176. +               Castle castle = CastleManager.getInstance().getCastleById(castleId);
  177. +              
  178. +               if (castle != null && castleId != 0)
  179. +                   player.sendPacket(new SiegeInfo(castle));
  180. +           }
  181. +           catch (Exception e)
  182. +           {
  183. +           }
  184. +       }
  185. +       return true;
  186. +   }
  187. +  
  188. +   // Contains to EnterWorld.java for VIP onEnter.
  189. +   public static void onEnterVipStatus(L2PcInstance activeChar)
  190. +   {
  191. +       long now = Calendar.getInstance().getTimeInMillis();
  192. +       long endDay = activeChar.getMemos().getLong("TimeOfVip");
  193. +      
  194. +       if (now > endDay)
  195. +           AdminVipStatus.RemoveVipStatus(activeChar);
  196. +       else
  197. +       {
  198. +           activeChar.setVipStatus(true);
  199. +           activeChar.broadcastUserInfo();
  200. +       }
  201. +   }
  202. +  
  203. +   private static class SingletonHolder
  204. +   {
  205. +       protected static final VipManager _instance = new VipManager();
  206. +   }
  207. +}
  208. Index: java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java
  209. ===================================================================
  210. --- java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (revision 5)
  211. +++ java/net/sf/l2j/gameserver/handler/AdminCommandHandler.java (working copy)
  212. @@ -63,6 +63,7 @@
  213.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminSpawn;
  214.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTarget;
  215.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminTeleport;
  216. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminVipStatus;
  217.  import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminZone;
  218.  
  219.  public class AdminCommandHandler
  220. @@ -123,6 +124,7 @@
  221.         registerAdminCommandHandler(new AdminTarget());
  222.         registerAdminCommandHandler(new AdminTeleport());
  223.         registerAdminCommandHandler(new AdminZone());
  224. +       registerAdminCommandHandler(new AdminVipStatus());
  225.     }
  226.    
  227.     public void registerAdminCommandHandler(IAdminCommandHandler handler)
  228. Index: config/vip.properties
  229. ===================================================================
  230. --- config/vip.properties   (nonexistent)
  231. +++ config/vip.properties   (working copy)
  232. @@ -0,0 +1,25 @@
  233. +# ================================================
  234. +#                    VIP System            
  235. +# ================================================
  236. +# If True, player can got VIP Status by item.
  237. +VipItemEnabled = True
  238. +
  239. +# Id of VIP Item.
  240. +# Do not forget to add the item handler on xml/items 3481.
  241. +# <set name="handler" val="VipStatusItem" />
  242. +VipItemId = 3481
  243. +
  244. +# Days of VIP.
  245. +VipDays = 10
  246. +
  247. +# Set Exp/Sp/Drop.
  248. +VipExp/SpRates = 50
  249. +VipAdenaDrop = 50
  250. +VipSpoilRates = 50
  251. +VipRaidDrop = 1
  252. +VipDrop = 1
  253. +
  254. +# Set Enchant Chance.
  255. +VipEnchantChanceArmor = 0.77
  256. +VipEnchantChanceWeapon15Plus = 0.77
  257. +VipEnchantChanceWeapon = 0.77
  258. \ No newline at end of file
  259. Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminVipStatus.java
  260. ===================================================================
  261. --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminVipStatus.java (nonexistent)
  262. +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminVipStatus.java (working copy)
  263. @@ -0,0 +1,134 @@
  264. +/*
  265. + * This program is free software: you can redistribute it and/or modify it under
  266. + * the terms of the GNU General Public License as published by the Free Software
  267. + * Foundation, either version 3 of the License, or (at your option) any later
  268. + * version.
  269. + *
  270. + * This program is distributed in the hope that it will be useful, but WITHOUT
  271. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  272. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  273. + * details.
  274. + *
  275. + * You should have received a copy of the GNU General Public License along with
  276. + * this program. If not, see <http://www.gnu.org/licenses/>.
  277. + */
  278. +package net.sf.l2j.gameserver.handler.admincommandhandlers;
  279. +
  280. +import java.util.StringTokenizer;
  281. +import java.util.concurrent.TimeUnit;
  282. +
  283. +import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  284. +import net.sf.l2j.gameserver.model.L2World;
  285. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  286. +import net.sf.l2j.gameserver.network.clientpackets.Say2;
  287. +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
  288. +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  289. +import net.sf.l2j.gameserver.taskmanager.VipTimeTaskManager;
  290. +
  291. +/**
  292. + * @author Baggos
  293. + */
  294. +public class AdminVipStatus implements IAdminCommandHandler
  295. +{
  296. +   private static String[] _adminCommands = new String[]
  297. +   {
  298. +       "admin_vipon",
  299. +       "admin_vipoff"
  300. +   };
  301. +  
  302. +   @Override
  303. +   public boolean useAdminCommand(String command, L2PcInstance activeChar)
  304. +   {
  305. +       StringTokenizer st = new StringTokenizer(command);
  306. +       st.nextToken();
  307. +       String player = "";
  308. +       int time = 1;
  309. +       L2PcInstance target = null;
  310. +       if (st.hasMoreTokens())
  311. +       {
  312. +           player = st.nextToken();
  313. +           target = L2World.getInstance().getPlayer(player);
  314. +           if (st.hasMoreTokens())
  315. +           {
  316. +               try
  317. +               {
  318. +                   time = Integer.parseInt(st.nextToken());
  319. +               }
  320. +               catch (NumberFormatException nfe)
  321. +               {
  322. +                   activeChar.sendMessage("Invalid number format used: " + nfe);
  323. +                   return false;
  324. +               }
  325. +           }
  326. +       }
  327. +       else if (activeChar.getTarget() != null && activeChar.getTarget() instanceof L2PcInstance)
  328. +           target = (L2PcInstance) activeChar.getTarget();
  329. +      
  330. +       if (command.startsWith("admin_vipon"))
  331. +       {
  332. +           if (target == null && player.equals(""))
  333. +           {
  334. +               activeChar.sendMessage("Usage: //vipon <char_name> [days]");
  335. +               return false;
  336. +           }
  337. +           if (target != null)
  338. +           {
  339. +               AdminVipStatus.AddVipStatus(target, activeChar, time);
  340. +               activeChar.sendMessage(target.getName() + " got VIP Status for " + time + " day(s).");
  341. +           }
  342. +       }
  343. +       else if (command.startsWith("admin_vipoff"))
  344. +       {
  345. +           if (target == null && player.equals(""))
  346. +           {
  347. +               activeChar.sendMessage("Usage: //removevip <char_name>");
  348. +               return false;
  349. +           }
  350. +           if (target != null)
  351. +           {
  352. +               if (target.isVipStatus())
  353. +               {
  354. +                   AdminVipStatus.RemoveVipStatus(target);
  355. +                   activeChar.sendMessage(target.getName() + "'s VIP Status has been removed.");
  356. +               }
  357. +               else
  358. +                   activeChar.sendMessage("Player " +target.getName() + " is not an VIP.");
  359. +           }
  360. +       }
  361. +       return true;
  362. +   }
  363. +  
  364. +   public static void AddVipStatus(L2PcInstance target, L2PcInstance player, int time)
  365. +   {
  366. +       target.broadcastPacket(new SocialAction(target, 16));
  367. +       target.setVipStatus(true);
  368. +       VipTimeTaskManager.getInstance().add(target);
  369. +       long remainingTime = target.getMemos().getLong("TimeOfVip", 0);
  370. +       if (remainingTime > 0)
  371. +       {
  372. +           target.getMemos().set("TimeOfVip", remainingTime + TimeUnit.DAYS.toMillis(time));
  373. +           target.sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "VIP Manager", "Dear " + player.getName() + ", your VIP status has been extended by " + time + " day(s)."));
  374. +       }
  375. +       else
  376. +       {
  377. +           target.getMemos().set("TimeOfVip", System.currentTimeMillis() + TimeUnit.DAYS.toMillis(time));
  378. +           target.sendPacket(new CreatureSay(0, Say2.HERO_VOICE, "VIP Manager", "Dear " + player.getName() + ", you got VIP Status for " + time + " day(s)."));
  379. +           target.broadcastUserInfo();
  380. +       }
  381. +   }
  382. +  
  383. +   public static void RemoveVipStatus(L2PcInstance target)
  384. +   {
  385. +       VipTimeTaskManager.getInstance().remove(target);
  386. +       target.getMemos().set("TimeOfVip", 0);
  387. +       target.setVipStatus(false);
  388. +       target.broadcastPacket(new SocialAction(target, 13));
  389. +       target.broadcastUserInfo();
  390. +   }
  391. +  
  392. +   @Override
  393. +   public String[] getAdminCommandList()
  394. +   {
  395. +       return _adminCommands;
  396. +   }
  397. +}
  398. Index: java/net/sf/l2j/gameserver/taskmanager/VipTimeTaskManager.java
  399. ===================================================================
  400. --- java/net/sf/l2j/gameserver/taskmanager/VipTimeTaskManager.java  (nonexistent)
  401. +++ java/net/sf/l2j/gameserver/taskmanager/VipTimeTaskManager.java  (working copy)
  402. @@ -0,0 +1,75 @@
  403. +/*
  404. + * This program is free software: you can redistribute it and/or modify it under
  405. + * the terms of the GNU General Public License as published by the Free Software
  406. + * Foundation, either version 3 of the License, or (at your option) any later
  407. + * version.
  408. + *
  409. + * This program is distributed in the hope that it will be useful, but WITHOUT
  410. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  411. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  412. + * details.
  413. + *
  414. + * You should have received a copy of the GNU General Public License along with
  415. + * this program. If not, see <http://www.gnu.org/licenses/>.
  416. + */
  417. +package net.sf.l2j.gameserver.taskmanager;
  418. +
  419. +import java.util.Map;
  420. +import java.util.concurrent.ConcurrentHashMap;
  421. +
  422. +import net.sf.l2j.gameserver.ThreadPoolManager;
  423. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminVipStatus;
  424. +import net.sf.l2j.gameserver.model.actor.L2Character;
  425. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  426. +
  427. +/**
  428. + * @author Baggos
  429. + */
  430. +public class VipTimeTaskManager implements Runnable
  431. +{
  432. +   private final Map<L2PcInstance, Long> _players = new ConcurrentHashMap<>();
  433. +  
  434. +   protected VipTimeTaskManager()
  435. +   {
  436. +       // Run task each 10 second.
  437. +       ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(this, 10000, 10000);
  438. +   }
  439. +  
  440. +   public final void add(L2PcInstance player)
  441. +   {
  442. +       _players.put(player, System.currentTimeMillis());
  443. +   }
  444. +  
  445. +   public final void remove(L2Character player)
  446. +   {
  447. +       _players.remove(player);
  448. +   }
  449. +  
  450. +   @Override
  451. +   public final void run()
  452. +   {
  453. +       if (_players.isEmpty())
  454. +           return;
  455. +      
  456. +       for (Map.Entry<L2PcInstance, Long> entry : _players.entrySet())
  457. +       {
  458. +           final L2PcInstance player = entry.getKey();
  459. +          
  460. +           if (player.getMemos().getLong("TimeOfVip") < System.currentTimeMillis())
  461. +           {
  462. +               AdminVipStatus.RemoveVipStatus(player);
  463. +               remove(player);
  464. +           }
  465. +       }
  466. +   }
  467. +  
  468. +   public static final VipTimeTaskManager getInstance()
  469. +   {
  470. +       return SingletonHolder._instance;
  471. +   }
  472. +  
  473. +   private static class SingletonHolder
  474. +   {
  475. +       protected static final VipTimeTaskManager _instance = new VipTimeTaskManager();
  476. +   }
  477. +}
  478. Index: java/net/sf/l2j/Config.java
  479. ===================================================================
  480. --- java/net/sf/l2j/Config.java (revision 5)
  481. +++ java/net/sf/l2j/Config.java (working copy)
  482. @@ -49,10 +49,26 @@
  483.     public static final String LOGIN_CONFIGURATION_FILE = "./config/loginserver.properties";
  484.     public static final String NPCS_FILE = "./config/npcs.properties";
  485.     public static final String PLAYERS_FILE = "./config/players.properties";
  486. +   public static final String VIP_FILE = "./config/vip.properties";
  487.     public static final String SERVER_FILE = "./config/server.properties";
  488.     public static final String SIEGE_FILE = "./config/siege.properties";
  489.    
  490.     // --------------------------------------------------
  491. +   // VIP settings
  492. +   // --------------------------------------------------
  493. +   public static boolean ENABLE_VIP_ITEM;
  494. +   public static int VIP_ITEM_ID;
  495. +   public static int VIP_DAYS;
  496. +   public static int VIP_XP_SP_RATES;
  497. +   public static int VIP_ADENA_RATES;
  498. +   public static int VIP_SPOIL_RATES;
  499. +   public static int VIP_RATE_DROP_ITEMS_BY_RAID;
  500. +   public static int VIP_DROP_RATES;
  501. +   public static double VIP_ENCHANT_CHANCE_ARMOR;
  502. +   public static double VIP_ENCHANT_CHANCE_WEAPON_15PLUS;
  503. +   public static double VIP_ENCHANT_CHANCE_WEAPON;
  504. +  
  505. +   // --------------------------------------------------
  506.     // Clans settings
  507.     // --------------------------------------------------
  508.    
  509. @@ -687,6 +703,22 @@
  510.         {
  511.             _log.info("Loading gameserver configuration files.");
  512.            
  513. +           // VIP settings
  514. +           ExProperties vip = load(VIP_FILE);
  515. +           ENABLE_VIP_ITEM = vip.getProperty("VipItemEnabled", true);
  516. +           VIP_ITEM_ID = vip.getProperty("VipItemId", 3481);
  517. +           VIP_DAYS = vip.getProperty("VipDays", 5);
  518. +          
  519. +           VIP_XP_SP_RATES = vip.getProperty("VipExp/SpRates", 1000);
  520. +           VIP_ADENA_RATES = vip.getProperty("VipAdenaDrop", 1000);
  521. +           VIP_SPOIL_RATES = vip.getProperty("VipSpoilRates", 1000);
  522. +           VIP_RATE_DROP_ITEMS_BY_RAID = vip.getProperty("VipRaidDrop", 1);
  523. +           VIP_DROP_RATES = vip.getProperty("VipDrop", 1);
  524. +          
  525. +           VIP_ENCHANT_CHANCE_ARMOR = vip.getProperty("VipEnchantChanceArmor", 0.77);
  526. +           VIP_ENCHANT_CHANCE_WEAPON_15PLUS = vip.getProperty("VipEnchantChanceWeapon15Plus", 0.77);
  527. +           VIP_ENCHANT_CHANCE_WEAPON = vip.getProperty("VipEnchantChanceWeapon", 0.77);
  528. +          
  529.             // Clans settings
  530.             ExProperties clans = load(CLANS_FILE);
  531.             ALT_CLAN_JOIN_DAYS = clans.getProperty("DaysBeforeJoinAClan", 5);
  532. Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
  533. ===================================================================
  534. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (revision 5)
  535. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java (working copy)
  536. @@ -22,6 +22,7 @@
  537.  import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
  538.  import net.sf.l2j.gameserver.handler.AdminCommandHandler;
  539.  import net.sf.l2j.gameserver.handler.IAdminCommandHandler;
  540. +import net.sf.l2j.gameserver.instancemanager.VipManager;
  541.  import net.sf.l2j.gameserver.model.L2Object;
  542.  import net.sf.l2j.gameserver.model.L2World;
  543.  import net.sf.l2j.gameserver.model.actor.L2Npc;
  544. @@ -162,6 +163,22 @@
  545.                 if (heroid > 0)
  546.                     Hero.getInstance().showHeroDiary(activeChar, heroclass, heroid, heropage);
  547.             }
  548. +           else if (_command.startsWith("vip"))
  549. +           {
  550. +               VipManager.getInstance().Vip(_command, activeChar);
  551. +           }
  552. +           else if (_command.startsWith("tp"))
  553. +           {
  554. +               VipManager.getInstance().Teleport(_command, activeChar);
  555. +           }
  556. +           else if (_command.startsWith("clantp"))
  557. +           {
  558. +               VipManager.getInstance().ClanTeleport(_command, activeChar);
  559. +           }
  560. +           else if (_command.startsWith("siege"))
  561. +           {
  562. +               VipManager.getInstance().Siege(_command, activeChar);
  563. +           }
  564.             else if (_command.startsWith("arenachange")) // change
  565.             {
  566.                 final boolean isManager = activeChar.getCurrentFolkNPC() instanceof L2OlympiadManagerInstance;
  567. Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java
  568. ===================================================================
  569. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (revision 5)
  570. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestEnchantItem.java    (working copy)
  571. @@ -111,7 +111,7 @@
  572.        
  573.         synchronized (item)
  574.         {
  575. -           double chance = scrollTemplate.getChance(item);
  576. +           double chance = scrollTemplate.getChance(item, activeChar);
  577.            
  578.             // last validation check
  579.             if (item.getOwnerId() != activeChar.getObjectId() || !isEnchantable(item) || chance < 0)
  580. Index: java/net/sf/l2j/gameserver/network/clientpackets/AbstractEnchantPacket.java
  581. ===================================================================
  582. --- java/net/sf/l2j/gameserver/network/clientpackets/AbstractEnchantPacket.java (revision 5)
  583. +++ java/net/sf/l2j/gameserver/network/clientpackets/AbstractEnchantPacket.java (working copy)
  584. @@ -18,6 +18,7 @@
  585.  import java.util.Map;
  586.  
  587.  import net.sf.l2j.Config;
  588. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  589.  import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  590.  import net.sf.l2j.gameserver.model.item.kind.Item;
  591.  import net.sf.l2j.gameserver.model.item.kind.Weapon;
  592. @@ -59,7 +60,6 @@
  593.                     if (!_isWeapon || (Config.ENCHANT_MAX_WEAPON > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_WEAPON))
  594.                         return false;
  595.                     break;
  596. -              
  597.                 case Item.TYPE2_SHIELD_ARMOR:
  598.                 case Item.TYPE2_ACCESSORY:
  599.                     if (_isWeapon || (Config.ENCHANT_MAX_ARMOR > 0 && enchantItem.getEnchantLevel() >= Config.ENCHANT_MAX_ARMOR))
  600. @@ -107,9 +107,10 @@
  601.          * <li>full body armors has a chance of 1/1 for +4, 2/3 for +5, 1/3 for +6, ..., 1/17 for +20. If you've made a +20 armor, chance to make it +21 will be equal to zero (0%).</li>
  602.         * </ul>
  603.         * @param enchantItem : The item to enchant.
  604. +        * @param player
  605.         * @return the enchant chance under double format (0.7 / 0.35 / 0.44324...).
  606.         */
  607. -       public final double getChance(ItemInstance enchantItem)
  608. +       public final double getChance(ItemInstance enchantItem, L2PcInstance player)
  609.        {
  610.            if (!isValid(enchantItem))
  611.                return -1;
  612. @@ -122,16 +123,20 @@
  613.          
  614.            // Armor formula : 0.66^(current-2), chance is lower and lower for each enchant.
  615.            if (enchantItem.isArmor())
  616. -               chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
  617. +               if (player.isVipStatus())
  618. +                   chance = Math.pow(Config.VIP_ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
  619. +               else
  620. +                   chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
  621.            // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
  622.            else if (enchantItem.isWeapon())
  623.            {
  624. +               if (player.isVipStatus())
  625. +                   chance = (enchantItem.getEnchantLevel() > 14) ? Config.VIP_ENCHANT_CHANCE_WEAPON_15PLUS : Config.VIP_ENCHANT_CHANCE_WEAPON;
  626.                if (((Weapon) enchantItem.getItem()).isMagical())
  627.                    chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
  628.                else
  629.                    chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
  630.            }
  631. -          
  632.            return chance;
  633.        }
  634.    }
  635. Index: java/net/sf/l2j/gameserver/handler/ItemHandler.java
  636. ===================================================================
  637. --- java/net/sf/l2j/gameserver/handler/ItemHandler.java (revision 5)
  638. +++ java/net/sf/l2j/gameserver/handler/ItemHandler.java (working copy)
  639. @@ -43,6 +43,7 @@
  640. import net.sf.l2j.gameserver.handler.itemhandlers.SpecialXMas;
  641. import net.sf.l2j.gameserver.handler.itemhandlers.SpiritShot;
  642. import net.sf.l2j.gameserver.handler.itemhandlers.SummonItems;
  643. +import net.sf.l2j.gameserver.handler.itemhandlers.VipStatusItem;
  644. import net.sf.l2j.gameserver.model.item.kind.EtcItem;
  645.  
  646. public class ItemHandler
  647. @@ -82,6 +83,7 @@
  648.        registerItemHandler(new SoulCrystals());
  649.        registerItemHandler(new SpiritShot());
  650.        registerItemHandler(new SummonItems());
  651. +       registerItemHandler(new VipStatusItem());
  652.    }
  653.  
  654.    public void registerItemHandler(IItemHandler handler)
  655. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
  656. ===================================================================
  657. --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 5)
  658. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
  659. @@ -239,6 +239,7 @@
  660. import net.sf.l2j.gameserver.taskmanager.ItemsOnGroundTaskManager;
  661. import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager;
  662. import net.sf.l2j.gameserver.taskmanager.ShadowItemTaskManager;
  663. +import net.sf.l2j.gameserver.taskmanager.VipTimeTaskManager;
  664. import net.sf.l2j.gameserver.taskmanager.WaterTaskManager;
  665. import net.sf.l2j.gameserver.templates.skills.L2EffectFlag;
  666. import net.sf.l2j.gameserver.templates.skills.L2EffectType;
  667. @@ -586,6 +587,7 @@
  668.    private volatile int _clientHeading;
  669.  
  670.    private int _mailPosition;
  671. +   private boolean _isVipStatus;
  672.  
  673.    private static final int FALLING_VALIDATION_DELAY = 10000;
  674.    private volatile long _fallingTimestamp = 0;
  675. @@ -4084,7 +4086,7 @@
  676.        for (L2Character character : getKnownList().getKnownType(L2Character.class))
  677.            if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  678.                character.abortCast();
  679. -      
  680. +          
  681.        if (isInParty() && getParty().isInDimensionalRift())
  682.            getParty().getDimensionalRift().getDeadMemberList().add(this);
  683.      
  684. @@ -4395,6 +4397,8 @@
  685.        PvpFlagTaskManager.getInstance().remove(this);
  686.        GameTimeTaskManager.getInstance().remove(this);
  687.        ShadowItemTaskManager.getInstance().remove(this);
  688. +       if (isVipStatus())
  689. +           VipTimeTaskManager.getInstance().remove(this);
  690.    }
  691.  
  692.    /**
  693. @@ -6890,7 +6894,7 @@
  694.      
  695.        switch (sklTargetType)
  696.        {
  697. -       // Target the player if skill type is AURA, PARTY, CLAN or SELF
  698. +           // Target the player if skill type is AURA, PARTY, CLAN or SELF
  699.            case TARGET_AURA:
  700.            case TARGET_FRONT_AURA:
  701.            case TARGET_BEHIND_AURA:
  702. @@ -8150,7 +8154,7 @@
  703.        else
  704.            for (L2Skill s : SkillTable.getNobleSkills())
  705.                super.removeSkill(s); // Just Remove skills without deleting from Sql
  706. -          
  707. +              
  708.        _noble = val;
  709.      
  710.        sendSkillList();
  711. @@ -8496,7 +8500,7 @@
  712.            for (L2Character character : getKnownList().getKnownType(L2Character.class))
  713.                if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  714.                    character.abortCast();
  715. -          
  716. +              
  717.            store();
  718.            _reuseTimeStamps.clear();
  719.          
  720. @@ -8631,6 +8635,8 @@
  721.      
  722.        // Add to the GameTimeTask to keep inform about activity time.
  723.        GameTimeTaskManager.getInstance().add(this);
  724. +       if (isVipStatus())
  725. +           VipTimeTaskManager.getInstance().add(this);
  726.      
  727.        // Teleport player if the Seven Signs period isn't the good one, or if the player isn't in a cabal.
  728.        if (isIn7sDungeon() && !isGM())
  729. @@ -9113,7 +9119,7 @@
  730.            for (L2Character character : getKnownList().getKnownType(L2Character.class))
  731.                if (character.getFusionSkill() != null && character.getFusionSkill().getTarget() == this)
  732.                    character.abortCast();
  733. -          
  734. +              
  735.            // Stop signets & toggles effects.
  736.            for (L2Effect effect : getAllEffects())
  737.            {
  738. @@ -9170,7 +9176,7 @@
  739.            // If the L2PcInstance is a GM, remove it from the GM List
  740.            if (isGM())
  741.                GmListTable.getInstance().deleteGm(this);
  742. -          
  743. +              
  744.            // Check if the L2PcInstance is in observer mode to set its position to its position
  745.            // before entering in observer mode
  746.            if (inObserverMode())
  747. @@ -9285,13 +9291,13 @@
  748.            case 7809: // yellow for beginners
  749.            case 8486: // prize-winning for beginners
  750.                return 0;
  751. -              
  752. +          
  753.            case 8485: // prize-winning luminous
  754.            case 8506: // green luminous
  755.            case 8509: // purple luminous
  756.            case 8512: // yellow luminous
  757.                return 2;
  758. -              
  759. +          
  760.            default:
  761.                return 1;
  762.        }
  763. @@ -10198,6 +10204,16 @@
  764.        }
  765.    }
  766.  
  767. +   public boolean isVipStatus()
  768. +   {
  769. +       return _isVipStatus;
  770. +   }
  771. +  
  772. +   public void setVipStatus(boolean vip)
  773. +   {
  774. +       _isVipStatus = vip;
  775. +   }
  776. +  
  777.    /**
  778.     * @return the number of charges this L2PcInstance got.
  779.     */
  780. Index: java/net/sf/l2j/gameserver/handler/itemhandlers/VipStatusItem.java
  781. ===================================================================
  782. --- java/net/sf/l2j/gameserver/handler/itemhandlers/VipStatusItem.java  (nonexistent)
  783. +++ java/net/sf/l2j/gameserver/handler/itemhandlers/VipStatusItem.java  (working copy)
  784. @@ -0,0 +1,57 @@
  785. +/*
  786. + * This program is free software: you can redistribute it and/or modify it under
  787. + * the terms of the GNU General Public License as published by the Free Software
  788. + * Foundation, either version 3 of the License, or (at your option) any later
  789. + * version.
  790. + *
  791. + * This program is distributed in the hope that it will be useful, but WITHOUT
  792. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  793. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  794. + * details.
  795. + *
  796. + * You should have received a copy of the GNU General Public License along with
  797. + * this program. If not, see <http://www.gnu.org/licenses/>.
  798. + */
  799. +package net.sf.l2j.gameserver.handler.itemhandlers;
  800. +
  801. +import net.sf.l2j.Config;
  802. +import net.sf.l2j.gameserver.handler.IItemHandler;
  803. +import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminVipStatus;
  804. +import net.sf.l2j.gameserver.model.actor.L2Playable;
  805. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  806. +import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
  807. +import net.sf.l2j.gameserver.network.SystemMessageId;
  808. +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  809. +
  810. +/**
  811. + * @author Baggos
  812. + */
  813. +public class VipStatusItem implements IItemHandler
  814. +{
  815. +   @Override
  816. +   public void useItem(L2Playable playable, ItemInstance item, boolean forceUse)
  817. +   {
  818. +       if (Config.ENABLE_VIP_ITEM)
  819. +       {
  820. +           if (!(playable instanceof L2PcInstance))
  821. +               return;
  822. +          
  823. +           L2PcInstance activeChar = (L2PcInstance) playable;
  824. +           if (activeChar.isVipStatus())
  825. +               activeChar.sendMessage("Your character has already VIP Status!");
  826. +           else if (activeChar.isInOlympiadMode())
  827. +               activeChar.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
  828. +           else
  829. +           {
  830. +               AdminVipStatus.AddVipStatus(activeChar, activeChar, Config.VIP_DAYS);
  831. +               activeChar.broadcastPacket(new SocialAction(activeChar, 16));
  832. +               playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
  833. +           }
  834. +       }
  835. +   }
  836. +  
  837. +   public int getItemIds()
  838. +   {
  839. +       return Config.VIP_ITEM_ID;
  840. +   }
  841. +}
  842. Index: java/net/sf/l2j/gameserver/model/actor/L2Attackable.java
  843. ===================================================================
  844. --- java/net/sf/l2j/gameserver/model/actor/L2Attackable.java    (revision 5)
  845. +++ java/net/sf/l2j/gameserver/model/actor/L2Attackable.java    (working copy)
  846. @@ -340,6 +340,12 @@
  847.                        sp *= Config.CHAMPION_REWARDS;
  848.                    }
  849.                  
  850. +                   if (attacker.isVipStatus())
  851. +                   {
  852. +                       exp *= Config.VIP_XP_SP_RATES;
  853. +                       sp *= Config.VIP_XP_SP_RATES;
  854. +                   }
  855. +                  
  856.                    exp *= 1 - penalty;
  857.                  
  858.                    if (isOverhit() && _overhitAttacker != null && _overhitAttacker.getActingPlayer() != null && attacker == _overhitAttacker.getActingPlayer())
  859. @@ -419,6 +425,12 @@
  860.                    sp *= Config.CHAMPION_REWARDS;
  861.                }
  862.              
  863. +               if (attacker.isVipStatus())
  864. +               {
  865. +                   exp *= Config.VIP_XP_SP_RATES;
  866. +                   sp *= Config.VIP_XP_SP_RATES;
  867. +               }
  868. +              
  869.                exp *= partyMul;
  870.                sp *= partyMul;
  871.              
  872. @@ -793,11 +805,23 @@
  873.      
  874.        // Applies Drop rates
  875.        if (drop.getItemId() == 57)
  876. -           dropChance *= Config.RATE_DROP_ADENA;
  877. +           if (lastAttacker.isVipStatus())
  878. +               dropChance *= Config.VIP_ADENA_RATES;
  879. +           else
  880. +               dropChance *= Config.RATE_DROP_ADENA;
  881.        else if (isSweep)
  882. -           dropChance *= Config.RATE_DROP_SPOIL;
  883. +           if (lastAttacker.isVipStatus())
  884. +               dropChance *= Config.VIP_SPOIL_RATES;
  885. +           else
  886. +               dropChance *= Config.RATE_DROP_SPOIL;
  887.        else
  888. -           dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
  889. +       {
  890. +           if (lastAttacker.isVipStatus())
  891. +               dropChance *= isRaid() && !isRaidMinion() ? Config.VIP_RATE_DROP_ITEMS_BY_RAID : Config.VIP_DROP_RATES;
  892. +           else
  893. +               dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
  894. +          
  895. +       }
  896.      
  897.        if (isChampion())
  898.            dropChance *= Config.CHAMPION_REWARDS;
  899. @@ -832,7 +856,7 @@
  900.        if (isChampion())
  901.            if (drop.getItemId() == 57 || (drop.getItemId() >= 6360 && drop.getItemId() <= 6362))
  902.                itemCount *= Config.CHAMPION_ADENAS_REWARDS;
  903. -      
  904. +          
  905.        if (itemCount > 0)
  906.            return new IntIntHolder(drop.getItemId(), itemCount);
  907.      
  908. @@ -851,7 +875,7 @@
  909.    {
  910.        if (categoryDrops == null)
  911.            return null;
  912. -      
  913. +          
  914.        // Get default drop chance for the category (that's the sum of chances for all items in the category)
  915.         // keep track of the base category chance as it'll be used later, if an item is drop from the category.
  916.         // for everything else, use the total "categoryDropChance"
  917. @@ -882,7 +906,7 @@
  918.             DropData drop = categoryDrops.dropOne(isRaid() && !isRaidMinion());
  919.             if (drop == null)
  920.                 return null;
  921. -          
  922. +              
  923.             // Now decide the quantity to drop based on the rates and penalties. To get this value
  924.             // simply divide the modified categoryDropChance by the base category chance. This
  925.             // results in a chance that will dictate the drops amounts: for each amount over 100
  926. @@ -897,7 +921,12 @@
  927.            
  928.             double dropChance = drop.getChance();
  929.             if (drop.getItemId() == 57)
  930. -               dropChance *= Config.RATE_DROP_ADENA;
  931. +               if (lastAttacker.isVipStatus())
  932. +                   dropChance *= Config.VIP_ADENA_RATES;
  933. +               else
  934. +                   dropChance *= Config.RATE_DROP_ADENA;
  935. +           else if (lastAttacker.isVipStatus())
  936. +               dropChance *= isRaid() && !isRaidMinion() ? Config.VIP_RATE_DROP_ITEMS_BY_RAID : Config.VIP_DROP_RATES;
  937.             else
  938.                 dropChance *= isRaid() && !isRaidMinion() ? Config.RATE_DROP_ITEMS_BY_RAID : Config.RATE_DROP_ITEMS;
  939.            
  940. @@ -933,7 +962,7 @@
  941.             if (isChampion())
  942.                 if (drop.getItemId() == 57 || (drop.getItemId() >= 6360 && drop.getItemId() <= 6362))
  943.                     itemCount *= Config.CHAMPION_ADENAS_REWARDS;
  944. -          
  945. +              
  946.             if (itemCount > 0)
  947.                 return new IntIntHolder(drop.getItemId(), itemCount);
  948.         }
  949. @@ -954,7 +983,7 @@
  950.             for (L2Character atkChar : _attackByList)
  951.                 if (atkChar.getLevel() > highestLevel)
  952.                     highestLevel = atkChar.getLevel();
  953. -          
  954. +              
  955.             // According to official data (Prima), deep blue mobs are 9 or more levels below players
  956.             if (highestLevel - 9 >= getLevel())
  957.                 return ((highestLevel - (getLevel() + 8)) * 9);
  958. @@ -1515,7 +1544,7 @@
  959.         // Over-hit damage percentages are limited to 25% max
  960.         if (overhitPercentage > 25)
  961.             overhitPercentage = 25;
  962. -      
  963. +          
  964.         // Get the overhit exp bonus according to the above over-hit damage percentage
  965.         // (1/1 basis - 13% of over-hit damage, 13% of extra exp is given, and so on...)
  966.         double overhitExp = ((overhitPercentage / 100) * normalExp);
  967. Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  968. ===================================================================
  969. --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (revision 5)
  970. +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java    (working copy)
  971. @@ -27,6 +27,7 @@
  972.  import net.sf.l2j.gameserver.instancemanager.PetitionManager;
  973.  import net.sf.l2j.gameserver.instancemanager.SevenSigns;
  974.  import net.sf.l2j.gameserver.instancemanager.SiegeManager;
  975. +import net.sf.l2j.gameserver.instancemanager.VipManager;
  976.  import net.sf.l2j.gameserver.model.L2Clan;
  977.  import net.sf.l2j.gameserver.model.L2Clan.SubPledge;
  978.  import net.sf.l2j.gameserver.model.L2World;
  979. @@ -203,6 +204,10 @@
  980.             activeChar.sendPacket(ExMailArrived.STATIC_PACKET);
  981.         }
  982.        
  983. +       // Vip Status onEnter
  984. +       if (activeChar.getMemos().getLong("TimeOfVip", 0) > 0)
  985. +           VipManager.onEnterVipStatus(activeChar);
  986. +      
  987.         // Clan notice, if active.
  988.         if (Config.ENABLE_COMMUNITY_BOARD && clan != null && clan.isNoticeEnabled())
  989.         {
  990. Index: java/net/sf/l2j/gameserver/model/actor/instance/L2VipInstance.java
  991. ===================================================================
  992. --- java/net/sf/l2j/gameserver/model/actor/instance/L2VipInstance.java  (nonexistent)
  993. +++ java/net/sf/l2j/gameserver/model/actor/instance/L2VipInstance.java  (working copy)
  994. @@ -0,0 +1,173 @@
  995. +/*
  996. + * This program is free software: you can redistribute it and/or modify it under
  997. + * the terms of the GNU General Public License as published by the Free Software
  998. + * Foundation, either version 3 of the License, or (at your option) any later
  999. + * version.
  1000. + *
  1001. + * This program is distributed in the hope that it will be useful, but WITHOUT
  1002. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  1003. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  1004. + * details.
  1005. + *
  1006. + * You should have received a copy of the GNU General Public License along with
  1007. + * this program. If not, see <http://www.gnu.org/licenses/>.
  1008. + */
  1009. +package net.sf.l2j.gameserver.model.actor.instance;
  1010. +
  1011. +import net.sf.l2j.gameserver.ThreadPoolManager;
  1012. +import net.sf.l2j.gameserver.ai.CtrlIntention;
  1013. +import net.sf.l2j.gameserver.datatables.SkillTable;
  1014. +import net.sf.l2j.gameserver.instancemanager.CastleManager;
  1015. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
  1016. +import net.sf.l2j.gameserver.network.SystemMessageId;
  1017. +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
  1018. +import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
  1019. +
  1020. +/**
  1021. + * @author Baggos
  1022. + */
  1023. +public class L2VipInstance extends L2NpcInstance
  1024. +{
  1025. +   /** Type the count for clean pk */
  1026. +   private final static int PK_CLEAN_COUNT = 50;
  1027. +  
  1028. +   public L2VipInstance(int objectId, NpcTemplate template)
  1029. +   {
  1030. +       super(objectId, template);
  1031. +   }
  1032. +  
  1033. +   public static void Nobless(L2PcInstance player)
  1034. +   {
  1035. +       if (player.isNoble())
  1036. +       {
  1037. +           player.sendMessage("You Are Already A Noblesse!.");
  1038. +           return;
  1039. +       }
  1040. +       player.broadcastPacket(new SocialAction(player, 16));
  1041. +       player.setNoble(true, true);
  1042. +       player.sendMessage("You Are Now a Noble,You Are Granted With Noblesse Status , And Noblesse Skills.");
  1043. +       player.broadcastUserInfo();
  1044. +   }
  1045. +  
  1046. +   public static void Sex(L2PcInstance player)
  1047. +   {
  1048. +       player.getAppearance().setSex(player.getAppearance().getSex() ? false : true);
  1049. +       player.sendMessage("Your gender has been changed,You will be disconected in 3 Seconds!");
  1050. +       player.broadcastUserInfo();
  1051. +       player.decayMe();
  1052. +       player.spawnMe();
  1053. +       ThreadPoolManager.getInstance().scheduleGeneral(() -> player.logout(false), 3000);
  1054. +   }
  1055. +  
  1056. +   public static void CleanPk(L2PcInstance player)
  1057. +   {
  1058. +       if (player.getPkKills() < 50)
  1059. +       {
  1060. +           player.sendMessage("You do not have enough Pk kills for clean.");
  1061. +           return;
  1062. +       }
  1063. +       player.setPkKills(player.getPkKills() - PK_CLEAN_COUNT);
  1064. +       player.sendMessage("You have successfully clean " + PK_CLEAN_COUNT + " pks!");
  1065. +       player.broadcastUserInfo();
  1066. +   }
  1067. +  
  1068. +   public static void Rec(L2PcInstance player)
  1069. +   {
  1070. +       if (player.getRecomHave() == 255)
  1071. +       {
  1072. +           player.sendMessage("You already have full recommends.");
  1073. +           return;
  1074. +       }
  1075. +       player.setRecomHave(255);
  1076. +       player.sendMessage("Added 255 recommends.");
  1077. +       player.getLastRecomUpdate();
  1078. +       player.broadcastUserInfo();
  1079. +   }
  1080. +  
  1081. +   public static void teleportTo(String val, L2PcInstance activeChar, L2PcInstance target)
  1082. +   {
  1083. +       if (target.getObjectId() == activeChar.getObjectId())
  1084. +           activeChar.sendPacket(SystemMessageId.CANNOT_USE_ON_YOURSELF);
  1085. +      
  1086. +       // Check if the player is not in the same party
  1087. +       else if (!activeChar.getParty().getPartyMembers().contains(target))
  1088. +           return;
  1089. +      
  1090. +       // Simple checks to avoid exploits
  1091. +       else if (target.isInJail() || target.isInOlympiadMode() || target.isInDuel() || target.isFestivalParticipant() || (target.isInParty() && target.getParty().isInDimensionalRift()) || target.inObserverMode())
  1092. +       {
  1093. +           activeChar.sendMessage("Due to the current friend's status, the teleportation failed.");
  1094. +           return;
  1095. +       }
  1096. +      
  1097. +       else if (target.getClan() != null && CastleManager.getInstance().getCastleByOwner(target.getClan()) != null && CastleManager.getInstance().getCastleByOwner(target.getClan()).getSiege().isInProgress())
  1098. +       {
  1099. +           activeChar.sendMessage("As your friend is in siege, you can't go to him/her.");
  1100. +           return;
  1101. +       }
  1102. +       else if (activeChar.getPvpFlag() > 0 || activeChar.getKarma() > 0)
  1103. +       {
  1104. +           activeChar.sendMessage("Go away! Flag or Pk player can not be teleported.");
  1105. +           return;
  1106. +       }
  1107. +       int x = target.getX();
  1108. +       int y = target.getY();
  1109. +       int z = target.getZ();
  1110. +      
  1111. +       activeChar.getAI().setIntention(CtrlIntention.IDLE);
  1112. +       activeChar.doCast(SkillTable.getInstance().getInfo(2100, 1));
  1113. +       activeChar.sendPacket(new ExShowScreenMessage("You will be teleported to " + target.getName() + " in 3 Seconds!", 3000, 2, true));
  1114. +       ThreadPoolManager.getInstance().scheduleGeneral(() -> activeChar.teleToLocation(x, y, z, 0), 3000);
  1115. +       activeChar.sendMessage("You have teleported to " + target.getName() + ".");
  1116. +   }
  1117. +  
  1118. +   public static void teleportToClan(String clan, L2PcInstance activeChar, L2PcInstance target)
  1119. +   {
  1120. +       if (target.getObjectId() == activeChar.getObjectId())
  1121. +           activeChar.sendPacket(SystemMessageId.CANNOT_USE_ON_YOURSELF);
  1122. +      
  1123. +       // Check if the player is not in the same clan.
  1124. +       else if (!activeChar.getClan().isMember(target.getObjectId()))
  1125. +           return;
  1126. +      
  1127. +       // Simple checks to avoid exploits
  1128. +       else if (target.isInJail() || target.isInOlympiadMode() || target.isInDuel() || target.isFestivalParticipant() || (target.isInParty() && target.getParty().isInDimensionalRift()) || target.inObserverMode())
  1129. +       {
  1130. +           activeChar.sendMessage("Due to the current clan member's status, the teleportation failed.");
  1131. +           return;
  1132. +       }
  1133. +      
  1134. +       else if (target.getClan() != null && CastleManager.getInstance().getCastleByOwner(target.getClan()) != null && CastleManager.getInstance().getCastleByOwner(target.getClan()).getSiege().isInProgress())
  1135. +       {
  1136. +           activeChar.sendMessage("As your clan member is in siege, you can't go to him/her.");
  1137. +           return;
  1138. +       }
  1139. +       else if (activeChar.getPvpFlag() > 0 || activeChar.getKarma() > 0)
  1140. +       {
  1141. +           activeChar.sendMessage("Go away! Flag or Pk player can not be teleported.");
  1142. +           return;
  1143. +       }
  1144. +       int x = target.getX();
  1145. +       int y = target.getY();
  1146. +       int z = target.getZ();
  1147. +      
  1148. +       activeChar.getAI().setIntention(CtrlIntention.IDLE);
  1149. +       activeChar.doCast(SkillTable.getInstance().getInfo(2100, 1));
  1150. +       activeChar.sendPacket(new ExShowScreenMessage("You will be teleported to " + target.getName() + " in 3 Seconds!", 3000, 2, true));
  1151. +       ThreadPoolManager.getInstance().scheduleGeneral(() -> activeChar.teleToLocation(x, y, z, 0), 3000);
  1152. +       activeChar.sendMessage("You have teleported to " + target.getName() + ".");
  1153. +   }
  1154. +  
  1155. +   @Override
  1156. +   public String getHtmlPath(int npcId, int val)
  1157. +   {
  1158. +       String filename = "";
  1159. +      
  1160. +       if (val == 0)
  1161. +           filename = "" + npcId;
  1162. +       else
  1163. +           filename = npcId + "-" + val;
  1164. +      
  1165. +       return "data/html/mods/vipNpc/" + filename + ".htm";
  1166. +   }
  1167. +}
  1168. \ No newline at end of file
  1169. #P aCis_datapack
  1170. Index: data/xml/npcs/50000-50999.xml
  1171. ===================================================================
  1172. --- data/xml/npcs/50000-50999.xml   (revision 5)
  1173. +++ data/xml/npcs/50000-50999.xml   (working copy)
  1174. @@ -108,4 +108,40 @@
  1175.             <skill id="4416" level="18"/>
  1176.         </skills>
  1177.     </npc>
  1178. +           <npc id="50009" idTemplate="30540" name="Angela" title="VIP MANAGER">
  1179. +       <set name="level" val="70"/>
  1180. +       <set name="radius" val="8"/>
  1181. +       <set name="height" val="20.5"/>
  1182. +       <set name="rHand" val="0"/>
  1183. +       <set name="lHand" val="0"/>
  1184. +       <set name="type" val="L2Vip"/>
  1185. +       <set name="exp" val="0"/>
  1186. +       <set name="sp" val="0"/>
  1187. +       <set name="hp" val="2444.46819"/>
  1188. +       <set name="mp" val="1345.8"/>
  1189. +       <set name="hpRegen" val="7.5"/>
  1190. +       <set name="mpRegen" val="2.7"/>
  1191. +       <set name="pAtk" val="688.86373"/>
  1192. +       <set name="pDef" val="295.91597"/>
  1193. +       <set name="mAtk" val="470.40463"/>
  1194. +       <set name="mDef" val="216.53847"/>
  1195. +       <set name="crit" val="4"/>
  1196. +       <set name="atkSpd" val="253"/>
  1197. +       <set name="str" val="40"/>
  1198. +       <set name="int" val="21"/>
  1199. +       <set name="dex" val="30"/>
  1200. +       <set name="wit" val="20"/>
  1201. +       <set name="con" val="43"/>
  1202. +       <set name="men" val="20"/>
  1203. +       <set name="corpseTime" val="7"/>
  1204. +       <set name="walkSpd" val="50"/>
  1205. +       <set name="runSpd" val="120"/>
  1206. +       <set name="dropHerbGroup" val="0"/>
  1207. +       <set name="attackRange" val="40"/>
  1208. +       <ai type="default" ssCount="0" ssRate="0" spsCount="0" spsRate="0" aggro="0" canMove="true" seedable="false"/>
  1209. +       <skills>
  1210. +           <skill id="4045" level="1"/>
  1211. +           <skill id="4416" level="14"/>
  1212. +       </skills>
  1213. +   </npc>
  1214.  </list>
  1215. \ No newline at end of file
  1216. Index: data/xml/admin_commands_rights.xml
  1217. ===================================================================
  1218. --- data/xml/admin_commands_rights.xml  (revision 5)
  1219. +++ data/xml/admin_commands_rights.xml  (working copy)
  1220. @@ -12,6 +12,10 @@
  1221.     <aCar name="admin_silence" accessLevel="1" />
  1222.     <aCar name="admin_tradeoff" accessLevel="1" />
  1223.     <aCar name="admin_reload" accessLevel="1" />
  1224. +  
  1225. +   <!-- VIP -->
  1226. +   <aCar name="admin_vipon" accessLevel="1" />
  1227. +   <aCar name="admin_vipoff" accessLevel="1" />
  1228.  
  1229.     <!-- ANNOUNCEMENTS -->
  1230.     <aCar name="admin_announce" accessLevel="1" />
  1231. Index: data/html/mods/vipNpc/50009.htm
  1232. ===================================================================
  1233. --- data/html/mods/vipNpc/50009.htm (nonexistent)
  1234. +++ data/html/mods/vipNpc/50009.htm (working copy)
  1235. @@ -0,0 +1,83 @@
  1236. +<html>
  1237. +<title>
  1238. +Donate Manager
  1239. +</title>
  1240. +<body>
  1241. +<br>
  1242. +
  1243. +<table width=300 height=32 bgcolor=000000>
  1244. +<tr>
  1245. +<td fixwidth=5>
  1246. +</td>
  1247. +<td fixwidth=32 height=42>
  1248. +<center><button action="bypass -h vip_vip $vip" value="" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill0106">
  1249. +</td>
  1250. +<td fixwidth=250>
  1251. +<br>
  1252. +<center><font color=F2F5A9>Vip Settings:</font>
  1253. +       <center><combobox width=120 height=17 var="vip" list=Noblesse;ChangeSex;CleanPk;FullRec;
  1254. +</td>
  1255. +<td fixwidth=50>
  1256. +</td>
  1257. +</tr>
  1258. +</table>
  1259. +
  1260. +<table width=300 height=32 bgcolor=000000>
  1261. +<tr>
  1262. +<td fixwidth=5>
  1263. +</td>
  1264. +<td fixwidth=32 height=42>
  1265. +       <center><button value="" action="bypass -h siege_siege $siege" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill0216">
  1266. +</td>
  1267. +<td fixwidth=250>
  1268. +<br>
  1269. +<center><font color=F2F5A9>Siege Services:</font>
  1270. +       <center><combobox width=120 height=17 var="siege" list=Gludio;Dion;Giran;Oren;Aden;Innadril;Goddard;Rune;Schuttgart;
  1271. +</td>
  1272. +<td fixwidth=50>
  1273. +</td>
  1274. +</tr>
  1275. +</table>
  1276. +
  1277. +<br>
  1278. +<center>
  1279. +Dear VIP player!<br1>
  1280. +From here you can go to your party member<br1>
  1281. +or you can also go to your clan member.<br1>
  1282. +Try it! It is easy only with one click.<br1>
  1283. +Conditions:<br1>
  1284. + <font color=FE642E>Olympiad</font>,<font color=FE642E> Duel</font>,<font color=FE642E> Events</font><br1>
  1285. +<font color=FE642E>Jail</font>,<font color=FE642E> Observer Mode</font>,<font color=FE642E> Siege</font><br1>
  1286. +<font color=FE642E>Flag</font> for yourself,<font color=FE642E> Karma</font> for yourself<font color=FE642E></font>.<br1>
  1287. +</center>
  1288. +
  1289. +<table width=300 height=32 bgcolor=000000>
  1290. +<tr>
  1291. +<td fixwidth=5>
  1292. +</td>
  1293. +<td fixwidth=32 height=42>
  1294. +<button action="bypass -h tp_tp $val" value="" value="" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill1429">
  1295. +</td>
  1296. +<td fixwidth=250>
  1297. +<center><font color=F2F5A9>Teleport to your party member:</font>
  1298. +<center><edit var="val" width=120></td>
  1299. +<td fixwidth=50>
  1300. +</td>
  1301. +</tr>
  1302. +</table>
  1303. +
  1304. +<table width=300 height=32 bgcolor=000000>
  1305. +<tr>
  1306. +<td fixwidth=5>
  1307. +</td>
  1308. +<td fixwidth=32 height=42>
  1309. +<button action="bypass -h clantp_clantp $clan" value="" value="" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill1429">
  1310. +</td>
  1311. +<td fixwidth=250>
  1312. +<center><font color=F2F5A9>Teleport to your clan member:</font>
  1313. +<center><edit var="clan" width=120></td>
  1314. +<td fixwidth=50>
  1315. +</td>
  1316. +</tr>
  1317. +</table>
  1318. +</body></html>
  1319. \ No newline at end of file
  1320. Index: data/xml/items/3400-3499.xml
  1321. ===================================================================
  1322. --- data/xml/items/3400-3499.xml    (revision 5)
  1323. +++ data/xml/items/3400-3499.xml    (working copy)
  1324. @@ -595,6 +595,7 @@
  1325.         <set name="material" val="STEEL" />
  1326.         <set name="price" val="200" />
  1327.         <set name="is_stackable" val="true" />
  1328. +       <set name="handler" val="VipStatusItem" />
  1329.     </item>
  1330.     <item id="3482" type="EtcItem" name="Gold Wyvern">
  1331.         <set name="material" val="STEEL" />
  1332. Index: data/html/mods/vipNpc/50009.htm
  1333. ===================================================================
  1334. --- data/html/mods/vipNpc/50009.htm (nonexistent)
  1335. +++ data/html/mods/vipNpc/50009.htm (working copy)
  1336. @@ -0,0 +1,83 @@
  1337. +<html>
  1338. +<title>
  1339. +Donate Manager
  1340. +</title>
  1341. +<body>
  1342. +<br>
  1343. +
  1344. +<table width=300 height=32 bgcolor=000000>
  1345. +<tr>
  1346. +<td fixwidth=5>
  1347. +</td>
  1348. +<td fixwidth=32 height=42>
  1349. +<center><button action="bypass -h vip_vip $vip" value="" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill0106">
  1350. +</td>
  1351. +<td fixwidth=250>
  1352. +<br>
  1353. +<center><font color=F2F5A9>Vip Settings:</font>
  1354. +       <center><combobox width=120 height=17 var="vip" list=Noblesse;ChangeSex;CleanPk;FullRec;
  1355. +</td>
  1356. +<td fixwidth=50>
  1357. +</td>
  1358. +</tr>
  1359. +</table>
  1360. +
  1361. +<table width=300 height=32 bgcolor=000000>
  1362. +<tr>
  1363. +<td fixwidth=5>
  1364. +</td>
  1365. +<td fixwidth=32 height=42>
  1366. +       <center><button value="" action="bypass -h siege_siege $siege" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill0216">
  1367. +</td>
  1368. +<td fixwidth=250>
  1369. +<br>
  1370. +<center><font color=F2F5A9>Siege Services:</font>
  1371. +       <center><combobox width=120 height=17 var="siege" list=Gludio;Dion;Giran;Oren;Aden;Innadril;Goddard;Rune;Schuttgart;
  1372. +</td>
  1373. +<td fixwidth=50>
  1374. +</td>
  1375. +</tr>
  1376. +</table>
  1377. +
  1378. +<br>
  1379. +<center>
  1380. +Dear VIP player!<br1>
  1381. +From here you can go to your party member<br1>
  1382. +or you can also go to your clan member.<br1>
  1383. +Try it! It is easy only with one click.<br1>
  1384. +Conditions:<br1>
  1385. + <font color=FE642E>Olympiad</font>,<font color=FE642E> Duel</font>,<font color=FE642E> Events</font><br1>
  1386. +<font color=FE642E>Jail</font>,<font color=FE642E> Observer Mode</font>,<font color=FE642E> Siege</font><br1>
  1387. +<font color=FE642E>Flag</font> for yourself,<font color=FE642E> Karma</font> for yourself<font color=FE642E></font>.<br1>
  1388. +</center>
  1389. +
  1390. +<table width=300 height=32 bgcolor=000000>
  1391. +<tr>
  1392. +<td fixwidth=5>
  1393. +</td>
  1394. +<td fixwidth=32 height=42>
  1395. +<button action="bypass -h tp_tp $val" value="" value="" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill1429">
  1396. +</td>
  1397. +<td fixwidth=250>
  1398. +<center><font color=F2F5A9>Teleport to your party member:</font>
  1399. +<center><edit var="val" width=120></td>
  1400. +<td fixwidth=50>
  1401. +</td>
  1402. +</tr>
  1403. +</table>
  1404. +
  1405. +<table width=300 height=32 bgcolor=000000>
  1406. +<tr>
  1407. +<td fixwidth=5>
  1408. +</td>
  1409. +<td fixwidth=32 height=42>
  1410. +<button action="bypass -h clantp_clantp $clan" value="" value="" width=32 height=32 back="L2UI_CH3.Minimap.mapbutton_zoomin1" fore="icon.skill1429">
  1411. +</td>
  1412. +<td fixwidth=250>
  1413. +<center><font color=F2F5A9>Teleport to your clan member:</font>
  1414. +<center><edit var="clan" width=120></td>
  1415. +<td fixwidth=50>
  1416. +</td>
  1417. +</tr>
  1418. +</table>
  1419. +</body></html>
  1420. \ No newline at end of file
  1421. Index: data/xml/skills/2100-2199.xml
  1422. ===================================================================
  1423. --- data/xml/skills/2100-2199.xml   (revision 5)
  1424. +++ data/xml/skills/2100-2199.xml   (working copy)
  1425. @@ -1,8 +1,8 @@
  1426.  <?xml version='1.0' encoding='utf-8'?>
  1427.  <list>
  1428. -   <skill id="2100" levels="1" name="Escape: 1 second">
  1429. +   <skill id="2100" levels="1" name="Escape: 3 second">
  1430.         <set name="target" val="TARGET_SELF" />
  1431. -       <set name="hitTime" val="1000" />
  1432. +       <set name="hitTime" val="3000" />
  1433.         <set name="staticHitTime" val="true" />
  1434.         <set name="skillType" val="RECALL" />
  1435.         <set name="operateType" val="OP_ACTIVE" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement