mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 02:13:04 +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,6 @@
|
||||
package noppes.npcs.scripted.interfaces.roles;
|
||||
|
||||
public interface IRole {
|
||||
|
||||
int getType();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package noppes.npcs.scripted.interfaces.roles;
|
||||
|
||||
public interface IRoleBank extends IRole {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package noppes.npcs.scripted.interfaces.roles;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
|
||||
public interface IRoleFollower extends IRole {
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param player Player who is set as the owner. If null given everything resets
|
||||
*/
|
||||
void setOwner(IPlayer player);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns the followers owner. Returns null if he has no owner or the owner is offline
|
||||
*/
|
||||
IPlayer getOwner();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower has an owner
|
||||
*/
|
||||
boolean hasOwner();
|
||||
|
||||
boolean isFollowing();
|
||||
|
||||
void setIsFollowing(boolean following);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns days left
|
||||
*/
|
||||
int getDaysLeft();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param days The days you want to add to the days remaining
|
||||
*/
|
||||
void addDaysLeft(int days);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not the follower is set to infinite days
|
||||
*/
|
||||
boolean getInfiniteDays();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param infinite Sets whether the days hired are infinite
|
||||
*/
|
||||
void setInfiniteDays(boolean infinite);
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Return whether the gui is disabled
|
||||
*/
|
||||
boolean getGuiDisabled();
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @param disabled Set the gui to be disabled or not
|
||||
*/
|
||||
void setGuiDisabled(boolean disabled);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package noppes.npcs.scripted.interfaces.roles;
|
||||
|
||||
public interface IRoleMailman extends IRole {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package noppes.npcs.scripted.interfaces.roles;
|
||||
|
||||
import noppes.npcs.scripted.interfaces.entity.IPlayer;
|
||||
import noppes.npcs.scripted.interfaces.item.IItemStack;
|
||||
|
||||
public interface IRoleTrader extends IRole {
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param currency2 Currency item number two
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
void setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold);
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
* @param currency Currency item
|
||||
* @param sold Item to be sold by this npc
|
||||
*/
|
||||
void setSellOption(int slot, IItemStack currency, IItemStack sold);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return The item being sold in this slot.
|
||||
*/
|
||||
IItemStack getSellOption(int slot);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return a ScriptItemStack array of size 2 which contains the currency of this trade
|
||||
*/
|
||||
IItemStack[] getCurrency(int slot);
|
||||
|
||||
/**
|
||||
* @param slot Slot number 0-17
|
||||
*/
|
||||
void removeSellOption(int slot);
|
||||
|
||||
/**
|
||||
* @param name The trader Linked Market name
|
||||
*/
|
||||
void setMarket(String name);
|
||||
|
||||
/**
|
||||
* @return Get the currently set Linked Market name
|
||||
*/
|
||||
String getMarket();
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return the number of times an item has been sold on that slot
|
||||
*/
|
||||
int getPurchaseNum(int slot);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param player
|
||||
* @return the number of times this player has purchased from this trader
|
||||
*/
|
||||
int getPurchaseNum(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* Sets the purchase count of all slots to 0
|
||||
*/
|
||||
void resetPurchaseNum();
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot to 0
|
||||
* @param slot
|
||||
*/
|
||||
void resetPurchaseNum(int slot);
|
||||
|
||||
/**
|
||||
* sets the purchase num for that slot and player to 0
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
void resetPurchaseNum(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @return if this slot is enabled
|
||||
*/
|
||||
boolean isSlotEnabled(int slot);
|
||||
|
||||
/**
|
||||
* @param slot
|
||||
* @param player
|
||||
* @return if this slot is enabled for this player
|
||||
*/
|
||||
boolean isSlotEnabled(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* prevent an item from being sold on that slot
|
||||
* @param slot
|
||||
*/
|
||||
void disableSlot(int slot);
|
||||
|
||||
/**
|
||||
* disables the slot for this player
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
void disableSlot(int slot, IPlayer player);
|
||||
|
||||
/**
|
||||
* allow an item to be sold on that slot
|
||||
* @param slot
|
||||
*/
|
||||
void enableSlot(int slot);
|
||||
|
||||
/**
|
||||
* enables the slot for this player
|
||||
* @param slot
|
||||
* @param player
|
||||
*/
|
||||
void enableSlot(int slot, IPlayer player);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package noppes.npcs.scripted.interfaces.roles;
|
||||
|
||||
public interface IRoleTransporter extends IRole {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user