warc222

Re: [Hot Share] Auto Nobless RaidBoss Configurable.

Dec 25th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.77 KB | None | 0 0
  1. Index: D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java
  2.  
  3. ===================================================================
  4.  
  5. --- D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java (revision 1004)
  6.  
  7. +++ D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java (working copy)
  8.  
  9. @@ -25,6 +25,7 @@
  10.  
  11. import com.l2jfrozen.gameserver.model.L2Summon;
  12.  
  13. import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
  14.  
  15. import com.l2jfrozen.gameserver.network.SystemMessageId;
  16.  
  17. +import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
  18.  
  19. import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
  20.  
  21. import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
  22.  
  23. import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  24.  
  25.  
  26.  
  27. @@ -87,24 +87,60 @@
  28.  
  29.  
  30.  
  31. if(player != null)
  32.  
  33. {
  34.  
  35. + // RaidBoss auto noble START
  36.  
  37. + if (Config.ALLOW_AUTO_NOBLESS_FROM_BOSS)
  38.  
  39. + {
  40.  
  41. + if (getNpcId() == Config.BOSS_ID) //Barakiel as default.
  42.  
  43. + {
  44.  
  45. + if (player.getParty() != null)
  46.  
  47. + {
  48.  
  49. + for (L2PcInstance member : player.getParty().getPartyMembers())
  50.  
  51. + {
  52.  
  53. + if (member.isNoble() == true)
  54.  
  55. + {
  56.  
  57. + member.sendMessage("["+Config.SERVER_NAME+"]:" + "Your party gained nobless status for defeating " + getName() + "!");
  58.  
  59. + }
  60.  
  61. + else
  62.  
  63. + {
  64.  
  65. + if (member.isInsideRadius(getX(), getY(), getZ(), Config.RADIUS_TO_RAID, false, false)) //to prevent exploit
  66.  
  67. + {
  68.  
  69. + member.setNoble(true);
  70.  
  71. + member.sendMessage("["+Config.SERVER_NAME+"]:" + "You and your party gained nobless status for defeating " + getName() + "!");
  72.  
  73. + member.broadcastPacket(new SocialAction(member.getObjectId(), 16)); //Special effect or all!
  74.  
  75. + }
  76.  
  77. + else
  78.  
  79. + member.sendMessage("["+Config.SERVER_NAME+"]:" + "Your party killed " + getName() + "! But you were to far away and earned nothing...");
  80.  
  81. + }
  82.  
  83. + }
  84.  
  85. + }
  86.  
  87. + else if ((player.getParty() == null) && (player.isNoble() == false))
  88.  
  89. + {
  90.  
  91. + player.setNoble(true);
  92.  
  93. + player.sendMessage("["+Config.SERVER_NAME+"]:" + "You gained nobless status for defeating " + getName() + "!");
  94.  
  95. + player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
  96.  
  97. + }
  98.  
  99. + }
  100.  
  101. + }
  102.  
  103. + // RaidBoss auto noble END
  104.  
  105. SystemMessage msg = new SystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL);
  106.  
  107. broadcastPacket(msg);
  108.  
  109. msg = null;
  110.  
  111.  
  112.  
  113.  
  114.  
  115. Index: D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/Config.java
  116.  
  117. ===================================================================
  118.  
  119. --- D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/Config.java (revision 1004)
  120.  
  121. +++ D:/L2 Olympiad/Servas/Absolute/head-src/com/l2jfrozen/Config.java (working copy)
  122.  
  123.  
  124.  
  125. public static String PVP2_CUSTOM_MESSAGE;
  126.  
  127.  
  128.  
  129. + //============================================================
  130.  
  131. + /* Auto Nobless FROM BOSS */
  132.  
  133. + public static int BOSS_ID; // Barakiel retail like
  134.  
  135. + public static boolean ALLOW_AUTO_NOBLESS_FROM_BOSS;
  136.  
  137. + public static String SERVER_NAME;
  138.  
  139. + public static int RADIUS_TO_RAID;
  140.  
  141. + // ============================================================
  142.  
  143. public static void loadL2JFrozenConfig()
  144.  
  145.  
  146.  
  147. @@ -2517,8 +2550,12 @@
  148.  
  149. PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
  150.  
  151. + /* Auto Nobless FROM BOSS */
  152.  
  153. + ALLOW_AUTO_NOBLESS_FROM_BOSS = Boolean.valueOf(L2JFrozenSettings.getProperty("AllowAutoNoblessFromBoss", "True"));
  154.  
  155. + BOSS_ID = Integer.parseInt(L2JFrozenSettings.getProperty("BossId", "25325")); //Barakiel retail like
  156.  
  157. + RADIUS_TO_RAID = Integer.parseInt(L2JFrozenSettings.getProperty("RadiusToRaid", "1000"));
  158.  
  159. + SERVER_NAME = L2JFrozenSettings.getProperty("ServerName", "L2-Frozen");
  160.  
  161. }
  162.  
  163. catch(Exception e)
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175. ===================================================================
  176.  
  177. gameserver\config\functions\l2jfrozen.properties
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. PvP2CustomMeesage = You have been teleported to PvP Zone 2!
  186.  
  187.  
  188.  
  189. + # ----------------------------------------------
  190.  
  191. + # Auto Nobless from RaidBoss -
  192.  
  193. + # ----------------------------------------------
  194.  
  195. +
  196.  
  197. + # Allow auto nobless from RaidBosses?
  198.  
  199. + AllowAutoNoblessFromBoss = True
  200.  
  201. +
  202.  
  203. + # RaidBoss id from which player will get nobless ( if autonobless enabled)
  204.  
  205. + BossId = 25325
  206.  
  207. +
  208.  
  209. + # The player has to be inside this radius around the RaidBoss in order to get Nobless!
  210.  
  211. + # Default: 1000 (the most optimal option and not recommended to change :))
  212.  
  213. + RadiusToRaid = 1000
  214.  
  215. +
  216.  
  217. + # Server will broadcast if you or your party killed the boss.
  218.  
  219. + ServerName = L2-Frozen
  220.  
  221.  
  222.  
  223. # -----------------------------------------
  224.  
  225. # Protector System Config -
  226.  
  227. # -----------------------------------------
  228.  
  229.  
  230.  
  231.  
  232.  
  233. Credits: Token & Tortex
  234.  
  235. Version: 1.0
Advertisement
Add Comment
Please, Sign In to add comment