Advertisement
Guest User

Vip

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