Advertisement
Giardev

RaidbossLimit

Aug 30th, 2021 (edited)
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 3.36 KB | Source Code | 0 0
  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.Monster;
  22. +import net.sf.l2j.gameserver.model.actor.instance.RaidBoss;
  23.  import net.sf.l2j.gameserver.model.zone.type.subtype.ZoneType;
  24.  
  25.  /**
  26. @@ -38,8 +42,10 @@
  27.     private final int[] _oustLoc = new int[3];
  28.    
  29.     private int _invadeTime;
  30. +   private int _bossId;
  31.    
  32.     public BossZone(int id)
  33.     {
  34. @@ -73,8 +79,10 @@
  35.             _oustLoc[1] = Integer.parseInt(value);
  36.         else if (name.equals("oustZ"))
  37.             _oustLoc[2] = Integer.parseInt(value);
  38. +        else if (name.equals("bossId"))
  39. +           _bossId = Integer.parseInt(value);
  40.         else
  41.             super.setParameter(name, value);
  42.     }
  43. @@ -73,8 +79,10 @@
  44.     @Override
  45.     protected void onExit(Creature character)
  46.     {
  47.         character.setInsideZone(ZoneId.BOSS, false);
  48. +      
  49. +       if (creature instanceof RaidBoss raidboss)
  50. +       {
  51. +           if (raidboss.getNpcId() == _bossId)
  52. +           {
  53. +               // Teletransportar al RaidBoss a su spawn
  54. +               raidboss.teleportTo(raidboss.getSpawn().getSpawnLocation(), 0);
  55. +               raidboss.setTarget(null);
  56. +               raidboss.getStatus().setMaxHp();
  57. +               raidboss.getAI().getCurrentIntention();
  58. +
  59. +               // Buscar y teletransportar los minions dentro de la zona
  60. +               for (Monster minion : getKnownTypeInside(Monster.class))
  61. +               {
  62. +                   if (minion != null && minion.isRaidRelated() && minion != raidboss)
  63. +                   {
  64. +                       minion.teleportTo(minion.getSpawn().getSpawnLocation(), 0);
  65. +                       minion.setTarget(null);
  66. +                       minion.getStatus().setMaxHp();
  67. +                       minion.getAI().getCurrentIntention();
  68. +                   }
  69. +               }
  70. +           }
  71. +       }
  72. +      
  73.         if (character instanceof Playable)
  74.  
  75.            
  76. \ No newline at end of file
  77. ==================================================================================================
  78. <?xml version="1.0" encoding="UTF-8"?>
  79. <list>
  80.     <!-- Boss Zones -->
  81.     <zone id="110020" shape="NPoly" minZ="-15000" maxZ="10000"> <!-- Barakiel -->
  82. +       <stat name="bossId" val="25325" />
  83.         <node x="83495" y="-85322" />
  84.         <node x="87837" y="-85721" />
  85.         <node x="88877" y="-84196" />
  86.         <node x="87585" y="-81756" />  
  87.         <node x="89955" y="-78691" />
  88.         <node x="93900" y="-86824" />
  89.         <node x="89598" y="-90579" />
  90.         <node x="84452" y="-91320" />
  91.         <node x="82178" y="-88232" />
  92.     </zone>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement