diff --git a/src/api b/src/api index e4a0840ae..d33ed5c41 160000 --- a/src/api +++ b/src/api @@ -1 +1 @@ -Subproject commit e4a0840ae287bd2ffc3f04a6fc0a45d4873343f8 +Subproject commit d33ed5c4124b632f2223a0cc1ce1cc997180b8f5 diff --git a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java index 6441e4764..768006575 100644 --- a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java +++ b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java @@ -9,11 +9,7 @@ import noppes.npcs.NoppesUtilServer; import noppes.npcs.api.jobs.IJob; import noppes.npcs.api.roles.IRole; import noppes.npcs.config.ConfigMain; -import noppes.npcs.constants.EnumAnimation; -import noppes.npcs.constants.EnumJobType; -import noppes.npcs.constants.EnumNavType; -import noppes.npcs.constants.EnumRoleType; -import noppes.npcs.constants.EnumStandingType; +import noppes.npcs.constants.*; import noppes.npcs.controllers.FactionController; import noppes.npcs.controllers.data.Line; import noppes.npcs.entity.EntityCustomNpc; @@ -123,6 +119,25 @@ public class ScriptNpc extends ScriptLiving imp return npc.ai.standingType.ordinal(); } + /** + * @param movingType The moving type of the npc. 0 = standing, 1 = wandering, 2 = moving path + */ + public void setMovingType(int movingType){ + for(EnumMovingType e : EnumMovingType.values()) { + if (e.ordinal() == movingType) { + npc.ai.movingType = e; + break; + } + } + } + + /** + * @return The moving type of the npc. 0 = standing, 1 = wandering, 2 = moving path + */ + public int getMovingType(){ + return npc.ai.movingType.ordinal(); + } + /** * @param name The name of the npc */