Advertisement
LIONN

Hero Boss

May 7th, 2012
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.45 KB | None | 0 0
  1. Index: config/functions/l2jfrozen.properties
  2. ===================================================================
  3. --- config/functions/l2jfrozen.properties (revision 936)
  4. +++ config/functions/l2jfrozen.properties (working copy)
  5. @@ -280,4 +280,9 @@
  6. ProtectorSkillLevel = 13
  7. ProtectorSkillTime = 600
  8. # Npc Protector Message
  9. -ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  10. \ No newline at end of file
  11. +ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
  12. +
  13. +# Id do Boss que dara status hero ao player que der o ultimo hit.
  14. +HeroBossId = 0
  15. +# Tempo de status hero que o player ira ganhar.
  16. +HeroBossDays = 1
  17. \ No newline at end of file
  18. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java
  19. ===================================================================
  20. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java (revision 936)
  21. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2RaidBossInstance.java (working copy)
  22. @@ -25,6 +25,7 @@
  23. import com.l2jfrozen.gameserver.model.L2Summon;
  24. import com.l2jfrozen.gameserver.model.spawn.L2Spawn;
  25. import com.l2jfrozen.gameserver.network.SystemMessageId;
  26. +import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
  27. import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
  28. import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
  29. import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
  30. @@ -99,6 +100,16 @@
  31.  
  32.    if(player != null)
  33.    {
  34. +   if (getNpcId() == Config.RH_HERO_BOSS_ID && !player.isHero())
  35. +   {
  36. +    player.broadcastPacket(new SocialAction(player.getObjectId(), 16));
  37. +    player.setIsHero(true);
  38. +    player.setHeroEndTime(Config.RH_HERO_BOSS_DAYS * 24L * 60L * 60L * 1000L);
  39. +    player.sendMessage("You Are Now a Hero! You Are Granted With Hero Status, Skills, Aura.");
  40. +    player.broadcastUserInfo();
  41. +    player.getInventory().addItem("Wings of Destiny", 6842, 1, player, null);
  42. +   }
  43. +  
  44.     SystemMessage msg = new SystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL);
  45.     broadcastPacket(msg);
  46.     msg = null;
  47. Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
  48. ===================================================================
  49. --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 936)
  50. +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
  51. @@ -14035,6 +14035,38 @@
  52.    sendSkillList();
  53.   }
  54.  
  55. + public void setHeroEndTime(long heroTime)
  56. + {
  57. +  Connection con = null;
  58. +  try
  59. +  {
  60. +   con = L2DatabaseFactory.getInstance().getConnection(false);
  61. +   PreparedStatement stmt = con.prepareStatement("REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator, hero_end_date) VALUES (?,?,?,?,?,?)");
  62. +  
  63. +   stmt.setInt(1, getObjectId());
  64. +   stmt.setString(2, getName());
  65. +   stmt.setInt(3, 1);
  66. +   stmt.setInt(4, isNoble() ? 1 : 0);
  67. +   stmt.setInt(5, isDonator() ? 1 : 0);
  68. +   stmt.setLong(6, heroTime == 0 ? 0 : System.currentTimeMillis() + heroTime);
  69. +   stmt.execute();
  70. +   stmt.close();
  71. +   stmt = null;
  72. +  }
  73. +  catch(Exception e)
  74. +  {
  75. +   if(Config.ENABLE_ALL_EXCEPTIONS)
  76. +    e.printStackTrace();
  77. +
  78. +   _log.log(Level.SEVERE, "Error: could not update database: ", e);
  79. +  }
  80. +  finally
  81. +  {
  82. +   CloseUtil.close(con);
  83. +   con = null;
  84. +  }
  85. + }
  86. +
  87.   /**
  88.    * Sets the donator.
  89.    *
  90. Index: head-src/com/l2jfrozen/Config.java
  91. ===================================================================
  92. --- F:/Workspace/BETA_GS/head-src/com/l2jfrozen/Config.java (revision 936)
  93. +++ F:/Workspace/BETA_GS/head-src/com/l2jfrozen/Config.java (working copy)
  94. @@ -2379,6 +2379,9 @@
  95.   public static String PVP1_CUSTOM_MESSAGE;
  96.   public static String PVP2_CUSTOM_MESSAGE;
  97.  
  98. + public static int RH_HERO_BOSS_ID;
  99. + public static int RH_HERO_BOSS_DAYS;
  100. +
  101.   //============================================================
  102.   public static void loadL2JFrozenConfig()
  103.   {
  104. @@ -2391,6 +2394,9 @@
  105.     L2JFrozenSettings.load(is);
  106.     is.close();
  107.  
  108. +   RH_HERO_BOSS_ID  = Integer.parseInt(L2JFrozenSettings.getProperty("HeroBossId", "0"));
  109. +   RH_HERO_BOSS_DAYS = Integer.parseInt(L2JFrozenSettings.getProperty("HeroBossDays", "1"));
  110. +
  111.     /** Custom Tables **/
  112.     CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(L2JFrozenSettings.getProperty("CustomSpawnlistTable", "True"));
  113.     SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(L2JFrozenSettings.getProperty("SaveGmSpawnOnCustom", "True"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement