diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index 16fbfa2a..232a6a62 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -206,9 +206,6 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc skillTreePoints.put(id, skillTreePoints.getOrDefault(id, 0) + val); } - public int countSkillTreePoints(SkillTree skillTree) { - return nodeLevels.keySet().stream().filter(node -> node.getTree().equals(skillTree)).mapToInt(nodeLevels::get).sum(); - } /** * Make a copy to make sure that the object @@ -262,7 +259,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc //Check the State of the node if (nodeStatus != NodeStatus.UNLOCKED && nodeStatus != NodeStatus.UNLOCKABLE) return false; - return getNodeLevel(node) < node.getMaxLevel() && (skillTreePoints.getOrDefault(node.getTree().getId(), 0) > 0 || skillTreePoints.getOrDefault("global", 0) > 0); + return getNodeLevel(node) < node.getMaxLevel() && (skillTreePoints.getOrDefault(node.getTree().getId(), 0) + skillTreePoints.getOrDefault("global", 0) >= node.getSkillTreePointsConsumed()); } /** @@ -277,10 +274,14 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc if (nodeStates.get(node) == NodeStatus.UNLOCKABLE) setNodeState(node, NodeStatus.UNLOCKED); - if (skillTreePoints.get(node.getTree().getId()) > 0) - withdrawSkillTreePoints(node.getTree().getId(), 1); - else - withdrawSkillTreePoints("global", 1); + int pointToWithdraw = node.getSkillTreePointsConsumed(); + if (skillTreePoints.get(node.getTree().getId()) > 0) { + int pointWithdrawn = Math.min(pointToWithdraw, skillTreePoints.get(node.getTree().getId())); + withdrawSkillTreePoints(node.getTree().getId(), pointWithdrawn); + pointToWithdraw -= pointWithdrawn; + } + if (pointToWithdraw > 0) + withdrawSkillTreePoints("global", pointToWithdraw); //We unload the nodeStates map (for the skill tree) and reload it completely for (SkillTreeNode node1 : node.getTree().getNodes()) nodeStates.remove(node1); @@ -335,7 +336,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc } public void setNodeLevel(SkillTreeNode node, int nodeLevel) { - int delta = nodeLevel - nodeLevels.getOrDefault(node, 0); + int delta = (nodeLevel - nodeLevels.getOrDefault(node, 0))*node.getSkillTreePointsConsumed(); pointSpent.put(node.getTree(), pointSpent.getOrDefault(node.getTree(), 0) + delta); nodeLevels.put(node, nodeLevel); } @@ -853,7 +854,6 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc new ConfigMessage("level-up").addPlaceholders("level", String.valueOf(level)).send(getPlayer()); MMOCore.plugin.soundManager.getSound(SoundEvent.LEVEL_UP).playTo(getPlayer()); new SmallParticleEffect(getPlayer(), Particle.SPELL_INSTANT); - //TEST } getStats().updateStats(); } @@ -953,7 +953,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc @Override public double getHealth() { - return isOnline() ? getPlayer().getHealth():health ; + return isOnline() ? getPlayer().getHealth() : health; } @Override diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/AttributesCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/AttributesCommand.java index a418202d..c3b756d3 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/AttributesCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/AttributesCommand.java @@ -18,6 +18,9 @@ public class AttributesCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.attributes")) + return false; + if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "This command is for players only."); return true; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/FriendsCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/FriendsCommand.java index d230ea74..b0b457f2 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/FriendsCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/FriendsCommand.java @@ -25,6 +25,8 @@ public class FriendsCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.friends")) + return false; if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "This command is for players only."); return true; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/GuildCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/GuildCommand.java index f1fd656b..7f0437ff 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/GuildCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/GuildCommand.java @@ -26,6 +26,8 @@ public class GuildCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.guild")) + return false; if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "This command is for players only."); return true; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PartyCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PartyCommand.java index d9f02a10..e398ece2 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PartyCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PartyCommand.java @@ -27,6 +27,8 @@ public class PartyCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.party")) + return false; if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "This command is for players only."); return true; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PlayerStatsCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PlayerStatsCommand.java index af2b8cef..6fd8c2e1 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PlayerStatsCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/PlayerStatsCommand.java @@ -18,6 +18,8 @@ public class PlayerStatsCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.profile")) + return false; if (!(sender instanceof Player)) { sender.sendMessage(ChatColor.RED + "This command is for players only."); return true; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/QuestsCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/QuestsCommand.java index 7946c3e9..56b81eae 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/QuestsCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/QuestsCommand.java @@ -17,6 +17,8 @@ public class QuestsCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.quests")) + return false; if (sender instanceof Player) { PlayerData data = PlayerData.get((Player) sender); MMOCommandEvent event = new MMOCommandEvent(data, "quests"); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillTreesCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillTreesCommand.java index ae53e0d9..bf1513a0 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillTreesCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillTreesCommand.java @@ -19,6 +19,8 @@ public class SkillTreesCommand extends RegisteredCommand { @Override public boolean execute(@NotNull CommandSender sender, String s, String[] args) { + if (!sender.hasPermission("mmocore.skilltrees")) + return false; if (!(sender instanceof Player player)) return false; PlayerData data = PlayerData.get(player); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillsCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillsCommand.java index 25429f56..2e3bf259 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillsCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/SkillsCommand.java @@ -18,6 +18,8 @@ public class SkillsCommand extends RegisteredCommand { @Override public boolean execute(CommandSender sender, String label, String[] args) { + if (!sender.hasPermission("mmocore.skills")) + return false; if (sender instanceof Player) { PlayerData data = PlayerData.get((Player) sender); MMOCommandEvent event = new MMOCommandEvent(data, "skills"); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/api/ToggleableCommand.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/api/ToggleableCommand.java index 8e43385a..bfad893b 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/api/ToggleableCommand.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/command/api/ToggleableCommand.java @@ -32,7 +32,7 @@ public enum ToggleableCommand { PARTY("party", "Invite players in a party to split exp", config -> new PartyCommand(config)), GUILD("guild", "Show players in current guild", config -> new GuildCommand(config)), WITHDRAW("withdraw", "Withdraw money into coins and notes", config -> new WithdrawCommand(config), v -> MMOCore.plugin.hasEconomy() && MMOCore.plugin.economy.isValid(), "w"), - SKILL_TREES("skiltrees", "Open up the skill tree menu", config -> new SkillTreesCommand(config), "st", "trees", "tree"), + SKILL_TREES("skilltrees", "Open up the skill tree menu", config -> new SkillTreesCommand(config), "st", "trees", "tree"), DEPOSIT("deposit", "Open the currency deposit menu", config -> new DepositCommand(config), "d"), PVP_MODE("pvpmode", "Toggle on/off PVP mode.", config -> new PvpModeCommand(config), "pvp"); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassConfirmation.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassConfirmation.java index d5b81205..20068519 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassConfirmation.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassConfirmation.java @@ -26,9 +26,9 @@ public class ClassConfirmation extends EditableInventory { private final PlayerClass playerClass; - public ClassConfirmation(PlayerClass playerClass) { - super("class-confirm-"+ UtilityMethods.ymlName(playerClass.getId())); - this.playerClass=playerClass; + public ClassConfirmation(PlayerClass playerClass, boolean isDefault) { + super("class-confirm-" + (isDefault ? "default" : UtilityMethods.ymlName(playerClass.getId()))); + this.playerClass = playerClass; } @Override diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassSelect.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassSelect.java index 083cd6b0..58f816a4 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassSelect.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/ClassSelect.java @@ -64,9 +64,6 @@ public class ClassSelect extends EditableInventory { @Override public ItemStack display(ProfessSelectionInventory inv, int n) { - if (n >= inv.classes.size()) - return null; - ItemStack item = playerClass.getIcon(); ItemMeta meta = item.getItemMeta(); if (hideFlags()) @@ -93,6 +90,8 @@ public class ClassSelect extends EditableInventory { item.setItemMeta(meta); return item; } + + } public class ProfessSelectionInventory extends GeneratedInventory { diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SkillTreeViewer.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SkillTreeViewer.java index 7f52fcac..34d05689 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SkillTreeViewer.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SkillTreeViewer.java @@ -248,6 +248,7 @@ public class SkillTreeViewer extends EditableInventory { holders.register("max-level", node.getMaxLevel()); holders.register("max-children", node.getMaxChildren()); holders.register("size", node.getSize()); + holders.register("point-consumed", node.getSkillTreePointsConsumed()); } int maxPointSpent = inv.getSkillTree().getMaxPointSpent(); holders.register("max-point-spent", maxPointSpent == Integer.MAX_VALUE ? "∞" : maxPointSpent); @@ -367,7 +368,7 @@ public class SkillTreeViewer extends EditableInventory { open(); } if (item.getFunction().equals("reallocation")) { - int spent = playerData.countSkillTreePoints(skillTree); + int spent = playerData.getPointSpent(skillTree); if (spent < 1) { MMOCore.plugin.configManager.getSimpleMessage("no-skill-tree-points-spent").send(player); MMOCore.plugin.soundManager.getSound(SoundEvent.NOT_ENOUGH_POINTS).playTo(getPlayer()); @@ -381,7 +382,7 @@ public class SkillTreeViewer extends EditableInventory { event.setCancelled(true); return; } else { - int reallocated = playerData.countSkillTreePoints(skillTree); + int reallocated = playerData.getPointSpent(skillTree); //We remove all the nodeStates progress playerData.giveSkillTreePoints(skillTree.getId(), reallocated); playerData.giveSkillTreeReallocationPoints(-1); @@ -446,7 +447,7 @@ public class SkillTreeViewer extends EditableInventory { //Else the player doesn't doesn't have the skill tree points else { - MMOCore.plugin.configManager.getSimpleMessage("not-enough-skill-tree-points").send(player); + MMOCore.plugin.configManager.getSimpleMessage("not-enough-skill-tree-points", "point", "" + node.getSkillTreePointsConsumed()).send(player); MMOCore.plugin.soundManager.getSound(SoundEvent.NOT_ENOUGH_POINTS).playTo(getPlayer()); event.setCancelled(true); return; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassConfirmation.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassConfirmation.java deleted file mode 100644 index 3255868d..00000000 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassConfirmation.java +++ /dev/null @@ -1,77 +0,0 @@ -package net.Indyuce.mmocore.gui; - -import net.Indyuce.mmocore.MMOCore; -import net.Indyuce.mmocore.api.player.PlayerData; -import net.Indyuce.mmocore.gui.api.EditableInventory; -import net.Indyuce.mmocore.gui.api.GeneratedInventory; -import net.Indyuce.mmocore.gui.api.InventoryClickContext; -import net.Indyuce.mmocore.gui.api.PluginInventory; -import net.Indyuce.mmocore.gui.api.item.InventoryItem; -import net.Indyuce.mmocore.gui.api.item.Placeholders; -import net.Indyuce.mmocore.gui.api.item.SimplePlaceholderItem; -import net.Indyuce.mmocore.api.event.PlayerChangeClassEvent; -import net.Indyuce.mmocore.api.player.profess.PlayerClass; -import net.Indyuce.mmocore.api.SoundEvent; -import org.bukkit.Bukkit; -import org.bukkit.configuration.ConfigurationSection; - -public class SubclassConfirmation extends EditableInventory { - public SubclassConfirmation() { - super("subclass-confirm"); - } - - @Override - public InventoryItem load(String function, ConfigurationSection config) { - return function.equalsIgnoreCase("yes") ? new InventoryItem(config) { - - @Override - public Placeholders getPlaceholders(SubclassConfirmationInventory inv, int n) { - - Placeholders holders = new Placeholders(); - holders.register("class", inv.profess.getName()); - return holders; - } - } : new SimplePlaceholderItem(config); - } - - public GeneratedInventory newInventory(PlayerData data, PlayerClass profess, PluginInventory last) { - return new SubclassConfirmationInventory(data, this, profess, last); - } - - public class SubclassConfirmationInventory extends GeneratedInventory { - private final PlayerClass profess; - private final PluginInventory last; - - public SubclassConfirmationInventory(PlayerData playerData, EditableInventory editable, PlayerClass profess, PluginInventory last) { - super(playerData, editable); - - this.profess = profess; - this.last = last; - } - - @Override - public void whenClicked(InventoryClickContext context, InventoryItem item) { - - if (item.getFunction().equals("back")) - last.open(); - - else if (item.getFunction().equals("yes")) { - - PlayerChangeClassEvent called = new PlayerChangeClassEvent(playerData, profess); - Bukkit.getPluginManager().callEvent(called); - if (called.isCancelled()) - return; - - playerData.setClass(profess); - MMOCore.plugin.configManager.getSimpleMessage("class-select", "class", profess.getName()).send(player); - MMOCore.plugin.soundManager.getSound(SoundEvent.SELECT_CLASS).playTo(player); - player.closeInventory(); - } - } - - @Override - public String calculateName() { - return getName(); - } - } -} diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java index 7625b214..0dec5911 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/gui/SubclassSelect.java @@ -1,8 +1,7 @@ package net.Indyuce.mmocore.gui; import io.lumine.mythic.lib.MythicLib; -import io.lumine.mythic.lib.api.item.ItemTag; -import io.lumine.mythic.lib.api.item.NBTItem; +import io.lumine.mythic.lib.UtilityMethods; import net.Indyuce.mmocore.MMOCore; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.gui.api.EditableInventory; @@ -15,116 +14,118 @@ import net.Indyuce.mmocore.api.player.profess.PlayerClass; import net.Indyuce.mmocore.api.ConfigMessage; import net.Indyuce.mmocore.api.SoundEvent; import net.Indyuce.mmocore.api.player.profess.Subclass; +import org.apache.commons.lang.Validate; import org.bukkit.Material; +import org.bukkit.NamespacedKey; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; +import org.bukkit.persistence.PersistentDataType; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; public class SubclassSelect extends EditableInventory { - public SubclassSelect() { - super("subclass-select"); - } + public SubclassSelect() { + super("subclass-select"); + } - @Override - public InventoryItem load(String function, ConfigurationSection config) { - return function.equals("class") ? new ClassItem(config) : new SimplePlaceholderItem(config); - } + @Override + public InventoryItem load(String function, ConfigurationSection config) { + return function.startsWith("sub-class") ? new ClassItem(config) : new SimplePlaceholderItem(config); + } - public GeneratedInventory newInventory(PlayerData data) { - return new SubclassSelectionInventory(data, this); - } + public GeneratedInventory newInventory(PlayerData data) { + return new SubclassSelectionInventory(data, this); + } - public class ClassItem extends SimplePlaceholderItem { - private final String name; - private final List lore; + public class ClassItem extends SimplePlaceholderItem { + private final String name; + private final List lore; + private final PlayerClass playerClass; - public ClassItem(ConfigurationSection config) { - super(Material.BARRIER, config); + public ClassItem(ConfigurationSection config) { + super(Material.BARRIER, config); + Validate.isTrue(config.getString("function").length() > 10, "Couldn't find the class associated to: " + config.getString("function")); + String classId = UtilityMethods.enumName(config.getString("function").substring(10)); + this.playerClass = Objects.requireNonNull(MMOCore.plugin.classManager.get(classId), classId + " does not correspond to any classId."); + this.name = config.getString("name"); + this.lore = config.getStringList("lore"); + } - this.name = config.getString("name"); - this.lore = config.getStringList("lore"); - } + public boolean hasDifferentDisplay() { + return true; + } - @Override - public boolean hasDifferentDisplay() { - return true; - } + @Override + public ItemStack display(SubclassSelectionInventory inv, int n) { + ItemStack item = playerClass.getIcon(); + ItemMeta meta = item.getItemMeta(); + if (hideFlags()) + meta.addItemFlags(ItemFlag.values()); + meta.setDisplayName(MythicLib.plugin.parseColors(name).replace("{name}", playerClass.getName())); + List lore = new ArrayList<>(this.lore); - @Override - public ItemStack display(SubclassSelectionInventory inv, int n) { - if (n >= inv.subclasses.size()) - return null; + int index = lore.indexOf("{lore}"); + if (index >= 0) { + lore.remove(index); + for (int j = 0; j < playerClass.getDescription().size(); j++) + lore.add(index + j, playerClass.getDescription().get(j)); + } - PlayerClass profess = inv.subclasses.get(n).getProfess(); + index = lore.indexOf("{attribute-lore}"); + if (index >= 0) { + lore.remove(index); + for (int j = 0; j < playerClass.getAttributeDescription().size(); j++) + lore.add(index + j, playerClass.getAttributeDescription().get(j)); + } - ItemStack item = profess.getIcon(); - ItemMeta meta = item.getItemMeta(); - meta.setDisplayName(MythicLib.plugin.parseColors(name).replace("{name}", profess.getName())); - List lore = new ArrayList<>(this.lore); + meta.getPersistentDataContainer().set(new NamespacedKey(MMOCore.plugin, "class_id"), PersistentDataType.STRING, playerClass.getId()); + meta.setLore(lore); + item.setItemMeta(meta); + return item; + } - int index = lore.indexOf("{lore}"); - if (index >= 0) { - lore.remove(index); - for (int j = 0; j < profess.getDescription().size(); j++) - lore.add(index + j, profess.getDescription().get(j)); - } + @Override + public boolean canDisplay(SubclassSelectionInventory inv) { + return inv.getPlayerData().getProfess().hasSubclass(playerClass); + } + } - index = lore.indexOf("{attribute-lore}"); - if (index >= 0) { - lore.remove(index); - for (int j = 0; j < profess.getAttributeDescription().size(); j++) - lore.add(index + j, profess.getAttributeDescription().get(j)); - } + public class SubclassSelectionInventory extends GeneratedInventory { + private final List subclasses; - meta.setLore(lore); - item.setItemMeta(meta); - return NBTItem.get(item).addTag(new ItemTag("classId", profess.getId())).toItem(); - } + public SubclassSelectionInventory(PlayerData playerData, EditableInventory editable) { + super(playerData, editable); - @Override - public boolean canDisplay(SubclassSelectionInventory inv) { - return true; - } - } + subclasses = playerData.getProfess().getSubclasses().stream().filter(sub -> playerData.getLevel() >= sub.getLevel()) + .collect(Collectors.toList()); + } - public class SubclassSelectionInventory extends GeneratedInventory { - private final List subclasses; + @Override + public String calculateName() { + return getName(); + } - public SubclassSelectionInventory(PlayerData playerData, EditableInventory editable) { - super(playerData, editable); + @Override + public void whenClicked(InventoryClickContext context, InventoryItem item) { + if (item.getFunction().equals("back")) + InventoryManager.CLASS_SELECT.newInventory(playerData).open(); - subclasses = playerData.getProfess().getSubclasses().stream().filter(sub -> playerData.getLevel() >= sub.getLevel()) - .collect(Collectors.toList()); - } + if (item.getFunction().startsWith("sub-class")) { + String classId= item.getFunction().substring(10); - @Override - public String calculateName() { - return getName(); - } - - @Override - public void whenClicked(InventoryClickContext context, InventoryItem item) { - if (item.getFunction().equals("back")) - InventoryManager.CLASS_SELECT.newInventory(playerData).open(); - - if (item.getFunction().equals("class")) { - String tag = NBTItem.get(context.getClickedItem()).getString("classId"); - if (tag.equals("")) - return; - - if (playerData.getClassPoints() < 1) { - player.closeInventory(); - MMOCore.plugin.soundManager.getSound(SoundEvent.CANT_SELECT_CLASS).playTo(getPlayer()); - new ConfigMessage("cant-choose-new-class").send(player); - return; - } - - InventoryManager.SUBCLASS_CONFIRM.newInventory(playerData, MMOCore.plugin.classManager.get(tag), this).open(); - } - } - } + if (playerData.getClassPoints() < 1) { + player.closeInventory(); + MMOCore.plugin.soundManager.getSound(SoundEvent.CANT_SELECT_CLASS).playTo(getPlayer()); + new ConfigMessage("cant-choose-new-class").send(player); + return; + } + InventoryManager.CLASS_CONFIRM.get(classId).newInventory(playerData, this).open(); + } + } + } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java index 26e3911c..eab332ab 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java @@ -182,12 +182,19 @@ public class ConfigManager { } public void loadDefaultFile(String path, String name) { - String newPath = path.isEmpty() ? "" : "/" + path; - File folder = new File(MMOCore.plugin.getDataFolder() + (newPath)); - if (!folder.exists()) folder.mkdir(); + String newPath =""; + if(!path.isEmpty()){ + String[] subpaths = path.split("/"); + for (String subpath : subpaths) { + newPath+="/"+subpath; + File folder = new File(MMOCore.plugin.getDataFolder() + (newPath)); + if (!folder.exists()) folder.mkdir(); + } + } File file = new File(MMOCore.plugin.getDataFolder() + (newPath), name); if (!file.exists()) try { + MMOCore.log("default/" + (path.isEmpty() ? "" : path + "/") + name); Files.copy(MMOCore.plugin.getResource("default/" + (path.isEmpty() ? "" : path + "/") + name), file.getAbsoluteFile().toPath()); } catch (IOException e) { e.printStackTrace(); diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java index 4d931033..e043636a 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/InventoryManager.java @@ -22,7 +22,6 @@ public class InventoryManager { public static final ClassSelect CLASS_SELECT = new ClassSelect(); public static final SubclassSelect SUBCLASS_SELECT = new SubclassSelect(); public static final Map CLASS_CONFIRM = new HashMap<>(); - public static final SubclassConfirmation SUBCLASS_CONFIRM = new SubclassConfirmation(); public static final WaypointViewer WAYPOINTS = new WaypointViewer(); public static final EditableFriendList FRIEND_LIST = new EditableFriendList(); public static final EditableFriendRemoval FRIEND_REMOVAL = new EditableFriendRemoval(); @@ -33,22 +32,39 @@ public class InventoryManager { public static final QuestViewer QUEST_LIST = new QuestViewer(); public static final AttributeView ATTRIBUTE_VIEW = new AttributeView(); public static final SkillTreeViewer TREE_VIEW = new SkillTreeViewer(); - public static final List list = new ArrayList(Arrays.asList(PLAYER_STATS, ATTRIBUTE_VIEW, TREE_VIEW, SKILL_LIST, CLASS_SELECT, SUBCLASS_SELECT, SUBCLASS_CONFIRM, QUEST_LIST, WAYPOINTS, FRIEND_LIST, FRIEND_REMOVAL, PARTY_VIEW, PARTY_CREATION, GUILD_VIEW, GUILD_CREATION)); + + public static final List list = new ArrayList(Arrays.asList(PLAYER_STATS, ATTRIBUTE_VIEW, TREE_VIEW, SKILL_LIST, CLASS_SELECT, SUBCLASS_SELECT, QUEST_LIST, WAYPOINTS, FRIEND_LIST, FRIEND_REMOVAL, PARTY_VIEW, PARTY_CREATION, GUILD_VIEW, GUILD_CREATION)); + + private static List defaultClass = Arrays.asList(new String[]{"human", "mage", "paladin", "warrior", "rogue", "arcane-mage"}); public static void load() { + String classConfirmFolder = "gui/class-confirm"; + try { + MMOCore.plugin.configManager.loadDefaultFile(classConfirmFolder, "class-confirm-default.yml"); + } catch (Exception exception) { + MMOCore.log(Level.WARNING, "Could not load inventory 'class-confirm/class-confirm-default" + "': " + exception.getMessage()); + } for (PlayerClass playerClass : MMOCore.plugin.classManager.getAll()) { - ClassConfirmation GUI = new ClassConfirmation(playerClass); + String classId = MMOCoreUtils.ymlName(playerClass.getId()); + ConfigFile configFile = new ConfigFile(classConfirmFolder, "class-confirm-" + classId); + ClassConfirmation GUI; + if (configFile.exists()) + GUI = new ClassConfirmation(playerClass, false); + else { + GUI = new ClassConfirmation(playerClass, true); + } CLASS_CONFIRM.put(MMOCoreUtils.ymlName(playerClass.getId()), GUI); - list.add(GUI); + GUI.reload(new ConfigFile("/" +classConfirmFolder, GUI.getId()).getConfig()); } - list.forEach(inv -> { - String folder="gui"+(inv instanceof ClassConfirmation?"/class-confirm":""); + list.forEach(inv -> + { + String folder = "gui" + (inv instanceof ClassConfirmation ? "/class-confirm" : ""); try { MMOCore.plugin.configManager.loadDefaultFile(folder, inv.getId() + ".yml"); - inv.reload(new ConfigFile("/"+folder, inv.getId()).getConfig()); + inv.reload(new ConfigFile("/" + folder, inv.getId()).getConfig()); } catch (Exception exception) { - MMOCore.log(Level.WARNING, "Could not load inventory '" +(inv instanceof ClassConfirmation?"class-confirm/":""+ inv.getId() + "': " + exception.getMessage())); + MMOCore.log(Level.WARNING, "Could not load inventory '" + (inv instanceof ClassConfirmation ? "class-confirm/" : "") + inv.getId() + "': " + exception.getMessage()); } }); } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java index 5dbf9cb8..37b1e4e4 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skilltree/SkillTreeNode.java @@ -22,6 +22,10 @@ public class SkillTreeNode implements ExperienceObject { private final SkillTree tree; private final String name, id; private IntegerCoordinates coordinates; + /** + * The number of skill tree points this node requires. + */ + private final int skillTreePointsConsumed; private boolean isRoot; /** @@ -56,7 +60,8 @@ public class SkillTreeNode implements ExperienceObject { name = Objects.requireNonNull(config.getString("name"), "Could not find node name"); size = Objects.requireNonNull(config.getInt("size")); isRoot = config.getBoolean("is-root", false); - + skillTreePointsConsumed=config.getInt("point-consumed",1); + Validate.isTrue(skillTreePointsConsumed>0,"The skill tree points consumed by a node must be greater than 0."); if (config.contains("lores")) for (String key : config.getConfigurationSection("lores").getKeys(false)) try { @@ -100,6 +105,10 @@ public class SkillTreeNode implements ExperienceObject { children.add(child); } + public int getSkillTreePointsConsumed() { + return skillTreePointsConsumed; + } + public void setCoordinates(IntegerCoordinates coordinates) { this.coordinates = coordinates; } @@ -112,6 +121,7 @@ public class SkillTreeNode implements ExperienceObject { return softParents.containsKey(parent) || strongParents.containsKey(parent); } + public int getMaxLevel() { return maxLevel; } diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-arcane-mage.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-default.yml similarity index 100% rename from MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-arcane-mage.yml rename to MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-default.yml diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-human.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-human.yml deleted file mode 100644 index 9a3d74e3..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-human.yml +++ /dev/null @@ -1,38 +0,0 @@ -# GUI display name, used by default -name: 'Confirmation: {class}' - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - function: 'yes' - - # Displayed when the player had already selected this class - # before (only if class slots are enabled in the config). - unlocked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: - - '' - - '&7Class Level: &e{level}' - - '&7Progression: &e{exp} / {next_level}' - - '&8[&e{progress}&8] &e{percent}%' - - '' - - '&7Skill Points: &6{skill_points}' - - '&7Skills You Unlocked: &6{unlocked_skills}&7/&6{class_skills}' - - # Displayed when the class is being chosen for the first time. - locked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: {} - - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-mage.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-mage.yml deleted file mode 100644 index 5c06c186..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-mage.yml +++ /dev/null @@ -1,38 +0,0 @@ -# GUI display name, used by default -name: 'Confirmation: {class}' - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - function: 'yes' - - # Displayed when the player had already selected this class - # before (only if class slots are enabled in the config). - unlocked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: - - '' - - '&7Class Level: &e{level}' - - '&7Progression: &e{exp} / {next_level}' - - '&8[&e{progress}&8] &e{percent}%' - - '' - - '&7Skill Points: &6{skill_points}' - - '&7Skills You Unlocked: &6{unlocked_skills}&7/&6{class_skills}' - - # Displayed when the class is being chosen for the first time. - locked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: {} - - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-marksman.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-marksman.yml deleted file mode 100644 index 5c06c186..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-marksman.yml +++ /dev/null @@ -1,38 +0,0 @@ -# GUI display name, used by default -name: 'Confirmation: {class}' - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - function: 'yes' - - # Displayed when the player had already selected this class - # before (only if class slots are enabled in the config). - unlocked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: - - '' - - '&7Class Level: &e{level}' - - '&7Progression: &e{exp} / {next_level}' - - '&8[&e{progress}&8] &e{percent}%' - - '' - - '&7Skill Points: &6{skill_points}' - - '&7Skills You Unlocked: &6{unlocked_skills}&7/&6{class_skills}' - - # Displayed when the class is being chosen for the first time. - locked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: {} - - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-paladin.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-paladin.yml deleted file mode 100644 index 5c06c186..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-paladin.yml +++ /dev/null @@ -1,38 +0,0 @@ -# GUI display name, used by default -name: 'Confirmation: {class}' - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - function: 'yes' - - # Displayed when the player had already selected this class - # before (only if class slots are enabled in the config). - unlocked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: - - '' - - '&7Class Level: &e{level}' - - '&7Progression: &e{exp} / {next_level}' - - '&8[&e{progress}&8] &e{percent}%' - - '' - - '&7Skill Points: &6{skill_points}' - - '&7Skills You Unlocked: &6{unlocked_skills}&7/&6{class_skills}' - - # Displayed when the class is being chosen for the first time. - locked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: {} - - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-rogue.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-rogue.yml deleted file mode 100644 index 5c06c186..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-rogue.yml +++ /dev/null @@ -1,38 +0,0 @@ -# GUI display name, used by default -name: 'Confirmation: {class}' - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - function: 'yes' - - # Displayed when the player had already selected this class - # before (only if class slots are enabled in the config). - unlocked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: - - '' - - '&7Class Level: &e{level}' - - '&7Progression: &e{exp} / {next_level}' - - '&8[&e{progress}&8] &e{percent}%' - - '' - - '&7Skill Points: &6{skill_points}' - - '&7Skills You Unlocked: &6{unlocked_skills}&7/&6{class_skills}' - - # Displayed when the class is being chosen for the first time. - locked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: {} - - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-warrior.yml b/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-warrior.yml deleted file mode 100644 index 5c06c186..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/class-confirm/class-confirm-warrior.yml +++ /dev/null @@ -1,38 +0,0 @@ -# GUI display name, used by default -name: 'Confirmation: {class}' - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - function: 'yes' - - # Displayed when the player had already selected this class - # before (only if class slots are enabled in the config). - unlocked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: - - '' - - '&7Class Level: &e{level}' - - '&7Progression: &e{exp} / {next_level}' - - '&8[&e{progress}&8] &e{percent}%' - - '' - - '&7Skill Points: &6{skill_points}' - - '&7Skills You Unlocked: &6{unlocked_skills}&7/&6{class_skills}' - - # Displayed when the class is being chosen for the first time. - locked: - item: GREEN_TERRACOTTA - name: '&aSelect {class}' - lore: {} - - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/skill-tree.yml b/MMOCore-Dist/src/main/resources/default/gui/skill-tree.yml index 230034df..ce9abe2c 100644 --- a/MMOCore-Dist/src/main/resources/default/gui/skill-tree.yml +++ b/MMOCore-Dist/src/main/resources/default/gui/skill-tree.yml @@ -83,6 +83,7 @@ items: - '&7Current Level: &6{current-level}' - '&7Max Level: &6{max-level}' - '&7Max Children: &6{max-children}' + - '&7Points required: &6{point-consumed}' - '&7Size: &6{size}' - '--------------------' - '&7⧆ &6Requirements: ' diff --git a/MMOCore-Dist/src/main/resources/default/gui/subclass-confirm.yml b/MMOCore-Dist/src/main/resources/default/gui/subclass-confirm.yml deleted file mode 100644 index 772f7f1c..00000000 --- a/MMOCore-Dist/src/main/resources/default/gui/subclass-confirm.yml +++ /dev/null @@ -1,21 +0,0 @@ - -# GUI display name -name: Subclass Confirmation - -# Number of slots in your inventory. Must be -# between 9 and 54 and must be a multiple of 9. -slots: 27 - -items: - yes: - slots: [12] - item: GREEN_TERRACOTTA - function: 'yes' - name: '&aSelect {class}' - lore: {} - back: - slots: [14] - item: RED_TERRACOTTA - function: back - name: '&aBack' - lore: {} diff --git a/MMOCore-Dist/src/main/resources/default/gui/subclass-select.yml b/MMOCore-Dist/src/main/resources/default/gui/subclass-select.yml index e86d3c5c..66723f37 100644 --- a/MMOCore-Dist/src/main/resources/default/gui/subclass-select.yml +++ b/MMOCore-Dist/src/main/resources/default/gui/subclass-select.yml @@ -13,10 +13,10 @@ items: item: RED_STAINED_GLASS_PANE name: '&aBack to Class Selection' lore: [] - class: - slots: [13,12,14,11,15,10,16] - function: class - name: '&a&lThe {name}' + arcane-mage: + slots: [13] + function: sub-class-arcane-mage + name: '&a&lThe Arcane Mage' lore: - '{lore}' - '' diff --git a/MMOCore-Dist/src/main/resources/default/messages.yml b/MMOCore-Dist/src/main/resources/default/messages.yml index 06f11f18..00e11faf 100644 --- a/MMOCore-Dist/src/main/resources/default/messages.yml +++ b/MMOCore-Dist/src/main/resources/default/messages.yml @@ -216,7 +216,7 @@ no-skill-tree-points-spent: '&cYou have not spent any skill tree points.' locked-node: '&cThis skill is locked!' upgrade-skill-node: '&eYour skill node &6{skill-node} &eis now Level &6{level}&e!' skill-node-max-level-hit: '&cYou already hit the max level for that skill node.' -not-enough-skill-tree-points: '&cYou need one skill tree point.' +not-enough-skill-tree-points: '&cYou need {point} skill tree point.' reallocated-points: '&eYou successfully reset the skill tree {skill-tree}. &eYou now have &6{points} &eskill tree points.' not-skill-tree-reallocation-point: '&cYou do not have 1 skill tree reallocation point.' no-skill-tree: '&cYour class doesn''t have any skill tree.' diff --git a/MMOCore-Dist/src/main/resources/default/skill-trees/combat.yml b/MMOCore-Dist/src/main/resources/default/skill-trees/combat.yml index 9744e9ca..41d437ca 100644 --- a/MMOCore-Dist/src/main/resources/default/skill-trees/combat.yml +++ b/MMOCore-Dist/src/main/resources/default/skill-trees/combat.yml @@ -15,6 +15,7 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 experience-table: skilltree_cooldown_reduction5 lores: 0: @@ -27,6 +28,7 @@ nodes: a2: name: 'Cooldown Reduction' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_cooldown_reduction10 coordinates: @@ -41,6 +43,7 @@ nodes: a3: name: 'Cooldown Reduction' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_cooldown_reduction15 coordinates: @@ -57,6 +60,7 @@ nodes: b1: name: 'Critical Strike Chance' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_critical_strike_chance1 coordinates: @@ -71,6 +75,7 @@ nodes: b2: name: 'Critical Strike Chance' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_critical_strike_chance2 coordinates: @@ -85,6 +90,7 @@ nodes: b3: name: 'Critical Strike Chance' size: 1 + point-consumed: 1 max-children: 2 experience-table: skilltree_critical_strike_chance3 coordinates: @@ -101,6 +107,7 @@ nodes: c1: name: 'Life Steal' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_lifesteal1 coordinates: @@ -115,6 +122,7 @@ nodes: c2: name: 'Life Steal' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_lifesteal2 coordinates: @@ -129,6 +137,7 @@ nodes: c3: name: 'Life Steal' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_lifesteal2 coordinates: @@ -145,6 +154,7 @@ nodes: d1: name: 'Damage Reduction' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_damage_reduction1 coordinates: @@ -159,6 +169,7 @@ nodes: d2: name: 'Damage Reduction' size: 1 + point-consumed: 1 max-children: 2 experience-table: skilltree_damage_reduction2 coordinates: @@ -173,6 +184,7 @@ nodes: d3: name: 'Damage Reduction' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_damage_reduction2 coordinates: @@ -189,6 +201,7 @@ nodes: e1: name: 'Health Regeneration' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_health_regeneration1 coordinates: @@ -203,6 +216,7 @@ nodes: e2: name: 'Health Regeneration' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_health_regeneration2 coordinates: @@ -217,6 +231,7 @@ nodes: e3: name: 'Health Regeneration' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_health_regeneration2 coordinates: @@ -233,6 +248,7 @@ nodes: f1: name: 'Mana Regeneration' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_mana_regeneration1 coordinates: @@ -247,6 +263,7 @@ nodes: f2: name: 'Mana Regeneration' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_mana_regeneration2 coordinates: @@ -261,6 +278,7 @@ nodes: f3: name: 'Mana Regeneration' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_mana_regeneration2 coordinates: @@ -277,6 +295,7 @@ nodes: g1: name: 'Magic Damage' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_magic_damage1 coordinates: @@ -291,6 +310,7 @@ nodes: g2: name: 'Magic Damage' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_magic_damage2 coordinates: @@ -305,6 +325,7 @@ nodes: g3: name: 'Magic Damage' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_magic_damage2 coordinates: @@ -321,6 +342,7 @@ nodes: h1: name: 'Max Health' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_max_health2 coordinates: @@ -335,6 +357,7 @@ nodes: h2: name: 'Max Health' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_max_health4 coordinates: @@ -349,6 +372,7 @@ nodes: h3: name: 'Max Health' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_max_health4 coordinates: @@ -365,6 +389,7 @@ nodes: j1: name: 'Weapon Damage' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_weapon_damage2 coordinates: @@ -379,6 +404,7 @@ nodes: j2: name: 'Weapon Damage' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_weapon_damage4 coordinates: @@ -393,6 +419,7 @@ nodes: j3: name: 'Weapon Damage' size: 1 + point-consumed: 1 max-children: 1 experience-table: skilltree_weapon_damage4 coordinates: diff --git a/MMOCore-Dist/src/main/resources/default/skill-trees/general.yml b/MMOCore-Dist/src/main/resources/default/skill-trees/general.yml index 8fb6d043..24c382b2 100644 --- a/MMOCore-Dist/src/main/resources/default/skill-trees/general.yml +++ b/MMOCore-Dist/src/main/resources/default/skill-trees/general.yml @@ -18,6 +18,7 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 experience-table: skilltree_mana_regeneration1 lores: 0: @@ -36,6 +37,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_mana_regeneration2 lores: 0: @@ -54,6 +57,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_mana_regeneration2 lores: 0: @@ -71,6 +76,8 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_health_regeneration1 lores: 0: @@ -90,6 +97,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_health_regeneration2 lores: 0: @@ -109,6 +118,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_health_regeneration2 lores: 0: @@ -126,6 +137,8 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_cooldown_reduction5 lores: 0: @@ -145,6 +158,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_cooldown_reduction10 lores: 0: @@ -164,6 +179,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_cooldown_reduction15 lores: 0: @@ -186,6 +203,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_critical_strike_chance1 lores: 0: @@ -205,6 +224,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_critical_strike_chance2 lores: 0: @@ -224,6 +245,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_critical_strike_chance5 lores: 0: @@ -245,6 +268,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_damage_reduction1 lores: 0: @@ -264,6 +289,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_damage_reduction2 lores: 0: @@ -283,6 +310,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_damage_reduction2 lores: 0: @@ -303,6 +332,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_weapon_damage1 lores: 0: @@ -322,6 +353,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_weapon_damage2 lores: 0: @@ -341,6 +374,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_weapon_damage2 lores: 0: @@ -362,6 +397,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_lifesteal3 lores: 0: @@ -382,6 +419,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_max_health5 lores: 0: @@ -401,6 +440,8 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 + point-consumed: 1 experience-table: skilltree_magic_damage3 lores: 0: diff --git a/MMOCore-Dist/src/main/resources/default/skill-trees/mage-arcane-mage.yml b/MMOCore-Dist/src/main/resources/default/skill-trees/mage-arcane-mage.yml index 35b3d141..ed672c4f 100644 --- a/MMOCore-Dist/src/main/resources/default/skill-trees/mage-arcane-mage.yml +++ b/MMOCore-Dist/src/main/resources/default/skill-trees/mage-arcane-mage.yml @@ -18,6 +18,7 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 experience-table: skilltree_mana_regeneration1 lores: 0: @@ -36,6 +37,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_mana_regeneration2 lores: 0: @@ -54,6 +56,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_mana_regeneration2 lores: 0: @@ -75,6 +78,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_skill_damage5 lores: 0: @@ -93,6 +97,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_skill_damage5 lores: 0: @@ -111,6 +116,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_skill_damage10 lores: 0: @@ -132,6 +138,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_spell_vampirism2 lores: 0: @@ -150,6 +157,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_spell_vampirism2 lores: 0: @@ -168,6 +176,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_spell_vampirism6 lores: 0: @@ -189,6 +198,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_additional_experience2 lores: 0: @@ -207,6 +217,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_additional_experience3 lores: 0: @@ -225,6 +236,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_additional_experience5 lores: 0: @@ -246,6 +258,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_magic_damage_reduction5 lores: 0: @@ -264,6 +277,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_magic_damage_reduction5 lores: 0: @@ -282,6 +296,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_magic_damage_reduction10 lores: 0: @@ -303,6 +318,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_skill_critical_strike_chance5 lores: 0: @@ -321,6 +337,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_skill_critical_strike_chance10 lores: 0: @@ -339,6 +356,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_skill_critical_strike_chance15 lores: 0: @@ -360,6 +378,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_magic_damage1 lores: 0: @@ -378,6 +397,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_magic_damage2 lores: 0: @@ -396,6 +416,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_magic_damage2 lores: 0: diff --git a/MMOCore-Dist/src/main/resources/default/skill-trees/rogue-marksman.yml b/MMOCore-Dist/src/main/resources/default/skill-trees/rogue-marksman.yml index a661fb2f..768eafe8 100644 --- a/MMOCore-Dist/src/main/resources/default/skill-trees/rogue-marksman.yml +++ b/MMOCore-Dist/src/main/resources/default/skill-trees/rogue-marksman.yml @@ -18,6 +18,7 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 experience-table: skilltree_additional_experience2 lores: 0: @@ -36,6 +37,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_additional_experience3 lores: 0: @@ -54,6 +56,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_additional_experience5 lores: 0: @@ -75,6 +78,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_arrow_velocity10 lores: 0: @@ -93,6 +97,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_arrow_velocity15 lores: 0: @@ -111,6 +116,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_arrow_velocity25 lores: 0: @@ -132,6 +138,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_lifesteal1 lores: 0: @@ -150,6 +157,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_lifesteal2 lores: 0: @@ -168,6 +176,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_lifesteal2 lores: 0: @@ -189,6 +198,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_knockback_resistance5 lores: 0: @@ -207,6 +217,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_knockback_resistance5 lores: 0: @@ -225,6 +236,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_knockback_resistance10 lores: 0: @@ -246,6 +258,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_critical_strike_chance2 lores: 0: @@ -264,6 +277,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_critical_strike_chance3 lores: 0: @@ -282,6 +296,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_critical_strike_chance5 lores: 0: @@ -303,6 +318,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_movement_speed2 lores: 0: @@ -321,6 +337,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_movement_speed2 lores: 0: @@ -339,6 +356,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_movement_speed6 lores: 0: @@ -360,6 +378,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_projectile_damage2 lores: 0: @@ -378,6 +397,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_projectile_damage2 lores: 0: @@ -396,6 +416,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_projectile_damage6 lores: 0: diff --git a/MMOCore-Dist/src/main/resources/default/skill-trees/warrior-paladin.yml b/MMOCore-Dist/src/main/resources/default/skill-trees/warrior-paladin.yml index 1fce0b3a..21ba2cf5 100644 --- a/MMOCore-Dist/src/main/resources/default/skill-trees/warrior-paladin.yml +++ b/MMOCore-Dist/src/main/resources/default/skill-trees/warrior-paladin.yml @@ -18,6 +18,7 @@ nodes: max-level: 1 is-root: true size: 1 + point-consumed: 1 experience-table: skilltree_attack_speed5 lores: 0: @@ -36,6 +37,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_attack_speed10 lores: 0: @@ -54,6 +56,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_attack_speed15 lores: 0: @@ -75,6 +78,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_health_regeneration1 lores: 0: @@ -93,6 +97,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_health_regeneration2 lores: 0: @@ -111,6 +116,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_health_regeneration2 lores: 0: @@ -132,6 +138,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_physical_damage_reduction5 lores: 0: @@ -150,6 +157,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_physical_damage_reduction10 lores: 0: @@ -168,6 +176,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_physical_damage_reduction15 lores: 0: @@ -189,6 +198,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_parry_rating5 lores: 0: @@ -207,6 +217,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_parry_rating5 lores: 0: @@ -225,6 +236,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_parry_rating10 lores: 0: @@ -246,6 +258,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_knockback_resistance5 lores: 0: @@ -264,6 +277,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_knockback_resistance5 lores: 0: @@ -282,6 +296,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_knockback_resistance10 lores: 0: @@ -303,6 +318,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_dodge_rating2 lores: 0: @@ -321,6 +337,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_dodge_rating3 lores: 0: @@ -339,6 +356,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_dodge_rating5 lores: 0: @@ -360,6 +378,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_weapon_damage1 lores: 0: @@ -378,6 +397,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_weapon_damage2 lores: 0: @@ -396,6 +416,7 @@ nodes: max-level: 1 size: 1 + point-consumed: 1 experience-table: skilltree_weapon_damage2 lores: 0: diff --git a/MMOCore-Dist/src/main/resources/plugin.yml b/MMOCore-Dist/src/main/resources/plugin.yml index dbf24e51..152a94ca 100644 --- a/MMOCore-Dist/src/main/resources/plugin.yml +++ b/MMOCore-Dist/src/main/resources/plugin.yml @@ -27,3 +27,27 @@ permissions: mmocore.class-select: description: Access to /class default: op + mmocore.attributes: + description: Access to /attributes + default: true + mmocore.skills: + description: Access to /skills + default: true + mmocore.profile: + description: Access to /profile + default: true + mmocore.friends: + description: Access to /friends + default: true + mmocore.guild: + description: Access to /guild + default: true + mmocore.party: + description: Access to /party + default: true + mmocore.skilltrees: + description: Access to /skilltrees + default: true + mmocore.quests: + description: Access to /quests + default: true \ No newline at end of file