mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-08 08:23:11 +00:00
@@ -29,6 +29,12 @@ import com.l2jserver.service.game.ai.AIScript;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class NPC extends Actor {
|
||||
private NPCState state;
|
||||
|
||||
public enum NPCState {
|
||||
MOVING, ATTACKING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance
|
||||
*
|
||||
@@ -39,6 +45,42 @@ public class NPC extends Actor {
|
||||
super(templateID);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the state
|
||||
*/
|
||||
public NPCState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if NPC is idle
|
||||
*/
|
||||
public boolean isIdle() {
|
||||
return state == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if NPC is idle
|
||||
*/
|
||||
public boolean isMoving() {
|
||||
return state == NPCState.MOVING;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if NPC is idle
|
||||
*/
|
||||
public boolean isAttacking() {
|
||||
return state == NPCState.ATTACKING;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param state
|
||||
* the state to set
|
||||
*/
|
||||
public void setState(NPCState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActorSex getSex() {
|
||||
return this.getTemplate().getSex();
|
||||
|
||||
Reference in New Issue
Block a user