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; } }
public void trainPassive(Skill Sk) { owner.getRoom().setSkillRedirect(true); Sk.train(); owner.getRoom().setSkillRedirect(false); }