Advertisement
Guest User

Untitled

a guest
Nov 11th, 2013
4,024
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 26.26 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GameServer
  3. Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/gameserver/model/L2Character.java    (revision 948)
  6. +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java    (working copy)
  7. @@ -339,6 +339,9 @@
  8.    
  9.     /** The Constant ZONE_DANGERAREA. */
  10.     public static final int ZONE_DANGERAREA = 16384;
  11. +  
  12. +   /** The Constant ZONE_MULTIFUNCTION. */
  13. +   public static final int ZONE_MULTIFUNCTION = 16385;
  14.  
  15.     /** The _current zones. */
  16.     private int _currentZones = 0;
  17. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecipeShopListSet.java
  18. ===================================================================
  19. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecipeShopListSet.java   (revision 948)
  20. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRecipeShopListSet.java   (working copy)
  21. @@ -19,9 +19,11 @@
  22.  package com.l2jfrozen.gameserver.network.clientpackets;
  23.  
  24.  import com.l2jfrozen.Config;
  25. +import com.l2jfrozen.gameserver.model.L2Character;
  26.  import com.l2jfrozen.gameserver.model.L2ManufactureItem;
  27.  import com.l2jfrozen.gameserver.model.L2ManufactureList;
  28.  import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  29. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  30.  import com.l2jfrozen.gameserver.network.SystemMessageId;
  31.  import com.l2jfrozen.gameserver.network.serverpackets.RecipeShopMsg;
  32.  import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
  33. @@ -64,6 +66,12 @@
  34.             player.sendPacket(new SystemMessage(SystemMessageId.CANT_CRAFT_DURING_COMBAT));
  35.             return;
  36.         }
  37. +      
  38. +       if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.store_zone)
  39. +       {
  40. +           player.sendMessage("You cannot craft while inside Multifunction zone.");
  41. +           return;
  42. +       }
  43.  
  44.         if(player.isTradeDisabled())
  45.         {
  46. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java
  47. ===================================================================
  48. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java (revision 948)
  49. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestRestart.java (working copy)
  50. @@ -25,10 +25,12 @@
  51.  import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager;
  52.  import com.l2jfrozen.gameserver.datatables.SkillTable;
  53.  import com.l2jfrozen.gameserver.model.Inventory;
  54. +import com.l2jfrozen.gameserver.model.L2Character;
  55.  import com.l2jfrozen.gameserver.model.L2Party;
  56.  import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  57.  import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
  58.  import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival;
  59. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  60.  import com.l2jfrozen.gameserver.network.L2GameClient;
  61.  import com.l2jfrozen.gameserver.network.L2GameClient.GameClientState;
  62.  import com.l2jfrozen.gameserver.network.SystemMessageId;
  63. @@ -103,6 +105,13 @@
  64.             sendPacket(RestartResponse.valueOf(false));
  65.             return;
  66.         }
  67. +      
  68. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.restart_zone)
  69. +       {
  70. +           player.sendMessage("You cannot restart while inside a Multifunction zone.");
  71. +           sendPacket(RestartResponse.valueOf(false));
  72. +           return;
  73. +       }
  74.  
  75.         // Check if player is in away mode
  76.         if(player.isAway())
  77. Index: config/MultiFunctionZone.properties
  78. ===================================================================
  79. --- config/MultiFunctionZone.properties (revision 0)
  80. +++ config/MultiFunctionZone.properties (revision 0)
  81. @@ -0,0 +1,60 @@
  82. +# ---------------------------------------------------------------------------
  83. +# MultiFunctionZone - custom addon for your server
  84. +# ---------------------------------------------------------------------------
  85. +# This option will turn on PvP flag to all people when entering to the zone
  86. +EnablePvP = True
  87. +
  88. +# If set to false, zone will be no-restart zone
  89. +NoRestartZone = False
  90. +
  91. +# If set to false, zone will be no-logout zone
  92. +NoLogoutZone = False
  93. +
  94. +# If set to false, zone will be no-store zone
  95. +NoStoreZone = False
  96. +
  97. +# Give noblesse after revive?
  98. +ReviveNoblesse = False
  99. +
  100. +# Heal after revive?
  101. +ReviveHeal = False
  102. +
  103. +# Delay, in seconds, to wait before revive
  104. +# 0 to disable
  105. +ReviveDelay = 10
  106. +
  107. +# Set the spawn points where players will be teleported on revive, if enabled
  108. +# example:150111,144740,-12248;143665,144418,-12022;144443,147685,-12139
  109. +SpawnLoc = 150111,144740,-12248;143665,144418,-12022;144443,147685,-12139
  110. +
  111. +# Random respawn radius
  112. +RespawnRadius = 500
  113. +
  114. +# If set to true, players will take noblesse blessing when entering
  115. +GiveNoblesse = True
  116. +
  117. +# Remove buffs when entering to the zone
  118. +RemoveBuffs = False
  119. +
  120. +# Remove pets when entering to the zone
  121. +RemovePets = False
  122. +
  123. +# Special rewards when hunting inside this zone
  124. +# example: 57,100000;14720,1
  125. +Rewards = 57,100000;14720,1
  126. +
  127. +# List of Items(id's) that won't be usable inside this area and also will be unequiped when entering
  128. +# (armor, weapons, scrolls, potions, etc), example: 728,7575, 6383, 1538
  129. +Items = 728,7575,6383,1538
  130. +
  131. +# List of Grades that won't be usable inside this area and also will be unequiped when entering
  132. +# example: D,C,B,A,S,S80,S84
  133. +Grades = C,B,A
  134. +
  135. +# Items with this enchant or more won't be usable inside this area and also will be unequiped when entering
  136. +# 0 to disable
  137. +Enchant = 0
  138. +
  139. +# Players with one of that classes won't be able to enter to the zone
  140. +# example: 93,85,12
  141. +Classes = 92
  142. \ No newline at end of file
  143. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java
  144. ===================================================================
  145. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java (revision 948)
  146. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/Logout.java (working copy)
  147. @@ -19,10 +19,12 @@
  148. import com.l2jfrozen.Config;
  149. import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager;
  150. import com.l2jfrozen.gameserver.datatables.SkillTable;
  151. +import com.l2jfrozen.gameserver.model.L2Character;
  152. import com.l2jfrozen.gameserver.model.L2Party;
  153. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  154. import com.l2jfrozen.gameserver.model.entity.olympiad.Olympiad;
  155. import com.l2jfrozen.gameserver.model.entity.sevensigns.SevenSignsFestival;
  156. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  157. import com.l2jfrozen.gameserver.network.SystemMessageId;
  158. import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
  159. import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
  160. @@ -50,6 +52,13 @@
  161.             player.sendPacket(ActionFailed.STATIC_PACKET);
  162.             return;
  163.         }
  164. +      
  165. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.logout_zone)
  166. +       {
  167. +           player.sendMessage("You cannot Logout while inside a Multifunction zone.");
  168. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  169. +           return;
  170. +       }
  171.  
  172.         if (player.isAway())
  173.         {
  174. Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
  175. ===================================================================
  176. --- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java  (revision 948)
  177. +++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java  (working copy)
  178. @@ -58,6 +58,7 @@
  179. import com.l2jfrozen.gameserver.model.zone.type.L2FortZone;
  180. import com.l2jfrozen.gameserver.model.zone.type.L2JailZone;
  181. import com.l2jfrozen.gameserver.model.zone.type.L2MotherTreeZone;
  182. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  183. import com.l2jfrozen.gameserver.model.zone.type.L2NoHqZone;
  184. import com.l2jfrozen.gameserver.model.zone.type.L2NoLandingZone;
  185. import com.l2jfrozen.gameserver.model.zone.type.L2OlympiadStadiumZone;
  186. @@ -240,6 +241,10 @@
  187.                                 {
  188.                                     temp = new L2NoHqZone(zoneId);
  189.                                 }
  190. +                               else if(zoneType.equals("MultiFunctionZone"))
  191. +                               {
  192. +                                   temp = new L2MultiFunctionZone(zoneId);
  193. +                               }
  194.                                 else if(zoneType.equals("BossZone"))
  195.                                 {
  196.                                     int boss_id = -1;
  197. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java
  198. ===================================================================
  199. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java    (revision 948)
  200. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/UseItem.java    (working copy)
  201. @@ -29,10 +29,12 @@
  202. import com.l2jfrozen.gameserver.managers.CastleManager;
  203. import com.l2jfrozen.gameserver.managers.ClanHallManager;
  204. import com.l2jfrozen.gameserver.model.Inventory;
  205. +import com.l2jfrozen.gameserver.model.L2Character;
  206. import com.l2jfrozen.gameserver.model.L2Clan;
  207. import com.l2jfrozen.gameserver.model.L2Object;
  208. import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  209. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  210. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  211. import com.l2jfrozen.gameserver.network.SystemMessageId;
  212. import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
  213. import com.l2jfrozen.gameserver.network.serverpackets.EtcStatusUpdate;
  214. @@ -95,6 +97,11 @@
  215.         if(item == null)
  216.             return;
  217.  
  218. +       if(getClient().getActiveChar().isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.checkItem(item))
  219. +       {
  220. +           getClient().getActiveChar().sendMessage("You cannot use "+item.getName()+" inside this zone.");
  221. +           return;
  222. +       }
  223.         if(item.isWear())
  224.             // No unequipping wear-items
  225.             return;
  226. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java
  227. ===================================================================
  228. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java    (revision 948)
  229. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListSell.java    (working copy)
  230. @@ -19,8 +19,10 @@
  231. package com.l2jfrozen.gameserver.network.clientpackets;
  232.  
  233. import com.l2jfrozen.Config;
  234. +import com.l2jfrozen.gameserver.model.L2Character;
  235. import com.l2jfrozen.gameserver.model.TradeList;
  236. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  237. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  238. import com.l2jfrozen.gameserver.network.SystemMessageId;
  239. import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
  240. import com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListSell;
  241. @@ -96,6 +98,13 @@
  242.             player.sendPacket(new PrivateStoreManageListSell(player));
  243.             return;
  244.         }
  245. +      
  246. +       if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.store_zone)
  247. +       {
  248. +           player.sendPacket(new PrivateStoreManageListSell(player));
  249. +           player.sendMessage("You cannot start store while inside Multifunction zone.");
  250. +           return;
  251. +       }
  252.  
  253.         TradeList tradeList = player.getSellList();
  254.         tradeList.clear();
  255. Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2MultiFunctionZone.java
  256. ===================================================================
  257. --- head-src/com/l2jfrozen/gameserver/model/zone/type/L2MultiFunctionZone.java  (revision 0)
  258. +++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2MultiFunctionZone.java  (revision 0)
  259. @@ -0,0 +1,342 @@
  260. +/*
  261. + * This program is free software: you can redistribute it and/or modify it under
  262. + * the terms of the GNU General Public License as published by the Free Software
  263. + * Foundation, either version 3 of the License, or (at your option) any later
  264. + * version.
  265. + *
  266. + * This program is distributed in the hope that it will be useful, but WITHOUT
  267. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  268. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  269. + * details.
  270. + *
  271. + * You should have received a copy of the GNU General Public License along with
  272. + * this program. If not, see <http://www.gnu.org/licenses/>.
  273. + */
  274. +/*
  275. + * This program is free software: you can redistribute it and/or modify it under
  276. + * the terms of the GNU General Public License as published by the Free Software
  277. + * Foundation, either version 3 of the License, or (at your option) any later
  278. + * version.
  279. + *
  280. + * This program is distributed in the hope that it will be useful, but WITHOUT
  281. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  282. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  283. + * details.
  284. + *
  285. + * You should have received a copy of the GNU General Public License along with
  286. + * this program. If not, see <http://www.gnu.org/licenses/>.
  287. + */
  288. +package com.l2jfrozen.gameserver.model.zone.type;
  289. +
  290. +import java.io.File;
  291. +import java.io.FileInputStream;
  292. +import java.util.ArrayList;
  293. +import java.util.List;
  294. +import java.util.Properties;
  295. +import com.l2jfrozen.gameserver.datatables.SkillTable;
  296. +import com.l2jfrozen.gameserver.model.L2Character;
  297. +import com.l2jfrozen.gameserver.model.L2Skill;
  298. +import com.l2jfrozen.gameserver.model.L2Summon;
  299. +import com.l2jfrozen.gameserver.model.PcInventory;
  300. +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
  301. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  302. +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
  303. +import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  304. +import com.l2jfrozen.util.random.Rnd;
  305. +import javolution.util.FastList;
  306. +
  307. +/**
  308. + *
  309. + * @author Wyatt
  310. + * @version 1.3
  311. + *
  312. + */
  313. +
  314. +public class L2MultiFunctionZone extends L2ZoneType
  315. +{
  316. +  
  317. +   public L2MultiFunctionZone(int id)
  318. +   {
  319. +       super(id);
  320. +       loadConfigs();
  321. +   }
  322. +  
  323. +   public static boolean pvp_enabled, restart_zone, store_zone, logout_zone, revive_noblesse, revive_heal, revive, remove_buffs, remove_pets, give_noblesse;
  324. +   static int radius, enchant, revive_delay;
  325. +   static int[][] spawn_loc;
  326. +   L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
  327. +   private static List<String> items = new FastList<String>();
  328. +   private static List<String> classes = new FastList<String>(), grades = new FastList<String>();
  329. +   public static List<int[]> rewards = new ArrayList<int[]>();
  330. +   static String[] gradeNames = {"","D","C","B","A","S","S80","S84"};
  331. +  
  332. +  
  333. +   @Override
  334. +   protected void onEnter(L2Character character)
  335. +   {
  336. +       character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
  337. +       character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, true);
  338. +      
  339. +       if (character instanceof L2PcInstance)
  340. +       {
  341. +           L2PcInstance activeChar = ((L2PcInstance) character);
  342. +           if(classes != null && classes.contains(""+activeChar.getClassId().getId()))
  343. +           {
  344. +               activeChar.teleToLocation(83597,147888,-3405);
  345. +               activeChar.sendMessage("Your class is not allowed in the MultiFunction zone.");
  346. +               return;
  347. +           }
  348. +          
  349. +           for(L2ItemInstance o : activeChar.getInventory()._items)
  350. +           {
  351. +               if(o.isEquipable() && o.isEquipped() && !checkItem(o))
  352. +               {
  353. +                   int slot = activeChar.getInventory().getSlotFromItem(o);
  354. +                   activeChar.getInventory().unEquipItemInBodySlotAndRecord(slot);
  355. +                   activeChar.sendMessage(o.getItemName()+" unequiped because is not allowed inside this zone.");
  356. +               }
  357. +           }
  358. +           activeChar.sendMessage("You entered in a MultiFunction zone.");
  359. +           clear(activeChar);
  360. +           if(give_noblesse)
  361. +               noblesse.getEffects(activeChar, activeChar);  
  362. +           if(pvp_enabled)
  363. +               activeChar.updatePvPFlag(1);               
  364. +       }
  365. +   }
  366. +  
  367. +   @Override
  368. +   protected void onExit(L2Character character)
  369. +   {
  370. +       character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
  371. +       character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, false);
  372. +      
  373. +       if (character instanceof L2PcInstance)
  374. +       {
  375. +           L2PcInstance activeChar = ((L2PcInstance) character);
  376. +           activeChar.sendMessage("You left from a MultiFunction zone.");
  377. +          
  378. +           if(pvp_enabled)
  379. +               activeChar.stopPvPFlag();  
  380. +       }
  381. +   }
  382. +  
  383. +   @Override
  384. +   public void onDieInside(final L2Character character)
  385. +   {
  386. +       if (character instanceof L2PcInstance)
  387. +       {
  388. +           final L2PcInstance activeChar = ((L2PcInstance) character);
  389. +           if(revive)
  390. +           {
  391. +               ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  392. +               {
  393. +                   @Override
  394. +                   public void run()
  395. +                   {
  396. +                       activeChar.doRevive();
  397. +                       heal(activeChar);
  398. +                       int[] loc = spawn_loc[Rnd.get(spawn_loc.length)];
  399. +                       activeChar.teleToLocation(loc[0]+Rnd.get(-radius,radius), loc[1]+Rnd.get(-radius,radius), loc[2]);
  400. +                   }
  401. +               },revive_delay*1000);  
  402. +           }
  403. +       }
  404. +   }
  405. +
  406. +   @Override
  407. +   public void onReviveInside(L2Character character)
  408. +   {  
  409. +       if (character instanceof L2PcInstance)
  410. +       {
  411. +           L2PcInstance activeChar = ((L2PcInstance) character);
  412. +           if(revive_noblesse)
  413. +               noblesse.getEffects(activeChar, activeChar);  
  414. +           if(revive_heal)
  415. +               heal(activeChar);
  416. +       }
  417. +   }
  418. +  
  419. +   static void heal(L2PcInstance activeChar)
  420. +   {
  421. +       activeChar.setCurrentHp(activeChar.getMaxHp());
  422. +       activeChar.setCurrentCp(activeChar.getMaxCp());
  423. +       activeChar.setCurrentMp(activeChar.getMaxMp());
  424. +   }
  425. +  
  426. +   private void clear (L2PcInstance player)
  427. +   {
  428. +       if(remove_buffs)
  429. +       {
  430. +           player.stopAllEffects();
  431. +           if(remove_pets)
  432. +           {
  433. +               L2Summon pet = player.getPet();
  434. +               if(pet!= null)
  435. +               {
  436. +                   pet.stopAllEffects();
  437. +                   pet.unSummon(player);  
  438. +               }  
  439. +           }
  440. +       }
  441. +       else
  442. +       {
  443. +           if(remove_pets)
  444. +           {
  445. +               L2Summon pet = player.getPet();
  446. +               if(pet!= null)
  447. +               {
  448. +                   pet.unSummon(player);  
  449. +               }  
  450. +           }
  451. +       }
  452. +   }
  453. +  
  454. +   public static void givereward(L2PcInstance player)
  455. +   {
  456. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION))
  457. +       {
  458. +           for (int[] reward : rewards)
  459. +           {
  460. +               PcInventory inv = player.getInventory();
  461. +               inv.addItem("Custom Reward", reward[0], reward[1], player,  player);   
  462. +           }
  463. +       }
  464. +   }
  465. +  
  466. +   public static boolean checkItem (L2ItemInstance item)
  467. +   {
  468. +       int o = item.getItem().getCrystalType();
  469. +       int e = item.getEnchantLevel();
  470. +      
  471. +       if(enchant != 0 && e >= enchant)
  472. +       {
  473. +           return false;
  474. +       }
  475. +      
  476. +       if(grades.contains(gradeNames[o]))
  477. +           return false;
  478. +
  479. +       if(items != null && items.contains(""+item.getItemId()))
  480. +           return false;
  481. +       return true;
  482. +   }
  483. +  
  484. +   private static void loadConfigs()
  485. +   {
  486. +       try
  487. +       {
  488. +           Properties prop = new Properties();
  489. +           prop.load(new FileInputStream(new File("./config/MultiFunctionZone.properties")));
  490. +           pvp_enabled = Boolean.parseBoolean(prop.getProperty("EnablePvP", "False"));
  491. +           spawn_loc = parseItemsList(prop.getProperty("SpawnLoc", "150111,144740,-12248"));
  492. +           revive_delay = Integer.parseInt(prop.getProperty("ReviveDelay", "10"));
  493. +           if(revive_delay != 0)
  494. +           {
  495. +               revive = true;
  496. +           }
  497. +           give_noblesse = Boolean.parseBoolean(prop.getProperty("GiveNoblesse", "False"));
  498. +           String[] propertySplit = prop.getProperty("Items", "").split(",");
  499. +           if (propertySplit.length != 0)
  500. +           {
  501. +               for(String i : propertySplit)
  502. +               {
  503. +                   items.add(i);
  504. +               }
  505. +           }
  506. +           propertySplit = prop.getProperty("Grades", "").split(",");
  507. +           if (propertySplit.length != 0)
  508. +           {
  509. +               for(String i : propertySplit)
  510. +               {
  511. +                   if(i.equals("D") || i.equals("C") || i.equals("B") || i.equals("A") || i.equals("S") || i.equals("S80") || i.equals("S84"))
  512. +                       grades.add(i);
  513. +               }
  514. +           }
  515. +           propertySplit = prop.getProperty("Classes", "").split(",");
  516. +           if (propertySplit.length != 0)
  517. +           {
  518. +               for(String i : propertySplit)
  519. +               {
  520. +                   classes.add(i);
  521. +               }
  522. +           }
  523. +           radius =  Integer.parseInt(prop.getProperty("RespawnRadius", "500"));
  524. +           enchant =  Integer.parseInt(prop.getProperty("Enchant", "0"));
  525. +           remove_buffs = Boolean.parseBoolean(prop.getProperty("RemoveBuffs", "False"));
  526. +           remove_pets = Boolean.parseBoolean(prop.getProperty("RemovePets", "False"));
  527. +           restart_zone = Boolean.parseBoolean(prop.getProperty("NoRestartZone", "False"));
  528. +           store_zone = Boolean.parseBoolean(prop.getProperty("NoStoreZone", "False"));
  529. +           logout_zone = Boolean.parseBoolean(prop.getProperty("NoLogoutZone", "False"));
  530. +           revive_noblesse = Boolean.parseBoolean(prop.getProperty("ReviveNoblesse", "False"));
  531. +           revive_heal = Boolean.parseBoolean(prop.getProperty("ReviveHeal", "False"));   
  532. +           propertySplit = prop.getProperty("Rewards", "57,100000").split(";");
  533. +           for (String reward : propertySplit)
  534. +           {
  535. +               String[] rewardSplit = reward.split(",");
  536. +               if (rewardSplit.length == 2)
  537. +               {
  538. +                   try
  539. +                   {
  540. +                       rewards.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  541. +                   }
  542. +                   catch (NumberFormatException nfe)
  543. +                   {
  544. +                   }
  545. +               }
  546. +           }
  547. +       }
  548. +       catch(Exception e)
  549. +       {
  550. +           e.printStackTrace();
  551. +       }
  552. +   }  
  553. +  
  554. +   private static int[][] parseItemsList(String line)
  555. +   {
  556. +       final String[] propertySplit = line.split(";");
  557. +       if (propertySplit.length == 0)
  558. +           return null;
  559. +
  560. +       int i = 0;
  561. +       String[] valueSplit;
  562. +       final int[][] result = new int[propertySplit.length][];
  563. +       for (String value : propertySplit)
  564. +       {
  565. +           valueSplit = value.split(",");
  566. +           if (valueSplit.length != 3)
  567. +           {
  568. +               return null;
  569. +           }
  570. +
  571. +           result[i] = new int[3];
  572. +           try
  573. +           {
  574. +               result[i][0] = Integer.parseInt(valueSplit[0]);
  575. +           }
  576. +           catch (NumberFormatException e)
  577. +           {
  578. +               return null;
  579. +           }
  580. +           try
  581. +           {
  582. +               result[i][1] = Integer.parseInt(valueSplit[1]);
  583. +           }
  584. +           catch (NumberFormatException e)
  585. +           {
  586. +               return null;
  587. +           }
  588. +           try
  589. +           {
  590. +               result[i][2] = Integer.parseInt(valueSplit[2]);
  591. +           }
  592. +           catch (NumberFormatException e)
  593. +           {
  594. +               return null;
  595. +           }
  596. +           i++;
  597. +       }
  598. +       return result;
  599. +   }
  600. +}
  601. \ No newline at end of file
  602. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  603. ===================================================================
  604. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (revision 948)
  605. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  606. @@ -151,6 +151,7 @@
  607. import com.l2jfrozen.gameserver.model.extender.BaseExtender.EventType;
  608. import com.l2jfrozen.gameserver.model.quest.Quest;
  609. import com.l2jfrozen.gameserver.model.quest.QuestState;
  610. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  611. import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
  612. import com.l2jfrozen.gameserver.network.L2GameClient;
  613. import com.l2jfrozen.gameserver.network.SystemMessageId;
  614. @@ -274,6 +275,8 @@
  615.    
  616.     /** The _vote timestamp. */
  617.     private long _voteTimestamp = 0;
  618. +  
  619. +   public int counter = 0;
  620.  
  621.     /** The _posticipate sit. */
  622.     private boolean _posticipateSit;
  623. @@ -7990,6 +7993,8 @@
  624.        
  625.         // Add karma to attacker and increase its PK counter
  626.         setPvpKills(getPvpKills() + 1);
  627. +      
  628. +       L2MultiFunctionZone.givereward(this);
  629.  
  630.          // Increase the kill count for a special hero aura
  631.          heroConsecutiveKillCount++;
  632. Index: head-src/com/l2jfrozen/gameserver/model/ItemContainer.java
  633. ===================================================================
  634. --- head-src/com/l2jfrozen/gameserver/model/ItemContainer.java  (revision 948)
  635. +++ head-src/com/l2jfrozen/gameserver/model/ItemContainer.java  (working copy)
  636. @@ -44,7 +44,7 @@
  637. {
  638.     protected static final Logger _log = Logger.getLogger(ItemContainer.class.getName());
  639.  
  640. -   protected final List<L2ItemInstance> _items;
  641. +   public final List<L2ItemInstance> _items;
  642.  
  643.     protected ItemContainer()
  644.     {
  645. Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
  646. ===================================================================
  647. --- head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java    (revision 948)
  648. +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java    (working copy)
  649. @@ -31,6 +31,7 @@
  650. import com.l2jfrozen.gameserver.model.entity.event.TvT;
  651. import com.l2jfrozen.gameserver.model.entity.siege.Castle;
  652. import com.l2jfrozen.gameserver.model.entity.siege.Fort;
  653. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  654.  
  655. /**
  656.  * sample 0b 952a1048 objectId 00000000 00000000 00000000 00000000 00000000 00000000 format dddddd rev 377 format
  657. @@ -64,7 +65,8 @@
  658.                             || (DM.is_started() && player._inEventDM)
  659.                             || (CTF.is_started() && player._inEventCTF)
  660.                             || player.isInFunEvent()
  661. -                           || player.isPendingRevive());
  662. +                           || player.isPendingRevive()
  663. +                           || (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && L2MultiFunctionZone.revive));
  664.         }
  665.         _charObjId = cha.getObjectId();
  666.         _fake = !cha.isDead();
  667. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
  668. ===================================================================
  669. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 948)
  670. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy)
  671. @@ -19,8 +19,10 @@
  672. package com.l2jfrozen.gameserver.network.clientpackets;
  673.  
  674. import com.l2jfrozen.Config;
  675. +import com.l2jfrozen.gameserver.model.L2Character;
  676. import com.l2jfrozen.gameserver.model.TradeList;
  677. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  678. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  679. import com.l2jfrozen.gameserver.network.SystemMessageId;
  680. import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
  681. import com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListBuy;
  682. @@ -95,6 +97,13 @@
  683.             player.sendPacket(new PrivateStoreManageListBuy(player));
  684.             return;
  685.         }
  686. +      
  687. +       if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.store_zone)
  688. +       {
  689. +           player.sendPacket(new PrivateStoreManageListBuy(player));
  690. +           player.sendMessage("You cannot start store while inside Multifunction zone.");
  691. +           return;
  692. +       }
  693.  
  694.         TradeList tradeList = player.getBuyList();
  695.         tradeList.clear();
  696.  
  697. ### Eclipse Workspace Patch 1.0
  698. #P L2jFrozen_DataPack
  699. Index: data/zones/zone.xml
  700. ===================================================================
  701. --- data/zones/zone.xml (revision 948)
  702. +++ data/zones/zone.xml (working copy)
  703. @@ -4489,4 +4489,10 @@
  704.         <node X="-85870" Y="-46233" />
  705.         <node X="-86090" Y="-46061" />
  706.     </zone>
  707. +   <zone id="16385" name="Custom" type="MultiFunctionZone" shape="NPoly" minZ="-15000" maxZ="-10000">
  708. +       <node X="130000" Y="160000" />
  709. +       <node X="130000" Y="130000" />
  710. +       <node X="160000" Y="130000" />
  711. +       <node X="160000" Y="160000" />
  712. +   </zone>
  713. </list>
  714. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement