warc222

Auto Nobless from RaidBosses for L2jfrozen

Oct 3rd, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.54 KB | None | 0 0
  1. Index: D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java
  2. ===================================================================
  3. --- D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java (revision 1004)
  4. +++ D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java (working copy)
  5. @@ -25,6 +25,7 @@
  6. import com.l2jfrozen.gameserver.model.L2Summon;
  7. import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
  8. import com.l2jfrozen.gameserver.network.SystemMessageId;
  9. +import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
  10. import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
  11. import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
  12. import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  13.  
  14. @@ -87,24 +87,60 @@
  15.  
  16. if(player != null)
  17. {
  18. + // RaidBoss auto noble START
  19. + if (Config.ALLOW_AUTO_NOBLESS_FROM_BOSS)
  20. + {
  21. + if (getNpcId() == Config.BOSS_ID) //Barakiel as default.
  22. + {
  23. + if (player.getParty() != null)
  24. + {
  25. + for (L2PcInstance member : player.getParty().getPartyMembers())
  26. + {
  27. + if (member.isNoble() == true)
  28. + {
  29. + member.sendMessage("["+Config.SERVER_NAME+"]:" + "Your party gained nobless status for defeating " + getName() + "!");
  30. + }
  31. + else
  32. + {
  33. + if (member.isInsideRadius(getX(), getY(), getZ(), Config.RADIUS_TO_RAID, false, false)) //to prevent exploit
  34. + {
  35. + member.setNoble(true);
  36. + member.sendMessage("["+Config.SERVER_NAME+"]:" + "You and your party gained nobless status for defeating " + getName() + "!");
  37. + member.broadcastPacket(new SocialAction(member.getObjectId(), 16)); //Special effect or all!
  38. + }
  39. + else
  40. + member.sendMessage("["+Config.SERVER_NAME+"]:" + "Your party killed " + getName() + "! But you were to far away and earned nothing...");
  41. + }
  42. + }
  43. + }
  44. + else if ((player.getParty() == null) && (player.isNoble() == false))
  45. + {
  46. + player.setNoble(true);
  47. + player.sendMessage("["+Config.SERVER_NAME+"]:" + "You gained nobless status for defeating " + getName() + "!");
  48. + player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
  49. + }
  50. + }
  51. + }
  52. + // RaidBoss auto noble END
  53. SystemMessage msg = new SystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL);
  54. broadcastPacket(msg);
  55. msg = null;
  56.  
  57.  
  58. Index: D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/Config.java
  59. ===================================================================
  60. --- D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/Config.java (revision 1004)
  61. +++ D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/Config.java (working copy)
  62.  
  63. public static String PVP2_CUSTOM_MESSAGE;
  64.  
  65. + //============================================================
  66. + /* Auto Nobless FROM BOSS */
  67. + public static int BOSS_ID; // Barakiel retail like
  68. + public static boolean ALLOW_AUTO_NOBLESS_FROM_BOSS;
  69. + public static String SERVER_NAME;
  70. + public static int RADIUS_TO_RAID;
  71. + // ============================================================
  72. public static void loadL2JFrozenConfig()
  73.  
  74. @@ -2517,8 +2550,12 @@
  75. PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
  76. + /* Auto Nobless FROM BOSS */
  77. + ALLOW_AUTO_NOBLESS_FROM_BOSS = Boolean.valueOf(L2JFrozenSettings.getProperty("AllowAutoNoblessFromBoss", "True"));
  78. + BOSS_ID = Integer.parseInt(L2JFrozenSettings.getProperty("BossId", "25325")); //Barakiel retail like
  79. + RADIUS_TO_RAID = Integer.parseInt(L2JFrozenSettings.getProperty("RadiusToRaid", "1000"));
  80. + SERVER_NAME = L2JFrozenSettings.getProperty("ServerName", "L2-Frozen");
  81. }
  82. catch(Exception e)
  83.  
  84.  
  85.  
  86.  
  87.  
  88. ===================================================================
  89. gameserver\config\functions\l2jfrozen.properties
  90.  
  91.  
  92.  
  93. PvP2CustomMeesage = You have been teleported to PvP Zone 2!
  94.  
  95. + # ----------------------------------------------
  96. + # Auto Nobless from RaidBoss -
  97. + # ----------------------------------------------
  98. +
  99. + # Allow auto nobless from RaidBosses?
  100. + AllowAutoNoblessFromBoss = True
  101. +
  102. + # RaidBoss id from which player will get nobless ( if autonobless enabled)
  103. + BossId = 25325
  104. +
  105. + # The player has to be inside this radius around the RaidBoss in order to get Nobless!
  106. + # Default: 1000 (the most optimal option and not recommended to change :))
  107. + RadiusToRaid = 1000
  108. +
  109. + # Server will broadcast if you or your party killed the boss.
  110. + ServerName = L2-Frozen
  111.  
  112. # -----------------------------------------
  113. # Protector System Config -
  114. # -----------------------------------------
  115.  
  116.  
  117. Credits: Token & Tortex
  118. Version: 1.0
Add Comment
Please, Sign In to add comment