mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
Added setJob and setRole functions to ScriptNpc
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user