Added setJob and setRole functions to ScriptNpc

This commit is contained in:
luisc committed 2021-12-29 22:34:51 -06:00
1 parent b330678104
commit de5f119fd7
1 file changed
+16
@@ -311,6 +311,14 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
return new ScriptRoleTransporter(npc);
return new ScriptRoleInterface(npc);
}
public void setRole(int role){
for (EnumRoleType e : EnumRoleType.values()) {
if (e.ordinal() == role) {
npc.advanced.role = e;
break;
}
}
}
/**
* @return Returns the npcs current job
@@ -334,6 +342,14 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
return new ScriptJobSpawner(npc);
return new ScriptJobInterface(npc);
}
public void setJob(int job){
for (EnumJobType e : EnumJobType.values()) {
if (e.ordinal() == job) {
npc.advanced.job = e;
break;
}
}
}
/**
* @return The item held in the right hand