Advertisement
Guest User

VIP

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