mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 13:09:11 +00:00
API Changes:
-Implemented interfaces for all jobs & roles. ScriptPlayer: -Added getData() function, which returns player data objects. IPlayerData: New class that holds all player data for modification. -Holds dialog, bank, quest, transport, faction, item giver, and mail data. -Also holds companion data, with functions has/set/getCompanion, and a getCompanionID function to differentiate companions.
This commit is contained in:
1 parent
587f63396f
commit
63a1525ee2
66 files changed
+1418
-207
No files matched your search
@@ -0,0 +1,4 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
public interface IPlayerBankData {
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
|
||||
public interface IPlayerData {
|
||||
|
||||
void setCompanion(ICustomNpc npc);
|
||||
|
||||
ICustomNpc getCompanion();
|
||||
|
||||
boolean hasCompanion();
|
||||
|
||||
int getCompanionID();
|
||||
|
||||
IPlayerDialogData getDialogData();
|
||||
|
||||
IPlayerBankData getBankData();
|
||||
|
||||
IPlayerQuestData getQuestData();
|
||||
|
||||
IPlayerTransportData getTransportData();
|
||||
|
||||
IPlayerFactionData getFactionData();
|
||||
|
||||
IPlayerItemGiverData getItemGiverData();
|
||||
|
||||
IPlayerMailData getMailData();
|
||||
|
||||
void save();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
public interface IPlayerDialogData {
|
||||
|
||||
boolean hasReadDialog(int id);
|
||||
|
||||
void readDialog(int id);
|
||||
|
||||
void unreadDialog(int id);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
public interface IPlayerFactionData {
|
||||
|
||||
int getPoints(int id);
|
||||
|
||||
void addPoints(int id, int points);
|
||||
|
||||
void setPoints(int id, int points);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.jobs.IJobItemGiver;
|
||||
|
||||
public interface IPlayerItemGiverData {
|
||||
|
||||
long getTime(IJobItemGiver jobItemGiver);
|
||||
|
||||
void setTime(IJobItemGiver jobItemGiver, long day);
|
||||
|
||||
boolean hasInteractedBefore(IJobItemGiver jobItemGiver);
|
||||
|
||||
IJobItemGiver[] getItemGivers();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.handler.data.IPlayerMail;
|
||||
|
||||
public interface IPlayerMailData {
|
||||
|
||||
boolean hasMail();
|
||||
|
||||
void addMail(IPlayerMail mail);
|
||||
|
||||
void removeMail(IPlayerMail mail);
|
||||
|
||||
boolean hasMail(IPlayerMail mail);
|
||||
|
||||
IPlayerMail[] getAllMail();
|
||||
|
||||
IPlayerMail[] getUnreadMail();
|
||||
|
||||
IPlayerMail[] getReadMail();
|
||||
|
||||
IPlayerMail[] getMailFrom(String sender);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.handler.data.IQuest;
|
||||
|
||||
public interface IPlayerQuestData {
|
||||
|
||||
IQuest getTrackedQuest();
|
||||
|
||||
void startQuest(int id);
|
||||
|
||||
void finishQuest(int id);
|
||||
|
||||
void stopQuest(int id);
|
||||
|
||||
void removeQuest(int id);
|
||||
|
||||
boolean hasFinishedQuest(int id);
|
||||
|
||||
public boolean hasActiveQuest(int id);
|
||||
|
||||
IQuest[] getActiveQuests();
|
||||
|
||||
IQuest[] getFinishedQuests();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.handler.data.ITransportLocation;
|
||||
|
||||
public interface IPlayerTransportData {
|
||||
|
||||
boolean hasTransport(int id);
|
||||
|
||||
void addTransport(int id);
|
||||
|
||||
void addTransport(ITransportLocation location);
|
||||
|
||||
ITransportLocation getTransport(int id);
|
||||
|
||||
ITransportLocation[] getTransports();
|
||||
|
||||
void removeTransport(int id);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package noppes.npcs.scripted.interfaces.handler;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.handler.data.ITransportCategory;
|
||||
|
||||
public interface ITransportHandler {
|
||||
|
||||
ITransportCategory[] categories();
|
||||
|
||||
void createCategory(String title);
|
||||
|
||||
ITransportCategory getCategory(String title);
|
||||
|
||||
void removeCategory(String title);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package noppes.npcs.scripted.interfaces.handler.data;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
|
||||
public interface IPlayerMail {
|
||||
|
||||
void setPageText(String[] pages);
|
||||
|
||||
String[] getPageText();
|
||||
|
||||
int getPageCount();
|
||||
|
||||
void setSender(String sender);
|
||||
|
||||
String getSender();
|
||||
|
||||
void setSubject(String subject);
|
||||
|
||||
String getSubject();
|
||||
|
||||
long getTimePast();
|
||||
|
||||
long getTimeSent();
|
||||
|
||||
boolean hasQuest();
|
||||
|
||||
IQuest getQuest();
|
||||
|
||||
IItemStack[] getItems();
|
||||
|
||||
void setItems(IItemStack[] items);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package noppes.npcs.scripted.interfaces.handler.data;
|
||||
|
||||
public interface ITransportCategory {
|
||||
|
||||
int getId();
|
||||
|
||||
void setTitle(String title);
|
||||
|
||||
String getTitle();
|
||||
|
||||
void addLocation(String name);
|
||||
|
||||
ITransportLocation getLocation(String name);
|
||||
|
||||
void removeLocation(String name);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package noppes.npcs.scripted.interfaces.handler.data;
|
||||
|
||||
public interface ITransportLocation {
|
||||
|
||||
int getId();
|
||||
|
||||
void setName(String name);
|
||||
|
||||
String getName();
|
||||
|
||||
void setDimension(int dimension);
|
||||
|
||||
int getDimension();
|
||||
|
||||
void setType(int type);
|
||||
|
||||
int getType();
|
||||
|
||||
void setPosition(int x, int y, int z);
|
||||
|
||||
double getX();
|
||||
|
||||
double getY();
|
||||
|
||||
double getZ();
|
||||
|
||||
void save();
|
||||
}
|
||||
Reference in new issue
Block a user