Advertisement
Wyatt

L2MultiFunctionalZone - Freya - By Wyatt

Feb 14th, 2013
802
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 21.41 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P Core_Freya
  3. Index: java/com/l2jserver/gameserver/model/actor/L2Character.java
  4. ===================================================================
  5. --- java/com/l2jserver/gameserver/model/actor/L2Character.java  (revision 5631)
  6. +++ java/com/l2jserver/gameserver/model/actor/L2Character.java  (working copy)
  7. @@ -205,8 +205,9 @@
  8.     public static final byte ZONE_ALTERED = 19;
  9.     public static final byte ZONE_NOBOOKMARK = 20;
  10.     public static final byte ZONE_NOITEMDROP = 21;
  11. +   public static final byte ZONE_MULTIFUNCTION = 22;
  12.    
  13. -   private final byte[] _zones = new byte[22];
  14. +   private final byte[] _zones = new byte[23];
  15.     protected byte _zoneValidateCounter = 4;
  16.    
  17.     private L2Character _debugger = null;
  18. Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java
  19. ===================================================================
  20. --- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (revision 5631)
  21. +++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  22. @@ -170,6 +170,7 @@
  23.  import com.l2jserver.gameserver.model.quest.QuestState;
  24.  import com.l2jserver.gameserver.model.quest.State;
  25.  import com.l2jserver.gameserver.model.zone.type.L2BossZone;
  26. +import com.l2jserver.gameserver.model.zone.type.L2MultiFunctionZone;
  27.  import com.l2jserver.gameserver.network.L2GameClient;
  28.  import com.l2jserver.gameserver.network.SystemMessageId;
  29.  import com.l2jserver.gameserver.network.communityserver.CommunityServerThread;
  30. @@ -5684,6 +5685,7 @@
  31.             // Add karma to attacker and increase its PK counter
  32.             setPvpKills(getPvpKills() + 1);
  33.            
  34. +           L2MultiFunctionZone.givereward(this);
  35.             // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
  36.             sendPacket(new UserInfo(this));
  37.             sendPacket(new ExBrExtraUserInfo(this));
  38. Index: dist/game/config/MultiFunctionZone.properties
  39. ===================================================================
  40. --- dist/game/config/MultiFunctionZone.properties   (revision 0)
  41. +++ dist/game/config/MultiFunctionZone.properties   (revision 0)
  42. @@ -0,0 +1,60 @@
  43. +# ---------------------------------------------------------------------------
  44. +# MultiFunctionZone - custom addon for your server
  45. +# ---------------------------------------------------------------------------
  46. +# This option will turn on PvP flag to all people when entering to the zone
  47. +EnablePvP = True
  48. +
  49. +# If set to false, zone will be no-restart zone
  50. +NoRestartZone = False
  51. +
  52. +# If set to false, zone will be no-logout zone
  53. +NoLogoutZone = False
  54. +
  55. +# If set to false, zone will be no-store zone
  56. +NoStoreZone = False
  57. +
  58. +# Give noblesse after revive?
  59. +ReviveNoblesse = False
  60. +
  61. +# Heal after revive?
  62. +ReviveHeal = False
  63. +
  64. +# Delay, in seconds, to wait before revive
  65. +# 0 to disable
  66. +ReviveDelay = 10
  67. +
  68. +# Set the spawn points where players will be teleported on revive, if enabled
  69. +# example:150111,144740,-12248;143665,144418,-12022;144443,147685,-12139
  70. +SpawnLoc = 150111,144740,-12248;143665,144418,-12022;144443,147685,-12139
  71. +
  72. +# Random respawn radius
  73. +RespawnRadius = 500
  74. +
  75. +# If set to true, players will take noblesse blessing when entering
  76. +GiveNoblesse = True
  77. +
  78. +# Remove buffs when entering to the zone
  79. +RemoveBuffs = False
  80. +
  81. +# Remove pets when entering to the zone
  82. +RemovePets = False
  83. +
  84. +# Special rewards when hunting inside this zone
  85. +# example: 57,100000;14720,1
  86. +Rewards = 57,100000;14720,1
  87. +
  88. +# List of Items(id's) that won't be usable inside this area and also will be unequiped when entering
  89. +# (armor, weapons, scrolls, potions, etc), example: 728,7575, 6383, 1538
  90. +Items = 728,7575,6383,1538
  91. +
  92. +# List of Grades that won't be usable inside this area and also will be unequiped when entering
  93. +# example: D,C,B,A,S,S80,S84
  94. +Grades = C,B,A
  95. +
  96. +# Items with this enchant or more won't be usable inside this area and also will be unequiped when entering
  97. +# 0 to disable
  98. +Enchant = 0
  99. +
  100. +# Players with one of that classes won't be able to enter to the zone
  101. +# example: 93,85,12
  102. +Classes = 92
  103. \ No newline at end of file
  104. Index: java/com/l2jserver/gameserver/network/clientpackets/UseItem.java
  105. ===================================================================
  106. --- java/com/l2jserver/gameserver/network/clientpackets/UseItem.java    (revision 5631)
  107. +++ java/com/l2jserver/gameserver/network/clientpackets/UseItem.java    (working copy)
  108. @@ -23,9 +23,11 @@
  109. import com.l2jserver.gameserver.handler.ItemHandler;
  110. import com.l2jserver.gameserver.instancemanager.FortSiegeManager;
  111. import com.l2jserver.gameserver.model.L2ItemInstance;
  112. +import com.l2jserver.gameserver.model.actor.L2Character;
  113. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  114. import com.l2jserver.gameserver.model.base.Race;
  115. import com.l2jserver.gameserver.model.itemcontainer.Inventory;
  116. +import com.l2jserver.gameserver.model.zone.type.L2MultiFunctionZone;
  117. import com.l2jserver.gameserver.network.SystemMessageId;
  118. import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  119. import com.l2jserver.gameserver.network.serverpackets.ItemList;
  120. @@ -113,6 +115,12 @@
  121.         if (item == null)
  122.             return;
  123.        
  124. +       if(getClient().getActiveChar().isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.checkItem(item))
  125. +       {
  126. +           getClient().getActiveChar().sendMessage("You cannot use "+item.getName()+" inside this zone.");
  127. +           return;
  128. +       }
  129. +      
  130.         if (item.getItem().getType2() == L2Item.TYPE2_QUEST)
  131.         {
  132.             SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.CANNOT_USE_QUEST_ITEMS);
  133. Index: java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java
  134. ===================================================================
  135. --- java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (revision 5631)
  136. +++ java/com/l2jserver/gameserver/network/clientpackets/RequestRestart.java (working copy)
  137. @@ -17,12 +17,13 @@
  138. import java.util.logging.Level;
  139. import java.util.logging.LogRecord;
  140. import java.util.logging.Logger;
  141. -
  142. import com.l2jserver.Config;
  143. import com.l2jserver.gameserver.SevenSignsFestival;
  144. import com.l2jserver.gameserver.instancemanager.AntiFeedManager;
  145. import com.l2jserver.gameserver.model.L2Party;
  146. +import com.l2jserver.gameserver.model.actor.L2Character;
  147. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  148. +import com.l2jserver.gameserver.model.zone.type.L2MultiFunctionZone;
  149. import com.l2jserver.gameserver.network.L2GameClient;
  150. import com.l2jserver.gameserver.network.L2GameClient.GameClientState;
  151. import com.l2jserver.gameserver.network.SystemMessageId;
  152. @@ -87,6 +88,13 @@
  153.             return;
  154.         }
  155.        
  156. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.restart_zone)
  157. +       {
  158. +           player.sendMessage("You cannot restart while inside a Multifunction zone.");
  159. +           sendPacket(RestartResponse.valueOf(false));
  160. +           return;
  161. +       }
  162. +      
  163.         // Prevent player from restarting if they are a festival participant
  164.         // and it is in progress, otherwise notify party members that the player
  165.         // is not longer a participant.
  166. Index: java/com/l2jserver/gameserver/model/itemcontainer/ItemContainer.java
  167. ===================================================================
  168. --- java/com/l2jserver/gameserver/model/itemcontainer/ItemContainer.java    (revision 5631)
  169. +++ java/com/l2jserver/gameserver/model/itemcontainer/ItemContainer.java    (working copy)
  170. @@ -43,7 +43,7 @@
  171. {
  172.     protected static final Logger _log = Logger.getLogger(ItemContainer.class.getName());
  173.    
  174. -   protected final List<L2ItemInstance> _items;
  175. +   public final List<L2ItemInstance> _items;
  176.    
  177.     protected ItemContainer()
  178.     {
  179. Index: java/com/l2jserver/gameserver/model/zone/type/L2MultiFunctionZone.java
  180. ===================================================================
  181. --- java/com/l2jserver/gameserver/model/zone/type/L2MultiFunctionZone.java  (revision 0)
  182. +++ java/com/l2jserver/gameserver/model/zone/type/L2MultiFunctionZone.java  (revision 0)
  183. @@ -0,0 +1,345 @@
  184. +/*
  185. + * This program is free software: you can redistribute it and/or modify it under
  186. + * the terms of the GNU General Public License as published by the Free Software
  187. + * Foundation, either version 3 of the License, or (at your option) any later
  188. + * version.
  189. + *
  190. + * This program is distributed in the hope that it will be useful, but WITHOUT
  191. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  192. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  193. + * details.
  194. + *
  195. + * You should have received a copy of the GNU General Public License along with
  196. + * this program. If not, see <http://www.gnu.org/licenses/>.
  197. + */
  198. +/*
  199. + * This program is free software: you can redistribute it and/or modify it under
  200. + * the terms of the GNU General Public License as published by the Free Software
  201. + * Foundation, either version 3 of the License, or (at your option) any later
  202. + * version.
  203. + *
  204. + * This program is distributed in the hope that it will be useful, but WITHOUT
  205. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  206. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  207. + * details.
  208. + *
  209. + * You should have received a copy of the GNU General Public License along with
  210. + * this program. If not, see <http://www.gnu.org/licenses/>.
  211. + */
  212. +package com.l2jserver.gameserver.model.zone.type;
  213. +
  214. +import java.io.File;
  215. +import java.io.FileInputStream;
  216. +import java.util.ArrayList;
  217. +import java.util.List;
  218. +import java.util.Properties;
  219. +import javolution.util.FastList;
  220. +import com.l2jserver.gameserver.ThreadPoolManager;
  221. +import com.l2jserver.gameserver.datatables.SkillTable;
  222. +import com.l2jserver.gameserver.model.L2ItemInstance;
  223. +import com.l2jserver.gameserver.model.L2Skill;
  224. +import com.l2jserver.gameserver.model.actor.L2Character;
  225. +import com.l2jserver.gameserver.model.actor.L2Summon;
  226. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  227. +import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
  228. +import com.l2jserver.gameserver.model.zone.L2SpawnZone;
  229. +import com.l2jserver.util.Rnd;
  230. +
  231. +/**
  232. + *
  233. + * @author Wyatt
  234. + * @version 1.3
  235. + *
  236. + */
  237. +
  238. +public class L2MultiFunctionZone extends L2SpawnZone
  239. +{
  240. +  
  241. +   public L2MultiFunctionZone(int id)
  242. +   {
  243. +       super(id);
  244. +       loadConfigs();
  245. +   }
  246. +  
  247. +   public static boolean pvp_enabled, restart_zone, store_zone, logout_zone, revive_noblesse, revive_heal, revive, remove_buffs, remove_pets, give_noblesse;
  248. +   static int radius, enchant, revive_delay;
  249. +   static int[][] spawn_loc;
  250. +   L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
  251. +   private static List<String> items = new FastList<String>();
  252. +   private static List<String> grades = new FastList<String>(), classes = new FastList<String>();
  253. +   public static List<int[]> rewards;
  254. +   static String[] gradeNames = {"","D","C","B","A","S","S80","S84"};
  255. +  
  256. +   @Override
  257. +   protected void onEnter(L2Character character)
  258. +   {
  259. +       character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, true);
  260. +       character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, true);
  261. +       if(!store_zone)
  262. +           character.setInsideZone(L2Character.ZONE_NOSTORE, true);
  263. +      
  264. +       if (character instanceof L2PcInstance)
  265. +       {
  266. +           L2PcInstance activeChar = ((L2PcInstance) character);
  267. +           if(classes != null && classes.contains(""+activeChar.getClassId().getId()))
  268. +           {
  269. +               activeChar.teleToLocation(83597,147888,-3405);
  270. +               activeChar.sendMessage("Your class is not allowed in the MultiFunction zone.");
  271. +               return;
  272. +           }
  273. +          
  274. +           for(L2ItemInstance o : activeChar.getInventory()._items)
  275. +           {
  276. +               if(o.isEquipable() && o.isEquipped() && !checkItem(o))
  277. +               {
  278. +                   int slot = activeChar.getInventory().getSlotFromItem(o);
  279. +                   activeChar.getInventory().unEquipItemInBodySlot(slot); 
  280. +                   activeChar.sendMessage(o.getName()+" unequiped because is not allowed inside this zone.");
  281. +               }
  282. +           }
  283. +           activeChar.sendMessage("You entered in a MultiFunction zone.");
  284. +           clear(activeChar);
  285. +           if(give_noblesse)
  286. +               noblesse.getEffects(activeChar, activeChar);  
  287. +           if(pvp_enabled && activeChar.getPvpFlag() == 0)
  288. +               activeChar.updatePvPFlag(1);               
  289. +       }
  290. +   }
  291. +  
  292. +   @Override
  293. +   protected void onExit(L2Character character)
  294. +   {
  295. +       character.setInsideZone(L2Character.ZONE_NOSUMMONFRIEND, false);
  296. +       character.setInsideZone(L2Character.ZONE_MULTIFUNCTION, false);
  297. +       if(!store_zone)
  298. +           character.setInsideZone(L2Character.ZONE_NOSTORE, false);
  299. +      
  300. +       if (character instanceof L2PcInstance)
  301. +       {
  302. +           L2PcInstance activeChar = ((L2PcInstance) character);
  303. +           activeChar.sendMessage("You left from a MultiFunction zone.");
  304. +          
  305. +           if(pvp_enabled)
  306. +               activeChar.stopPvPFlag();  
  307. +       }
  308. +   }
  309. +  
  310. +   @Override
  311. +   public void onDieInside(final L2Character character)
  312. +   {
  313. +       if (character instanceof L2PcInstance)
  314. +       {
  315. +           final L2PcInstance activeChar = ((L2PcInstance) character);
  316. +           if(revive)
  317. +           {
  318. +               ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
  319. +               {
  320. +                   @Override
  321. +                   public void run()
  322. +                   {
  323. +                       activeChar.doRevive();
  324. +                       heal(activeChar);
  325. +                       int[] loc = spawn_loc[Rnd.get(spawn_loc.length)];
  326. +                       activeChar.teleToLocation(loc[0]+Rnd.get(-radius,radius), loc[1]+Rnd.get(-radius,radius), loc[2]);
  327. +                   }
  328. +               },revive_delay*1000);  
  329. +           }
  330. +       }
  331. +   }
  332. +
  333. +   @Override
  334. +   public void onReviveInside(L2Character character)
  335. +   {  
  336. +       if (character instanceof L2PcInstance)
  337. +       {
  338. +           L2PcInstance activeChar = ((L2PcInstance) character);
  339. +           if(revive_noblesse)
  340. +               noblesse.getEffects(activeChar, activeChar);  
  341. +           if(revive_heal)
  342. +               heal(activeChar);
  343. +       }
  344. +   }
  345. +  
  346. +   private void clear (L2PcInstance player)
  347. +   {
  348. +       if(remove_buffs)
  349. +       {
  350. +           player.stopAllEffectsExceptThoseThatLastThroughDeath();
  351. +           if(remove_pets)
  352. +           {
  353. +               L2Summon pet = player.getPet();
  354. +               if(pet!= null)
  355. +               {
  356. +                   pet.stopAllEffectsExceptThoseThatLastThroughDeath();
  357. +                   pet.unSummon(player);  
  358. +               }  
  359. +           }
  360. +       }
  361. +       else
  362. +       {
  363. +           if(remove_pets)
  364. +           {
  365. +               L2Summon pet = player.getPet();
  366. +               if(pet!= null)
  367. +               {
  368. +                   pet.unSummon(player);  
  369. +               }  
  370. +           }
  371. +       }
  372. +   }
  373. +  
  374. +   static void heal(L2PcInstance activeChar)
  375. +   {
  376. +       activeChar.setCurrentHp(activeChar.getMaxHp());
  377. +       activeChar.setCurrentCp(activeChar.getMaxCp());
  378. +       activeChar.setCurrentMp(activeChar.getMaxMp());
  379. +   }
  380. +  
  381. +   public static void givereward(L2PcInstance player)
  382. +   {
  383. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION))
  384. +       {
  385. +           for (int[] reward : rewards)
  386. +           {
  387. +               PcInventory inv = player.getInventory();
  388. +               inv.addItem("Custom Reward", reward[0], reward[1], player,  player);   
  389. +           }
  390. +       }
  391. +   }
  392. +  
  393. +   public static boolean checkItem (L2ItemInstance item)
  394. +   {
  395. +       int o = item.getItem().getCrystalType();
  396. +       int e = item.getEnchantLevel();
  397. +      
  398. +       if(enchant != 0 && e >= enchant)
  399. +       {
  400. +           return false;
  401. +       }
  402. +      
  403. +       if(grades.contains(gradeNames[o]))
  404. +           return false;
  405. +
  406. +       if(items != null && items.contains(""+item.getItemId()))
  407. +           return false;
  408. +       return true;
  409. +   }
  410. +  
  411. +   private static void loadConfigs()
  412. +   {
  413. +       try
  414. +       {
  415. +           Properties prop = new Properties();
  416. +           prop.load(new FileInputStream(new File("./config/MultiFunctionZone.properties")));
  417. +           pvp_enabled = Boolean.parseBoolean(prop.getProperty("EnablePvP", "False"));
  418. +           spawn_loc = parseItemsList(prop.getProperty("SpawnLoc", "150111,144740,-12248"));
  419. +           revive_delay = Integer.parseInt(prop.getProperty("ReviveDelay", "10"));
  420. +           if(revive_delay != 0)
  421. +           {
  422. +               revive = true;
  423. +           }
  424. +           give_noblesse = Boolean.parseBoolean(prop.getProperty("GiveNoblesse", "False"));
  425. +           String[] propertySplit = prop.getProperty("Items", "").split(",");
  426. +           if (propertySplit.length != 0)
  427. +           {
  428. +               for(String i : propertySplit)
  429. +               {
  430. +                   items.add(i);
  431. +               }
  432. +           }
  433. +           propertySplit = prop.getProperty("Grades", "").split(",");
  434. +           if (propertySplit.length != 0)
  435. +           {
  436. +               for(String i : propertySplit)
  437. +               {
  438. +                   if(i.equals("D") || i.equals("C") || i.equals("B") || i.equals("A") || i.equals("S") || i.equals("S80") || i.equals("S84"))
  439. +                       grades.add(i);
  440. +               }
  441. +           }
  442. +           propertySplit = prop.getProperty("Classes", "").split(",");
  443. +           if (propertySplit.length != 0)
  444. +           {
  445. +               for(String i : propertySplit)
  446. +               {
  447. +                   classes.add(i);
  448. +               }
  449. +           }
  450. +           radius =  Integer.parseInt(prop.getProperty("RespawnRadius", "500"));
  451. +           enchant =  Integer.parseInt(prop.getProperty("Enchant", "0"));
  452. +           remove_buffs = Boolean.parseBoolean(prop.getProperty("RemoveBuffs", "False"));
  453. +           remove_pets = Boolean.parseBoolean(prop.getProperty("RemovePets", "False"));
  454. +           restart_zone = Boolean.parseBoolean(prop.getProperty("NoRestartZone", "False"));
  455. +           store_zone = Boolean.parseBoolean(prop.getProperty("NoStoreZone", "False"));
  456. +           logout_zone = Boolean.parseBoolean(prop.getProperty("NoLogoutZone", "False"));
  457. +           revive_noblesse = Boolean.parseBoolean(prop.getProperty("ReviveNoblesse", "False"));
  458. +           revive_heal = Boolean.parseBoolean(prop.getProperty("ReviveHeal", "False"));
  459. +           rewards = new ArrayList<int[]>();
  460. +           propertySplit = prop.getProperty("Rewards", "57,100000").split(";");
  461. +           for (String reward : propertySplit)
  462. +           {
  463. +               String[] rewardSplit = reward.split(",");
  464. +               if (rewardSplit.length == 2)
  465. +               {
  466. +                   try
  467. +                   {
  468. +                       rewards.add(new int[]{Integer.parseInt(rewardSplit[0]), Integer.parseInt(rewardSplit[1])});
  469. +                   }
  470. +                   catch (NumberFormatException nfe)
  471. +                   {
  472. +                   }
  473. +               }
  474. +           }
  475. +       }
  476. +       catch(Exception e)
  477. +       {
  478. +           e.printStackTrace();
  479. +       }
  480. +   }  
  481. +  
  482. +   private static int[][] parseItemsList(String line)
  483. +   {
  484. +       final String[] propertySplit = line.split(";");
  485. +       if (propertySplit.length == 0)
  486. +           return null;
  487. +
  488. +       int i = 0;
  489. +       String[] valueSplit;
  490. +       final int[][] result = new int[propertySplit.length][];
  491. +       for (String value : propertySplit)
  492. +       {
  493. +           valueSplit = value.split(",");
  494. +           if (valueSplit.length != 3)
  495. +           {
  496. +               return null;
  497. +           }
  498. +
  499. +           result[i] = new int[3];
  500. +           try
  501. +           {
  502. +               result[i][0] = Integer.parseInt(valueSplit[0]);
  503. +           }
  504. +           catch (NumberFormatException e)
  505. +           {
  506. +               return null;
  507. +           }
  508. +           try
  509. +           {
  510. +               result[i][1] = Integer.parseInt(valueSplit[1]);
  511. +           }
  512. +           catch (NumberFormatException e)
  513. +           {
  514. +               return null;
  515. +           }
  516. +           try
  517. +           {
  518. +               result[i][2] = Integer.parseInt(valueSplit[2]);
  519. +           }
  520. +           catch (NumberFormatException e)
  521. +           {
  522. +               return null;
  523. +           }
  524. +           i++;
  525. +       }
  526. +       return result;
  527. +   }
  528. +}
  529. \ No newline at end of file
  530. Index: java/com/l2jserver/gameserver/network/serverpackets/Die.java
  531. ===================================================================
  532. --- java/com/l2jserver/gameserver/network/serverpackets/Die.java    (revision 5631)
  533. +++ java/com/l2jserver/gameserver/network/serverpackets/Die.java    (working copy)
  534. @@ -27,6 +27,7 @@
  535. import com.l2jserver.gameserver.model.entity.Castle;
  536. import com.l2jserver.gameserver.model.entity.Fort;
  537. import com.l2jserver.gameserver.model.entity.TvTEvent;
  538. +import com.l2jserver.gameserver.model.zone.type.L2MultiFunctionZone;
  539.  
  540. /**
  541.  * sample
  542. @@ -62,7 +63,7 @@
  543.            
  544.         }
  545.         _charObjId = cha.getObjectId();
  546. -       _canTeleport = !((cha instanceof L2PcInstance && TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_charObjId)) || cha.isPendingRevive());
  547. +       _canTeleport = !((cha instanceof L2PcInstance && TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_charObjId)) || cha.isPendingRevive() || (cha.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && L2MultiFunctionZone.revive));
  548.         if (cha instanceof L2Attackable)
  549.             _sweepable = ((L2Attackable)cha).isSweepActive();
  550.        
  551. Index: java/com/l2jserver/gameserver/network/clientpackets/Logout.java
  552. ===================================================================
  553. --- java/com/l2jserver/gameserver/network/clientpackets/Logout.java (revision 5631)
  554. +++ java/com/l2jserver/gameserver/network/clientpackets/Logout.java (working copy)
  555. @@ -21,7 +21,9 @@
  556. import com.l2jserver.Config;
  557. import com.l2jserver.gameserver.SevenSignsFestival;
  558. import com.l2jserver.gameserver.model.L2Party;
  559. +import com.l2jserver.gameserver.model.actor.L2Character;
  560. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  561. +import com.l2jserver.gameserver.model.zone.type.L2MultiFunctionZone;
  562. import com.l2jserver.gameserver.network.SystemMessageId;
  563. import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
  564. import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  565. @@ -83,6 +85,13 @@
  566.             return;
  567.         }
  568.        
  569. +       if(player.isInsideZone(L2Character.ZONE_MULTIFUNCTION) && !L2MultiFunctionZone.logout_zone)
  570. +       {
  571. +           player.sendMessage("You cannot logout while inside a Multifunction zone.");
  572. +           player.sendPacket(ActionFailed.STATIC_PACKET);
  573. +           return;
  574. +       }
  575. +      
  576.         // Prevent player from logging out if they are a festival participant
  577.         // and it is in progress, otherwise notify party members that the player
  578.         // is not longer a participant.
  579.  
  580. ### Eclipse Workspace Patch 1.0
  581. #P L2J_DataPack
  582. Index: dist/game/data/zones/peace_zones.xml
  583. ===================================================================
  584. --- dist/game/data/zones/peace_zones.xml    (revision 9174)
  585. +++ dist/game/data/zones/peace_zones.xml    (working copy)
  586. @@ -978,4 +978,10 @@
  587.         <node X="-113768" Y="-150965" />
  588.         <node X="-115424" Y="-150965" />
  589.     </zone>
  590. +   <zone name="Custom" type="MultiFunctionZone" shape="NPoly" minZ="-15000" maxZ="-10000">
  591. +       <node X="130000" Y="160000" />
  592. +       <node X="130000" Y="130000" />
  593. +       <node X="160000" Y="130000" />
  594. +       <node X="160000" Y="160000" />
  595. +   </zone>
  596. </list>
  597. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement