Party Scripting / Better Party Objective Handling (Sync)

- IParty API
- PartyEvents and Registers
- Register Hooks to Player Scripts
This commit is contained in:
Kam committed 2024-03-06 05:05:16 -05:00
1 parent da9f77e9ba
commit 614c6ca474
13 files changed
+377 -49

No files matched your search

+44
View File
@@ -23,6 +23,7 @@ import noppes.npcs.api.IWorld;
import noppes.npcs.api.entity.IEntity;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.entity.IProjectile;
import noppes.npcs.api.event.IPartyEvent;
import noppes.npcs.api.gui.ICustomGui;
import noppes.npcs.api.gui.IItemSlot;
import noppes.npcs.api.item.IItemCustom;
@@ -765,4 +766,47 @@ public class EventHooks {
handler.callScript(EnumScriptType.TIMER, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyFinished(Party party, Quest quest){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
PartyEvent.PartyQuestCompletedEvent event = new PartyEvent.PartyQuestCompletedEvent(party, quest);
handler.callScript(EnumScriptType.PARTY_QUEST_COMPLETED, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyQuestSet(PartyEvent.PartyQuestSetEvent event){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
handler.callScript(EnumScriptType.PARTY_QUEST_SET, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyTurnIn(PartyEvent.PartyQuestTurnedInEvent event){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
handler.callScript(EnumScriptType.PARTY_QUEST_TURNED_IN, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyInvite(PartyEvent.PartyInviteEvent event){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
handler.callScript(EnumScriptType.PARTY_INVITE, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyKick(PartyEvent.PartyKickEvent event){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
handler.callScript(EnumScriptType.PARTY_KICK, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyLeave(PartyEvent.PartyLeaveEvent event){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
handler.callScript(EnumScriptType.PARTY_LEAVE, event);
NpcAPI.EVENT_BUS.post(event);
}
public static void onPartyDisband(PartyEvent.PartyDisbandEvent event){
PlayerDataScript handler = ScriptController.Instance.playerScripts;
handler.callScript(EnumScriptType.PARTY_DISBAND, event);
NpcAPI.EVENT_BUS.post(event);
}
}