Advertisement
Guest User

pvpzone

a guest
Apr 17th, 2017
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.50 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_gameserver
  3. Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java
  4. ===================================================================
  5. --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java   (revision 7)
  6. +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java   (working copy)
  7. @@ -37,6 +37,21 @@
  8.     protected int _requestedPointType;
  9.     protected boolean _continuation;
  10.    
  11. +   static int radius;
  12. +   static int[][] spawn_loc =
  13. +   {
  14. +       {
  15. +           9512,
  16. +           -21960,
  17. +           -3680
  18. +       },
  19. +       {
  20. +           11240,
  21. +           -24584,
  22. +           -3640
  23. +       }
  24. +   };
  25. +  
  26.     @Override
  27.     protected void readImpl()
  28.     {
  29. @@ -142,9 +157,15 @@
  30.                     if (!activeChar.isInJail())
  31.                         return;
  32.                     loc = new Location(-114356, -249645, -2984);               
  33.                     break;                 
  34.                 default:
  35. +                   if (activeChar.isInsideZone(ZoneId.PVP_ZONE) && activeChar.isDead())
  36. +                   {
  37. +                       int[] loca = spawn_loc[Rnd.get(spawn_loc.length)];
  38. +                       activeChar.doRevive();
  39. +                       activeChar.teleToLocation(loca[0] + Rnd.get(-radius, radius), loca[1] + Rnd.get(-radius, radius), loca[2], 0);
  40. +                       return;
  41. +                   }
  42.                     if (activeChar.isInsideZone(ZoneId.RANDOM_PVP_ZONE) && activeChar.isDead())
  43.                     {
  44.                         Location location = ZoneRandom.getInstance().getCurrentZone();
  45. Index: java/net/sf/l2j/gameserver/model/zone/ZoneId.java
  46. ===================================================================
  47. --- java/net/sf/l2j/gameserver/model/zone/ZoneId.java   (revision 7)
  48. +++ java/net/sf/l2j/gameserver/model/zone/ZoneId.java   (working copy)
  49. @@ -40,7 +40,8 @@
  50.     NO_RESTART(17),
  51.     SCRIPT(18),
  52.     FLAG(19),
  53. -   RANDOM_PVP_ZONE(20);
  54. +   RANDOM_PVP_ZONE(20),
  55. +   PVP_ZONE(21);
  56.    
  57.     private final int _id;
  58.    
  59. Index: java/net/sf/l2j/gameserver/model/zone/type/L2PvPZone.java
  60. ===================================================================
  61. --- java/net/sf/l2j/gameserver/model/zone/type/L2PvPZone.java   (nonexistent)
  62. +++ java/net/sf/l2j/gameserver/model/zone/type/L2PvPZone.java   (working copy)
  63. @@ -0,0 +1,65 @@
  64. +package net.sf.l2j.gameserver.model.zone.type;
  65. +
  66. +import net.sf.l2j.gameserver.datatables.SkillTable;
  67. +import net.sf.l2j.gameserver.model.L2Skill;
  68. +import net.sf.l2j.gameserver.model.actor.L2Character;
  69. +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
  70. +import net.sf.l2j.gameserver.model.zone.L2ZoneType;
  71. +import net.sf.l2j.gameserver.model.zone.ZoneId;
  72. +import net.sf.l2j.gameserver.network.SystemMessageId;
  73. +
  74. +/**
  75. + * @author Baggos
  76. + */
  77. +public class L2PvPZone extends L2ZoneType
  78. +{
  79. +   L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
  80. +  
  81. +   public L2PvPZone(int id)
  82. +   {
  83. +       super(id);
  84. +   }
  85. +  
  86. +   @Override
  87. +   protected void onEnter(L2Character character)
  88. +   {
  89. +       character.setInsideZone(ZoneId.PVP_ZONE, true);
  90. +       if (character instanceof L2PcInstance)
  91. +       {
  92. +           L2PcInstance player = character.getActingPlayer();
  93. +           noblesse.getEffects(player, player);
  94. +           ((L2PcInstance) character).sendPacket(SystemMessageId.ENTERED_COMBAT_ZONE);
  95. +           character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
  96. +       }
  97. +   }
  98. +  
  99. +   @Override
  100. +   protected void onExit(L2Character character)
  101. +   {
  102. +       character.setInsideZone(ZoneId.PVP_ZONE, false);
  103. +       if (character instanceof L2PcInstance)
  104. +       {
  105. +           ((L2PcInstance) character).sendPacket(SystemMessageId.LEFT_COMBAT_ZONE);
  106. +           character.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
  107. +       }
  108. +   }
  109. +  
  110. +   @Override
  111. +   public void onDieInside(L2Character character)
  112. +   {
  113. +   }
  114. +  
  115. +   @Override
  116. +   public void onReviveInside(L2Character character)
  117. +   {
  118. +       if (character instanceof L2PcInstance)
  119. +       {
  120. +           final L2PcInstance player = (L2PcInstance) character;
  121. +           noblesse.getEffects(player, player);
  122. +          
  123. +           player.setCurrentHp(player.getMaxHp());
  124. +           player.setCurrentCp(player.getMaxCp());
  125. +           player.setCurrentMp(player.getMaxMp());
  126. +       }
  127. +   }
  128. +}
  129. \ No newline at end of file
  130. #P aCis_datapack
  131. Index: data/xml/zones/PvPZone.xml
  132. ===================================================================
  133. --- data/xml/zones/PvPZone.xml  (nonexistent)
  134. +++ data/xml/zones/PvPZone.xml  (working copy)
  135. @@ -0,0 +1,11 @@
  136. +<?xml version="1.0" encoding="UTF-8"?>
  137. +<list>
  138. +    <zone type="PvPZone" shape="NPoly" minZ="-4290" maxZ="-1290"><!-- Primeval Isle -->
  139. +        <node X="10408" Y="-27395" />
  140. +        <node X="12065" Y="-25334" />
  141. +        <node X="15834" Y="-19850" />
  142. +        <node X="8791" Y="-10223" />
  143. +        <node X="3487" Y="-12137" />
  144. +        <node X="4110" Y="-34245" />
  145. +    </zone>
  146. +</list>
  147. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement