mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 10:49:07 +00:00
wtf
This commit is contained in:
1 parent
5795cc984b
commit
19cdf19a9b
3 files changed
+34
-1
No files matched your search
@@ -47,6 +47,7 @@ public abstract class Ability implements IAbility {
|
||||
// Timing (ticks)
|
||||
protected int cooldownTicks = 100;
|
||||
protected int windUpTicks = 20;
|
||||
protected int dazedTicks = 0;
|
||||
protected int activeTicks = 10;
|
||||
protected int recoveryTicks = 20;
|
||||
|
||||
@@ -588,6 +589,7 @@ public abstract class Ability implements IAbility {
|
||||
nbt.setFloat("maxRange", maxRange);
|
||||
nbt.setInteger("cooldown", cooldownTicks);
|
||||
nbt.setInteger("windUp", windUpTicks);
|
||||
nbt.setInteger("dazed", dazedTicks);
|
||||
nbt.setInteger("active", activeTicks);
|
||||
nbt.setInteger("recovery", recoveryTicks);
|
||||
nbt.setBoolean("interruptible", interruptible);
|
||||
@@ -627,6 +629,7 @@ public abstract class Ability implements IAbility {
|
||||
maxRange = nbt.getFloat("maxRange");
|
||||
cooldownTicks = nbt.getInteger("cooldown");
|
||||
windUpTicks = nbt.getInteger("windUp");
|
||||
dazedTicks = nbt.hasKey("dazed") ? nbt.getInteger("dazed") : 0;
|
||||
activeTicks = nbt.getInteger("active");
|
||||
recoveryTicks = nbt.getInteger("recovery");
|
||||
interruptible = nbt.getBoolean("interruptible");
|
||||
@@ -763,6 +766,16 @@ public abstract class Ability implements IAbility {
|
||||
this.windUpTicks = windUpTicks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDazedTicks() {
|
||||
return dazedTicks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDazedTicks(int ticks) {
|
||||
this.dazedTicks = ticks;
|
||||
}
|
||||
|
||||
public int getActiveTicks() {
|
||||
return activeTicks;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ public class NoppesUtilPlayer {
|
||||
if (dialog == null)
|
||||
return;
|
||||
DialogOption option = dialog.options.get(optionId);
|
||||
if (EventHooks.onDialogOption(player, new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog)))
|
||||
if (EventHooks.onDialogOption(player, new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog, optionId)))
|
||||
return;
|
||||
|
||||
if (!npc.isRemote()) {
|
||||
|
||||
@@ -8,16 +8,32 @@ import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public class DialogEvent extends PlayerEvent implements IDialogEvent {
|
||||
public final IDialog dialog;
|
||||
private final int optionId;
|
||||
|
||||
public DialogEvent(IPlayer player, IDialog dialog) {
|
||||
this(player, dialog, -1);
|
||||
}
|
||||
|
||||
public DialogEvent(IPlayer player, IDialog dialog, int optionId) {
|
||||
super(player);
|
||||
this.dialog = dialog;
|
||||
this.optionId = optionId;
|
||||
}
|
||||
|
||||
public IDialog getDialog() {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDialogId() {
|
||||
return dialog != null ? dialog.getId() : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOptionId() {
|
||||
return optionId;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_EVENT.function;
|
||||
}
|
||||
@@ -39,6 +55,10 @@ public class DialogEvent extends PlayerEvent implements IDialogEvent {
|
||||
super(player, dialog);
|
||||
}
|
||||
|
||||
public DialogOption(IPlayer player, IDialog dialog, int optionId) {
|
||||
super(player, dialog, optionId);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_OPTION.function;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user