Advertisement
ArkeyWave

[IL][L2J] Clan War Zone

Jan 9th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.55 KB | None | 0 0
  1. ### Eclipse Workspace Patch 1.0
  2. #P L2jFrozen_GameServer
  3. Index: head-src/com/l2jfrozen/gameserver/model/zone/type/L2ClanWarZone.java
  4. ===================================================================
  5. --- head-src/com/l2jfrozen/gameserver/model/zone/type/L2ClanWarZone.java    (revision 0)
  6. +++ head-src/com/l2jfrozen/gameserver/model/zone/type/L2ClanWarZone.java    (working copy)
  7. @@ -0,0 +1,78 @@
  8. +/*
  9. + * This program is free software: you can redistribute it and/or modify it under
  10. + * the terms of the GNU General Public License as published by the Free Software
  11. + * Foundation, either version 3 of the License, or (at your option) any later
  12. + * version.
  13. + *
  14. + * This program is distributed in the hope that it will be useful, but WITHOUT
  15. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  16. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  17. + * details.
  18. + *
  19. + * You should have received a copy of the GNU General Public License along with
  20. + * this program. If not, see <http://www.gnu.org/licenses/>.
  21. + */
  22. +package com.l2jfrozen.gameserver.model.zone.type;
  23. +
  24. +import com.l2jfrozen.gameserver.datatables.csv.MapRegionTable;
  25. +import com.l2jfrozen.gameserver.model.L2Character;
  26. +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
  27. +import com.l2jfrozen.gameserver.model.zone.L2ZoneType;
  28. +
  29. +public class L2ClanWarZone extends L2ZoneType
  30. +{
  31. +
  32. +   /**
  33. +    * @param id
  34. +    */
  35. +   public L2ClanWarZone(int id)
  36. +   {
  37. +       super(id);
  38. +   }
  39. +
  40. +  
  41. +   @Override
  42. +   protected void onEnter(L2Character character)
  43. +   {
  44. +       if (character instanceof L2PcInstance)
  45. +       {
  46. +          if(((L2PcInstance) character).getClan() != null)
  47. +          {
  48. +              ((L2PcInstance) character).setIsInsideClanwarZone(true);
  49. +              ((L2PcInstance) character).sendMessage("You have entered a Clan War Zone. Prepare for fight.");
  50. +          }
  51. +          else
  52. +          {
  53. +              ((L2PcInstance) character).sendMessage("This is strict area for clan members ONLY. You will be teleported at the nearest town.");
  54. +              ((L2PcInstance) character).teleToLocation(MapRegionTable.TeleportWhereType.Town);
  55. +          }
  56. +       }
  57. +   }
  58. +  
  59. +   @Override
  60. +   protected void onExit(L2Character character)
  61. +   {
  62. +       if (character instanceof L2PcInstance)
  63. +       {
  64. +          ((L2PcInstance) character).setIsInsideClanwarZone(false);
  65. +       }
  66. +   }
  67. +  
  68. +  
  69. +  @Override
  70. +   public void onDieInside(L2Character character)
  71. +   {
  72. +    
  73. +   }
  74. +  
  75. +   @Override
  76. +   public void onReviveInside(L2Character character)
  77. +   {
  78. +       onEnter(character);
  79. +   }
  80. +}
  81. \ No newline at end of file
  82. Index: head-src/com/l2jfrozen/gameserver/model/L2Character.java
  83. ===================================================================
  84. --- head-src/com/l2jfrozen/gameserver/model/L2Character.java    (revision 949)
  85. +++ head-src/com/l2jfrozen/gameserver/model/L2Character.java    (working copy)
  86. @@ -175,6 +175,8 @@
  87.     /** The _is buff protected. */
  88.     private boolean _isBuffProtected = false; //Protect From Debuffs
  89.    
  90. +   private boolean _isInsideClanwarZone = false;
  91. +  
  92.     /** The _is afraid. */
  93.     private boolean _isAfraid = false; // Flee in a random direction
  94.    
  95. @@ -11241,4 +11243,20 @@
  96.     {
  97.         return _triggeredSkills;
  98.     }
  99. +
  100. +   /**
  101. +    * @return the _isInsideClanwarZone
  102. +    */
  103. +   public boolean isInsideClanwarZone()
  104. +   {
  105. +       return _isInsideClanwarZone;
  106. +   }
  107. +
  108. +   /**
  109. +    * @param _isInsideClanwarZone the _isInsideClanwarZone to set
  110. +    */
  111. +   public void setIsInsideClanwarZone(boolean _isInsideClanwarZone)
  112. +   {
  113. +       this._isInsideClanwarZone = _isInsideClanwarZone;
  114. +   }
  115.  }
  116. Index: head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java
  117. ===================================================================
  118. --- head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java  (revision 949)
  119. +++ head-src/com/l2jfrozen/gameserver/datatables/xml/ZoneData.java  (working copy)
  120. @@ -50,6 +50,7 @@
  121.  import com.l2jfrozen.gameserver.model.zone.type.L2CastleTeleportZone;
  122.  import com.l2jfrozen.gameserver.model.zone.type.L2CastleZone;
  123.  import com.l2jfrozen.gameserver.model.zone.type.L2ClanHallZone;
  124. +import com.l2jfrozen.gameserver.model.zone.type.L2ClanWarZone;
  125.  import com.l2jfrozen.gameserver.model.zone.type.L2CustomZone;
  126.  import com.l2jfrozen.gameserver.model.zone.type.L2DamageZone;
  127.  import com.l2jfrozen.gameserver.model.zone.type.L2DerbyTrackZone;
  128. @@ -278,6 +279,10 @@
  129.                                 {
  130.                                     temp = new L2SwampZone(zoneId);
  131.                                 }
  132. +                               else if(zoneType.equals("FlagZone"))
  133. +                               {
  134. +                                   temp = new L2ClanWarZone(zoneId);
  135. +                               }
  136.  
  137.                                 // Check for unknown type
  138.                                 if(temp == null)
  139. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  140. ===================================================================
  141. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (revision 949)
  142. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
  143. @@ -7715,6 +7716,12 @@
  144.         if(!checkAntiFarm(targetPlayer))
  145.             return;
  146.            
  147. +       if(isInsideClanwarZone() && targetPlayer.isInsideClanwarZone() && (getClan() != null) && (targetPlayer.getClan() != null) && (getClanId() != targetPlayer.getClanId()))
  148. +       {
  149. +           getClan().setReputationScore(getClan().getReputationScore() + 100, true);
  150. +           sendMessage("You killed someone from an enemy clan. Your clan gets rewarded with 100 rep points!");
  151. +       }
  152. +      
  153.         // Check if it's pvp
  154.         if(checkIfPvP(target) && targetPlayer.getPvpFlag() != 0 || isInsideZone(ZONE_PVP) && targetPlayer.isInsideZone(ZONE_PVP))
  155.         {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement