Esempio n. 1
0
  /**
   * @param attachCond
   * @param applyCond
   * @param set
   * @param params
   */
  public TriggerSkillBySkill(
      Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) {
    super(attachCond, applyCond, set, params);

    _castSkillId = params.getInt("castSkillId", 0);
    _chance = params.getInt("chance", 100);
    _skill = new SkillHolder(params.getInt("skillId", 0), params.getInt("skillLevel", 0));
    _targetType = params.getEnum("targetType", L2TargetType.class, L2TargetType.ONE);
  }
Esempio n. 2
0
  public Escape(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) {
    super(attachCond, applyCond, set, params);

    _escapeType = params.getEnum("escapeType", TeleportWhereType.class, null);
  }
Esempio n. 3
0
  public ManaHealPercent(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) {
    super(attachCond, applyCond, set, params);

    _power = params.getDouble("power", 0);
  }
Esempio n. 4
0
  public HealOverTime(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) {
    super(attachCond, applyCond, set, params);

    _power = params.getDouble("power", 0);
  }
Esempio n. 5
0
  public SkillTurning(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params) {
    super(attachCond, applyCond, set, params);

    _chance = params.getInt("chance", 100);
  }
Esempio n. 6
0
  /**
   * Parses the henna.
   *
   * @param d the d
   */
  private void parseHenna(Node d) {
    final StatsSet set = new StatsSet();
    final List<ClassId> wearClassIds = new ArrayList<>();
    final List<SkillHolder> skills = new ArrayList<>();
    NamedNodeMap attrs = d.getAttributes();
    Node attr;
    for (int i = 0; i < attrs.getLength(); i++) {
      attr = attrs.item(i);
      set.set(attr.getNodeName(), attr.getNodeValue());
    }

    for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling()) {
      final String name = c.getNodeName();
      attrs = c.getAttributes();
      switch (name) {
        case "stats":
          {
            for (int i = 0; i < attrs.getLength(); i++) {
              attr = attrs.item(i);
              set.set(attr.getNodeName(), attr.getNodeValue());
            }
            break;
          }
        case "wear":
          {
            attr = attrs.getNamedItem("count");
            set.set("wear_count", attr.getNodeValue());
            attr = attrs.getNamedItem("fee");
            set.set("wear_fee", attr.getNodeValue());
            break;
          }
        case "cancel":
          {
            attr = attrs.getNamedItem("count");
            set.set("cancel_count", attr.getNodeValue());
            attr = attrs.getNamedItem("fee");
            set.set("cancel_fee", attr.getNodeValue());
            break;
          }
        case "skills":
          {
            for (Node i = c.getFirstChild(); i != null; i = i.getNextSibling()) {
              if ("skill".equals(i.getNodeName())) {
                final int skillId =
                    Integer.parseInt(i.getAttributes().getNamedItem("id").getNodeValue());
                final int skillLevel =
                    Integer.parseInt(i.getAttributes().getNamedItem("level").getNodeValue());
                skills.add(new SkillHolder(skillId, skillLevel));
              }
            }
            break;
          }
        case "classId":
          {
            wearClassIds.add(ClassId.getClassId(Integer.parseInt(c.getTextContent())));
            break;
          }
      }
    }
    final L2Henna henna = new L2Henna(set);
    henna.setWearClassIds(wearClassIds);
    henna.setSkills(skills);
    _hennaList.put(henna.getDyeId(), henna);
  }