Advertisement
Nik

FAN/SQUARE SKill target types [Core]

Nik
Oct 7th, 2011
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.24 KB | None | 0 0
  1. Index: java/com/l2jserver/gameserver/model/L2Skill.java
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/model/L2Skill.java    (revision 171)
  4. +++ java/com/l2jserver/gameserver/model/L2Skill.java    (working copy)
  5. @@ -96,6 +96,8 @@
  6.         TARGET_PET,
  7.         TARGET_SUMMON,
  8.         TARGET_AREA,
  9. +       TARGET_AREA_FAN,
  10. +       TARGET_AREA_SQUARE,
  11.         TARGET_FRONT_AREA,
  12.         TARGET_BEHIND_AREA,
  13.         TARGET_AURA,
  14. @@ -216,6 +218,7 @@
  15.    
  16.     /** Target type of the skill : SELF, PARTY, CLAN, PET... */
  17.     private final SkillTargetType _targetType;
  18. +   private final int[] _areaParams;
  19.     private final int _feed;
  20.     // base success chance
  21.     private final double _power;
  22. @@ -487,6 +490,26 @@
  23.         _skillRadius = set.getInteger("skillRadius", 80);
  24.        
  25.         _targetType = set.getEnum("target", SkillTargetType.class);
  26. +       String areaParams = set.getString("areaParams", null);
  27. +       if (areaParams != null)
  28. +       {
  29. +           try
  30. +           {
  31. +               String [] valuesSplit = areaParams.split(",");
  32. +               if (valuesSplit.length != 4)
  33. +                   throw new IllegalArgumentException("SkillId: "+_id+" invalid areaParams value: "+areaParams+", \"directionV(90: top, 0: front, -90: bottom), directionH(0: front, 90: right, 180: back, 270: left), distance, radius  \" required");
  34. +              
  35. +               _areaParams = new int[4];
  36. +               for (int i = 0; i < 4; i++)
  37. +                   _areaParams[i] = Integer.parseInt(valuesSplit[i]);
  38. +           }
  39. +           catch (Exception e)
  40. +           {
  41. +               throw new IllegalArgumentException("SkillId: "+_id+" invalid areaParams value: "+areaParams+", \"directionV(90: top, 0: front, -90: bottom), directionH(0: front, 90: right, 180: back, 270: left), distance, radius  \" required");
  42. +           }
  43. +       }
  44. +       else
  45. +           _areaParams = new int[]{0,0,0,0};
  46.         _power = set.getFloat("power", 0.f);
  47.         _pvpPower = set.getFloat("pvpPower", (float)getPower());
  48.         _pvePower = set.getFloat("pvePower", (float)getPower());
  49. @@ -645,6 +668,19 @@
  50.         return _targetType;
  51.     }
  52.    
  53. +   /**
  54. +    * Return the area parameters of the skill used for specific target area types. <br>
  55. +    * 0: directionV
  56. +    * 1: directionH
  57. +    * 2: distance
  58. +    * 3: radius
  59. +    * @return
  60. +    */
  61. +   public final int[] getAreaParams()
  62. +   {
  63. +       return _areaParams;
  64. +   }
  65. +  
  66.     public final int getCondition()
  67.     {
  68.         return _condition;
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement