Added drowning types:

In Air,
In Water,
or
Never
to CNPCs.
This commit is contained in:
Luis C.M committed 2022-06-29 12:21:30 -05:00
1 parent 44225194ac
commit 55b21de050
9 files changed
+102 -44

No files matched your search

@@ -1038,10 +1038,19 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
}
public boolean getCanDrown() {
return npc.stats.canDrown;
return npc.stats.drowningType > 0;
}
public void setCanDrown(boolean d) {
npc.stats.canDrown = d;
npc.stats.drowningType = d ? 1 : 0;
}
public void setDrowningType(int type) {
if (type < 0)
type = 0;
if (type > 2)
type = 2;
npc.stats.drowningType = type;
}
@Override
@@ -359,7 +359,11 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
boolean getCanDrown();
void setCanDrown(boolean b);
/**
*
* @param type 0 - Never drowns, 1 - Drowns in water, 2 - Drowns in air (without water)
*/
void setDrowningType(int type);
/**
* @param type The AnimationType
@@ -9,11 +9,13 @@ import noppes.npcs.scripted.interfaces.IWorld;
import noppes.npcs.scripted.interfaces.entity.IEntity;
public interface ICloneHandler {
IEntity spawn(double var1, double var3, double var5, int var7, String var8, IWorld var9);
IEntity spawn(double x, double y, double z, int tab, String name, IWorld world);
IEntity get(int var1, String var2, IWorld var3);
IEntity[] getTab(int tab, IWorld world);
void set(int var1, String var2, IEntity var3);
IEntity get(int tab, String name, IWorld world);
void remove(int var1, String var2);
void set(int tab, String name, IEntity entity);
void remove(int tab, String name);
}