Guest User

L2MultiFunctionZone by Wyatt, Interlude V1.2

a guest
Sep 15th, 2012
1,281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 26.32 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.2
  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>();
  329. +   private static List<String> grades = new FastList<String>();
  330. +   public static List<int[]> rewards = new ArrayList<int[]>();
  331. +   static String[] gradeNames = {"","D","C","B","A","S","S80","S84"};
  332. +  
  333. +  
  334. +   @Override
  335. +   protected void onEnter(L2Character character)
  336. +   {
  337. +       character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
  338. +       character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, true);
  339. +      
  340. +       if (character instanceof L2PcInstance)
  341. +       {
  342. +           L2PcInstance activeChar = ((L2PcInstance) character);
  343. +           if(classes != null && classes.contains(""+activeChar.getClassId().getId()))
  344. +           {
  345. +               activeChar.teleToLocation(83597,147888,-3405);
  346. +               activeChar.sendMessage("Your class is not allowed in the MultiFunction zone.");
  347. +               return;
  348. +           }
  349. +          
  350. +           for(L2ItemInstance o : activeChar.getInventory()._items)
  351. +           {
  352. +               if(o.isEquipable() && o.isEquipped() && !checkItem(o))
  353. +               {
  354. +                   int slot = activeChar.getInventory().getSlotFromItem(o);
  355. +                   activeChar.getInventory().unEquipItemInBodySlotAndRecord(slot);
  356. +                   activeChar.sendMessage(o.getItemName()+" unequiped because is not allowed inside this zone.");
  357. +               }
  358. +           }
  359. +           activeChar.sendMessage("You entered in a MultiFunction zone.");
  360. +           clear(activeChar);
  361. +           if(give_noblesse)
  362. +               noblesse.getEffects(activeChar, activeChar);  
  363. +           if(pvp_enabled && activeChar.getPvpFlag() == 0)
  364. +               activeChar.updatePvPFlag(1);               
  365. +       }
  366. +   }
  367. +  
  368. +   @Override
  369. +   protected void onExit(L2Character character)
  370. +   {
  371. +       character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
  372. +       character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, false);
  373. +      
  374. +       if (character instanceof L2PcInstance)
  375. +       {
  376. +           L2PcInstance activeChar = ((L2PcInstance) character);
  377. +           activeChar.sendMessage("You left from a MultiFunction zone.");
  378. +          
  379. +           if(pvp_enabled)
  380. +               activeChar.stopPvPFlag();  
  381. +       }
  382. +   }
  383. +  
  384. +   @Override
  385. +   public void onDieInside(final L2Character character)
  386. +   {
  387. +       if (character instanceof L2PcInstance)
  388. +       {
  389. +           final L2PcInstance activeChar = ((L2PcInstance) character);
  390. +           if(revive)
  391. +           {
  392. +               ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  393. +               {
  394. +                   @Override
  395. +                   public void run()
  396. +                   {
  397. +                       activeChar.doRevive();
  398. +                       heal(activeChar);
  399. +                       int[] loc = spawn_loc[Rnd.get(spawn_loc.length)];
  400. +                       activeChar.teleToLocation(loc[0]+Rnd.get(-radius,radius), loc[1]+Rnd.get(-radius,radius), loc[2]);
  401. +                   }
  402. +               },revive_delay*1000);  
  403. +           }
  404. +       }
  405. +   }
  406. +
  407. +   @Override
  408. +   public void onReviveInside(L2Character character)
  409. +   {  
  410. +       if (character instanceof L2PcInstance)
  411. +       {
  412. +           L2PcInstance activeChar = ((L2PcInstance) character);
  413. +           if(revive_noblesse)
  414. +               noblesse.getEffects(activeChar, activeChar);  
  415. +           if(revive_heal)
  416. +               heal(activeChar);
  417. +       }
  418. +   }
  419. +  
  420. +   static void heal(L2PcInstance activeChar)
  421. +   {
  422. +       activeChar.setCurrentHp(activeChar.getMaxHp());
  423. +       activeChar.setCurrentCp(activeChar.getMaxCp());
  424. +       activeChar.setCurrentMp(activeChar.getMaxMp());
  425. +   }
  426. +  
  427. +   private void clear (L2PcInstance player)
  428. +   {
  429. +       if(remove_buffs)
  430. +       {
  431. +           player.stopAllEffects();
  432. +           if(remove_pets)
  433. +           {
  434. +               L2Summon pet = player.getPet();
  435. +               if(pet!= null)
  436. +               {
  437. +                   pet.stopAllEffects();
  438. +                   pet.unSummon(player);  
  439. +               }  
  440. +           }
  441. +       }
  442. +       else
  443. +       {
  444. +           if(remove_pets)
  445. +           {
  446. +               L2Summon pet = player.getPet();
  447. +               if(pet!= null)
  448. +               {
  449. +                   pet.unSummon(player);  
  450. +               }  
  451. +           }
  452. +       }
  453. +   }
  454. +  
  455. +   public static void givereward(L2PcInstance player)
  456. +   {
  457. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION))
  458. +       {
  459. +           for (int[] reward : rewards)
  460. +           {
  461. +               PcInventory inv = player.getInventory();
  462. +               inv.addItem("Custom Reward", reward[0], reward[1], player,  player);   
  463. +           }
  464. +       }
  465. +   }
  466. +  
  467. +   public static boolean checkItem (L2ItemInstance item)
  468. +   {
  469. +       int o = item.getItem().getCrystalType();
  470. +       int e = item.getEnchantLevel();
  471. +      
  472. +       if(enchant != 0 && e >= enchant)
  473. +       {
  474. +           return false;
  475. +       }
  476. +      
  477. +       if(grades.contains(gradeNames[o]))
  478. +           return false;
  479. +
  480. +       if(items != null && items.contains(""+item.getItemId()))
  481. +           return false;
  482. +       return true;
  483. +   }
  484. +  
  485. +   private static void loadConfigs()
  486. +   {
  487. +       try
  488. +       {
  489. +           Properties prop = new Properties();
  490. +           prop.load(new FileInputStream(new File("./config/MultiFunctionZone.properties")));
  491. +           pvp_enabled = Boolean.parseBoolean(prop.getProperty("EnablePvP", "False"));
  492. +           spawn_loc = parseItemsList(prop.getProperty("SpawnLoc", "150111,144740,-12248"));
  493. +           revive_delay = Integer.parseInt(prop.getProperty("ReviveDelay", "10"));
  494. +           if(revive_delay != 0)
  495. +           {
  496. +               revive = true;
  497. +           }
  498. +           give_noblesse = Boolean.parseBoolean(prop.getProperty("GiveNoblesse", "False"));
  499. +           String[] propertySplit = prop.getProperty("Items", "").split(",");
  500. +           if (propertySplit.length != 0)
  501. +           {
  502. +               for(String i : propertySplit)
  503. +               {
  504. +                   items.add(i);
  505. +               }
  506. +           }
  507. +           propertySplit = prop.getProperty("Grades", "").split(",");
  508. +           if (propertySplit.length != 0)
  509. +           {
  510. +               for(String i : propertySplit)
  511. +               {
  512. +                   if(i.equals("D") || i.equals("C") || i.equals("B") || i.equals("A") || i.equals("S") || i.equals("S80") || i.equals("S84"))
  513. +                       grades.add(i);
  514. +               }
  515. +           }
  516. +           propertySplit = prop.getProperty("Classes", "").split(",");
  517. +           if (propertySplit.length != 0)
  518. +           {
  519. +               for(String i : propertySplit)
  520. +               {
  521. +                   classes.add(i);
  522. +               }
  523. +           }
  524. +           radius =  Integer.parseInt(prop.getProperty("RespawnRadius", "500"));
  525. +           enchant =  Integer.parseInt(prop.getProperty("Enchant", "0"));
  526. +           remove_buffs = Boolean.parseBoolean(prop.getProperty("RemoveBuffs", "False"));
  527. +           remove_pets = Boolean.parseBoolean(prop.getProperty("RemovePets", "False"));
  528. +           restart_zone = Boolean.parseBoolean(prop.getProperty("NoRestartZone", "False"));
  529. +           store_zone = Boolean.parseBoolean(prop.getProperty("NoStoreZone", "False"));
  530. +           logout_zone = Boolean.parseBoolean(prop.getProperty("NoLogoutZone", "False"));
  531. +           revive_noblesse = Boolean.parseBoolean(prop.getProperty("ReviveNoblesse", "False"));
  532. +           revive_heal = Boolean.parseBoolean(prop.getProperty("ReviveHeal", "False"));   
  533. +           propertySplit = prop.getProperty("Rewards", "57,100000").split(";");
  534. +           for (String reward : propertySplit)
  535. +           {
  536. +               String[] rewardSplit = reward.split(",");
  537. +               if (rewardSplit.length == 2)
  538. +               {
  539. +                   try
  540. +                   {
  541. +                       rewards.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  542. +                   }
  543. +                   catch (NumberFormatException nfe)
  544. +                   {
  545. +                   }
  546. +               }
  547. +           }
  548. +       }
  549. +       catch(Exception e)
  550. +       {
  551. +           e.printStackTrace();
  552. +       }
  553. +   }  
  554. +  
  555. +   private static int[][] parseItemsList(String line)
  556. +   {
  557. +       final String[] propertySplit = line.split(";");
  558. +       if (propertySplit.length == 0)
  559. +           return null;
  560. +
  561. +       int i = 0;
  562. +       String[] valueSplit;
  563. +       final int[][] result = new int[propertySplit.length][];
  564. +       for (String value : propertySplit)
  565. +       {
  566. +           valueSplit = value.split(",");
  567. +           if (valueSplit.length != 3)
  568. +           {
  569. +               return null;
  570. +           }
  571. +
  572. +           result[i] = new int[3];
  573. +           try
  574. +           {
  575. +               result[i][0] = Integer.parseInt(valueSplit[0]);
  576. +           }
  577. +           catch (NumberFormatException e)
  578. +           {
  579. +               return null;
  580. +           }
  581. +           try
  582. +           {
  583. +               result[i][1] = Integer.parseInt(valueSplit[1]);
  584. +           }
  585. +           catch (NumberFormatException e)
  586. +           {
  587. +               return null;
  588. +           }
  589. +           try
  590. +           {
  591. +               result[i][2] = Integer.parseInt(valueSplit[2]);
  592. +           }
  593. +           catch (NumberFormatException e)
  594. +           {
  595. +               return null;
  596. +           }
  597. +           i++;
  598. +       }
  599. +       return result;
  600. +   }
  601. +}
  602. \ No newline at end of file
  603. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  604. ===================================================================
  605. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (revision 948)
  606. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  607. @@ -151,6 +151,7 @@
  608. import com.l2jfrozen.gameserver.model.extender.BaseExtender.EventType;
  609. import com.l2jfrozen.gameserver.model.quest.Quest;
  610. import com.l2jfrozen.gameserver.model.quest.QuestState;
  611. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  612. import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;
  613. import com.l2jfrozen.gameserver.network.L2GameClient;
  614. import com.l2jfrozen.gameserver.network.SystemMessageId;
  615. @@ -274,6 +275,8 @@
  616.    
  617.     /** The _vote timestamp. */
  618.     private long _voteTimestamp = 0;
  619. +  
  620. +   public int counter = 0;
  621.  
  622.     /** The _posticipate sit. */
  623.     private boolean _posticipateSit;
  624. @@ -7990,6 +7993,8 @@
  625.        
  626.         // Add karma to attacker and increase its PK counter
  627.         setPvpKills(getPvpKills() + 1);
  628. +      
  629. +       L2MultiFunctionZone.givereward(this);
  630.  
  631.          // Increase the kill count for a special hero aura
  632.          heroConsecutiveKillCount++;
  633. Index: head-src/com/l2jfrozen/gameserver/model/ItemContainer.java
  634. ===================================================================
  635. --- head-src/com/l2jfrozen/gameserver/model/ItemContainer.java  (revision 948)
  636. +++ head-src/com/l2jfrozen/gameserver/model/ItemContainer.java  (working copy)
  637. @@ -44,7 +44,7 @@
  638. {
  639.     protected static final Logger _log = Logger.getLogger(ItemContainer.class.getName());
  640.  
  641. -   protected final List<L2ItemInstance> _items;
  642. +   public final List<L2ItemInstance> _items;
  643.  
  644.     protected ItemContainer()
  645.     {
  646. Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java
  647. ===================================================================
  648. --- head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java    (revision 948)
  649. +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/Die.java    (working copy)
  650. @@ -31,6 +31,7 @@
  651. import com.l2jfrozen.gameserver.model.entity.event.TvT;
  652. import com.l2jfrozen.gameserver.model.entity.siege.Castle;
  653. import com.l2jfrozen.gameserver.model.entity.siege.Fort;
  654. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  655.  
  656. /**
  657.  * sample 0b 952a1048 objectId 00000000 00000000 00000000 00000000 00000000 00000000 format dddddd rev 377 format
  658. @@ -64,7 +65,8 @@
  659.                             || (DM.is_started() && player._inEventDM)
  660.                             || (CTF.is_started() && player._inEventCTF)
  661.                             || player.isInFunEvent()
  662. -                           || player.isPendingRevive());
  663. +                           || player.isPendingRevive()
  664. +                           || (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && L2MultiFunctionZone.revive));
  665.         }
  666.         _charObjId = cha.getObjectId();
  667.         _fake = !cha.isDead();
  668. Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
  669. ===================================================================
  670. --- head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (revision 948)
  671. +++ head-src/com/l2jfrozen/gameserver/network/clientpackets/SetPrivateStoreListBuy.java (working copy)
  672. @@ -19,8 +19,10 @@
  673. package com.l2jfrozen.gameserver.network.clientpackets;
  674.  
  675. import com.l2jfrozen.Config;
  676. +import com.l2jfrozen.gameserver.model.L2Character;
  677. import com.l2jfrozen.gameserver.model.TradeList;
  678. import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  679. +import com.l2jfrozen.gameserver.model.zone.type.L2MultiFunctionZone;
  680. import com.l2jfrozen.gameserver.network.SystemMessageId;
  681. import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
  682. import com.l2jfrozen.gameserver.network.serverpackets.PrivateStoreManageListBuy;
  683. @@ -95,6 +97,13 @@
  684.             player.sendPacket(new PrivateStoreManageListBuy(player));
  685.             return;
  686.         }
  687. +      
  688. +       if (player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.store_zone)
  689. +       {
  690. +           player.sendPacket(new PrivateStoreManageListBuy(player));
  691. +           player.sendMessage("You cannot start store while inside Multifunction zone.");
  692. +           return;
  693. +       }
  694.  
  695.         TradeList tradeList = player.getBuyList();
  696.         tradeList.clear();
  697.  
  698. ### Eclipse Workspace Patch 1.0
  699. #P L2jFrozen_DataPack
  700. Index: data/zones/zone.xml
  701. ===================================================================
  702. --- data/zones/zone.xml (revision 948)
  703. +++ data/zones/zone.xml (working copy)
  704. @@ -4489,4 +4489,10 @@
  705.         <node X="-85870" Y="-46233" />
  706.         <node X="-86090" Y="-46061" />
  707.     </zone>
  708. +   <zone id="16385" name="Custom" type="MultiFunctionZone" shape="NPoly" minZ="-15000" maxZ="-10000">
  709. +       <node X="130000" Y="160000" />
  710. +       <node X="130000" Y="130000" />
  711. +       <node X="160000" Y="130000" />
  712. +       <node X="160000" Y="160000" />
  713. +   </zone>
  714. </list>
  715. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment