mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 00:39:40 +00:00
Added IDialogImage, a scripted object which is used by IDialog. Used to add dialog images.
IDialog: -Added several new functions for dialogs' new visual attributes, as well as a way to add, get, create, remove, and clear dialog images. Global NPC events: -Added fields and variables from the old ScriptEvent events, in preparation to replace the old events with NpcEvent instances on local NPC scripts. -Fixed issue where some event hooks would run on remote worlds. Global NPC killed event: -Added droppedItems and expDropped fields. IWorld and NpcAPI: -Now always uses a non-remove WorldServer object to create ScriptWorld objects and add them to the world cache.
This commit is contained in:
1 parent
486e37cd7f
commit
8f16e6b20f
17 files changed
+710
-128
No files matched your search
@@ -259,18 +259,19 @@ public class NoppesUtilPlayer {
|
||||
Dialog dialog = DialogController.instance.dialogs.get(dialogId);
|
||||
if(dialog == null)
|
||||
return;
|
||||
|
||||
EventHooks.onDialogOption(new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
EventHooks.onNPCDialogClosed(npc,player,dialogId,optionId+1,dialog);
|
||||
|
||||
if(!dialog.hasDialogs(player) && !dialog.hasOtherOptions()) {
|
||||
EventHooks.onDialogClosed(new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
return;
|
||||
}
|
||||
DialogOption option = dialog.options.get(optionId);
|
||||
if(option == null || option.optionType == EnumOptionType.DialogOption && (!option.isAvailable(player) || !option.hasDialog()) || option.optionType == EnumOptionType.Disabled || option.optionType == EnumOptionType.QuitOption) {
|
||||
EventHooks.onDialogClosed(new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
return;
|
||||
if (!npc.isRemote()) {
|
||||
EventHooks.onDialogOption(new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
EventHooks.onNPCDialogClosed(npc, player, dialogId, optionId + 1, dialog);
|
||||
|
||||
if (!dialog.hasDialogs(player) && !dialog.hasOtherOptions()) {
|
||||
EventHooks.onDialogClosed(new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
return;
|
||||
}
|
||||
if (option == null || option.optionType == EnumOptionType.DialogOption && (!option.isAvailable(player) || !option.hasDialog()) || option.optionType == EnumOptionType.Disabled || option.optionType == EnumOptionType.QuitOption) {
|
||||
EventHooks.onDialogClosed(new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(option.optionType == EnumOptionType.RoleOption){
|
||||
if(npc.roleInterface != null)
|
||||
|
||||
Reference in new issue
Block a user