Giardev

RaidbossLimit

Aug 30th, 2021 (edited)
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/aCis/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java b/aCis/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java
  2. index 56adf02..79c4292 100644
  3. --- a/aCis/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java
  4. +++ b/aCis/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java
  5. @@ -3,6 +3,8 @@
  6.  import java.sql.Connection;
  7.  import java.sql.PreparedStatement;
  8.  import java.sql.ResultSet;
  9.  import java.util.List;
  10.  import java.util.Map;
  11.  import java.util.Set;
  12. @@ -13,11 +15,13 @@
  13.  import net.sf.l2j.Config;
  14.  import net.sf.l2j.gameserver.data.xml.MapRegionData.TeleportType;
  15.  import net.sf.l2j.gameserver.enums.ZoneId;
  16.  import net.sf.l2j.gameserver.model.actor.Attackable;
  17.  import net.sf.l2j.gameserver.model.actor.Creature;
  18.  import net.sf.l2j.gameserver.model.actor.Playable;
  19.  import net.sf.l2j.gameserver.model.actor.Player;
  20.  import net.sf.l2j.gameserver.model.actor.Summon;
  21. +import net.sf.l2j.gameserver.model.actor.instance.RaidBoss;
  22.  import net.sf.l2j.gameserver.model.zone.type.subtype.ZoneType;
  23.  
  24.  /**
  25. @@ -38,8 +42,10 @@
  26.     private final int[] _oustLoc = new int[3];
  27.    
  28.     private int _invadeTime;
  29. +   private int _bossId;
  30.    
  31.     public BossZone(int id)
  32.     {
  33. @@ -73,8 +79,10 @@
  34.             _oustLoc[1] = Integer.parseInt(value);
  35.         else if (name.equals("oustZ"))
  36.             _oustLoc[2] = Integer.parseInt(value);
  37. +        else if (name.equals("bossId"))
  38. +           _bossId = Integer.parseInt(value);
  39.         else
  40.             super.setParameter(name, value);
  41.     }
  42. @@ -73,8 +79,10 @@
  43.     @Override
  44.     protected void onExit(Creature character)
  45.     {
  46.         character.setInsideZone(ZoneId.BOSS, false);
  47. +      
  48. +       if (character instanceof RaidBoss)
  49. +       {
  50. +           final RaidBoss raidboss = ((RaidBoss) character);
  51. +           if (raidboss.getNpcId() == _bossId)
  52. +           {
  53. +               raidboss.teleportTo(raidboss.getSpawn().getLoc(), 0);
  54. +               raidboss.setTarget(null);
  55. +               raidboss.getStatus().setMaxHp();
  56. +               raidboss.getAI().tryToIdle();
  57. +           }
  58. +       }
  59.        
  60.         if (character instanceof Playable)
  61.  
  62.            
  63. \ No newline at end of file
  64. <?xml version="1.0" encoding="UTF-8"?>
  65. <list>
  66.     <!-- Boss Zones -->
  67.     <zone id="110020" shape="NPoly" minZ="-15000" maxZ="10000"> <!-- Barakiel -->
  68. +       <stat name="bossId" val="25325" />
  69.         <node x="83495" y="-85322" />
  70.         <node x="87837" y="-85721" />
  71.         <node x="88877" y="-84196" />
  72.         <node x="87585" y="-81756" />  
  73.         <node x="89955" y="-78691" />
  74.         <node x="93900" y="-86824" />
  75.         <node x="89598" y="-90579" />
  76.         <node x="84452" y="-91320" />
  77.         <node x="82178" y="-88232" />
  78.     </zone>
Add Comment
Please, Sign In to add comment