Guest User

Untitled

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