示例#1
0
  public static Skill createSkill(String sName, Entity ENT, int lev) {

    Ability A = null;
    Class C = null;

    sName = Utility.getProperClassName(sName);

    try {
      C = Class.forName(sName);
      A = (Ability) C.newInstance();
    } catch (Exception e) {
      return null;
    } catch (Throwable t) {
      return null;
    }

    try {
      Skill Sk = (Skill) A;
      Sk.init(ENT, lev);
      return Sk;
    } catch (Exception e) {
      return null;
    } catch (Throwable t) {
      return null;
    }
  }
示例#2
0
  public void trainPassive(Skill Sk) {

    owner.getRoom().setSkillRedirect(true);
    Sk.train();
    owner.getRoom().setSkillRedirect(false);
  }