mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-24 00:15:16 +01:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/net/Indyuce/mmocore/loot/chest/LootChestRegion.java
This commit is contained in:
commit
116247fd70
@ -1,16 +1,12 @@
|
|||||||
package net.Indyuce.mmocore.api.load;
|
package net.Indyuce.mmocore.api.load;
|
||||||
|
|
||||||
import net.Indyuce.mmocore.experience.dispenser.ExperienceDispenser;
|
import net.Indyuce.mmocore.experience.dispenser.ExperienceDispenser;
|
||||||
|
import net.Indyuce.mmocore.loot.droptable.condition.*;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.block.BlockType;
|
import net.Indyuce.mmocore.api.block.BlockType;
|
||||||
import net.Indyuce.mmocore.api.block.SkullBlockType;
|
import net.Indyuce.mmocore.api.block.SkullBlockType;
|
||||||
import net.Indyuce.mmocore.api.block.VanillaBlockType;
|
import net.Indyuce.mmocore.api.block.VanillaBlockType;
|
||||||
import net.Indyuce.mmocore.loot.droptable.condition.BiomeCondition;
|
|
||||||
import net.Indyuce.mmocore.loot.droptable.condition.Condition;
|
|
||||||
import net.Indyuce.mmocore.loot.droptable.condition.LevelCondition;
|
|
||||||
import net.Indyuce.mmocore.loot.droptable.condition.PermissionCondition;
|
|
||||||
import net.Indyuce.mmocore.loot.droptable.condition.WorldCondition;
|
|
||||||
import net.Indyuce.mmocore.loot.droptable.dropitem.DropItem;
|
import net.Indyuce.mmocore.loot.droptable.dropitem.DropItem;
|
||||||
import net.Indyuce.mmocore.loot.droptable.dropitem.DropTableDropItem;
|
import net.Indyuce.mmocore.loot.droptable.dropitem.DropTableDropItem;
|
||||||
import net.Indyuce.mmocore.loot.droptable.dropitem.GoldDropItem;
|
import net.Indyuce.mmocore.loot.droptable.dropitem.GoldDropItem;
|
||||||
@ -109,6 +105,9 @@ public class DefaultMMOLoader extends MMOLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Condition loadCondition(MMOLineConfig config) {
|
public Condition loadCondition(MMOLineConfig config) {
|
||||||
|
if(config.getKey().equals("distance"))
|
||||||
|
return new DistanceCondition(config);
|
||||||
|
|
||||||
if (config.getKey().equals("world"))
|
if (config.getKey().equals("world"))
|
||||||
return new WorldCondition(config);
|
return new WorldCondition(config);
|
||||||
|
|
||||||
|
@ -457,9 +457,9 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
* Teleports the player to a specific waypoint. This applies
|
* Teleports the player to a specific waypoint. This applies
|
||||||
* the stellium waypoint cost and plays the teleport animation.
|
* the stellium waypoint cost and plays the teleport animation.
|
||||||
*
|
*
|
||||||
* @param waypoint Target waypoint
|
* @param target Target waypoint
|
||||||
*/
|
*/
|
||||||
public void warp(Waypoint waypoint, CostType costType) {
|
public void warp(Waypoint target, double cost) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This cooldown is only used internally to make sure the player is not
|
* This cooldown is only used internally to make sure the player is not
|
||||||
@ -467,8 +467,6 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
* player waypoints data
|
* player waypoints data
|
||||||
*/
|
*/
|
||||||
setLastActivity(PlayerActivity.USE_WAYPOINT);
|
setLastActivity(PlayerActivity.USE_WAYPOINT);
|
||||||
|
|
||||||
final double cost = waypoint.getCost(costType);
|
|
||||||
giveStellium(-cost, PlayerResourceUpdateEvent.UpdateReason.USE_WAYPOINT);
|
giveStellium(-cost, PlayerResourceUpdateEvent.UpdateReason.USE_WAYPOINT);
|
||||||
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@ -491,7 +489,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
|
|
||||||
MMOCore.plugin.configManager.getSimpleMessage("warping-comencing", "left", "" + ((120 - t) / 20)).send(getPlayer());
|
MMOCore.plugin.configManager.getSimpleMessage("warping-comencing", "left", "" + ((120 - t) / 20)).send(getPlayer());
|
||||||
if (t++ >= 100) {
|
if (t++ >= 100) {
|
||||||
getPlayer().teleport(waypoint.getLocation());
|
getPlayer().teleport(target.getLocation());
|
||||||
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20, 1, false, false));
|
getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20, 1, false, false));
|
||||||
MMOCore.plugin.soundManager.getSound(SoundEvent.WARP_TELEPORT).playTo(getPlayer());
|
MMOCore.plugin.soundManager.getSound(SoundEvent.WARP_TELEPORT).playTo(getPlayer());
|
||||||
cancel();
|
cancel();
|
||||||
@ -872,7 +870,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
* checks if they could potentially upgrade to one of these
|
* checks if they could potentially upgrade to one of these
|
||||||
*
|
*
|
||||||
* @return If the player can change its current class to
|
* @return If the player can change its current class to
|
||||||
* a subclass
|
* a subclass
|
||||||
*/
|
*/
|
||||||
public boolean canChooseSubclass() {
|
public boolean canChooseSubclass() {
|
||||||
for (Subclass subclass : getProfess().getSubclasses())
|
for (Subclass subclass : getProfess().getSubclasses())
|
||||||
|
@ -61,6 +61,7 @@ public enum StatType {
|
|||||||
// Utility
|
// Utility
|
||||||
ADDITIONAL_EXPERIENCE,
|
ADDITIONAL_EXPERIENCE,
|
||||||
COOLDOWN_REDUCTION,
|
COOLDOWN_REDUCTION,
|
||||||
|
CHANCE,
|
||||||
|
|
||||||
// Damage-type based stats
|
// Damage-type based stats
|
||||||
MAGIC_DAMAGE,
|
MAGIC_DAMAGE,
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package net.Indyuce.mmocore.gui;
|
package net.Indyuce.mmocore.gui;
|
||||||
|
|
||||||
import io.lumine.mythic.lib.api.item.ItemTag;
|
|
||||||
import io.lumine.mythic.lib.api.item.NBTItem;
|
|
||||||
import net.Indyuce.mmocore.MMOCore;
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerActivity;
|
import net.Indyuce.mmocore.api.player.PlayerActivity;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
@ -14,14 +12,17 @@ import net.Indyuce.mmocore.waypoint.CostType;
|
|||||||
import net.Indyuce.mmocore.waypoint.Waypoint;
|
import net.Indyuce.mmocore.waypoint.Waypoint;
|
||||||
import net.Indyuce.mmocore.waypoint.WaypointOption;
|
import net.Indyuce.mmocore.waypoint.WaypointOption;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class WaypointViewer extends EditableInventory {
|
public class WaypointViewer extends EditableInventory {
|
||||||
public WaypointViewer() {
|
public WaypointViewer() {
|
||||||
@ -65,7 +66,8 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
|
|
||||||
public class WaypointItem extends SimplePlaceholderItem<WaypointViewerInventory> {
|
public class WaypointItem extends SimplePlaceholderItem<WaypointViewerInventory> {
|
||||||
private final SimplePlaceholderItem noWaypoint, locked;
|
private final SimplePlaceholderItem noWaypoint, locked;
|
||||||
private final WaypointItemHandler availWaypoint, notLinked, notDynamic, noStellium;
|
private final WaypointItemHandler availWaypoint, noStellium, notLinked, notDynamic, currentWayPoint;
|
||||||
|
|
||||||
|
|
||||||
public WaypointItem(ConfigurationSection config) {
|
public WaypointItem(ConfigurationSection config) {
|
||||||
super(Material.BARRIER, config);
|
super(Material.BARRIER, config);
|
||||||
@ -74,15 +76,18 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
Validate.notNull(config.getConfigurationSection("locked"), "Could not load 'locked' config");
|
Validate.notNull(config.getConfigurationSection("locked"), "Could not load 'locked' config");
|
||||||
Validate.notNull(config.getConfigurationSection("not-a-destination"), "Could not load 'not-a-destination' config");
|
Validate.notNull(config.getConfigurationSection("not-a-destination"), "Could not load 'not-a-destination' config");
|
||||||
Validate.notNull(config.getConfigurationSection("not-dynamic"), "Could not load 'not-dynamic' config");
|
Validate.notNull(config.getConfigurationSection("not-dynamic"), "Could not load 'not-dynamic' config");
|
||||||
|
Validate.notNull(config.getConfigurationSection("current-waypoint"), "Could not load 'current-waypoint' config");
|
||||||
Validate.notNull(config.getConfigurationSection("not-enough-stellium"), "Could not load 'not-enough-stellium' config");
|
Validate.notNull(config.getConfigurationSection("not-enough-stellium"), "Could not load 'not-enough-stellium' config");
|
||||||
Validate.notNull(config.getConfigurationSection("display"), "Could not load 'display' config");
|
Validate.notNull(config.getConfigurationSection("display"), "Could not load 'display' config");
|
||||||
|
|
||||||
|
|
||||||
noWaypoint = new SimplePlaceholderItem(config.getConfigurationSection("no-waypoint"));
|
noWaypoint = new SimplePlaceholderItem(config.getConfigurationSection("no-waypoint"));
|
||||||
locked = new SimplePlaceholderItem(config.getConfigurationSection("locked"));
|
locked = new SimplePlaceholderItem(config.getConfigurationSection("locked"));
|
||||||
notLinked = new WaypointItemHandler(config.getConfigurationSection("not-a-destination"));
|
notLinked = new WaypointItemHandler(config.getConfigurationSection("not-a-destination"), true);
|
||||||
notDynamic = new WaypointItemHandler(config.getConfigurationSection("not-dynamic"));
|
notDynamic = new WaypointItemHandler(config.getConfigurationSection("not-dynamic"), true);
|
||||||
noStellium = new WaypointItemHandler(config.getConfigurationSection("not-enough-stellium"));
|
currentWayPoint = new WaypointItemHandler(config.getConfigurationSection("current-waypoint"), true);
|
||||||
availWaypoint = new WaypointItemHandler(config.getConfigurationSection("display"));
|
noStellium = new WaypointItemHandler(config.getConfigurationSection("not-enough-stellium"), false);
|
||||||
|
availWaypoint = new WaypointItemHandler(config.getConfigurationSection("display"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -99,28 +104,37 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
|
|
||||||
// Locked waypoint?
|
// Locked waypoint?
|
||||||
Waypoint waypoint = inv.waypoints.get(index);
|
Waypoint waypoint = inv.waypoints.get(index);
|
||||||
|
if (inv.current != null && inv.current.equals(waypoint))
|
||||||
|
return currentWayPoint.display(inv, n);
|
||||||
|
|
||||||
|
|
||||||
if (!inv.getPlayerData().hasWaypoint(waypoint))
|
if (!inv.getPlayerData().hasWaypoint(waypoint))
|
||||||
return locked.display(inv, n);
|
return locked.display(inv, n);
|
||||||
|
|
||||||
// Waypoints are not linked
|
// Waypoints are not linked
|
||||||
if (inv.current != null && !inv.current.hasDestination(waypoint))
|
if (inv.current != null && !inv.paths.containsKey(waypoint))
|
||||||
return notLinked.display(inv, n);
|
return notLinked.display(inv, n);
|
||||||
|
|
||||||
|
|
||||||
// Not dynamic waypoint
|
// Not dynamic waypoint
|
||||||
if (inv.current == null && !waypoint.hasOption(WaypointOption.DYNAMIC))
|
if (inv.current == null && !inv.paths.containsKey(waypoint))
|
||||||
return notDynamic.display(inv, n);
|
return notDynamic.display(inv, n);
|
||||||
|
|
||||||
// Stellium cost
|
//Normal cost
|
||||||
if (waypoint.getCost(inv.current == null ? CostType.DYNAMIC_USE : CostType.NORMAL_USE) > inv.getPlayerData().getStellium())
|
if (inv.paths.get(waypoint).getCost() > inv.getPlayerData().getStellium())
|
||||||
return noStellium.display(inv, n);
|
return noStellium.display(inv, n);
|
||||||
|
|
||||||
|
|
||||||
return availWaypoint.display(inv, n);
|
return availWaypoint.display(inv, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WaypointItemHandler extends InventoryItem<WaypointViewerInventory> {
|
public class WaypointItemHandler extends InventoryItem<WaypointViewerInventory> {
|
||||||
public WaypointItemHandler(ConfigurationSection config) {
|
private final boolean onlyName;
|
||||||
|
|
||||||
|
public WaypointItemHandler(ConfigurationSection config, boolean onlyName) {
|
||||||
super(config);
|
super(config);
|
||||||
|
this.onlyName = onlyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,7 +143,11 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
|
|
||||||
// If a player can teleport to another waypoint given his location
|
// If a player can teleport to another waypoint given his location
|
||||||
Waypoint waypoint = inv.waypoints.get(inv.page * inv.getEditable().getByFunction("waypoint").getSlots().size() + n);
|
Waypoint waypoint = inv.waypoints.get(inv.page * inv.getEditable().getByFunction("waypoint").getSlots().size() + n);
|
||||||
return NBTItem.get(disp).addTag(new ItemTag("waypointId", waypoint.getId())).toItem();
|
ItemMeta meta = disp.getItemMeta();
|
||||||
|
PersistentDataContainer container = meta.getPersistentDataContainer();
|
||||||
|
container.set(new NamespacedKey(MMOCore.plugin, "waypointId"), PersistentDataType.STRING, waypoint.getId());
|
||||||
|
disp.setItemMeta(meta);
|
||||||
|
return disp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -138,9 +156,12 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
|
|
||||||
Waypoint waypoint = inv.waypoints.get(inv.page * inv.getByFunction("waypoint").getSlots().size() + n);
|
Waypoint waypoint = inv.waypoints.get(inv.page * inv.getByFunction("waypoint").getSlots().size() + n);
|
||||||
holders.register("name", waypoint.getName());
|
holders.register("name", waypoint.getName());
|
||||||
holders.register("current_cost", decimal.format(waypoint.getCost(inv.waypointCostType)));
|
if (!onlyName) {
|
||||||
holders.register("normal_cost", decimal.format(waypoint.getCost(CostType.NORMAL_USE)));
|
holders.register("current_cost", inv.paths.get(waypoint).getCost());
|
||||||
holders.register("dynamic_cost", decimal.format(waypoint.getCost(CostType.DYNAMIC_USE)));
|
holders.register("normal_cost", decimal.format(inv.paths.containsKey(waypoint) ? inv.paths.get(waypoint).getCost() : Double.POSITIVE_INFINITY));
|
||||||
|
holders.register("dynamic_cost", decimal.format(waypoint.getDynamicCost()));
|
||||||
|
holders.register("intermediary_waypoints", inv.paths.containsKey(waypoint) ? inv.paths.get(waypoint).displayIntermediaryWayPoints(inv.waypointCostType.equals(CostType.DYNAMIC_USE)) : "none");
|
||||||
|
}
|
||||||
|
|
||||||
return holders;
|
return holders;
|
||||||
}
|
}
|
||||||
@ -149,6 +170,7 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
public class WaypointViewerInventory extends GeneratedInventory {
|
public class WaypointViewerInventory extends GeneratedInventory {
|
||||||
private final List<Waypoint> waypoints = new ArrayList<>(MMOCore.plugin.waypointManager.getAll());
|
private final List<Waypoint> waypoints = new ArrayList<>(MMOCore.plugin.waypointManager.getAll());
|
||||||
private final Waypoint current;
|
private final Waypoint current;
|
||||||
|
private final Map<Waypoint, Waypoint.PathInfo> paths = new HashMap<>();
|
||||||
private final CostType waypointCostType;
|
private final CostType waypointCostType;
|
||||||
|
|
||||||
private int page;
|
private int page;
|
||||||
@ -157,6 +179,31 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
super(playerData, editable);
|
super(playerData, editable);
|
||||||
|
|
||||||
this.current = current;
|
this.current = current;
|
||||||
|
if (current != null) {
|
||||||
|
for (Waypoint.PathInfo pathInfo : current.getAllPath())
|
||||||
|
paths.put(pathInfo.getFinalWaypoint(), pathInfo);
|
||||||
|
}
|
||||||
|
if (current == null) {
|
||||||
|
|
||||||
|
//Iterate through all the dynamic points and find all the points it is linked to and the path
|
||||||
|
HashMap<Waypoint, Double> dynamicPoints = new HashMap<>();
|
||||||
|
//We first check all the dynamic waypoints
|
||||||
|
for (Waypoint waypoint : waypoints) {
|
||||||
|
if (waypoint.canHaveDynamicUse(playerData.getPlayer())) {
|
||||||
|
paths.put(waypoint, new Waypoint.PathInfo(waypoint, waypoint.getDynamicCost()));
|
||||||
|
dynamicPoints.put(waypoint, waypoint.getDynamicCost());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(Waypoint source: dynamicPoints.keySet()){
|
||||||
|
for (Waypoint.PathInfo target : source.getAllPath()) {
|
||||||
|
if (!paths.containsKey(target.getFinalWaypoint()) || paths.get(target.getFinalWaypoint()).getCost() > target.getCost()+dynamicPoints.get(source)) {
|
||||||
|
paths.put(target.getFinalWaypoint(), target.addCost(dynamicPoints.get(source)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.waypointCostType = current == null ? CostType.DYNAMIC_USE : CostType.NORMAL_USE;
|
this.waypointCostType = current == null ? CostType.DYNAMIC_USE : CostType.NORMAL_USE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +227,10 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item.getFunction().equals("waypoint")) {
|
if (item.getFunction().equals("waypoint")) {
|
||||||
String tag = NBTItem.get(event.getCurrentItem()).getString("waypointId");
|
PersistentDataContainer container = event.getCurrentItem().getItemMeta().getPersistentDataContainer();
|
||||||
|
String tag = container.has(new NamespacedKey(MMOCore.plugin, "waypointId"), PersistentDataType.STRING) ?
|
||||||
|
container.get(new NamespacedKey(MMOCore.plugin, "waypointId"), PersistentDataType.STRING) : "";
|
||||||
|
|
||||||
if (tag.equals(""))
|
if (tag.equals(""))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -198,20 +248,21 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Waypoint does not have target as destination
|
// Waypoint does not have target as destination
|
||||||
if (current != null && !current.hasDestination(waypoint)) {
|
if (current != null && current.getPath(waypoint) == null) {
|
||||||
MMOCore.plugin.configManager.getSimpleMessage("cannot-teleport-to").send(player);
|
MMOCore.plugin.configManager.getSimpleMessage("cannot-teleport-to").send(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not dynamic waypoint
|
// Not dynamic waypoint
|
||||||
if (current == null && !waypoint.hasOption(WaypointOption.DYNAMIC)) {
|
if (current == null && !paths.containsKey(waypoint)) {
|
||||||
MMOCore.plugin.configManager.getSimpleMessage("not-dynamic-waypoint").send(player);
|
MMOCore.plugin.configManager.getSimpleMessage("not-dynamic-waypoint").send(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stellium cost
|
// Stellium cost
|
||||||
CostType costType = current == null ? CostType.DYNAMIC_USE : CostType.NORMAL_USE;
|
CostType costType = current == null ? CostType.DYNAMIC_USE : CostType.NORMAL_USE;
|
||||||
double left = waypoint.getCost(costType) - playerData.getStellium();
|
double withdraw = paths.get(waypoint).getCost();
|
||||||
|
double left = withdraw - playerData.getStellium();
|
||||||
if (left > 0) {
|
if (left > 0) {
|
||||||
MMOCore.plugin.configManager.getSimpleMessage("not-enough-stellium", "more", decimal.format(left)).send(player);
|
MMOCore.plugin.configManager.getSimpleMessage("not-enough-stellium", "more", decimal.format(left)).send(player);
|
||||||
return;
|
return;
|
||||||
@ -221,7 +272,8 @@ public class WaypointViewer extends EditableInventory {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
playerData.warp(waypoint, costType);
|
playerData.warp(waypoint, withdraw);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import net.Indyuce.mmocore.MMOCore;
|
|||||||
import net.Indyuce.mmocore.api.event.LootChestSpawnEvent;
|
import net.Indyuce.mmocore.api.event.LootChestSpawnEvent;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerActivity;
|
import net.Indyuce.mmocore.api.player.PlayerActivity;
|
||||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||||
|
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||||
import net.Indyuce.mmocore.loot.LootBuilder;
|
import net.Indyuce.mmocore.loot.LootBuilder;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -85,7 +86,7 @@ public class LootChestRegion {
|
|||||||
player.setLastActivity(PlayerActivity.LOOT_CHEST_SPAWN);
|
player.setLastActivity(PlayerActivity.LOOT_CHEST_SPAWN);
|
||||||
|
|
||||||
// First randomly determine the chest tier
|
// First randomly determine the chest tier
|
||||||
ChestTier tier = rollTier();
|
ChestTier tier = rollTier(player);
|
||||||
|
|
||||||
// Find a random location, 20 trials max
|
// Find a random location, 20 trials max
|
||||||
Location location = getRandomLocation(player.getPlayer().getLocation());
|
Location location = getRandomLocation(player.getPlayer().getLocation());
|
||||||
@ -116,22 +117,25 @@ public class LootChestRegion {
|
|||||||
MMOCore.plugin.lootChests.register(lootChest);
|
MMOCore.plugin.lootChests.register(lootChest);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO stat to increase chance to get higher tiers?
|
public ChestTier rollTier(PlayerData player) {
|
||||||
public ChestTier rollTier() {
|
double chance = player.getStats().getStat(StatType.CHANCE);
|
||||||
|
|
||||||
// Calculate sum of all chances and then normalize
|
|
||||||
double norm = 0;
|
|
||||||
for (ChestTier tier : tiers)
|
|
||||||
norm += tier.getChance();
|
|
||||||
|
|
||||||
Validate.isTrue(norm > 0, "No tier was found");
|
|
||||||
|
|
||||||
|
//chance=0 ->the tier.chance remains the same
|
||||||
|
//chance ->+inf -> the tier.chance becomes the same for everyone, uniform law
|
||||||
|
//chance=8-> tierChance=sqrt(tierChance)
|
||||||
double sum = 0;
|
double sum = 0;
|
||||||
for (ChestTier tier : tiers)
|
for (ChestTier tier : tiers) {
|
||||||
if (random.nextDouble() < (sum += tier.getChance()) / norm)
|
sum += Math.pow(tier.chance, 1 / Math.pow((1 + chance),1/3));
|
||||||
return tier;
|
}
|
||||||
|
|
||||||
throw new RuntimeException("Could not roll random chest tier");
|
double s=0;
|
||||||
|
for (ChestTier tier : tiers) {
|
||||||
|
s+=Math.pow(tier.chance, 1 / Math.pow((1 + chance),1/3))/sum;
|
||||||
|
if (random.nextDouble() < s)
|
||||||
|
return tier;
|
||||||
|
}
|
||||||
|
|
||||||
|
return tiers.stream().findAny().orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getRandomLocation(Location center) {
|
public Location getRandomLocation(Location center) {
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package net.Indyuce.mmocore.loot.droptable.condition;
|
||||||
|
|
||||||
|
import io.lumine.mythic.lib.api.MMOLineConfig;
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.generator.WorldInfo;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class DistanceCondition extends Condition{
|
||||||
|
private final Location location;
|
||||||
|
private final double distance;
|
||||||
|
|
||||||
|
public DistanceCondition(MMOLineConfig config) {
|
||||||
|
super(config);
|
||||||
|
Validate.isTrue(config.contains("world"));
|
||||||
|
Validate.isTrue(config.contains("x"));
|
||||||
|
Validate.isTrue(config.contains("y"));
|
||||||
|
Validate.isTrue(config.contains("z"));
|
||||||
|
Validate.isTrue(config.contains("distance"));
|
||||||
|
Validate.isTrue(Bukkit.getWorld(config.getString("world"))!=null,"This world doesn't exist");
|
||||||
|
location=new Location(Bukkit.getWorld(config.getString("world")),config.getDouble("x"),
|
||||||
|
config.getDouble("y"),config.getDouble("z"));
|
||||||
|
distance=config.getDouble("distance");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMet(ConditionInstance entity) {
|
||||||
|
Entity entity1=entity.getEntity();
|
||||||
|
return entity1.getWorld().equals(location.getWorld())&&location.distance(entity1.getLocation())<distance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -111,6 +111,7 @@ public class KeyCombos implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Adding pressed key
|
// Adding pressed key
|
||||||
CustomSkillCastingHandler casting = (CustomSkillCastingHandler) playerData.getSkillCasting();
|
CustomSkillCastingHandler casting = (CustomSkillCastingHandler) playerData.getSkillCasting();
|
||||||
casting.current.registerKey(event.getPressed());
|
casting.current.registerKey(event.getPressed());
|
||||||
|
@ -1,14 +1,21 @@
|
|||||||
package net.Indyuce.mmocore.waypoint;
|
package net.Indyuce.mmocore.waypoint;
|
||||||
|
|
||||||
|
import io.lumine.mythic.lib.api.MMOLineConfig;
|
||||||
|
import net.Indyuce.mmocore.MMOCore;
|
||||||
|
import net.Indyuce.mmocore.loot.droptable.condition.Condition;
|
||||||
|
import net.Indyuce.mmocore.loot.droptable.condition.ConditionInstance;
|
||||||
import net.Indyuce.mmocore.player.Unlockable;
|
import net.Indyuce.mmocore.player.Unlockable;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.craftbukkit.libs.jline.internal.Nullable;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class Waypoint implements Unlockable {
|
public class Waypoint implements Unlockable {
|
||||||
private final String id, name;
|
private final String id, name;
|
||||||
@ -21,7 +28,7 @@ public class Waypoint implements Unlockable {
|
|||||||
* <p>
|
* <p>
|
||||||
* If it's empty it can access any waypoint.
|
* If it's empty it can access any waypoint.
|
||||||
*/
|
*/
|
||||||
private final Set<String> destinations = new HashSet<>();
|
private final Map<String, Integer> destinations = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waypoint options saved here.
|
* Waypoint options saved here.
|
||||||
@ -31,8 +38,23 @@ public class Waypoint implements Unlockable {
|
|||||||
/**
|
/**
|
||||||
* Stellium cost for each action (0 being the default cost)
|
* Stellium cost for each action (0 being the default cost)
|
||||||
*/
|
*/
|
||||||
|
private final double dynamicCost, setSpawnCost;
|
||||||
|
private final ArrayList<Condition> dynamicUseConditions = new ArrayList<>();
|
||||||
|
|
||||||
private final Map<CostType, Double> costs = new HashMap<>();
|
private final Map<CostType, Double> costs = new HashMap<>();
|
||||||
|
|
||||||
|
public double getDynamicCost() {
|
||||||
|
return dynamicCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSetSpawnCost() {
|
||||||
|
return setSpawnCost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getCost(Waypoint waypoint) {
|
||||||
|
return getPath(waypoint).cost;
|
||||||
|
}
|
||||||
|
|
||||||
public Waypoint(ConfigurationSection config) {
|
public Waypoint(ConfigurationSection config) {
|
||||||
id = Objects.requireNonNull(config, "Could not load config section").getName();
|
id = Objects.requireNonNull(config, "Could not load config section").getName();
|
||||||
name = Objects.requireNonNull(config.getString("name"), "Could not load waypoint name");
|
name = Objects.requireNonNull(config.getString("name"), "Could not load waypoint name");
|
||||||
@ -40,13 +62,39 @@ public class Waypoint implements Unlockable {
|
|||||||
loc = readLocation(Objects.requireNonNull(config.getString("location"), "Could not read location"));
|
loc = readLocation(Objects.requireNonNull(config.getString("location"), "Could not read location"));
|
||||||
radiusSquared = Math.pow(config.getDouble("radius"), 2);
|
radiusSquared = Math.pow(config.getDouble("radius"), 2);
|
||||||
|
|
||||||
for (CostType costType : CostType.values())
|
dynamicCost = config.getDouble("cost.dynamic-use");
|
||||||
costs.put(costType, config.getDouble("cost." + costType.getPath()));
|
setSpawnCost = config.getDouble("cost.set-spawnpoint");
|
||||||
|
|
||||||
|
|
||||||
for (WaypointOption option : WaypointOption.values())
|
for (WaypointOption option : WaypointOption.values())
|
||||||
options.put(option, config.getBoolean("option." + option.getPath(), option.getDefaultValue()));
|
options.put(option, config.getBoolean("option." + option.getPath(), option.getDefaultValue()));
|
||||||
|
|
||||||
destinations.addAll(config.getStringList("linked"));
|
//We load all the linked WayPoints
|
||||||
|
if (config.contains("linked")) {
|
||||||
|
ConfigurationSection section = config.getConfigurationSection("linked");
|
||||||
|
for (String key : section.getKeys(false)) {
|
||||||
|
destinations.put(key, section.getInt(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (config.contains("conditions")) {
|
||||||
|
List<String> conditions = config.getStringList("conditions");
|
||||||
|
for (String condition : conditions) {
|
||||||
|
dynamicUseConditions.add(MMOCore.plugin.loadManager.loadCondition(new MMOLineConfig(condition)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canHaveDynamicUse(Player player) {
|
||||||
|
if (!options.get(WaypointOption.DYNAMIC))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (Condition condition : dynamicUseConditions) {
|
||||||
|
if (!condition.isMet(new ConditionInstance(player)))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@ -61,16 +109,87 @@ public class Waypoint implements Unlockable {
|
|||||||
return loc;
|
return loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param other Another waypoint
|
* @param other Another waypoint
|
||||||
* @return If any player standing on that waypoint can teleport to given waypoint
|
* @return If any player standing on that waypoint can teleport to given waypoint
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean hasDestination(Waypoint other) {
|
public boolean hasDestination(Waypoint other) {
|
||||||
return destinations.isEmpty() || destinations.contains(other.getId());
|
return destinations.isEmpty() || destinations.keySet().contains(other.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getCost(CostType type) {
|
/**
|
||||||
return costs.getOrDefault(type, 0d);
|
* Checks directly if the waypoint is directly linked to the current one
|
||||||
|
*
|
||||||
|
* @return Integer.POSITIVE_INFINITY if the way point is not linked
|
||||||
|
*/
|
||||||
|
private int getSimpleCostDestination(Waypoint waypoint) {
|
||||||
|
if (!destinations.keySet().contains(waypoint.getId()))
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
return destinations.get(waypoint.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ArrayList<PathInfo> getAllPath() {
|
||||||
|
//All the WayPoints that have been registered
|
||||||
|
ArrayList<Waypoint> checkedPoints = new ArrayList<>();
|
||||||
|
//All the path
|
||||||
|
ArrayList<PathInfo> paths = new ArrayList();
|
||||||
|
ArrayList<PathInfo> pointsToCheck = new ArrayList<>();
|
||||||
|
pointsToCheck.add(new PathInfo(this));
|
||||||
|
|
||||||
|
while (pointsToCheck.size() != 0) {
|
||||||
|
PathInfo checked = pointsToCheck.get(0);
|
||||||
|
pointsToCheck.remove(0);
|
||||||
|
paths.add(checked);
|
||||||
|
checkedPoints.add(checked.getFinalWaypoint());
|
||||||
|
|
||||||
|
for (String wayPointId : checked.getFinalWaypoint().destinations.keySet()) {
|
||||||
|
Waypoint toCheck = MMOCore.plugin.waypointManager.get(wayPointId);
|
||||||
|
if (!checkedPoints.contains(toCheck)) {
|
||||||
|
PathInfo toCheckInfo = checked.addWayPoint(toCheck);
|
||||||
|
//We keep pointsToCheck ordered
|
||||||
|
pointsToCheck = toCheckInfo.addInOrder(pointsToCheck);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return paths;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public PathInfo getPath(Waypoint targetWaypoint) {
|
||||||
|
//All the WayPoints that have been registered
|
||||||
|
ArrayList<Waypoint> checkedPoints = new ArrayList<>();
|
||||||
|
//All the path
|
||||||
|
ArrayList<PathInfo> paths = new ArrayList();
|
||||||
|
ArrayList<PathInfo> pointsToCheck = new ArrayList<>();
|
||||||
|
pointsToCheck.add(new PathInfo(this));
|
||||||
|
|
||||||
|
while (pointsToCheck.size() != 0) {
|
||||||
|
PathInfo checked = pointsToCheck.get(0);
|
||||||
|
pointsToCheck.remove(0);
|
||||||
|
paths.add(checked);
|
||||||
|
checkedPoints.add(checked.getFinalWaypoint());
|
||||||
|
|
||||||
|
if (checked.getFinalWaypoint().equals(targetWaypoint))
|
||||||
|
return checked;
|
||||||
|
|
||||||
|
for (String wayPointId : checked.getFinalWaypoint().destinations.keySet()) {
|
||||||
|
Waypoint toCheck = MMOCore.plugin.waypointManager.get(wayPointId);
|
||||||
|
if (!checkedPoints.contains(toCheck)) {
|
||||||
|
PathInfo toCheckInfo = checked.addWayPoint(toCheck);
|
||||||
|
//We keep pointsToCheck ordered
|
||||||
|
pointsToCheck = toCheckInfo.addInOrder(pointsToCheck);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//If no path has been found we return null
|
||||||
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasOption(WaypointOption option) {
|
public boolean hasOption(WaypointOption option) {
|
||||||
@ -118,4 +237,96 @@ public class Waypoint implements Unlockable {
|
|||||||
|
|
||||||
return new Location(world, x, y, z, yaw, pitch);
|
return new Location(world, x, y, z, yaw, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class PathInfo {
|
||||||
|
private final ArrayList<Waypoint> waypoints;
|
||||||
|
private double cost;
|
||||||
|
|
||||||
|
public ArrayList<Waypoint> getWaypoints() {
|
||||||
|
return waypoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getCost() {
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PathInfo(Waypoint waypoint) {
|
||||||
|
this.waypoints = new ArrayList<>();
|
||||||
|
this.waypoints.add(waypoint);
|
||||||
|
cost = 0;
|
||||||
|
}
|
||||||
|
public PathInfo(Waypoint waypoint,double cost) {
|
||||||
|
this.waypoints = new ArrayList<>();
|
||||||
|
this.waypoints.add(waypoint);
|
||||||
|
this.cost = cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PathInfo addCost(double cost) {
|
||||||
|
this.cost+=cost;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<PathInfo> addInOrder(ArrayList<PathInfo> pathInfos) {
|
||||||
|
int index = 0;
|
||||||
|
while (index < pathInfos.size()) {
|
||||||
|
if (cost < pathInfos.get(index).cost) {
|
||||||
|
pathInfos.set(index, this);
|
||||||
|
return pathInfos;
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
//If index==pathInfos.size() we add the waypoint at the end
|
||||||
|
pathInfos.add(this);
|
||||||
|
return pathInfos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public PathInfo(List<Waypoint> waypoints, double cost) {
|
||||||
|
this.waypoints = new ArrayList<>(waypoints);
|
||||||
|
this.cost = cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param dynamic We display the first waypoint if it is dynamic as it is an intermediary point
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String displayIntermediaryWayPoints(boolean dynamic) {
|
||||||
|
String result = "";
|
||||||
|
if(!dynamic) {
|
||||||
|
if (waypoints.size() <= 2)
|
||||||
|
return "none";
|
||||||
|
for (int i = 1; i < waypoints.size() - 1; i++) {
|
||||||
|
result += waypoints.get(i).name + (i != waypoints.size() - 2 ? "," : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(dynamic) {
|
||||||
|
if (waypoints.size() <= 1)
|
||||||
|
return "none";
|
||||||
|
for (int i = 0; i < waypoints.size() - 1; i++) {
|
||||||
|
result += waypoints.get(i).name + (i != waypoints.size() - 2 ? "," : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PathInfo addWayPoint(Waypoint waypoint) {
|
||||||
|
Validate.isTrue(!waypoints.contains(waypoint), "You can't create cyclic path");
|
||||||
|
ArrayList<Waypoint> newWaypoints = new ArrayList<>();
|
||||||
|
newWaypoints.addAll(waypoints);
|
||||||
|
newWaypoints.add(waypoint);
|
||||||
|
double cost = this.cost + getFinalWaypoint().getSimpleCostDestination(waypoint);
|
||||||
|
return new PathInfo(newWaypoints, cost);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Waypoint getInitialWaypoint() {
|
||||||
|
return waypoints.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Waypoint getFinalWaypoint() {
|
||||||
|
return waypoints.get(waypoints.size() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -34,7 +34,7 @@ items:
|
|||||||
|
|
||||||
lore:
|
lore:
|
||||||
- '&7You cannot teleport as the two waypoints are not linked.'
|
- '&7You cannot teleport as the two waypoints are not linked.'
|
||||||
- '&7Teleporting costs &b&l{normal_cost}&7/&b&l{dynamic_cost} &7Stellium.'
|
|
||||||
|
|
||||||
# When you cannot teleport to a non dynamic waypoint
|
# When you cannot teleport to a non dynamic waypoint
|
||||||
not-dynamic:
|
not-dynamic:
|
||||||
@ -43,9 +43,16 @@ items:
|
|||||||
|
|
||||||
lore:
|
lore:
|
||||||
- '&7You cannot teleport as you are not standing on a waypoint.'
|
- '&7You cannot teleport as you are not standing on a waypoint.'
|
||||||
- '&7Teleporting costs &b&l{normal_cost}&7/&b&l{dynamic_cost} &7Stellium.'
|
|
||||||
|
|
||||||
# When you cannot teleport to a non dynamic waypoint
|
|
||||||
|
current-waypoint:
|
||||||
|
name: '&a{name}'
|
||||||
|
item: ENDER_PEARL
|
||||||
|
|
||||||
|
lore:
|
||||||
|
- '&7The waypoint you are standing at.'
|
||||||
|
|
||||||
|
# When you don't have enough stellium
|
||||||
not-enough-stellium:
|
not-enough-stellium:
|
||||||
name: '&a{name}'
|
name: '&a{name}'
|
||||||
item: ENDER_PEARL
|
item: ENDER_PEARL
|
||||||
@ -61,6 +68,7 @@ items:
|
|||||||
|
|
||||||
lore:
|
lore:
|
||||||
- '&7You can teleport to this waypoint.'
|
- '&7You can teleport to this waypoint.'
|
||||||
|
- '&7Intermediary waypoints : {intermediary_waypoints}'
|
||||||
- '&7Click to teleport for &b{current_cost} &7Stellium.'
|
- '&7Click to teleport for &b{current_cost} &7Stellium.'
|
||||||
|
|
||||||
next:
|
next:
|
||||||
|
@ -22,7 +22,7 @@ exp-sources: {}
|
|||||||
on-fish:
|
on-fish:
|
||||||
overriding-drop-table:
|
overriding-drop-table:
|
||||||
conditions:
|
conditions:
|
||||||
- 'region{name=swamp}'
|
- 'biome{name=swamp}'
|
||||||
|
|
||||||
# When drop table is read, one of these
|
# When drop table is read, one of these
|
||||||
# items will be selected randomly.
|
# items will be selected randomly.
|
||||||
|
@ -58,6 +58,11 @@ default:
|
|||||||
COOLDOWN_REDUCTION:
|
COOLDOWN_REDUCTION:
|
||||||
base: 0
|
base: 0
|
||||||
per-level: 0
|
per-level: 0
|
||||||
|
|
||||||
|
#Increases chance to have rare loot chests
|
||||||
|
CHANCE:
|
||||||
|
base: 0
|
||||||
|
per-level: 0
|
||||||
|
|
||||||
# Dealt by skills
|
# Dealt by skills
|
||||||
SKILL_DAMAGE:
|
SKILL_DAMAGE:
|
||||||
|
@ -17,8 +17,6 @@ spawn:
|
|||||||
# Stellium cost in order to use the waypoint.
|
# Stellium cost in order to use the waypoint.
|
||||||
# Stellium is like stamina however it's not used
|
# Stellium is like stamina however it's not used
|
||||||
# by skills and regens much slower than mana.
|
# by skills and regens much slower than mana.
|
||||||
normal-use: 3
|
|
||||||
|
|
||||||
# Cost when not standing on any waypoint.
|
# Cost when not standing on any waypoint.
|
||||||
dynamic-use: 5
|
dynamic-use: 5
|
||||||
|
|
||||||
@ -42,12 +40,12 @@ spawn:
|
|||||||
default: true
|
default: true
|
||||||
|
|
||||||
# All the waypoints you can teleport to when standing
|
# All the waypoints you can teleport to when standing
|
||||||
# on that waypoint. If that list is empty you are able
|
# on that waypoint. And the cost needed to travel to his pointIf that list is empty you are able
|
||||||
# to teleport to any waypoint
|
# to teleport to any waypoint
|
||||||
linked:
|
linked:
|
||||||
- spawn1
|
spawn1: 4
|
||||||
- spawn2
|
spawn2: 5
|
||||||
- forest
|
|
||||||
|
|
||||||
spawn1:
|
spawn1:
|
||||||
name: Spawn1
|
name: Spawn1
|
||||||
@ -62,6 +60,15 @@ spawn1:
|
|||||||
# on any waypoint (waypoint must be unlocked).
|
# on any waypoint (waypoint must be unlocked).
|
||||||
dynamic: true
|
dynamic: true
|
||||||
|
|
||||||
|
##Not necessary if the waypoint doesn't allow dynamic use
|
||||||
|
##The conditions for the dynamic-use of the waypoint
|
||||||
|
conditions:
|
||||||
|
- 'distance{world=world;x=69;y=71;z=163;distance=500}'
|
||||||
|
|
||||||
|
|
||||||
|
linked:
|
||||||
|
spawn: 4
|
||||||
|
|
||||||
spawn2:
|
spawn2:
|
||||||
name: Spawn2
|
name: Spawn2
|
||||||
location: 'world 69 71 136 136 0'
|
location: 'world 69 71 136 136 0'
|
||||||
@ -70,3 +77,5 @@ spawn2:
|
|||||||
normal-use: 3
|
normal-use: 3
|
||||||
option:
|
option:
|
||||||
enable-menu: false
|
enable-menu: false
|
||||||
|
linked:
|
||||||
|
spawn: 3
|
||||||
|
Loading…
Reference in New Issue
Block a user