Advertisement
-JRGames-

ChaoticZone Rus3.5

Feb 26th, 2023
926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.07 KB | None | 0 0
  1. diff --git a/Server3.5/build/gameserver/config/Custom/Annunces.properties b/Server3.5/build/gameserver/config/Custom/Annunces.properties
  2. index e9e9471..bf97d2c 100644
  3. --- a/Server3.5/build/gameserver/config/Custom/Annunces.properties
  4. +++ b/Server3.5/build/gameserver/config/Custom/Annunces.properties
  5. @@ -15,3 +15,18 @@
  6.  AllowPkRewardSystem = True
  7.  # PK reward itemId,itemCount;
  8.  PkRewardItem = 5592,5;
  9. +
  10. +#============================================================
  11. +#                  Chaotic Zone Messenge
  12. +#============================================================
  13. +# Message to enter to Chaotic Zone
  14. +ChaoticZoneMessageTextEnter = You have entered the Chaotic Zone!
  15. +
  16. +# Time Show Message to player Entre to Zone
  17. +ChaoticZoneMessegeTimeEnter = 4
  18. +
  19. +# Message to enter to Chaotic Zone
  20. +ChaoticZoneMessageTextExit = You have left the Chaotic Zone!
  21. +
  22. +# Time Show Message to player Exit the Zone
  23. +ChaoticZoneMessegeTimeExit = 4
  24. diff --git a/Server3.5/build/gameserver/data/xml/zones/ArenaZone.xml b/Server3.5/build/gameserver/data/xml/zones/ArenaZone.xml
  25. index 2bfa9f5..1a7aa17 100644
  26. --- a/Server3.5/build/gameserver/data/xml/zones/ArenaZone.xml
  27. +++ b/Server3.5/build/gameserver/data/xml/zones/ArenaZone.xml
  28. @@ -15,13 +15,6 @@
  29.         <node x="-88408" y="142708"/>
  30.         <spawn type="NORMAL" x="-86979" y="142402" z="-3643" />
  31.     </zone>
  32. -   <zone shape="NPoly" minZ="-3850" maxZ="-3350"><!-- giran_pvp_battle -->
  33. -       <node x="72493" y="142263"/>
  34. -       <node x="73493" y="142264"/>
  35. -       <node x="73493" y="143261"/>
  36. -       <node x="72495" y="143258"/>
  37. -       <spawn type="NORMAL" x="73890" y="142656" z="-3778" />
  38. -   </zone>
  39.     <zone shape="NPoly" minZ="-3498" maxZ="-3298"><!-- colosseum_battle -->
  40.         <node x="150948" y="46483" />
  41.         <node x="151210" y="46186" />
  42. diff --git a/Server3.5/build/gameserver/data/xml/zones/ChaoticZone.xml b/Server3.5/build/gameserver/data/xml/zones/ChaoticZone.xml
  43. new file mode 100644
  44. index 0000000..113f736
  45. --- /dev/null
  46. +++ b/Server3.5/build/gameserver/data/xml/zones/ChaoticZone.xml
  47. @@ -0,0 +1,12 @@
  48. +<?xml version="1.0" encoding="UTF-8"?>
  49. +<list>
  50. +  
  51. +   <zone type="ChaoticZone" shape="NPoly" minZ="-3850" maxZ="-3350"><!-- giran_pvp_battle -->
  52. +       <node x="72493" y="142263"/>
  53. +       <node x="73493" y="142264"/>
  54. +       <node x="73493" y="143261"/>
  55. +       <node x="72495" y="143258"/>
  56. +       <spawn type="NORMAL" x="73890" y="142656" z="-3778" />
  57. +   </zone>
  58. +  
  59. +</list>
  60. \ No newline at end of file
  61. diff --git a/aCis_gameserver/java/net/sf/l2j/Config.java b/aCis_gameserver/java/net/sf/l2j/Config.java
  62. index c365362..de0cb3e 100644
  63. --- a/aCis_gameserver/java/net/sf/l2j/Config.java
  64. +++ b/aCis_gameserver/java/net/sf/l2j/Config.java
  65. @@ -80,6 +80,11 @@
  66.      public static int BANKING_SYSTEM_GOLDBARS;
  67.      public static int BANKING_SYSTEM_ADENA;
  68.    
  69. +    public static String ENTER_CHAOTIC_ZONE_MESSEGE;
  70. +    public static int TIME_MESSEGE_CHAOTIC_ZONE_ENTER;
  71. +    public static String EXIT_CHAOTIC_ZONE_MESSEGE;
  72. +    public static int TIME_MESSEGE_CHAOTIC_ZONE_EXIT;
  73. +
  74.     // --------------------------------------------------
  75.     // Clans settings
  76.     // --------------------------------------------------
  77. @@ -1210,6 +1215,11 @@
  78.         ALLOW_PK_REWARD = Boolean.parseBoolean(Annunce.getProperty("AllowPkRewardSystem", "False"));
  79.         PK_REWARD_ITEM = parseItemsList(Annunce.getProperty("PkRewardItem", "57,400"));
  80.  
  81. +       ENTER_CHAOTIC_ZONE_MESSEGE = Annunce.getProperty("ChaoticZoneMessageTextEnter", "You have entered the Chaotic Zone!");
  82. +       TIME_MESSEGE_CHAOTIC_ZONE_ENTER = Integer.parseInt(Annunce.getProperty("ChaoticZoneMessegeTimeEnter", "6")) * 1000;
  83. +       EXIT_CHAOTIC_ZONE_MESSEGE = Annunce.getProperty("ChaoticZoneMessageTextExit", "You have left the Chaotic Zone!");
  84. +       TIME_MESSEGE_CHAOTIC_ZONE_EXIT = Integer.parseInt(Annunce.getProperty("ChaoticZoneMessegeTimeExit", "6")) * 1000;
  85. +
  86.     }
  87.    
  88.     private static final void loadProtect()
  89. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java b/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java
  90. index 5fb0f95..d219bc9 100644
  91. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java
  92. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/enums/ZoneId.java
  93. @@ -23,7 +23,8 @@
  94.     SCRIPT(18),
  95.     BOSS(19),
  96.     PAGAN(20),
  97. -   SSQ(21);
  98. +   SSQ(21),
  99. +   CHAOTIC_ZONE(22);
  100.    
  101.     private final int _id;
  102.    
  103. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/ChaoticZone.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/ChaoticZone.java
  104. new file mode 100644
  105. index 0000000..4c26c75
  106. --- /dev/null
  107. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/ChaoticZone.java
  108. @@ -0,0 +1,50 @@
  109. +package net.sf.l2j.gameserver.model.zone.type;
  110. +
  111. +import net.sf.l2j.Config;
  112. +import net.sf.l2j.gameserver.enums.ZoneId;
  113. +import net.sf.l2j.gameserver.model.actor.Creature;
  114. +import net.sf.l2j.gameserver.model.actor.Player;
  115. +import net.sf.l2j.gameserver.model.zone.type.subtype.ZoneType;
  116. +import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
  117. +import net.sf.l2j.gameserver.taskmanager.PvpFlagTaskManager;
  118. +
  119. +/**
  120. + * @author Sarada
  121. + * = TioPatinhaS =
  122. + */
  123. +public class ChaoticZone extends ZoneType
  124. +{
  125. +   public ChaoticZone(int id)
  126. +   {
  127. +       super(id);
  128. +   }
  129. +  
  130. +   @Override
  131. +   protected void onEnter(Creature creature)
  132. +   {
  133. +       if (creature instanceof Player)
  134. +       {
  135. +           final Player player = (Player) creature;
  136. +          
  137. +           creature.setInsideZone(ZoneId.CHAOTIC_ZONE, true);
  138. +           creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
  139. +           player.updatePvPFlag(1);
  140. +           creature.sendPacket(new ExShowScreenMessage(Config.ENTER_CHAOTIC_ZONE_MESSEGE, Config.TIME_MESSEGE_CHAOTIC_ZONE_ENTER));
  141. +           return;
  142. +       }
  143. +   }
  144. +   @Override
  145. +   protected void onExit(Creature creature)
  146. +   {
  147. +       if (creature instanceof Player)
  148. +       {
  149. +           final Player activeChar = (Player) creature;
  150. +           creature.setInsideZone(ZoneId.CHAOTIC_ZONE, false);
  151. +           creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
  152. +           activeChar.updatePvPFlag(0);
  153. +           PvpFlagTaskManager.getInstance().add(activeChar, Config.PVP_NORMAL_TIME);
  154. +           creature.sendPacket(new ExShowScreenMessage(Config.EXIT_CHAOTIC_ZONE_MESSEGE, Config.TIME_MESSEGE_CHAOTIC_ZONE_EXIT));
  155. +           return;
  156. +       }
  157. +   }
  158. +}
  159. \ No newline at end of file
  160. diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java b/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
  161. index 113b1c2..2a79481 100644
  162. --- a/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
  163. +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/taskmanager/PvpFlagTaskManager.java
  164. @@ -4,7 +4,7 @@
  165.  import java.util.concurrent.ConcurrentHashMap;
  166.  
  167.  import net.sf.l2j.commons.pool.ThreadPool;
  168. -
  169. +import net.sf.l2j.gameserver.enums.ZoneId;
  170.  import net.sf.l2j.gameserver.model.actor.Player;
  171.  
  172.  /**
  173. @@ -35,6 +35,13 @@
  174.         {
  175.             // Get time left and check.
  176.             final Player player = entry.getKey();
  177. +          
  178. +           if (player.isInsideZone(ZoneId.CHAOTIC_ZONE))
  179. +           {
  180. +               _players.remove(player);
  181. +               continue;
  182. +           }
  183. +
  184.             final long timeLeft = entry.getValue();
  185.            
  186.             // Time is running out, clear PvP flag and remove from list.
  187.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement