Advertisement
-JRGames-

NEWBIE BUFF ACIS

Oct 25th, 2020
2,391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.09 KB | None | 0 0
  1. Index: java/net/sf/l2j/Config.java
  2. ===================================================================
  3. --- java/net/sf/l2j/Config.java
  4.  
  5. +/** Newbie Buffs */
  6. +   public static boolean NEW_PLAYER_BUFFS;
  7. +   public static HashMap<Integer, Integer> NEWBIE_BUFF_FIGHTER;
  8. +   public static HashMap<Integer, Integer> NEWBIE_BUFF_MAGE;
  9.  
  10. //============================================================
  11.  
  12. +       NEW_PLAYER_BUFFS = Boolean.parseBoolean(skills.getProperty("Newbie_Player_Buff", "False"));
  13.        
  14. +       if(NEW_PLAYER_BUFFS)
  15. +       {
  16. +           String[] fighterBuffSplit = skills.getProperty("Newlbie_Buff_Fighter", "").split(";");
  17. +           NEWBIE_BUFF_FIGHTER = new HashMap<>(fighterBuffSplit.length);
  18. +           for(String skill : fighterBuffSplit)
  19. +           {
  20. +               String[] skillSplit = skill.split(",");
  21. +               if(skillSplit.length != 2)
  22. +               {
  23. +                   System.out.println("invalid config property -> SkillList " + fighterBuffSplit + " -> FighterBuffList \"" + skill + "\"");
  24. +               }
  25. +               else
  26. +               {
  27. +                   try
  28. +                   {
  29. +                       NEWBIE_BUFF_FIGHTER.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  30. +                   }
  31. +                   catch(NumberFormatException nfe)
  32. +                   {
  33. +                       if(!skill.equals(""))
  34. +                       {
  35. +                           System.out.println("invalid config property -> SkillList " + fighterBuffSplit + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
  36. +                       }
  37. +                   }
  38. +               }
  39. +           }
  40.  
  41. +           String[] mageBuffSplit = skills.getProperty("Newlbie_Buff_Mage", "").split(";");
  42. +           NEWBIE_BUFF_MAGE = new HashMap<>(mageBuffSplit.length);
  43. +           for(String skill : mageBuffSplit)
  44. +           {
  45. +               String[] skillSplit = skill.split(",");
  46. +               if(skillSplit.length != 2)
  47. +               {
  48. +                   System.out.println("invalid config property -> SkillList " + mageBuffSplit + " -> MageBuffList \"" + skill + "\"");
  49. +               }
  50. +               else
  51. +               {
  52. +                   try
  53. +                   {
  54. +                       NEWBIE_BUFF_MAGE.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
  55. +                   }
  56. +                   catch(NumberFormatException nfe)
  57. +                   {
  58. +                       if(!skill.equals(""))
  59. +                       {
  60. +                           System.out.println("invalid config property -> SkillList " + mageBuffSplit + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);
  61. +                       }
  62. +                   }
  63. +               }
  64. +           }
  65. +       }
  66.  
  67. Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  68. ===================================================================
  69. --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
  70. +import net.sf.l2j.gameserver.model.L2Skill;
  71.  
  72.  
  73. +       if(activeChar.getFirstLog())
  74. +           onEnterNewbie(activeChar);
  75.  
  76. +   private static void onEnterNewbie(Player activeChar)
  77. +   {
  78. +       if(Config.NEW_PLAYER_BUFFS)
  79. +           {
  80. +               if(activeChar.isMageClass())
  81. +               {
  82. +                   for(Integer skillid : Config.NEWBIE_BUFF_MAGE.keySet())
  83. +                   {
  84. +                       int skilllvl = Config.NEWBIE_BUFF_MAGE.get(skillid);
  85. +                       L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
  86. +                       if(skill != null)
  87. +                           skill.getEffects(activeChar, activeChar);
  88. +                   }
  89. +               }
  90. +               else
  91. +               {
  92. +                   for(Integer skillid : Config.NEWBIE_BUFF_FIGHTER.keySet())
  93. +                   {
  94. +                       int skilllvl = Config.NEWBIE_BUFF_FIGHTER.get(skillid);
  95. +                       L2Skill skill = SkillTable.getInstance().getInfo(skillid, skilllvl);
  96.                         if(skill != null)
  97. +                           skill.getEffects(activeChar, activeChar);
  98. +                   }
  99. +               }
  100. +           }
  101. +           activeChar.setFirstLog(false);
  102. +           activeChar.updateFirstLog();
  103. +       }
  104.    
  105.  
  106. Index: config/skills.properties
  107. ===================================================================
  108.  
  109. +# Give buffs to character on first game log in.
  110. +# Default: False
  111. +Newbie_Player_Buff = True
  112.  
  113. +# The List of Fighter Buffs
  114. +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
  115. +Newlbie_Buff_Fighter = 1204,2;1068,3;1040,3;1035,4;1036,2;1045,6;1086,2;1077,3;1240,3;1242,3;264,1;267,1;268,1;269,1;304,1;349,1;364,1;271,1;274,1;275,1;1363,1;1391,3;4699,1;4703,1
  116.  
  117. +# The List of Mage Buffs
  118. +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
  119. +Newlbie_Buff_Mage = 1204,2;1040,3;1035,4;1045,6;1048,6;1036,2;1303,2;1085,3;1059,3;1078,6;1062,2;1397,3;264,1;267,1;268,1;304,1;349,1;364,1;273,1;276,1;365,1;1413,1;1391,3;4703,1
  120.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement