Compare commits
No commits in common. "master" and "dev" have entirely different histories.
12
.classpath
12
.classpath
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="jgrapht"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/AutoPluginUpdate.jar"/>
|
||||
<classpathentry kind="lib" path="D:/Documents/GlowAPI_v1.4.4.jar"/>
|
||||
<classpathentry kind="lib" path="D:/Documents/Test Server/spigot-1.9.2-R0.1-SNAPSHOT.jar"/>
|
||||
<classpathentry kind="lib" path="D:/Documents/aPlugin.jar"/>
|
||||
<classpathentry kind="src" path="/AutoPluginUpdate"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
|
||||
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${resource}"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/TwosideKeeper"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="TwosideKeeper"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/TwosideKeeper/projectBuilder.xml}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/TwosideKeeper}"/>
|
||||
</launchConfiguration>
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
.*
|
||||
/bin
|
27
.project
27
.project
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>TwosideKeeper</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
|
||||
<triggers>full,incremental,</triggers>
|
||||
<arguments>
|
||||
<dictionary>
|
||||
<key>LaunchConfigHandle</key>
|
||||
<value><project>/.externalToolBuilders/New_Builder.launch</value>
|
||||
</dictionary>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -1,4 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java=UTF-8
|
||||
encoding//src/sig/plugin/TwosideKeeper/TwosideKeeper.java=UTF-8
|
||||
encoding/<project>=UTF-8
|
@ -1,11 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
Binary file not shown.
@ -1,7 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.X
|
||||
loadbefore: [aPlugin]
|
||||
version: 3.9.0a
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
@ -123,73 +122,3 @@ commands:
|
||||
usage: /craft ITEM
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
weather:
|
||||
description: Toggles the sending of a weather warning message to the player.
|
||||
usage: /weather <DISCORD NAME>
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
red:
|
||||
description: Ready up for the ice skating race.
|
||||
usage: /red
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
ready:
|
||||
description: Ready up for the tree climbing race.
|
||||
usage: /ready
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
habitat:
|
||||
description: View the habitat levels within the area.
|
||||
usage: /habitat
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
debugreport:
|
||||
description: View a full debug report of the Server.
|
||||
usage: /debugreport
|
||||
permission: TwosideKeeper.fulldebugreport
|
||||
permission-message: No permissions!
|
||||
equip_weapon:
|
||||
description: Toggle Automatic Equipping of Weapons
|
||||
usage: /equip_weapon
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
equip_armor:
|
||||
description: Toggle Automatic Equipping of Armor
|
||||
usage: /equip_armor
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
options:
|
||||
description: Displays a menu to toggle plugin-specific options.
|
||||
usage: /options
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
settings:
|
||||
description: Displays a menu to toggle plugin-specific options.
|
||||
usage: /settings
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
damage_numbers:
|
||||
description: Toggles the damage numbers that display while dealing damage.
|
||||
usage: /damage_numbers
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
dailyloot:
|
||||
description: Loots a certain box.
|
||||
usage: /dailyloot <UUID>
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
pvp:
|
||||
description: Declare PvP to a player.
|
||||
usage: /pvp
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
fb:
|
||||
description: Determine if a player is a fresh blood player or not.
|
||||
usage: /fb <player>
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
||||
search:
|
||||
description: Displays a listing of items in Recycling Centers. Supply an argument to search for a specific item.
|
||||
usage: /search [Item Name]
|
||||
permission: TwosideKeeper.money
|
||||
permission-message: No permissions!
|
@ -1,35 +1,24 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class ActionBarBuffUpdater{
|
||||
|
||||
/*
|
||||
* LIST OF BUFFS:
|
||||
* basename / icon string
|
||||
*
|
||||
* Poison ChatColor.YELLOW+"☣"
|
||||
* DeathMark ChatColor.DARK_RED+"☠"
|
||||
*/
|
||||
|
||||
public static String getActionBarPrefix(LivingEntity p) {
|
||||
StringBuilder actionbardisplay = new StringBuilder("");
|
||||
for (PotionEffect pe : p.getActivePotionEffects()) {
|
||||
if (pe.getAmplifier()>3) {
|
||||
actionbardisplay.append(ParseEffect(p,pe));
|
||||
}
|
||||
}
|
||||
actionbardisplay.append(AddAdditionalEffects(p));
|
||||
//TwosideKeeper.log(actionbardisplay.toString(), 0);
|
||||
if (actionbardisplay.toString().contains(" ")) {
|
||||
return actionbardisplay.toString().substring(0, actionbardisplay.toString().lastIndexOf(" "));
|
||||
} else {
|
||||
@ -41,83 +30,27 @@ public class ActionBarBuffUpdater{
|
||||
StringBuilder effectString=new StringBuilder("");
|
||||
if (p instanceof Player) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)p);
|
||||
if (p.getFireTicks()>0) {
|
||||
effectString.append(ChatColor.GOLD);
|
||||
effectString.append("⚠");
|
||||
effectString.append(AppendAmplifier((p.getFireTicks()/20)-1,false));
|
||||
effectString.append(" ");
|
||||
}
|
||||
/*if (pd.lifestealstacks>0) {
|
||||
effectString.append(ChatColor.AQUA);
|
||||
effectString.append("❣");
|
||||
if (pd.lifestealstacks>4) {
|
||||
effectString.append(ChatColor.AQUA+"❣");
|
||||
effectString.append(AppendAmplifier(pd.lifestealstacks-1));
|
||||
effectString.append(" ");
|
||||
}*/
|
||||
/*if (pd.weaponcharges>0) {
|
||||
effectString.append(ChatColor.DARK_AQUA);
|
||||
effectString.append("☤");
|
||||
}
|
||||
if (pd.weaponcharges>4) {
|
||||
effectString.append(ChatColor.DARK_AQUA+"☤");
|
||||
effectString.append(AppendAmplifier(pd.weaponcharges-1));
|
||||
effectString.append(" ");
|
||||
}*/
|
||||
/*if (pd.damagepool>0) {
|
||||
effectString.append(ChatColor.DARK_PURPLE);
|
||||
effectString.append("♥");
|
||||
}
|
||||
if (pd.damagepool>4) {
|
||||
effectString.append(ChatColor.DARK_PURPLE+"♥");
|
||||
effectString.append(AppendAmplifier((int)(pd.damagepool-1)));
|
||||
effectString.append(" ");
|
||||
}*/
|
||||
if (pd.lastvendettastack+200>TwosideKeeper.getServerTickTime() &&
|
||||
ItemSet.hasFullSet((Player)p, ItemSet.SONGSTEEL)) {
|
||||
effectString.append(ChatColor.GRAY);
|
||||
effectString.append("☉");
|
||||
effectString.append(AppendAmplifier(((int)((pd.lastvendettastack+200)-TwosideKeeper.getServerTickTime())/20)-1,false));
|
||||
effectString.append(" ");
|
||||
}
|
||||
if (pd.swiftaegisamt>0) {
|
||||
effectString.append(ChatColor.YELLOW);
|
||||
effectString.append("❈");
|
||||
if (pd.swiftaegisamt>4) {
|
||||
effectString.append(ChatColor.YELLOW+"❈");
|
||||
effectString.append(AppendAmplifier((int)(GenericFunctions.getSwiftAegisAmt((Player)p)-1)));
|
||||
effectString.append(" ");
|
||||
}
|
||||
if (pd.regenpool>0) {
|
||||
effectString.append(ChatColor.BLUE);
|
||||
effectString.append(ChatColor.BOLD);
|
||||
effectString.append("✙");
|
||||
effectString.append(AppendAmplifier((int)(pd.regenpool)));
|
||||
effectString.append(" ");
|
||||
}
|
||||
if (pd.vendetta_amt>0 && effectString.length()==0) {
|
||||
|
||||
}
|
||||
if (pd.lastusedRejuvenation+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATION_COOLDOWN, (Player)p)>TwosideKeeper.getServerTickTime()) {
|
||||
effectString.append(ChatColor.GREEN);
|
||||
effectString.append(ChatColor.BOLD);
|
||||
effectString.append(ChatColor.UNDERLINE);
|
||||
effectString.append("Rejuvenation");
|
||||
int timeRemaining = (int)((pd.lastusedRejuvenation+GenericFunctions.GetModifiedCooldown(TwosideKeeper.REJUVENATION_COOLDOWN, (Player)p))-TwosideKeeper.getServerTickTime());
|
||||
effectString.append(ConvertBuffTimeToIcon(timeRemaining));
|
||||
effectString.append(ChatColor.RESET);
|
||||
effectString.append(" ");
|
||||
}
|
||||
}
|
||||
HashMap<String,Buff> buffMap = Buff.getBuffData(p);
|
||||
for (String s : buffMap.keySet()) {
|
||||
Buff b = buffMap.get(s);
|
||||
|
||||
if (b.getRemainingBuffTime()>0) {
|
||||
effectString.append(b.getBuffIcon());
|
||||
effectString.append(" ");
|
||||
if (p instanceof Player) {
|
||||
effectString.append(b.getDisplayName());
|
||||
}
|
||||
effectString.append(ConvertBuffAmplifierToIcon(b.getAmplifier()));
|
||||
effectString.append(" ");
|
||||
if (b.getRemainingBuffTime()<=200 || b.getDisplayTimerAlways()) {
|
||||
effectString.append(ConvertBuffTimeToIcon(b.getRemainingBuffTime()));
|
||||
}
|
||||
effectString.append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
if (effectString.length()>0) {
|
||||
return effectString.toString()+ChatColor.RESET;
|
||||
} else {
|
||||
@ -125,122 +58,33 @@ public class ActionBarBuffUpdater{
|
||||
}
|
||||
}
|
||||
|
||||
private static String ConvertBuffAmplifierToIcon(int amplifier) {
|
||||
if (amplifier==1) {
|
||||
return "Ⅰ";
|
||||
} else
|
||||
if (amplifier==2) {
|
||||
return "Ⅱ";
|
||||
} else
|
||||
if (amplifier==3) {
|
||||
return "Ⅲ";
|
||||
} else
|
||||
if (amplifier==4) {
|
||||
return "Ⅳ";
|
||||
} else
|
||||
if (amplifier==5) {
|
||||
return "Ⅴ";
|
||||
} else
|
||||
if (amplifier==6) {
|
||||
return "Ⅵ";
|
||||
} else
|
||||
if (amplifier==7) {
|
||||
return "Ⅶ";
|
||||
} else
|
||||
if (amplifier==8) {
|
||||
return "Ⅷ";
|
||||
} else
|
||||
if (amplifier==9) {
|
||||
return "Ⅸ";
|
||||
} else
|
||||
if (amplifier==10) {
|
||||
return "Ⅹ";
|
||||
} else
|
||||
if (amplifier==11) {
|
||||
return "Ⅺ";
|
||||
} else
|
||||
if (amplifier==12) {
|
||||
return "Ⅻ";
|
||||
} else {
|
||||
if (amplifier!=0) {
|
||||
return Integer.toString(amplifier);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String ConvertBuffTimeToIcon(long remainingBuffTime) {
|
||||
if (remainingBuffTime>200) {
|
||||
return Long.toString(remainingBuffTime/20);
|
||||
} else
|
||||
if (remainingBuffTime>180) {
|
||||
return "➓";
|
||||
} else
|
||||
if (remainingBuffTime>160) {
|
||||
return "➒";
|
||||
} else
|
||||
if (remainingBuffTime>140) {
|
||||
return "➑";
|
||||
} else
|
||||
if (remainingBuffTime>120) {
|
||||
return "➐";
|
||||
} else
|
||||
if (remainingBuffTime>100) {
|
||||
return "➏";
|
||||
} else
|
||||
if (remainingBuffTime>80) {
|
||||
return "➎";
|
||||
} else
|
||||
if (remainingBuffTime>60) {
|
||||
return "➍";
|
||||
} else
|
||||
if (remainingBuffTime>40) {
|
||||
return "➌";
|
||||
} else
|
||||
if (remainingBuffTime>20) {
|
||||
return "➋";
|
||||
} else
|
||||
{
|
||||
return "➊";
|
||||
}
|
||||
}
|
||||
|
||||
private static String ParseEffect(LivingEntity p, PotionEffect pe) {
|
||||
StringBuilder effectString=new StringBuilder("");
|
||||
PotionEffectType pet = pe.getType();
|
||||
if (pet.equals(PotionEffectType.INCREASE_DAMAGE)) {
|
||||
effectString.append(ChatColor.GOLD);
|
||||
effectString.append("⚔");
|
||||
effectString.append(ChatColor.GOLD+"⚔");
|
||||
} else
|
||||
if (pet.equals(PotionEffectType.DAMAGE_RESISTANCE)) {
|
||||
effectString.append(ChatColor.BLUE);
|
||||
effectString.append("❈");
|
||||
effectString.append(ChatColor.BLUE+"❈");
|
||||
} else
|
||||
if (pet.equals(PotionEffectType.REGENERATION)) {
|
||||
effectString.append(ChatColor.GREEN);
|
||||
effectString.append("✙");
|
||||
effectString.append(ChatColor.GREEN+"✙");
|
||||
} else
|
||||
if (pet.equals(PotionEffectType.SPEED)) {
|
||||
effectString.append(ChatColor.WHITE);
|
||||
effectString.append("➠");
|
||||
effectString.append(ChatColor.WHITE+"➠");
|
||||
} else
|
||||
/*if (pet.equals(PotionEffectType.POISON) ||
|
||||
if (pet.equals(PotionEffectType.POISON) ||
|
||||
(pet.equals(PotionEffectType.BLINDNESS) && (p instanceof LivingEntity && !(p instanceof Player)))) {
|
||||
effectString.append(ChatColor.YELLOW);
|
||||
effectString.append("☣");
|
||||
} else*/
|
||||
/*if ((pet.equals(PotionEffectType.UNLUCK) && (p instanceof LivingEntity && !(p instanceof Player)))) {
|
||||
effectString.append(ChatColor.DARK_RED);
|
||||
effectString.append("☠");
|
||||
} else*/
|
||||
effectString.append(ChatColor.YELLOW+"☣");
|
||||
} else
|
||||
if ((pet.equals(PotionEffectType.UNLUCK) && (p instanceof LivingEntity && !(p instanceof Player)))) {
|
||||
effectString.append(ChatColor.DARK_RED+"☠");
|
||||
} else
|
||||
if (pet.equals(PotionEffectType.SLOW)) {
|
||||
effectString.append(ChatColor.DARK_AQUA);
|
||||
effectString.append("♒");
|
||||
effectString.append(ChatColor.DARK_AQUA+"♒");
|
||||
} else
|
||||
if (pet.equals(PotionEffectType.WEAKNESS) || pet.equals(PotionEffectType.SLOW_DIGGING)) {
|
||||
effectString.append(ChatColor.RED);
|
||||
effectString.append("✘");
|
||||
effectString.append(ChatColor.RED+"✘");
|
||||
}
|
||||
if (effectString.length()>0) {
|
||||
effectString.append(AppendAmplifier(pe.getAmplifier()));
|
||||
@ -254,12 +98,8 @@ public class ActionBarBuffUpdater{
|
||||
}
|
||||
|
||||
private static String AppendAmplifier(int amplifier) {
|
||||
return AppendAmplifier(amplifier,true);
|
||||
}
|
||||
|
||||
private static String AppendAmplifier(int amplifier, boolean romanNumerals) {
|
||||
StringBuilder amp = new StringBuilder(" ");
|
||||
if (amplifier+1<=10 && romanNumerals) {
|
||||
if (amplifier+1<=10) {
|
||||
amp.append(ChatColor.GRAY+""+WorldShop.toRomanNumeral(amplifier+1));
|
||||
} else {
|
||||
amp.append(ChatColor.GRAY+""+(amplifier+1));
|
||||
|
@ -12,8 +12,6 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
public class Artifact {
|
||||
public static ItemStack createArtifactItem(ArtifactItem type) {
|
||||
@ -135,9 +133,6 @@ public class Artifact {
|
||||
}
|
||||
if (reprint_lore) {
|
||||
l.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Crafting Item");
|
||||
if (GenericFunctions.isEquip(item)) {
|
||||
l.add(ChatColor.GOLD+""+ChatColor.BOLD+"T1 Artifact");
|
||||
}
|
||||
if (type==ArtifactItem.MALLEABLE_BASE) {
|
||||
l.add(ChatColor.YELLOW+" Right-click to activate");
|
||||
l.add(ChatColor.YELLOW+" this base.");
|
||||
@ -177,11 +172,11 @@ public class Artifact {
|
||||
if (item.getItemMeta().hasLore()) {
|
||||
l = item.getItemMeta().getLore();
|
||||
}
|
||||
l.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Artifact");
|
||||
l.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+ChatColor.RESET+ChatColor.GOLD+" "+GenericFunctions.CapitalizeFirstLetters(ait.getItemName())+" Artifact");
|
||||
l.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Item");
|
||||
m.setLore(l);
|
||||
item.setItemMeta(m);
|
||||
//item.addUnsafeEnchantment(Enchantment.LUCK, tier);
|
||||
item.addUnsafeEnchantment(Enchantment.LUCK, tier);
|
||||
return item;
|
||||
}
|
||||
public static boolean isArtifact(ItemStack item) {
|
||||
@ -190,9 +185,7 @@ public class Artifact {
|
||||
item.hasItemMeta() &&
|
||||
item.getItemMeta().hasLore() &&
|
||||
(GenericFunctions.searchfor(item.getItemMeta().getLore(),ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Crafting Item") ||
|
||||
item.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Item") ||
|
||||
(ItemUtils.LoreContainsSubstring(item, ChatColor.GOLD+""+ChatColor.BOLD+"T") &&
|
||||
ItemUtils.LoreContainsSubstring(item, " Artifact") && TextUtils.hasNoSpaceBeforeAndAfter(ChatColor.GOLD+""+ChatColor.BOLD+"T"," Artifact",item.getItemMeta().getLore())))) {
|
||||
item.getItemMeta().getLore().contains(ChatColor.GOLD+""+ChatColor.ITALIC+"Artifact Item"))) {
|
||||
//This is an artifact.
|
||||
return true;
|
||||
} else {
|
||||
@ -244,7 +237,6 @@ public class Artifact {
|
||||
m.setLore(lore);
|
||||
m.setDisplayName(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+ChatColor.RESET+ChatColor.GOLD+" Artifact "+GenericFunctions.CapitalizeFirstLetters(item.getItemName())+" Recipe");
|
||||
newitem.setItemMeta(m);
|
||||
newitem.addUnsafeEnchantment(Enchantment.LUCK, tier);
|
||||
return newitem.clone();
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@Deprecated
|
||||
public class AutoUpdatePlugin implements Runnable {
|
||||
List<Plugin> plugins;
|
||||
boolean restarting=false;
|
||||
@ -80,7 +79,7 @@ public class AutoUpdatePlugin implements Runnable {
|
||||
Bukkit.broadcastMessage("The server has detected a new version of "+ChatColor.YELLOW+plugins.get(ii).name+"."+ChatColor.GRAY+ChatColor.ITALIC+"If all players leave, the update will occur immediately.");
|
||||
}
|
||||
if (restarting) {
|
||||
//TwosideKeeper.updateServer();
|
||||
TwosideKeeper.updateServer();
|
||||
}
|
||||
}},1);
|
||||
TwosideKeeper.log("New hash: "+md5, 2);
|
||||
|
@ -12,14 +12,9 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
|
||||
public class AwakenedArtifact {
|
||||
int experience_points=0;
|
||||
@ -94,12 +89,11 @@ public class AwakenedArtifact {
|
||||
if (totalval>=1000) {
|
||||
//LEVEL UP!
|
||||
ItemStack item = addLV(artifact,totalval/1000, p);
|
||||
item = addMaxAP(item,totalval/1000);
|
||||
item = setEXP(item,totalval%1000);
|
||||
item = addAP(item,totalval/1000);
|
||||
double potentialred = 0.1d * getPotential(item); //5
|
||||
potentialred *= 1d - (5d+GenericFunctions.getAbilityValue(ArtifactAbility.PRESERVATION, artifact,p))/100d;
|
||||
TwosideKeeper.log("Potential is reduced by "+(potentialred)+"% from "+getPotential(item), 0);
|
||||
double potentialred = 10.0d;
|
||||
potentialred *= 1 - GenericFunctions.getAbilityValue(ArtifactAbility.PRESERVATION, artifact)/100d;
|
||||
TwosideKeeper.log("Potential reduction is reduced by "+(10-potentialred), 4);
|
||||
if (getPotential(item)>potentialred) {
|
||||
item = setPotential(item,(int)(getPotential(item)-potentialred));
|
||||
if (Math.random() < (potentialred % 1)) {
|
||||
@ -111,20 +105,16 @@ public class AwakenedArtifact {
|
||||
}
|
||||
}
|
||||
p.sendMessage("Your "+artifact.getItemMeta().getDisplayName()+ChatColor.RESET+" has upgraded to "+ChatColor.YELLOW+"Level "+getLV(artifact)+"!");
|
||||
TextComponent tc1 = new TextComponent("You have "+getAP(item)+" Ability Point"+((getAP(item)==1)?"":"s")+" to spend!");
|
||||
p.sendMessage("You have "+getAP(item)+" Ability Point"+((getAP(item)==1)?"":"s")+" to spend!");
|
||||
|
||||
TextComponent tc = new TextComponent(ChatColor.GREEN+"["+Character.toString((char)0x25b2)+"]");
|
||||
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder("Click to upgrade abilities on this artifact. "+ChatColor.GREEN+"Available AP: "+ChatColor.BLUE+AwakenedArtifact.getAP(item)).create()));
|
||||
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,"/awakenedartifact menu "+GenericFunctions.CalculateSlot(item,p)));
|
||||
/*TextComponent tc = new TextComponent("Click ");
|
||||
TextComponent ac = new TextComponent(ChatColor.GREEN+"[HERE]"+ChatColor.WHITE);
|
||||
ac.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder(ChatColor.ITALIC+"Click to add another skill point!").create()));
|
||||
ac.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,"/awakenedartifact"));
|
||||
tc.addExtra(ac);
|
||||
tc.addExtra(" to open up the ability upgrade menu.");*/
|
||||
tc1.addExtra(tc);
|
||||
p.spigot().sendMessage(tc1);
|
||||
//p.spigot().sendMessage(ArtifactAbility.GenerateMenu(ArtifactItemType.getArtifactItemTypeFromItemStack(p.getInventory().getItem(GenericFunctions.CalculateSlot(artifact,p))).getUpgradePath(), CustomDamage.getBaseWeaponDamage(artifact, p, null), artifact,GenericFunctions.CalculateSlot(artifact,p)));
|
||||
tc.addExtra(" to open up the ability upgrade menu.");
|
||||
p.spigot().sendMessage(tc);*/
|
||||
p.spigot().sendMessage(ArtifactAbility.GenerateMenu(ArtifactItemType.getArtifactItemTypeFromItemStack(p.getInventory().getItem(GenericFunctions.CalculateSlot(artifact,p))).getUpgradePath(), CustomDamage.getBaseWeaponDamage(artifact, p, null), artifact,GenericFunctions.CalculateSlot(artifact,p)));
|
||||
return item;
|
||||
} else {
|
||||
return setEXP(artifact,totalval);
|
||||
@ -163,7 +153,7 @@ public class AwakenedArtifact {
|
||||
List<String> lore = m.getLore();
|
||||
DecimalFormat df = new DecimalFormat("000");
|
||||
lore.set(findLVLine(lore), ChatColor.GRAY+"Level "+df.format(amt));
|
||||
//lore.set(findAPLine(lore), ChatColor.GOLD+"Ability Points: "+getAP(artifact)+"/"+amt);
|
||||
lore.set(findAPLine(lore), ChatColor.GOLD+"Ability Points: "+getAP(artifact)+"/"+amt);
|
||||
m.setLore(lore);
|
||||
artifact.setItemMeta(m);
|
||||
return artifact;
|
||||
@ -392,10 +382,7 @@ public class AwakenedArtifact {
|
||||
//AP is on line 7 (element 6)
|
||||
m.setLore(lore);
|
||||
item.setItemMeta(m);
|
||||
//ItemUtils.addLoreLineUnderneathLineContainingSubstring(artifact, "Artifact Crafting Item", ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Artifact");
|
||||
item=ItemUtils.ModifyLoreLineContainingSubstring(item, ChatColor.GOLD+""+ChatColor.BOLD+"T", ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Artifact");
|
||||
//item.addUnsafeEnchantment(Enchantment.LUCK, tier);
|
||||
item.removeEnchantment(Enchantment.LUCK);
|
||||
item.addUnsafeEnchantment(Enchantment.LUCK, tier);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -1,292 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Boss;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.Box;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.MaterialData;
|
||||
|
||||
/**
|
||||
* Holds data about an arena.
|
||||
* @param <E>
|
||||
*/
|
||||
public class Arena<E> {
|
||||
HashMap<Block,MaterialData> oldblocklist = new HashMap<Block,MaterialData>();
|
||||
List<Material> wallmats = new ArrayList<Material>();
|
||||
List<Material> floormats = new ArrayList<Material>();
|
||||
List<Material> roofmats = new ArrayList<Material>();
|
||||
List<Material> insidemats = new ArrayList<Material>();
|
||||
List<Chunk> temporarychunks = new ArrayList<Chunk>();
|
||||
List<Player> arenaplayers = new ArrayList<Player>();
|
||||
Box box;
|
||||
World world;
|
||||
E test;
|
||||
|
||||
public Arena(World world, int x, int y, int z, int w, int h, int d,Material arena_mat) {
|
||||
this.world = world;
|
||||
this.box = new Box(x,y,z,w,h,d);
|
||||
this.wallmats.add(arena_mat);
|
||||
this.floormats.add(arena_mat);
|
||||
this.roofmats.add(arena_mat);
|
||||
}
|
||||
|
||||
public Arena(World world, int x, int y, int z, int w, int h, int d,Material...arena_mats) {
|
||||
this.world = world;
|
||||
this.box = new Box(x,y,z,w,h,d);
|
||||
for (Material mat : arena_mats) {
|
||||
this.wallmats.add(mat);
|
||||
this.floormats.add(mat);
|
||||
this.roofmats.add(mat);
|
||||
}
|
||||
}
|
||||
|
||||
public Arena(World world, int x, int y, int z, int w, int h, int d,Material insidemat, Material...arena_mats) {
|
||||
this.world = world;
|
||||
this.box = new Box(x,y,z,w,h,d);
|
||||
for (Material mat : arena_mats) {
|
||||
this.wallmats.add(mat);
|
||||
this.floormats.add(mat);
|
||||
this.roofmats.add(mat);
|
||||
}
|
||||
this.insidemats.add(insidemat);
|
||||
}
|
||||
|
||||
public Arena(World world, int x, int y, int z, int w, int h, int d,Material insidemat, Material wallmat, Material floormat, Material roofmat) {
|
||||
this.world = world;
|
||||
this.box = new Box(x,y,z,w,h,d);
|
||||
this.wallmats.add(wallmat);
|
||||
this.floormats.add(floormat);
|
||||
this.roofmats.add(roofmat);
|
||||
this.insidemats.add(insidemat);
|
||||
}
|
||||
|
||||
public Arena(World world, int x, int y, int z, int w, int h, int d, Material[] insidemats, Material[] wallmats, Material[] floormats, Material[] roofmats) {
|
||||
this.world = world;
|
||||
this.box = new Box(x,y,z,w,h,d);
|
||||
for (Material mat : wallmats) {
|
||||
this.wallmats.add(mat);
|
||||
}
|
||||
for (Material mat : floormats) {
|
||||
this.floormats.add(mat);
|
||||
}
|
||||
for (Material mat : roofmats) {
|
||||
this.roofmats.add(mat);
|
||||
}
|
||||
for (Material mat : insidemats) {
|
||||
this.insidemats.add(mat);
|
||||
}
|
||||
}
|
||||
|
||||
public void runTick() {
|
||||
for (Player p : arenaplayers) {
|
||||
if (p==null || !p.isValid()) {
|
||||
TwosideKeeper.ScheduleRemoval(arenaplayers,p);
|
||||
}
|
||||
}
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
TwosideKeeper.log("Checking for "+p.getName(), 0);
|
||||
if (p.getGameMode()==GameMode.SURVIVAL) {
|
||||
if (arenaplayers.contains(p)) {
|
||||
if (!insideBoundaries(p)) {
|
||||
p.teleport(new Location(world,box.getX()+(box.getWidth()/2),box.getY()+(box.getHeight()/2),box.getZ()+(box.getDepth()/2)));
|
||||
p.sendMessage(ChatColor.GREEN+"You cannot leave this arena!");
|
||||
}
|
||||
} else {
|
||||
if (insideBoundaries(p)) {
|
||||
p.teleport(new Location(world,box.getX()+(box.getWidth()/2),box.getY()+(box.getHeight()*2),box.getZ()+(box.getDepth()/2)));
|
||||
p.sendMessage(ChatColor.GREEN+"You cannot enter this arena!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean insideBoundaries(Player p) {
|
||||
int x = p.getLocation().getBlockX();
|
||||
int y = p.getLocation().getBlockY();
|
||||
int z = p.getLocation().getBlockZ();
|
||||
return (x>=box.getX() && x<=box.getX()+box.getWidth() &&
|
||||
y>=box.getY() && y<=box.getY()+box.getHeight() &&
|
||||
z>=box.getZ() && z<=box.getZ()+box.getDepth());
|
||||
}
|
||||
|
||||
public void AddPlayers(Player...players) {
|
||||
for (Player p : players) {
|
||||
arenaplayers.add(p);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemovePlayers(Player...players) {
|
||||
for (Player p : players) {
|
||||
arenaplayers.remove(p);
|
||||
}
|
||||
}
|
||||
|
||||
public void AssembleArena() {
|
||||
final int x = box.getX();
|
||||
final int y = box.getY();
|
||||
final int z = box.getZ();
|
||||
AssembleArena(x,y,z,box.clone());
|
||||
}
|
||||
|
||||
public void DisassembleArena() {
|
||||
DisassembleArena(-1);
|
||||
}
|
||||
|
||||
public void DisassembleArena(int amt) {
|
||||
//amt is how many blocks to process in one tick.
|
||||
int processed=0;
|
||||
for (Block b : oldblocklist.keySet()) {
|
||||
Chunk c = b.getChunk();
|
||||
if (!TwosideKeeper.temporary_chunks.contains(c)) {
|
||||
TwosideKeeper.temporary_chunks.add(c);
|
||||
}
|
||||
c.load();
|
||||
if (!temporarychunks.contains(c)) {
|
||||
temporarychunks.add(c);
|
||||
}
|
||||
MaterialData dat = oldblocklist.get(b);
|
||||
if (b.getType()!=dat.getType() || b.getData()!=dat.getData()) {
|
||||
b.setType(dat.getType());
|
||||
b.setData(dat.getData());
|
||||
}
|
||||
if (amt!=-1) {TwosideKeeper.ScheduleRemoval(oldblocklist, b);}
|
||||
processed++;
|
||||
if (processed>amt && amt!=-1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (amt!=-1 && oldblocklist.size()>0) {
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{DisassembleArena(amt);}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void AssembleArena(int curx, int cury, int curz, Box box) {
|
||||
for (int i=0;i<8;i++) {
|
||||
Block b = world.getBlockAt(curx, cury, curz);
|
||||
Chunk c = b.getChunk();
|
||||
if (!TwosideKeeper.temporary_chunks.contains(c)) {
|
||||
TwosideKeeper.temporary_chunks.add(c);
|
||||
}
|
||||
c.load();
|
||||
if (!temporarychunks.contains(c)) {
|
||||
temporarychunks.add(c);
|
||||
}
|
||||
while (b.getState()!=null && b.getState() instanceof InventoryHolder) {
|
||||
if (curx>box.getX()+box.getWidth()) {
|
||||
curx=box.getX();
|
||||
cury++;
|
||||
}
|
||||
if (cury>box.getY()+box.getHeight()) {
|
||||
cury=box.getY();
|
||||
curz++;
|
||||
}
|
||||
if (curz<box.getZ()+box.getDepth()) {
|
||||
ConvertBlock(curx, cury, curz, box, b);
|
||||
curx++;
|
||||
}
|
||||
}
|
||||
if (curx>box.getX()+box.getWidth()) {
|
||||
curx=box.getX();
|
||||
cury++;
|
||||
}
|
||||
if (cury>box.getY()+box.getHeight()) {
|
||||
cury=box.getY();
|
||||
curz++;
|
||||
}
|
||||
if (curz<box.getZ()+box.getDepth()) {
|
||||
ConvertBlock(curx, cury, curz, box, b);
|
||||
curx++;
|
||||
}
|
||||
}
|
||||
if (curz<=box.getZ()+box.getDepth()) {
|
||||
final int x = curx;
|
||||
final int y = cury;
|
||||
final int z = curz;
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||
AssembleArena(x,y,z,box);
|
||||
}, 1);
|
||||
} else {
|
||||
ClearAllTemporaryChunks();
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetBlock(int curx, int cury, int curz, Box box, Block b) {
|
||||
if (oldblocklist.containsKey(b)) {
|
||||
MaterialData dat = oldblocklist.get(b);
|
||||
if (b.getType()!=dat.getType() || b.getData()!=dat.getData()) {
|
||||
b.setType(dat.getType());
|
||||
b.setData(dat.getData());
|
||||
}
|
||||
oldblocklist.remove(b);
|
||||
}
|
||||
}
|
||||
|
||||
public void ConvertBlock(int curx, int cury, int curz, Box box, Block b) {
|
||||
if (isWallBlock(curx,cury,curz,box)) {
|
||||
oldblocklist.put(b,new MaterialData(b.getType(),b.getData()));
|
||||
b.setType(wallmats.get((int)(Math.random()*wallmats.size())));
|
||||
} else
|
||||
if (isRoofBlock(curx,cury,curz,box)) {
|
||||
oldblocklist.put(b,new MaterialData(b.getType(),b.getData()));
|
||||
b.setType(roofmats.get((int)(Math.random()*roofmats.size())));
|
||||
} else
|
||||
if (isFloorBlock(curx,cury,curz,box)) {
|
||||
oldblocklist.put(b,new MaterialData(b.getType(),b.getData()));
|
||||
b.setType(floormats.get((int)(Math.random()*floormats.size())));
|
||||
} else
|
||||
{
|
||||
oldblocklist.put(b,new MaterialData(b.getType(),b.getData()));
|
||||
if (insidemats.size()>0) {
|
||||
if (b.getType()!=Material.AIR && !b.isLiquid()) {
|
||||
SoundUtils.playGlobalSound(b.getLocation(), Sound.BLOCK_METAL_BREAK, 0.3f, 0.3f);
|
||||
}
|
||||
b.setType(insidemats.get((int)(Math.random()*insidemats.size())));
|
||||
} else {
|
||||
b.setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
/*final int x = curx++;
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||
AssembleArena(x,cury,curz,box);
|
||||
}, 1);*/
|
||||
}
|
||||
|
||||
private boolean isFloorBlock(int curx, int cury, int curz, Box box2) {
|
||||
return cury==box.getY();
|
||||
}
|
||||
|
||||
private boolean isRoofBlock(int curx, int cury, int curz, Box box2) {
|
||||
return cury==box.getY()+box.getHeight();
|
||||
}
|
||||
|
||||
private boolean isWallBlock(int curx, int cury, int curz, Box box) {
|
||||
return curx==box.getX() || curx==box.getWidth()+box.getX() ||
|
||||
curz==box.getZ() || curz==box.getZ()+box.getDepth();
|
||||
}
|
||||
|
||||
public void Cleanup() {
|
||||
//ClearAllTemporaryChunks();
|
||||
DisassembleArena();
|
||||
}
|
||||
|
||||
private void ClearAllTemporaryChunks() {
|
||||
TwosideKeeper.temporary_chunks.removeAll(temporarychunks);
|
||||
temporarychunks.clear();
|
||||
}
|
||||
}
|
@ -1,160 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Boss;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.EliteMonster;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.Camera;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class EliteGuardian extends EliteMonster{
|
||||
Location firstHitLoc = null;
|
||||
boolean cutsceneplayed=false;
|
||||
STATE state = STATE.WAITINGFORCUTSCENE;
|
||||
int cutscenetimer=0;
|
||||
Camera cam;
|
||||
Arena arena;
|
||||
Location startedspot;
|
||||
|
||||
public EliteGuardian(Monster m) {
|
||||
super(m);
|
||||
}
|
||||
|
||||
public void runTick() {
|
||||
//This monster constantly gives itself its buffs as it may lose some (Debilitation mode).
|
||||
increaseBarTextScroll();
|
||||
dontDrown();
|
||||
regenerateHealth();
|
||||
resetToSpawn();
|
||||
createBossHealthbar();
|
||||
ignoreAllOtherTargets();
|
||||
runStateMachine();
|
||||
if (m.isValid() && targetlist.size()>0) {
|
||||
getGlow();
|
||||
}
|
||||
runArenaTick();
|
||||
}
|
||||
|
||||
private void runArenaTick() {
|
||||
if (arena!=null) {
|
||||
arena.runTick();
|
||||
}
|
||||
}
|
||||
|
||||
private void runStateMachine() {
|
||||
switch (state) {
|
||||
case PASSIVE:
|
||||
m.setAI(true);
|
||||
m.setInvulnerable(false);
|
||||
break;
|
||||
case WAITINGFORCUTSCENE:
|
||||
m.setInvulnerable(true);
|
||||
List<Player> nearby = GenericFunctions.getNearbyPlayers(m.getLocation(), 4);
|
||||
if (nearby.size()>0) {
|
||||
boolean hasLineOfSight=false;
|
||||
for (Player p : nearby) {
|
||||
if (p.hasLineOfSight(m)) {
|
||||
hasLineOfSight=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasLineOfSight) {
|
||||
List<Player> nearby2 = GenericFunctions.getNearbyPlayers(m.getLocation(), 16);
|
||||
//Play the cutscene for all of these players.
|
||||
/*for (Player p : nearby2) {
|
||||
p.setVelocity(new Vector(0,0,0));
|
||||
targetlist.add(p);
|
||||
if (cutscenetimer==0) {
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
p.setSpectatorTarget(m);
|
||||
}
|
||||
}
|
||||
if (cutscenetimer==0) {
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 40, 1, m);
|
||||
}*/
|
||||
cam = new Camera(m.getLocation(),nearby2.toArray(new Player[nearby2.size()]));
|
||||
targetlist.addAll(nearby2);
|
||||
TwosideKeeper.cameras.add(cam);
|
||||
cutscenetimer=0;
|
||||
state = STATE.RUNNINGCUTSCENE;
|
||||
TwosideKeeper.log("Monster Location: "+m.getLocation(),5);
|
||||
cam.rotateAroundPointWithZoom(0.55, 350, m.getLocation(), 8, 0.04, 1, 4);
|
||||
//cam.rotateAroundPoint(0.55, 200, m.getLocation(), 8, 4);
|
||||
arena = new Arena(m.getWorld(),
|
||||
m.getLocation().getBlockX()-10,m.getLocation().getBlockY()-2,m.getLocation().getBlockZ()-10,
|
||||
20,7,20,
|
||||
Material.PRISMARINE);
|
||||
arena.AddPlayers(nearby2.toArray(new Player[nearby2.size()]));
|
||||
arena.AssembleArena();
|
||||
TwosideKeeper.arenas.add(arena);
|
||||
startedspot = m.getLocation().clone();
|
||||
}
|
||||
}
|
||||
m.setAI(false);
|
||||
m.setVelocity(new Vector(0,0,0));
|
||||
break;
|
||||
case RUNNINGCUTSCENE:
|
||||
cutscenetimer++;
|
||||
if (cutscenetimer>60) {
|
||||
state=STATE.PASSIVE;
|
||||
cam.Cleanup();
|
||||
}
|
||||
m.setAI(false);
|
||||
m.setVelocity(new Vector(0,0,0));
|
||||
m.teleport(startedspot);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (Player p : targetlist) {
|
||||
adjustMiningFatigue(p);
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustMiningFatigue(Player p) {
|
||||
if (p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) && ((GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==2 && GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING, p)>=4800) || (GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==20 && GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING, p)<4800))) {
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW_DIGGING, 6000, 20, p, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void runHitEvent(LivingEntity damager, double dmg) {
|
||||
super.runHitEvent(damager,dmg);
|
||||
}
|
||||
|
||||
public void Cleanup() {
|
||||
super.Cleanup();
|
||||
if (arena!=null) {
|
||||
arena.DisassembleArena();
|
||||
TwosideKeeper.arenas.remove(arena);
|
||||
}
|
||||
}
|
||||
|
||||
public void AnnounceFailedTakedown() {
|
||||
super.AnnounceFailedTakedown();
|
||||
if (dpslist.size()>0 && !m.isDead()) {
|
||||
if (arena!=null) {
|
||||
arena.DisassembleArena();
|
||||
TwosideKeeper.arenas.remove(arena);
|
||||
arena=null;
|
||||
}
|
||||
state=STATE.WAITINGFORCUTSCENE;
|
||||
cutscenetimer=0;
|
||||
}
|
||||
}
|
||||
|
||||
enum STATE {
|
||||
PASSIVE, //Just works like vanilla Minecraft behavior.
|
||||
WAITINGFORCUTSCENE, //A mode where the game is waiting for a cutscene to occur. The Elite Guardian does not move during this time.
|
||||
RUNNINGCUTSCENE,
|
||||
}
|
||||
}
|
@ -32,31 +32,24 @@ import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
import sig.plugin.TwosideKeeper.EliteMonster;
|
||||
import sig.plugin.TwosideKeeper.MonsterController;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Loot;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.APIUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class EliteZombie extends EliteMonster{
|
||||
static int REFRESH_BUFFS = 20*30;
|
||||
static float FAST_MOVE_SPD = 0.575f;
|
||||
static float FAST_MOVE_SPD = 0.65f;
|
||||
static long BURST_TIME = 20*3;
|
||||
static float BURST_LIMIT = 10f;
|
||||
static int WEAKNESS_DURATION = 20*10;
|
||||
static int POISON_DURATION = 20*10;
|
||||
static int LEAP_COOLDOWN = 20*20;
|
||||
static int LEAP_COOLDOWN = 20*40;
|
||||
static int ENRAGE_COOLDOWN = 20*60;
|
||||
static int STORINGENERGY_COOLDOWN = 20*45;
|
||||
static int WILLPOWER_COOLDOWN = 20*30;
|
||||
static int STORINGENERGY_COOLDOWN = 20*50;
|
||||
static int WILLPOWER_COOLDOWN = 20*50;
|
||||
static int GLOW_TIME = 20*1;
|
||||
|
||||
private long stuckTimer=0;
|
||||
private Location lastLoc = null;
|
||||
|
||||
long last_rebuff_time=0;
|
||||
long last_burstcheck_time=0;
|
||||
long last_applyglow_time=0;
|
||||
@ -95,17 +88,14 @@ public class EliteZombie extends EliteMonster{
|
||||
|
||||
protected void createBossHealthbar() {
|
||||
List<Player> currentplayers = bar.getPlayers();
|
||||
/*for (int i=0;i<currentplayers.size();i++) {
|
||||
for (int i=0;i<currentplayers.size();i++) {
|
||||
if (!targetlist.contains(currentplayers.get(i))) {
|
||||
bar.removePlayer(currentplayers.get(i));
|
||||
willpower_bar.removePlayer(currentplayers.get(i));
|
||||
}
|
||||
}*/
|
||||
bar.removeAll();
|
||||
willpower_bar.removeAll();
|
||||
}
|
||||
bar.setProgress(m.getHealth()/m.getMaxHealth());
|
||||
bar.setTitle(GenericFunctions.getDisplayName(m) + ((m.getTarget()!=null && (m.getTarget() instanceof Player))?(ChatColor.DARK_AQUA+" "+arrow+" "+ChatColor.YELLOW+((Player)m.getTarget()).getName()):""));
|
||||
displayHealthbarToNearbyPlayers();
|
||||
for (int i=0;i<targetlist.size();i++) {
|
||||
if (!currentplayers.contains(targetlist.get(i))) {
|
||||
bar.addPlayer(targetlist.get(i));
|
||||
@ -146,12 +136,12 @@ public class EliteZombie extends EliteMonster{
|
||||
lp.setReapplicationDelay(20);
|
||||
lp.setBasePotionData(new PotionData(PotionType.POISON));
|
||||
lp.setParticle(Particle.SPELL);
|
||||
SoundUtils.playGlobalSound(loc, Sound.ENTITY_HOSTILE_SPLASH, 1.0f, 1.0f);
|
||||
loc.getWorld().playSound(loc, Sound.ENTITY_HOSTILE_SPLASH, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
private void adjustWillpower() {
|
||||
//Check for nearby mobs. Each mob increases willpower by 1.
|
||||
if (Math.random()<=0.5 && !leaping && !storingenergy) {
|
||||
if (Math.random()<=0.3 && !leaping && !storingenergy) {
|
||||
int mobcount=0;
|
||||
List<Monster> monsterlist = CustomDamage.trimNonMonsterEntities(m.getNearbyEntities(10, 10, 10));
|
||||
mobcount=monsterlist.size()-1;
|
||||
@ -256,8 +246,8 @@ public class EliteZombie extends EliteMonster{
|
||||
p.setVelocity(new Vector(0,-1,0));
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,(int)(20*2.25),0,p);
|
||||
SoundUtils.playLocalSound(p, Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f);
|
||||
SoundUtils.playLocalSound(p, Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f);
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,13 +267,13 @@ public class EliteZombie extends EliteMonster{
|
||||
}
|
||||
}
|
||||
if (!storingenergy) {
|
||||
/*if (storingenergy_hit>0) {
|
||||
//storingenergy_hit/=1.04f;
|
||||
if (storingenergy_hit>0) {
|
||||
storingenergy_hit/=1.04f;
|
||||
if (storingenergy_hit<10) {
|
||||
storingenergy_hit=0;
|
||||
}
|
||||
} */
|
||||
if (l.getLocation().distanceSquared(m.getLocation())>8192 && !leaping && last_leap_time+20<TwosideKeeper.getServerTickTime()) {
|
||||
}
|
||||
if (l.getLocation().distanceSquared(m.getLocation())>4096 && !leaping) {
|
||||
//Lose the target.
|
||||
targetlist.remove(l);
|
||||
if (targetlist.size()>0) {
|
||||
@ -294,12 +284,12 @@ public class EliteZombie extends EliteMonster{
|
||||
}
|
||||
} else
|
||||
if (l.getLocation().distanceSquared(m.getLocation())>100 && !leaping) {
|
||||
SoundUtils.playGlobalSound(l.getLocation(), Sound.ENTITY_CAT_HISS, 1.0f, 1.0f);
|
||||
l.getWorld().playSound(l.getLocation(), Sound.ENTITY_CAT_HISS, 1.0f, 1.0f);
|
||||
chasing=true;
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||
public void run() {
|
||||
m.teleport(l.getLocation().add(Math.random(),Math.random(),Math.random()));
|
||||
l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20*5,4));
|
||||
l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,20*5,7));
|
||||
l.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,20*1,7));
|
||||
chasing=false;
|
||||
}
|
||||
@ -309,28 +299,12 @@ public class EliteZombie extends EliteMonster{
|
||||
} else {
|
||||
m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(DEFAULT_MOVE_SPD);
|
||||
}
|
||||
}
|
||||
|
||||
if (l.getLocation().getY()>m.getLocation().getY()+1) {
|
||||
//Jump up to compensate. Move towards the player too.
|
||||
m.setVelocity((m.getLocation().getDirection()).add(new Vector(0,0.2*(l.getLocation().getY()-m.getLocation().getY()),0)));
|
||||
}
|
||||
if (lastLoc!=null && lastLoc.distance(m.getLocation())<=0.4) {
|
||||
stuckTimer++;
|
||||
//TwosideKeeper.log("Stuck. "+stuckTimer, 0);
|
||||
} else {
|
||||
stuckTimer=0;
|
||||
}
|
||||
lastLoc = m.getLocation().clone();
|
||||
if (stuckTimer>5) {
|
||||
//Teleport randomly.
|
||||
m.teleport(getNearbyFreeLocation(m.getLocation()));
|
||||
stuckTimer=0;
|
||||
}
|
||||
}
|
||||
if (l instanceof Player) {
|
||||
Player pl = (Player)l;
|
||||
pl.setFlying(false);
|
||||
}
|
||||
} else {
|
||||
targetlist.remove(l);
|
||||
m.setTarget(null);
|
||||
@ -340,7 +314,7 @@ public class EliteZombie extends EliteMonster{
|
||||
private void rebuff() {
|
||||
if (last_rebuff_time+REFRESH_BUFFS<=TwosideKeeper.getServerTickTime()) {
|
||||
last_rebuff_time=TwosideKeeper.getServerTickTime();
|
||||
//m.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,Integer.MAX_VALUE,8),true);
|
||||
m.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,Integer.MAX_VALUE,8),true);
|
||||
m.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE,Integer.MAX_VALUE,8),true);
|
||||
//m.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,Integer.MAX_VALUE,2),true);
|
||||
ItemStack helm = new ItemStack(Material.GOLD_AXE);
|
||||
@ -366,11 +340,6 @@ public class EliteZombie extends EliteMonster{
|
||||
bar.setColor(BarColor.RED);
|
||||
if (!targetlist.contains(damager) && (damager instanceof Player)) {
|
||||
targetlist.add((Player)damager);
|
||||
if (targetlist.size()>4) {
|
||||
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
|
||||
m.setMaxHealth(baseHP+hpgain);
|
||||
GenericFunctions.HealEntity(m,hpgain);
|
||||
}
|
||||
}
|
||||
if (!participantlist.contains(damager) && (damager instanceof Player)) {
|
||||
participantlist.add((Player)damager);
|
||||
@ -389,12 +358,12 @@ public class EliteZombie extends EliteMonster{
|
||||
}
|
||||
last_regen_time=TwosideKeeper.getServerTickTime();
|
||||
double randomrate = 0d;
|
||||
if (!chasing && CustomDamage.getPercentHealthRemaining(m)<=90) {
|
||||
if (!chasing && CustomDamage.getPercentHealthRemaining(m)<=50) {
|
||||
if (last_leap_time+LEAP_COOLDOWN<=TwosideKeeper.getServerTickTime()) {
|
||||
performLeap();
|
||||
}
|
||||
}
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=65) {
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=25) {
|
||||
if (!leaping && !chasing &&
|
||||
last_storingenergy_time+STORINGENERGY_COOLDOWN<=TwosideKeeper.getServerTickTime()) {
|
||||
last_storingenergy_time=TwosideKeeper.getServerTickTime();
|
||||
@ -402,7 +371,6 @@ public class EliteZombie extends EliteMonster{
|
||||
for (int i=0;i<targetlist.size();i++) {
|
||||
targetlist.get(i).sendMessage(ChatColor.GOLD+"The "+GenericFunctions.getDisplayName(m)+ChatColor.GOLD+" is absorbing energy!");
|
||||
}
|
||||
Channel.createNewChannel(m, "Storing Energy", 20);
|
||||
m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0f);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||
public void run() {
|
||||
@ -413,7 +381,7 @@ public class EliteZombie extends EliteMonster{
|
||||
Player target = ChooseRandomTarget();
|
||||
if (target!=null) {
|
||||
if (last_storingenergy_health-m.getHealth()>0) {
|
||||
storingenergy_hit=(last_storingenergy_health-m.getHealth());
|
||||
storingenergy_hit=(last_storingenergy_health-m.getHealth())*500d;
|
||||
for (int i=0;i<targetlist.size();i++) {
|
||||
targetlist.get(i).sendMessage(ChatColor.GOLD+"The "+GenericFunctions.getDisplayName(m)+ChatColor.GOLD+"'s next hit is stronger!");
|
||||
targetlist.get(i).sendMessage(ChatColor.DARK_RED+""+ChatColor.ITALIC+" \"DIE "+target.getName()+ChatColor.DARK_RED+"! DIEE!\"");
|
||||
@ -430,7 +398,7 @@ public class EliteZombie extends EliteMonster{
|
||||
},6*20);
|
||||
}
|
||||
}
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=20) {
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=10) {
|
||||
if (last_enrage_time+ENRAGE_COOLDOWN<=TwosideKeeper.getServerTickTime()) {
|
||||
last_enrage_time=TwosideKeeper.getServerTickTime();
|
||||
for (int i=0;i<targetlist.size();i++) {
|
||||
@ -452,12 +420,12 @@ public class EliteZombie extends EliteMonster{
|
||||
}},20*20);
|
||||
}
|
||||
}
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=90 &&
|
||||
CustomDamage.getPercentHealthRemaining(m)>75) {
|
||||
randomrate = 1/16d;
|
||||
} else
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=75 &&
|
||||
CustomDamage.getPercentHealthRemaining(m)>50) {
|
||||
randomrate = 1/16d;
|
||||
} else
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<=50 &&
|
||||
CustomDamage.getPercentHealthRemaining(m)>25) {
|
||||
randomrate = 1/8d;
|
||||
} else
|
||||
{
|
||||
@ -485,8 +453,7 @@ public class EliteZombie extends EliteMonster{
|
||||
Monster nm = (Monster)m.getWorld().spawnEntity(getNearbyFreeLocation(m.getLocation()),choice);
|
||||
Player target = targetlist.get((int)(Math.random() * targetlist.size()));
|
||||
nm.setTarget(target);
|
||||
//MonsterController.convertMonster(nm, MonsterDifficulty.HELLFIRE);
|
||||
MonsterController.convertLivingEntity(nm, LivingEntityDifficulty.HELLFIRE);
|
||||
MonsterController.convertMonster(nm, MonsterDifficulty.HELLFIRE);
|
||||
}
|
||||
if (CustomDamage.getPercentHealthRemaining(m)<10) {
|
||||
Player target = targetlist.get((int)(Math.random() * targetlist.size()));
|
||||
@ -495,15 +462,14 @@ public class EliteZombie extends EliteMonster{
|
||||
nm.setPowered(true);
|
||||
}
|
||||
nm.setTarget(target);
|
||||
//MonsterController.convertMonster(nm, MonsterDifficulty.HELLFIRE);
|
||||
MonsterController.convertLivingEntity(nm, LivingEntityDifficulty.HELLFIRE);
|
||||
MonsterController.convertMonster(nm, MonsterDifficulty.HELLFIRE);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void performLeap() {
|
||||
last_leap_time = TwosideKeeper.getServerTickTime();
|
||||
int radius = (int)(5*(CustomDamage.getPercentHealthMissing(m)/100d))+4;
|
||||
int radius = (int)(6*(CustomDamage.getPercentHealthMissing(m)/100d))+1;
|
||||
//Choose a target randomly.
|
||||
Player target = ChooseRandomTarget();
|
||||
m.setTarget(target);
|
||||
@ -530,7 +496,7 @@ public class EliteZombie extends EliteMonster{
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Selected block "+b.toString(), 5);
|
||||
if (!APIUtils.isExplosionProof(b) && b.getType()!=Material.STAINED_GLASS) {
|
||||
if (!aPlugin.API.isExplosionProof(b) && b.getType()!=Material.STAINED_GLASS) {
|
||||
Material type = b.getType();
|
||||
Byte data = b.getData();
|
||||
storedblocks.put(b, type);
|
||||
@ -558,13 +524,12 @@ public class EliteZombie extends EliteMonster{
|
||||
b.setType(Material.AIR);
|
||||
} else {
|
||||
b.setType(storedblocks.get(b));
|
||||
b.setData(storedblockdata.get(b));
|
||||
}
|
||||
SoundUtils.playGlobalSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f);
|
||||
}
|
||||
aPlugin.API.sendSoundlessExplosion(target_leap_loc, 4);
|
||||
b.getLocation().getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f);
|
||||
}
|
||||
storedblocks.clear();
|
||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f);
|
||||
m.getLocation().getWorld().playSound(m.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.7f, 1.2f);
|
||||
List<Player> nearbyplayers = GenericFunctions.getNearbyPlayers(target_leap_loc, radius);
|
||||
for (int i=0;i<nearbyplayers.size();i++) {
|
||||
GenericFunctions.removeNoDamageTick(nearbyplayers.get(i), m);
|
||||
@ -576,18 +541,13 @@ public class EliteZombie extends EliteMonster{
|
||||
//GenericFunctions.DealDamageToNearbyPlayers(target_leap_loc, 5*200, radius, true, 2, m, "Leap",false);
|
||||
//GenericFunctions.getNear
|
||||
}
|
||||
},(int)(((20*1.5)*(CustomDamage.getPercentHealthRemaining(m)/100d))+30));
|
||||
},(int)(((20*3)*(CustomDamage.getPercentHealthRemaining(m)/100d))+30));
|
||||
}
|
||||
|
||||
//Triggers when this mob hits something.
|
||||
public void hitEvent(LivingEntity ent) {
|
||||
if (!targetlist.contains(ent) && (ent instanceof Player)) {
|
||||
targetlist.add((Player)ent);
|
||||
if (targetlist.size()>4) {
|
||||
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
|
||||
m.setMaxHealth(baseHP+hpgain);
|
||||
m.setHealth(m.getHealth()+hpgain);
|
||||
}
|
||||
}
|
||||
if (Math.random()<=0.33) {
|
||||
if (ent.hasPotionEffect(PotionEffectType.POISON)) {
|
||||
@ -602,14 +562,13 @@ public class EliteZombie extends EliteMonster{
|
||||
if (ent instanceof Player) {
|
||||
Player p = (Player)ent;
|
||||
if (storingenergy_hit>0) {
|
||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,20*4,0,p);
|
||||
TwosideKeeper.log("Got hit for "+storingenergy_hit+" damage!", 2);
|
||||
//GenericFunctions.removeNoDamageTick(p, m);
|
||||
if (CustomDamage.ApplyDamage(storingenergy_hit, m, p, null, "Stored Energy", CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE|CustomDamage.IGNORE_DAMAGE_TICK)) {
|
||||
GenericFunctions.removeNoDamageTick(p, m);
|
||||
if (CustomDamage.ApplyDamage(storingenergy_hit, m, p, null, "Stored Energy", CustomDamage.IGNOREDODGE)) {
|
||||
//TwosideKeeperAPI.DealDamageToEntity(.CalculateDamageReduction(storingenergy_hit,p,m),p,m);
|
||||
storingenergy_hit=0;
|
||||
p.setVelocity(m.getLocation().getDirection().multiply(2.0f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package sig.plugin.TwosideKeeper.Boss;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
@ -8,7 +7,6 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import sig.plugin.TwosideKeeper.ChargeZombie;
|
||||
import sig.plugin.TwosideKeeper.EliteMonster;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeperAPI;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class MegaWither extends EliteMonster{
|
||||
@ -29,11 +27,6 @@ public class MegaWither extends EliteMonster{
|
||||
ignoreAllOtherTargets();
|
||||
randomlyDropDown();
|
||||
destroyNearbyBlocks();
|
||||
setupName();
|
||||
}
|
||||
|
||||
private void setupName() {
|
||||
TwosideKeeperAPI.setCustomLivingEntityName(m, ChatColor.DARK_RED+"Mega Wither");
|
||||
}
|
||||
|
||||
private void destroyNearbyBlocks() {
|
||||
|
@ -1,31 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Boss;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Guardian;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import sig.plugin.TwosideKeeper.EliteMonster;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class SendMiningFatigueToAllNearbyElderGuardians extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (EliteMonster em : TwosideKeeper.elitemonsters) {
|
||||
if (em.getMonster() instanceof Guardian) {
|
||||
//Apply Mining Fatigue 100 to all players.
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (!p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) || GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING,p)<1200 ||
|
||||
GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)<20) {
|
||||
//p.getWorld().playEffect(p.getLocation(), Effect., arg2);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW_DIGGING, 6000, 20, p, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -5,7 +5,6 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.boss.BarFlag;
|
||||
@ -18,7 +17,6 @@ import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
@Deprecated
|
||||
public class BossMonster {
|
||||
private String name;
|
||||
private double maxhp;
|
||||
@ -43,7 +41,7 @@ public class BossMonster {
|
||||
this.m = m;
|
||||
this.damagereduction=0.0;
|
||||
this.buffs=null;
|
||||
this.movespd=LivingEntityStructure.GetLivingEntityStructure(m).original_movespd;
|
||||
this.movespd=LivingEntityStructure.getLivingEntityStructure(m).original_movespd;
|
||||
this.hp_regen=0;
|
||||
this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG);
|
||||
}
|
||||
@ -56,7 +54,7 @@ public class BossMonster {
|
||||
this.attackstrength = attackstrength;
|
||||
this.m = m;
|
||||
this.buffs=null;
|
||||
this.movespd=LivingEntityStructure.GetLivingEntityStructure(m).original_movespd;
|
||||
this.movespd=LivingEntityStructure.getLivingEntityStructure(m).original_movespd;
|
||||
this.hp_regen=0;
|
||||
this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG);
|
||||
}
|
||||
@ -70,7 +68,7 @@ public class BossMonster {
|
||||
this.attackstrength = attackstrength;
|
||||
this.m = m;
|
||||
this.buffs = buffs;
|
||||
this.movespd=LivingEntityStructure.GetLivingEntityStructure(m).original_movespd;
|
||||
this.movespd=LivingEntityStructure.getLivingEntityStructure(m).original_movespd;
|
||||
this.hp_regen=0;
|
||||
this.bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SOLID, BarFlag.CREATE_FOG);
|
||||
}
|
||||
@ -152,15 +150,13 @@ public class BossMonster {
|
||||
|
||||
protected void createBossHealthbar() {
|
||||
List<Player> currentplayers = bar.getPlayers();
|
||||
/*for (int i=0;i<currentplayers.size();i++) {
|
||||
for (int i=0;i<currentplayers.size();i++) {
|
||||
if (!targetlist.contains(currentplayers.get(i))) {
|
||||
bar.removePlayer(currentplayers.get(i));
|
||||
}
|
||||
}*/
|
||||
bar.removeAll();
|
||||
}
|
||||
bar.setProgress(m.getHealth()/m.getMaxHealth());
|
||||
bar.setTitle(GenericFunctions.getDisplayName(m) + ((m instanceof Monster && ((Monster)m).getTarget()!=null && (((Monster)m).getTarget() instanceof Player))?(ChatColor.DARK_AQUA+" "+arrow+" "+ChatColor.YELLOW+((Player)((Monster)m).getTarget()).getName()):""));
|
||||
displayHealthbarToNearbyPlayers();
|
||||
for (int i=0;i<targetlist.size();i++) {
|
||||
if (!currentplayers.contains(targetlist.get(i))) {
|
||||
bar.addPlayer(targetlist.get(i));
|
||||
@ -168,12 +164,4 @@ public class BossMonster {
|
||||
}
|
||||
}
|
||||
|
||||
private void displayHealthbarToNearbyPlayers() {
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (m.getLocation().distanceSquared(p.getLocation())<=2500) {
|
||||
bar.addPlayer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,433 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.BuffTemplate;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
public class Buff {
|
||||
private String displayName;
|
||||
private long expireTime;
|
||||
private int level;
|
||||
private Color col;
|
||||
private String icon;
|
||||
private boolean isGoodBuff; //If false, it's a debuff.
|
||||
private boolean permanentBuff; //Whether or not this buff/debuff cannot be removed by normal means.
|
||||
private boolean displayTimer;
|
||||
|
||||
/**
|
||||
* Creates a new Buff structure.
|
||||
* @param displayName The name that will show up in the action bar for players if they have this buff.
|
||||
* @param duration The amount of time in ticks the buff will remain active.
|
||||
* @param amplifier The amplifier/level/stack amount of this buff.
|
||||
* @param buffcolor The color of the particles this buff creates.
|
||||
* @param icon An icon that appears for the buff in the action bar and status bar for monster name tags. This typically includes a chat color code as well to distinguish this buff's color.
|
||||
* @param isGoodBuff Whether or not this is a good buff. Debuffs should have this set to false.
|
||||
*/
|
||||
public Buff(String displayName, long duration, int amplifier, Color buffcolor, String icon, boolean isGoodBuff) {
|
||||
this.displayName=displayName;
|
||||
this.expireTime=TwosideKeeper.getServerTickTime()+duration;
|
||||
this.level=amplifier;
|
||||
this.col=buffcolor;
|
||||
this.icon=icon;
|
||||
this.isGoodBuff=isGoodBuff;
|
||||
this.permanentBuff=false;
|
||||
this.displayTimer=false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Buff structure.
|
||||
* @param displayName The name that will show up in the action bar for players if they have this buff.
|
||||
* @param duration The amount of time in ticks the buff will remain active.
|
||||
* @param amplifier The amplifier/level/stack amount of this buff.
|
||||
* @param buffcolor The color of the particles this buff creates.
|
||||
* @param icon An icon that appears for the buff in the action bar and status bar for monster name tags. This typically includes a chat color code as well to distinguish this buff's color.
|
||||
* @param isGoodBuff Whether or not this is a good buff. Debuffs should have this set to false.
|
||||
* @param permanentBuff Whether or not this buff cannot be removed. When set to true, the method buffCanBeRemoved() returns false, notifying the programmers that this buff should not be removed. This make the use of removeBuff() for this buff do absolutely nothing.
|
||||
*/
|
||||
public Buff(String displayName, long duration, int amplifier, Color buffcolor, String icon, boolean isGoodBuff, boolean permanentBuff) {
|
||||
this.displayName=displayName;
|
||||
this.expireTime=TwosideKeeper.getServerTickTime()+duration;
|
||||
this.level=amplifier;
|
||||
this.col=buffcolor;
|
||||
this.icon=icon;
|
||||
this.isGoodBuff=isGoodBuff;
|
||||
this.permanentBuff=permanentBuff;
|
||||
this.displayTimer=false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Buff structure.
|
||||
* @param displayName The name that will show up in the action bar for players if they have this buff.
|
||||
* @param duration The amount of time in ticks the buff will remain active.
|
||||
* @param amplifier The amplifier/level/stack amount of this buff.
|
||||
* @param buffcolor The color of the particles this buff creates.
|
||||
* @param icon An icon that appears for the buff in the action bar and status bar for monster name tags. This typically includes a chat color code as well to distinguish this buff's color.
|
||||
* @param isGoodBuff Whether or not this is a good buff. Debuffs should have this set to false.
|
||||
* @param permanentBuff Whether or not this buff cannot be removed. When set to true, the method buffCanBeRemoved() returns false, notifying the programmers that this buff should not be removed. This make the use of removeBuff() for this buff do absolutely nothing.
|
||||
* @param displayTimer Whether or not to display the countdown timer even if the duration is greater than 10 seconds.
|
||||
*/
|
||||
public Buff(String displayName, long duration, int amplifier, Color buffcolor, String icon, boolean isGoodBuff, boolean permanentBuff, boolean displayTimer) {
|
||||
this.displayName=displayName;
|
||||
this.expireTime=TwosideKeeper.getServerTickTime()+duration;
|
||||
this.level=amplifier;
|
||||
this.col=buffcolor;
|
||||
this.icon=icon;
|
||||
this.isGoodBuff=isGoodBuff;
|
||||
this.permanentBuff=permanentBuff;
|
||||
this.displayTimer=displayTimer;
|
||||
}
|
||||
|
||||
public static boolean hasBuffInHashMap(LivingEntity l, String name) {
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
return pd.buffs.containsKey(name);
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
return les.buffs.containsKey(name);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasBuff(LivingEntity l, BuffTemplate buff) {
|
||||
return hasBuff(l,buff.getKeyName());
|
||||
}
|
||||
|
||||
public static boolean hasBuff(LivingEntity l, String name) {
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (pd.buffs.containsKey(name)) {
|
||||
Buff b = pd.buffs.get(name);
|
||||
return hasBuffExpired(b);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
if (les.buffs.containsKey(name)) {
|
||||
Buff b = les.buffs.get(name);
|
||||
return hasBuffExpired(b);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void outputBuffs(LivingEntity l) {
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
TwosideKeeper.log(TextUtils.outputHashmap(pd.buffs),0);
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
TwosideKeeper.log(TextUtils.outputHashmap(les.buffs),0);
|
||||
}
|
||||
}
|
||||
|
||||
public static HashMap<String,Buff>getBuffData(LivingEntity l) {
|
||||
if (l instanceof Player) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)l);
|
||||
return pd.buffs;
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
return les.buffs;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <b>null</b> if no buff found! Use <b>hasBuff()</b> to verify they have
|
||||
* a buff beforehand.
|
||||
*
|
||||
* This version of the method uses a BuffTemplate, which allows you to use an already defined setup for
|
||||
* a Buff's appearance and display.
|
||||
*/
|
||||
public static Buff getBuff(LivingEntity l, BuffTemplate buff) {
|
||||
return getBuff(l,buff.getKeyName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <b>null</b> if no buff found! Use <b>hasBuff()</b> to verify they have
|
||||
* a buff beforehand.
|
||||
*/
|
||||
public static Buff getBuff(LivingEntity l, String name) {
|
||||
if (hasBuff(l,name)) {
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (pd.buffs.containsKey(name)) {
|
||||
return pd.buffs.get(name);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
if (les.buffs.containsKey(name)) {
|
||||
Buff b = les.buffs.get(name);
|
||||
return b;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDisplayTimerAlways(boolean displayTimerAlways) {
|
||||
this.displayTimer=displayTimerAlways;
|
||||
}
|
||||
|
||||
public boolean getDisplayTimerAlways() {
|
||||
return displayTimer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to add a buff to the target. This will not necessarily add the buff if the amplifier
|
||||
* is weaker than what is currently applied, or the amplifier is the same but the duration is less.
|
||||
* This follows the same rules established by all other buff mechanics added previously to the server.
|
||||
*
|
||||
* This version of the method uses a BuffTemplate, which allows you to use an already defined setup for
|
||||
* a Buff's appearance and display.
|
||||
*/
|
||||
public static void addBuff(LivingEntity l, long duration, int amplifier, BuffTemplate buff, boolean stacking) {
|
||||
addBuff(l,buff.getKeyName(),new Buff(
|
||||
buff.getDisplayName(),
|
||||
duration,
|
||||
amplifier,
|
||||
buff.getParticleColor(),
|
||||
buff.getIcon(),
|
||||
buff.isGoodBuff(),
|
||||
buff.isPermanentBuff(),
|
||||
buff.isDisplayTimer()
|
||||
),stacking);
|
||||
}
|
||||
|
||||
|
||||
public static void addBuff(LivingEntity ent, int duration, int amplifier, BuffTemplate buff) {
|
||||
addBuff(ent,duration,amplifier,buff,false);
|
||||
}
|
||||
|
||||
public static void addBuff(LivingEntity l, String name, Buff buff) {
|
||||
addBuff(l,name,buff,false);
|
||||
}
|
||||
/**
|
||||
* Attempts to add a buff to the target. This will not necessarily add the buff if the amplifier
|
||||
* is weaker than what is currently applied, or the amplifier is the same but the duration is less.
|
||||
* This follows the same rules established by all other buff mechanics added previously to the server.
|
||||
*/
|
||||
public static void addBuff(LivingEntity l, String name, Buff buff, boolean stacking) {
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
if (PVP.isPvPing(p)) {
|
||||
buff.setDuration((int)((buff.expireTime-TwosideKeeper.getServerTickTime()) / 2));
|
||||
}
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
int oldlv = 0;
|
||||
long oldduration = 0;
|
||||
if (hasBuff(p,name)) {
|
||||
oldlv = pd.buffs.get(name).getAmplifier();
|
||||
oldduration = pd.buffs.get(name).getRemainingBuffTime();
|
||||
if (stacking) {
|
||||
if (PVP.isPvPing(p)) {
|
||||
oldlv=1;
|
||||
}
|
||||
buff.setStacks(buff.getAmplifier()+oldlv);
|
||||
pd.buffs.put(name, buff);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
pd.buffs.put(name, buff);
|
||||
return;
|
||||
}
|
||||
if (buff.getAmplifier()>=oldlv) {
|
||||
if (buff.getAmplifier()==oldlv) { //Check if duration is longer or same.
|
||||
if (buff.getRemainingBuffTime()>=oldduration) {
|
||||
pd.buffs.put(name, buff);
|
||||
}
|
||||
} else {
|
||||
pd.buffs.put(name, buff); //If Buff level is greater than old level.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
int oldlv = 0;
|
||||
long oldduration = 0;
|
||||
if (hasBuff(l,name)) {
|
||||
oldlv = les.buffs.get(name).getAmplifier();
|
||||
oldduration = les.buffs.get(name).getRemainingBuffTime();
|
||||
if (stacking) {
|
||||
buff.setStacks(buff.getAmplifier()+oldlv);
|
||||
les.buffs.put(name, buff);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
les.buffs.put(name, buff);
|
||||
return;
|
||||
}
|
||||
if (buff.getAmplifier()>=oldlv) {
|
||||
if (buff.getAmplifier()==oldlv) { //Check if duration is longer or same.
|
||||
if (buff.getRemainingBuffTime()>=oldduration) {
|
||||
les.buffs.put(name, buff);
|
||||
}
|
||||
} else {
|
||||
les.buffs.put(name, buff); //If Buff level is greater than old level.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void removeBuff(LivingEntity l, BuffTemplate buff) {
|
||||
removeBuff(l,buff.getKeyName());
|
||||
}
|
||||
|
||||
public static void removeBuff(LivingEntity l, String name) {
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
Buff b = pd.buffs.remove(name);
|
||||
if (b!=null && !b.buffCanBeRemoved()) {
|
||||
pd.buffs.put(name, b);
|
||||
}
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
Buff b = les.buffs.remove(name);
|
||||
if (b!=null && !b.buffCanBeRemoved()) {
|
||||
les.buffs.put(name, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the level relative to the amt provided.
|
||||
*/
|
||||
public void increaseStacks(int amt) {
|
||||
level+=amt;
|
||||
}
|
||||
/**
|
||||
* Decreases the level relative to the amt provided. Can go negative.
|
||||
*/
|
||||
public void decreaseStacks(int amt) {
|
||||
level-=amt;
|
||||
}
|
||||
/**
|
||||
* Sets the level of the buff directly to amt.
|
||||
*/
|
||||
public void setStacks(int amt) {
|
||||
level=amt;
|
||||
}
|
||||
/**
|
||||
* Increases the duration of the buff by <b>duration</b> number of ticks.
|
||||
*/
|
||||
public void increaseDuration(int duration) {
|
||||
expireTime+=duration;
|
||||
}
|
||||
/**
|
||||
* Decreases duration of the buff by <b>duration</b> number of ticks.
|
||||
*/
|
||||
public void decreaseDuration(int duration) {
|
||||
expireTime-=duration;
|
||||
}
|
||||
/**
|
||||
* Sets the duration of the buff to <b>duration</b> ticks.
|
||||
*/
|
||||
public void setDuration(int duration) {
|
||||
refreshDuration(duration);
|
||||
}
|
||||
/**
|
||||
* Refreshes the buff's duration so time starts at the original duration again.
|
||||
*/
|
||||
public void refreshDuration(int duration) {
|
||||
expireTime=TwosideKeeper.getServerTickTime()+duration;
|
||||
}
|
||||
/**
|
||||
* Whether or not this is considered a good buff (true) or a bad buff (false)
|
||||
*/
|
||||
public boolean isGoodBuff() {
|
||||
return isGoodBuff;
|
||||
}
|
||||
/**
|
||||
* Whether or not this is considered a bad buff (true) or a good buff (false)
|
||||
*/
|
||||
public boolean isDebuff() {
|
||||
return !isGoodBuff;
|
||||
}
|
||||
/**
|
||||
* Whether or not this buff has ran out of time.
|
||||
*/
|
||||
public static boolean hasBuffExpired(Buff b) {
|
||||
if (b.expireTime<TwosideKeeper.getServerTickTime()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name that shows up in the action bar for the player.
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the expiration time of the buff in ticks, to be compared with TwosideKeeper.getServerTickTime().
|
||||
*/
|
||||
public long getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the level/amplifier/stack amount of this buff.
|
||||
*/
|
||||
public int getAmplifier() {
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the swirly particle colors that appear when this buff is applied.
|
||||
*/
|
||||
public Color getBuffParticleColor() {
|
||||
return col;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the remaining amount of time this buff is still active on this entity. Returns 0 if it has already expired.
|
||||
*/
|
||||
public long getRemainingBuffTime() {
|
||||
return Math.max(expireTime-TwosideKeeper.getServerTickTime(),0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a print-friendly version of this structure.
|
||||
*/
|
||||
public String toString() {
|
||||
return "Buff(Name="+displayName+",Time="+expireTime+",Level="+level+",Color="+col+",Icon="+getBuffIcon()+")";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the string that consistss of the buff icon for this buff. Usually includes a chat color code.
|
||||
*/
|
||||
public String getBuffIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not this buff can be removed.
|
||||
*/
|
||||
public boolean buffCanBeRemoved() {
|
||||
return !permanentBuff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the specified buff can be removed.
|
||||
*/
|
||||
public static boolean buffCanBeRemoved(Buff b) {
|
||||
return !b.permanentBuff;
|
||||
}
|
||||
}
|
@ -1,163 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class ChallengeReward {
|
||||
public static boolean hasRewards(Player p) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
return pd.rewards.length()>0;
|
||||
}
|
||||
|
||||
public static void rewardAwards(Player p) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
GlobalLoot gl = GlobalLoot.spawnGlobalLoot(p.getLocation(), ChatColor.GREEN+"Daily Challenge Loot");
|
||||
String[] awards = pd.rewards.split(",");
|
||||
for (String s : awards) {
|
||||
int rank = Integer.parseInt(s);
|
||||
if (pd.isFirstReward) {
|
||||
gl.addNewDropInventory(p.getUniqueId(), getAward(rank));
|
||||
pd.isFirstReward=false;
|
||||
}
|
||||
gl.addNewDropInventory(p.getUniqueId(), getAward(rank));
|
||||
}
|
||||
pd.rewards="";
|
||||
SoundUtils.playLocalSound(p, Sound.ENTITY_PLAYER_LEVELUP, 1.0f, 1.2f);
|
||||
}
|
||||
|
||||
public static void provideAwards() {
|
||||
provideAwards(TwosideKeeper.dpschallenge_records);
|
||||
provideHOFAwards(TwosideKeeper.dpschallenge_recordsHOF);
|
||||
provideAwards(TwosideKeeper.tankchallenge_records);
|
||||
provideHOFAwards(TwosideKeeper.tankchallenge_recordsHOF);
|
||||
provideAwards(TwosideKeeper.parkourchallenge_records);
|
||||
provideHOFAwards(TwosideKeeper.parkourchallenge_recordsHOF);
|
||||
}
|
||||
|
||||
private static void provideAwards(RecordKeeping r) {
|
||||
for (int i=0;i<r.recordlist.size();i++) {
|
||||
Record rec = r.recordlist.get(i);
|
||||
int rank = i+1;
|
||||
Player p = Bukkit.getPlayer(rec.getName());
|
||||
if (p!=null && p.isOnline()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (hasRewards(p)) {
|
||||
pd.rewards+=","+rank;
|
||||
} else {
|
||||
pd.rewards=Integer.toString(rank);
|
||||
}
|
||||
} else {
|
||||
File config;
|
||||
config = new File(TwosideKeeper.filesave,"users/"+Bukkit.getOfflinePlayer(rec.getName()).getUniqueId()+".data");
|
||||
FileConfiguration workable = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
if (!config.exists()) {
|
||||
//Something bad happened if we got here.
|
||||
TwosideKeeper.log("[WARNING] Could not find the correct player data file for "+p+" to get money data from.",1);
|
||||
} else {
|
||||
|
||||
String rewards = workable.getString("rewards");
|
||||
if (rewards.length()>0) {
|
||||
rewards+=","+rank;
|
||||
} else {
|
||||
rewards=Integer.toString(rank);
|
||||
}
|
||||
|
||||
workable.set("rewards", rewards);
|
||||
|
||||
try {
|
||||
workable.save(config);
|
||||
} catch (IOException e) {
|
||||
TwosideKeeper.log("[WARNING] Could not find the correct player data file for "+p+" to get money data from.",1);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void provideHOFAwards(RecordKeeping r) {
|
||||
if (r.recordlist.size()>0) {
|
||||
Record rec = r.recordlist.get(0);
|
||||
Player p = Bukkit.getPlayer(rec.getName());
|
||||
if (p!=null && p.isOnline()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (hasRewards(p)) {
|
||||
pd.rewards+=","+438190894;
|
||||
} else {
|
||||
pd.rewards=Integer.toString(438190894);
|
||||
}
|
||||
} else {
|
||||
File config;
|
||||
config = new File(TwosideKeeper.filesave,"users/"+Bukkit.getOfflinePlayer(rec.getName()).getUniqueId()+".data");
|
||||
FileConfiguration workable = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
if (!config.exists()) {
|
||||
//Something bad happened if we got here.
|
||||
TwosideKeeper.log("[WARNING] Could not find the correct player data file for "+p+" to get money data from.",1);
|
||||
} else {
|
||||
|
||||
String rewards = workable.getString("rewards");
|
||||
if (rewards.length()>0) {
|
||||
rewards+=","+438190894;
|
||||
} else {
|
||||
rewards=Integer.toString(438190894);
|
||||
}
|
||||
|
||||
workable.set("rewards", rewards);
|
||||
|
||||
try {
|
||||
workable.save(config);
|
||||
} catch (IOException e) {
|
||||
TwosideKeeper.log("[WARNING] Could not find the correct player data file for "+p+" to get money data from.",1);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack[] getAward(int rank) {
|
||||
switch (rank) {
|
||||
case 1:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,2),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,2),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE,1),
|
||||
};
|
||||
}
|
||||
case 2:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,1),
|
||||
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,1),
|
||||
};
|
||||
}
|
||||
case 3:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,1),
|
||||
};
|
||||
}
|
||||
case 438190894:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE,2),
|
||||
};
|
||||
}
|
||||
default:{
|
||||
return new ItemStack[]{
|
||||
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -6,14 +6,8 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Monster;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Effects.TemporaryBlock;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class ChargeZombie {
|
||||
Monster m;
|
||||
long stuckTimer=0;
|
||||
Location lastLoc = null;
|
||||
public boolean canBreak=true;
|
||||
|
||||
public ChargeZombie(Monster m) {
|
||||
this.m=m;
|
||||
@ -37,9 +31,8 @@ public class ChargeZombie {
|
||||
if (Math.abs(x)<outerradius &&
|
||||
Math.abs(y)<outerradius+1 &&
|
||||
Math.abs(z)<outerradius &&
|
||||
(aPlugin.API.isDestroyable(m.getLocation().add(x,y,z).getBlock()) ||
|
||||
m.getLocation().add(x,y,z).getBlock().getType()==Material.OBSIDIAN)) {
|
||||
if (m.getTarget()!=null && m.getTarget().isValid()) {
|
||||
aPlugin.API.isDestroyable(m.getLocation().add(x,y,z).getBlock()) ||
|
||||
m.getLocation().add(x,y,z).getBlock().getType()==Material.OBSIDIAN) {
|
||||
if (!(y==0 && m.getTarget().getLocation().getY()>m.getLocation().getY()) || !m.getLocation().add(x,y,z).getBlock().getType().isSolid()) { //Player is higher than zombie. Don't break blocks in front of it. Climb up them. Unless it's lava.
|
||||
if (!(y<0 && (m.getTarget().getLocation().getY()>m.getLocation().getY()-1))) { //Player is lower than zombie. Break blocks below it to get to the player.
|
||||
boolean brokeliquid = false;
|
||||
@ -52,36 +45,11 @@ public class ChargeZombie {
|
||||
brokeliquid=true;
|
||||
if (m.getLocation().add(x,y,z).getBlock().getType()==Material.STATIONARY_LAVA) {
|
||||
m.getLocation().add(x,y,z).getBlock().setType(Material.OBSIDIAN);
|
||||
SoundUtils.playGlobalSound(m.getLocation().add(x,y,z),Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
|
||||
m.getLocation().getWorld().playSound(m.getLocation().add(x,y,z),Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
|
||||
}
|
||||
}
|
||||
if (!brokeliquid) {
|
||||
SoundUtils.playGlobalSound(m.getLocation().add(x,y,z),Sound.BLOCK_STONE_BREAK, 1.0f, 1.0f);
|
||||
}
|
||||
m.getLocation().add(x,y,z).getBlock().breakNaturally();
|
||||
aPlugin.API.sendBlockBreakPacket(m.getLocation().add(x,y,z).getBlock(), -1);
|
||||
} else {
|
||||
aPlugin.API.sendBlockBreakPacket(m.getLocation().add(x,y,z).getBlock(), (int)(Math.random()*6)+3);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y>=0) {
|
||||
boolean brokeliquid = false;
|
||||
//Break it.
|
||||
if (ChanceToBreak(m.getLocation().add(x,y,z).getBlock())) {
|
||||
if (m.getLocation().add(x,y,z).getBlock().getType()==Material.WATER ||
|
||||
m.getLocation().add(x,y,z).getBlock().getType()==Material.STATIONARY_WATER ||
|
||||
m.getLocation().add(x,y,z).getBlock().getType()==Material.LAVA ||
|
||||
m.getLocation().add(x,y,z).getBlock().getType()==Material.STATIONARY_LAVA) {
|
||||
brokeliquid=true;
|
||||
if (m.getLocation().add(x,y,z).getBlock().getType()==Material.STATIONARY_LAVA) {
|
||||
m.getLocation().add(x,y,z).getBlock().setType(Material.OBSIDIAN);
|
||||
SoundUtils.playGlobalSound(m.getLocation().add(x,y,z),Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
|
||||
}
|
||||
}
|
||||
if (!brokeliquid) {
|
||||
SoundUtils.playGlobalSound(m.getLocation().add(x,y,z),Sound.BLOCK_STONE_BREAK, 1.0f, 1.0f);
|
||||
m.getLocation().getWorld().playSound(m.getLocation().add(x,y,z),Sound.BLOCK_STONE_BREAK, 1.0f, 1.0f);
|
||||
}
|
||||
m.getLocation().add(x,y,z).getBlock().breakNaturally();
|
||||
aPlugin.API.sendBlockBreakPacket(m.getLocation().add(x,y,z).getBlock(), -1);
|
||||
@ -125,11 +93,11 @@ public class ChargeZombie {
|
||||
brokeliquid=true;
|
||||
if (l.add(x,y,z).getBlock().getType()==Material.STATIONARY_LAVA) {
|
||||
l.add(x,y,z).getBlock().setType(Material.OBSIDIAN);
|
||||
SoundUtils.playGlobalSound(l.add(x,y,z),Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
|
||||
l.getWorld().playSound(l.add(x,y,z),Sound.BLOCK_FIRE_EXTINGUISH, 1f, 1f);
|
||||
}
|
||||
}
|
||||
if (!brokeliquid) {
|
||||
SoundUtils.playGlobalSound(l.add(x,y,z),Sound.BLOCK_STONE_BREAK, 1.0f, 1.0f);
|
||||
l.getWorld().playSound(l.add(x,y,z),Sound.BLOCK_STONE_BREAK, 1.0f, 1.0f);
|
||||
}
|
||||
l.add(x,y,z).getBlock().breakNaturally();
|
||||
aPlugin.API.sendBlockBreakPacket(l.add(x,y,z).getBlock(), -1);
|
||||
@ -153,18 +121,12 @@ public class ChargeZombie {
|
||||
|
||||
public static boolean ChanceToBreak(Block b) {
|
||||
int blocktoughness = 0;
|
||||
if (TemporaryBlock.isTemporaryBlock(b) || !aPlugin.API.isDestroyable(b)) {
|
||||
return false;
|
||||
}
|
||||
switch (b.getType()) {
|
||||
case BEDROCK: {
|
||||
blocktoughness=999999;
|
||||
}break;
|
||||
case OBSIDIAN:{
|
||||
blocktoughness=100;
|
||||
}break;
|
||||
case ENDER_CHEST:{
|
||||
blocktoughness=999999;
|
||||
blocktoughness=44;
|
||||
}break;
|
||||
case ANVIL:{
|
||||
blocktoughness=10;
|
||||
@ -262,7 +224,7 @@ public class ChargeZombie {
|
||||
case CHEST:
|
||||
case TRAPPED_CHEST:
|
||||
case WORKBENCH:{
|
||||
blocktoughness=999999;
|
||||
blocktoughness=5;
|
||||
}break;
|
||||
case BRICK_STAIRS:
|
||||
case BRICK:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,112 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.inventivetalent.glow.GlowAPI.Color;
|
||||
|
||||
import sig.plugin.TwosideKeeper.Events.EntityChannelCastEvent;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.MixedDamage;
|
||||
|
||||
public class CustomMonster {
|
||||
protected LivingEntity m;
|
||||
|
||||
public CustomMonster(LivingEntity m) {
|
||||
super();
|
||||
this.m=m;
|
||||
}
|
||||
|
||||
public LivingEntity GetMonster() {
|
||||
return m;
|
||||
}
|
||||
|
||||
public boolean isAlive() {
|
||||
return !m.isDead();
|
||||
}
|
||||
|
||||
public MixedDamage getBasicAttackDamage() {
|
||||
return MixedDamage.v(0,0,0);
|
||||
}
|
||||
|
||||
/*
|
||||
public boolean hasTarget() {
|
||||
return (m.getTarget()!=null)?true:false;
|
||||
}*/
|
||||
|
||||
public static CustomMonster getCustomMonster(LivingEntity m) {
|
||||
if (TwosideKeeper.custommonsters.containsKey(m.getUniqueId())) {
|
||||
return TwosideKeeper.custommonsters.get(m.getUniqueId());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*public boolean recognizeMonsterConditions(LivingEntity m) {
|
||||
return false;
|
||||
}*/
|
||||
|
||||
public void runTick() {
|
||||
|
||||
}
|
||||
|
||||
public void customHitHandler() {
|
||||
|
||||
}
|
||||
public void customHitHandler(double dmg) {
|
||||
|
||||
}
|
||||
public void onHitEvent(LivingEntity damager, double damage) {
|
||||
|
||||
}
|
||||
public void onPlayerSlayEvent(Player p, String reason) {
|
||||
|
||||
}
|
||||
|
||||
public boolean isImmuneToSuppression() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
|
||||
}
|
||||
|
||||
public void entityCleanup() {
|
||||
|
||||
}
|
||||
|
||||
public void runChannelCastEvent(EntityChannelCastEvent ev) {
|
||||
|
||||
}
|
||||
|
||||
public void runProjectileLaunchEvent(ProjectileLaunchEvent ev) {
|
||||
|
||||
}
|
||||
|
||||
public void onDeathEvent() {
|
||||
|
||||
}
|
||||
|
||||
public Color getGlowColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isInIframe() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void bloodPoolSpawnedEvent(LivingEntity target) {
|
||||
}
|
||||
|
||||
public void AnnounceDPSBreakdown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 0.0 means cannot be moved, 1.0 means normal knockback.
|
||||
*/
|
||||
public double getKnockbackMult() {
|
||||
return 1.0;
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -16,7 +15,6 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class DeathManager {
|
||||
@ -27,29 +25,25 @@ public class DeathManager {
|
||||
public static List<DeathStructure> ds = new ArrayList<DeathStructure>();
|
||||
|
||||
public static void addNewDeathStructure(List<ItemStack> deathinv, Location deathloc, Player p) {
|
||||
ds.add(new DeathStructure(deathinv,deathloc.clone(),p));
|
||||
TwosideKeeper.log("Added a new Death Structure: "+ds.get(ds.size()-1).toString(),0);
|
||||
ds.add(new DeathStructure(deathinv,deathloc,p));
|
||||
TwosideKeeper.log("Added a new Death Structure: "+ds.get(ds.size()-1).toString(),5);
|
||||
}
|
||||
public static void removeDeathStructure(Player p) {
|
||||
ds.remove(getDeathStructure(p));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,15,-2,p,true);
|
||||
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,15,100,p,true);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,15,-2,p,true);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,15,100,p,true);
|
||||
p.setVelocity(new Vector(0,0,0));
|
||||
CustomDamage.removeIframe(p);
|
||||
Location loc = p.getLocation();
|
||||
if (p.getBedSpawnLocation()!=null) {loc.setY(p.getBedSpawnLocation().getY());}
|
||||
p.teleport(loc);
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,p);
|
||||
}},1);
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
//pd.deathloot.clear();
|
||||
if (pd!=null) {
|
||||
pd.hasDied=false;
|
||||
}
|
||||
p.setCollidable(true);
|
||||
}
|
||||
public static boolean deathStructureExists(Player p) {
|
||||
@ -118,31 +112,23 @@ public class DeathManager {
|
||||
Inventory deathinv = Bukkit.getServer().createInventory(p, 45, "Death Loot");
|
||||
GenericFunctions.TransferItemsToInventory(p.getInventory(), deathinv);
|
||||
double totalmoney = TwosideKeeper.getPlayerMoney(Bukkit.getPlayer(p.getName()))+TwosideKeeper.getPlayerBankMoney(Bukkit.getPlayer(p.getName()));
|
||||
double price = 1;
|
||||
int price = 1;
|
||||
if (structure.deathloc.getBlockY()<=60) {
|
||||
price += 24-(structure.deathloc.getBlockY()/2.5);
|
||||
}
|
||||
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(Bukkit.getPlayer(p.getName()));
|
||||
if (pd.playermode_on_death==PlayerMode.NORMAL) {
|
||||
price /= 2d;
|
||||
}
|
||||
pd.hasDied=false;
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
|
||||
p.openInventory(deathinv);
|
||||
p.sendMessage(ChatColor.AQUA+"You can buy back up to "+ChatColor.YELLOW+(int)(totalmoney/price)+ChatColor.AQUA+" items, costing $"+ChatColor.GREEN+df.format(price)+ChatColor.WHITE+" per item.");
|
||||
p.sendMessage(ChatColor.AQUA+"You can buy back up to "+ChatColor.YELLOW+(int)(totalmoney/price)+ChatColor.AQUA+" items, costing $"+ChatColor.GREEN+price+ChatColor.WHITE+" per item.");
|
||||
p.sendMessage(" The rest will drop at your death location.");
|
||||
p.sendMessage(ChatColor.GRAY+"Close your inventory once you've picked your items.");
|
||||
}
|
||||
|
||||
public static double CalculateDeathPrice(Player p) {
|
||||
public static int CalculateDeathPrice(Player p) {
|
||||
DeathStructure ds = getDeathStructure(p);
|
||||
double price = (1+((ds.deathloc.getBlockY()<=60)?(24-(ds.deathloc.getBlockY()/2.5)):0));
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (pd.playermode_on_death==PlayerMode.NORMAL) {
|
||||
price /= 2d;
|
||||
}
|
||||
return price;
|
||||
return (int)(1+((ds.deathloc.getBlockY()<=60)?(24-(ds.deathloc.getBlockY()/2.5)):0));
|
||||
}
|
||||
public static int CountOccupiedSlots(Inventory inv) {
|
||||
int occupiedslots = 0;
|
||||
|
@ -12,8 +12,7 @@ public class DiscordStatusUpdater implements Runnable{
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
//DiscordMessageSender.setPlaying(ProduceMessage());
|
||||
aPlugin.API.discordSetPlaying(ProduceMessage());
|
||||
DiscordMessageSender.setPlaying(ProduceMessage());
|
||||
Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(Bukkit.getPluginManager().getPlugin("TwosideKeeper"), this, 300l);
|
||||
}
|
||||
|
||||
|
@ -1,93 +1,46 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.InventoryUtils;
|
||||
|
||||
public class DropDeathItems implements Runnable{
|
||||
|
||||
Player p = null;
|
||||
Location deathloc = null;
|
||||
List<ItemStack> contents;
|
||||
Inventory inv_contents;
|
||||
|
||||
DropDeathItems(Player p, List<ItemStack> contents, Location deathloc) {
|
||||
this.p=p;
|
||||
this.deathloc=deathloc;
|
||||
this.contents=contents;
|
||||
this.inv_contents = Bukkit.createInventory(p, 63);
|
||||
for (ItemStack it : contents) {
|
||||
if (it!=null) {
|
||||
inv_contents.addItem(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!AttemptToDropItems(p,deathloc)) {
|
||||
TwosideKeeper.log("Re-running...",0);
|
||||
List<ItemStack> tempcontents = new ArrayList<ItemStack>();
|
||||
for (ItemStack it : inv_contents.getContents()) {
|
||||
if (it!=null && it.getType()!=Material.AIR) {
|
||||
tempcontents.add(it);
|
||||
}
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin,new DropDeathItems(p,tempcontents,deathloc),1); //Keep trying until the chunk is loaded!!!
|
||||
TwosideKeeper.temporary_chunks.clear();
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin,new DropDeathItems(p,contents,deathloc),1); //Keep trying until the chunk is loaded!!!
|
||||
}
|
||||
}
|
||||
|
||||
public boolean AttemptToDropItems(Player p, Location deathloc) {
|
||||
TwosideKeeper.temporary_chunks.add(deathloc.getChunk());
|
||||
deathloc.getChunk().load();
|
||||
deathloc.getWorld().loadChunk(deathloc.getChunk());
|
||||
if (deathloc.getChunk().isLoaded()) {
|
||||
TwosideKeeper.log("Respawn and Dropping...", 2);
|
||||
while (!InventoryUtils.hasEmptyInventory(inv_contents)) {
|
||||
while (contents.size()>0) {
|
||||
if (deathloc.getChunk().isLoaded()) {
|
||||
Item it = deathloc.getWorld().dropItemNaturally(deathloc, InventoryUtils.getFirstItemThatIsNotEmpty(inv_contents));
|
||||
it.setInvulnerable(true);
|
||||
if (it!=null && it.isValid()) {
|
||||
inv_contents.removeItem(it.getItemStack());
|
||||
TwosideKeeper.log("Dropping "+it.getItemStack().toString()+" at Death location "+deathloc,2);
|
||||
} else {
|
||||
TwosideKeeper.log("Item did not spawn! Will try again.",0);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
TwosideKeeper.log("Chunk is not loaded! Will try again.",0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*while (contents.size()>0) {
|
||||
if (deathloc.getChunk().isLoaded()) {
|
||||
Item it = null;
|
||||
do {
|
||||
deathloc.getWorld().loadChunk(deathloc.getChunk());
|
||||
it=deathloc.getWorld().dropItemNaturally(deathloc, contents.get(0));
|
||||
TwosideKeeper.temporary_chunks.add(deathloc.getChunk());} while (it==null || !it.isValid());
|
||||
Item it = deathloc.getWorld().dropItemNaturally(deathloc, contents.get(0));
|
||||
it.setInvulnerable(true);
|
||||
TwosideKeeper.log("Dropping "+contents.get(0).toString()+" at Death location "+deathloc,2);
|
||||
//contents.remove(0);
|
||||
|
||||
contents.remove(0);
|
||||
} else {
|
||||
deathloc.getWorld().loadChunk(deathloc.getChunk());
|
||||
}
|
||||
}*/
|
||||
for (Chunk c : TwosideKeeper.temporary_chunks) {
|
||||
c.unload(true);
|
||||
}
|
||||
TwosideKeeper.temporary_chunks.clear();
|
||||
DeathManager.removeDeathStructure(p);
|
||||
return true;
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Drops;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import aPlugin.Drop;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
|
||||
public class DropRandomFirework extends Drop {
|
||||
|
||||
int min,max;
|
||||
|
||||
public DropRandomFirework(int min, int max, int weight) {
|
||||
super(min,max,weight,"Holiday Firework");
|
||||
this.min=min;
|
||||
this.max=max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
ItemStack randomfirework = ItemUtils.createRandomFirework();
|
||||
randomfirework.setAmount((int)(((Math.random()*(max-min))+min)));
|
||||
return randomfirework;
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package sig.plugin.TwosideKeeper.Drops;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -8,7 +7,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import aPlugin.Drop;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Loot;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||
@ -26,11 +24,11 @@ public class SigDrop extends Drop{
|
||||
boolean isHardened; //If set to false, it has no breaks remaining.
|
||||
boolean isSet; //If set to false, it's non-set.
|
||||
int isWeapon; //0: Armor, 1: Weapon, 2: Tool
|
||||
LivingEntityDifficulty diff;
|
||||
MonsterDifficulty diff;
|
||||
|
||||
public SigDrop(int amount, int weight, String description, boolean isHardened, boolean isSet, int isWeapon, LivingEntityDifficulty normal) {
|
||||
public SigDrop(int amount, int weight, String description, boolean isHardened, boolean isSet, int isWeapon, MonsterDifficulty diff) {
|
||||
super(amount, weight,
|
||||
"["+GenericFunctions.CapitalizeFirstLetters(normal.name().replace("_", " "))+"]"+
|
||||
"["+GenericFunctions.CapitalizeFirstLetters(diff.name().replace("_", " "))+"]"+
|
||||
((isHardened)?" Hardened":"")+
|
||||
" Mega"+
|
||||
(isSet?" Set":"")+
|
||||
@ -39,7 +37,7 @@ public class SigDrop extends Drop{
|
||||
this.isHardened=isHardened;
|
||||
this.isSet=isSet;
|
||||
this.isWeapon=isWeapon;
|
||||
this.diff=normal;
|
||||
this.diff=diff;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -135,28 +133,18 @@ public class SigDrop extends Drop{
|
||||
item = Loot.GenerateMegaPiece(item.getType(), isHardened);
|
||||
}break;
|
||||
default:{
|
||||
TwosideKeeper.log("Something went terribly wrong generating the item! DIRT is being returned! Check your switch statement for 'isWeapon'.", 0);
|
||||
TwosideKeeper.log("Something went terrible wrong generating the item! DIRT is being returned! Check your switch statement for 'isWeapon'.", 0);
|
||||
item = new ItemStack(Material.DIRT);
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
public ItemStack CreateModifiedLootPiece(Player p, ItemStack item, LivingEntityDifficulty diff2) {
|
||||
public ItemStack CreateModifiedLootPiece(Player p, ItemStack item, MonsterDifficulty md) {
|
||||
if (isSet) {
|
||||
ItemSet set = ItemSet.PANROS;
|
||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED || TwosideKeeper.CHRISTMASLINGERINGEVENT_ACTIVATED) {
|
||||
if (Math.random()<=0.01) {
|
||||
set = LivingEntityDifficulty.PickAHolidayItemSet(PlayerMode.getPlayerMode(p),diff2); //This is the set we have to generate.
|
||||
} else {
|
||||
set = LivingEntityDifficulty.PickAnItemSet(PlayerMode.getPlayerMode(p),diff2); //This is the set we have to generate.
|
||||
}
|
||||
} else {
|
||||
set = LivingEntityDifficulty.PickAnItemSet(PlayerMode.getPlayerMode(p),diff2); //This is the set we have to generate.
|
||||
}
|
||||
TwosideKeeper.log("Set Chosen: "+set, 5);
|
||||
ItemSet set = MonsterDifficulty.PickAnItemSet(PlayerMode.getPlayerMode(p),md); //This is the set we have to generate.
|
||||
//Turn it into the appropriate piece if necessary.
|
||||
item = LivingEntityDifficulty.ConvertSetPieceIfNecessary(item, set);
|
||||
item = MonsterDifficulty.ConvertSetPieceIfNecessary(item, set);
|
||||
|
||||
int tierbonus=0;
|
||||
if (item.getType().name().contains("LEATHER")) {
|
||||
@ -164,15 +152,14 @@ public class SigDrop extends Drop{
|
||||
}
|
||||
|
||||
item = Loot.GenerateSetPiece(item, set, isHardened, tierbonus);
|
||||
TwosideKeeper.log("Final Item: "+item, 5);
|
||||
} else {
|
||||
item = Loot.GenerateMegaPiece(item.getType(), isHardened);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
private int GetTierBonusBasedOnDifficulty(LivingEntityDifficulty diff2) {
|
||||
switch (diff2) {
|
||||
private int GetTierBonusBasedOnDifficulty(MonsterDifficulty dif) {
|
||||
switch (dif) {
|
||||
case DANGEROUS:{
|
||||
if (Math.random()<=1/3d) {
|
||||
return 1;
|
||||
@ -205,12 +192,7 @@ public class SigDrop extends Drop{
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
if (Bukkit.getOnlinePlayers().size()>0) {
|
||||
int random = (int)(Math.random()*(Bukkit.getOnlinePlayers().size()));
|
||||
Player picked = (Player)(Bukkit.getOnlinePlayers().toArray()[random]);
|
||||
return getItemStack(picked);
|
||||
} else {
|
||||
TwosideKeeper.log("Something went terribly wrong with getItemStack() call. Check to make sure you are using getSingleDrop(Player) and not getSingleDrop()!!!", 0);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,9 +25,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.inventivetalent.glow.GlowAPI;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class EliteMonster {
|
||||
protected static float DEFAULT_MOVE_SPD = 0.3f;
|
||||
@ -51,7 +49,6 @@ public class EliteMonster {
|
||||
protected boolean chasing=false;
|
||||
protected boolean enraged=false;
|
||||
protected boolean storingenergy=false;
|
||||
public double baseHP = 0.0;
|
||||
|
||||
protected List<Player> targetlist = new ArrayList<Player>();
|
||||
protected List<Player> participantlist = new ArrayList<Player>();
|
||||
@ -65,7 +62,6 @@ public class EliteMonster {
|
||||
this.myspawn=m.getLocation();
|
||||
bar = m.getServer().createBossBar(GenericFunctions.getDisplayName(m), BarColor.WHITE, BarStyle.SEGMENTED_6, BarFlag.CREATE_FOG);
|
||||
willpower_bar = m.getServer().createBossBar("Willpower", BarColor.PINK, BarStyle.SOLID, BarFlag.CREATE_FOG);
|
||||
this.baseHP = m.getMaxHealth();
|
||||
}
|
||||
|
||||
public void runTick() {
|
||||
@ -113,13 +109,11 @@ public class EliteMonster {
|
||||
}
|
||||
|
||||
protected void createBossHealthbar() {
|
||||
/*if (m instanceof Wither || m instanceof EnderDragon) {
|
||||
if (m instanceof Wither || m instanceof EnderDragon) {
|
||||
bar.removeAll();
|
||||
willpower_bar.removeAll();
|
||||
return;
|
||||
}*/
|
||||
bar.removeAll();
|
||||
willpower_bar.removeAll();
|
||||
}
|
||||
List<Player> currentplayers = bar.getPlayers();
|
||||
for (int i=0;i<currentplayers.size();i++) {
|
||||
if (!targetlist.contains(currentplayers.get(i))) {
|
||||
@ -128,10 +122,7 @@ public class EliteMonster {
|
||||
}
|
||||
}
|
||||
bar.setProgress(m.getHealth()/m.getMaxHealth());
|
||||
bar.setTitle((Channel.isChanneling(m)?LivingEntityStructure.getChannelingBar(m):GenericFunctions.getDisplayName(m)) + ((m.getTarget()!=null && (m.getTarget() instanceof Player))?(ChatColor.DARK_AQUA+" "+arrow+" "+ChatColor.YELLOW+((Player)m.getTarget()).getName()):""));
|
||||
if (!(m instanceof Wither || m instanceof EnderDragon)) {
|
||||
displayHealthbarToNearbyPlayers();
|
||||
}
|
||||
bar.setTitle(GenericFunctions.getDisplayName(m) + ((m.getTarget()!=null && (m.getTarget() instanceof Player))?(ChatColor.DARK_AQUA+" "+arrow+" "+ChatColor.YELLOW+((Player)m.getTarget()).getName()):""));
|
||||
for (int i=0;i<targetlist.size();i++) {
|
||||
if (!currentplayers.contains(targetlist.get(i))) {
|
||||
bar.addPlayer(targetlist.get(i));
|
||||
@ -139,18 +130,6 @@ public class EliteMonster {
|
||||
}
|
||||
}
|
||||
|
||||
protected void displayHealthbarToNearbyPlayers() {
|
||||
try {
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (m.getLocation().getWorld().equals(p.getLocation().getWorld()) && m.getLocation().distanceSquared(p.getLocation())<=2500) {
|
||||
bar.addPlayer(p);
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected void resetToSpawn() {
|
||||
if (!leaping && targetlist.size()==0 && m.getLocation().getWorld().equals(myspawn.getWorld()) && m.getLocation().distanceSquared(myspawn)>81) {
|
||||
while (myspawn.getBlock().getRelative(0, -1, 0).getType()==Material.AIR && myspawn.getY()>1) {
|
||||
@ -158,9 +137,15 @@ public class EliteMonster {
|
||||
}
|
||||
m.teleport(myspawn);
|
||||
m.setHealth(m.getMaxHealth());
|
||||
AnnounceFailedTakedown();
|
||||
if (dpslist.size()>0) {
|
||||
Bukkit.getServer().broadcastMessage(GenericFunctions.getDisplayName(m)+" Takedown Failed...");
|
||||
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
|
||||
Bukkit.getServer().broadcastMessage(generateDPSReport());
|
||||
aPlugin.API.discordSendRaw(GenericFunctions.getDisplayName(m)+" Takedown Failed...\n\n"+ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+generateDPSReport()+"\n```");
|
||||
}
|
||||
bar.setColor(BarColor.WHITE);
|
||||
first_willpower_notification=false;
|
||||
dpslist.clear();
|
||||
willpower=0;
|
||||
bar.removeAll();
|
||||
willpower_bar.removeAll();
|
||||
@ -170,24 +155,6 @@ public class EliteMonster {
|
||||
if (!m.getLocation().getWorld().equals(myspawn.getWorld())) {
|
||||
myspawn = m.getLocation(); //Then this is my new spawn...
|
||||
}
|
||||
for (Player p : targetlist) {
|
||||
if (p.isDead()) {
|
||||
targetlist.remove(p);
|
||||
}
|
||||
}
|
||||
if (targetlist.size()==0) {
|
||||
participantlist.clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void AnnounceFailedTakedown() {
|
||||
if (dpslist.size()>0 && !m.isDead()) {
|
||||
Bukkit.getServer().broadcastMessage(GenericFunctions.getDisplayName(m)+" Takedown Failed...");
|
||||
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
|
||||
Bukkit.getServer().broadcastMessage(generateDPSReport());
|
||||
aPlugin.API.discordSendRaw(GenericFunctions.getDisplayName(m)+" Takedown Failed...\n\n"+ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+generateDPSReport()+"\n```");
|
||||
dpslist.clear();
|
||||
}
|
||||
}
|
||||
|
||||
protected void dontDrown() {
|
||||
@ -201,9 +168,6 @@ public class EliteMonster {
|
||||
public GlowAPI.Color getGlow() {
|
||||
GlowAPI.Color col = GlowAPI.Color.DARK_PURPLE;
|
||||
if (m.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE)) {
|
||||
col = GlowAPI.Color.DARK_BLUE;
|
||||
}
|
||||
if (Channel.isChanneling(m)) {
|
||||
col = GlowAPI.Color.YELLOW;
|
||||
}
|
||||
if (storingenergy) {
|
||||
@ -239,8 +203,8 @@ public class EliteMonster {
|
||||
p.setVelocity(new Vector(0,-1,0));
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,(int)(20*2.25),0,p);
|
||||
SoundUtils.playLocalSound(p, Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f);
|
||||
SoundUtils.playLocalSound(p, Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f);
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,12 +213,6 @@ public class EliteMonster {
|
||||
bar.setColor(BarColor.GREEN);
|
||||
m.setHealth(Math.min(m.getHealth()+1,m.getMaxHealth()));
|
||||
}
|
||||
if (m.getMaxHealth()>(baseHP+(baseHP*(0.25*((targetlist.size()>4)?(targetlist.size()-4):0))))) {
|
||||
m.setMaxHealth((baseHP+(baseHP*(0.25*((targetlist.size()>4)?(targetlist.size()-4):0)))));
|
||||
if (m.getHealth()>m.getMaxHealth()) {
|
||||
m.setHealth(m.getMaxHealth());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void runPlayerLeaveEvent(Player p) {
|
||||
@ -268,11 +226,6 @@ public class EliteMonster {
|
||||
bar.setColor(BarColor.RED);
|
||||
if (!targetlist.contains(damager) && (damager instanceof Player)) {
|
||||
targetlist.add((Player)damager);
|
||||
if (targetlist.size()>4) {
|
||||
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
|
||||
m.setMaxHealth(baseHP+hpgain);
|
||||
m.setHealth(m.getHealth()+hpgain);
|
||||
}
|
||||
}
|
||||
if (!participantlist.contains(damager) && (damager instanceof Player)) {
|
||||
participantlist.add((Player)damager);
|
||||
@ -284,7 +237,6 @@ public class EliteMonster {
|
||||
currentdps = dpslist.get(p.getName());
|
||||
}
|
||||
dpslist.put(p.getName(), currentdps+dmg);
|
||||
TwosideKeeper.log(p.getName()+"'s Damage: "+dpslist.get(p.getName()), 5);
|
||||
}
|
||||
last_regen_time=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
@ -308,13 +260,8 @@ public class EliteMonster {
|
||||
|
||||
//Triggers when this mob hits something.
|
||||
public void hitEvent(LivingEntity ent) {
|
||||
if (!targetlist.contains(ent) && (ent instanceof Player) && !ent.isDead()) {
|
||||
if (!targetlist.contains(ent) && (ent instanceof Player)) {
|
||||
targetlist.add((Player)ent);
|
||||
if (targetlist.size()>4) {
|
||||
double hpgain = m.getMaxHealth()*(0.25*(targetlist.size()-4));
|
||||
m.setMaxHealth(baseHP+hpgain);
|
||||
m.setHealth(m.getHealth()+hpgain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,8 +270,6 @@ public class EliteMonster {
|
||||
Player p = targetlist.get((int)(Math.random() * targetlist.size()));
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS,20*1,7,p);
|
||||
m.setTarget(p);
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||
les.increaseAggroWhileMultiplyingAllOthers(p, 0, 0.25);
|
||||
TwosideKeeper.log("Set new target to "+p.getName(), 2);
|
||||
return p;
|
||||
} else {
|
||||
@ -386,7 +331,6 @@ public class EliteMonster {
|
||||
|
||||
public void Cleanup() {
|
||||
// Remove all healthbars before destroying.
|
||||
AnnounceFailedTakedown();
|
||||
removeAllHealthbars();
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Events;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class EntityChannelCastEvent extends Event{
|
||||
private LivingEntity l;
|
||||
private String abilityName;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public EntityChannelCastEvent(LivingEntity l, String abilityName) {
|
||||
this.l=l;
|
||||
this.abilityName=abilityName;
|
||||
}
|
||||
|
||||
public LivingEntity getLivingEntity() {
|
||||
return l;
|
||||
}
|
||||
|
||||
public String getAbilityName() {
|
||||
return abilityName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Events;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class EntityDamagedEvent extends Event implements Cancellable{
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private LivingEntity ent;
|
||||
private Entity damager;
|
||||
private double damage;
|
||||
private String reason;
|
||||
|
||||
public LivingEntity getEntity() {
|
||||
return ent;
|
||||
}
|
||||
|
||||
public Entity getDamager() {
|
||||
return damager;
|
||||
}
|
||||
|
||||
public void setDamager(Entity damager) {
|
||||
this.damager = damager;
|
||||
}
|
||||
|
||||
public double getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void setDamage(double damage) {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public int getFlags() {
|
||||
return flags;
|
||||
}
|
||||
|
||||
public void setFlags(int flags) {
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
private int flags;
|
||||
private boolean cancelled=false;
|
||||
|
||||
/**
|
||||
* Called anytime an Entity is damaged.
|
||||
* <br><br>
|
||||
* <b>This event is cancellable.</b> Cancelling the event prevents the damage from being applied to the damaged entity and all on-hit effects will not apply.
|
||||
* @param ent The entity being damaged.
|
||||
* @param damager The entity that caused the damage, can be null.
|
||||
* @param damage The amount of actual damage taken, after all calculations are applied.
|
||||
* @param reason The reason the damage was taken.
|
||||
* @param flags The flags set by this event.
|
||||
*/
|
||||
public EntityDamagedEvent(LivingEntity ent, Entity damager, double damage, String reason, int flags) {
|
||||
this.ent=ent;
|
||||
this.damager=damager;
|
||||
this.damage=damage;
|
||||
this.reason=reason;
|
||||
this.flags=flags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled=cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Events;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class InventoryUpdateEvent extends Event{
|
||||
private Player p;
|
||||
private ItemStack item;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private UpdateReason reason;
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public InventoryUpdateEvent(Player p, ItemStack item, UpdateReason reason) {
|
||||
this.p=p;
|
||||
this.item=item;
|
||||
this.reason=reason;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return p;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public UpdateReason getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public static void TriggerUpdateInventoryEvent(Player p, ItemStack item, UpdateReason reason) {
|
||||
if (item!=null) {
|
||||
InventoryUpdateEvent ev = new InventoryUpdateEvent(p, item, reason);
|
||||
Bukkit.getPluginManager().callEvent(ev);
|
||||
}
|
||||
//TwosideKeeper.log("Triggered because of "+reason, 0);
|
||||
}
|
||||
|
||||
public enum UpdateReason {
|
||||
INVENTORYUPDATE,
|
||||
PICKEDUPITEM,
|
||||
DROPPEDITEM
|
||||
}
|
||||
}
|
@ -12,24 +12,14 @@ public class PlayerDodgeEvent extends Event implements Cancellable{
|
||||
private Entity damager;
|
||||
private String reason;
|
||||
private int flags;
|
||||
private double damage;
|
||||
private boolean cancelled=false;
|
||||
private boolean cancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Deprecated
|
||||
public PlayerDodgeEvent(Player p, Entity damager, String reason, int flags) {
|
||||
this.p=p;
|
||||
this.damager=damager;
|
||||
this.reason=reason;
|
||||
this.flags=flags;
|
||||
this.damage=0;
|
||||
}
|
||||
|
||||
public PlayerDodgeEvent(Player p, double damage, Entity damager, String reason, int flags) {
|
||||
this.p=p;
|
||||
this.damager=damager;
|
||||
this.reason=reason;
|
||||
this.flags=flags;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
@ -48,10 +38,6 @@ public class PlayerDodgeEvent extends Event implements Cancellable{
|
||||
return flags;
|
||||
}
|
||||
|
||||
public double getRawDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
|
||||
|
||||
public final class PlayerLineDriveEvent extends Event implements Cancellable{
|
||||
private Player p;
|
||||
private boolean cancelled=false;
|
||||
private boolean cancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public PlayerLineDriveEvent(Player p) {
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
|
||||
|
||||
public class PlayerTumbleEvent extends Event implements Cancellable{
|
||||
private Player p;
|
||||
private boolean cancelled=false;
|
||||
private boolean cancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public PlayerTumbleEvent(Player p) {
|
||||
|
@ -1,61 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Generators;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
public class DPSRoom extends Room{
|
||||
|
||||
public DPSRoom(int width,int length) {
|
||||
super(width,length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] generate(World world, Random rand, int chunkx, int chunkz) {
|
||||
byte[] result = new byte[65536];
|
||||
if (chunkx<ROOM_WIDTH/16 &&
|
||||
chunkz<ROOM_LENGTH/16 &&
|
||||
chunkx>=0 &&
|
||||
chunkz>=0) {
|
||||
for(int x=0; x<16; x++){
|
||||
for(int z=0; z<16; z++) {
|
||||
result[xyzToByte(x,0,z)] = (byte) Material.BEDROCK.getId();
|
||||
//result[xyzToByte(x,255,z)] = (byte) Material.BARRIER.getId();
|
||||
}
|
||||
}
|
||||
GenerateOuterWalls(chunkx, chunkz, result);
|
||||
}
|
||||
/*for(int x=0; x<16; x++){
|
||||
for(int z=0; z<16; z++) {
|
||||
result[xyzToByte(x,0,z)] = (byte) Material.BEDROCK.getId();
|
||||
result[xyzToByte(x,255,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}*/
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void GenerateOuterWalls(int chunkx, int chunkz, byte[] result) {
|
||||
int wallslotx = Math.floorMod(chunkx,ROOM_WIDTH/16);
|
||||
int wallslotz = Math.floorMod(chunkz,ROOM_LENGTH/16);
|
||||
for (int y=1;y<20;y++) {
|
||||
for(int x=0; x<16; x++){
|
||||
for (int z=0;z<16;z++) {
|
||||
if (wallslotx==0) {
|
||||
result[xyzToByte(0,y,z)] = (byte) Material.BEDROCK.getId();
|
||||
} else
|
||||
if (wallslotx==(ROOM_WIDTH/16)-1){
|
||||
result[xyzToByte(15,y,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
if (wallslotz==0) {
|
||||
result[xyzToByte(x,y,0)] = (byte) Material.BEDROCK.getId();
|
||||
} else
|
||||
if (wallslotz==(ROOM_LENGTH/16)-1){
|
||||
result[xyzToByte(x,y,15)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Generators;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
public class ParkourRoom extends Room{
|
||||
|
||||
public ParkourRoom(int width,int length) {
|
||||
super(width,length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] generate(World world, Random rand, int chunkx, int chunkz) {
|
||||
byte[] result = new byte[65536];
|
||||
if (chunkx<ROOM_WIDTH/16 &&
|
||||
chunkz<ROOM_LENGTH/16 &&
|
||||
chunkx>=0 &&
|
||||
chunkz>=0) {
|
||||
for(int x=0; x<16; x++){
|
||||
for(int z=0; z<16; z++) {
|
||||
result[xyzToByte(x,0,z)] = (byte) Material.BEDROCK.getId();
|
||||
//result[xyzToByte(x,255,z)] = (byte) Material.BARRIER.getId();
|
||||
}
|
||||
}
|
||||
GenerateOuterWalls(chunkx, chunkz, result);
|
||||
}
|
||||
/*for(int x=0; x<16; x++){
|
||||
for(int z=0; z<16; z++) {
|
||||
result[xyzToByte(x,0,z)] = (byte) Material.BEDROCK.getId();
|
||||
result[xyzToByte(x,255,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}*/
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void GenerateOuterWalls(int chunkx, int chunkz, byte[] result) {
|
||||
int wallslotx = Math.floorMod(chunkx,ROOM_WIDTH/16);
|
||||
int wallslotz = Math.floorMod(chunkz,ROOM_LENGTH/16);
|
||||
for (int y=1;y<80;y++) {
|
||||
for(int x=0; x<16; x++){
|
||||
for (int z=0;z<16;z++) {
|
||||
if (wallslotx==0) {
|
||||
result[xyzToByte(0,y,z)] = (byte) Material.BEDROCK.getId();
|
||||
} else
|
||||
if (wallslotx==(ROOM_WIDTH/16)-1){
|
||||
result[xyzToByte(15,y,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
if (wallslotz==0) {
|
||||
result[xyzToByte(x,y,0)] = (byte) Material.BEDROCK.getId();
|
||||
} else
|
||||
if (wallslotz==(ROOM_LENGTH/16)-1){
|
||||
result[xyzToByte(x,y,15)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.Generators;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
|
||||
public class Room extends ChunkGenerator{
|
||||
int ROOM_WIDTH = 32;
|
||||
int ROOM_LENGTH = 32;
|
||||
|
||||
public Room() {
|
||||
|
||||
}
|
||||
|
||||
public Room(int width, int length) {
|
||||
ROOM_WIDTH=width;
|
||||
ROOM_LENGTH=length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSpawn(World world, int x, int z) {
|
||||
return true;
|
||||
}
|
||||
public int xyzToByte(int x, int y, int z) {
|
||||
return (x * 16 + z) * 256 + y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] generate(World world, Random rand, int chunkx, int chunkz) {
|
||||
byte[] result = new byte[65536];
|
||||
if (chunkx<ROOM_WIDTH/16 &&
|
||||
chunkz<ROOM_LENGTH/16 &&
|
||||
chunkx>=0 &&
|
||||
chunkz>=0) {
|
||||
for(int x=0; x<16; x++){
|
||||
for(int z=0; z<16; z++) {
|
||||
result[xyzToByte(x,0,z)] = (byte) Material.BEDROCK.getId();
|
||||
result[xyzToByte(x,255,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}
|
||||
GenerateOuterWalls(chunkx, chunkz, result);
|
||||
}
|
||||
/*for(int x=0; x<16; x++){
|
||||
for(int z=0; z<16; z++) {
|
||||
result[xyzToByte(x,0,z)] = (byte) Material.BEDROCK.getId();
|
||||
result[xyzToByte(x,255,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}*/
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void GenerateOuterWalls(int chunkx, int chunkz, byte[] result) {
|
||||
int wallslotx = Math.floorMod(chunkx,ROOM_WIDTH/16);
|
||||
int wallslotz = Math.floorMod(chunkz,ROOM_LENGTH/16);
|
||||
for (int y=1;y<255;y++) {
|
||||
for(int x=0; x<16; x++){
|
||||
for (int z=0;z<16;z++) {
|
||||
if (wallslotx==0) {
|
||||
result[xyzToByte(0,y,z)] = (byte) Material.BEDROCK.getId();
|
||||
} else
|
||||
if (wallslotx==(ROOM_WIDTH/16)-1){
|
||||
result[xyzToByte(15,y,z)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
if (wallslotz==0) {
|
||||
result[xyzToByte(x,y,0)] = (byte) Material.BEDROCK.getId();
|
||||
} else
|
||||
if (wallslotz==(ROOM_LENGTH/16)-1){
|
||||
result[xyzToByte(x,y,15)] = (byte) Material.BEDROCK.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getRoomWidth() {
|
||||
return ROOM_WIDTH;
|
||||
}
|
||||
public int getRoomLength() {
|
||||
return ROOM_LENGTH;
|
||||
}
|
||||
}
|
@ -1,132 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.InventoryUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
public class GlobalLoot {
|
||||
Item item;
|
||||
public static List<Chunk> chunks = new ArrayList<Chunk>();
|
||||
Chunk c;
|
||||
String lootname;
|
||||
UUID item_uuid;
|
||||
HashMap<UUID,Inventory> drop_inventories = new HashMap<UUID,Inventory>();
|
||||
HashMap<UUID,Long> last_opened_loot = new HashMap<UUID,Long>();
|
||||
|
||||
GlobalLoot(Location spawnLoc, String lootName) {
|
||||
Chunk c = spawnLoc.getChunk();
|
||||
if (!chunks.contains(c)) {
|
||||
chunks.add(c);
|
||||
c.load();
|
||||
}
|
||||
TwosideKeeper.temporary_chunks.add(c);
|
||||
item = (Item)spawnLoc.getWorld().dropItemNaturally(spawnLoc, new ItemStack(Material.CHEST));
|
||||
//item = GenericFunctions.dropItem(new ItemStack(Material.CHEST), spawnLoc);
|
||||
item_uuid = item.getUniqueId();
|
||||
item.setCustomName(TextUtils.RandomColor()+ChatColor.stripColor(lootName));
|
||||
item.setCustomNameVisible(true);
|
||||
item.setPickupDelay(Integer.MAX_VALUE);
|
||||
item.setInvulnerable(true);
|
||||
this.lootname = lootName;
|
||||
TwosideKeeper.temporary_chunks.remove(c);
|
||||
}
|
||||
|
||||
public void runInventoryCloseEvent(InventoryCloseEvent ev) {
|
||||
Player p = (Player)ev.getPlayer();
|
||||
if (drop_inventories.containsKey(p.getUniqueId()) &&
|
||||
ev.getInventory().getTitle()!=null &&
|
||||
ev.getInventory().getTitle().equalsIgnoreCase(lootname)) {
|
||||
last_opened_loot.put(p.getUniqueId(), TwosideKeeper.getServerTickTime());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
if ((item!=null && item.isValid())) {
|
||||
List<Player> players = GenericFunctions.getNearbyPlayers(item.getLocation(), 1.5);
|
||||
for (Player p : players) {
|
||||
if (p.getOpenInventory().getType()==InventoryType.CRAFTING &&
|
||||
drop_inventories.containsKey(p.getUniqueId())) {
|
||||
if ((!last_opened_loot.containsKey(p.getUniqueId()) ||
|
||||
last_opened_loot.get(p.getUniqueId())+100<=TwosideKeeper.getServerTickTime()) &&
|
||||
!InventoryUtils.hasEmptyInventory(drop_inventories.get(p.getUniqueId()))) {
|
||||
last_opened_loot.put(p.getUniqueId(), TwosideKeeper.getServerTickTime());
|
||||
//Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"tellraw @a [\"\",{\"text\":\"<"+p.getName()+"> \"},{\"text\":\""+ChatColor.GREEN+"A "+item.getCustomName()+" is nearby! "+ChatColor.BOLD+"[\"},{\"text\":\"[Click Here]"+ChatColor.RESET+ChatColor.GREEN+"\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":\""+GenericFunctions.GetItemName(ev.getPlayer().getEquipment().getItemInMainHand())+""+WorldShop.GetItemInfo(ev.getPlayer().getEquipment().getItemInMainHand()).replace("\"", "\\\"")+"\"}},{\"text\":\""+ev.getMessage().substring(pos)+"\"}]");
|
||||
TextComponent tc = new TextComponent(ChatColor.GREEN+"A "+item.getCustomName()+ChatColor.RESET+ChatColor.GREEN+" is nearby! ");
|
||||
TextComponent tc2 = new TextComponent(ChatColor.YELLOW+""+ChatColor.BOLD+"[Click here]");
|
||||
tc2.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND,"/dailyloot "+item.getUniqueId()));
|
||||
tc.addExtra(tc2);
|
||||
tc2 = new TextComponent(ChatColor.RESET+""+ChatColor.GREEN+" to open its contents.");
|
||||
tc.addExtra(tc2);
|
||||
p.spigot().sendMessage(tc);
|
||||
//p.openInventory(drop_inventories.get(p.getUniqueId()));
|
||||
}
|
||||
}/* else {
|
||||
if (!drop_inventories.containsKey(p.getUniqueId())) {
|
||||
TwosideKeeper.log("WARNING! Could not find UUID "+p.getUniqueId()+". UUID List: "+TextUtils.outputHashmap(drop_inventories), 1);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
chunks.remove(c);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Item getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public UUID getItemUniqueID() {
|
||||
return item_uuid;
|
||||
}
|
||||
|
||||
public void addNewDropInventory(UUID id, ItemStack...lootitems) {
|
||||
if (drop_inventories.containsKey(id)) {
|
||||
Inventory inv = drop_inventories.get(id);
|
||||
inv.addItem(lootitems);
|
||||
} else {
|
||||
Inventory newinv = Bukkit.createInventory(null, ((((lootitems.length-1)/9)+1)*9),this.lootname);
|
||||
newinv.addItem(lootitems);
|
||||
drop_inventories.put(id, newinv);
|
||||
}
|
||||
}
|
||||
|
||||
public void openDropInventory(Player p) {
|
||||
if (drop_inventories.containsKey(p.getUniqueId()) &&
|
||||
!InventoryUtils.hasEmptyInventory(drop_inventories.get(p.getUniqueId()))) {
|
||||
p.openInventory(drop_inventories.get(p.getUniqueId()));
|
||||
} else {
|
||||
TwosideKeeper.log("WARNING! Drop Inventory for Player with UUID <"+p.getUniqueId()+"> does not have an associated inventory with Global Loot <"+item.getUniqueId()+">. THIS SHOULD NOT BE HAPPENING!!", 1);
|
||||
p.sendMessage(ChatColor.RED+"Something terrible has happened! "+ChatColor.RESET+"Please let the server administrator know about this.");
|
||||
}
|
||||
}
|
||||
|
||||
public static GlobalLoot spawnGlobalLoot(Location loc, String lootName) {
|
||||
GlobalLoot loot = new GlobalLoot(loc,lootName);
|
||||
TwosideKeeper.globalloot.put(loot.getItem().getUniqueId(), loot);
|
||||
return loot;
|
||||
}
|
||||
}
|
22
src/sig/plugin/TwosideKeeper/HellfireSpider.java
Normal file
22
src/sig/plugin/TwosideKeeper/HellfireSpider.java
Normal file
@ -0,0 +1,22 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import org.bukkit.entity.Monster;
|
||||
|
||||
public class HellfireSpider {
|
||||
Monster m;
|
||||
|
||||
public HellfireSpider(Monster m) {
|
||||
this.m=m;
|
||||
}
|
||||
|
||||
public Monster GetSpider() {
|
||||
return m;
|
||||
}
|
||||
public boolean isAlive() {
|
||||
return !m.isDead();
|
||||
}
|
||||
public boolean hasTarget() {
|
||||
return (m.getTarget()!=null)?true:false;
|
||||
}
|
||||
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.DebugUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.PlayerUtils;
|
||||
|
||||
public class AdvancedTitle {
|
||||
TitlePart large_lefttitle = new TitlePart("",0);
|
||||
TitlePart large_centertitle = new TitlePart("",0);
|
||||
TitlePart large_righttitle = new TitlePart("",0);
|
||||
TitlePart small_centertitle = new TitlePart("",0);
|
||||
Player p;
|
||||
|
||||
public AdvancedTitle(Player p) {
|
||||
this.p=p;
|
||||
}
|
||||
|
||||
public void modifyLargeLeftTitle(String title, int duration) {
|
||||
large_lefttitle.setTitle(title);
|
||||
large_lefttitle.setDuration(duration);
|
||||
update();
|
||||
}
|
||||
public void modifyLargeCenterTitle(String title, int duration) {
|
||||
large_centertitle.setTitle(title);
|
||||
large_centertitle.setDuration(duration);
|
||||
update();
|
||||
}
|
||||
public void modifyLargeRightTitle(String title, int duration) {
|
||||
large_righttitle.setTitle(title);
|
||||
large_righttitle.setDuration(duration);
|
||||
update();
|
||||
}
|
||||
public void modifySmallCenterTitle(String title, int duration) {
|
||||
small_centertitle.setTitle(title);
|
||||
small_centertitle.setDuration(duration);
|
||||
update();
|
||||
}
|
||||
|
||||
public void checkExpiredTitles() {
|
||||
boolean refreshnames=false;
|
||||
if (large_lefttitle.isExpired()) {
|
||||
large_lefttitle.clear();
|
||||
refreshnames=true;
|
||||
}
|
||||
if (large_centertitle.isExpired()) {
|
||||
large_centertitle.clear();
|
||||
refreshnames=true;
|
||||
}
|
||||
if (large_righttitle.isExpired()) {
|
||||
large_righttitle.clear();
|
||||
refreshnames=true;
|
||||
}
|
||||
if (small_centertitle.isExpired()) {
|
||||
small_centertitle.clear();
|
||||
refreshnames=true;
|
||||
}
|
||||
if (refreshnames) {
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
public void update() {
|
||||
p.sendTitle(combineLargeTitles(), combineSmallTitles());
|
||||
}
|
||||
|
||||
private String combineSmallTitles() {
|
||||
StringBuilder sb = new StringBuilder(small_centertitle.getTitle());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String combineLargeTitles() {
|
||||
StringBuilder sb = new StringBuilder(large_lefttitle.getTitle());
|
||||
sb.append(ChatColor.RESET);
|
||||
if (large_lefttitle.getTitle().length()>0 ||
|
||||
large_righttitle.getTitle().length()>0) {
|
||||
if (large_centertitle.getTitle().length()==0) {
|
||||
sb.append(" ");
|
||||
} else {
|
||||
sb.append(" ");
|
||||
sb.append(large_centertitle.getTitle());
|
||||
sb.append(ChatColor.RESET);
|
||||
sb.append(" ");
|
||||
}
|
||||
} else {
|
||||
sb.append(large_centertitle.getTitle());
|
||||
sb.append(ChatColor.RESET);
|
||||
}
|
||||
sb.append(large_righttitle.getTitle());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void updateCombatBar(Player p, LivingEntity target) {
|
||||
updateSideTitleStats(p);
|
||||
TwosideKeeper.updateHealthbarDisplay(p, target);
|
||||
update();
|
||||
}
|
||||
|
||||
public void updateCombatBar(Player p, LivingEntity target, double damage, int flags) {
|
||||
updateSideTitleStats(p);
|
||||
TwosideKeeper.updateHealthbarDisplay(p, target, damage, flags);
|
||||
update();
|
||||
}
|
||||
|
||||
public void updateSideTitleStats(Player p) {
|
||||
//DebugUtils.showStackTrace();
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
||||
modifyLargeLeftTitle(ChatColor.DARK_AQUA+"☤"+Integer.toString((int)pd.weaponcharges),100);
|
||||
modifyLargeRightTitle(ChatColor.DARK_PURPLE+Integer.toString((int)pd.damagepool)+"♥",100);
|
||||
}
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.DEFENDER) {
|
||||
if (ItemSet.hasFullSet(p, ItemSet.SONGSTEEL)) {
|
||||
modifyLargeLeftTitle(ChatColor.YELLOW+Integer.toString((int)pd.vendetta_amt),100);
|
||||
}
|
||||
//modifyLargeRightTitle(ChatColor.GOLD+Integer.toString((int)pd.thorns_amt),100);
|
||||
modifyLargeRightTitle(ChatColor.DARK_AQUA+Integer.toString(pd.blockStacks)+"☉",100);
|
||||
}
|
||||
}
|
||||
|
||||
public String[] getTitles() {
|
||||
return new String[]{large_lefttitle.getTitle(),large_centertitle.getTitle(),large_righttitle.getTitle()};
|
||||
}
|
||||
}
|
||||
|
||||
class TitlePart {
|
||||
String title;
|
||||
long expiretime;
|
||||
boolean hasExpired=false;
|
||||
|
||||
TitlePart(String title, int duration) {
|
||||
this.title=title;
|
||||
this.expiretime=TwosideKeeper.getServerTickTime()+duration;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
title="";
|
||||
hasExpired=true;
|
||||
}
|
||||
|
||||
void setTitle(String title) {
|
||||
this.title=title;
|
||||
}
|
||||
|
||||
void setDuration(int duration) {
|
||||
this.expiretime=TwosideKeeper.getServerTickTime()+duration;
|
||||
hasExpired=false;
|
||||
}
|
||||
|
||||
boolean alreadyExpired() {
|
||||
return hasExpired;
|
||||
}
|
||||
|
||||
boolean isExpired() {
|
||||
return !hasExpired && expiretime<=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
|
||||
String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
long getExpirationTime() {
|
||||
return expiretime;
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ public class AnvilItem {
|
||||
if (validitem(olditem) && validitem(newitem)) {
|
||||
//Input Item : ᶲ2+Test New Item: 2Jelly
|
||||
String var = getColorCodes(); //var = ChatColor.RED (ᶲ2)
|
||||
TwosideKeeper.log("var = "+var, 5);
|
||||
TwosideKeeper.log("var = "+var, 2);
|
||||
String newcol = newitem.getItemMeta().getDisplayName(); //2Jelly
|
||||
String colors = "";
|
||||
if (var.length()>=2) {
|
||||
|
@ -1,16 +1,11 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.aPluginAPIWrapper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class ArrowBarrage implements Runnable{
|
||||
@ -28,19 +23,13 @@ public class ArrowBarrage implements Runnable{
|
||||
public void run() {
|
||||
shots_left--;
|
||||
Arrow arr = p.launchProjectile(Arrow.class);
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
pd.rangermode=BowMode.SNIPE;
|
||||
arr.setVelocity(p.getLocation().getDirection().multiply(2));
|
||||
TwosideKeeper.ShootPiercingArrow(arr, p);
|
||||
arr.remove();
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW, 4, 9, p, true);
|
||||
if (shots_left>0) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, this, 3);
|
||||
} else {
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_arrowbarrage, 1));
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||
aPluginAPIWrapper.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GenericFunctions.GetRemainingCooldownTime(p, pd.last_arrowbarrage, TwosideKeeper.ARROWBARRAGE_COOLDOWN));
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,11 +17,8 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import sig.plugin.TwosideKeeper.AwakenedArtifact;
|
||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
import sig.plugin.TwosideKeeper.PVP;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.PVPValue;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ArtifactUtils;
|
||||
|
||||
public enum ArtifactAbility {
|
||||
//Enum Structure:
|
||||
@ -29,147 +26,126 @@ public enum ArtifactAbility {
|
||||
//Temporary abilities: Work for 1 level and wear off afterward.
|
||||
|
||||
//Weapon Abilities
|
||||
DAMAGE("Strike","Improves Base Damage by [VAL]",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(15,1.0),10000,1,UpgradePath.BASIC,1),
|
||||
ARMOR_PEN("Piercing","[VAL]% of your damage is ignored by resistances. ([PENDMG] damage)",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),100,1,UpgradePath.BASIC,1),
|
||||
EXECUTION("Execute","Deals [VAL] extra damage for every 20% of target's missing health.",new double[]{0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},
|
||||
new PVPValue(30,0.3),10000,1,UpgradePath.BASIC,1),
|
||||
LIFESTEAL("Lifesteal","Heals [VAL]% of the damage dealt to targets back to your health pool.",new double[]{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
|
||||
new PVPValue(15,0.1),1000,1,UpgradePath.WEAPON,1),
|
||||
CRITICAL("Critical","[VAL]% chance to deal critical strikes.",new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},
|
||||
new PVPValue(30,0.5),100,1,UpgradePath.WEAPON,1),
|
||||
CRIT_DMG("Crit Damage","Critical Strikes deal [200VAL]% damage.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),10000,1,UpgradePath.WEAPON,1),
|
||||
HIGHWINDER("Highwinder","While moving fast or sprinting, you deal [VAL] extra damage for every 1m of speed.",new double[]{0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05},
|
||||
new PVPValue(1,0.5),10000,15,UpgradePath.WEAPON,1),
|
||||
DAMAGE("Strike","Improves Base Damage by [VAL]",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0},
|
||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
||||
ARMOR_PEN("Piercing","[VAL]% of your damage is ignored by resistances. ([PENDMG] damage)",new double[]{0.4,0.8,1.2,1.6,2.0,2.4,2.8,3.2,3.6,4.0,4.4,4.8,5.2,5.7,6.4,7.5},
|
||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
||||
EXECUTION("Execute","Deals [VAL] extra damage for every 20% of target's missing health.",new double[]{0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.50,1.65,1.80,1.95,2.10,2.40,2.70},
|
||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
||||
LIFESTEAL("Lifesteal","Heals [VAL]% of the damage dealt to targets back to your health pool.",new double[]{0.8,1.2,1.6,2.0,2.4,2.8,3.2,3.6,4.0,4.4,4.8,5.6,6.4,7.2,8.0,8.8},
|
||||
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.75,0.75,0.7,0.7,0.6,0.6,0.5,0.5,0.4},100,1,UpgradePath.WEAPON),
|
||||
CRITICAL("Critical","[VAL]% chance to deal critical strikes.",new double[]{1.0,1.25,1.5,1.75,2.0,2.25,2.50,2.75,3.0,3.25,3.50,3.75,4.00,4.25,4.50},
|
||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,1,UpgradePath.WEAPON),
|
||||
CRIT_DMG("Crit Damage","Critical Strikes deal [200VAL]% damage.",new double[]{0.5,1.0,2.0,4.0,6.0,10.0,15.0,19.0,22.0,26.0,30.0,35.0,40.0,45.0,60.0},
|
||||
new double[]{3.0,2.9,2.8,2.7,2.6,2.5,2.4,2.3,2.2,2.1,2.0,1.8,1.6,1.4,1.0},100,1,UpgradePath.WEAPON),
|
||||
HIGHWINDER("Highwinder","While moving fast or sprinting, you deal [VAL] extra damage for every 1m of speed.",new double[]{0.18,0.225,0.27,0.315,0.36,0.405,0.45,0.495,0.54,0.61,0.79,0.99,1.30,1.70,2.50},
|
||||
new double[]{0.675,0.65,0.625,0.6,0.575,0.55,0.525,0.5,0.475,0.45,0.425,0.4,0.375,0.35,0.30},100,15,UpgradePath.WEAPON),
|
||||
|
||||
//Bow Abilities
|
||||
MARKSMAN("Marksman","Increases headshot hitbox size by [VAL]% .",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),10000,15,UpgradePath.BOW,1),
|
||||
/*SIEGESTANCE("Siege Stance",ChatColor.GRAY+"[Unimplemented] Activate by Sneaking for three seconds. Sneak again to de-activate.\n\n"
|
||||
MARKSMAN("Marksman","Increases headshot hitbox size by [VAL]% .",new double[]{10.0,15,20,25,30,35,40,45,50,55,60,70,80,90,100},
|
||||
new double[]{1.0,0.975,0.95,0.875,0.85,0.825,0.8,0.775,0.75,0.725,0.70,0.675,0.65,0.55,0.45},10,15,UpgradePath.BOW),
|
||||
SIEGESTANCE("Siege Stance",ChatColor.GRAY+"[Unimplemented] Activate by Sneaking for three seconds. Sneak again to de-activate.\n\n"
|
||||
+ "Applies Slowness V and Resistance VI. While in Siege Stance you fire clusters of 7 arrows per shot. Each arrow deals [VAL] damage.",new double[]{3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.BOW,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.BOW),
|
||||
ARROWSHOWER("Arrow Shower",ChatColor.GRAY+"[Unimplemented] Shift-Left Click to activate. Applies Slowness X for three seconds while firing arrows into the sky and onto enemies in a large area in front of you. Each arrow deals [VAL] damage.",new double[]{0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7},
|
||||
new double[]{0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4},100,1000,UpgradePath.BOW,1),
|
||||
new double[]{0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4},100,1000,UpgradePath.BOW),
|
||||
TARGETING("Targeting",ChatColor.GRAY+"[Unimplemented] Left-click a mob to target them. Fire arrows to release homing missiles at your target. Each missile explodes and deals [VAL] damage.",new double[]{10,10,10,10,10,10,10,10,10,10},
|
||||
new double[]{0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},100,1000,UpgradePath.BOW,1),
|
||||
new double[]{0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},100,1000,UpgradePath.BOW),
|
||||
ENDERTURRET("Ender Turret",ChatColor.GRAY+"[Unimplemented] Place Eyes of Ender in your hotbar to use as ammo. Each eye fired launches forward and upward before releasing a barrage of homing missiles that lock onto enemy targets. Each missile explodes and deals [VAL] damage.",new double[]{25,25,25,25,25,25,25,25,25,25},
|
||||
new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},100,1000,UpgradePath.BOW,1),*/
|
||||
new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},100,1000,UpgradePath.BOW),
|
||||
|
||||
//Armor abilities
|
||||
DAMAGE_REDUCTION("Defense","Increases Base Damage reduction by [VAL]%\n\n"+PlayerMode.RANGER.getColor()+PlayerMode.RANGER.getName()+" Mode "+ChatColor.WHITE+" only receives half the effect.",new double[]{0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245,0.245},
|
||||
new PVPValue(50,0.245),100,1,UpgradePath.ARMOR,1),
|
||||
HEALTH("Health","Increases Maximum Health by [VAL].\n\n"+PlayerMode.RANGER.getColor()+PlayerMode.RANGER.getName()+" Mode "+ChatColor.WHITE+" only receives half the effect.",new double[]{0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25},
|
||||
new PVPValue(30,0.25),10000,1,UpgradePath.ARMOR,1),
|
||||
HEALTH_REGEN("Regeneration","Regenerates an extra [VAL] health every 5 seconds.",new double[]{0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125},
|
||||
new PVPValue(1,0.125),10000,1,UpgradePath.ARMOR,1),
|
||||
STATUS_EFFECT_RESISTANCE("Resistance","When a debuff is applied, there is a [VAL]% chance to remove it.",new double[]{0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25},
|
||||
new PVPValue(40,0.25),100,1,UpgradePath.ARMOR,1),
|
||||
SHADOWWALKER("Shadow Walker","Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas.",new double[]{0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2},
|
||||
new PVPValue(0,0.2),100,100,UpgradePath.ARMOR,1),
|
||||
SURVIVOR("Survivor","Taking fatal damage will not kill you and instead consumes this ability, removes all debuffs, and restores your health by [VAL]%"+TemporarySkill(true),new double[]{10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10},
|
||||
new PVPValue(0,10),10,25,UpgradePath.ARMOR,1),
|
||||
DODGE("Dodge","You have a [VAL]% chance to dodge incoming damage from any damage source."+LevelCost(2),new double[]{0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2},
|
||||
new PVPValue(0,0.2),100,40,UpgradePath.ARMOR,2),
|
||||
GRACEFULDODGE("Graceful Dodge","Whenever a dodge occurs, you will gain [GRACEFULVAL] seconds of invulnerability."+LevelCost(10),new double[]{0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05},
|
||||
new PVPValue(0,0.05),100,40,UpgradePath.ARMOR,10),
|
||||
DAMAGE_REDUCTION("Defense","Increases Base Damage reduction by [VAL]%\n\n"+PlayerMode.RANGER.getColor()+PlayerMode.RANGER.getName()+" Mode "+ChatColor.WHITE+" only receives half the effect.",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.1,5.2,5.25,5.3,5.35,5.5},
|
||||
new double[]{2.2,2.1,2.0,1.9,1.8,1.7,1.6,1.55,1.5,1.475,1.45,1.425,1.4,1.35,1.3},100,1,UpgradePath.ARMOR),
|
||||
HEALTH("Health","Increases Maximum Health by [VAL].\n\n"+PlayerMode.RANGER.getColor()+PlayerMode.RANGER.getName()+" Mode "+ChatColor.WHITE+" only receives half the effect.",new double[]{0.35,0.70,1.05,1.40,1.70,2.0,2.3,2.6,2.9,3.0,3.1,3.2,3.3,3.4,3.6},
|
||||
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.75,0.7,0.675,0.65,0.625,0.6,0.55,0.5},100,1,UpgradePath.ARMOR),
|
||||
HEALTH_REGEN("Regeneration","Regenerates an extra [VAL] health every 5 seconds.",new double[]{0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.29166666666666666666666666666667,0.33333333333333333333333333333333,0.375,0.4,0.42,0.44,0.46,0.48,0.55},
|
||||
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.475,0.45,0.425,0.4},100,1,UpgradePath.ARMOR),
|
||||
STATUS_EFFECT_RESISTANCE("Resistance","When a debuff is applied, there is a [VAL]% chance to remove it.",new double[]{3,3.5,4,4.5,5,5.5,6,6.5,7,7.1,7.2,7.3,7.4,7.45,7.5},
|
||||
new double[]{4.0,3.85,3.70,3.55,3.40,3.25,3.10,2.95,2.80,2.775,2.75,2.725,2.7,2.675,2.65},100,1,UpgradePath.ARMOR),
|
||||
SHADOWWALKER("Shadow Walker","Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas.",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
|
||||
new double[]{1.5,1.4,1.3,1.2,1.1,1.0,0.9,0.8,0.7,0.65,0.625,0.6,0.585,0.565,0.55},100,10,UpgradePath.ARMOR),
|
||||
SURVIVOR("Survivor","Taking fatal damage will not kill you and instead consumes this ability, removes all debuffs, and restores your health by [VAL]%"+TemporarySkill(),new double[]{4,4.25,4.5,4.75,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10},
|
||||
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},10,25,UpgradePath.ARMOR),
|
||||
DODGE("Dodge","You have a [VAL]% chance to dodge incoming damage from any damage source.",new double[]{0.1,0.125,0.15,0.175,0.225,0.25,0.275,0.3,0.325,0.35,0.375,0.4,0.45,0.5,0.55},
|
||||
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.45,0.35,0.25,0.2},100,40,UpgradePath.ARMOR),
|
||||
GRACEFULDODGE("Graceful Dodge","Whenever a dodge occurs, you will gain [VAL] seconds of invulnerability."+LevelCost(10),new double[]{0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.165,0.18,0.2},
|
||||
new double[]{1.8,1.79,1.78,1.77,1.76,1.75,1.74,1.73,1.72,1.71,1.70,1.69,1.67,1.65,1.62},10,40,UpgradePath.ARMOR),
|
||||
|
||||
//Sword abilities
|
||||
PROVOKE("Provoke","Your attacks increase Aggression by [VAL].",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
|
||||
new PVPValue(0,1.0),10000,10,UpgradePath.PROVOKE,1),
|
||||
COMBO("Belligerent","[VAL]% more damage for each successive strike on a mob. Resets after 2 seconds of no combat.",new double[]{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
|
||||
new PVPValue(50,0.1),10000,40,UpgradePath.SWORD,1),
|
||||
PROVOKE("Provoke","Your attacks provoke enemies for [VAL] seconds.",new double[]{3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,15.0},
|
||||
new double[]{3.0,2.9,2.8,2.7,2.6,2.5,2.4,2.3,2.2,2.1,2.0,1.9,1.8,1.7,1.6,1.5,1.4,1.3,1.2,1.1},100,10,UpgradePath.SWORD),
|
||||
COMBO("Belligerent","[VAL]% more damage for each successive strike on a mob. Resets after 2 seconds of no combat.",new double[]{1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8,3.0,3.25,3.5,4.0,5.5},
|
||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,40,UpgradePath.SWORD),
|
||||
|
||||
//Pickaxe abilities
|
||||
/*SCAVENGE("Scavenge",ChatColor.GRAY+"[Unimplemented] Breaks off resources from armor. [VAL]% chance per hit.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE,1),
|
||||
MINES("Land Mine",ChatColor.GRAY+"[Unimplemented]While in combat, throw your pickaxe to send land mines towards your enemies. On contact they deal [VAL] damage.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE,1),*/
|
||||
MINES("Land Mine",ChatColor.GOLD+"Shift+Right-click"+ChatColor.RESET+" air to place down a land mine. Land mines detonate when enemies step near the mine location, dealing [VAL] damage. Mines will automatically detonate after 15 seconds of no activity.\n\nYou can place a maximum of "+ChatColor.GOLD+"[MINEAMT]"+ChatColor.RESET+" mine[MINEAMTPLURAL] at once.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(100,1.0),10000,40,UpgradePath.PICKAXE,1),
|
||||
OREHARVESTER("Ore Harvester",ChatColor.GOLD+"Shift+Right-click"+ChatColor.RESET+" an ore block to convert the block into a temporary buff. The buff lasts for [VAL] seconds. Duration can be stacked for longer buffs.\n\n "+DisplayOreBonus("Coal Ore","+[COALORE_BONUS]% Critical Damage")+"\n"+DisplayOreBonus("Iron Ore","+[IRONORE_BONUS]% Block Chance")+"\n"+DisplayOreBonus("Gold Ore","+[GOLDORE_BONUS]% Critical Strike Chance")+"\n"+DisplayOreBonus("Redstone Ore","+[REDSTONEORE_BONUS] Maximum Health")+"\n"+DisplayOreBonus("Lapis Lazuli Ore","+[LAPISORE_BONUS] Health Regeneration")+"\n"+DisplayOreBonus("Diamond Ore","+[COALORE_BONUS]% Damage Reduction")+"\n"+DisplayOreBonus("Emerald Ore","+[COALORE_BONUS] Base Damage")+"\n"+LevelCost(40),new double[]{10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0},
|
||||
new PVPValue(100,10.0),10000,100,UpgradePath.PICKAXE,40),
|
||||
IMPACT("Impact","Damaging an enemy deals [VAL]% of an enemy's health as bonus physical damage on hit."+LevelCost(5),new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(100,1.0),250,20,UpgradePath.PICKAXE,5),
|
||||
FORCESTRIKE("Force Strike","Perform an attack that slams an enemy against a wall. Enemies take [FORCESTRIKEVAL] damage on a successful slam, crumbling the walls behind them.\n\n"+ChatColor.YELLOW+"15 second cooldown",new double[]{2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0},
|
||||
new PVPValue(100,2.0),10000,350,UpgradePath.PICKAXE,1),
|
||||
SCAVENGE("Scavenge",ChatColor.GRAY+"[Unimplemented] Breaks off resources from armor. [VAL]% chance per hit.",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE),
|
||||
MINES("Land Mine",ChatColor.GRAY+"[Unimplemented]While in combat, throw your pickaxe to send land mines towards your enemies. On contact they deal [VAL] damage.",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE),
|
||||
|
||||
//Shovel abilities
|
||||
SUPPRESS("Suppression","Suppresses a mob on hit for [VAL] seconds.\n\n"
|
||||
+ "Suppression prevents movement, attacking, exploding, and teleportation."+LevelCost(10),new double[]{0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02},
|
||||
new PVPValue(10,0.02),100,10,UpgradePath.SHOVEL,10),
|
||||
ERUPTION("Eruption","Sneak while Left-clicking a mob to damage mobs for [ERUPTIONVAL] damage and knock them up. The eruption also destroys the ground beneath you.",new double[]{3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0},
|
||||
new PVPValue(15,3.0),10000,40,UpgradePath.SHOVEL,1),
|
||||
EARTHWAVE("Earth Wave","While in mid-air, right-click to instantly slam into the ground and launch soft blocks. This attack ignores fall damage. The larger the fall, the larger the wave.\n\nDeals [EARTHWAVEVAL] damage to every enemy hit by the wave. Deals double damage and knocks up on soft blocks.",new double[]{2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0},
|
||||
new PVPValue(15,2.0),10000,100,UpgradePath.SHOVEL,1),
|
||||
+ "Suppression prevents movement, attacking, exploding, and teleportation."+LevelCost(10),new double[]{0.1,0.12,0.14,0.16,0.18,0.2,0.22,0.24,0.26,0.28,0.3,0.34,0.38,0.42,0.5},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},10,10,UpgradePath.SHOVEL),
|
||||
ERUPTION("Eruption","Sneak while Left-clicking a mob to damage mobs for [VAL] damage and knock them up. The eruption also destroys the ground beneath you.",new double[]{11.0,12.0,13.0,14.0,16.0,18.0,20.0,23,26.0,29,32.0,35.0,37.5,39.5,50},
|
||||
new double[]{1.0,0.925,0.85,0.775,0.7,0.625,0.55,0.475,0.45,0.425,0.4,0.375,0.35,0.325,0.3},100,40,UpgradePath.SHOVEL),
|
||||
EARTHWAVE("Earth Wave","While in combat, destroy a block to send a wave of earth towards your enemies. Enemies standing inside of the waves take [VAL] damage every second.",new double[]{10,12,14,16,18,20,22,24,26,30,35,40,45,50,70},
|
||||
new double[]{2.4,2.2,2.0,1.9,1.8,1.7,1.6,1.5,1.4,1.2,1.1,1.0,0.9,0.8,0.7},100,100,UpgradePath.SHOVEL),
|
||||
|
||||
//Axe abilities
|
||||
/*BREAKDOWN("Break Down",ChatColor.GRAY+"[Unimplemented] Breaks down armor on mobs. Each hit has a [VAL]% chance to remove a piece of armor from a mob.",new double[]{3,3,3,3,3,3,3,3,3,3},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.AXE,1),
|
||||
BREAKDOWN("Break Down",ChatColor.GRAY+"[Unimplemented] Breaks down armor on mobs. Each hit has a [VAL]% chance to remove a piece of armor from a mob.",new double[]{3,3,3,3,3,3,3,3,3,3},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.AXE),
|
||||
BUTCHERY("Butchery",ChatColor.GRAY+"[Unimplemented] Broken down armor have a [VAL]% chance to drop onto the ground.",new double[]{10,10,10,10,10,10,10,10,10,10},
|
||||
new double[]{0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8},100,1000,UpgradePath.AXE,1),*/
|
||||
DAMAGEPOOL("Damage Pool Recovery","Removes [VAL] points from Barbarian's Damage Pool with each attack.",
|
||||
new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},
|
||||
new PVPValue(30,0.5),10000,1,UpgradePath.AXE,1),
|
||||
LIFESTACK("Life Stack","Increases Barbarian's lifesteal stacks by [VAL] per hit.",
|
||||
new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},
|
||||
new PVPValue(30,0.5),10000,1,UpgradePath.AXE,1),
|
||||
LIFESUCK("Life Sucker","Directly heals [VAL]% of damage dealt as health, with a maximum of [LIFESUCKVAL] health healed per hit."+LevelCost(3),
|
||||
new double[]{0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8},
|
||||
new PVPValue(30,0.8),100,40,UpgradePath.AXE,3),
|
||||
HIGHDIVE("High Dive","Sneak while pressing the drop key to become rooted for 3 seconds, storing [VAL]% damage taken and gaining 100% knockback resistance. Then leap up high into the air and slam the ground. High Dive increases the base damage of Barbarian's Leaping Strike by the amount of damage stored."+LevelCost(3),
|
||||
new double[]{0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8},
|
||||
new PVPValue(30,0.8),100,100,UpgradePath.AXE,3),
|
||||
new double[]{0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8,0.8},100,1000,UpgradePath.AXE),
|
||||
|
||||
//Scythe abilities
|
||||
AOE("Area of Effect","Deals damage to targets up to [AOEVAL]m from the main target hit.",new double[]{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
|
||||
new PVPValue(5,1.0),10000,1,UpgradePath.SCYTHE,1),
|
||||
DEATHMARK("Death Mark","Applies a Death Mark stack to enemies hit. Death mark stacks last for 5 seconds, and refresh on each hit.\n\nMarks can be detonated at any time by right-clicking. Targets killed with Death Mark resets the cooldown. Targets not killed lose half their Death Mark stacks.\n\n Each death mark stack applied deals [VAL] true damage.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(10,1.0),10000,10,UpgradePath.SCYTHE,1),
|
||||
CRIPPLE("Cripple","Every 10 death marks applied on a monster increases damage dealt from all damage sources by [VAL]%.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(1,1.0),100,1000,UpgradePath.SCYTHE,1),
|
||||
AOE("Area of Effect","Deals damage to targets up to [VAL]m from the main target hit.",new double[]{0.4,0.45,0.5,0.55,0.6,0.65,0.70,0.75,0.80,0.85,0.90,0.95,1.00,1.05,1.10},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.9,0.7,0.5},100,1,UpgradePath.SCYTHE),
|
||||
DEATHMARK("Death Mark","Applies a Death Mark stack to enemies hit. Death mark stacks last for 5 seconds, and refresh on each hit.\n\nMarks can be detonated at any time by right-clicking. Targets killed with Death Mark resets the cooldown. Targets not killed lose half their Death Mark stacks.\n\n Each death mark stack applied deals [VAL] true damage.",new double[]{0.2,0.4,0.6,0.8,1.0,1.2,1.4,1.6,1.8,2.0,2.5,3.0,3.5,4.0,5.0},
|
||||
new double[]{0.6,0.575,0.55,0.525,0.5,0.475,0.45,0.425,0.4,0.375,0.35,0.325,0.3,0.275,0.25},100,10,UpgradePath.SCYTHE),
|
||||
CRIPPLE("Cripple","Every 10 death marks applied on a monster increases damage dealt from all damage sources by [VAL]%.",new double[]{1,2,3,4,5,6,7,8,10,12},
|
||||
new double[]{0.3,0.3,0.27,0.27,0.24,0.24,0.21,0.21,0.18,0.18},100,1000,UpgradePath.SCYTHE),
|
||||
|
||||
//General abilities
|
||||
AUTOREPAIR("Auto Repair","1% chance every second to repair [VAL] durability to the artifact item\n\nThe item must be sitting in your hotbar or must be equipped for this ability to work. This ability is less effective with no sunlight!",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),10000,1,UpgradePath.ALL,1),
|
||||
GREED("Greed","Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved. Each kill has a [GREEDCHANCE]% chance to consume the Greed buff."+TemporarySkill(true),new double[]{10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,10.0,15.0,15.0,15.0,20.0,25.0,30.0,40.0},
|
||||
new PVPValue(0,10.0),10,10,UpgradePath.ALL,1),
|
||||
GROWTH("Growth","Sets the Potential of your Artifact to 20%."+TemporarySkill(false),new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(0,1.0),1,10,UpgradePath.ALL,1),
|
||||
/*REMOVE_CURSE("Remove Curse",ChatColor.GRAY+"[Unimplemented] Removes a level of a curse from the Artifact.",new double[]{-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0},
|
||||
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},1,1000,UpgradePath.ALL),*/
|
||||
PRESERVATION("Preservation","Potential decays [POTVAL]% slower.",new double[]{0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90,0.90},
|
||||
new PVPValue(100,0.9),100,1,UpgradePath.ALL,1),
|
||||
/*EXP_MULT("Mega XP",ChatColor.GRAY+"[Unimplemented] Increases experience dropped from monsters by [VAL]% .",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.ALL),*/
|
||||
AUTOREPAIR("Auto Repair","1% chance every second to repair [VAL] durability to the artifact item\n\nThe item must be sitting in your hotbar or must be equipped for this ability to work. This ability is less effective with no sunlight!",new double[]{3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,10,15},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},10,1,UpgradePath.ALL),
|
||||
GREED("Greed","Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved. Each kill has a [GREEDCHANCE]% chance to consume the Greed buff."+TemporarySkill(),new double[]{1,2,3,4,5,7,9,11,13,15,17,19,25,35,50},
|
||||
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},10,10,UpgradePath.ALL),
|
||||
/*GROWTH("Growth",ChatColor.GRAY+"[Unimplemented] Increases artifact EXP gained by [VAL]% . Health is halved, health regeneration is halved, and damage reduction is halved. Consumes one level of Growth per level up.",new double[]{100,100,100,100,100,100,100,100,100,100},
|
||||
new double[]{2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0},100,1000,UpgradePath.ALL),*/
|
||||
REMOVE_CURSE("Remove Curse",ChatColor.GRAY+"[Unimplemented] Removes a level of a curse from the Artifact.",new double[]{-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0},
|
||||
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},1,1000,UpgradePath.ALL),
|
||||
PRESERVATION("Preservation","Potential decays [VAL]% slower.",new double[]{1.0,1.25,1.5,1.75,2.0,2.25,2.5,2.75,3.0,3.25,3.50,3.75,4.0,4.25,4.5},
|
||||
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},20,1,UpgradePath.ALL),
|
||||
EXP_MULT("Mega XP",ChatColor.GRAY+"[Unimplemented] Increases experience dropped from monsters by [VAL]% .",new double[]{5,5,5,5,5,5,5,5,5,5},
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.ALL),
|
||||
|
||||
//Bad stuff
|
||||
REDUCEDMG("Weakness","[VAL]% Decrease in Base Damage.",new double[]{8,8,8,8,8,8,8,8,8,8},
|
||||
new PVPValue(30,8),100,3,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,3,UpgradePath.ALL),
|
||||
REDUCEDEF("Imperil","[VAL]% Decrease in Damage Reduction",new double[]{8,8,8,8,8,8,8,8,8,8},
|
||||
new PVPValue(30,8),100,5,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,5,UpgradePath.ALL),
|
||||
LIFE_REDUCTION("Health Cut","[VAL]% decrease in maximum health.",new double[]{30,30,30,30,30,30,30,30,30,30},
|
||||
new PVPValue(30,30),100,5,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,5,UpgradePath.ALL),
|
||||
LOWER_DEFENSE("Debilitate","[VAL]% decrease in damage reduction.",new double[]{30,30,30,30,30,30,30,30,30,30},
|
||||
new PVPValue(30,30),100,5,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,5,UpgradePath.ALL),
|
||||
TELEPORT("Teleport","[VAL]% chance to teleport the player to a random location on artifact experience gain.",new double[]{3,3,3,3,3,3,3,3,3,3},
|
||||
new PVPValue(30,3),100,10,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,10,UpgradePath.ALL),
|
||||
DRAINING("Draining","[VAL]% chance to remove a level of experience on artifact experience gain.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),100,10,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,10,UpgradePath.ALL),
|
||||
NOREGEN("Weary","No health regenerates.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),100,15,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,15,UpgradePath.ALL),
|
||||
STARVATION("Starvation","[VAL]% chance to cause [HUNGERVAL] seconds of Hunger on experience gain.",new double[]{5,5,5,5,5,5,5,5,5,5},
|
||||
new PVPValue(30,5),100,15,UpgradePath.ALL,1),
|
||||
new double[]{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},100,15,UpgradePath.ALL),
|
||||
BURN("Flammable","All burn damage deals x[VAL] damage.",new double[]{4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0},
|
||||
new PVPValue(30,0.4),100,25,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,25,UpgradePath.ALL),
|
||||
FROZEN("Frozen","Player will be inflicted with increasing levels of slowness and fatigue until finally frozen and killed.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),1,45,UpgradePath.ALL,1),
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},1,45,UpgradePath.ALL),
|
||||
PETRIFICATION("Petrification","Player will be inflicted with increasing levels of slowness and fatigue until finally petrified and killed.",new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},
|
||||
new PVPValue(30,1.0),1,45,UpgradePath.ALL,1),
|
||||
;
|
||||
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},1,45,UpgradePath.ALL),
|
||||
|
||||
final static double[] decayvals = new double[]{0.5,0.588,0.6505,0.6990,0.7386,0.7720,0.8010,0.8266,0.8495,0.8702,0.8891,0.9225,0.9515,0.9771,1.0};
|
||||
;
|
||||
|
||||
public static int LINE_SIZE=50;
|
||||
String name;
|
||||
@ -179,36 +155,25 @@ public enum ArtifactAbility {
|
||||
int maxlv;
|
||||
int requirement;
|
||||
UpgradePath upgrade;
|
||||
int apcost;
|
||||
PVPValue pvpval;
|
||||
|
||||
ArtifactAbility(String name, String desc, double[] baseval, PVPValue pvpval, int maxlv, int requirement, UpgradePath upgrade, int apcost) {
|
||||
ArtifactAbility(String name, String desc, double[] baseval, double[] decayval, int maxlv, int requirement, UpgradePath upgrade) {
|
||||
this.name=name;
|
||||
this.desc=desc;
|
||||
this.baseval=baseval;
|
||||
this.decayval=decayval;
|
||||
this.maxlv=maxlv;
|
||||
this.requirement=requirement;
|
||||
AwakenedArtifact.ability_map.put(this,this.name);
|
||||
AwakenedArtifact.name_map.put(this.name,this);
|
||||
this.upgrade=upgrade;
|
||||
this.apcost=apcost;
|
||||
this.pvpval=pvpval;
|
||||
}
|
||||
|
||||
public PVPValue getPVPValue() {
|
||||
return pvpval;
|
||||
}
|
||||
|
||||
private static String LevelCost(int i) {
|
||||
return "\n\n"+ChatColor.RED+"Costs "+i+" AP";
|
||||
}
|
||||
|
||||
private static String TemporarySkill(boolean knockoff) {
|
||||
return "\n\n"+ChatColor.RED+"Consumes 1 Max AP Point"+((knockoff)?" when knocked off.":"");
|
||||
}
|
||||
|
||||
public int getAPCost() {
|
||||
return this.apcost;
|
||||
private static String TemporarySkill() {
|
||||
return "\n\n"+ChatColor.RED+"Consumes 1 Max AP Point when knocked off.";
|
||||
}
|
||||
|
||||
public String GetName() {
|
||||
@ -221,22 +186,12 @@ public enum ArtifactAbility {
|
||||
|
||||
public double GetBaseValue(int tier) {
|
||||
if (tier<=0) {tier=1;}
|
||||
if (tier-1<this.baseval.length) {
|
||||
return this.baseval[tier-1];
|
||||
} else {
|
||||
TwosideKeeper.log("WARNING! Base value for tier "+tier+" does not exist for ability "+this.name()+"! Falling back to highest possible value.", 1);
|
||||
return this.baseval[this.baseval.length-1];
|
||||
}
|
||||
}
|
||||
|
||||
public double GetDecayValue(int tier) {
|
||||
if (tier<=0) {tier=1;}
|
||||
if (tier-1<decayvals.length) {
|
||||
return decayvals[tier-1];
|
||||
} else {
|
||||
TwosideKeeper.log("WARNING! Decay value for tier "+tier+" does not exist for decayvals array! Falling back to highest possible value.", 1);
|
||||
return decayvals[decayvals.length-1];
|
||||
}
|
||||
return this.decayval[tier-1];
|
||||
}
|
||||
|
||||
public int GetMaxLevel() {
|
||||
@ -247,6 +202,21 @@ public enum ArtifactAbility {
|
||||
return requirement;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static double calculateValue(ArtifactAbility ability, int artifacttier, int abilitylevel) {
|
||||
double sum=0;
|
||||
TwosideKeeper.log("Ability "+ability.GetName(), 4);
|
||||
for(int i=0;i<abilitylevel;i++){
|
||||
TwosideKeeper.log("Old Sum:"+sum+"::i:"+i, 5);
|
||||
sum+=1d/(1d+(ability.GetDecayValue(artifacttier)*(double)i));
|
||||
TwosideKeeper.log("New Sum:"+sum+"::i:"+i, 5);
|
||||
}
|
||||
TwosideKeeper.log("Sum is "+sum, 5);
|
||||
TwosideKeeper.log("Base value is "+ability.GetBaseValue(artifacttier), 4);
|
||||
return sum*ability.GetBaseValue(artifacttier);
|
||||
}
|
||||
|
||||
public static HashMap<ArtifactAbility,Integer> getEnchantments(ItemStack item) {
|
||||
HashMap<ArtifactAbility,Integer> abilities = new HashMap<ArtifactAbility,Integer>();
|
||||
if (GenericFunctions.isArtifactEquip(item)) {
|
||||
@ -264,6 +234,7 @@ public enum ArtifactAbility {
|
||||
newstring+=" "+splitstring[j];
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log(newstring,5);
|
||||
//This is the name of the enchantment. Now connect it with the name map we made.
|
||||
abilities.put(AwakenedArtifact.name_map.get(ChatColor.stripColor(newstring)),Integer.parseInt(splitstring[splitstring.length-1]));
|
||||
}
|
||||
@ -286,22 +257,13 @@ public enum ArtifactAbility {
|
||||
List<String> lore = m.getLore();
|
||||
if (containsEnchantment(ability,item)) {
|
||||
//We just need to find the line and upgrade it then.
|
||||
boolean belowartifactline=false;
|
||||
for (int i=0;i<lore.size();i++) {
|
||||
if (!belowartifactline) {
|
||||
if (lore.get(i).contains(ChatColor.GOLD+"Ability Points:")) {
|
||||
belowartifactline=true;
|
||||
}
|
||||
} else {
|
||||
String filterstring = ChatColor.stripColor(lore.get(i).replaceFirst(" ", "").substring(0, lore.get(i).lastIndexOf(" ")-1));
|
||||
//TwosideKeeper.log("CHECKING _"+filterstring+"_ TO _"+ability.GetName()+"_", 0);
|
||||
if (filterstring.equalsIgnoreCase(ability.GetName())) {
|
||||
if (lore.get(i).contains(ability.GetName())) {
|
||||
//This is the line! Modify it.
|
||||
lore.set(i, ChatColor.YELLOW+" "+ability.GetName()+" "+(lv));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
m.setLore(lore);
|
||||
item.setItemMeta(m);
|
||||
return item;
|
||||
@ -320,7 +282,7 @@ public enum ArtifactAbility {
|
||||
if (containsEnchantment(ability,item)) {
|
||||
for (int i=0;i<lore.size();i++) {
|
||||
if (lore.get(i).contains(ability.GetName())) {
|
||||
//TwosideKeeper.log("Removed "+ability.GetName(), 2);
|
||||
TwosideKeeper.log("Removed "+ability.GetName(), 2);
|
||||
//This is the line! Remove it.
|
||||
lore.remove(i);
|
||||
i--;
|
||||
@ -335,7 +297,7 @@ public enum ArtifactAbility {
|
||||
public static ItemStack removeAllEnchantments(ItemStack item) {
|
||||
HashMap<ArtifactAbility,Integer> enchants = getEnchantments(item);
|
||||
for (ArtifactAbility ab : enchants.keySet()) {
|
||||
//TwosideKeeper.log("Checking for enchantment "+ab.GetName(), 2);
|
||||
TwosideKeeper.log("Checking for enchantment "+ab.GetName(), 2);
|
||||
item = removeEnchantment(ab,item);
|
||||
}
|
||||
item = AwakenedArtifact.setAP(item, AwakenedArtifact.getMaxAP(item));
|
||||
@ -362,7 +324,6 @@ public enum ArtifactAbility {
|
||||
}
|
||||
|
||||
public static boolean containsEnchantment(ArtifactAbility ability, ItemStack item) {
|
||||
//TwosideKeeper.log("Enchantment list: "+getEnchantments(item), 0);
|
||||
return getEnchantments(item).containsKey(ability);
|
||||
}
|
||||
|
||||
@ -440,13 +401,6 @@ public enum ArtifactAbility {
|
||||
return true;
|
||||
}
|
||||
}break;
|
||||
case PROVOKE:{
|
||||
if ((item.getType().toString().contains("AXE") && !item.getType().toString().contains("PICKAXE"))
|
||||
|| item.getType().toString().contains("SWORD")) {
|
||||
//This is an item that can upgrade with Provoke.
|
||||
return true;
|
||||
}
|
||||
}break;
|
||||
case BASIC:{
|
||||
if (!item.getType().toString().contains("HELMET") &&
|
||||
!item.getType().toString().contains("CHESTPLATE") &&
|
||||
@ -474,7 +428,7 @@ public enum ArtifactAbility {
|
||||
if (getEnchantmentLevel(ability,item)>1) { //This is more than 1 level, so we just remove one level from it.
|
||||
//This is allowed. Proceed.
|
||||
item = applyEnchantment(ability,getEnchantmentLevel(ability,item)-1,item);
|
||||
//AwakenedArtifact.addAP(item, 1);
|
||||
AwakenedArtifact.addAP(item, 1);
|
||||
} else {
|
||||
//Just remove it completely.
|
||||
removeEnchantment(ability,item);
|
||||
@ -491,21 +445,16 @@ public enum ArtifactAbility {
|
||||
int level = getEnchantmentLevel(ability,item);
|
||||
//Make sure this item is compatible with the enchantment being applied.
|
||||
if (isCompatibleWithUpgrade(item,ability.upgrade)) {
|
||||
if (AwakenedArtifact.getAP(item)>=ability.getAPCost()) {
|
||||
if (AwakenedArtifact.getAP(item)>0) {
|
||||
if (ability.GetMaxLevel()>level && ability.GetMinLevel()<=AwakenedArtifact.getLV(item)) {
|
||||
//This is allowed. Proceed.
|
||||
item = applyEnchantment(ability,level+1,item);
|
||||
AwakenedArtifact.addAP(item, -ability.getAPCost());
|
||||
AwakenedArtifact.addAP(item, -1);
|
||||
p.sendMessage(ChatColor.AQUA+"Successfully applied "+ChatColor.BLUE+ability.GetName()+" "+(level+1)+ChatColor.AQUA+" to your artifact!");
|
||||
/*if (ability.equals(ArtifactAbility.GRACEFULDODGE) ||
|
||||
if (ability.equals(ArtifactAbility.GRACEFULDODGE) ||
|
||||
ability.equals(ArtifactAbility.SUPPRESS)) {
|
||||
//Remove a level from using a temporary ability.
|
||||
AwakenedArtifact.addAP(item, -9);
|
||||
}*/
|
||||
if (ability.equals(ArtifactAbility.GROWTH)) {
|
||||
removeEnchantment(ArtifactAbility.GROWTH,item);
|
||||
AwakenedArtifact.setPotential(item, 20);
|
||||
AwakenedArtifact.setMaxAP(item, AwakenedArtifact.getMaxAP(item)-1);
|
||||
}
|
||||
int apamt = AwakenedArtifact.getAP(item);
|
||||
if (apamt>0) {
|
||||
@ -517,7 +466,7 @@ public enum ArtifactAbility {
|
||||
tc.addExtra(ac);
|
||||
tc.addExtra(" to open up the ability upgrade menu.");;*/
|
||||
p.spigot().sendMessage(tc);
|
||||
p.spigot().sendMessage(ArtifactAbility.GenerateMenu(ArtifactItemType.getArtifactItemTypeFromItemStack(p.getInventory().getItem(GenericFunctions.CalculateSlot(item,p))).getUpgradePath(), CustomDamage.getBaseWeaponDamage(item, p, null), item,GenericFunctions.CalculateSlot(item,p),p));
|
||||
p.spigot().sendMessage(ArtifactAbility.GenerateMenu(ArtifactItemType.getArtifactItemTypeFromItemStack(p.getInventory().getItem(GenericFunctions.CalculateSlot(item,p))).getUpgradePath(), CustomDamage.getBaseWeaponDamage(item, p, null), item,GenericFunctions.CalculateSlot(item,p)));
|
||||
}
|
||||
} else {
|
||||
if (ability.GetMaxLevel()<=level) {
|
||||
@ -535,17 +484,15 @@ public enum ArtifactAbility {
|
||||
return item;
|
||||
}
|
||||
|
||||
public static TextComponent DisplayAbility(ArtifactAbility ability, double playerdmgval, ItemStack targetitem, int slot, Player p) {
|
||||
public static TextComponent DisplayAbility(ArtifactAbility ability, double playerdmgval, ItemStack targetitem, int slot) {
|
||||
boolean unlocked=true;
|
||||
String lockedreason = "";
|
||||
if (AwakenedArtifact.getLV(targetitem)<ability.GetMinLevel() || getEnchantmentLevel(ability,targetitem)>=ability.GetMaxLevel() || AwakenedArtifact.getAP(targetitem)<ability.getAPCost()) {
|
||||
if (AwakenedArtifact.getLV(targetitem)<ability.GetMinLevel() || getEnchantmentLevel(ability,targetitem)>=ability.GetMaxLevel()) {
|
||||
unlocked=false;
|
||||
if (AwakenedArtifact.getLV(targetitem)<ability.GetMinLevel()) {
|
||||
lockedreason=ChatColor.GRAY+""+ChatColor.ITALIC+"Your Artifact needs to reach Level "+ability.GetMinLevel()+" to obtain this ability.";
|
||||
} else if (getEnchantmentLevel(ability,targetitem)>=ability.GetMaxLevel()) {
|
||||
lockedreason=ChatColor.GRAY+""+ChatColor.ITALIC+"Your Artifact has reached the maximum level for this ability!";
|
||||
} else if (AwakenedArtifact.getAP(targetitem)<ability.getAPCost()) {
|
||||
lockedreason=ChatColor.GRAY+""+ChatColor.ITALIC+"Your Artifact does not have enough ability points to upgrade "+ChatColor.GREEN+ability.GetName()+ChatColor.GRAY+"!";
|
||||
}
|
||||
}
|
||||
int enchantlevel=0;
|
||||
@ -554,9 +501,9 @@ public enum ArtifactAbility {
|
||||
}
|
||||
String displaystring = "";
|
||||
if (enchantlevel>0) {
|
||||
displaystring = displayDescriptionUpgrade(ability,ArtifactUtils.getArtifactTier(targetitem),enchantlevel,enchantlevel+1,playerdmgval, PVP.isPvPing(p));
|
||||
displaystring = displayDescriptionUpgrade(ability,targetitem.getEnchantmentLevel(Enchantment.LUCK),enchantlevel,enchantlevel+1,playerdmgval);
|
||||
} else {
|
||||
displaystring = displayDescription(ability,ArtifactUtils.getArtifactTier(targetitem),enchantlevel+1,playerdmgval, PVP.isPvPing(p));
|
||||
displaystring = displayDescription(ability,targetitem.getEnchantmentLevel(Enchantment.LUCK),enchantlevel+1,playerdmgval);
|
||||
}
|
||||
TextComponent tc = new TextComponent(((unlocked)?ChatColor.GREEN:ChatColor.RED)+"["+ability.GetName()+" "+(enchantlevel+1)+"] ");
|
||||
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder(WordUtils.wrap(ChatColor.BLUE+ability.GetName()+"\n\n"+displaystring+((lockedreason.equalsIgnoreCase(""))?"":"\n\n"),LINE_SIZE,"\n",true)+WordUtils.wrap(lockedreason,LINE_SIZE,"\n"+net.md_5.bungee.api.ChatColor.GRAY,true)).create()));
|
||||
@ -573,11 +520,11 @@ public enum ArtifactAbility {
|
||||
}
|
||||
}
|
||||
|
||||
public static TextComponent GenerateMenu(UpgradePath path, double playerdmgval, ItemStack targetitem, Player p) {
|
||||
return GenerateMenu(path,playerdmgval,targetitem,0,p);
|
||||
public static TextComponent GenerateMenu(UpgradePath path, double playerdmgval, ItemStack targetitem) {
|
||||
return GenerateMenu(path,playerdmgval,targetitem,0);
|
||||
}
|
||||
|
||||
public static TextComponent GenerateMenu(UpgradePath path, double playerdmgval, ItemStack targetitem, int slot, Player p) {
|
||||
public static TextComponent GenerateMenu(UpgradePath path, double playerdmgval, ItemStack targetitem, int slot) {
|
||||
TextComponent msg1 = new TextComponent("Choose an ability to upgrade "+((targetitem.hasItemMeta() && targetitem.getItemMeta().hasDisplayName())?targetitem.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(targetitem))+ChatColor.RESET+":\n\n");
|
||||
int i=0;
|
||||
TextComponent text = new TextComponent("");
|
||||
@ -589,128 +536,98 @@ public enum ArtifactAbility {
|
||||
path==UpgradePath.FISHING_ROD ||
|
||||
path==UpgradePath.SCYTHE ||
|
||||
path==UpgradePath.BASIC) {
|
||||
text=DisplayAbility(DAMAGE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ARMOR_PEN,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EXECUTION,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DAMAGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ARMOR_PEN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EXECUTION,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
if (path!=UpgradePath.BASIC) {
|
||||
text=DisplayAbility(LIFESTEAL,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(CRITICAL,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(CRIT_DMG,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HIGHWINDER,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(LIFESTEAL,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(CRITICAL,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(CRIT_DMG,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HIGHWINDER,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
if (path==UpgradePath.SWORD) {
|
||||
text=DisplayAbility(PROVOKE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(COMBO,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(PROVOKE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(COMBO,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
} else
|
||||
if (path==UpgradePath.AXE) {
|
||||
text=DisplayAbility(PROVOKE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
//text=DisplayAbility(BREAKDOWN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
//text=DisplayAbility(BUTCHERY,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
if (TwosideKeeper.NEWARTIFACTABILITIES_ACTIVATED) {
|
||||
text=DisplayAbility(DAMAGEPOOL,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(LIFESTACK,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(LIFESUCK,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HIGHDIVE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
}
|
||||
text=DisplayAbility(BREAKDOWN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(BUTCHERY,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
} else
|
||||
if (path==UpgradePath.FISHING_ROD) {
|
||||
} else
|
||||
if (path==UpgradePath.BOW) {
|
||||
text=DisplayAbility(MARKSMAN,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
/*text=DisplayAbility(SIEGESTANCE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(MARKSMAN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(SIEGESTANCE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ARROWSHOWER,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(TARGETING,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ENDERTURRET,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}*/
|
||||
text=DisplayAbility(ENDERTURRET,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
} else
|
||||
if (path==UpgradePath.SCYTHE) {
|
||||
text=DisplayAbility(AOE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DEATHMARK,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(AOE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DEATHMARK,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (path==UpgradePath.ARMOR //Armor category.
|
||||
) {
|
||||
text=DisplayAbility(DAMAGE_REDUCTION,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HEALTH,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HEALTH_REGEN,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(STATUS_EFFECT_RESISTANCE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(SHADOWWALKER,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(SURVIVOR,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DODGE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(GRACEFULDODGE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DAMAGE_REDUCTION,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HEALTH,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(HEALTH_REGEN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(STATUS_EFFECT_RESISTANCE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(SHADOWWALKER,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(SURVIVOR,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(GRACEFULDODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
} else
|
||||
if (path==UpgradePath.TOOL || //Tool category.
|
||||
path==UpgradePath.SHOVEL ||
|
||||
path==UpgradePath.PICKAXE
|
||||
) {
|
||||
text=DisplayAbility(DAMAGE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ARMOR_PEN,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EXECUTION,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(DAMAGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ARMOR_PEN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EXECUTION,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
if (path==UpgradePath.SHOVEL) {
|
||||
text=DisplayAbility(SUPPRESS,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ERUPTION,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EARTHWAVE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(SUPPRESS,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(ERUPTION,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EARTHWAVE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
} else
|
||||
if (path==UpgradePath.PICKAXE) {
|
||||
//text=DisplayAbility(SCAVENGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
if (TwosideKeeper.NEWARTIFACTABILITIES_ACTIVATED) {
|
||||
text=DisplayAbility(MINES,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(OREHARVESTER,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(IMPACT,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(FORCESTRIKE,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
}
|
||||
text=DisplayAbility(SCAVENGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
}
|
||||
}
|
||||
|
||||
text=DisplayAbility(GREED,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(AUTOREPAIR,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(GROWTH,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
//text=DisplayAbility(REMOVE_CURSE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(PRESERVATION,playerdmgval,targetitem,slot,p);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
//text=DisplayAbility(EXP_MULT,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(GREED,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(AUTOREPAIR,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(REMOVE_CURSE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(PRESERVATION,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
text=DisplayAbility(EXP_MULT,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
|
||||
|
||||
return msg1;
|
||||
}
|
||||
|
||||
static String DisplayOreBonus(String oretype, String bonus) {
|
||||
return ChatColor.LIGHT_PURPLE+oretype+": "+ChatColor.YELLOW+" "+bonus;
|
||||
}
|
||||
|
||||
public static String displayDescription(ArtifactAbility ability, int tier, int abilitylv, double playerdmgval, boolean pvp) { //Level to display information for.
|
||||
public static String displayDescription(ArtifactAbility ability, int tier, int abilitylv, double playerdmgval) { //Level to display information for.
|
||||
String msg = ability.GetDescription();
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
msg=msg.replace("[VAL]", ChatColor.BLUE+df.format(calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[200VAL]", ChatColor.BLUE+df.format(200+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[PENDMG]", ChatColor.BLUE+df.format(calculateValue(ability,tier,abilitylv,pvp)/100*playerdmgval)+ChatColor.RESET); //Based on multiplying [VAL] by the base damage value.
|
||||
msg=msg.replace("[VAL]", ChatColor.BLUE+df.format(calculateValue(ability,tier,abilitylv))+ChatColor.RESET);
|
||||
msg=msg.replace("[200VAL]", ChatColor.BLUE+df.format(200+calculateValue(ability,tier,abilitylv))+ChatColor.RESET);
|
||||
msg=msg.replace("[PENDMG]", ChatColor.BLUE+df.format(calculateValue(ability,tier,abilitylv)/100*playerdmgval)+ChatColor.RESET); //Based on multiplying [VAL] by the base damage value.
|
||||
msg=msg.replace("[HUNGERVAL]", ChatColor.BLUE+df.format(10*abilitylv)+ChatColor.RESET);
|
||||
msg=msg.replace("[FATALDMG]", ChatColor.BLUE+df.format(120*abilitylv)+ChatColor.RESET);
|
||||
msg=msg.replace("[REPAIRCHANCE]", ChatColor.BLUE+df.format(tier/3)+ChatColor.RESET);
|
||||
msg=msg.replace("[DODGEVAL]", ChatColor.BLUE+df.format(tier)+ChatColor.RESET);
|
||||
msg=msg.replace("[GREEDCHANCE]", ChatColor.BLUE+df.format(8-(tier/2d))+ChatColor.RESET);
|
||||
msg=msg.replace("[ERUPTIONVAL]", ChatColor.BLUE+df.format(35+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[EARTHWAVEVAL]", ChatColor.BLUE+df.format(20+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[AOEVAL]", ChatColor.BLUE+df.format(1+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[POTVAL]", ChatColor.BLUE+df.format(5+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[GRACEFULVAL]", ChatColor.BLUE+df.format(0.1+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[FORCESTRIKEVAL]", ChatColor.BLUE+df.format(60+calculateValue(ability,tier,abilitylv,pvp))+ChatColor.RESET);
|
||||
msg=msg.replace("[GREEDCHANCE]", ChatColor.BLUE+df.format((16-tier)*0.1d)+ChatColor.RESET);
|
||||
return msg;
|
||||
}
|
||||
public static String displayDescriptionUpgrade(ArtifactAbility ability, int tier, int fromlv, int tolv, double playerdmgval, boolean pvp) { //Level to display information for.
|
||||
public static String displayDescriptionUpgrade(ArtifactAbility ability, int tier, int fromlv, int tolv, double playerdmgval) { //Level to display information for.
|
||||
String msg = ability.GetDescription();
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
msg=msg.replace("[VAL]", DisplayChangedValue(df.format(calculateValue(ability,tier,fromlv,pvp)),df.format(calculateValue(ability,tier,tolv,pvp))));
|
||||
msg=msg.replace("[200VAL]", ChatColor.BLUE+DisplayChangedValue(df.format(200+calculateValue(ability,tier,fromlv,pvp)),df.format(200+calculateValue(ability,tier,tolv,pvp)))+ChatColor.RESET);
|
||||
msg=msg.replace("[PENDMG]", DisplayChangedValue(df.format(calculateValue(ability,tier,fromlv,pvp)/100*playerdmgval),df.format(calculateValue(ability,tier,tolv,pvp)/100*playerdmgval))); //Based on multiplying [VAL] by the base damage value.
|
||||
msg=msg.replace("[VAL]", DisplayChangedValue(df.format(calculateValue(ability,tier,fromlv)),df.format(calculateValue(ability,tier,tolv))));
|
||||
msg=msg.replace("[200VAL]", ChatColor.BLUE+DisplayChangedValue(df.format(200+calculateValue(ability,tier,fromlv)),df.format(200+calculateValue(ability,tier,tolv)))+ChatColor.RESET);
|
||||
msg=msg.replace("[PENDMG]", DisplayChangedValue(df.format(calculateValue(ability,tier,fromlv)/100*playerdmgval),df.format(calculateValue(ability,tier,tolv)/100*playerdmgval))); //Based on multiplying [VAL] by the base damage value.
|
||||
msg=msg.replace("[HUNGERVAL]", DisplayBadChangedValue(df.format(10*fromlv),df.format(10*tolv)));
|
||||
msg=msg.replace("[FATALDMG]", DisplayChangedValue(df.format(120-fromlv),df.format(120-tolv)));
|
||||
msg=msg.replace("[REPAIRCHANCE]", df.format(tier/3));
|
||||
msg=msg.replace("[DODGEVAL]", df.format(tier));
|
||||
msg=msg.replace("[GREEDCHANCE]", ChatColor.BLUE+df.format(8-(tier/2d))+ChatColor.RESET);
|
||||
msg=msg.replace("[ERUPTIONVAL]", DisplayChangedValue(df.format(35+calculateValue(ability,tier,fromlv,pvp))+ChatColor.RESET,df.format(35+calculateValue(ability,tier,tolv,pvp))+ChatColor.RESET));
|
||||
msg=msg.replace("[EARTHWAVEVAL]", DisplayChangedValue(df.format(20+calculateValue(ability,tier,fromlv,pvp))+ChatColor.RESET,df.format(20+calculateValue(ability,tier,tolv,pvp))+ChatColor.RESET));
|
||||
msg=msg.replace("[AOEVAL]", DisplayChangedValue(df.format(1+calculateValue(ability,tier,fromlv,pvp))+ChatColor.RESET,df.format(1+calculateValue(ability,tier,tolv,pvp))+ChatColor.RESET));
|
||||
msg=msg.replace("[POTVAL]", DisplayChangedValue(df.format(5+calculateValue(ability,tier,fromlv,pvp))+ChatColor.RESET,df.format(5+calculateValue(ability,tier,tolv,pvp))+ChatColor.RESET));
|
||||
msg=msg.replace("[GRACEFULVAL]", DisplayChangedValue(df.format(0.1+calculateValue(ability,tier,fromlv,pvp))+ChatColor.RESET,df.format(0.1+calculateValue(ability,tier,tolv,pvp))+ChatColor.RESET));
|
||||
msg=msg.replace("[FORCESTRIKEVAL]", DisplayChangedValue(df.format(60+calculateValue(ability,tier,fromlv,pvp))+ChatColor.RESET,df.format(60+calculateValue(ability,tier,tolv,pvp))+ChatColor.RESET));
|
||||
msg=msg.replace("[GREEDCHANCE]", ChatColor.BLUE+df.format((100d/tier))+ChatColor.RESET);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@ -721,23 +638,4 @@ public enum ArtifactAbility {
|
||||
return ChatColor.DARK_RED+""+ChatColor.STRIKETHROUGH+val1+ChatColor.RESET+ChatColor.RED+val2+ChatColor.DARK_RED+ChatColor.BOLD+"v"+ChatColor.RESET;
|
||||
}
|
||||
|
||||
public static double calculateValue(ArtifactAbility ab, int artifactTier, int enchantmentLevel, boolean pvp) {
|
||||
double sum=0;
|
||||
TwosideKeeper.log("Ability "+ab.GetName(), 4);
|
||||
/*for(int i=0;i<abilitylevel;i++){
|
||||
TwosideKeeper.log("Old Sum:"+sum+"::i:"+i, 5);
|
||||
sum+=1d/(1d+(ability.GetDecayValue(artifacttier)*(double)i));
|
||||
TwosideKeeper.log("New Sum:"+sum+"::i:"+i, 5);
|
||||
}
|
||||
TwosideKeeper.log("Sum is "+sum, 5);
|
||||
TwosideKeeper.log("Base value is "+ability.GetBaseValue(artifacttier), 4);
|
||||
return sum*ability.GetBaseValue(artifacttier);*/
|
||||
//return Math.pow(ability.GetBaseValue(artifacttier)*abilitylevel, ability.GetDecayValue(artifacttier));
|
||||
if (pvp) {
|
||||
return ab.pvpval.getBaseValue() * Math.pow(ab.pvpval.getPointValue(),ab.GetDecayValue(15));
|
||||
} else {
|
||||
return ab.GetBaseValue(artifactTier) * Math.pow(enchantmentLevel, ab.GetDecayValue(artifactTier));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -15,5 +15,5 @@ public enum ArtifactItem {
|
||||
DIVINE_CORE,
|
||||
DIVINE_BASE,
|
||||
MALLEABLE_BASE,
|
||||
ARTIFACT_RECIPE;
|
||||
ARTIFACT_RECIPE
|
||||
}
|
||||
|
@ -491,7 +491,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 1);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 1);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -519,7 +518,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 2);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.DURABILITY, 2);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 1);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -549,7 +547,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.DURABILITY, 3);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 2);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -583,7 +580,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.DURABILITY, 4);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 1);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 3);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -618,7 +614,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 2);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LURE, 1);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 4);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -653,7 +648,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LOOT_BONUS_MOBS, 3);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LURE, 2);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 5);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -689,7 +683,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LURE, 3);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 6);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -728,7 +721,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LURE, 4);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 8);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -766,7 +758,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.KNOCKBACK, 1);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LURE, 5);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 9);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
@ -805,7 +796,6 @@ public enum ArtifactItemType {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.KNOCKBACK, 2);
|
||||
if (upgrade==UpgradePath.FISHING_ROD) {
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LURE, 6);
|
||||
ouritem.addUnsafeEnchantment(Enchantment.LUCK, 10);
|
||||
}
|
||||
}
|
||||
if (upgrade==UpgradePath.ARMOR) {
|
||||
|
@ -1,31 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public enum Book {
|
||||
BEGINNERSGUIDE("NewPlayerGuide.txt"),
|
||||
COMMANDGUIDE("CommandGuide.txt"),
|
||||
STRIKERGUIDE("StrikerGuide.txt"),
|
||||
DEFENDERGUIDE("DefenderGuide.txt"),
|
||||
RANGERGUIDE("RangerGuide.txt"),
|
||||
SLAYERGUIDE("SlayerGuide.txt"),
|
||||
BARBARIANGUIDE("BarbarianGuide.txt"),
|
||||
SUMMONERGUIDE("SummonerGuide.txt"),
|
||||
ADVENTURERGUIDE("AdventurerGuide.txt");
|
||||
|
||||
String fileLoc;
|
||||
|
||||
Book(String loc) {
|
||||
this.fileLoc=loc;
|
||||
}
|
||||
|
||||
public File getBookFile() {
|
||||
return new File(TwosideKeeper.plugin.getDataFolder()+"/books/"+this.fileLoc);
|
||||
}
|
||||
|
||||
public String getBookFilepath() {
|
||||
return TwosideKeeper.plugin.getDataFolder()+"/books/"+this.fileLoc;
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/*package sig.plugin.TwosideKeeper.HelperStructures.BotCommands;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class stats implements aPlugin.API.DiscordCommandExecutor{
|
||||
@Override
|
||||
public void run(String[] args) {
|
||||
//args[0] is the command!
|
||||
//TwosideKeeper.log("Length is "+args.length, 0);
|
||||
if (args.length==2) {
|
||||
Player p = Bukkit.getPlayer(args[1]);
|
||||
if (p!=null && p.isOnline()) {
|
||||
//TwosideKeeper.showP
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
@ -1,81 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
|
||||
import sig.plugin.TwosideKeeper.Buff;
|
||||
|
||||
public enum BuffTemplate {
|
||||
POISON("Poison","Poison",Color.YELLOW,ChatColor.YELLOW+"☣",false),
|
||||
SHRAPNEL("SHRAPNEL","Shrapnel",Color.RED,ChatColor.RED+"❂",false),
|
||||
WINDCHARGES("WINDCHARGE","Wind",Color.GRAY,"๑",true),
|
||||
BLEEDING("BLEEDING","Bleed",Color.MAROON,ChatColor.DARK_RED+"☠",false),
|
||||
REGENERATION("REGENERATION","Regeneration",Color.GREEN,ChatColor.GREEN+""+ChatColor.BOLD+"✙",true),
|
||||
INFECTION("INFECTION","Infection",Color.GRAY,ChatColor.GRAY+"❧",false),
|
||||
CRIPPLE("CRIPPLE","Cripple",Color.WHITE,ChatColor.WHITE+"☹",false),
|
||||
DARKSUBMISSION("DARKSUBMISSION",ChatColor.GRAY+"Dark Submission"+ChatColor.RESET,Color.BLACK,ChatColor.BLACK+""+ChatColor.MAGIC+"☁"+ChatColor.RESET,false),
|
||||
CONFUSION("CONFUSION","Confusion",Color.PURPLE,ChatColor.DARK_PURPLE+"๑"+ChatColor.RESET,false),
|
||||
|
||||
UNDYINGRAGE_COOLDOWN("COOLDOWN_UNDYING_RAGE","Undying Rage Cooldown",null,ChatColor.WHITE+"",true,true),
|
||||
UNSTOPPABLETEAM_COOLDOWN("Unstoppable Team Unavailable","Unstoppable Team Unavailable",null,ChatColor.WHITE+"",true,true),
|
||||
;
|
||||
|
||||
String keyName;
|
||||
String displayName;
|
||||
Color col;
|
||||
String icon;
|
||||
boolean isGoodBuff;
|
||||
boolean permanentBuff;
|
||||
boolean displayTimer;
|
||||
|
||||
public String getKeyName() {
|
||||
return keyName;
|
||||
}
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
public Color getParticleColor() {
|
||||
return col;
|
||||
}
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
public boolean isGoodBuff() {
|
||||
return isGoodBuff;
|
||||
}
|
||||
public boolean isPermanentBuff() {
|
||||
return permanentBuff;
|
||||
}
|
||||
public boolean isDisplayTimer() {
|
||||
return displayTimer;
|
||||
}
|
||||
|
||||
BuffTemplate(String keyName, String displayName, Color particleColor, String icon, boolean isGoodBuff) {
|
||||
this.keyName=keyName;
|
||||
this.displayName=displayName;
|
||||
this.col=particleColor;
|
||||
this.icon=icon;
|
||||
this.isGoodBuff=isGoodBuff;
|
||||
this.permanentBuff=false;
|
||||
this.displayTimer=false;
|
||||
}
|
||||
BuffTemplate(String keyName, String displayName, Color particleColor, String icon, boolean isGoodBuff, boolean isPermanentBuff) {
|
||||
this.keyName=keyName;
|
||||
this.displayName=displayName;
|
||||
this.col=particleColor;
|
||||
this.icon=icon;
|
||||
this.isGoodBuff=isGoodBuff;
|
||||
this.permanentBuff=isPermanentBuff;
|
||||
this.displayTimer=false;
|
||||
}
|
||||
BuffTemplate(String keyName, String displayName, Color particleColor, String icon, boolean isGoodBuff, boolean isPermanentBuff, boolean displayTimer) {
|
||||
this.keyName=keyName;
|
||||
this.displayName=displayName;
|
||||
this.col=particleColor;
|
||||
this.icon=icon;
|
||||
this.isGoodBuff=isGoodBuff;
|
||||
this.permanentBuff=isPermanentBuff;
|
||||
this.displayTimer=displayTimer;
|
||||
}
|
||||
//new Buff("Poison",20*20,Integer.parseInt(args[1]),Color.YELLOW,ChatColor.YELLOW+"☣",false)
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.CastBarItem;
|
||||
|
||||
public class CastBar {
|
||||
List<CastBarItem> castbaritems = new ArrayList<CastBarItem>();
|
||||
|
||||
public CastBar(CastBarItem...items) {
|
||||
castbaritems = Arrays.asList(items);
|
||||
while (castbaritems.size()<9) {
|
||||
castbaritems.add(new CastBarItem(Material.AIR));
|
||||
}
|
||||
}
|
||||
|
||||
public void run(Player p) {
|
||||
aPlugin.API.setSlot(p, 9);
|
||||
for (int i=0;i<9;i++) {
|
||||
aPlugin.API.setItem(p, p.getOpenInventory(), i, castbaritems.get(i).getItemStack());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,166 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.boss.BarColor;
|
||||
import org.bukkit.boss.BarFlag;
|
||||
import org.bukkit.boss.BarStyle;
|
||||
import org.bukkit.boss.BossBar;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.LivingEntityStructure;
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.Events.EntityChannelCastEvent;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class Channel {
|
||||
LivingEntity l;
|
||||
String channelName;
|
||||
int duration;
|
||||
long channelStartTime;
|
||||
BossBar channelBar;
|
||||
boolean cancelled=false;
|
||||
|
||||
public Channel(LivingEntity l, String spellName, int tickDuration) {
|
||||
this.l=l;
|
||||
this.channelName=spellName;
|
||||
this.duration=tickDuration;
|
||||
this.channelStartTime=TwosideKeeper.getServerTickTime();
|
||||
if (l instanceof Player) {
|
||||
Player p = (Player)l;
|
||||
channelBar = l.getServer().createBossBar(ChatColor.YELLOW+channelName, BarColor.YELLOW, BarStyle.SOLID, BarFlag.CREATE_FOG);
|
||||
channelBar.addPlayer(p);
|
||||
UpdateBossBar();
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
pd.currentChannel=this;
|
||||
} else {
|
||||
UpdateMobChannelingBar(l);
|
||||
l.setCustomNameVisible(true);
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
les.currentChannel=this;
|
||||
}
|
||||
GenericFunctions.addSuppressionTime(l, duration+5);
|
||||
AddToStructure();
|
||||
}
|
||||
|
||||
public static Channel createNewChannel(LivingEntity l, String spellName, int channelDuration){
|
||||
return new Channel(l,spellName,channelDuration);
|
||||
}
|
||||
|
||||
public static boolean isChanneling(LivingEntity l) {
|
||||
if (l instanceof Player) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)l);
|
||||
return pd.currentChannel!=null;
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
return les.currentChannel!=null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void stopChanneling(LivingEntity l) {
|
||||
if (isChanneling(l)) {
|
||||
Channel c = getCurrentChannel(l);
|
||||
c.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static Channel getCurrentChannel(LivingEntity l) {
|
||||
if (isChanneling(l)) {
|
||||
if (l instanceof Player) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)l);
|
||||
return pd.currentChannel;
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
return les.currentChannel;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddToStructure() {
|
||||
TwosideKeeper.channels.add(this);
|
||||
}
|
||||
|
||||
private void UpdateMobChannelingBar(LivingEntity l) {
|
||||
LivingEntityStructure.setChannelingBar(l, getMobChannelingBar());
|
||||
}
|
||||
|
||||
private void UpdateBossBar() {
|
||||
long tickTimeChanneled = TwosideKeeper.getServerTickTime()-channelStartTime;
|
||||
double ratio = (double)tickTimeChanneled/duration;
|
||||
channelBar.setProgress(ratio);
|
||||
}
|
||||
|
||||
private String getMobChannelingBar() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(ChatColor.YELLOW);
|
||||
sb.append(channelName);
|
||||
sb.append("[");
|
||||
long tickTimeChanneled = TwosideKeeper.getServerTickTime()-channelStartTime;
|
||||
double ratio = (double)tickTimeChanneled/duration;
|
||||
int bars = (int)(ratio*10);
|
||||
for (int i=0;i<bars;i++) {
|
||||
sb.append("█");
|
||||
}
|
||||
for (int i=0;i<10-bars;i++) {
|
||||
sb.append("-");
|
||||
}
|
||||
sb.append("]");
|
||||
sb.append(ChatColor.RESET);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void setCancelled(boolean isCancelled) {
|
||||
cancelled=isCancelled;
|
||||
LivingEntityStructure.setChannelingBar(l, "");
|
||||
if (channelBar!=null) {
|
||||
channelBar.removeAll();
|
||||
}
|
||||
}
|
||||
|
||||
public String getSpellName() {
|
||||
return channelName;
|
||||
}
|
||||
|
||||
public LivingEntity getLivingEntity() {
|
||||
return l;
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
if (l==null || !l.isValid() || cancelled) {
|
||||
return false;
|
||||
}
|
||||
if (channelStartTime+duration<TwosideKeeper.getServerTickTime()) {
|
||||
if (channelBar!=null) {
|
||||
channelBar.removeAll();
|
||||
} else {
|
||||
LivingEntityStructure.setChannelingBar(l, "");
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
if (les.suffix_bar.length()==0 && les.prefix.length()>0) {
|
||||
l.setCustomNameVisible(false);
|
||||
}
|
||||
}
|
||||
if (l instanceof Player) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)l);
|
||||
pd.currentChannel=null;
|
||||
} else {
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(l);
|
||||
les.currentChannel=null;
|
||||
}
|
||||
EntityChannelCastEvent ev = new EntityChannelCastEvent(l,channelName);
|
||||
Bukkit.getPluginManager().callEvent(ev);
|
||||
return false;
|
||||
} else {
|
||||
if (channelBar!=null) {
|
||||
UpdateBossBar();
|
||||
} else {
|
||||
UpdateMobChannelingBar(l);
|
||||
LivingEntityStructure.UpdateMobName(l);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.EulerAngle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MathUtils;
|
||||
|
||||
public class ArmorStandProperties {
|
||||
final public static ArmorStandProperties SCEPTERBASE = new ArmorStandProperties();
|
||||
final public static ArmorStandProperties SCEPTERTOP = new ArmorStandProperties();
|
||||
|
||||
boolean arms = false;
|
||||
boolean baseplate = false;
|
||||
EulerAngle bodyPose = EulerAngle.ZERO;
|
||||
ItemStack boots = new ItemStack(Material.AIR);
|
||||
ItemStack chestplate = new ItemStack(Material.AIR);
|
||||
EulerAngle headPose = EulerAngle.ZERO;
|
||||
ItemStack helmet = new ItemStack(Material.AIR);
|
||||
ItemStack hand = new ItemStack(Material.AIR);
|
||||
EulerAngle leftArmPose = EulerAngle.ZERO;
|
||||
EulerAngle leftLegPose = EulerAngle.ZERO;
|
||||
ItemStack leggings = new ItemStack(Material.AIR);
|
||||
boolean marker = false;
|
||||
EulerAngle rightArmPose = EulerAngle.ZERO;
|
||||
EulerAngle rightLegPose = EulerAngle.ZERO;
|
||||
|
||||
boolean small = false;
|
||||
boolean visible=true;
|
||||
boolean customNameVisible=false;
|
||||
String customName="";
|
||||
Vector offset = new Vector();
|
||||
|
||||
public ArmorStandProperties() {
|
||||
|
||||
}
|
||||
|
||||
public boolean isArms() {
|
||||
return arms;
|
||||
}
|
||||
|
||||
public void setArms(boolean arms) {
|
||||
this.arms = arms;
|
||||
}
|
||||
|
||||
public boolean isBaseplate() {
|
||||
return baseplate;
|
||||
}
|
||||
|
||||
public void setBaseplate(boolean baseplate) {
|
||||
this.baseplate = baseplate;
|
||||
}
|
||||
|
||||
public EulerAngle getBodyPose() {
|
||||
return bodyPose;
|
||||
}
|
||||
|
||||
public void setBodyPose(EulerAngle bodyPose) {
|
||||
this.bodyPose = bodyPose;
|
||||
}
|
||||
|
||||
public ItemStack getBoots() {
|
||||
return boots;
|
||||
}
|
||||
|
||||
public void setBoots(ItemStack boots) {
|
||||
this.boots = boots;
|
||||
}
|
||||
|
||||
public ItemStack getChestplate() {
|
||||
return chestplate;
|
||||
}
|
||||
|
||||
public void setChestplate(ItemStack chestplate) {
|
||||
this.chestplate = chestplate;
|
||||
}
|
||||
|
||||
public EulerAngle getHeadPose() {
|
||||
return headPose;
|
||||
}
|
||||
|
||||
public void setHeadPose(EulerAngle headPose) {
|
||||
this.headPose = headPose;
|
||||
}
|
||||
|
||||
public ItemStack getHelmet() {
|
||||
return helmet;
|
||||
}
|
||||
|
||||
public void setHelmet(ItemStack helmet) {
|
||||
this.helmet = helmet;
|
||||
}
|
||||
|
||||
public ItemStack getHand() {
|
||||
return hand;
|
||||
}
|
||||
|
||||
public void setHand(ItemStack hand) {
|
||||
this.hand = hand;
|
||||
}
|
||||
|
||||
public EulerAngle getLeftArmPose() {
|
||||
return leftArmPose;
|
||||
}
|
||||
|
||||
public void setLeftArmPose(EulerAngle leftArmPose) {
|
||||
this.leftArmPose = leftArmPose;
|
||||
}
|
||||
|
||||
public EulerAngle getLeftLegPose() {
|
||||
return leftLegPose;
|
||||
}
|
||||
|
||||
public void setLeftLegPose(EulerAngle leftLegPose) {
|
||||
this.leftLegPose = leftLegPose;
|
||||
}
|
||||
|
||||
public ItemStack getLeggings() {
|
||||
return leggings;
|
||||
}
|
||||
|
||||
public void setLeggings(ItemStack leggings) {
|
||||
this.leggings = leggings;
|
||||
}
|
||||
|
||||
public boolean isMarker() {
|
||||
return marker;
|
||||
}
|
||||
|
||||
public void setMarker(boolean marker) {
|
||||
this.marker = marker;
|
||||
}
|
||||
|
||||
public EulerAngle getRightArmPose() {
|
||||
return rightArmPose;
|
||||
}
|
||||
|
||||
public void setRightArmPose(EulerAngle rightArmPose) {
|
||||
this.rightArmPose = rightArmPose;
|
||||
}
|
||||
|
||||
public boolean isSmall() {
|
||||
return small;
|
||||
}
|
||||
|
||||
public void setSmall(boolean small) {
|
||||
this.small = small;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public void setVisible(boolean visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
public boolean isCustomNameVisible() {
|
||||
return customNameVisible;
|
||||
}
|
||||
|
||||
public void setCustomNameVisible(boolean customNameVisible) {
|
||||
this.customNameVisible = customNameVisible;
|
||||
}
|
||||
|
||||
public String getCustomName() {
|
||||
return customName;
|
||||
}
|
||||
|
||||
public void setCustomName(String customName) {
|
||||
this.customName = customName;
|
||||
}
|
||||
public EulerAngle getRightLegPose() {
|
||||
return rightLegPose;
|
||||
}
|
||||
|
||||
public void setRightLegPose(EulerAngle rightLegPose) {
|
||||
this.rightLegPose = rightLegPose;
|
||||
}
|
||||
|
||||
public Vector getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public void setOffset(Vector offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public static void defineAllModels() {
|
||||
SetupScepterBase();
|
||||
SetupScepterTop();
|
||||
}
|
||||
|
||||
private static void SetupScepterTop() {
|
||||
SCEPTERTOP.rightArmPose = MathUtils.getEulerAngleDegrees(-90, 0, 0);
|
||||
SCEPTERTOP.hand = new ItemStack(Material.DOUBLE_PLANT);
|
||||
SCEPTERTOP.offset = new Vector(-0.7,0,0.1);
|
||||
}
|
||||
|
||||
private static void SetupScepterBase() {
|
||||
SCEPTERBASE.rightArmPose = MathUtils.getEulerAngleDegrees(-90, 90, 0);
|
||||
SCEPTERBASE.small = true;
|
||||
SCEPTERBASE.hand = new ItemStack(Material.BONE);
|
||||
}
|
||||
}
|
||||
|
@ -1,83 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Dropper;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class BaublePouch {
|
||||
public final static String POUCHID_LINE = ChatColor.DARK_GREEN+"POUCH#";
|
||||
public static boolean isBaublePouch(ItemStack item) {
|
||||
return (ItemUtils.isValidItem(item) &&
|
||||
ItemUtils.LoreContainsSubstring(item, POUCHID_LINE));
|
||||
}
|
||||
public static Location getBaublePouchLoc(int id) {
|
||||
int posx = id % 960;
|
||||
int posy = 66; //Hoppers are at 64. So these cannot be directly above them as the items will get sucked in.
|
||||
int posz = id / 960;
|
||||
return new Location(Bukkit.getWorld("FilterCube"),posx,posy,posz);
|
||||
}
|
||||
public static Block getBaublePouchBlock(int id) {
|
||||
Block b = Bukkit.getWorld("FilterCube").getBlockAt(getBaublePouchLoc(id));
|
||||
return b;
|
||||
}
|
||||
public static Dropper getBaublePouchDropper(int id) {
|
||||
Dropper h = (Dropper)Bukkit.getWorld("FilterCube").getBlockAt(getBaublePouchLoc(id)).getState();
|
||||
return h;
|
||||
}
|
||||
public static void createNewBaublePouch(int id) {
|
||||
Block b = getBaublePouchBlock(id);
|
||||
b.getWorld().getBlockAt(getBaublePouchLoc(id)).setType(Material.DROPPER);
|
||||
}
|
||||
public static int getBaublePouchID(ItemStack item) {
|
||||
if (isBaublePouch(item)) {
|
||||
String id = ItemUtils.GetLoreLineContainingSubstring(item, POUCHID_LINE).split("#")[1];
|
||||
return Integer.parseInt(id);
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public static HashMap<Integer,ItemStack> insertItemsIntoBaublePouch(int id, ItemStack...items) {
|
||||
Dropper d = getBaublePouchDropper(id);
|
||||
Inventory inv = d.getInventory();
|
||||
return inv.addItem(items);
|
||||
}
|
||||
public static void openBaublePouch(Player p, ItemStack item) {
|
||||
if (isBaublePouch(item)) {
|
||||
int id = getBaublePouchID(item);
|
||||
Dropper d = getBaublePouchDropper(id);
|
||||
d.getChunk().load();
|
||||
GenericFunctions.renameDropper(d, ChatColor.stripColor(((ItemUtils.hasDisplayName(item))?ItemUtils.getDisplayName(item):"Bauble Pouch #"+id)));
|
||||
p.openInventory(d.getInventory());
|
||||
SoundUtils.playLocalSound(p, Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.0f, 1.0f);
|
||||
} else {
|
||||
p.sendMessage(ChatColor.RED+"Could not open Bauble Pouch! Please let the admin know this did not work.");
|
||||
}
|
||||
}
|
||||
public static List<ItemStack> getBaublePouchContents(int id) {
|
||||
List<ItemStack> itemlist = new ArrayList<ItemStack>();
|
||||
Dropper d = getBaublePouchDropper(id);
|
||||
Inventory inv = d.getInventory();
|
||||
for (ItemStack item : inv.getContents()) {
|
||||
if (ItemUtils.isValidItem(item)) {
|
||||
itemlist.add(item);
|
||||
}
|
||||
}
|
||||
return itemlist;
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class BlockModifyQueue{
|
||||
Material checktype; //The material the block should be before converting.
|
||||
Material finaltype; //The material the block is converting into.
|
||||
byte checkdata; //Data the block should be before converting.
|
||||
byte finaldata; //Data the block should be after converting.
|
||||
boolean usedata=false;
|
||||
Block b; //The block we are converting.
|
||||
|
||||
public BlockModifyQueue(Block b, Material checktype, Material finaltype) {
|
||||
this.b=b;
|
||||
this.checktype=checktype;
|
||||
this.finaltype=finaltype;
|
||||
this.checkdata=0;
|
||||
this.finaldata=0;
|
||||
this.usedata=false;
|
||||
}
|
||||
|
||||
public BlockModifyQueue(Block b, Material checktype, byte checkdata, Material finaltype, byte finaldata) {
|
||||
this.b=b;
|
||||
this.checktype=checktype;
|
||||
this.finaltype=finaltype;
|
||||
this.checkdata=checkdata;
|
||||
this.finaldata=finaldata;
|
||||
this.usedata=true;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if ((TypeException(b) || b.getType()==checktype) && (!usedata || b.getData()==checkdata)) {
|
||||
b.setType(finaltype);
|
||||
//TwosideKeeper.log("Set Type from Requested "+checktype+" to "+finaltype, 0);
|
||||
if (usedata) {b.setData(finaldata);}
|
||||
}
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return b;
|
||||
}
|
||||
|
||||
private boolean TypeException(Block b) {
|
||||
if (b.getType()==Material.STATIONARY_LAVA || b.getType()==Material.LAVA ||
|
||||
b.getType()==Material.STATIONARY_WATER || b.getType()==Material.WATER) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Cleanup(List<BlockModifyQueue> queue) {
|
||||
for (BlockModifyQueue bmq: queue) {
|
||||
bmq.run();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,158 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MovementUtils;
|
||||
|
||||
public class Camera {
|
||||
//ArmorStand camera_ent;
|
||||
double degrees=0;
|
||||
HashMap<UUID,Location> camera_viewerlocs = new HashMap<UUID,Location>();
|
||||
Chunk startingchunk;
|
||||
Location startedat;
|
||||
public Camera(Location startingloc,Player...viewers) {
|
||||
startingchunk = startingloc.getChunk();
|
||||
startedat=startingloc.clone();
|
||||
TwosideKeeper.temporary_chunks.add(startingchunk);
|
||||
startingchunk.load();
|
||||
for (Player p : viewers) {
|
||||
AddCameraViewer(p);
|
||||
}
|
||||
}
|
||||
public boolean containsViewer(Player p) {
|
||||
return (camera_viewerlocs.containsKey(p.getUniqueId()));
|
||||
}
|
||||
public void AddCameraViewer(Player p) {
|
||||
camera_viewerlocs.put(p.getUniqueId(), p.getLocation().clone());
|
||||
//TwosideKeeper.log("Set starting loc of "+p.getName()+" to "+camera_viewerlocs.get(p.getUniqueId()), 1);
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
p.setSpectatorTarget(null);
|
||||
}
|
||||
public Location getStartingLoc(Player p) {
|
||||
if (containsViewer(p)) {
|
||||
return camera_viewerlocs.get(p.getUniqueId());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public void removeCameraViewer(Player p) {
|
||||
if (camera_viewerlocs.containsKey(p.getUniqueId())) {
|
||||
p.setSpectatorTarget(null);
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
p.teleport(camera_viewerlocs.get(p.getUniqueId()));
|
||||
//TwosideKeeper.log("Teleporting player "+p.getName()+" to "+camera_viewerlocs.get(p.getUniqueId()), 1);
|
||||
camera_viewerlocs.remove(p.getUniqueId());
|
||||
}
|
||||
}
|
||||
public boolean runTick() {
|
||||
if (camera_viewerlocs.size()==0) {
|
||||
return false;
|
||||
}
|
||||
for (UUID id : camera_viewerlocs.keySet()) {
|
||||
Player p = Bukkit.getPlayer(id);
|
||||
if (p!=null && p.isValid()) {
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
if (p.getAllowFlight()) {p.setFlying(true);}
|
||||
p.setSpectatorTarget(p);
|
||||
} else {
|
||||
TwosideKeeper.ScheduleRemoval(camera_viewerlocs, p);
|
||||
}
|
||||
//TwosideKeeper.log("offset: "+camera_ent.getLocation().subtract(startedat)+" || Player offset: "+p.getLocation().subtract(startedat), 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void Cleanup() {
|
||||
Cleanup(false);
|
||||
}
|
||||
public void Cleanup(boolean isShuttingDown) {
|
||||
for (UUID id : camera_viewerlocs.keySet()) {
|
||||
Player p = Bukkit.getPlayer(id);
|
||||
if (p!=null && p.isValid()) {
|
||||
p.setSpectatorTarget(null);
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
p.teleport(camera_viewerlocs.get(id));
|
||||
if (!isShuttingDown) {
|
||||
TwosideKeeper.ScheduleRemoval(camera_viewerlocs, p);
|
||||
}
|
||||
} else {
|
||||
if (!isShuttingDown) {
|
||||
TwosideKeeper.ScheduleRemoval(camera_viewerlocs, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isShuttingDown) {
|
||||
TwosideKeeper.temporary_chunks.remove(startingchunk);
|
||||
}
|
||||
removeAllCameraViewers();
|
||||
}
|
||||
|
||||
private void removeAllCameraViewers() {
|
||||
camera_viewerlocs.clear();
|
||||
}
|
||||
public void pointCameraToLocation(Location fromLoc, Location toLoc) {
|
||||
//Points a camera to the target location.
|
||||
if (fromLoc!=null && toLoc!=null && toLoc.getWorld().equals(fromLoc.getWorld())) {
|
||||
Vector dir = MovementUtils.pointTowardsLocation(fromLoc, toLoc);
|
||||
Location currloc = fromLoc.clone();
|
||||
currloc.setDirection(dir);
|
||||
teleportViewers(currloc);
|
||||
}
|
||||
}
|
||||
|
||||
private void teleportViewers(Location loc) {
|
||||
for (UUID id : camera_viewerlocs.keySet()) {
|
||||
Player p = Bukkit.getPlayer(id);
|
||||
if (p!=null && p.isValid()) {
|
||||
p.teleport(loc);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void setCameraAroundCircle(double radius, double degrees, Location loc, double yoffset) {
|
||||
double velx = Math.cos(Math.toRadians(degrees));
|
||||
//double vely = Math.sin(Math.toRadians(degrees));
|
||||
double velz = Math.sin(Math.toRadians(degrees));
|
||||
Vector newvector = new Vector(-velx,0,-velz);
|
||||
newvector.multiply(radius*2);
|
||||
Location finalloc = loc.clone().add(newvector).add(0,yoffset,0);
|
||||
//TwosideKeeper.log("offset: "+camera_ent.getLocation().subtract(startedat)+" -> "+finalloc.subtract(startedat),0);
|
||||
//camera_ent.teleport(finalloc);
|
||||
teleportViewers(finalloc);
|
||||
pointCameraToLocation(finalloc,loc);
|
||||
}
|
||||
|
||||
public void rotateAroundPoint(double spd, int duration, Location loc, double radius, double yoffset) {
|
||||
duration--;
|
||||
setCameraAroundCircle(radius,degrees,loc,yoffset);
|
||||
degrees+=spd;
|
||||
if (duration>0) {
|
||||
final int dur = duration;
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{rotateAroundPoint(spd,dur,loc,radius,yoffset);}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void rotateAroundPointWithZoom(double spd, int duration, Location loc, double startzoom, double zoomspd, double maxzoom, double yoffset) {
|
||||
duration--;
|
||||
setCameraAroundCircle(startzoom,degrees,loc,yoffset);
|
||||
degrees+=spd;
|
||||
startzoom = Math.max(maxzoom,startzoom-zoomspd);
|
||||
yoffset = Math.min(yoffset,startzoom);
|
||||
if (duration>0) {
|
||||
final int dur = duration;
|
||||
final double zoom = startzoom;
|
||||
final double y = yoffset;
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{rotateAroundPointWithZoom(spd,dur,loc,zoom,zoomspd,maxzoom,y);}, 1);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
|
||||
public class CastBarItem {
|
||||
ItemStack item;
|
||||
|
||||
public CastBarItem(Material mat) {
|
||||
this(mat,(short)0,1,null);
|
||||
}
|
||||
|
||||
public CastBarItem(Material mat, short data, String displayName) {
|
||||
this(mat,data,1,displayName);
|
||||
}
|
||||
|
||||
public CastBarItem(Material mat, short data, int amt, String displayName) {
|
||||
item = new ItemStack(mat,amt,data);
|
||||
if (displayName!=null) {
|
||||
ItemUtils.setDisplayName(item, displayName);
|
||||
}
|
||||
}
|
||||
|
||||
public CastBarItem(MaterialData matdata, String displayName) {
|
||||
item = new ItemStack(matdata.getItemType(),1,matdata.getData());
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return item;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,6 @@ import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@ -34,7 +33,7 @@ public class Habitation {
|
||||
if (locationhashes.containsKey(hash)) {
|
||||
int spawnamt = locationhashes.get(hash);
|
||||
TwosideKeeper.log("[Habitat]Spawn Amount was "+spawnamt+". "+((0.5/(spawnamt+1))*100)+"% chance to fail.",4);
|
||||
if (Math.random()>(20/((spawnamt*2)+1))) {
|
||||
if (Math.random()>(20/(spawnamt+1))) {
|
||||
TwosideKeeper.log("[Habitat]It failed.",4);
|
||||
return false;
|
||||
}
|
||||
@ -46,7 +45,7 @@ public class Habitation {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*public void addKillToLocation(LivingEntity l) {
|
||||
public void addKillToLocation(LivingEntity l) {
|
||||
String hash = getLocationHash(l.getLocation());
|
||||
if (startinglocs.containsKey(l.getUniqueId())) {
|
||||
hash = getLocationHash(startinglocs.get(l.getUniqueId()));
|
||||
@ -55,9 +54,9 @@ public class Habitation {
|
||||
int spawnamt = locationhashes.get(hash);
|
||||
spawnamt+=1;
|
||||
locationhashes.put(hash,spawnamt);
|
||||
for (int x=-4;x<5;x++) {
|
||||
for (int z=-4;z<5;z++) {
|
||||
if (x!=0 && z!=0) {
|
||||
for (int x=-2;x<3;x++) {
|
||||
for (int z=-2;z<3;z++) {
|
||||
if (x!=0^z!=0) {
|
||||
addKillToLocation(l.getLocation().add(x*16,0,z*16));
|
||||
}
|
||||
}
|
||||
@ -67,7 +66,6 @@ public class Habitation {
|
||||
locationhashes.put(hash,1);
|
||||
}
|
||||
}
|
||||
|
||||
public void addKillToLocation(Location l) {
|
||||
String hash = getLocationHash(l);
|
||||
if (locationhashes.containsKey(hash)) {
|
||||
@ -80,30 +78,6 @@ public class Habitation {
|
||||
else {
|
||||
locationhashes.put(hash,1);
|
||||
}
|
||||
}*/
|
||||
|
||||
public void addKillToLocation(LivingEntity entityKilled) {
|
||||
for (int offsetMeters = 0; offsetMeters < 64; offsetMeters += 4) {
|
||||
// Attempt to add 1 habitat to a random chunk within offsetMeters of the death location
|
||||
// Guaranteed to add at least 1 kill to the chunk that the killed entity was in.
|
||||
addKillToLocation(getRandomLocationWithinCircle(
|
||||
// Use entity source location, or death location if not available
|
||||
startinglocs.getOrDefault(entityKilled.getUniqueId(), entityKilled.getLocation()),
|
||||
offsetMeters));
|
||||
}
|
||||
}
|
||||
|
||||
public void addKillToLocation(Location location) {
|
||||
String locationHash = getLocationHash(location);
|
||||
//TwosideKeeper.log("Location hash is "+locationHash, 0);
|
||||
locationhashes.put(locationHash, locationhashes.getOrDefault(locationHash, 0) + 1);
|
||||
}
|
||||
|
||||
private Location getRandomLocationWithinCircle(Location sourceLocation, double radiusMultiplier) {
|
||||
final double angle = 2 * Math.PI * ThreadLocalRandom.current().nextDouble();
|
||||
final double temp = ThreadLocalRandom.current().nextDouble() + ThreadLocalRandom.current().nextDouble();
|
||||
final double radius = temp > 1 ? radiusMultiplier * (2 - temp) : radiusMultiplier * temp;
|
||||
return sourceLocation.clone().add(radius * Math.cos(angle), 0, radius * Math.sin(angle));
|
||||
}
|
||||
|
||||
public void increaseHabitationLevels() {
|
||||
@ -131,13 +105,11 @@ public class Habitation {
|
||||
}
|
||||
}
|
||||
|
||||
public String getLocationHash(Location location) {
|
||||
if (location != null) {
|
||||
return location.getChunk().getX() + ' ' + String.valueOf((int)location.getY() / 16) + ' ' + location.getChunk().getZ() + ' ' + location.getWorld().getName();
|
||||
public String getLocationHash(Location l) {
|
||||
if (l!=null) {
|
||||
return (int)(l.getX()/16)+" "+(int)(l.getZ()/16);
|
||||
} else {
|
||||
TwosideKeeper.log(
|
||||
"[ERROR][Habitat]Could not get Location Hash!!! Probably undefined Player->Enemy hit interaction!",
|
||||
1);
|
||||
TwosideKeeper.log("[ERROR][Habitat]Could not get Location Hash!!! Probably undefined Player->Enemy hit interaction!", 1);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@ -161,9 +133,7 @@ public class Habitation {
|
||||
bw.write((String)locationhashes.keySet().toArray()[i]+","+locationhashes.get((String)locationhashes.keySet().toArray()[i]));
|
||||
bw.newLine();
|
||||
}
|
||||
if (locationhashes.keySet().toArray().length>0) {
|
||||
TwosideKeeper.log("[Habitat]Saved "+(locationhashes.keySet().toArray().length)+" habitat"+((locationhashes.keySet().toArray().length)!=1?"s":"")+" successfully.",2);
|
||||
}
|
||||
TwosideKeeper.log("[Habitat]Saved "+(locationhashes.keySet().toArray().length)+" habitats successfully.",2);
|
||||
bw.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@ -174,6 +144,7 @@ public class Habitation {
|
||||
public void loadLocationHashesFromConfig() {
|
||||
File file = new File(TwosideKeeper.plugin.getDataFolder()+"/locationhashes.data");
|
||||
|
||||
// if file doesnt exists, then create it
|
||||
if (file.exists()) {
|
||||
try(
|
||||
FileReader fw = new FileReader(TwosideKeeper.plugin.getDataFolder()+"/locationhashes.data");
|
||||
@ -200,6 +171,7 @@ public class Habitation {
|
||||
TwosideKeeper.log("[Habitat]Loaded "+lines+" habitats successfully.",2);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
//exception handling left as an exercise for the reader
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
//An Itemstack not bound by the limitation of 128 or more items in a stack.
|
||||
public class ItemContainer {
|
||||
ItemStack item;
|
||||
int amt;
|
||||
|
||||
public ItemContainer(ItemStack item) {
|
||||
this.item=item.clone();
|
||||
this.amt=this.item.getAmount();
|
||||
this.item.setAmount(1);
|
||||
}
|
||||
|
||||
public void setAmount(int amt) {
|
||||
this.amt = amt;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return this.amt;
|
||||
}
|
||||
|
||||
public ItemStack getItem() {
|
||||
return this.item;
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.inventory.Recipe;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class JobRecipe {
|
||||
String name = "";
|
||||
Recipe rec;
|
||||
|
||||
public JobRecipe(String name, Recipe rec) {
|
||||
this.name=name;
|
||||
this.rec=rec;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getCommandName() {
|
||||
return name.replaceAll(" ", "_");
|
||||
}
|
||||
|
||||
public Recipe getRecipe() {
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static void InitializeJobRecipes() {
|
||||
Map<String,Recipe> newrecipes = aPlugin.API.getAddedRecipes();
|
||||
for (String namer : newrecipes.keySet()) {
|
||||
TwosideKeeper.log("Added recipe: "+namer, 4);
|
||||
Recipe r = newrecipes.get(namer);
|
||||
TwosideKeeper.jobrecipes.add(new JobRecipe(namer,r));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||
|
||||
|
||||
|
||||
public class PVPValue {
|
||||
int points; //Number of points in this value.
|
||||
double baseval; //The base value of this ability.
|
||||
|
||||
public PVPValue(int points, double baseval) {
|
||||
this.points=points;
|
||||
this.baseval=baseval;
|
||||
}
|
||||
|
||||
public int getPointValue() {
|
||||
return points;
|
||||
}
|
||||
public double getBaseValue() {
|
||||
return baseval;
|
||||
}
|
||||
}
|
@ -28,26 +28,14 @@ public enum RecipeLinker {
|
||||
eic(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Ender Item Cube",new ItemStack[]{
|
||||
CustomItem.EnderItemCube(),
|
||||
new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),
|
||||
new ItemStack(Material.EMERALD),new ItemStack(Material.ENDER_CHEST),new ItemStack(Material.EMERALD),
|
||||
new ItemStack(Material.EMERALD),new ItemStack(Material.CHEST),new ItemStack(Material.EMERALD),
|
||||
new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),
|
||||
}),
|
||||
vacuumcube(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Vacuum Cube",new ItemStack[]{
|
||||
CustomItem.VacuumCube(),
|
||||
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.ELYTRA),new ItemStack(Material.DIAMOND_BLOCK),
|
||||
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.ENDER_CHEST),new ItemStack(Material.DIAMOND_BLOCK),
|
||||
new ItemStack(Material.ENDER_PEARL),new ItemStack(Material.REDSTONE_BLOCK),new ItemStack(Material.ENDER_PEARL)
|
||||
}),
|
||||
filtercube(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Filter Cube",new ItemStack[]{
|
||||
CustomItem.FilterCube(),
|
||||
new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),
|
||||
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.CHEST),new ItemStack(Material.DIAMOND_BLOCK),
|
||||
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.HOPPER),new ItemStack(Material.DIAMOND_BLOCK)
|
||||
}),
|
||||
dc(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Duplicate Ender Item Cube",new ItemStack[]{
|
||||
CustomItem.EnderItemCube(2),
|
||||
CustomItem.EnderItemCube(),new ItemStack(Material.NETHER_STAR)
|
||||
}),
|
||||
aq(RecipeCategory.CONTAINERS,ChatColor.RED,"Arrow Quiver",new ItemStack[]{
|
||||
aq(RecipeCategory.MISC_ITEMS,ChatColor.RED,"Arrow Quiver",new ItemStack[]{
|
||||
CustomItem.ArrowQuiver(),
|
||||
null,new ItemStack(Material.LEATHER),new ItemStack(Material.EMERALD_BLOCK),
|
||||
new ItemStack(Material.LEATHER),new ItemStack(Material.SPECTRAL_ARROW),new ItemStack(Material.LEATHER),
|
||||
@ -373,22 +361,6 @@ public enum RecipeLinker {
|
||||
Recipes.getArrowFromMeta("PIERCING_ARR"),
|
||||
new ItemStack(Material.REDSTONE,1),new ItemStack(Material.REDSTONE,1),new ItemStack(Material.REDSTONE,1),
|
||||
new ItemStack(Material.REDSTONE,1),Recipes.getArrowFromMeta("DOUBLE_DAMAGE_ARR"),
|
||||
}),
|
||||
worldshop(RecipeCategory.MISC_ITEMS,ChatColor.BLUE,"World Shop",new ItemStack[]{
|
||||
CustomItem.WorldShop(),
|
||||
new ItemStack(Material.CHEST,1),new ItemStack(Material.SIGN,1),null,
|
||||
CustomItem.DirtSubstitute(),
|
||||
}),
|
||||
worldshop2(RecipeCategory.MISC_ITEMS,ChatColor.BLUE,"World Shop [Trapped Chest]",new ItemStack[]{
|
||||
CustomItem.WorldShop2(),
|
||||
new ItemStack(Material.TRAPPED_CHEST,1),new ItemStack(Material.SIGN,1),null,
|
||||
CustomItem.DirtSubstitute(),
|
||||
}),
|
||||
baublepouch(RecipeCategory.CONTAINERS,ChatColor.YELLOW,"Bauble Pouch",new ItemStack[]{
|
||||
CustomItem.BaublePouch(),
|
||||
new ItemStack(Material.LEATHER),new ItemStack(Material.LEATHER),new ItemStack(Material.LEATHER),
|
||||
new ItemStack(Material.LEATHER),new ItemStack(Material.CHORUS_FLOWER),new ItemStack(Material.LEATHER),
|
||||
new ItemStack(Material.LEATHER),new ItemStack(Material.LEATHER),new ItemStack(Material.LEATHER),
|
||||
});
|
||||
|
||||
String name = "";
|
||||
|
@ -1,51 +1,5 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public enum CubeType {
|
||||
NORMAL(0,9),LARGE(1,27),ENDER(2,27),VACUUM(3,54),FILTER(4,27);
|
||||
|
||||
int id=0;
|
||||
int size=9;
|
||||
|
||||
private CubeType(int id, int size) {
|
||||
this.id=id;
|
||||
this.size=size;
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return this.size;
|
||||
}
|
||||
|
||||
public static CubeType getCubeTypeFromID(int id) {
|
||||
for (CubeType ct : CubeType.values()) {
|
||||
if (ct.getID()==id) {
|
||||
return ct;
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("INVALID CUBE ID SPECIFIED: "+id+". THIS SHOULD NOT BE HAPPENING!", 0);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getSlotsFromType(CubeType size) {
|
||||
switch (size) {
|
||||
case ENDER:
|
||||
return 27;
|
||||
case FILTER:
|
||||
return 27;
|
||||
case LARGE:
|
||||
return 27;
|
||||
case NORMAL:
|
||||
return 9;
|
||||
case VACUUM:
|
||||
return 54;
|
||||
default:
|
||||
return 27;
|
||||
}
|
||||
}
|
||||
|
||||
NORMAL,LARGE,ENDER
|
||||
}
|
||||
|
@ -24,9 +24,7 @@ import sig.plugin.TwosideKeeper.Artifact;
|
||||
import sig.plugin.TwosideKeeper.Recipes;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
|
||||
public class CustomItem {
|
||||
ItemStack item;
|
||||
@ -50,8 +48,6 @@ public class CustomItem {
|
||||
TwosideKeeper.LARGE_ITEM_CUBE_RECIPE = LargeItemCubeRecipe();
|
||||
TwosideKeeper.ENDER_ITEM_CUBE_RECIPE = EnderItemCubeRecipe();
|
||||
TwosideKeeper.DUPLICATE_ENDER_ITEM_CUBE_RECIPE = DuplicateEnderItemCubeRecipe();
|
||||
TwosideKeeper.VACUUM_CUBE_RECIPE = VacuumCubeRecipe();
|
||||
TwosideKeeper.FILTER_CUBE_RECIPE = FilterCubeRecipe();
|
||||
TwosideKeeper.ARROW_QUIVER_RECIPE = ArrowQuiverRecipe();
|
||||
TwosideKeeper.HARDENED_IRON_HELMET_RECIPE = HardenedRecipe(Material.IRON_HELMET,Material.IRON_BLOCK,"aaa","axa","xxx");
|
||||
TwosideKeeper.HARDENED_IRON_CHESTPLATE_RECIPE = HardenedRecipe(Material.IRON_CHESTPLATE,Material.IRON_BLOCK,"axa","aaa","aaa");
|
||||
@ -115,220 +111,6 @@ public class CustomItem {
|
||||
TwosideKeeper.EXPLODING_ARROW_RECIPE = ExplodingArrowRecipe();
|
||||
TwosideKeeper.POISON_ARROW_RECIPE = PoisonArrowRecipe();
|
||||
TwosideKeeper.PIERCING_ARROW_RECIPE = PiercingArrowRecipe();
|
||||
TwosideKeeper.WORLD_SHOP_RECIPE = WorldShopRecipe();
|
||||
TwosideKeeper.WORLD_SHOP2_RECIPE = WorldShop2Recipe();
|
||||
TwosideKeeper.BAUBLE_POUCH_RECIPE = BaublePouchRecipe();
|
||||
}
|
||||
|
||||
private static ShapelessRecipe BaublePouchRecipe() {
|
||||
ShapelessRecipe rec = new ShapelessRecipe(BaublePouch());
|
||||
rec.addIngredient(4, Material.LEATHER);
|
||||
rec.addIngredient(1, Material.CHORUS_FLOWER);
|
||||
rec.addIngredient(4, Material.LEATHER);
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static ItemStack DailyToken() {
|
||||
ItemStack token = new ItemStack(Material.COMMAND_CHAIN);
|
||||
ItemUtils.setDisplayName(token, ChatColor.GREEN+"Daily Challenge Token");
|
||||
ItemUtils.addLore(token, ChatColor.AQUA+"Allows you to participate in a daily");
|
||||
ItemUtils.addLore(token, ChatColor.AQUA+"challenge without waiting! Right-click");
|
||||
ItemUtils.addLore(token, ChatColor.AQUA+"a daily challenge sign with this token");
|
||||
ItemUtils.addLore(token, ChatColor.AQUA+"in hand to consume the token instead.");
|
||||
token.addUnsafeEnchantment(Enchantment.LUCK, 1);
|
||||
ItemUtils.hideEnchantments(token);
|
||||
return token.clone();
|
||||
}
|
||||
|
||||
public static ItemStack BattleToken() {
|
||||
ItemStack token = new ItemStack(Material.COMMAND);
|
||||
ItemUtils.setDisplayName(token, ChatColor.GRAY+"| "+ChatColor.DARK_RED+ChatColor.BOLD+"Battle Token"+ChatColor.RESET+ChatColor.GRAY+" |");
|
||||
ItemUtils.addLore(token, ChatColor.GOLD+"Given to the fiercest of warriors in");
|
||||
ItemUtils.addLore(token, ChatColor.GOLD+"the world. This token is a symbol of");
|
||||
ItemUtils.addLore(token, ChatColor.GOLD+"recognition and can be used to obtain");
|
||||
ItemUtils.addLore(token, ChatColor.GOLD+"special items exclusively from battling.");
|
||||
token.addUnsafeEnchantment(Enchantment.LUCK, 1);
|
||||
ItemUtils.hideEnchantments(token);
|
||||
return token.clone();
|
||||
}
|
||||
|
||||
public static boolean isBattleToken(ItemStack item) {
|
||||
if (ItemUtils.isValidLoreItem(item) &&
|
||||
item.containsEnchantment(Enchantment.LUCK) &&
|
||||
item.getType()==Material.COMMAND) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isDailyToken(ItemStack item) {
|
||||
if (ItemUtils.isValidLoreItem(item) &&
|
||||
item.containsEnchantment(Enchantment.LUCK) &&
|
||||
item.getType()==Material.COMMAND_CHAIN) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack BaublePouch() {
|
||||
ItemStack baublePouch = new ItemStack(Material.CHORUS_FLOWER);
|
||||
ItemUtils.addLore(baublePouch, ChatColor.AQUA+"A handy 9-slot pouch that");
|
||||
ItemUtils.addLore(baublePouch, ChatColor.AQUA+"can hold Baubles of any");
|
||||
ItemUtils.addLore(baublePouch, ChatColor.AQUA+"sort.");
|
||||
ItemUtils.addLore(baublePouch, ChatColor.AQUA+"");
|
||||
ItemUtils.addLore(baublePouch, BaublePouch.POUCHID_LINE+"0");
|
||||
ItemUtils.setDisplayName(baublePouch, ChatColor.GREEN+"Bauble Pouch");
|
||||
baublePouch.addUnsafeEnchantment(Enchantment.LUCK, 1);
|
||||
ItemUtils.hideEnchantments(baublePouch);
|
||||
return baublePouch.clone();
|
||||
}
|
||||
|
||||
public static ItemStack VacuumCube() {
|
||||
ItemStack item_VacuumCube = new ItemStack(Material.ENDER_CHEST);
|
||||
List<String> item_VacuumCube_lore = new ArrayList<String>();
|
||||
item_VacuumCube_lore.add("A storage container that sucks");
|
||||
item_VacuumCube_lore.add("up blocks. Holds 54 block stacks.");
|
||||
item_VacuumCube_lore.add(ChatColor.GRAY+"Block Collection: "+ChatColor.GREEN+"ON");
|
||||
ItemMeta item_ItemCube_meta=item_VacuumCube.getItemMeta();
|
||||
item_ItemCube_meta.setLore(item_VacuumCube_lore);
|
||||
item_ItemCube_meta.setDisplayName(ChatColor.BLUE+""+ChatColor.BOLD+"Vacuum Cube");
|
||||
item_VacuumCube.setItemMeta(item_ItemCube_meta);
|
||||
return item_VacuumCube.clone();
|
||||
}
|
||||
|
||||
public static ItemStack IronMaterialKit() {
|
||||
ItemStack kit = new ItemStack(Material.IRON_BLOCK);
|
||||
ItemUtils.setDisplayName(kit, ChatColor.translateAlternateColorCodes('§', "§7§lIron Material Kit"));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7Converts an item's base material"));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7to §rIron§7 and hardens it."));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', ""));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§eIncreases Breaks Remaining."));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', ""));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7Right-click an item on a pedestal to use."));
|
||||
kit.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
|
||||
ItemUtils.addFlag(kit, ItemFlag.HIDE_ENCHANTS);
|
||||
return kit.clone();
|
||||
}
|
||||
|
||||
public static ItemStack DiamondMaterialKit() {
|
||||
ItemStack kit = new ItemStack(Material.DIAMOND_BLOCK);
|
||||
ItemUtils.setDisplayName(kit, ChatColor.translateAlternateColorCodes('§', "§b§lDiamond Material Kit"));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7Converts an item's base material"));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7to §bDiamond§7."));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', ""));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§aApplies Unbreaking and Mending."));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', ""));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7Right-click an item on a pedestal to use."));
|
||||
kit.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
|
||||
ItemUtils.addFlag(kit, ItemFlag.HIDE_ENCHANTS);
|
||||
return kit.clone();
|
||||
}
|
||||
|
||||
public static ItemStack GoldMaterialKit() {
|
||||
ItemStack kit = new ItemStack(Material.GOLD_BLOCK);
|
||||
ItemUtils.setDisplayName(kit, ChatColor.translateAlternateColorCodes('§', "§e§lGold Material Kit"));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7Converts an item's base material"));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7to §eGold§7."));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', ""));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§cMay degrade the item."));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', ""));
|
||||
ItemUtils.addLore(kit, ChatColor.translateAlternateColorCodes('§', "§7Right-click an item on a pedestal to use."));
|
||||
kit.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
|
||||
ItemUtils.addFlag(kit, ItemFlag.HIDE_ENCHANTS);
|
||||
return kit.clone();
|
||||
}
|
||||
|
||||
private static ShapelessRecipe VacuumCubeRecipe() {
|
||||
ItemStack item_VacuumCube = VacuumCube();
|
||||
|
||||
ShapelessRecipe ItemCube = new ShapelessRecipe(item_VacuumCube);
|
||||
ItemCube.addIngredient(Material.ENDER_CHEST);
|
||||
ItemCube.addIngredient(Material.ENDER_PEARL);
|
||||
ItemCube.addIngredient(Material.ENDER_PEARL);
|
||||
ItemCube.addIngredient(Material.ELYTRA);
|
||||
ItemCube.addIngredient(4,Material.DIAMOND_BLOCK);
|
||||
ItemCube.addIngredient(Material.REDSTONE_BLOCK);
|
||||
return ItemCube;
|
||||
}
|
||||
|
||||
private static ShapelessRecipe FilterCubeRecipe() {
|
||||
ItemStack item_FilterCube = FilterCube();
|
||||
|
||||
ShapelessRecipe FilterCube = new ShapelessRecipe(item_FilterCube);
|
||||
FilterCube.addIngredient(Material.CHEST);
|
||||
FilterCube.addIngredient(Material.HOPPER);
|
||||
FilterCube.addIngredient(4,Material.DIAMOND_BLOCK);
|
||||
FilterCube.addIngredient(3,Material.IRON_BLOCK);
|
||||
return FilterCube;
|
||||
}
|
||||
|
||||
public static ItemStack FilterCube() {
|
||||
ItemStack item_FilterCube = new ItemStack(Material.HOPPER_MINECART);
|
||||
List<String> item_FilterCube_lore = new ArrayList<String>();
|
||||
item_FilterCube_lore.add("A storage container that holds up");
|
||||
item_FilterCube_lore.add("to 27 items. Shift-Right click to");
|
||||
item_FilterCube_lore.add("open up a filtered item list.");
|
||||
ItemMeta item_FilterCube_meta=item_FilterCube.getItemMeta();
|
||||
item_FilterCube_meta.setLore(item_FilterCube_lore);
|
||||
item_FilterCube_meta.setDisplayName(ChatColor.GREEN+""+ChatColor.BOLD+"Filter Cube");
|
||||
item_FilterCube.setItemMeta(item_FilterCube_meta);
|
||||
return item_FilterCube.clone();
|
||||
}
|
||||
|
||||
private static ShapelessRecipe WorldShopRecipe() {
|
||||
ItemStack item_worldShop = WorldShop();
|
||||
|
||||
ShapelessRecipe recipe_Worldshop = new ShapelessRecipe(item_worldShop);
|
||||
recipe_Worldshop.addIngredient(Material.CHEST);
|
||||
recipe_Worldshop.addIngredient(Material.SIGN);
|
||||
recipe_Worldshop.addIngredient(Material.DIRT);
|
||||
return recipe_Worldshop;
|
||||
}
|
||||
|
||||
private static ShapelessRecipe WorldShop2Recipe() {
|
||||
ItemStack item_worldShop = WorldShop2();
|
||||
|
||||
ShapelessRecipe recipe_Worldshop = new ShapelessRecipe(item_worldShop);
|
||||
recipe_Worldshop.addIngredient(Material.TRAPPED_CHEST);
|
||||
recipe_Worldshop.addIngredient(Material.SIGN);
|
||||
recipe_Worldshop.addIngredient(Material.DIRT);
|
||||
return recipe_Worldshop;
|
||||
}
|
||||
|
||||
public static ItemStack DirtSubstitute() {
|
||||
ItemStack dirtSub = new ItemStack(Material.DIRT);
|
||||
ItemUtils.addLore(dirtSub, "You can substitute the dirt block");
|
||||
ItemUtils.addLore(dirtSub, "with any block to create any type");
|
||||
ItemUtils.addLore(dirtSub, "of World Shop!");
|
||||
return dirtSub;
|
||||
}
|
||||
|
||||
public static ItemStack WorldShop() {
|
||||
ItemStack worldShop = new ItemStack(Material.CHEST);
|
||||
List<String> worldShopLore = new ArrayList<String>();
|
||||
worldShopLore.add("You can substitute the dirt block");
|
||||
worldShopLore.add("with any block to create any type");
|
||||
worldShopLore.add("of World Shop!");
|
||||
ItemMeta item_ItemCube_meta=worldShop.getItemMeta();
|
||||
item_ItemCube_meta.setLore(worldShopLore);
|
||||
item_ItemCube_meta.setDisplayName("Placeable World Shop");
|
||||
worldShop.setItemMeta(item_ItemCube_meta);
|
||||
return worldShop.clone();
|
||||
}
|
||||
|
||||
public static ItemStack WorldShop2() {
|
||||
ItemStack worldShop = new ItemStack(Material.TRAPPED_CHEST);
|
||||
List<String> worldShopLore = new ArrayList<String>();
|
||||
worldShopLore.add("You can substitute the dirt block");
|
||||
worldShopLore.add("with any block to create any type");
|
||||
worldShopLore.add("of World Shop!");
|
||||
ItemMeta item_ItemCube_meta=worldShop.getItemMeta();
|
||||
item_ItemCube_meta.setLore(worldShopLore);
|
||||
item_ItemCube_meta.setDisplayName("Placeable World Shop");
|
||||
worldShop.setItemMeta(item_ItemCube_meta);
|
||||
return worldShop.clone();
|
||||
}
|
||||
|
||||
private static ShapelessRecipe PiercingArrowRecipe() {
|
||||
@ -586,6 +368,7 @@ public class CustomItem {
|
||||
ArrowQuiver.setIngredient('l', Material.LEATHER);
|
||||
ArrowQuiver.setIngredient('e', Material.EMERALD_BLOCK);
|
||||
|
||||
|
||||
return ArrowQuiver;
|
||||
}
|
||||
|
||||
@ -690,18 +473,4 @@ public class CustomItem {
|
||||
return item_ItemCube.clone();
|
||||
}
|
||||
|
||||
public static boolean isVacuumCube(ItemStack item) {
|
||||
if (ItemUtils.isValidLoreItem(item) && ItemUtils.LoreContains(item, "A storage container that sucks")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isFilterCube(ItemStack item) {
|
||||
if (ItemUtils.isValidLoreItem(item) && ItemUtils.LoreContains(item, "open up a filtered item list.")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,55 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArmorStandProperties;
|
||||
|
||||
public class CustomModel {
|
||||
List<ArmorStandProperties> modelParts = new ArrayList<ArmorStandProperties>();
|
||||
List<ArmorStand> stands = new ArrayList<ArmorStand>();
|
||||
|
||||
public CustomModel(Location loc, ArmorStandProperties...modelParts) {
|
||||
for (ArmorStandProperties asp : modelParts) {
|
||||
this.modelParts.add(asp);
|
||||
this.stands.add(setupArmorStand(loc, asp));
|
||||
}
|
||||
}
|
||||
|
||||
private ArmorStand setupArmorStand(Location loc, ArmorStandProperties asp) {
|
||||
ArmorStand stand = (ArmorStand)loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND);
|
||||
stand.setArms(asp.isArms());
|
||||
stand.setBasePlate(asp.isBaseplate());
|
||||
stand.setBodyPose(asp.getBodyPose());
|
||||
stand.setBoots(asp.getBoots());
|
||||
stand.setChestplate(asp.getChestplate());
|
||||
stand.setHeadPose(asp.getHeadPose());
|
||||
stand.setHelmet(asp.getHelmet());
|
||||
stand.setItemInHand(asp.getHand());
|
||||
stand.setLeftArmPose(asp.getLeftArmPose());
|
||||
stand.setLeftLegPose(asp.getLeftLegPose());
|
||||
stand.setLeggings(asp.getLeggings());
|
||||
stand.setMarker(asp.isMarker());
|
||||
stand.setRightArmPose(asp.getRightArmPose());
|
||||
stand.setRightLegPose(asp.getRightLegPose());
|
||||
stand.setSmall(asp.isSmall());
|
||||
stand.setVisible(asp.isVisible());
|
||||
stand.setCustomNameVisible(asp.isCustomNameVisible());
|
||||
stand.setCustomName(asp.getCustomName());
|
||||
stand.teleport(loc.add(asp.getOffset()));
|
||||
return stand;
|
||||
}
|
||||
|
||||
public void displayModel(Location loc) {
|
||||
for (int i=0;i<stands.size();i++) {
|
||||
if (stands.get(i)!=null && stands.get(i).isValid()) {
|
||||
stands.get(i).teleport(loc.add(modelParts.get(i).getOffset()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -87,11 +87,11 @@ public enum CustomRecipe {
|
||||
ItemStack newitem = null;
|
||||
ItemStack netherstar = null;
|
||||
for (int i=1;i<10;i++) {
|
||||
if ((ev.getInventory().getItem(i)!=null &&
|
||||
if (ev.getInventory().getItem(i)!=null &&
|
||||
ev.getInventory().getItem(i).getType()!=Material.AIR &&
|
||||
(ev.getInventory().getItem(i).getType()==Material.ENDER_CHEST)) && !CustomItem.isVacuumCube(ev.getInventory().getItem(i))) {
|
||||
(ev.getInventory().getItem(i).getType()==Material.ENDER_CHEST)) {
|
||||
ItemMeta inventory_itemMeta1=ev.getInventory().getItem(i).getItemMeta();
|
||||
if (inventory_itemMeta1.hasLore() && inventory_itemMeta1.getLore().size()>=4) {
|
||||
if (inventory_itemMeta1.hasLore() && inventory_itemMeta1.getLore().size()==4) {
|
||||
String loreitem = inventory_itemMeta1.getLore().get(3);
|
||||
if (loreitem!=null && loreitem.contains(ChatColor.DARK_PURPLE+"ID#")) {
|
||||
//log("This is an Item Cube. Invalidate recipe.",4);
|
||||
|
@ -1,46 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.AreaEffectCloud;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
import org.bukkit.entity.EnderSignal;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.EntityUtils;
|
||||
|
||||
public class DamageLabel{
|
||||
ArmorStand aec;
|
||||
double spd;
|
||||
int duration;
|
||||
|
||||
public DamageLabel(ArmorStand aec, double spd, int duration) {
|
||||
this.aec=aec;
|
||||
this.spd=spd;
|
||||
this.duration=duration;
|
||||
}
|
||||
|
||||
public boolean run() {
|
||||
if (aec.isValid()) {
|
||||
duration--;
|
||||
/*if (duration>0) {
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, new CloudRunnableRemoveLabel(aec.getLocation().add(0,spd,0).clone(),aec.getCustomName(),spd,duration), 1);
|
||||
}*/
|
||||
aec.teleport(aec.getLocation().add(0,spd,0));
|
||||
if (duration<0) {
|
||||
aec.remove();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
aec.remove();
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
|
||||
public class DamageStructure {
|
||||
double damage;
|
||||
Entity damager;
|
||||
LivingEntity target;
|
||||
ItemStack weapon;
|
||||
String reason;
|
||||
int flags;
|
||||
|
||||
public DamageStructure(double damage, Entity damager, LivingEntity target, ItemStack weapon, String reason, int flags) {
|
||||
this.damage=damage;
|
||||
this.damager=damager;
|
||||
this.target=target;
|
||||
this.weapon=weapon;
|
||||
this.reason=reason;
|
||||
this.flags=flags;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
CustomDamage.ApplyDamage(damage, damager, target, weapon, reason, flags);
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.MixedDamage;
|
||||
|
||||
public class DarkSlash extends WindSlash{
|
||||
|
||||
final static int EFFECT_DENSITY = 10;
|
||||
final static Particle EFFECT_PARTICLE = Particle.ENCHANTMENT_TABLE;
|
||||
final static float SPEED_MULT = 2.5f;
|
||||
|
||||
public DarkSlash(Location loc, LivingEntity l, MixedDamage dmg, int tick_duration) {
|
||||
super(loc, l, dmg, tick_duration);
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
if (!moveWindSlash()) {
|
||||
return false;
|
||||
}
|
||||
createParticles();
|
||||
damageNearbyTargets();
|
||||
if (TwosideKeeper.getServerTickTime()>death_time) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void createParticles() {
|
||||
//loc.getWorld().spawnParticle(Particle.END_ROD, loc.clone().add(0,-SLASH_SIZE/2,0), 4);
|
||||
for (int i=0;i<EFFECT_DENSITY;i++) {
|
||||
Location randloc = loc.clone();
|
||||
loc.getWorld().spawnParticle(EFFECT_PARTICLE, randloc.add(randloc.getDirection().setY(randloc.getDirection().getY()*2).multiply(Math.random())).clone().add(0,-SLASH_SIZE/2,0), 1);
|
||||
}
|
||||
//loc.getWorld().playEffect(loc.clone().add(0,-SLASH_SIZE/2,0), Effect.DRAGON_BREATH, 4);
|
||||
//loc.getWorld().playEffect(loc.clone().add(0,-SLASH_SIZE/2,0), Effect.COLOURED_DUST, 20);
|
||||
|
||||
Location baseloc = loc.clone();
|
||||
|
||||
final int density=100;
|
||||
final int height=30;
|
||||
|
||||
for (int j=0;j<density;j++) {
|
||||
for (int i=0;i<height;i++) {
|
||||
ColoredParticle.RED_DUST.send(baseloc.clone().add(0,-SLASH_SIZE/2,0).add(0,(2d/height)*i,0)
|
||||
, 20, 0, 0, 255);
|
||||
}
|
||||
baseloc.add(baseloc.getDirection().multiply(SPEED_MULT/density));
|
||||
}
|
||||
}
|
||||
|
||||
private void damageNearbyTargets() {
|
||||
//GenericFunctions.DealDamageToNearbyMobs(loc, dmg, SLASH_SIZE, false, 0, sourcep, sourcep.getEquipment().getItemInMainHand(), false, "Dark Slash");
|
||||
GenericFunctions.DealDamageToNearbyPlayers(loc, dmg.getDmgComponent(), SLASH_SIZE, false, true, 0, l, "Dark Slash", false, false);
|
||||
if (dmg.getTruePctDmgComponent()>0) {GenericFunctions.DealDamageToNearbyPlayers(loc, dmg.getTruePctDmgComponent(), SLASH_SIZE, false, true, 0, l, "Dark Slash", false, true);}
|
||||
if (dmg.getTrueDmgComponent()>0) {GenericFunctions.DealDamageToNearbyPlayers(loc, dmg.getTrueDmgComponent(), SLASH_SIZE, false, true, 0, l, "Dark Slash", true, false);}
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PVP;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class EarthWaveTask implements Runnable{
|
||||
Location centerpoint;
|
||||
int radius;
|
||||
double vel;
|
||||
double dmg;
|
||||
Player damager;
|
||||
|
||||
public EarthWaveTask(Location center, int radius, double vel, double dmg, Player damager) {
|
||||
this.centerpoint=center;
|
||||
this.radius=radius;
|
||||
this.vel=vel;
|
||||
this.dmg=dmg;
|
||||
this.damager=damager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!damager.isDead()) {
|
||||
for (int x=-radius;x<=radius;x++) { //Start at the top y.
|
||||
Block b = centerpoint.getBlock().getRelative(x, 0, -radius);
|
||||
if (GenericFunctions.isSoftBlock(b) && b.getRelative(0, 1, 0).getType()==Material.AIR && !PVP.isPvPing(damager)) {
|
||||
FallingBlock fb = centerpoint.getWorld().spawnFallingBlock(b.getLocation().add(0,0,0), b.getType(), b.getData());
|
||||
fb.setVelocity(new Vector(0,vel,0));
|
||||
b.setType(Material.AIR);
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg*2, 2, true, vel/1.5d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
} else {
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 0.1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg, 2, true, vel/4d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
}
|
||||
}
|
||||
for (int x=-radius;x<=radius;x++) { //Start at the top y.
|
||||
Block b = centerpoint.getBlock().getRelative(x, 0, radius);
|
||||
if (GenericFunctions.isSoftBlock(b) && b.getRelative(0, 1, 0).getType()==Material.AIR && !PVP.isPvPing(damager)) {
|
||||
FallingBlock fb = centerpoint.getWorld().spawnFallingBlock(b.getLocation().add(0,0,0), b.getType(), b.getData());
|
||||
fb.setVelocity(new Vector(0,vel,0));
|
||||
b.setType(Material.AIR);
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg*2, 2, true, vel/1.5d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
} else {
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 0.1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg, 2, true, vel/4d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
}
|
||||
}
|
||||
for (int y=-radius+1;y<radius;y++) { //Start at the top y.
|
||||
Block b = centerpoint.getBlock().getRelative(radius, 0, y);
|
||||
if (GenericFunctions.isSoftBlock(b) && b.getRelative(0, 1, 0).getType()==Material.AIR && !PVP.isPvPing(damager)) {
|
||||
FallingBlock fb = centerpoint.getWorld().spawnFallingBlock(b.getLocation().add(0,0,0), b.getType(), b.getData());
|
||||
fb.setVelocity(new Vector(0,vel,0));
|
||||
b.setType(Material.AIR);
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg*2, 2, true, vel/1.5d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
} else {
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 0.1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg, 2, true, vel/4d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
}
|
||||
}
|
||||
for (int y=-radius+1;y<radius;y++) { //Start at the top y.
|
||||
Block b = centerpoint.getBlock().getRelative(-radius, 0, y);
|
||||
if (GenericFunctions.isSoftBlock(b) && b.getRelative(0, 1, 0).getType()==Material.AIR && !PVP.isPvPing(damager)) {
|
||||
FallingBlock fb = centerpoint.getWorld().spawnFallingBlock(b.getLocation().add(0,0,0), b.getType(), b.getData());
|
||||
fb.setVelocity(new Vector(0,vel,0));
|
||||
b.setType(Material.AIR);
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg*2, 2, true, vel/1.5d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
} else {
|
||||
aPlugin.API.sendSoundlessExplosion(b.getLocation().add(0,1,0), 0.1f);
|
||||
GenericFunctions.DealDamageToNearbyMobs(b.getLocation(), dmg, 2, true, vel/4d, damager, damager.getEquipment().getItemInMainHand(), false, "Earth Wave");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle;
|
||||
|
||||
public class EffectPool {
|
||||
double radius = 1;
|
||||
Color col = null;
|
||||
Location loc = null;
|
||||
long expireTime=0;
|
||||
final int PARTICLE_DENSITY = 5;
|
||||
public EffectPool(Location loc, double radius, int duration, Color col) {
|
||||
this.loc=loc.clone();
|
||||
this.radius=radius;
|
||||
this.col=col;
|
||||
this.expireTime=TwosideKeeper.getServerTickTime()+duration;
|
||||
TwosideKeeper.effectpools.add(this);
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
int density = (int)Math.pow(PARTICLE_DENSITY, radius);
|
||||
for (int i=0;i<density;i++) {
|
||||
Location particleloc = loc.clone().add(
|
||||
(Math.random()*(radius+1))-radius,
|
||||
0.66,
|
||||
(Math.random()*(radius+1))-radius
|
||||
);
|
||||
ColoredParticle.RED_DUST.send(particleloc, 50, col.getRed(), col.getGreen(), col.getBlue());
|
||||
}
|
||||
return !(expireTime<=TwosideKeeper.getServerTickTime());
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ParticleEffect;
|
||||
|
||||
public class HighlightCircle {
|
||||
final Particle PARTICLE = Particle.BLOCK_DUST;
|
||||
final int PARTICLE_DENSITY = 16;
|
||||
final int ANGLE_OFFSET = 10;
|
||||
Location center = null;
|
||||
double r = 0;
|
||||
double h = 0;
|
||||
long expireTime = 0;
|
||||
|
||||
/**
|
||||
* Creates a cylinder zone that will be outline by particles.
|
||||
* @param l The centered location of the zone.
|
||||
* @param radius The radius of the zone.
|
||||
* @param height The height of the zone.
|
||||
* @param duration The amount of time in ticks the zone will exist.
|
||||
*/
|
||||
public HighlightCircle(Location l, double radius, double height, int duration) {
|
||||
this.center=l.clone();
|
||||
this.r=radius;
|
||||
this.h=height;
|
||||
this.expireTime=TwosideKeeper.getServerTickTime()+duration;
|
||||
TwosideKeeper.circles.add(this);
|
||||
}
|
||||
|
||||
public Location getCenter() {
|
||||
return center;
|
||||
}
|
||||
|
||||
public double getRadius() {
|
||||
return r;
|
||||
}
|
||||
|
||||
public double getHeight() {
|
||||
return h;
|
||||
}
|
||||
|
||||
public boolean hasExpired() {
|
||||
return expireTime<TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
for (int j=0;j<h;j++) {
|
||||
for (int i=0;i<PARTICLE_DENSITY;i++) {
|
||||
double angle = ((1d/PARTICLE_DENSITY)*360d)*i+(ANGLE_OFFSET*j);
|
||||
double xamt = Math.sin(Math.toRadians(angle))*r;
|
||||
double zamt = Math.cos(Math.toRadians(angle))*r;
|
||||
Location particleloc = center.clone().add(new Location(center.getWorld(),
|
||||
xamt,
|
||||
j,
|
||||
zamt)
|
||||
);
|
||||
//TwosideKeeper.log("Location: "+particleloc, 0);
|
||||
ParticleEffect.CRIT.display(new Vector(0,0,0), 0f, particleloc, 50);
|
||||
}
|
||||
}
|
||||
return !hasExpired();
|
||||
}
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.inventivetalent.glow.GlowAPI;
|
||||
|
||||
import net.minecraft.server.v1_9_R1.EnumParticle;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.aPluginAPIWrapper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class LavaPlume {
|
||||
FallingBlock fb;
|
||||
int lavayreached;
|
||||
int delaytimer;
|
||||
Location lavaplumeloc;
|
||||
List<TemporaryLava> lavablocks;
|
||||
boolean negativevel=false;
|
||||
boolean state1=true,state2=true,state3=true,state4=true;
|
||||
/**
|
||||
*
|
||||
* @param delay Delay in ticks.
|
||||
*/
|
||||
public LavaPlume(int delay, Location loc) {
|
||||
//this.fb=fb;
|
||||
this.lavablocks=new ArrayList<TemporaryLava>();
|
||||
//this.lavayreached=fb.getLocation().getBlockY();
|
||||
this.delaytimer=(int)((delay/20d)*4);
|
||||
this.lavaplumeloc = loc.clone().add(0,1,0);
|
||||
}
|
||||
/*
|
||||
* Returns false if this block is invalid.
|
||||
*/
|
||||
public boolean runTick() {
|
||||
if (this.delaytimer>=0) {
|
||||
this.delaytimer--;
|
||||
if (this.delaytimer!=0) {
|
||||
aPluginAPIWrapper.sendParticle(this.lavaplumeloc.clone().add(0,Math.random()*5,0), EnumParticle.DRIP_LAVA, (float)Math.random(),(float)Math.random(),(float)Math.random(), (float)Math.random(), 10);
|
||||
} else {
|
||||
FallingBlock fallblock = this.lavaplumeloc.clone().getWorld().spawnFallingBlock(this.lavaplumeloc.clone().add(0,1,0), Material.REDSTONE_BLOCK, (byte)0);
|
||||
fallblock.setMetadata("DESTROY", new FixedMetadataValue(TwosideKeeper.plugin,true));
|
||||
fallblock.setVelocity(new Vector(0,(float)((Math.random()*2)+1),0));
|
||||
fallblock.setDropItem(false);
|
||||
for (Player pl : Bukkit.getOnlinePlayers()) {
|
||||
GlowAPI.setGlowing(fallblock, GlowAPI.Color.YELLOW, pl);
|
||||
}
|
||||
this.fb = fallblock;
|
||||
this.lavayreached = this.lavaplumeloc.getBlockY();
|
||||
return RunLavaTick();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return RunLavaTick();
|
||||
}
|
||||
}
|
||||
private boolean RunLavaTick() {
|
||||
for (TemporaryLava tl : lavablocks) {
|
||||
if (!tl.runTick()) {
|
||||
TwosideKeeper.ScheduleRemoval(lavablocks, tl);
|
||||
}
|
||||
}
|
||||
if (fb==null || !fb.isValid()) {
|
||||
//Load up the chunk and see if we can remove it.
|
||||
if (this.lavablocks.size()>0) {
|
||||
return true;
|
||||
} else {
|
||||
//Cleared for official deleting.
|
||||
if (!fb.isValid()) {
|
||||
fb.remove();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (fb.getLocation().getY()>lavayreached) {
|
||||
int tickdelay=0;
|
||||
for (int y=lavayreached;y<fb.getLocation().getY();y++) {
|
||||
//Set the 4 blocks around it to lava.
|
||||
List<Block> blocklist = new ArrayList<Block>();
|
||||
int rely = (int)(y-fb.getLocation().getY());
|
||||
if (state1 && !UpdateLavaBlock(fb.getLocation().add(1,rely,0).getBlock(),tickdelay)) {state1=false;}
|
||||
if (state2 && !UpdateLavaBlock(fb.getLocation().add(-1,rely,0).getBlock(),tickdelay)) {state2=false;}
|
||||
if (state3 && !UpdateLavaBlock(fb.getLocation().add(0,rely,1).getBlock(),tickdelay)) {state3=false;}
|
||||
if (state4 && !UpdateLavaBlock(fb.getLocation().add(0,rely,-1).getBlock(),tickdelay)) {state4=false;}
|
||||
tickdelay++;
|
||||
}
|
||||
lavayreached=(int)fb.getLocation().getY();
|
||||
} else
|
||||
if (fb.getVelocity().getY()<0) {
|
||||
fb.remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean UpdateLavaBlock(Block lavamod,int tickdelay) {
|
||||
if (lavamod.getType()==Material.AIR || lavamod.getType()==Material.LAVA) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, ()->{
|
||||
if (lavamod.getType()==Material.AIR) {
|
||||
lavamod.setType(Material.LAVA);
|
||||
lavamod.setData((byte)8);
|
||||
//TwosideKeeper.blockqueue.add(new BlockModifyQueue(lavamod,Material.AIR,(byte)0,Material.LAVA,(byte)8));
|
||||
}
|
||||
},tickdelay);
|
||||
this.lavablocks.add(new TemporaryLava(lavamod,(int)(3*fb.getVelocity().getY())+6));
|
||||
if (Math.random()<=0.1) {
|
||||
SoundUtils.playGlobalSound(lavamod.getLocation(), Sound.ENTITY_BLAZE_SHOOT, 0.6f, 0.6f);
|
||||
SmallFireball sf = (SmallFireball)fb.getWorld().spawnEntity(lavamod.getLocation(), EntityType.SMALL_FIREBALL);
|
||||
sf.setDirection(new Vector(Math.random()-0.5,-Math.random()*0.5,Math.random()-0.5));
|
||||
sf.setVelocity(new Vector(Math.random()-0.5,-Math.random()*0.5,Math.random()-0.5));
|
||||
}
|
||||
SoundUtils.playGlobalSound(fb.getLocation(), Sound.BLOCK_LAVA_POP, 1.0f, 1.0f);
|
||||
return true;
|
||||
} else {
|
||||
//TwosideKeeper.log("Triggered for type "+lavamod.getType(), 0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Cleanup() {
|
||||
//Delete the falling block associated with itself.
|
||||
if (fb!=null) {
|
||||
fb.remove();
|
||||
}
|
||||
//Delete all Temporary Lava associated with this lava plume.
|
||||
for (TemporaryLava tl : lavablocks) {
|
||||
tl.Cleanup();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class ReplaceBlockTask implements Runnable{
|
||||
String str;
|
||||
|
||||
public ReplaceBlockTask(String str) {
|
||||
this.str=str;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (TwosideKeeper.temporaryblocks.containsKey(str)) {
|
||||
TemporaryBlock tb = TwosideKeeper.temporaryblocks.get(str);
|
||||
CleanupTemporaryBlock(tb);
|
||||
TwosideKeeper.temporaryblocks.remove(TemporaryBlock.getLocationKey(tb));
|
||||
TwosideKeeper.temporaryblocks.remove(TemporaryBlock.getLocationKey(tb, false));
|
||||
}
|
||||
}
|
||||
|
||||
public static void CleanupTemporaryBlock(TemporaryBlock tb) {
|
||||
if (tb.getBlock()!=null /*&&
|
||||
tb.getBlock().getType()==tb.getConvertedMaterial() &&
|
||||
tb.getBlock().getData()==tb.getConvertedData()*/) {
|
||||
tb.getBlock().setType(tb.getOriginalMaterial());
|
||||
tb.getBlock().setData(tb.getOriginalData());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,260 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.APIUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
public class TemporaryBlock {
|
||||
Material origmat;
|
||||
Material convertedmat;
|
||||
byte origdata;
|
||||
byte converteddata;
|
||||
int duration;
|
||||
String specialKey;
|
||||
Block bl;
|
||||
|
||||
public Material getOriginalMaterial() {
|
||||
return origmat;
|
||||
}
|
||||
|
||||
public Material getConvertedMaterial() {
|
||||
return convertedmat;
|
||||
}
|
||||
|
||||
public byte getOriginalData() {
|
||||
return origdata;
|
||||
}
|
||||
|
||||
public byte getConvertedData() {
|
||||
return converteddata;
|
||||
}
|
||||
|
||||
public String getSpecialKey() {
|
||||
return specialKey;
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return bl;
|
||||
}
|
||||
|
||||
public TemporaryBlock(Block b, Material convertedmat, int duration) {
|
||||
this.origmat = b.getType();
|
||||
this.convertedmat = convertedmat;
|
||||
this.origdata = b.getData();
|
||||
this.converteddata = b.getData();
|
||||
this.duration = duration;
|
||||
this.specialKey = "";
|
||||
this.bl=b;
|
||||
Block tempblock = getBlockToModify(b);
|
||||
if (tempblock!=null) {
|
||||
modifyBlock(this.bl);
|
||||
}
|
||||
setupStructureAndScheduler();
|
||||
}
|
||||
|
||||
public TemporaryBlock(Block b, Material convertedmat, byte converteddata, int duration) {
|
||||
this.origmat = b.getType();
|
||||
this.convertedmat = convertedmat;
|
||||
this.origdata = b.getData();
|
||||
this.converteddata = converteddata;
|
||||
this.duration = duration;
|
||||
this.specialKey = "";
|
||||
this.bl=b;
|
||||
Block tempblock = getBlockToModify(b);
|
||||
if (tempblock!=null) {
|
||||
this.bl = tempblock;
|
||||
modifyBlock(this.bl);
|
||||
}
|
||||
setupStructureAndScheduler();
|
||||
}
|
||||
|
||||
public TemporaryBlock(Block b, Material convertedmat, byte converteddata, int duration, String specialKey) {
|
||||
this.origmat = b.getType();
|
||||
this.convertedmat = convertedmat;
|
||||
this.origdata = b.getData();
|
||||
this.converteddata = converteddata;
|
||||
this.duration = duration;
|
||||
this.specialKey = specialKey;
|
||||
this.bl=b;
|
||||
Block tempblock = getBlockToModify(b);
|
||||
if (tempblock!=null) {
|
||||
this.bl = tempblock;
|
||||
modifyBlock(this.bl);
|
||||
}
|
||||
setupStructureAndScheduler();
|
||||
}
|
||||
|
||||
private void modifyBlock(Block b) {
|
||||
if (b!=null && !APIUtils.isExplosionProof(b)) {
|
||||
b.setType(convertedmat);
|
||||
b.setData(converteddata);
|
||||
}
|
||||
}
|
||||
|
||||
private void setupStructureAndScheduler() {
|
||||
if (bl!=null) {
|
||||
if (!TwosideKeeper.temporaryblocks.containsKey(getLocationKey(bl))) {
|
||||
AddToTemporaryBlockStructure(this);
|
||||
}
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,
|
||||
new ReplaceBlockTask(getLocationKey(this)),
|
||||
duration);
|
||||
//TwosideKeeper.log(TextUtils.outputHashmap(TwosideKeeper.temporaryblocks),0);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddToTemporaryBlockStructure(TemporaryBlock tb) {
|
||||
if (tb.getSpecialKey().length()>0) {
|
||||
TwosideKeeper.temporaryblocks.put(getLocationKey(tb), tb);
|
||||
}
|
||||
TwosideKeeper.temporaryblocks.put(getLocationKey(tb,false), tb);
|
||||
}
|
||||
|
||||
private static String getLocationKey(Block bl) {
|
||||
return getLocationKey(bl, "");
|
||||
}
|
||||
|
||||
public static String getLocationKey(TemporaryBlock tb) {
|
||||
return tb.getLocationKey(tb.getBlock(), tb.getSpecialKey());
|
||||
}
|
||||
|
||||
public static String getLocationKey(TemporaryBlock tb, boolean includeSpecialKey) {
|
||||
return tb.getLocationKey(tb.getBlock(), (includeSpecialKey)?tb.getSpecialKey():"");
|
||||
}
|
||||
|
||||
private static String getLocationKey(Block bl, String specialKey) {
|
||||
if (bl!=null) {
|
||||
StringBuilder sb = new StringBuilder(Integer.toString(bl.getLocation().getBlockX()));
|
||||
sb.append("_");
|
||||
sb.append(Integer.toString(bl.getLocation().getBlockY()));
|
||||
sb.append("_");
|
||||
sb.append(Integer.toString(bl.getLocation().getBlockZ()));
|
||||
sb.append("_");
|
||||
sb.append(bl.getLocation().getWorld().getName());
|
||||
sb.append("_");
|
||||
sb.append(specialKey);
|
||||
//TwosideKeeper.log("Checking key: "+sb.toString(), 0);
|
||||
return sb.toString();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private Block getBlockToModify(Block b) {
|
||||
//Attempt to detect areas above and below ground to place this modified block.
|
||||
int yoffset = 0;
|
||||
while (yoffset<=5) {
|
||||
Block checkblock = b.getRelative(0, yoffset, 0);
|
||||
Block checkblock2 = b.getRelative(0, yoffset+1, 0);
|
||||
if (checkblock!=null && checkblock2!=null) {
|
||||
if ((checkblock.getType()==Material.AIR || checkblock.isLiquid() || checkblock.getType().isTransparent())) {
|
||||
yoffset = adjustYOffset(yoffset);
|
||||
//TwosideKeeper.log(Integer.toString(yoffset), 0);
|
||||
} else {
|
||||
if ((checkblock2.getType()==Material.AIR || checkblock2.isLiquid())) {
|
||||
this.origmat = checkblock.getType();
|
||||
this.origdata = checkblock.getData();
|
||||
return b.getRelative(0, yoffset, 0);
|
||||
} else {
|
||||
yoffset = adjustYOffset(yoffset);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
yoffset = adjustYOffset(yoffset);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private int adjustYOffset(int yoffset) {
|
||||
yoffset=(yoffset>-5 && yoffset<=0)?(yoffset-1):(yoffset<0)?1:(yoffset+1);
|
||||
return yoffset;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("TemporaryBlock{");
|
||||
sb.append("orig:(");sb.append(origmat);sb.append(",");sb.append(origdata);sb.append(")");
|
||||
sb.append(",");
|
||||
sb.append("converted:(");sb.append(convertedmat);sb.append(",");sb.append(converteddata);sb.append(")");
|
||||
sb.append(",");
|
||||
sb.append("duration:");sb.append(duration);
|
||||
sb.append(",");
|
||||
sb.append("key:");sb.append(specialKey);
|
||||
sb.append(",");
|
||||
sb.append("block:");sb.append(bl);
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static boolean isTemporaryBlock(Block b) {
|
||||
return TwosideKeeper.temporaryblocks.containsKey(TemporaryBlock.getLocationKey(b));
|
||||
}
|
||||
public static boolean isStandingOnSpecialBlock(Location l, String specialKey) {
|
||||
//return TwosideKeeper.temporaryblocks.containsKey(TemporaryBlock.getLocationKey(b));
|
||||
Block b = l.getBlock().getRelative(0, -1, 0);
|
||||
//TwosideKeeper.log(b.toString(), 0);
|
||||
if (b!=null) {
|
||||
return TwosideKeeper.temporaryblocks.containsKey(TemporaryBlock.getLocationKey(b,specialKey));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static boolean isInRangeOfSpecialBlock(Location l, double range, String specialKey) {
|
||||
Block b = l.getBlock();
|
||||
//TwosideKeeper.log(b.toString(), 0);
|
||||
while (range-->0 && b.getLocation().getBlockY()>0) {
|
||||
if (TwosideKeeper.temporaryblocks.containsKey(TemporaryBlock.getLocationKey(b,specialKey))) {
|
||||
return true;
|
||||
} else {
|
||||
b = b.getRelative(0, -1, 0);
|
||||
//TwosideKeeper.log(b.toString(), 0);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static TemporaryBlock getTemporaryBlock(Block b) {
|
||||
if (TwosideKeeper.temporaryblocks.containsKey(TemporaryBlock.getLocationKey(b))) {
|
||||
return TwosideKeeper.temporaryblocks.get(TemporaryBlock.getLocationKey(b));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void createTemporaryBlockCircle(Location center, int radius, Material convertedmat, byte converteddata, int duration, String specialKey) {
|
||||
int width=0;
|
||||
for (int i=-radius;i<=radius;i++) {
|
||||
Location offset = center.clone().add(0,0,i);
|
||||
for (int j=-width;j<=width;j++) {
|
||||
Block b = offset.getBlock().getRelative(j, 0, 0);
|
||||
new TemporaryBlock(b, convertedmat, converteddata, duration, specialKey);
|
||||
}
|
||||
if (i<0) {
|
||||
width++;
|
||||
} else {
|
||||
width--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void createTemporaryBlockCircle(Location center, int radius, Material convertedmat, int duration, String specialKey) {
|
||||
int width=0;
|
||||
for (int i=-radius;i<=radius;i++) {
|
||||
Location offset = center.clone().add(0,0,i);
|
||||
for (int j=-width;j<=width;j++) {
|
||||
Block b = offset.getBlock().getRelative(j, 0, 0);
|
||||
new TemporaryBlock(b, convertedmat, duration);
|
||||
}
|
||||
if (i<0) {
|
||||
width++;
|
||||
} else {
|
||||
width--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.Buff;
|
||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class TemporaryBlockNode {
|
||||
Location l;
|
||||
double range;
|
||||
int duration;
|
||||
String specialKey;
|
||||
Particle effect;
|
||||
int particleDensity; //Number of particles per second.
|
||||
long lastAppliedEffect=TwosideKeeper.getServerTickTime();
|
||||
|
||||
public TemporaryBlockNode(Location l, double range, int duration, String key) {
|
||||
this.l=l;
|
||||
this.range=range;
|
||||
this.specialKey=key;
|
||||
this.duration=duration;
|
||||
this.effect=null;
|
||||
this.particleDensity=0;
|
||||
TwosideKeeper.blocknodes.add(this);
|
||||
}
|
||||
|
||||
public TemporaryBlockNode(Location l, double range, int duration, String key, Particle effect, int density) {
|
||||
this.l=l;
|
||||
this.range=range;
|
||||
this.specialKey=key;
|
||||
this.duration=duration;
|
||||
this.effect=effect;
|
||||
this.particleDensity=density;
|
||||
TwosideKeeper.blocknodes.add(this);
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
playParticleEffects();
|
||||
affectEntitiesBasedOnKey();
|
||||
duration-=5;
|
||||
if (duration<0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void affectEntitiesBasedOnKey() {
|
||||
switch (specialKey) {
|
||||
case "TESTNODE":{
|
||||
for (Entity e : getNonPlayersOnNode()) {
|
||||
if (e instanceof LivingEntity) {
|
||||
CustomDamage.ApplyDamage(1, null, (LivingEntity)e, null, "Test Damage");
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case "FIREPOOL":{
|
||||
if (lastAppliedEffect+20<TwosideKeeper.getServerTickTime()) {
|
||||
lastAppliedEffect = TwosideKeeper.getServerTickTime();
|
||||
for (Entity e : getNonPlayersOnNode()) {
|
||||
if (e instanceof LivingEntity) {
|
||||
Buff.addBuff((LivingEntity)e, "BURN", new Buff("Burn",100,1,Color.ORANGE,ChatColor.GOLD+"❂",false),true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
private void playParticleEffects() {
|
||||
if (effect!=null) {
|
||||
for (int i=0;i<particleDensity/4;i++) {
|
||||
SpawnParticleInRandomLocation();
|
||||
}
|
||||
if (Math.random()<=(particleDensity%20)*0.05) {
|
||||
SpawnParticleInRandomLocation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SpawnParticleInRandomLocation() {
|
||||
l.getWorld().spawnParticle(effect, new Location(l.getWorld(),l.getX()+Math.random()*range-(Math.random()*(range*2))
|
||||
,l.getY()+Math.random()*range-(Math.random()*(range*2))
|
||||
,l.getZ()+Math.random()*range-(Math.random()*(range*2))), 2);
|
||||
}
|
||||
|
||||
public Entity[] getEntitiesOnNode() {
|
||||
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
|
||||
return ents.toArray(new Entity[ents.size()]);
|
||||
}
|
||||
|
||||
public List<Entity> getPlayersOnNode() {
|
||||
long time = System.nanoTime();
|
||||
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
|
||||
List<Entity> list = new ArrayList<Entity>();
|
||||
for (Entity e : ents) {
|
||||
if (e instanceof Player) {
|
||||
list.add(e);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Calculation time via nearby entities: "+(System.nanoTime()-time), TwosideKeeper.TIMINGS_DEBUG);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Entity> getNonPlayersOnNode() {
|
||||
long time = System.nanoTime();
|
||||
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
|
||||
List<Entity> list = new ArrayList<Entity>();
|
||||
for (Entity e : ents) {
|
||||
if (!(e instanceof Player)) {
|
||||
list.add(e);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Calculation time via nearby entities: "+(System.nanoTime()-time), TwosideKeeper.TIMINGS_DEBUG);
|
||||
return list;
|
||||
}
|
||||
@Deprecated
|
||||
public List<Entity> getPlayersOnNodeViaDistanceSearch() {
|
||||
long time = System.nanoTime();
|
||||
List<Entity> list = new ArrayList<Entity>();
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (p.getLocation().distance(l)<=range) {
|
||||
list.add(p);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Calculation time via distance search: "+(System.nanoTime()-time), TwosideKeeper.TIMINGS_DEBUG);
|
||||
return list;
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.minecraft.server.v1_9_R1.EnumParticle;
|
||||
import sig.plugin.TwosideKeeper.aPluginAPIWrapper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class TemporaryIce {
|
||||
int lifetime=0;
|
||||
Entity trappedEntity = null;
|
||||
Block b;
|
||||
|
||||
public TemporaryIce(int life, Block b, Entity trappedent) {
|
||||
this.lifetime=life;
|
||||
this.trappedEntity = trappedent;
|
||||
this.b=b;
|
||||
if (this.trappedEntity instanceof LivingEntity) {
|
||||
LivingEntity le = (LivingEntity)this.trappedEntity;
|
||||
le.setVelocity(new Vector(0,0,0));
|
||||
}
|
||||
if (b.getType()==Material.AIR) {
|
||||
b.setType(Material.PACKED_ICE);
|
||||
}
|
||||
}
|
||||
|
||||
public TemporaryIce(int life, Block b) {
|
||||
this.lifetime=life;
|
||||
this.trappedEntity = null;
|
||||
this.b=b;
|
||||
if (b.getType()==Material.AIR) {
|
||||
b.setType(Material.PACKED_ICE);
|
||||
}
|
||||
}
|
||||
|
||||
public int getLifetime() {
|
||||
return lifetime;
|
||||
}
|
||||
|
||||
public Entity getTrappedEntity() {
|
||||
return trappedEntity;
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return b;
|
||||
}
|
||||
|
||||
public boolean run() {
|
||||
lifetime--;
|
||||
if (b.getType()==Material.PACKED_ICE) {
|
||||
aPluginAPIWrapper.sendParticle(b.getLocation(), EnumParticle.FIREWORKS_SPARK, 0, 1, 0, 1.2f, 3);
|
||||
if (lifetime>10) {
|
||||
aPlugin.API.sendBlockBreakPacket(b, 2);
|
||||
} else
|
||||
if (lifetime>5) {
|
||||
aPlugin.API.sendBlockBreakPacket(b, 4);
|
||||
} else
|
||||
if (lifetime>0) {
|
||||
aPlugin.API.sendBlockBreakPacket(b, 6);
|
||||
}
|
||||
}
|
||||
if (lifetime<=0) {
|
||||
Cleanup();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Cleanup() {
|
||||
if (b.getType()==Material.PACKED_ICE) {
|
||||
b.setType(Material.AIR);
|
||||
SoundUtils.playGlobalSound(b.getLocation(), Sound.BLOCK_GLASS_BREAK, 1.0f, 0.8f);
|
||||
}
|
||||
if (trappedEntity!=null && trappedEntity.isValid()) {
|
||||
if (trappedEntity instanceof LivingEntity) {
|
||||
LivingEntity le = (LivingEntity)trappedEntity;
|
||||
le.setAI(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
||||
|
||||
public class TemporaryLava {
|
||||
Block b;
|
||||
int ttl; //Time-to-Live. When this expires it dies.
|
||||
public TemporaryLava(Block b, int timer) {
|
||||
this.b=b;
|
||||
this.ttl=timer;
|
||||
}
|
||||
public TemporaryLava(Block b, int timer, boolean convert) {
|
||||
if (convert) {
|
||||
if (b.getType()==Material.AIR) {
|
||||
b.setType(Material.LAVA);
|
||||
b.setData((byte)8);
|
||||
//TwosideKeeper.blockqueue.add(new BlockModifyQueue(b,Material.AIR,Material.LAVA));
|
||||
}
|
||||
}
|
||||
this.b=b;
|
||||
this.ttl=timer;
|
||||
}
|
||||
public boolean runTick() {
|
||||
this.ttl--;
|
||||
if (this.ttl<=0) {
|
||||
ResetBlock();
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
private void ResetBlock() {
|
||||
if (b.getType()==Material.LAVA || b.getType()==Material.STATIONARY_LAVA) {
|
||||
TwosideKeeper.blockqueue.add(new BlockModifyQueue(b,b.getType(),Material.AIR));
|
||||
}
|
||||
}
|
||||
public void Cleanup() {
|
||||
ResetBlock();
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class TemporarySnow {
|
||||
Block b;
|
||||
int lifetime;
|
||||
public TemporarySnow(Block b,int lifetime) {
|
||||
this.b=b;
|
||||
this.lifetime=lifetime;
|
||||
}
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Effects;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.BlockUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.MixedDamage;
|
||||
|
||||
public class WindSlash {
|
||||
Location loc;
|
||||
Player sourcep;
|
||||
LivingEntity l;
|
||||
MixedDamage dmg;
|
||||
long lasteffect;
|
||||
long death_time;
|
||||
final static int EFFECT_DENSITY = 20;
|
||||
final static int EFFECT_FREQUENCY = 4;
|
||||
final static int SLASH_SIZE = 3; //Radius.
|
||||
final static Particle EFFECT_PARTICLE = Particle.FIREWORKS_SPARK;
|
||||
final static float SPEED_MULT = 3.5f;
|
||||
|
||||
public WindSlash(Location loc, Player p, double dmg, int tick_duration) {
|
||||
this.loc=loc.clone().add(0,p.getEyeHeight(),0);
|
||||
this.sourcep=p;
|
||||
this.dmg=MixedDamage.v(dmg);
|
||||
this.death_time = TwosideKeeper.getServerTickTime()+tick_duration;
|
||||
this.lasteffect=TwosideKeeper.getServerTickTime();
|
||||
SoundUtils.playGlobalSound(loc,Sound.BLOCK_PORTAL_TRIGGER, 0.2f, 2.0f);
|
||||
}
|
||||
|
||||
public WindSlash(Location loc, LivingEntity l, MixedDamage dmg, int tick_duration) {
|
||||
this.loc=loc.clone().add(0,l.getEyeHeight(),0);
|
||||
this.l=l;
|
||||
this.dmg=dmg;
|
||||
this.death_time = TwosideKeeper.getServerTickTime()+tick_duration;
|
||||
this.lasteffect=TwosideKeeper.getServerTickTime();
|
||||
SoundUtils.playGlobalSound(loc,Sound.BLOCK_PORTAL_TRIGGER, 0.2f, 2.0f);
|
||||
}
|
||||
|
||||
public boolean runTick() {
|
||||
if (!moveWindSlash()) {
|
||||
return false;
|
||||
}
|
||||
createParticles();
|
||||
damageNearbyTargets();
|
||||
if (TwosideKeeper.getServerTickTime()>death_time) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void damageNearbyTargets() {
|
||||
GenericFunctions.DealDamageToNearbyMobs(loc, dmg.getDmgComponent(), SLASH_SIZE, false, 0, sourcep, sourcep.getEquipment().getItemInMainHand(), false, "Wind Slash");
|
||||
}
|
||||
|
||||
protected boolean moveWindSlash() {
|
||||
Location origloc = loc.clone();
|
||||
Vector move = origloc.getDirection().setY(origloc.getDirection().getY()/1.4).multiply(SPEED_MULT);
|
||||
float dist = SPEED_MULT;
|
||||
loc.add(move);
|
||||
SoundUtils.playGlobalSound(loc, Sound.ENTITY_PLAYER_ATTACK_NODAMAGE, 0.4f, 1.0f);
|
||||
while (dist-->0) {
|
||||
if (!BlockUtils.isPassThrough(origloc.add(origloc.getDirection()))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
//TwosideKeeper.log("New Location: "+loc, 0);
|
||||
}
|
||||
|
||||
protected void createParticles() {
|
||||
loc.getWorld().spawnParticle(Particle.SWEEP_ATTACK, loc.clone().add(0,-SLASH_SIZE/2,0), 2);
|
||||
for (int i=0;i<EFFECT_DENSITY;i++) {
|
||||
Location randloc = loc.clone();
|
||||
loc.getWorld().spawnParticle(EFFECT_PARTICLE, randloc.add(randloc.getDirection().setY(randloc.getDirection().getY()/1.4).multiply(Math.random())).clone().add(0,-SLASH_SIZE/2,0), 1);
|
||||
}
|
||||
}
|
||||
}
|
@ -25,10 +25,10 @@ public class EliteMonsterLocationFinder implements Runnable{
|
||||
public void run() {
|
||||
TwosideKeeper.ELITE_LOCATION = GenericFunctions.defineNewEliteLocation();
|
||||
if (TwosideKeeper.ELITE_LOCATION==null) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new EliteMonsterLocationFinder(p,name), 2l);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new EliteMonsterLocationFinder(p,name), 20l);
|
||||
if (p!=null) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if ((pd.lastcompassnotification+(20*20))<TwosideKeeper.getServerTickTime()) {
|
||||
if ((pd.lastcompassnotification+(20*10))<TwosideKeeper.getServerTickTime()) {
|
||||
pd.lastcompassnotification=TwosideKeeper.getServerTickTime();
|
||||
p.sendMessage("The "+name+ChatColor.WHITE+" is still searching...");
|
||||
} else {
|
||||
@ -42,7 +42,7 @@ public class EliteMonsterLocationFinder implements Runnable{
|
||||
p.setCompassTarget(TwosideKeeper.ELITE_LOCATION);
|
||||
}
|
||||
Monster m = (Monster)TwosideKeeper.ELITE_LOCATION.getWorld().spawnEntity(TwosideKeeper.ELITE_LOCATION, EntityType.ZOMBIE);
|
||||
MonsterController.convertLivingEntity(m, LivingEntityDifficulty.ELITE);
|
||||
MonsterController.convertMonster(m, MonsterDifficulty.ELITE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,63 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Hopper;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
||||
|
||||
public class FilterCubeItem {
|
||||
public static void populateFilterCubeItemList(Player p) {
|
||||
HashMap<Material, List<Integer>> structure = GrabFilterCubeStructure(p);
|
||||
structure.clear();
|
||||
|
||||
for (ItemStack item : p.getInventory().getContents()) {
|
||||
if (item!=null && CustomItem.isFilterCube(item)) {
|
||||
Hopper h = ItemCubeUtils.getFilterCubeHopper(ItemCubeUtils.getItemCubeID(item));
|
||||
for (ItemStack it : h.getInventory()) {
|
||||
if (it!=null) {
|
||||
int id = ItemCubeUtils.getItemCubeID(item);
|
||||
if (structure.containsKey(it.getType())) {
|
||||
List<Integer> filterCubes = structure.get(it.getType());
|
||||
filterCubes.add(id);
|
||||
} else {
|
||||
List<Integer> filterCubeList = new ArrayList<Integer>();
|
||||
filterCubeList.add(id);
|
||||
structure.put(it.getType(), filterCubeList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TwosideKeeper.log("New Map: \n"+TextUtils.outputHashmap(structure), 0);
|
||||
}
|
||||
|
||||
public static HashMap<Material, List<Integer>> GrabFilterCubeStructure(Player p) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
HashMap<Material,List<Integer>> structure = pd.filtercubestructure;
|
||||
return structure;
|
||||
}
|
||||
|
||||
public static boolean ItemHasFilterCube(ItemStack item, Player p) {
|
||||
HashMap<Material, List<Integer>> structure = GrabFilterCubeStructure(p);
|
||||
return structure.containsKey(item.getType());
|
||||
}
|
||||
|
||||
public static List<Integer> getFilterCubeIDsToInsertItem(ItemStack item, Player p) {
|
||||
HashMap<Material, List<Integer>> structure = GrabFilterCubeStructure(p);
|
||||
if (structure.containsKey(item.getType())) {
|
||||
return structure.get(item.getType());
|
||||
} else {
|
||||
return new ArrayList<Integer>();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +1,11 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.InventoryUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemCubeUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class ItemCube {
|
||||
public static boolean isSomeoneViewingItemCube(int id, Player checker) {
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
@ -31,9 +23,8 @@ public class ItemCube {
|
||||
}
|
||||
public static Inventory getViewingItemCubeInventory(int id, Player checker) {
|
||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||
if (checker==null || !p.equals(checker)) {
|
||||
if (!p.equals(checker)) {
|
||||
if (p.getOpenInventory()!=null && p.getOpenInventory().getTitle().contains("Item Cube #"+id)) {
|
||||
//TwosideKeeper.log("Updating inventory for player "+p.getName()+"; Inventory "+p.getOpenInventory().getTitle(), 0);
|
||||
//This is an item cube. Check if it's the same number.
|
||||
return p.getOpenInventory().getTopInventory();
|
||||
}
|
||||
@ -42,43 +33,14 @@ public class ItemCube {
|
||||
return null; //Didn't find anything.
|
||||
}
|
||||
public static void displayErrorMessage(Player p) {
|
||||
SoundUtils.playLocalSound(p, Sound.BLOCK_NOTE_PLING, 0.6f, 4.0f);
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_PLING, 0.6f, 4.0f);
|
||||
p.sendMessage("Someone is currently using this Item Cube! Please wait for them to finish.");
|
||||
}
|
||||
|
||||
public static void addToViewersOfItemCube(int idnumb, ItemStack cursor, Player check) {
|
||||
Inventory inv = getViewingItemCubeInventory(idnumb, check);
|
||||
if (inv!=null && cursor!=null) {
|
||||
//TwosideKeeper.log("Adding items "+cursor+" to Inventory "+inv.getTitle(), 0);
|
||||
if (inv!=null) {
|
||||
inv.addItem(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addToViewersOfItemCube(int idnumb, ItemStack[] cursor, Player check) {
|
||||
Inventory inv = getViewingItemCubeInventory(idnumb, check);
|
||||
cursor = InventoryUtils.RemoveAllNullItems(cursor);
|
||||
if (inv!=null) {
|
||||
//TwosideKeeper.log("Adding items "+Arrays.toString(cursor)+" to Inventory "+inv.getTitle(), 0);
|
||||
inv.addItem(cursor);
|
||||
}
|
||||
}
|
||||
public static void removeFromViewersofItemCube(int idnumb, ItemStack cursor, Player check) {
|
||||
Inventory inv = getViewingItemCubeInventory(idnumb, check);
|
||||
if (inv!=null && cursor!=null) {
|
||||
inv.removeItem(cursor);
|
||||
}
|
||||
}
|
||||
public static void removeFromViewersofItemCube(int idnumb, ItemStack[] cursor, Player check) {
|
||||
Inventory inv = getViewingItemCubeInventory(idnumb, check);
|
||||
cursor = InventoryUtils.RemoveAllNullItems(cursor);
|
||||
if (inv!=null) {
|
||||
inv.removeItem(cursor);
|
||||
}
|
||||
}
|
||||
public static void clearFromViewersofItemCube(int id, Player check) {
|
||||
Inventory inv = getViewingItemCubeInventory(id, check);
|
||||
if (inv!=null) {
|
||||
inv.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,170 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PVP;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.Events.InventoryUpdateEvent;
|
||||
import sig.plugin.TwosideKeeper.Events.InventoryUpdateEvent.UpdateReason;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.InventoryUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
||||
|
||||
public class ItemPickupStructure {
|
||||
PlayerPickupItemEvent ev;
|
||||
|
||||
public ItemPickupStructure(PlayerPickupItemEvent itemEvent) {
|
||||
this.ev=itemEvent;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
//Arrow quiver code goes here.
|
||||
//TwosideKeeper.log("["+TwosideKeeper.getServerTickTime()+"] PlayerPickupItemEvent fired w/ "+ev.getItem().getItemStack(), 1);
|
||||
if (ev.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
Player p = ev.getPlayer();
|
||||
if (PVP.isPvPing(p)) {
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
//log("Item Right now: "+ev.getItem().getItemStack(),0);
|
||||
long time = System.nanoTime();
|
||||
long totaltime = System.nanoTime();
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||
InventoryUpdateEvent.TriggerUpdateInventoryEvent(p,ev.getItem().getItemStack(),UpdateReason.PICKEDUPITEM);
|
||||
}, 1);
|
||||
ItemStack newstack = InventoryUtils.AttemptToFillPartialSlotsFirst(p,ev.getItem().getItemStack());
|
||||
TwosideKeeper.PickupLogger.AddEntry("Fill Partial Slots First", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
//TwosideKeeper.log(" New Stack is: "+newstack,0);
|
||||
if (newstack==null || newstack.getType()==Material.AIR) {
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
TwosideKeeper.PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
if (ev.getRemaining()>0) {
|
||||
Item it = ev.getItem();
|
||||
it.getItemStack().setAmount(ev.getRemaining());
|
||||
//GenericFunctions.giveItem(p, it.getItemStack());
|
||||
GenericFunctions.dropItem(it.getItemStack(), p.getLocation());
|
||||
}
|
||||
ev.getItem().remove();ev.setCancelled(true);return;}
|
||||
TwosideKeeper.PickupLogger.AddEntry("Pickup Item when it's null", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
ev.getItem().setItemStack(newstack);
|
||||
//log("Pickup Metadata: "+ev.getItem().getItemStack().getItemMeta().toString(),0);
|
||||
//GenericFunctions.updateSetItems(p.getInventory());
|
||||
GenericFunctions.UpdateItemLore(ev.getItem().getItemStack());
|
||||
TwosideKeeper.PickupLogger.AddEntry("Update Item Lore", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
/*//LEGACY CODE
|
||||
if (!ev.isCancelled()) {
|
||||
if (ev.getItem().getItemStack().getType()==Material.ARROW &&
|
||||
playerHasArrowQuiver(p)) {
|
||||
int arrowquiver_slot = playerGetArrowQuiver(p);
|
||||
playerInsertArrowQuiver(p, arrowquiver_slot, ev.getItem().getItemStack().getAmount());
|
||||
log("Added "+ev.getItem().getItemStack().getAmount()+" arrow"+((ev.getItem().getItemStack().getAmount()==1)?"":"s")+" to quiver in slot "+arrowquiver_slot+". New amount: "+playerGetArrowQuiverAmt(p,arrowquiver_slot),4);
|
||||
//If we added it here, we destroy the item stack.
|
||||
p.sendMessage(ChatColor.DARK_GRAY+""+ev.getItem().getItemStack().getAmount()+" arrow"+((ev.getItem().getItemStack().getAmount()==1)?"":"s")+" "+((ev.getItem().getItemStack().getAmount()==1)?"was":"were")+" added to your arrow quiver. Arrow Count: "+ChatColor.GRAY+playerGetArrowQuiverAmt(p,arrowquiver_slot));
|
||||
ev.getPlayer().playSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, 1.0f);
|
||||
ev.getItem().remove();
|
||||
ev.setCancelled(true);
|
||||
}
|
||||
}*/
|
||||
|
||||
TwosideKeeper.HandlePickupAchievements(ev.getPlayer(), ev.getItem().getItemStack());
|
||||
TwosideKeeper.PickupLogger.AddEntry("Pickup Achievements", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
|
||||
boolean handled = TwosideKeeper.AutoEquipItem(ev.getItem().getItemStack(), p);
|
||||
TwosideKeeper.PickupLogger.AddEntry("Auto Equip Item Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
if (handled) {
|
||||
TwosideKeeper.PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
ev.setCancelled(handled);
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (AutoConsumeItem(p,ev.getItem().getItemStack())) {
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_GENERIC_EAT, 1.0f, 1.0f);
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}*/
|
||||
TwosideKeeper.PickupLogger.AddEntry("Auto Consume Item Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
|
||||
if (ev.getItem().hasMetadata("INFINITEARROW")) { //Not allowed to be picked up, this was an infinite arrow.
|
||||
TwosideKeeper.log("INFINITE PICKUP", 5);
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
TwosideKeeper.PickupLogger.AddEntry("Infinite Arrow Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
|
||||
if (GenericFunctions.isValidArrow(ev.getItem().getItemStack()) && ArrowQuiver.getArrowQuiverInPlayerInventory(p)!=null) {
|
||||
ev.setCancelled(true);
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
TwosideKeeper.PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
TwosideKeeper.AddToPlayerInventory(ev.getItem().getItemStack(), p);
|
||||
return;
|
||||
}
|
||||
TwosideKeeper.PickupLogger.AddEntry("Valid Arrow check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
|
||||
/**
|
||||
* MUST BE HANDLED AFTER EVERYTHING ELSE.
|
||||
*/
|
||||
|
||||
//TwosideKeeper.log("(1)Item is "+ev.getItem().getItemStack(), 0);
|
||||
if (InventoryUtils.isCarryingFilterCube(p)) {
|
||||
//Try to insert it into the Filter cube.
|
||||
//TwosideKeeper.log("(2)Item is "+ev.getItem().getItemStack(), 0);
|
||||
ItemStack[] remaining = InventoryUtils.insertItemsInFilterCube(p, ev.getItem().getItemStack());
|
||||
//TwosideKeeper.log("(3)Item is "+ev.getItem().getItemStack(), 0);
|
||||
if (remaining.length==0) {
|
||||
ev.setCancelled(true);
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
TwosideKeeper.PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
return;
|
||||
} else {
|
||||
ev.getItem().setItemStack(remaining[0]);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.PickupLogger.AddEntry("Filter Cube Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
|
||||
//TwosideKeeper.log("(1)Item is "+ev.getItem().getItemStack(), 0);
|
||||
if (ev.getItem().getItemStack().getType().isBlock() && InventoryUtils.isCarryingVacuumCube(p)) {
|
||||
//Try to insert it into the Vacuum cube.
|
||||
ItemStack[] remaining = InventoryUtils.insertItemsInVacuumCube(p, ev.getItem().getItemStack());
|
||||
if (remaining.length==0) {
|
||||
ev.setCancelled(true);
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
TwosideKeeper.PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
return;
|
||||
} else {
|
||||
ev.getItem().setItemStack(remaining[0]);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.PickupLogger.AddEntry("Vacuum Cube Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
|
||||
//ItemCubeUtils.pickupAndAddItemCubeToGraph(ev.getItem().getItemStack(), p);
|
||||
|
||||
ev.setCancelled(true);
|
||||
ItemStack givenitem = ev.getItem().getItemStack().clone();
|
||||
GenericFunctions.giveItem(p, givenitem);
|
||||
if (ev.getRemaining()>0) {
|
||||
givenitem.setAmount(ev.getRemaining());
|
||||
GenericFunctions.giveItem(p, givenitem);
|
||||
}
|
||||
TwosideKeeper.PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
ItemSet.updateItemSets(ev.getPlayer());
|
||||
TwosideKeeper.PickupLogger.AddEntry("Update Item Sets", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
return;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,37 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public enum ItemSlot {
|
||||
MAINHAND,
|
||||
OFFHAND;
|
||||
|
||||
public ItemStack getItem(Player p) {
|
||||
switch (this) {
|
||||
case MAINHAND:
|
||||
return p.getEquipment().getItemInMainHand();
|
||||
case OFFHAND:
|
||||
return p.getEquipment().getItemInOffHand();
|
||||
default:
|
||||
TwosideKeeper.log("WARNING! Could not find proper enum for this item slot! Slot: "+this, 0);
|
||||
return p.getEquipment().getItemInMainHand();
|
||||
}
|
||||
}
|
||||
|
||||
public void setItem(Player p, ItemStack item) {
|
||||
switch (this) {
|
||||
case MAINHAND:
|
||||
p.getEquipment().setItemInMainHand(item);
|
||||
break;
|
||||
case OFFHAND:
|
||||
p.getEquipment().setItemInOffHand(item);
|
||||
break;
|
||||
default:
|
||||
TwosideKeeper.log("WARNING! Could not find proper enum for this item slot! Slot: "+this, 0);
|
||||
p.getEquipment().setItemInMainHand(item);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures.Items;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Scepter {
|
||||
ItemStack item;
|
||||
|
||||
public Scepter(ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
public static boolean isScepter(ItemStack item) {
|
||||
return item.getType()==Material.BONE && (item.hasItemMeta() &&
|
||||
item.getItemMeta().hasLore() &&
|
||||
item.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE+"Summoner Gear"));
|
||||
}
|
||||
}
|
@ -1,415 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import aPlugin.API.Chests;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import sig.plugin.TwosideKeeper.Artifact;
|
||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
import sig.plugin.TwosideKeeper.MonsterController;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HolidayEvents.Christmas;
|
||||
|
||||
public enum LivingEntityDifficulty {
|
||||
NORMAL(0,""),
|
||||
DANGEROUS(500,ChatColor.DARK_AQUA+"Dangerous"),
|
||||
DEADLY(1000,ChatColor.GOLD+"Deadly"),
|
||||
HELLFIRE(5000,ChatColor.DARK_RED+"Hellfire"),
|
||||
ELITE(10000,ChatColor.DARK_PURPLE+"Elite"),
|
||||
END(6000,ChatColor.DARK_BLUE+""+ChatColor.MAGIC+"End"),
|
||||
T1_MINIBOSS(9000,ChatColor.GOLD+""+ChatColor.BOLD+"T1"+ChatColor.RESET),
|
||||
T2_MINIBOSS(9010,ChatColor.GOLD+""+ChatColor.BOLD+"T2"+ChatColor.RESET),
|
||||
T3_MINIBOSS(9020,ChatColor.GOLD+""+ChatColor.BOLD+"T3"+ChatColor.RESET);
|
||||
|
||||
int rating;
|
||||
String difficultyString;
|
||||
|
||||
LivingEntityDifficulty(int rating,String diffString) {
|
||||
this.rating=rating;
|
||||
this.difficultyString=diffString;
|
||||
}
|
||||
|
||||
public String getDifficultyString() {
|
||||
return difficultyString;
|
||||
}
|
||||
|
||||
/*private ItemStack Artifact() {
|
||||
sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,3);
|
||||
return null;
|
||||
}*/
|
||||
|
||||
public int getRating() {
|
||||
return rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether diff is stronger than the current difficulty. This is a numerical comparison,
|
||||
* and so will always be accurate.
|
||||
*/
|
||||
public boolean isStronger(LivingEntityDifficulty diff) {
|
||||
return (this.getRating()>diff.getRating());
|
||||
}
|
||||
|
||||
public List<ItemStack> RandomizeDrops(double dropmult, boolean isBoss, boolean isRanger, Entity damager, LivingEntity m) {
|
||||
return RandomizeDrops(dropmult,isBoss,false,isRanger,damager,m);
|
||||
}
|
||||
|
||||
public List<ItemStack> RandomizeDrops(double dropmult, boolean isBoss, boolean isElite, boolean isRanger, Entity damager, LivingEntity m) {
|
||||
|
||||
LivingEntityDifficulty diff = MonsterController.getLivingEntityDifficulty(m);
|
||||
|
||||
TwosideKeeper.log(ChatColor.AQUA+"->Entering RandomizeDrops()", 5);
|
||||
List<ItemStack> droplist = new ArrayList<ItemStack>();
|
||||
dropmult += 1; //Base dropmult is 1.0.
|
||||
if (Math.random() < dropmult % 1)
|
||||
{
|
||||
dropmult++;
|
||||
}
|
||||
|
||||
//Basically for each additional dropmult integer value, the
|
||||
//amount of rolls increases. (A dropmult of 1.0 is required for
|
||||
//an additional roll.)
|
||||
Player p = (Player)CustomDamage.getDamagerEntity(damager);
|
||||
for (int i=0;i<dropmult;i++) {
|
||||
TwosideKeeper.Loot_Logger.AddLootRoll();
|
||||
TwosideKeeper.log("Attempting a roll...", TwosideKeeper.LOOT_DEBUG);
|
||||
ItemStack goodie = null;
|
||||
if (Math.random()<=0.1 || isBoss) {
|
||||
TwosideKeeper.log("Inside!", 5);
|
||||
switch (diff) {
|
||||
case DANGEROUS:{
|
||||
goodie=aPlugin.API.Chests.LOOT_DANGEROUS.getSingleDrop(p);
|
||||
KeepRollingForBosses(isBoss, droplist, goodie, aPlugin.API.Chests.LOOT_DANGEROUS, p);
|
||||
}break;
|
||||
case DEADLY:{
|
||||
goodie=aPlugin.API.Chests.LOOT_DEADLY.getSingleDrop(p);
|
||||
KeepRollingForBosses(isBoss, droplist, goodie, aPlugin.API.Chests.LOOT_DEADLY, p);
|
||||
}break;
|
||||
case HELLFIRE:{
|
||||
goodie=aPlugin.API.Chests.LOOT_HELLFIRE.getSingleDrop(p);
|
||||
KeepRollingForBosses(isBoss, droplist, goodie, aPlugin.API.Chests.LOOT_HELLFIRE, p);
|
||||
}break;
|
||||
case END:{
|
||||
goodie=aPlugin.API.Chests.LOOT_CUSTOM.getSingleDrop(p);
|
||||
KeepRollingForBosses(isBoss, droplist, goodie, aPlugin.API.Chests.LOOT_CUSTOM, p);
|
||||
}break;
|
||||
case ELITE:{
|
||||
|
||||
}break;
|
||||
default:{
|
||||
if (Math.random()<=0.4) {
|
||||
goodie=aPlugin.API.Chests.LOOT_NORMAL.getSingleDrop(p);
|
||||
}
|
||||
KeepRollingForBosses(isBoss, droplist, goodie, aPlugin.API.Chests.LOOT_NORMAL, p);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.Loot_Logger.AddCommonLoot();
|
||||
ModifyAndAddDropToList(droplist,goodie,damager);
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("New Droplist: "+droplist.toString(), 5);
|
||||
return droplist;
|
||||
}
|
||||
|
||||
public void KeepRollingForBosses(boolean isBoss, List<ItemStack> droplist, ItemStack goodie, Chests chest, Player damager) {
|
||||
int roll=0;
|
||||
while (isBoss && !isValidSetItem(goodie) && roll<50) {
|
||||
goodie=chest.getSingleDrop(damager);
|
||||
ModifyAndAddDropToList(droplist,goodie,damager);
|
||||
roll++;
|
||||
TwosideKeeper.Loot_Logger.AddCommonLoot();
|
||||
}
|
||||
}
|
||||
|
||||
private void ModifyAndAddDropToList(List<ItemStack> droplist, ItemStack goodie, Entity damager) {
|
||||
/*LivingEntity shooter = CustomDamage.getDamagerEntity(damager);
|
||||
if (shooter instanceof Player) {
|
||||
Player p = (Player)shooter;
|
||||
if (isValidSetItem(goodie)) {
|
||||
if (Math.random()<0.8) {
|
||||
//Convert it to a set piece.
|
||||
PlayerMode pm = PlayerMode.getPlayerMode(p);
|
||||
if (AllowedToConvert(pm,goodie)) {
|
||||
ItemSet set = PickAnItemSet(pm,goodie);
|
||||
goodie = ConvertSetPieceIfNecessary(goodie, set);
|
||||
goodie = Loot.GenerateSetPiece(goodie.getType(), set, (Math.random()<0.1)?true:false, 0, false);
|
||||
}
|
||||
} else {
|
||||
//Convert it to a mega piece.
|
||||
PlayerMode pm = PlayerMode.getPlayerMode(p);
|
||||
if (AllowedToConvert(pm,goodie)) {
|
||||
goodie = Loot.GenerateMegaPiece(goodie.getType(), (Math.random()<0.1)?true:false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("Adding item "+goodie, 2);*/ //LEGACY CODE.
|
||||
if (damager.getWorld().getName().equalsIgnoreCase("world")) {
|
||||
if (Artifact.isArtifact(goodie) && goodie.getType()==Material.MAGMA_CREAM) {
|
||||
//This is a core, convert to essence.
|
||||
switch (goodie.getEnchantmentLevel(Enchantment.LUCK)) {
|
||||
case 1:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,goodie.getAmount());
|
||||
}break;
|
||||
case 2:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE,goodie.getAmount());
|
||||
}break;
|
||||
case 3:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE,goodie.getAmount());
|
||||
}break;
|
||||
case 4:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE,goodie.getAmount());
|
||||
}break;
|
||||
default:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,goodie.getAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (Artifact.isArtifact(goodie) && goodie.getType()==Material.CLAY_BALL) {
|
||||
//This is a core, convert to essence.
|
||||
switch (goodie.getEnchantmentLevel(Enchantment.LUCK)) {
|
||||
case 1:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE,goodie.getAmount());
|
||||
}break;
|
||||
case 2:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE,goodie.getAmount());
|
||||
}break;
|
||||
case 3:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.LOST_CORE,goodie.getAmount());
|
||||
}break;
|
||||
case 4:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE,goodie.getAmount());
|
||||
}break;
|
||||
default:{
|
||||
goodie = Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE,goodie.getAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
droplist.add(goodie);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean AllowedToConvert(PlayerMode pm, ItemStack goodie) {
|
||||
if (goodie.getType()==Material.SKULL_ITEM && pm!=PlayerMode.NORMAL && pm!=PlayerMode.SLAYER) {
|
||||
goodie.setDurability((short)3);
|
||||
SkullMeta sm = (SkullMeta)goodie.getItemMeta();
|
||||
sm.setOwner(Bukkit.getOfflinePlayers()[(int)(Math.random()*Bukkit.getOfflinePlayers().length)].getName());
|
||||
goodie.setItemMeta(sm);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static ItemStack ConvertSetPieceIfNecessary(ItemStack goodie, ItemSet set) {
|
||||
if ((set==ItemSet.JAMDAK ||
|
||||
set==ItemSet.ALIKAHN ||
|
||||
set==ItemSet.DARNYS ||
|
||||
set==ItemSet.LORASAADI) &&
|
||||
!goodie.getType().name().contains("LEATHER") &&
|
||||
GenericFunctions.isArmor(goodie)) {
|
||||
goodie.setType(Material.valueOf("LEATHER_"+goodie.getType().name().split("_")[1]));
|
||||
} else
|
||||
if (goodie.getType().name().contains("LEATHER") &&
|
||||
!(set==ItemSet.JAMDAK ||
|
||||
set==ItemSet.ALIKAHN ||
|
||||
set==ItemSet.DARNYS ||
|
||||
set==ItemSet.LORASAADI) &&
|
||||
GenericFunctions.isArmor(goodie)) {
|
||||
goodie.setType(Material.valueOf("IRON_"+goodie.getType().name().split("_")[1]));
|
||||
} else
|
||||
if (goodie.getType()!=Material.SKULL_ITEM &&
|
||||
(set==ItemSet.MOONSHADOW ||
|
||||
set==ItemSet.GLADOMAIN ||
|
||||
set==ItemSet.WOLFSBANE ||
|
||||
set==ItemSet.ALUSTINE)) {
|
||||
goodie.setType(Material.SKULL_ITEM);
|
||||
} else
|
||||
if (!goodie.getType().name().contains("SWORD") &&
|
||||
(set==ItemSet.LORASYS)) {
|
||||
goodie.setType(Material.valueOf(goodie.getType().name().split("_")[0]+"_SWORD"));
|
||||
}
|
||||
if (!GenericFunctions.isArmor(goodie) && (set==ItemSet.BLITZEN ||
|
||||
set==ItemSet.COMET ||
|
||||
set==ItemSet.CUPID ||
|
||||
set==ItemSet.DANCER ||
|
||||
set==ItemSet.DASHER ||
|
||||
set==ItemSet.DONNER ||
|
||||
set==ItemSet.OLIVE ||
|
||||
set==ItemSet.PRANCER ||
|
||||
set==ItemSet.RUDOLPH ||
|
||||
set==ItemSet.VIXEN)) {
|
||||
//Convert to a random choice of armor.
|
||||
ItemStack item = new ItemStack(Christmas.PickRandomArmorMaterial());
|
||||
goodie.setType(item.getType());
|
||||
}
|
||||
return goodie;
|
||||
}
|
||||
|
||||
private boolean isValidSetItem(ItemStack goodie) {
|
||||
if (goodie!=null) {
|
||||
return TwosideKeeper.validsetitems.contains(goodie.getType());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemSet PickAnItemSet(PlayerMode pm, LivingEntityDifficulty md) {
|
||||
ItemSet set;
|
||||
switch (pm) {
|
||||
case STRIKER:{
|
||||
set = ItemSet.PANROS;
|
||||
}break;
|
||||
case DEFENDER:{
|
||||
set = ItemSet.SONGSTEEL;
|
||||
}break;
|
||||
case BARBARIAN:{
|
||||
set = ItemSet.DAWNTRACKER;
|
||||
}break;
|
||||
case RANGER:{
|
||||
final int NUMBER_OF_MODES=4;
|
||||
int totalweight=50*NUMBER_OF_MODES; //50 for each mode.
|
||||
int selectweight=(int)(Math.random()*totalweight);
|
||||
if (selectweight<50) {
|
||||
set = ItemSet.JAMDAK;
|
||||
} else
|
||||
if (selectweight<100) {
|
||||
set = ItemSet.ALIKAHN;
|
||||
} else
|
||||
if (selectweight<150) {
|
||||
set = ItemSet.DARNYS;
|
||||
} else
|
||||
{
|
||||
set = ItemSet.LORASAADI;
|
||||
}
|
||||
}break;
|
||||
case SLAYER:{
|
||||
final int NUMBER_OF_MODES=3;
|
||||
int totalweight=50*NUMBER_OF_MODES; //50 for each mode.
|
||||
int selectweight=(int)(Math.random()*totalweight);
|
||||
if (selectweight<10) {
|
||||
set = ItemSet.LORASYS;
|
||||
} else
|
||||
switch (md) {
|
||||
case DANGEROUS:{
|
||||
set = ItemSet.ALUSTINE;
|
||||
}break;
|
||||
case DEADLY:{
|
||||
set = ItemSet.MOONSHADOW;
|
||||
}break;
|
||||
case HELLFIRE:
|
||||
case END:{
|
||||
set = ItemSet.GLADOMAIN;
|
||||
}break;
|
||||
default:{
|
||||
set = ItemSet.WOLFSBANE;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
default:{
|
||||
set = PickRandomSet(md);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
public static ItemSet PickRandomSet(LivingEntityDifficulty md) {
|
||||
final int NUMBER_OF_MODES=5;
|
||||
int totalweight=50*NUMBER_OF_MODES; //50 for each mode.
|
||||
int selectweight=(int)(Math.random()*totalweight);
|
||||
if (selectweight<50) {
|
||||
return ItemSet.PANROS;
|
||||
} else
|
||||
if (selectweight<100) {
|
||||
return ItemSet.SONGSTEEL;
|
||||
} else
|
||||
if (selectweight<150) {
|
||||
return ItemSet.DAWNTRACKER;
|
||||
} else
|
||||
if (selectweight<200) {
|
||||
//12.5 per set type.
|
||||
if (selectweight<162.5) {
|
||||
return ItemSet.JAMDAK;
|
||||
} else
|
||||
if (selectweight<175) {
|
||||
return ItemSet.ALIKAHN;
|
||||
} else
|
||||
if (selectweight<187.5) {
|
||||
return ItemSet.DARNYS;
|
||||
} else
|
||||
if (selectweight<200) {
|
||||
return ItemSet.LORASAADI;
|
||||
}
|
||||
} else
|
||||
if (selectweight<250) {
|
||||
if (selectweight<205) {
|
||||
return ItemSet.LORASYS;
|
||||
} else
|
||||
switch (md) {
|
||||
case DANGEROUS:{
|
||||
return ItemSet.ALUSTINE;
|
||||
}
|
||||
case DEADLY:{
|
||||
return ItemSet.MOONSHADOW;
|
||||
}
|
||||
case HELLFIRE:
|
||||
case END:{
|
||||
return ItemSet.GLADOMAIN;
|
||||
}
|
||||
default:{
|
||||
return ItemSet.WOLFSBANE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ItemSet.PANROS;
|
||||
}
|
||||
|
||||
public static ItemSet PickAHolidayItemSet(PlayerMode playerMode, Object object) {
|
||||
final int NUMBER_OF_MODES=10;
|
||||
int totalweight=50*NUMBER_OF_MODES; //50 for each mode.
|
||||
int selectweight=(int)(Math.random()*totalweight);
|
||||
if (selectweight<50) {
|
||||
return ItemSet.BLITZEN;
|
||||
} else
|
||||
if (selectweight<100) {
|
||||
return ItemSet.COMET;
|
||||
} else
|
||||
if (selectweight<150) {
|
||||
return ItemSet.CUPID;
|
||||
} else
|
||||
if (selectweight<200) {
|
||||
return ItemSet.DANCER;
|
||||
} else
|
||||
if (selectweight<250) {
|
||||
return ItemSet.DASHER;
|
||||
} else
|
||||
if (selectweight<300) {
|
||||
return ItemSet.DONNER;
|
||||
} else
|
||||
if (selectweight<350) {
|
||||
return ItemSet.OLIVE;
|
||||
} else
|
||||
if (selectweight<400) {
|
||||
return ItemSet.PRANCER;
|
||||
} else
|
||||
if (selectweight<450) {
|
||||
return ItemSet.RUDOLPH;
|
||||
} else
|
||||
{
|
||||
return ItemSet.VIXEN;
|
||||
}
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@ package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Material;
|
||||
@ -17,13 +16,10 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
|
||||
|
||||
import aPlugin.DropItem;
|
||||
import aPlugin.DropMaterial;
|
||||
import aPlugin.API.Chests;
|
||||
import aPlugin.Drop;
|
||||
import sig.plugin.TwosideKeeper.Artifact;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.Drops.SigDrop;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HolidayEvents.Christmas;
|
||||
|
||||
public class Loot {
|
||||
|
||||
@ -37,30 +33,20 @@ public class Loot {
|
||||
public static void DefineLootChests() {
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.STONE_SWORD,8));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),11));
|
||||
//aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.AIR,101));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.COAL,20));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.COAL,101));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.IRON_INGOT,1,17));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.DIAMOND,1,18));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.GOLD_NUGGET,1,17));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.ENDER_PEARL,1,8));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.ENDER_CHEST,4));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE),4));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,18,"[Normal] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,19,"[Normal] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,2,"[Normal] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.NORMAL));
|
||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED || TwosideKeeper.CHRISTMASLINGERINGEVENT_ACTIVATED) {
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getCookieItem(),1,3,10));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getSmallCandyItem(),1,3,10));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getLargeCandyItem(),10));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getSourCandyItem(),10));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getMysteryFlavorLollipopItem(),10));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getChristmasEventToken(),4));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Christmas.getChristmasBox(),1));
|
||||
}
|
||||
/*aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,2,"[Normal] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.ENDER_CHEST,19));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE),4));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,18,"[Normal] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,19,"[Normal] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,2,"[Normal] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,MonsterDifficulty.NORMAL));
|
||||
/*aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,2,"[Normal] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.NORMAL));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new SigDrop(1,1,"[Normal] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.NORMAL));*/
|
||||
@ -89,28 +75,17 @@ public class Loot {
|
||||
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.IRON_INGOT,91800));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.IRON_BLOCK,7800));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,1800,"[Dangerous] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,7800,"[Dangerous] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,200,"[Dangerous] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,200,"[Dangerous] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,600,"[Dangerous] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,180,"[Dangerous] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,780,"[Dangerous] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,20,"[Dangerous] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,20,"[Dangerous] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,60,"[Dangerous] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE),400));
|
||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED || TwosideKeeper.CHRISTMASLINGERINGEVENT_ACTIVATED) {
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getCookieItem(),1,3,46600));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getSmallCandyItem(),1,3,46600));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getLargeCandyItem(),46600));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getSourCandyItem(),1,3,46600));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getMysteryFlavorLollipopItem(),46600));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getHolidayRageCandyBarItem(),4900));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getSweetCandyItem(),4900));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getChristmasEventToken(),400));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Christmas.getChristmasBox(),100));
|
||||
}
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,1800,"[Dangerous] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,7800,"[Dangerous] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,200,"[Dangerous] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,200,"[Dangerous] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,600,"[Dangerous] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,180,"[Dangerous] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,780,"[Dangerous] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,20,"[Dangerous] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,20,"[Dangerous] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new SigDrop(1,60,"[Dangerous] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE),400));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.printDrops();
|
||||
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.IRON_INGOT,1,2,59800));
|
||||
@ -120,23 +95,17 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.DIAMOND_BLOCK,7800));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.GOLD_INGOT,7800));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.DIAMOND_SWORD,800));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,1800,"[Deadly] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,7800,"[Deadly] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,200,"[Deadly] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,200,"[Deadly] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,600,"[Deadly] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,360,"[Deadly] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,1560,"[Deadly] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,40,"[Deadly] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,40,"[Deadly] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,120,"[Deadly] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE),400));
|
||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED || TwosideKeeper.CHRISTMASLINGERINGEVENT_ACTIVATED) {
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Christmas.getHolidayRageCandyBarItem(),3900));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Christmas.getSweetCandyItem(),1,3,3900));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Christmas.getChristmasEventToken(),400));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Christmas.getChristmasBox(),100));
|
||||
}
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,1800,"[Deadly] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,7800,"[Deadly] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,200,"[Deadly] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,200,"[Deadly] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,600,"[Deadly] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,360,"[Deadly] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,1560,"[Deadly] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,40,"[Deadly] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,40,"[Deadly] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new SigDrop(1,120,"[Deadly] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.LOST_CORE),400));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.printDrops();
|
||||
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.EMERALD,1,3,60200));
|
||||
@ -145,66 +114,33 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.EMERALD_BLOCK,7800));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.DIAMOND_BLOCK,1,2,7800));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.GOLD_BLOCK,7800));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,1800,"[Hellfire] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,7800,"[Hellfire] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,200,"[Hellfire] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,200,"[Hellfire] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,600,"[Hellfire] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,540,"[Hellfire] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,2340,"[Hellfire] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,60,"[Hellfire] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,60,"[Hellfire] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,180,"[Hellfire] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE),400));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,1800,"[Hellfire] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,7800,"[Hellfire] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,200,"[Hellfire] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,200,"[Hellfire] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,600,"[Hellfire] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,540,"[Hellfire] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,2340,"[Hellfire] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,60,"[Hellfire] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,60,"[Hellfire] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new SigDrop(1,180,"[Hellfire] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.HELLFIRE));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE),400));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(TwosideKeeper.HUNTERS_COMPASS.getItemStack(),400));
|
||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED || TwosideKeeper.CHRISTMASLINGERINGEVENT_ACTIVATED) {
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Christmas.getHolidayRageCandyBarItem(),1,3,3900));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Christmas.getSweetCandyItem(),1,3,3900));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Christmas.getChristmasEventToken(),400));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Christmas.getChristmasBox(),100));
|
||||
}
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.printDrops();
|
||||
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,1800,"[End] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,7800,"[End] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,200,"[End] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,200,"[End] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,600,"[End] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,540,"[End] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,2340,"[End] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,60,"[End] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,60,"[End] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,180,"[End] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE),400));
|
||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED || TwosideKeeper.CHRISTMASLINGERINGEVENT_ACTIVATED) {
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Christmas.getHolidayRageCandyBarItem(),1,3,1400));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Christmas.getSweetCandyItem(),1,3,1400));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Christmas.getChristmasEventToken(),200));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Christmas.getChristmasBox(),50));
|
||||
}
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,1800,"[End] Mega Armor",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,7800,"[End] Mega Set Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,200,"[End] Mega Tool",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,200,"[End] Mega Weapon",SigDrop.NONHARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,600,"[End] Mega Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,540,"[End] Hardened Mega Armor",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.ARMOR,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,2340,"[End] Hardened Mega Set Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,60,"[End] Hardened Mega Tool",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.TOOL,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,60,"[End] Hardened Mega Weapon",SigDrop.HARDENED,SigDrop.NONSET,SigDrop.WEAPON,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new SigDrop(1,180,"[End] Hardened Mega Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,MonsterDifficulty.END));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE),400));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.printDrops();
|
||||
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.setName(ChatColor.RED+"Leader Wither Loot Box");
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,1000,"[Leader Wither] Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,1000,"[Leader Wither] Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropMaterial(Material.NETHER_STAR,140));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(CustomItem.DailyToken(),140));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,70,"[Leader Wither] Hardened Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,70,"[Leader Wither] Hardened Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,40,"[Leader Wither] Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,40,"[Leader Wither] Tool",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.TOOL,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,5,"[Leader Wither] Hardened Set Weapon",SigDrop.HARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,5,"[Leader Wither] Hardened Tool",SigDrop.HARDENED,SigDrop.SET,SigDrop.TOOL,LivingEntityDifficulty.DANGEROUS));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(aPlugin.API.getChestItem(Chests.ELITE),5));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(Christmas.getChristmasBox(),5));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.setProbability(0.8);
|
||||
aPlugin.API.Chests.LOOT_CUSTOM_5.printDrops();
|
||||
|
||||
/*for (Chests loot : Chests.values()) {
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||
loot.printDrops();
|
||||
}, 90);
|
||||
}*/
|
||||
//aPlugin.API.Chests..addDrop(new DropItem(TwosideKeeper.HUNTERS_COMPASS.getItemStack(),10));
|
||||
}
|
||||
|
||||
@ -221,7 +157,7 @@ public class Loot {
|
||||
}
|
||||
|
||||
public static ItemStack GenerateMegaPiece(Material mat_type, boolean hardened, boolean setitem, int settier, Entity damager, Monster m) {
|
||||
TwosideKeeper.log("Calling this with "+mat_type.name()+","+hardened+","+setitem+".", 5);
|
||||
TwosideKeeper.log("Calling this with "+mat_type.name()+","+hardened+","+setitem+".", 2);
|
||||
ItemStack raresword = new ItemStack(mat_type);
|
||||
ItemMeta sword_meta = raresword.getItemMeta();
|
||||
sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega "+GenericFunctions.UserFriendlyMaterialName(mat_type));
|
||||
@ -436,9 +372,9 @@ public class Loot {
|
||||
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases duration of Tumble to 3 seconds.");
|
||||
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Damage Reduction by 20%.");
|
||||
fakelore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" Increases Maximum Health by 20.");
|
||||
}
|
||||
LeatherArmorMeta lm = (LeatherArmorMeta)sword_meta;
|
||||
lm.setColor(Color.fromRGB(128, 64, 0));
|
||||
}
|
||||
}break;
|
||||
case 2: {
|
||||
sword_meta.setDisplayName(ChatColor.AQUA+""+ChatColor.BOLD+"Mega Darnys Ranger "+GenericFunctions.UserFriendlyMaterialName(mat_type).replace("Leather ", ""));
|
||||
@ -563,9 +499,7 @@ public class Loot {
|
||||
boolean allowed=true; //Setting this to false will not convert it to a set piece.
|
||||
prefix = (hardened)?(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega "):(ChatColor.AQUA+""+ChatColor.BOLD+"Mega ");
|
||||
switch (set) {
|
||||
case PANROS:
|
||||
case WINDRY:
|
||||
case LUCI:{
|
||||
case PANROS:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
|
||||
} else
|
||||
@ -574,11 +508,9 @@ public class Loot {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Striker "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Striker set.
|
||||
set_name = prefix+"Panros Striker "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Striker set.
|
||||
}break;
|
||||
case SONGSTEEL:
|
||||
case PROTECTOR:
|
||||
case SUSTENANCE:{
|
||||
case SONGSTEEL:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.SHIELD);
|
||||
tierbonus/=(custom)?1:2;
|
||||
@ -588,11 +520,9 @@ public class Loot {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Defender "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Defender set.
|
||||
set_name = prefix+"Songsteel Defender "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Defender set.
|
||||
}break;
|
||||
case DAWNTRACKER:
|
||||
case LEGION:
|
||||
case PRIDE:{
|
||||
case DAWNTRACKER:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.valueOf(item.getType().toString().replace("SWORD","")+"AXE"));
|
||||
} else
|
||||
@ -601,39 +531,66 @@ public class Loot {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Barbarian "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
set_name = prefix+"Dawntracker Barbarian "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
}break;
|
||||
case LORASYS:
|
||||
case ASSASSIN:
|
||||
case STEALTH:{
|
||||
case LORASYS:{
|
||||
if (!item.getType().toString().contains("SWORD")) {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Slayer "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
set_name = prefix+"Lorasys Slayer "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
}break;
|
||||
case JAMDAK:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Jamdak Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (Math.random()<=0.5 && tierbonus<2) {
|
||||
tierbonus+=(custom)?0:2;
|
||||
}
|
||||
}break;
|
||||
case DARNYS:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Darnys Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (Math.random()<=0.5 && tierbonus<1) {
|
||||
tierbonus+=(custom)?0:1;
|
||||
}
|
||||
}break;
|
||||
case ALIKAHN:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Alikahn Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (Math.random()<=0.1 && tierbonus<1) {
|
||||
tierbonus+=(custom)?0:1;
|
||||
}
|
||||
}break;
|
||||
case JAMDAK:
|
||||
case SHARD:
|
||||
case TOXIN:
|
||||
case DARNYS:
|
||||
case ALIKAHN:
|
||||
case LORASAADI:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (item.getType().toString().contains("_HELMET") ||
|
||||
item.getType().toString().contains("_LEGGINGS") ||
|
||||
item.getType().toString().contains("_CHESTPLATE") ||
|
||||
item.getType().toString().contains("_BOOTS")) {
|
||||
String itemstr = item.getType().toString();
|
||||
String[] split = itemstr.split("_");
|
||||
String newstr = "LEATHER_"+split[1];
|
||||
item.setType(Material.valueOf(newstr));
|
||||
} else
|
||||
if (!item.getType().name().contains("LEATHER") && !item.getType().name().contains("BOW")) {
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
set_name = prefix+"Lorasaadi Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (tierbonus>0 && Math.random()<=0.5) {
|
||||
tierbonus=(custom)?tierbonus:0;
|
||||
}
|
||||
}break;
|
||||
case GLADOMAIN:{
|
||||
//item.setType(Material.SKULL_ITEM); else
|
||||
@ -645,7 +602,7 @@ public class Loot {
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
item.setItemMeta(m);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Slayer Amulet";
|
||||
set_name = prefix+"Gladomain Slayer Amulet";
|
||||
}break;
|
||||
case MOONSHADOW:{
|
||||
if (!item.getType().toString().contains("SKULL_ITEM")) {
|
||||
@ -657,7 +614,7 @@ public class Loot {
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
item.setItemMeta(m);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Slayer Trinket";
|
||||
set_name = prefix+"Moonshadow Slayer Trinket";
|
||||
}break;
|
||||
case WOLFSBANE:{
|
||||
if (!item.getType().toString().contains("SKULL_ITEM")) {
|
||||
@ -669,7 +626,7 @@ public class Loot {
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
item.setItemMeta(m);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Slayer Ornament";
|
||||
set_name = prefix+"Wolfsbane Slayer Ornament";
|
||||
}break;
|
||||
case ALUSTINE:{
|
||||
if (!item.getType().toString().contains("SKULL_ITEM")) {
|
||||
@ -681,20 +638,7 @@ public class Loot {
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
item.setItemMeta(m);
|
||||
set_name = prefix+GenericFunctions.CapitalizeFirstLetters(set.name())+" Slayer Charm";
|
||||
}break;
|
||||
case BLITZEN:
|
||||
case COMET:
|
||||
case CUPID:
|
||||
case DANCER:
|
||||
case DASHER:
|
||||
case DONNER:
|
||||
case OLIVE:
|
||||
case PRANCER:
|
||||
case RUDOLPH:
|
||||
case VIXEN: {
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+"Holiday "+GenericFunctions.CapitalizeFirstLetters(set.name())+" "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Striker set.
|
||||
set_name = prefix+"Alustine Slayer Charm";
|
||||
}break;
|
||||
}
|
||||
if (item.getItemMeta().hasLore()) {
|
||||
@ -703,13 +647,12 @@ public class Loot {
|
||||
int tier = tierbonus;
|
||||
do {tier++;} while(Math.random()<=0.25);
|
||||
if (allowed) {
|
||||
lore.addAll(ItemSet.GenerateLore(set,tier,null));
|
||||
lore.addAll(ItemSet.GenerateLore(set,tier));
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.setLore(lore);
|
||||
m.setDisplayName(set_name);
|
||||
item.setItemMeta(m);
|
||||
}
|
||||
GenericFunctions.ConvertSetColor(item, set);
|
||||
item = addEnchantments(item,hardened);
|
||||
return item;
|
||||
}
|
||||
|
@ -18,34 +18,20 @@ import sig.plugin.TwosideKeeper.MonsterController;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
/**
|
||||
* Use LivingEntityDifficulty instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public enum MonsterDifficulty {
|
||||
|
||||
NORMAL(LivingEntityDifficulty.NORMAL),
|
||||
DANGEROUS(LivingEntityDifficulty.DANGEROUS),
|
||||
DEADLY(LivingEntityDifficulty.DEADLY),
|
||||
HELLFIRE(LivingEntityDifficulty.HELLFIRE),
|
||||
ELITE(LivingEntityDifficulty.ELITE),
|
||||
END(LivingEntityDifficulty.END);
|
||||
|
||||
LivingEntityDifficulty diff;
|
||||
|
||||
MonsterDifficulty(LivingEntityDifficulty diff) {
|
||||
this.diff=diff;
|
||||
}
|
||||
NORMAL,
|
||||
DANGEROUS,
|
||||
DEADLY,
|
||||
HELLFIRE,
|
||||
ELITE,
|
||||
END;
|
||||
|
||||
/*private ItemStack Artifact() {
|
||||
sig.plugin.TwosideKeeper.Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE,3);
|
||||
return null;
|
||||
}*/
|
||||
|
||||
public LivingEntityDifficulty getLivingEntityDifficultyEquivalent() {
|
||||
return this.diff;
|
||||
}
|
||||
|
||||
public List<ItemStack> RandomizeDrops(double dropmult, boolean isBoss, boolean isRanger, Entity damager, Monster m) {
|
||||
return RandomizeDrops(dropmult,isBoss,false,isRanger,damager,m);
|
||||
}
|
||||
@ -68,7 +54,7 @@ public enum MonsterDifficulty {
|
||||
Player p = (Player)CustomDamage.getDamagerEntity(damager);
|
||||
for (int i=0;i<dropmult;i++) {
|
||||
TwosideKeeper.Loot_Logger.AddLootRoll();
|
||||
TwosideKeeper.log("Attempting a roll...", TwosideKeeper.LOOT_DEBUG);
|
||||
TwosideKeeper.log("Attempting a roll...", 2);
|
||||
ItemStack goodie = null;
|
||||
if (Math.random()<=0.1 || isBoss) {
|
||||
TwosideKeeper.log("Inside!", 5);
|
||||
@ -93,9 +79,7 @@ public enum MonsterDifficulty {
|
||||
|
||||
}break;
|
||||
default:{
|
||||
if (Math.random()<=0.4) {
|
||||
goodie=aPlugin.API.Chests.LOOT_NORMAL.getSingleDrop(p);
|
||||
}
|
||||
KeepRollingForBosses(isBoss, droplist, goodie, aPlugin.API.Chests.LOOT_NORMAL, p);
|
||||
}
|
||||
}
|
||||
|
@ -1,232 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||
|
||||
public class OptionsMenu {
|
||||
Player p;
|
||||
Inventory inv;
|
||||
List<Option> options;
|
||||
|
||||
final int NUMBER_OF_ROWS = (OptionName.values().length/3)+(((OptionName.values().length%3)!=0)?1:0);
|
||||
|
||||
public OptionsMenu(Player p) {
|
||||
this.p=p;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
pd.optionsmenu=this;
|
||||
inv = Bukkit.createInventory(p, NUMBER_OF_ROWS*9, ChatColor.BLUE+"Options Menu");
|
||||
this.options = new ArrayList<Option>();
|
||||
|
||||
PopulateInterface(p);
|
||||
|
||||
//inv.setItem(arg0, arg1);
|
||||
|
||||
p.openInventory(inv);
|
||||
}
|
||||
|
||||
private void PopulateInterface(Player p) {
|
||||
for (int i=0;i<OptionName.values().length;i++) {
|
||||
Option o = new Option(OptionName.values()[i],i*3,(i*3)+1);
|
||||
ItemStack it = o.getOption().getMaterialData().toItemStack();
|
||||
SetupDescriptions(o, it);
|
||||
ItemStack it2 = new ItemStack(o.getTorchIcon(p));
|
||||
it2.setAmount(0);
|
||||
SetupDescriptions(o, it2);
|
||||
//TwosideKeeper.log(o+";;"+it+";;"+it2, 0);
|
||||
|
||||
inv.setItem(o.getPositions()[0], it);
|
||||
inv.setItem(o.getPositions()[1], it2);
|
||||
options.add(o);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupDescriptions(Option o, ItemStack it) {
|
||||
ItemUtils.setDisplayName(it, o.getOption().getTitle());
|
||||
ItemUtils.addLore(it, o.getOption().getDescription());
|
||||
ItemUtils.addFlag(it, ItemFlag.values());
|
||||
}
|
||||
|
||||
public static boolean runOptionsMenuClick(InventoryClickEvent ev) {
|
||||
InventoryHolder holder = ev.getInventory().getHolder();
|
||||
if (holder!=null && holder instanceof Player) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)holder);
|
||||
if (pd.optionsmenu!=null) {
|
||||
if (ev.getClickedInventory().equals(pd.optionsmenu.getInventory())) {
|
||||
pd.optionsmenu.checkForClick(ev.getSlot());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void checkForClick(int slot) {
|
||||
for (Option o : options) {
|
||||
for (Integer i : o.getPositions()) {
|
||||
if (i==slot) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (o.getOption().getTitle().equalsIgnoreCase("DPS Tracking") && pd.dpstrackinglocked) {
|
||||
return;
|
||||
}
|
||||
boolean val = o.getOption().isOptionEnabled(p, true);
|
||||
doExtraThings(o.getOption());
|
||||
p.sendMessage(o.getOption().getTitle()+" is now turned "+(val?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
||||
PopulateInterface(p);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void doExtraThings(OptionName o) {
|
||||
if (o==OptionName.DPS && !o.isOptionEnabled(p, false)) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
p.sendMessage(pd.damagedata.OutputResults());
|
||||
}
|
||||
}
|
||||
|
||||
private Inventory getInventory() {
|
||||
return inv;
|
||||
}
|
||||
}
|
||||
class Option{
|
||||
int iconpos;
|
||||
int torchpos;
|
||||
OptionName option;
|
||||
|
||||
Option(OptionName option, int iconslot, int torchslot) {
|
||||
this.option=option;
|
||||
this.iconpos=iconslot;
|
||||
this.torchpos=torchslot;
|
||||
}
|
||||
|
||||
OptionName getOption() {
|
||||
return option;
|
||||
}
|
||||
int[] getPositions() {
|
||||
return new int[]{iconpos,torchpos};
|
||||
}
|
||||
Material getTorchIcon(Player p) {
|
||||
return (getOption().isOptionEnabled(p,false)?Material.SLIME_BALL:Material.FIREBALL);
|
||||
}
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Option(option=");
|
||||
sb.append(option);
|
||||
sb.append(",iconpos=");
|
||||
sb.append(iconpos);
|
||||
sb.append(",torchpos=");
|
||||
sb.append(torchpos);
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
enum OptionName{
|
||||
DPSDISPLAY("Damage Number Display",ChatColor.GRAY+"Toggles the display of Damage Numbers on/off.",Material.SKULL_ITEM,(byte)0),
|
||||
DPS("DPS Tracking",ChatColor.GRAY+"Toggles the tracking of damage stats on/off.\nTurning it off reports the last damage session breakdown.",Material.WRITTEN_BOOK,(byte)0),
|
||||
HEALTHBARDISPLAY("Healthbar Display",ChatColor.GRAY+"Toggles the healthbar near the player's cursor\nwhen attacking or getting hit by mobs.",Material.BED,(byte)0),
|
||||
AUTOEQUIPARMOR("Auto-Equip Armor",ChatColor.GRAY+"Toggles automatically equipping appropriate armor.",Material.LEATHER_CHESTPLATE,(byte)0),
|
||||
AUTOEQUIPWEAPON("Auto-Equip Weapon",ChatColor.GRAY+"Toggles automatically equipping appropriate weapons.",Material.IRON_SWORD,(byte)0),
|
||||
SOUNDS("Login/Logout Sounds",ChatColor.GRAY+"Toggles the playing of login/logout sound\nnotifications as well as message sound notifications.",Material.RECORD_7,(byte)0),
|
||||
MOUSEOVERHEALTHBAR("Mouseover Healthbar",ChatColor.GRAY+"Toggles the display of a mob's healthbar without having to attack it.",Material.WATCH,(byte)0);
|
||||
|
||||
String title;
|
||||
String description;
|
||||
MaterialData data;
|
||||
|
||||
OptionName(String title, String desc, Material icon, byte data) {
|
||||
this.data = new MaterialData(icon,data);
|
||||
this.title=title;
|
||||
this.description=desc;
|
||||
}
|
||||
|
||||
MaterialData getMaterialData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
boolean isOptionEnabled(Player p, boolean toggle) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
switch (this) {
|
||||
case DPSDISPLAY:{
|
||||
if (toggle) {
|
||||
pd.damagenumbers=!pd.damagenumbers;
|
||||
}
|
||||
return pd.damagenumbers;
|
||||
}
|
||||
case DPS:{
|
||||
if (toggle) {
|
||||
pd.damagelogging=!pd.damagelogging;
|
||||
}
|
||||
return pd.damagelogging;
|
||||
}
|
||||
case AUTOEQUIPARMOR:{
|
||||
if (toggle) {
|
||||
pd.equiparmor=!pd.equiparmor;
|
||||
}
|
||||
return pd.equiparmor;
|
||||
}
|
||||
case AUTOEQUIPWEAPON:{
|
||||
if (toggle) {
|
||||
pd.equipweapons=!pd.equipweapons;
|
||||
}
|
||||
return pd.equipweapons;
|
||||
}
|
||||
case SOUNDS:{
|
||||
if (toggle) {
|
||||
pd.sounds_enabled=!pd.sounds_enabled;
|
||||
}
|
||||
return pd.sounds_enabled;
|
||||
}
|
||||
case HEALTHBARDISPLAY:{
|
||||
if (toggle) {
|
||||
pd.healthbardisplay=!pd.healthbardisplay;
|
||||
}
|
||||
return pd.healthbardisplay;
|
||||
}
|
||||
case MOUSEOVERHEALTHBAR:{
|
||||
if (toggle) {
|
||||
pd.mouseoverhealthbar=!pd.mouseoverhealthbar;
|
||||
}
|
||||
return pd.mouseoverhealthbar;
|
||||
}
|
||||
}
|
||||
TwosideKeeper.log("WARNING! Value for Option "+title+" does not exist!", 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("OptionName(title=");
|
||||
sb.append(title);
|
||||
sb.append(",description=");
|
||||
sb.append(description);
|
||||
sb.append(",data=");
|
||||
sb.append(data);
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -1,246 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||
import sig.plugin.TwosideKeeper.LivingEntityStructure;
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.MovementUtils;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.PlayerUtils;
|
||||
|
||||
public class Pet {
|
||||
final static public int LEASHRANGE = 16;
|
||||
final static public int LEASHRANGE_SQUARED = LEASHRANGE*LEASHRANGE;
|
||||
Player owner;
|
||||
Location targetLoc;
|
||||
Location lastPos;
|
||||
double moveSpd = 1;
|
||||
double jumpHeight = 3.0;
|
||||
int attackRate = 10;
|
||||
long lastAttacked = 0;
|
||||
LivingEntity ent;
|
||||
String name="";
|
||||
int stuckTimer=0;
|
||||
LivingEntity myTarget=null;
|
||||
|
||||
PetState myState = PetState.PASSIVE;
|
||||
double myDamage = 5;
|
||||
|
||||
public Pet(Player owner, EntityType ent, String nickname) {
|
||||
try {
|
||||
this.ent = (LivingEntity)owner.getLocation().getWorld().spawnEntity(owner.getLocation(), ent);
|
||||
this.owner = owner;
|
||||
this.name = nickname;
|
||||
this.setNickname(nickname);
|
||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(this.ent);
|
||||
les.isPet=true;
|
||||
les.petOwner=owner;
|
||||
} catch (ClassCastException e) {
|
||||
TwosideKeeper.log("ERROR! Specified invalid Entity Type when creating Pet!", 0);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void run() {
|
||||
if (owner==null || !owner.isValid() || ent==null || !ent.isValid()) {
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
|
||||
grabEnemyTarget();
|
||||
|
||||
switch (myState) {
|
||||
case PASSIVE:{
|
||||
if (myTarget!=null && !myTarget.isValid()) {
|
||||
myTarget=null;
|
||||
//TwosideKeeper.log("My Target is now "+GenericFunctions.GetEntityDisplayName(myTarget), 1);
|
||||
} else
|
||||
if (myTarget!=null) { //This is a valid target. If we are too far away, move towards it. Perform an attack when close enough if possible.
|
||||
if (ent.getLocation().distanceSquared(myTarget.getLocation())>4) {
|
||||
setTargetLocation(myTarget.getLocation());
|
||||
setState(PetState.MOVING);
|
||||
} else {
|
||||
//We are in attack range. Prepare an attack.
|
||||
if (lastAttacked+attackRate<=TwosideKeeper.getServerTickTime()) {
|
||||
myState=PetState.ATTACKING;
|
||||
lastAttacked=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (owner.getLocation().distanceSquared(ent.getLocation())>LEASHRANGE_SQUARED) {
|
||||
ent.teleport(owner.getLocation());
|
||||
}
|
||||
}break;
|
||||
case MOVING:{
|
||||
if (targetLoc!=null && ent.getLocation().distanceSquared(targetLoc)>2) {
|
||||
Location loc = MoveTowardsPoint(targetLoc);
|
||||
if (lastPos!=null) {
|
||||
if (lastPos.distanceSquared(ent.getLocation())<4) {
|
||||
stuckTimer++;
|
||||
//TwosideKeeper.log("Stuck Timer: "+stuckTimer, 1);
|
||||
} else {
|
||||
stuckTimer=0;
|
||||
lastPos=null;
|
||||
//setState(PetState.PASSIVE);
|
||||
}
|
||||
} else {
|
||||
lastPos = loc.clone();
|
||||
}
|
||||
}
|
||||
if (stuckTimer==20) {
|
||||
//Try jumping.
|
||||
ent.setVelocity(new Vector(0,jumpHeight,0));
|
||||
stuckTimer++;
|
||||
} else
|
||||
if (stuckTimer==50) {
|
||||
ent.teleport(owner);
|
||||
stuckTimer=0;
|
||||
lastPos=null;
|
||||
targetLoc=null;
|
||||
setState(PetState.PASSIVE);
|
||||
}
|
||||
if (targetLoc!=null && ent.getLocation().distanceSquared(targetLoc)<=2) {
|
||||
targetLoc=null;
|
||||
stuckTimer=0;
|
||||
setState(PetState.PASSIVE);
|
||||
}
|
||||
if (targetLoc==null) {
|
||||
stuckTimer=0;
|
||||
setState(PetState.PASSIVE);
|
||||
}
|
||||
}break;
|
||||
case ATTACKING:{
|
||||
if (myTarget!=null) {
|
||||
MoveTowardsPoint(myTarget.getLocation(),0.4);
|
||||
//Deal damage.
|
||||
CustomDamage.ApplyDamage(myDamage, ent, myTarget, null, "Pet Attack");
|
||||
}
|
||||
setState(PetState.PASSIVE);
|
||||
}break;
|
||||
}
|
||||
//TwosideKeeper.log("Pet State: "+myState, 1);
|
||||
}
|
||||
|
||||
private Location MoveTowardsPoint(Location targetLoc) {
|
||||
return MoveTowardsPoint(targetLoc,1);
|
||||
}
|
||||
|
||||
private Location MoveTowardsPoint(Location targetLoc, double mult) {
|
||||
Vector dirToMove = MovementUtils.getVelocityTowardsLocation(ent.getLocation(), targetLoc, moveSpd*mult);
|
||||
Location loc = ent.getLocation();
|
||||
loc.setDirection(dirToMove);
|
||||
ent.setVelocity(dirToMove);
|
||||
ent.teleport(loc);
|
||||
return loc;
|
||||
}
|
||||
|
||||
public void setTarget(LivingEntity target) {
|
||||
setTarget(target,false);
|
||||
}
|
||||
|
||||
public void setTarget(LivingEntity target, boolean force) {
|
||||
if (myTarget==null || myTarget.getLocation().distanceSquared(ent.getLocation())>64 || force) {
|
||||
myTarget = target;
|
||||
}
|
||||
}
|
||||
|
||||
private void grabEnemyTarget() {
|
||||
if (myTarget!=null){
|
||||
if (myTarget.isValid()) {
|
||||
if (!myTarget.getWorld().equals(ent.getWorld())) {
|
||||
myTarget=null;
|
||||
return;
|
||||
}
|
||||
if (myTarget.getLocation().distanceSquared(ent.getLocation())>64) {
|
||||
myTarget=null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ent.hasAI() && isFighting()) {
|
||||
ent.setAI(false);
|
||||
if (myTarget==null || !myTarget.isValid()) {
|
||||
//Attempt to find a target. Try the owner's target first.
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(owner);
|
||||
myTarget = pd.target;
|
||||
if (myTarget==null || !myTarget.isValid()) {
|
||||
//Try to find a nearby target.
|
||||
List<LivingEntity> ents = GenericFunctions.getNearbyMonsters(ent.getLocation(), 4);
|
||||
double closestrange = Integer.MAX_VALUE;
|
||||
LivingEntity selectedent = null;
|
||||
for (int i=0;i<ents.size();i++) {
|
||||
LivingEntity ent = ents.get(i);
|
||||
if (ent==this.ent || LivingEntityStructure.isFriendly(owner, ent)) {
|
||||
ents.remove(i--);
|
||||
} else {
|
||||
double dist = ent.getLocation().distanceSquared(this.ent.getLocation());
|
||||
if (closestrange>dist) {
|
||||
closestrange = dist;
|
||||
selectedent = ent;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedent!=null) {
|
||||
myTarget=selectedent;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
if (!ent.hasAI() && !isFighting()) {
|
||||
ent.setAI(true);
|
||||
}
|
||||
}
|
||||
|
||||
public PetState getState() {
|
||||
return myState;
|
||||
}
|
||||
|
||||
public void setTargetLocation(Location loc) {
|
||||
this.targetLoc=loc;
|
||||
}
|
||||
|
||||
public void setMoveSpeed(double spd) {
|
||||
this.moveSpd = spd;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.name=nickname;
|
||||
this.ent.setCustomName(nickname);
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Location getTargetLocation() {
|
||||
return targetLoc;
|
||||
}
|
||||
|
||||
public LivingEntity getEntity() {
|
||||
return ent;
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
ent.remove();
|
||||
}
|
||||
|
||||
public boolean isFighting() {
|
||||
if (owner!=null && PlayerUtils.PlayerIsInCombat(owner)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setState(PetState state) {
|
||||
myState = state;
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
public enum PetState {
|
||||
PASSIVE,
|
||||
MOVING,
|
||||
ATTACKING;
|
||||
}
|
@ -4,29 +4,109 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import sig.plugin.TwosideKeeper.PartyManager;
|
||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public enum PlayerMode {
|
||||
STRIKER(ChatColor.RED,"S","Striker",Book.STRIKERGUIDE),
|
||||
RANGER(ChatColor.DARK_GREEN,"R","Ranger",Book.RANGERGUIDE),
|
||||
DEFENDER(ChatColor.GRAY,"D","Defender",Book.DEFENDERGUIDE),
|
||||
BARBARIAN(ChatColor.GOLD,"B","Barbarian",Book.BARBARIANGUIDE
|
||||
STRIKER(ChatColor.RED,"S","Striker",
|
||||
ChatColor.RED+""+ChatColor.BOLD+"Striker mode Perks: "+ChatColor.RESET+"\n"
|
||||
+ ChatColor.WHITE+"->Players are identified as 'Strikers' when they only carry a sword in their main hand. No off-hand items.\n"
|
||||
+ ChatColor.GRAY+"->10% passive damage increase.\n"
|
||||
+ ChatColor.WHITE+"->20% chance to critically strike.\n"
|
||||
+ ChatColor.WHITE+"->Getting hit increases Speed by 1 Level. Stacks up to Speed V (Lasts five seconds.)\n"
|
||||
+ ChatColor.GRAY+"->Swinging your weapon stops nearby flying arrows. Each arrow deflected will give you a Strength buff. Stacks up to Strength V (Lasts five seconds.)\n"
|
||||
+ ChatColor.WHITE+"->Dropping your weapon will perform a line drive. Enemies you charge through take x1-x5 damage, based on target's missing health. This costs 5% of your durability (Unbreaking decreases this amount.)\n"
|
||||
+ ChatColor.GRAY+"->Strikers have a 20% chance to dodge incoming attacks from any damage source while moving.\n"
|
||||
+ ChatColor.WHITE+"->Hitting a target when they have not noticed you yet does x3 normal damage.\n"),
|
||||
RANGER(ChatColor.DARK_GREEN,"R","Ranger",
|
||||
ChatColor.DARK_GREEN+""+ChatColor.BOLD+"Ranger mode Perks: "+ChatColor.RESET+"\n"
|
||||
+ ChatColor.WHITE+"->Players are identified as 'Rangers' when they carry a bow or a quiver in one of their hands. Off-hand items are permitted, except for a shield. Can only be wearing leather armor, or no armor.\n"
|
||||
+ ChatColor.GRAY+"->Left-clicking mobs will cause them to be knocked back extremely far, basically in headshot range, when walls permit.\n"
|
||||
+ ChatColor.WHITE+"->Base Arrow Damage increases from x2->x4.\n"
|
||||
+ ChatColor.GRAY+"->You can dodge 50% of all incoming attacks from any damage sources.\n"
|
||||
+ ChatColor.WHITE+"You have immunity to all Thorns damage.\n"
|
||||
+ ChatColor.GRAY+"Shift-Right Click to change Bow Modes.\n"
|
||||
+ ChatColor.WHITE+"- "+ChatColor.BOLD+"Close Range Mode (Default):"+ChatColor.RESET+ChatColor.WHITE+" \n"
|
||||
+ ChatColor.GRAY+" You gain the ability to deal headshots from any distance, even directly onto an enemy's face. Each kill made in this mode gives you 100% dodge chance for the next hit taken. You can tumble and gain invulnerability for 1 second by dropping your bow. Sneak while dropping it to tumble backwards.\n"
|
||||
+ ChatColor.WHITE+"- "+ChatColor.BOLD+"Sniping Mode:"+ChatColor.RESET+ChatColor.WHITE+" \n"
|
||||
+ ChatColor.GRAY+" Headshot collision area increases by x3. Headshots will deal an extra x0.25 damage for each headshot landed, up to a cap of 8 stacks. Each stack also increases your Slowness level by 1. You lose 10% dodge chance per Slowness stack, but gain one Resistance level and 10% critical chance per Slowness stack.\n"
|
||||
+ ChatColor.WHITE+" Arrows are lightning-fast in Sniping Mode.\n"
|
||||
+ ChatColor.GRAY+" Press the drop key in Sniping Mode to unleash 26 piercing arrows rapidly against your enemies.\n\n"
|
||||
+ ChatColor.GRAY+"- "+ChatColor.BOLD+"Debilitation Mode:"+ChatColor.RESET+ChatColor.WHITE+" \n"
|
||||
+ ChatColor.WHITE+" Adds a stack of Poison when hitting non-poisoned targets (20 second duration). Hitting mobs in this mode refreshes the duration of the poison stacks. Headshots made in this mode will increase the level of Poison on the mob, making the mob more and more vulnerable.\n"
|
||||
+ ChatColor.GRAY+" Headshots also remove one level of a buff (does not affect debuffs) applied to the mob at random.\n"
|
||||
+ ChatColor.WHITE+" Press the drop key in Debilitation Mode when at least 1 poisoned target is nearby. Deals (Poison Level x 10) True Damage and Slows all targets the same level as the number of poison stacks applied to nearby targets for 15 seconds, and grants 4 Absorption health (2 hearts) to the Ranger per poison stack. Refreshes Poison duration on all nearby poisoned targets.\n"),
|
||||
DEFENDER(ChatColor.GRAY,"D","Defender",
|
||||
ChatColor.GRAY+""+ChatColor.BOLD+"Defender mode Perks: "+ChatColor.RESET+"\n"
|
||||
+ ChatColor.WHITE+"->Players are identified as 'Defenders' when they use a shield in their main hand.\n"
|
||||
+ ChatColor.GRAY+"->Base Damage reduction from shields increases from 5%->10%\n"
|
||||
+ ChatColor.WHITE+"->Blocking damage reduction increases from 50->70%\n"
|
||||
+ ChatColor.GRAY+"->When not blocking, you have Regeneration I. Blocking applies Regeneration II.\n"
|
||||
+ ChatColor.WHITE+"->Blocking gives 8 health (4 hearts) of Absorption damage.\n"
|
||||
+ ChatColor.GRAY+"->When hit while blocking, you build up Resistance, one level per hit, up to Resistance V (lasts 2 seconds)\n"
|
||||
+ ChatColor.WHITE+"->While blocking, you absorb 50% of all damage taken by party members.\n"
|
||||
+ ChatColor.GRAY+"->Blocking will aggro all nearby mobs to the blocking defender. They will glow indicate the aggro shift.\n"
|
||||
+ ChatColor.WHITE+"->Base Health increased by 10 (5 hearts)\n"
|
||||
+ ChatColor.GRAY+"->Getting hit as a defender increases saturation.\n"
|
||||
+ ChatColor.WHITE+"->Hitting mobs as a Defender aggros them to you.\n"
|
||||
+ ChatColor.GRAY+"->Knockback from attacks reduced by 75% while blocking.\n"
|
||||
+ ChatColor.WHITE+"- "+ChatColor.BOLD+"Rejuvenation"+ChatColor.RESET+ChatColor.WHITE+"\n"
|
||||
+ ChatColor.GRAY+"->Dropping your shield will give you Regeneration X for 10 seconds and 2 seconds of invulnerability. It also costs 400 shield durability!\n"),
|
||||
BARBARIAN(ChatColor.GOLD,"B","Barbarian",
|
||||
ChatColor.GOLD+""+ChatColor.BOLD+"Barbarian mode Perks: "+ChatColor.RESET+"\n"
|
||||
+ ChatColor.WHITE+"->Players are identified as 'Barbarians' by wielding an axe in both the main hand and the offhand.\n"
|
||||
+ ChatColor.GRAY+"->Barbarians swing their off-hand by right-clicking.\n"
|
||||
+ ChatColor.WHITE+"->Barbarians gain 2 HP (1 Heart) per 1% of Damage reduction.\n"
|
||||
+ ChatColor.GRAY+"->When Barbarians are hit, they take damage as if they had 0% Damage reduction.\n"
|
||||
+ ChatColor.WHITE+"->Players are identified as 'Slayers' by wearing no armor, and wearing a Bauble in their hotbar.\n"
|
||||
+ ChatColor.GRAY+"->Barbarians deal 20% more damage for every 20% of an enemy's missing health.\n"
|
||||
+ ChatColor.WHITE+"->Barbarians gain Bonus Lifesteal stacks as they hit enemies. Each stack increases Lifesteal by 1%, up to a cap of 100% extra Lifesteal. The stacks refresh every hit, but wear off after 5 seconds.\n"
|
||||
+ ChatColor.GRAY+"->Barbarians do not instantly take full damage when hit. Instead, the HP is stored in a 'Damage Pool' and distributed every second.\n"
|
||||
+ ChatColor.WHITE+"->If Barbarians have points in their 'Damage Pool', they will take up to 15 damage every second. The amount taken goes down by wearing Barbarian gear.\n"
|
||||
+ ChatColor.GRAY+"->When a monster is killed by a Barbarian, the amount of remaining damage in their Damage Pool is divided by 4.\n"
|
||||
+ ChatColor.WHITE+"->Barbarians automatically consume Rotten Flesh and Spider Eyes that are picked up. Each one heals for 1% of their health. Rotten Flesh and Spider Eyes in a Barbarian's inventory will automatically be consumed as the Barbarian gets hungry.\n"
|
||||
+ ChatColor.GRAY+"->Barbarians build up Weapon Charges in two ways: +1 Charge for attacking an enemy with the main hand weapon and +2 Charges for taking damage.\n"
|
||||
+ ChatColor.WHITE+"->Barbarians have 70% knockback resistance.\n"
|
||||
+ ChatColor.GRAY+"->Barbarians can release their Weapon Charges by using a variety of commands:\n"
|
||||
+ ChatColor.WHITE+"->Right-Click (Costs 10 Charges): Power Swing - Swing your off-hand weapon to deal an attack with +100% Lifesteal and +100% Crit Chance bonus. Gives 10 Bonus Lifesteal stacks.\n"
|
||||
+ ChatColor.GRAY+"->Shift Left-Click (Costs 30 Charges): Forceful Strike - Hit all enemies in a line in front of you, dealing double damage and suppressing them for 3 seconds.\n"
|
||||
+ ChatColor.WHITE+"->Shift Right-Click (Costs 30 Charges): Sweep Up - Performs a sweeping attack which knocks up and damages all enemies within a 4m radius of you. Doubles your Bonus Lifesteal stacks. Lifesteal effects are doubled during this attack.\n"
|
||||
+ ChatColor.GRAY+"->Swap Item Key (100 Charges Minimum, Costs ALL Charges): Barbarian's Rage - Converts your missing health into Absorption Hearts and applies powerful buffs. This ability is stronger the more stacks consumed.\n"
|
||||
+ ChatColor.WHITE+" Barbarian's Rage: \n"
|
||||
+ ChatColor.GRAY+" -- Strength Level: +1 per 10 charges\n"
|
||||
+ ChatColor.WHITE+" -- LifeSteal: +1% per 2 charges\n"
|
||||
+ ChatColor.GRAY+" -- Speed V\n"
|
||||
+ ChatColor.WHITE+" -- Duration of Rage: +1 second per 10 charges\n"
|
||||
+ ChatColor.GRAY+" -- +2 seconds of invulnerability per 100 charges\n"
|
||||
+ ChatColor.WHITE+"During Rage you gain double the number of Bonus Lifesteal stacks. You do not gain Weapon Charges during Barbarian's Rage.\n"
|
||||
+ ChatColor.GRAY+"->Leaping Strike: Barbarians that take fall damage deal triple the damage taken from the fall as damage to all enemies nearby. The range of this attack increases based on how fast the Barbarian falls.\n"
|
||||
+ ChatColor.WHITE+"->Mock: Press the drop key to perform a Mock attack to all enemies near you. Affected enemies become aggro'd to the Barbarian for 15 seconds and receive 2 stacks of Weakness that lasts 15 seconds. This can stack up to Weakness VI. 20 second cooldown.\n"
|
||||
),
|
||||
SLAYER(ChatColor.DARK_BLUE,"SL","Slayer",Book.SLAYERGUIDE),
|
||||
SLAYER(ChatColor.DARK_BLUE,"SL","Slayer",
|
||||
ChatColor.DARK_BLUE+""+ChatColor.BOLD+"Slayer mode Perks: "+ChatColor.RESET+"\n"
|
||||
+ ChatColor.WHITE+"->Players are identified as 'Slayers' by wearing no armor, and wearing a Bauble in their hotbar.\n"
|
||||
+ ChatColor.GRAY+"->Slayers can make use of up to 9 Baubles by placing them on their hotbar (Ideally you would want to use one slot for a weapon). Each Bauble adds a certain amount of stats to the Slayer, making them more efficient.\n"
|
||||
+ ChatColor.WHITE+"->Slayers take a maximum of 1 Heart (2 HP) in damage from all attacks, making this mode essentially 5 lives.\n"
|
||||
+ ChatColor.GRAY+"->Slayers are not affected by any Health Recovery and Health Regeneration effects. This mode only heals from kills, being out of combat for 1 minute, using the Amulet's set effect, or sleeping. However, Absorption will still work for a Slayer. Absorption hearts just get removed with normal damage calculation rules.\n"
|
||||
+ ChatColor.WHITE+"->Whenever a Slayer kills a target, they recover 1 Heart (2 HP). This can be modified by a special weapon.\n"
|
||||
+ ChatColor.GRAY+"->Slayers can enter Stealth mode by pressing Sneak. Once in Stealth mode, Slayers will not leave stealth until they take damage or Sneak again. Stealth mode drains 1 Durability every second from tools on your hotbar.\n"
|
||||
+ ChatColor.WHITE+"->While in Stealth mode, nothing will be able to detect you. Note this does not get rid of aggression from targets that have already aggro'd you.\n"
|
||||
+ ChatColor.GRAY+"->Slayers can Backstab targets by getting behind them and hitting them. A backstab does triple the normal damage of an attack.\n"
|
||||
+ ChatColor.WHITE+"->Whenever a Slayer critically strikes, it suppresses a target for 0.75 seconds. Suppression prevents movement, attacking, teleporting, and exploding. Suppressed targets glow Black.\n"
|
||||
+ ChatColor.GRAY+"->Slayers thrive in 1vs1 situations. If a target is completely alone, they will glow white to the Slayer. Isolated targets take 50% more damage from the Slayer. Slayer's Dodge Chance increases by 40% against isolated targets.\n"
|
||||
+ ChatColor.WHITE+"->Slayers can use the Assassination ability. Press the Drop key while looking at an enemy to perform an assassination: You jump directly behind the enemy, gaining 0.5 seconds of invulnerability. If the next hit after Assassination is performed kills the target, you gain a speed and strength buff. These buffs cap at Speed V and Strength X respectively and last 10 seconds. Assassination cooldown is reset whenever a target is instantly killed in this manner, and you get immediately put back into stealth, preventing further detection from other monsters.\n"),
|
||||
SUMMONER(ChatColor.DARK_PURPLE,"SM","Summoner",
|
||||
Book.SUMMONERGUIDE),
|
||||
NORMAL(ChatColor.WHITE,"A","Adventurer",Book.ADVENTURERGUIDE);
|
||||
ChatColor.DARK_PURPLE+""+ChatColor.BOLD+"Summoner mode Perks: "+ChatColor.RESET+"\n"),
|
||||
NORMAL(ChatColor.WHITE,"","Normal",
|
||||
"This mode has no perks!");
|
||||
;
|
||||
|
||||
final public static int UPDATE_GRACE_PERIOD=9; //How often to update the mode of the player.
|
||||
|
||||
ChatColor col=ChatColor.WHITE;
|
||||
String symbol="";
|
||||
Book storedBook;
|
||||
|
||||
public ChatColor getColor() {
|
||||
return col;
|
||||
@ -41,7 +121,6 @@ public enum PlayerMode {
|
||||
}
|
||||
|
||||
public static PlayerMode getPlayerMode(Player p) {
|
||||
if (p!=null && p.isValid() && p.isOnline() && !p.isDead()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (needsUpdating(pd)) {
|
||||
if (Check_isSlayer(p)) {
|
||||
@ -62,18 +141,12 @@ public enum PlayerMode {
|
||||
} else
|
||||
if (Check_isRanger(p)) {
|
||||
pd.lastmode=PlayerMode.RANGER;
|
||||
} else
|
||||
if (Check_isSummoner(p)) {
|
||||
pd.lastmode=PlayerMode.SUMMONER;
|
||||
} else {
|
||||
pd.lastmode=PlayerMode.NORMAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return pd.lastmode;
|
||||
} else {
|
||||
return PlayerMode.NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean needsUpdating(PlayerStructure pd) {
|
||||
@ -149,19 +222,6 @@ public enum PlayerMode {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isSummoner(Player p) {
|
||||
if (p!=null && !p.isDead()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (needsUpdating(pd)) {
|
||||
return getPlayerMode(p)==PlayerMode.SUMMONER;
|
||||
} else {
|
||||
return pd.lastmode==PlayerMode.SUMMONER;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isNormal(Player p) {
|
||||
if (p!=null && !p.isDead()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
@ -181,8 +241,8 @@ public enum PlayerMode {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (needsUpdating(pd)) {
|
||||
if ((((p.getEquipment().getItemInMainHand()!=null && (p.getEquipment().getItemInMainHand().getType()==Material.BOW || ArrowQuiver.isValidQuiver(p.getEquipment().getItemInMainHand())) && (p.getInventory().getExtraContents()[0]==null || p.getInventory().getExtraContents()[0].getType()==Material.AIR)) || //Satisfy just a bow/quiver in main hand.
|
||||
(p.getEquipment().getItemInMainHand()!=null && (p.getEquipment().getItemInMainHand().getType()==Material.BOW || ArrowQuiver.isValidQuiver(p.getEquipment().getItemInMainHand())) && p.getInventory().getExtraContents()[0]!=null && !(GenericFunctions.isWeapon(p.getInventory().getExtraContents()[0])) && !(GenericFunctions.isArmor(p.getInventory().getExtraContents()[0]))) || /*Satisfy a bow/quiver in main hand and no shield in off-hand.*/
|
||||
(p.getEquipment().getItemInMainHand()!=null && !GenericFunctions.isWeapon(p.getEquipment().getItemInMainHand()) && !GenericFunctions.isArmor(p.getEquipment().getItemInMainHand()) && p.getInventory().getExtraContents()[0]!=null && (p.getInventory().getExtraContents()[0].getType()==Material.BOW || ArrowQuiver.isValidQuiver(p.getInventory().getExtraContents()[0]))) || /*Satisfy a bow/quiver in off-hand and no shield in main hand.*/
|
||||
(p.getEquipment().getItemInMainHand()!=null && (p.getEquipment().getItemInMainHand().getType()==Material.BOW || ArrowQuiver.isValidQuiver(p.getEquipment().getItemInMainHand())) && p.getInventory().getExtraContents()[0]!=null && !GenericFunctions.isEquip(p.getInventory().getExtraContents()[0])) || /*Satisfy a bow/quiver in main hand and no shield in off-hand.*/
|
||||
(p.getEquipment().getItemInMainHand()!=null && !GenericFunctions.isEquip(p.getEquipment().getItemInMainHand()) && p.getInventory().getExtraContents()[0]!=null && (p.getInventory().getExtraContents()[0].getType()==Material.BOW || ArrowQuiver.isValidQuiver(p.getInventory().getExtraContents()[0]))) || /*Satisfy a bow/quiver in off-hand and no shield in main hand.*/
|
||||
((p.getEquipment().getItemInMainHand()==null || p.getEquipment().getItemInMainHand().getType()==Material.AIR) && p.getInventory().getExtraContents()[0]!=null && (p.getInventory().getExtraContents()[0].getType()==Material.BOW || ArrowQuiver.isValidQuiver(p.getInventory().getExtraContents()[0])))) /*Satisfy just a bow/quiver in off-hand.*/ &&
|
||||
GenericFunctions.AllLeatherArmor(p))) {
|
||||
return true;
|
||||
@ -236,7 +296,7 @@ public enum PlayerMode {
|
||||
if (p!=null && !p.isDead()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (needsUpdating(pd)) {
|
||||
if (p.getEquipment().getItemInMainHand()!=null && GenericFunctions.hasBaublePouchInOffHand(p) &&
|
||||
if (p.getEquipment().getItemInMainHand()!=null && GenericFunctions.hasSlayerSetItemOnHotbar(p) &&
|
||||
GenericFunctions.WearingNoArmor(p)) {
|
||||
return true;
|
||||
} else {
|
||||
@ -268,43 +328,23 @@ public enum PlayerMode {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean Check_isSummoner(Player p) {
|
||||
if (p!=null && !p.isDead()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (needsUpdating(pd)) {
|
||||
if (GenericFunctions.onlyHoldingScepter(p) &&
|
||||
GenericFunctions.AllLeatherArmor(p)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return pd.lastmode==PlayerMode.SUMMONER;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
String name="";
|
||||
Book helperBook;
|
||||
String desription="";
|
||||
|
||||
public Book getBook() {
|
||||
return helperBook;
|
||||
public String getDesription() {
|
||||
return desription;
|
||||
}
|
||||
|
||||
public void setBook(Book book) {
|
||||
this.helperBook = book;
|
||||
public void setDesription(String desription) {
|
||||
this.desription = desription;
|
||||
}
|
||||
|
||||
PlayerMode(ChatColor col, String abbreviation, String fullname, Book descBook) {
|
||||
PlayerMode(ChatColor col, String abbreviation, String fullname, String desc) {
|
||||
this.col=col;
|
||||
this.symbol=abbreviation;
|
||||
this.name=fullname;
|
||||
this.helperBook=descBook;
|
||||
this.desription=desc;
|
||||
}
|
||||
|
||||
public static boolean isLeatherPlayerMode(PlayerMode mode) {
|
||||
return mode==PlayerMode.RANGER || mode==PlayerMode.SUMMONER;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class Pronouns {
|
||||
"exploded.",
|
||||
"decided there was a better life worth living.",
|
||||
"exploded by the after shock.",
|
||||
"was shredded by the secondary explosion.",
|
||||
"was shredded by the secondary explsion.",
|
||||
"exploded into pieces.",
|
||||
"could not handle the after shock.",
|
||||
"was feeling a little greedy, blindly walking into the demolition zone.",
|
||||
@ -205,7 +205,7 @@ public class Pronouns {
|
||||
"melon",
|
||||
"pie",
|
||||
};
|
||||
}break;
|
||||
}
|
||||
case 16:{
|
||||
pronouns = new String[]{
|
||||
"thought living inside a block was a good idea.",
|
||||
@ -216,7 +216,7 @@ public class Pronouns {
|
||||
"somehow ended up trapped inside a block.",
|
||||
"ended up suffocating.",
|
||||
};
|
||||
}break;
|
||||
}
|
||||
case 17:{
|
||||
pronouns = new String[]{
|
||||
"got murdered by the webs of a "+ChatColor.DARK_RED+"Hellfire Spider.",
|
||||
@ -227,7 +227,7 @@ public class Pronouns {
|
||||
"got lost in the web.",
|
||||
"got tangled by webs.",
|
||||
};
|
||||
}break;
|
||||
}
|
||||
case 18:{
|
||||
pronouns = new String[]{
|
||||
"took too much damage, and wilted away...",
|
||||
@ -239,30 +239,7 @@ public class Pronouns {
|
||||
"braved the terrors of the world, but could not live to see another day.",
|
||||
"fought until the very end of their life. But it was not enough.",
|
||||
};
|
||||
}break;
|
||||
case 19:{
|
||||
pronouns = new String[]{
|
||||
"pulverized into Darkness...",
|
||||
"did not time their jump properly, submitting to Darkness.",
|
||||
"got slammed into the earth by Darkness.",
|
||||
};
|
||||
}break;
|
||||
case 20:{
|
||||
pronouns = new String[]{
|
||||
"was pierced to death.",
|
||||
"took one to the face.",
|
||||
"took an arrow to the knee.",
|
||||
"took one too many arrows to the face.",
|
||||
};
|
||||
}break;
|
||||
case 21:{
|
||||
pronouns = new String[]{
|
||||
"was barbequed!",
|
||||
"was turned into fried chicken from a deadly Burning Plume.",
|
||||
"could not avoid the Burning hell.",
|
||||
"... wtfbbq",
|
||||
};
|
||||
}break;
|
||||
}
|
||||
}
|
||||
return pronouns[(int)(Math.random()*pronouns.length)];
|
||||
}
|
||||
|
@ -1,58 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
public class RecyclingCenterNode {
|
||||
private Location loc;
|
||||
private boolean toolsAllowed=true;
|
||||
private boolean itemsAllowed=true;
|
||||
private String recyclingCenterName="Recycling Center";
|
||||
|
||||
public RecyclingCenterNode(Location loc, String name) {
|
||||
this(loc,name,true);
|
||||
}
|
||||
|
||||
public RecyclingCenterNode(Location loc, String name, boolean toolsAllowed) {
|
||||
this(loc,name,toolsAllowed,true);
|
||||
}
|
||||
|
||||
public RecyclingCenterNode(Location loc, String name, boolean toolsAllowed, boolean itemsAllowed) {
|
||||
this.loc=loc.clone();
|
||||
this.toolsAllowed=toolsAllowed;
|
||||
this.itemsAllowed=itemsAllowed;
|
||||
this.recyclingCenterName=name;
|
||||
}
|
||||
|
||||
public boolean areToolsAllowed() {
|
||||
return (itemsAllowed && toolsAllowed);
|
||||
}
|
||||
|
||||
public void setToolsAllowed(boolean toolsAllowed) {
|
||||
this.toolsAllowed = toolsAllowed;
|
||||
if (!this.itemsAllowed) {this.itemsAllowed = toolsAllowed;}
|
||||
}
|
||||
|
||||
public boolean areItemsAllowed() {
|
||||
return itemsAllowed;
|
||||
}
|
||||
|
||||
public void setItemsAllowed(boolean itemsAllowed) {
|
||||
this.itemsAllowed = itemsAllowed;
|
||||
}
|
||||
|
||||
public String getRecyclingCenterName() {
|
||||
return recyclingCenterName;
|
||||
}
|
||||
|
||||
public void setRecyclingCenterName(String name) {
|
||||
this.recyclingCenterName = name;
|
||||
}
|
||||
|
||||
public Location getRecyclingCenterLocation() {
|
||||
return loc;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "RecyclingCenterNode(Name="+recyclingCenterName+",x="+loc.getBlockX()+",y="+loc.getBlockY()+",z="+loc.getBlockZ()+",tools="+toolsAllowed+",itemsAllowed="+itemsAllowed+")";
|
||||
}
|
||||
}
|
@ -1,9 +1,7 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -13,14 +11,14 @@ import net.md_5.bungee.api.chat.TextComponent;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class ShopPurchase {
|
||||
UUID player;
|
||||
UUID customer;
|
||||
String player;
|
||||
String customer;
|
||||
ItemStack item;
|
||||
double money;
|
||||
int amt;
|
||||
boolean sell;
|
||||
|
||||
public ShopPurchase(UUID p, UUID customer, ItemStack item, double money, int amt) {
|
||||
public ShopPurchase(String p, String customer, ItemStack item, double money, int amt) {
|
||||
this.player = p;
|
||||
this.customer=customer;
|
||||
this.item=item;
|
||||
@ -29,7 +27,7 @@ public class ShopPurchase {
|
||||
this.sell=true;
|
||||
}
|
||||
|
||||
public ShopPurchase(UUID p, UUID customer, ItemStack item, double money, int amt, boolean sell) {
|
||||
public ShopPurchase(String p, String customer, ItemStack item, double money, int amt, boolean sell) {
|
||||
this.player = p;
|
||||
this.customer=customer;
|
||||
this.item=item;
|
||||
@ -38,11 +36,11 @@ public class ShopPurchase {
|
||||
this.sell=sell;
|
||||
}
|
||||
|
||||
public UUID getSeller() {
|
||||
return Bukkit.getOfflinePlayer(player).getUniqueId();
|
||||
public String getSeller() {
|
||||
return player;
|
||||
}
|
||||
public UUID getCustomer() {
|
||||
return Bukkit.getOfflinePlayer(customer).getUniqueId();
|
||||
public String getCustomer() {
|
||||
return customer;
|
||||
}
|
||||
public ItemStack getItem() {
|
||||
return item;
|
||||
@ -60,7 +58,7 @@ public class ShopPurchase {
|
||||
public TextComponent announcementString() {
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
if (sell) {
|
||||
TextComponent message1 = new TextComponent("Player "+ChatColor.BLUE+WorldShop.getFriendlyOwnerName(customer)+ChatColor.WHITE+" has purchased "+ChatColor.YELLOW+amt+ChatColor.WHITE+" of your ");
|
||||
TextComponent message1 = new TextComponent("Player "+ChatColor.BLUE+customer+ChatColor.WHITE+" has purchased "+ChatColor.YELLOW+amt+ChatColor.WHITE+" of your ");
|
||||
TextComponent message2 = new TextComponent(ChatColor.GREEN+"["+GenericFunctions.GetItemName(this.item)+ChatColor.RESET+""+ChatColor.GREEN+"]");
|
||||
message2.setHoverEvent(new HoverEvent( HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(GenericFunctions.GetItemName(this.item)+WorldShop.GetItemInfo(this.item)).create()));
|
||||
TextComponent message3 = new TextComponent(". You have earned $"+df.format(money)+". "+ChatColor.GRAY+""+ChatColor.ITALIC+"(See /money)");
|
||||
@ -69,7 +67,7 @@ public class ShopPurchase {
|
||||
finalmsg.addExtra(message3);
|
||||
return finalmsg;
|
||||
} else {
|
||||
TextComponent message1 = new TextComponent("Player "+ChatColor.BLUE+WorldShop.getFriendlyOwnerName(customer)+ChatColor.WHITE+" has sold "+ChatColor.YELLOW+amt+ChatColor.WHITE+" ");
|
||||
TextComponent message1 = new TextComponent("Player "+ChatColor.BLUE+customer+ChatColor.WHITE+" has sold "+ChatColor.YELLOW+amt+ChatColor.WHITE+" ");
|
||||
TextComponent message2 = new TextComponent(ChatColor.GREEN+"["+GenericFunctions.GetItemName(this.item)+ChatColor.RESET+""+ChatColor.GREEN+"]");
|
||||
message2.setHoverEvent(new HoverEvent( HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(GenericFunctions.GetItemName(this.item)+WorldShop.GetItemInfo(this.item)).create()));
|
||||
TextComponent message3 = new TextComponent(" to you. $"+df.format(money)+" has been deducted from your bank account. "+ChatColor.GRAY+""+ChatColor.ITALIC+"(Check your shop to collect your items.)");
|
||||
|
@ -1,52 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.MixedDamage;
|
||||
|
||||
public class Spell {
|
||||
String name;
|
||||
int[] cast_time;
|
||||
int[] cooldown_time;
|
||||
MixedDamage[] damage;
|
||||
long last_casted_spell;
|
||||
|
||||
public Spell(String name, int[] cast_time, int[] cooldowns) {
|
||||
this.name=name;
|
||||
this.cast_time=cast_time;
|
||||
this.cooldown_time=cooldowns;
|
||||
this.damage=null;
|
||||
this.last_casted_spell=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
|
||||
public Spell(String name, int[] cast_time, int[] cooldowns, MixedDamage[] damage) {
|
||||
this.name=name;
|
||||
this.cast_time=cast_time;
|
||||
this.cooldown_time=cooldowns;
|
||||
this.damage=damage;
|
||||
this.last_casted_spell=TwosideKeeper.getServerTickTime();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int[] getCastTimes() {
|
||||
return cast_time;
|
||||
}
|
||||
|
||||
public int[] getCooldowns() {
|
||||
return cooldown_time;
|
||||
}
|
||||
|
||||
public MixedDamage[] getDamageValues() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public long getLastCastedTime() {
|
||||
return last_casted_spell;
|
||||
}
|
||||
|
||||
public void setLastCastedTime(long time) {
|
||||
last_casted_spell = time;
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor.EntityType;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class StringConverter {
|
||||
public static Object getValue(String val, Class c) {
|
||||
switch (c.getSimpleName()) {
|
||||
case "Integer":{
|
||||
return Integer.parseInt(val);
|
||||
}
|
||||
case "Double":{
|
||||
return Double.parseDouble(val);
|
||||
}
|
||||
case "Boolean":{
|
||||
return Boolean.parseBoolean(val);
|
||||
}
|
||||
case "EntityType":{
|
||||
return EntityType.valueOf(val);
|
||||
}
|
||||
case "Color":{
|
||||
//return Color.(val);
|
||||
}
|
||||
default:{
|
||||
TwosideKeeper.log("WARNING! Could not convert String to Object class type "+c.getSimpleName(), 1);
|
||||
return val;
|
||||
}
|
||||
}
|
||||
//return Integer.parseInt(val);
|
||||
}
|
||||
}
|
@ -12,6 +12,5 @@ public enum UpgradePath {
|
||||
SCYTHE, //Falls under the 'Weapon' and 'Tool' category.
|
||||
FISHING_ROD, //Falls under the 'Weapon' category.
|
||||
BASIC, //Every category that is not 'Armor'.
|
||||
ALL, //The base category.
|
||||
PROVOKE
|
||||
ALL //The base category.
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user