Advertisement
Axelut

Raidboss Limit Zone

Oct 15th, 2023
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### Eclipse Workspace Patch 1.0
  2. #P aCis_datapack
  3. Index: data/xml/zones/RaidLimitZone.xml
  4. ===================================================================
  5. --- data/xml/zones/RaidLimitZone.xml    (revision 0)
  6. +++ data/xml/zones/RaidLimitZone.xml    (revision 0)
  7. @@ -0,0 +1,8 @@
  8. +<?xml version="1.0" encoding="UTF-8"?>
  9. +<list>
  10. +   <zone shape="Cuboid" minZ="-3000" maxZ="-2500"> <!-- Barakel Example -->
  11. +       <stat name="bossId" val="25325" />
  12. +       <node X="90792" Y="-85439" />
  13. +       <node X="91291" Y="-86537" />
  14. +   </zone>
  15. +</list>
  16. \ No newline at end of file
  17. #P aCis_gameserver
  18. Index: java/net/sf/l2j/gameserver/model/zone/ZoneId.java
  19. ===================================================================
  20. --- java/net/sf/l2j/gameserver/model/zone/ZoneId.java   (revision 5)
  21. +++ java/net/sf/l2j/gameserver/model/zone/ZoneId.java   (working copy)
  22. @@ -21,7 +21,8 @@
  23.     CAST_ON_ARTIFACT(16),
  24.     NO_RESTART(17),
  25.     SCRIPT(18),
  26. -   BOSS(19);
  27. +   BOSS(19),
  28. +   RAID_LIMIT(20);
  29.    
  30.     private final int _id;
  31.    
  32. Index: java/net/sf/l2j/gameserver/model/zone/type/RaidLimitZone.java
  33. ===================================================================
  34. --- java/net/sf/l2j/gameserver/model/zone/type/RaidLimitZone.java   (revision 0)
  35. +++ java/net/sf/l2j/gameserver/model/zone/type/RaidLimitZone.java   (revision 0)
  36. @@ -0,0 +1,46 @@
  37. +package net.sf.l2j.gameserver.model.zone.type;
  38. +
  39. +import net.sf.l2j.gameserver.model.actor.Creature;
  40. +import net.sf.l2j.gameserver.model.actor.ai.CtrlIntention;
  41. +import net.sf.l2j.gameserver.model.actor.instance.RaidBoss;
  42. +import net.sf.l2j.gameserver.model.zone.SpawnZoneType;
  43. +import net.sf.l2j.gameserver.model.zone.ZoneId;
  44. +
  45. +public class RaidLimitZone extends SpawnZoneType
  46. +{
  47. +   private int _bossId;
  48. +  
  49. +   public RaidLimitZone(int id)
  50. +   {
  51. +       super(id);
  52. +   }
  53. +  
  54. +   @Override
  55. +   public void setParameter(String name, String value)
  56. +   {
  57. +       if (name.equals("bossId"))
  58. +           _bossId = Integer.parseInt(value);
  59. +   }
  60. +  
  61. +   @Override
  62. +   protected void onEnter(Creature character)
  63. +   {
  64. +       character.setInsideZone(ZoneId.RAID_LIMIT, true);
  65. +   }
  66. +  
  67. +   @Override
  68. +   protected void onExit(Creature character)
  69. +   {
  70. +       character.setInsideZone(ZoneId.RAID_LIMIT, false);
  71. +       if (character instanceof RaidBoss)
  72. +       {
  73. +           final RaidBoss raidboss = ((RaidBoss) character);
  74. +           if (raidboss.getNpcId() == _bossId)
  75. +           {
  76. +               raidboss.teleportTo(raidboss.getSpawn().getLoc(), 0);
  77. +               raidboss.setTarget(null);
  78. +               raidboss.getAI().setIntention(CtrlIntention.IDLE);
  79. +           }
  80. +       }
  81. +   }
  82. +}
  83. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement