Partial commit to keep repository up-to-date for transfer. Full notes

about all changes coming in next commit.
dev
sigonasr2 9 years ago
parent b42a610154
commit 77efdd3fcc
  1. BIN
      TwosideKeeper.jar
  2. 7
      src/sig/plugin/TwosideKeeper/AutoUpdatePlugin.java
  3. 20
      src/sig/plugin/TwosideKeeper/Boss/EliteZombie.java
  4. 38
      src/sig/plugin/TwosideKeeper/Boss/MegaWither.java
  5. 2
      src/sig/plugin/TwosideKeeper/ChargeZombie.java
  6. 54
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  7. 4
      src/sig/plugin/TwosideKeeper/DeathManager.java
  8. 9
      src/sig/plugin/TwosideKeeper/Drops/SigDrop.java
  9. 33
      src/sig/plugin/TwosideKeeper/EliteMonster.java
  10. 4
      src/sig/plugin/TwosideKeeper/HelperStructures/ArtifactAbility.java
  11. 125
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  12. 1
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java
  13. 142
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/RecipeLinker.java
  14. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/CustomRecipe.java
  15. 50
      src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java
  16. 28
      src/sig/plugin/TwosideKeeper/HelperStructures/Loot.java
  17. 1
      src/sig/plugin/TwosideKeeper/HelperStructures/LootStructure.java
  18. 43
      src/sig/plugin/TwosideKeeper/HelperStructures/MonsterType.java
  19. 10
      src/sig/plugin/TwosideKeeper/LivingEntityStructure.java
  20. 54
      src/sig/plugin/TwosideKeeper/MonsterController.java
  21. 2
      src/sig/plugin/TwosideKeeper/PlayerStructure.java
  22. 2
      src/sig/plugin/TwosideKeeper/Recipes.java
  23. 1
      src/sig/plugin/TwosideKeeper/RecyclingCenter.java
  24. 5
      src/sig/plugin/TwosideKeeper/SpleefGame.java
  25. 143
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java
  26. 2
      src/sig/plugin/TwosideKeeper/TwosideKeeperAPI.java
  27. 2
      src/sig/plugin/TwosideKeeper/WorldShopManager.java
  28. 8
      src/sig/plugin/TwosideKeeper/runServerHeartbeat.java

Binary file not shown.

@ -34,7 +34,6 @@ public class AutoUpdatePlugin implements Runnable {
try {
FileUtils.copyURLToFile(new URL(plugins.get(i).url), new File(TwosideKeeper.filesave,"updates/"+plugins.get(i).name));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@ -43,20 +42,17 @@ public class AutoUpdatePlugin implements Runnable {
try {
file = new FileInputStream(new File(TwosideKeeper.filesave,"updates/"+plugins.get(i).name));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String md5 = null;
try {
md5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(file);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
file.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
@ -95,7 +91,6 @@ public class AutoUpdatePlugin implements Runnable {
FileUtils.copyFile(new File(TwosideKeeper.filesave,"updates/"+plugins.get(i).name),
new File(TwosideKeeper.filesave,"../"+plugins.get(i).name+".jar"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
}
@ -119,7 +114,6 @@ public class AutoUpdatePlugin implements Runnable {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@ -132,7 +126,6 @@ public class AutoUpdatePlugin implements Runnable {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@ -1,7 +1,5 @@
package sig.plugin.TwosideKeeper.Boss;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -15,8 +13,6 @@ import org.bukkit.Sound;
import org.bukkit.attribute.Attribute;
import org.bukkit.block.Block;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarFlag;
import org.bukkit.boss.BarStyle;
import org.bukkit.entity.AreaEffectCloud;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.EntityType;
@ -31,9 +27,7 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import org.bukkit.util.Vector;
import org.inventivetalent.glow.GlowAPI;
import sig.plugin.TwosideKeeper.ChargeZombie;
import sig.plugin.TwosideKeeper.CustomDamage;
import sig.plugin.TwosideKeeper.EliteMonster;
import sig.plugin.TwosideKeeper.MonsterController;
@ -91,7 +85,7 @@ public class EliteZombie extends EliteMonster{
}
}
private void createBossHealthbar() {
protected void createBossHealthbar() {
List<Player> currentplayers = bar.getPlayers();
for (int i=0;i<currentplayers.size();i++) {
if (!targetlist.contains(currentplayers.get(i))) {
@ -242,15 +236,15 @@ public class EliteZombie extends EliteMonster{
if (Math.random()<=0.01) {
Player p = ChooseRandomTarget();
//p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31));
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.JUMP,20*5,-1,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS,20*1,7,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,20*5,-1,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS,20*1,7,p);
if (Math.random()<=0.25) {
m.setTarget(p);
}
p.setFlying(false);
p.setVelocity(new Vector(0,-1,0));
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.LEVITATION,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.CONFUSION,(int)(20*2.25),0,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,(int)(20*2.25),0,p);
p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f);
p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
}
@ -358,7 +352,7 @@ public class EliteZombie extends EliteMonster{
dpslist.put(p.getName(), currentdps+dmg);
if ((!p.hasPotionEffect(PotionEffectType.WEAKNESS) || GenericFunctions.getPotionEffectLevel(PotionEffectType.WEAKNESS, p)<9) &&
!PlayerMode.isRanger(p)) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.WEAKNESS,35,9,p,true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.WEAKNESS,35,9,p,true);
}
}
last_regen_time=TwosideKeeper.getServerTickTime();
@ -553,7 +547,7 @@ public class EliteZombie extends EliteMonster{
Player p = (Player)ent;
if (storingenergy_hit>0) {
p.playSound(p.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.CONFUSION,20*4,0,p);
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.IGNOREDODGE)) {

@ -1,20 +1,58 @@
package sig.plugin.TwosideKeeper.Boss;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.potion.PotionEffectType;
import sig.plugin.TwosideKeeper.ChargeZombie;
import sig.plugin.TwosideKeeper.EliteMonster;
import sig.plugin.TwosideKeeper.TwosideKeeper;
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
public class MegaWither extends EliteMonster{
static int DROPDOWN_DURATION = 40;
static int DROPDOWN_COOLDOWN = 20*5;
long last_dropdowntime=0;
public MegaWither(Monster m) {
super(m);
m.setAI(false);
}
public void runTick() {
increaseBarTextScroll();
regenerateHealth();
createBossHealthbar();
resetToSpawn();
ignoreAllOtherTargets();
randomlyDropDown();
destroyNearbyBlocks();
}
private void destroyNearbyBlocks() {
if (targetlist.size()>0) {
ChargeZombie.BreakBlocksAroundArea(m, 2);
}
}
private void randomlyDropDown() {
if (last_dropdowntime+DROPDOWN_COOLDOWN<TwosideKeeper.getServerTickTime()) {
last_dropdowntime = TwosideKeeper.getServerTickTime();
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION, 20, -9, m);
}
}
//Triggers when this mob is hit.
public void runHitEvent(LivingEntity damager, double dmg) {
super.runHitEvent(damager,dmg);
m.setAI(true);
}
protected void resetToSpawn() {
super.resetToSpawn();
if (targetlist.size()==0) {
m.setAI(false);
}
}
}

@ -23,7 +23,7 @@ public class ChargeZombie {
return (m.getTarget()!=null)?true:false;
}
public void BreakBlocksAroundArea(int radius) {
public static void BreakBlocksAroundArea(Monster m, int radius) {
int outerradius = radius+1;
for (int x=-radius-1;x<radius+2;x++) {
for (int y=-radius;y<radius+3;y++) {

@ -273,7 +273,7 @@ public class CustomDamage {
* with the TRUEDMG flag set instead.
* @param damage
* @param damager
* @param target
* @param target
* @param weapon
* @param reason
* @param flags
@ -301,6 +301,8 @@ public class CustomDamage {
TwosideKeeper.setPlayerMaxHealth(p);
p.getScoreboard().getTeam(p.getName().toLowerCase()).setSuffix(TwosideKeeper.createHealthbar(((p.getHealth())/p.getMaxHealth())*100,p));
p.getScoreboard().getTeam(p.getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(p));
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.lasthitdesc = reason;
}
}
@ -326,7 +328,7 @@ public class CustomDamage {
pd.thorns_amt+=((1-CalculateDamageReduction(1,target,damager))*pd.lastrawdamage)*0.01;
}
DecimalFormat df = new DecimalFormat("0.00");
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored");
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored",true);
}
}
if (getDamagerEntity(damager) instanceof Enderman) {
@ -364,10 +366,13 @@ public class CustomDamage {
GenericFunctions.SubtractSlayerModeHealth(p, damage);
//p.setHealth(pd.slayermodehp);
//damage=0;
GenericFunctions.removeStealth(p);
if (GenericFunctions.hasStealth(p)) {
GenericFunctions.removeStealth(p);
}
}
pd.slayermegahit=false;
pd.lastcombat=TwosideKeeper.getServerTickTime();
pd.lasthitdesc=reason;
damage = calculateDefenderAbsorption(p, damager, damage);
@ -385,7 +390,7 @@ public class CustomDamage {
//Create an explosion.
TwosideKeeper.log("In here", 5);
Location hitloc = aPlugin.API.getArrowHitLocation(target, a);
GenericFunctions.DealExplosionDamageToEntities(hitloc, getBaseWeaponDamage(weapon,damager,target)+40, 6);
GenericFunctions.DealExplosionDamageToEntities(hitloc, getBaseWeaponDamage(weapon,damager,target)+80, 6);
p.playSound(hitloc, Sound.ENTITY_ENDERDRAGON_FIREBALL_EXPLODE, 0.5f, 1.0f);
aPlugin.API.sendSoundlessExplosion(hitloc, 2);
}
@ -459,7 +464,7 @@ public class CustomDamage {
}
performMegaKnockback(damager,target);
removePermEnchantments(p,weapon);
GenericFunctions.knockOffGreed(p);
//GenericFunctions.knockOffGreed(p);
castEruption(p,target,weapon);
addHealthFromLifesteal(p,damage,weapon);
triggerEliteHitEvent(p,target,damage);
@ -473,13 +478,24 @@ public class CustomDamage {
if (isFlagSet(pd.lasthitproperties,IS_CRIT)) {
GenericFunctions.addSuppressionTime(target, 15);
}
if (isFlagSet(pd.lasthitproperties,IS_PREEMPTIVE)) {
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.WOLFSBANE, 7)) {
if (pd.slayermodehp+2<p.getMaxHealth()) {
pd.slayermodehp+=2;
p.setHealth(pd.slayermodehp);
} else {
pd.slayermodehp=p.getMaxHealth();
p.setHealth(pd.slayermodehp);
}
}
}
}
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.MOONSHADOW, 2)) {
int poisonlv = (int)ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.MOONSHADOW, 2, 2);
if (target.hasPotionEffect(PotionEffectType.BLINDNESS) && GenericFunctions.getPotionEffectLevel(PotionEffectType.BLINDNESS, target)<=poisonlv) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS, 20*15, (int)poisonlv, target);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*15, (int)poisonlv, target);
} else {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS, 20*15, (int)poisonlv, target, true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*15, (int)poisonlv, target, true);
}
}
@ -529,9 +545,9 @@ public class CustomDamage {
int resistancelv = GenericFunctions.getPotionEffectLevel(PotionEffectType.DAMAGE_RESISTANCE, p);
int resistance_duration = GenericFunctions.getPotionEffectDuration(PotionEffectType.DAMAGE_RESISTANCE, p);
if (resistancelv>0) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE, Math.max(resistance_duration,20*20), resistancelv-1, p, true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.DAMAGE_RESISTANCE, Math.max(resistance_duration,20*20), resistancelv-1, p, true);
} else {
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.DAMAGE_RESISTANCE,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.DAMAGE_RESISTANCE,p);
}
pd.swiftaegisamt--;
TwosideKeeper.log(pd.swiftaegisamt+" stacks of Aegis remaining.", 5);
@ -920,7 +936,7 @@ public class CustomDamage {
pd.thorns_amt+=((1-CalculateDamageReduction(1,target,damager))*(rawdmg*0.01));
}
DecimalFormat df = new DecimalFormat("0.00");
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored");
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+((pd.thorns_amt>0)?"/"+ChatColor.GOLD+df.format(pd.thorns_amt):"")+ChatColor.GREEN+" dmg stored",true);
}
return true;
}
@ -1203,8 +1219,8 @@ public class CustomDamage {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (pd.iframetime<TwosideKeeper.getServerTickTime()+ticks) {
pd.iframetime=TwosideKeeper.getServerTickTime()+ticks;
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.GLOWING, ticks, 0, p, true);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.NIGHT_VISION,ticks,64, p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.GLOWING, ticks, 0, p, true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.NIGHT_VISION,ticks,64, p);
}
}
}
@ -1222,10 +1238,10 @@ public class CustomDamage {
if (p!=null) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.iframetime=0;
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.GLOWING,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.GLOWING,p);
int level = GenericFunctions.getPotionEffectLevel(PotionEffectType.NIGHT_VISION, p);
if (level==64) {
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.NIGHT_VISION,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.NIGHT_VISION,p);
}
}
}
@ -1429,6 +1445,8 @@ public class CustomDamage {
Player p = (Player)damager;
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
dmg += 93.182445*pd.velocity*GenericFunctions.getAbilityValue(ArtifactAbility.HIGHWINDER, weapon);
pd.lasthighwinderhit=TwosideKeeper.getServerTickTime();
GenericFunctions.sendActionBarMessage(p, TwosideKeeper.drawVelocityBar(pd.velocity,pd.highwinderdmg),true);
}
return dmg;
}
@ -2059,10 +2077,10 @@ public class CustomDamage {
if (totalmoney>=0.01) {
p_loc.setY(0);
p.teleport(p_loc);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SLOW,20*2,10,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.REGENERATION,20*16,6,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.LEVITATION,20*18,6,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE,20*26,50,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW,20*2,10,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,20*16,6,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,20*18,6,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.DAMAGE_RESISTANCE,20*26,50,p);
DecimalFormat df = new DecimalFormat("0.00");
double rand_amt = 0.0;
if (totalmoney>5) {

@ -33,8 +33,8 @@ public class DeathManager {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
@Override
public void run() {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.LEVITATION,15,-2,p,true);
GenericFunctions.logAndApplyPotionEffectToPlayer(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();

@ -10,6 +10,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
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;
public class SigDrop extends Drop{
@ -26,7 +27,13 @@ public class SigDrop extends Drop{
MonsterDifficulty diff;
public SigDrop(int amount, int weight, String description, boolean isHardened, boolean isSet, int isWeapon, MonsterDifficulty diff) {
super(amount, weight, description);
super(amount, weight,
"["+GenericFunctions.CapitalizeFirstLetters(diff.name().replace("_", " "))+"]"+
((isHardened)?" Hardened":"")+
" Mega"+
(isSet?" Set":"")+
(isWeapon==0?" Armor":isWeapon==1?" Weapon":" Tool")
);
this.isHardened=isHardened;
this.isSet=isSet;
this.isWeapon=isWeapon;

@ -7,10 +7,8 @@ import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.attribute.Attribute;
import org.bukkit.block.Block;
@ -18,25 +16,15 @@ import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarFlag;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.entity.AreaEffectCloud;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.entity.Wither;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import org.bukkit.util.Vector;
import org.inventivetalent.glow.GlowAPI;
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;
public class EliteMonster {
@ -120,7 +108,12 @@ public class EliteMonster {
}
}
private void createBossHealthbar() {
protected void createBossHealthbar() {
if (m instanceof Wither || m instanceof EnderDragon) {
bar.removeAll();
willpower_bar.removeAll();
return;
}
List<Player> currentplayers = bar.getPlayers();
for (int i=0;i<currentplayers.size();i++) {
if (!targetlist.contains(currentplayers.get(i))) {
@ -201,15 +194,15 @@ public class EliteMonster {
if (Math.random()<=0.01) {
Player p = ChooseRandomTarget();
//p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31));
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.JUMP,20*5,-1,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS,20*1,7,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,20*5,-1,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS,20*1,7,p);
if (Math.random()<=0.25) {
m.setTarget(p);
}
p.setFlying(false);
p.setVelocity(new Vector(0,-1,0));
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.LEVITATION,p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.CONFUSION,(int)(20*2.25),0,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.CONFUSION,(int)(20*2.25),0,p);
p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f);
p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f);
}
@ -275,7 +268,7 @@ public class EliteMonster {
public Player ChooseRandomTarget() {
if (targetlist.size()>0) {
Player p = targetlist.get((int)(Math.random() * targetlist.size()));
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS,20*1,7,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS,20*1,7,p);
m.setTarget(p);
TwosideKeeper.log("Set new target to "+p.getName(), 2);
return p;

@ -110,7 +110,7 @@ public enum ArtifactAbility {
//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[]{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 hit 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},
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),*/
@ -627,7 +627,7 @@ public enum ArtifactAbility {
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((16-tier)*0.1d)+ChatColor.RESET);
msg=msg.replace("[GREEDCHANCE]", ChatColor.BLUE+df.format((100d/tier))+ChatColor.RESET);
return msg;
}

@ -1,5 +1,9 @@
package sig.plugin.TwosideKeeper.HelperStructures.Common;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -12,6 +16,7 @@ import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.attribute.Attribute;
import org.bukkit.block.Block;
import org.bukkit.block.Sign;
import org.bukkit.command.CommandSender;
@ -2647,12 +2652,13 @@ public class GenericFunctions {
ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, item)) {
TwosideKeeper.log("Found one.",5);
int tier = item.getEnchantmentLevel(Enchantment.LUCK);
if (Math.random()<=((16-tier)*0.1d)/100d) {
item = ArtifactAbility.downgradeEnchantment(p, item, ArtifactAbility.GREED);p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item)));
if (Math.random()<=(100d/tier)/100d) {
item = ArtifactAbility.downgradeEnchantment(p, item, ArtifactAbility.GREED);
p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item)));
//AwakenedArtifact.setLV(item, AwakenedArtifact.getLV(item)-1, p);
AwakenedArtifact.setMaxAP(item, AwakenedArtifact.getMaxAP(item)-1);
brokeone=true;
break;
return;
}
}
}
@ -2662,11 +2668,12 @@ public class GenericFunctions {
if (isArtifactEquip(item) &&
ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, item)) {
int tier = item.getEnchantmentLevel(Enchantment.LUCK);
if (Math.random()<=((16-tier)*0.1d)/100d) {
if (Math.random()<=(100d/tier)/100d) {
item = ArtifactAbility.downgradeEnchantment(p, item, ArtifactAbility.GREED);
AwakenedArtifact.setLV(item, AwakenedArtifact.getLV(item)-1, p);
p.sendMessage(ChatColor.DARK_AQUA+"A level of "+ChatColor.YELLOW+"Greed"+ChatColor.DARK_AQUA+" has been knocked off of your "+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():UserFriendlyMaterialName(item)));
brokeone=true;
return;
}
}
}
@ -2736,7 +2743,7 @@ public class GenericFunctions {
CustomDamage.addIframe(dodgeduration, p);
logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED,dodgeduration,2,p);
logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,dodgeduration,2,p);
}
}
}
@ -2746,11 +2753,11 @@ public class GenericFunctions {
return (int)(cooldown*(1-cdr));
}
public static void logAndApplyPotionEffectToPlayer(PotionEffectType type, int ticks, int amplifier, LivingEntity p) {
logAndApplyPotionEffectToPlayer(type,ticks,amplifier,p,false);
public static void logAndApplyPotionEffectToEntity(PotionEffectType type, int ticks, int amplifier, LivingEntity p) {
logAndApplyPotionEffectToEntity(type,ticks,amplifier,p,false);
}
public static void logAndApplyPotionEffectToPlayer(PotionEffectType type, int ticks, int amplifier, LivingEntity p, boolean force) {
public static void logAndApplyPotionEffectToEntity(PotionEffectType type, int ticks, int amplifier, LivingEntity p, boolean force) {
TwosideKeeper.log(ChatColor.WHITE+"Adding Potion Effect "+type.getName()+" "+WorldShop.toRomanNumeral((amplifier+1))+"("+amplifier+") to "+p.getName()+" with "+ticks+" tick duration. "+((force)?ChatColor.RED+"FORCED":""), TwosideKeeper.POTION_DEBUG_LEVEL);
if (p.hasPotionEffect(type)) {
TwosideKeeper.log(ChatColor.YELLOW+" Already had effect on Player "+p.getName()+". "+type.getName()+" "+WorldShop.toRomanNumeral((getPotionEffectLevel(type,p)+1))+"("+getPotionEffectLevel(type,p)+"), Duration: "+getPotionEffectDuration(type,p)+" ticks", TwosideKeeper.POTION_DEBUG_LEVEL);
@ -2776,10 +2783,10 @@ public class GenericFunctions {
}
}
public static void logAndRemovePotionEffectFromPlayer(PotionEffectType type, LivingEntity p) {
public static void logAndRemovePotionEffectFromEntity(PotionEffectType type, LivingEntity p) {
TwosideKeeper.log(ChatColor.WHITE+"Removing Potion Effect "+type+" "+WorldShop.toRomanNumeral((getPotionEffectLevel(type,p)+1))+"("+getPotionEffectLevel(type,p)+") on Player "+p.getName()+" Duration: "+getPotionEffectDuration(type,p)+" ticks by adding a 0 duration version of this effect.", TwosideKeeper.POTION_DEBUG_LEVEL);
//p.removePotionEffect(type);
logAndApplyPotionEffectToPlayer(type,1,0,p,true);
logAndApplyPotionEffectToEntity(type,1,0,p,true);
if (p.hasPotionEffect(type)) {
TwosideKeeper.log(ChatColor.DARK_RED+" Effect on Player "+p.getName()+" is now "+type+" "+WorldShop.toRomanNumeral((getPotionEffectLevel(type,p)+1))+"("+getPotionEffectLevel(type,p)+"), Duration: "+getPotionEffectDuration(type,p)+" ticks", TwosideKeeper.POTION_DEBUG_LEVEL);
TwosideKeeper.log(ChatColor.RED+"THIS SHOULD NOT BE HAPPENING! Reporting", TwosideKeeper.POTION_DEBUG_LEVEL);
@ -2974,7 +2981,7 @@ public class GenericFunctions {
if (pd.last_rejuvenate+GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player)<=TwosideKeeper.getServerTickTime()) {
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0f, 1.0f);
addIFrame(player,40);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.REGENERATION,200,9,player,true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,200,9,player,true);
aPlugin.API.sendCooldownPacket(player, player.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player));
}
}
@ -3305,7 +3312,7 @@ public class GenericFunctions {
RevivePlayer(p,p.getMaxHealth());
pd.slayermodehp = p.getMaxHealth();
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {GenericFunctions.applyStealth(p,false);}
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED, 20*10, 3, p, true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED, 20*10, 3, p, true);
deAggroNearbyTargets(p);
revived=true;
Bukkit.broadcastMessage(ChatColor.GOLD+p.getName()+ChatColor.WHITE+" almost died... But came back to life!");
@ -3367,11 +3374,11 @@ public class GenericFunctions {
public static void deAggroNearbyTargets(Player p) {
//List<Monster> monsters = getNearbyMobs(p.getLocation(),8);
List<Monster> monsters = CustomDamage.trimNonMonsterEntities(p.getNearbyEntities(8, 8, 8));
List<Monster> monsters = CustomDamage.trimNonMonsterEntities(p.getNearbyEntities(24, 24, 24));
for (Monster m : monsters) {
if (m.getTarget()!=null &&
m.getTarget().equals(p) &&
m.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,5,0))) {
!m.hasPotionEffect(PotionEffectType.GLOWING)) {
m.setTarget(null);
}
}
@ -3384,7 +3391,7 @@ public class GenericFunctions {
if (isBadEffect(eff.getType())) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin,
() -> {
logAndRemovePotionEffectFromPlayer(eff.getType(),p);
logAndRemovePotionEffectFromEntity(eff.getType(),p);
}, 1);
}
}
@ -3543,13 +3550,17 @@ public class GenericFunctions {
Player p = (Player)damager;
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.last_strikerspell = pd.last_strikerspell-40;
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), (int)(GetModifiedCooldown(TwosideKeeper.LINEDRIVE_COOLDOWN,p)-(TwosideKeeper.getServerTickTime()-pd.last_strikerspell)));
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), GetRemainingCooldownTime(p, pd.last_strikerspell, TwosideKeeper.LINEDRIVE_COOLDOWN));
}
updateNoDamageTickMap(m,(Player)damager);
}
}
}
}
public static int GetRemainingCooldownTime(Player p, long current_cooldown, int cooldown_time) {
return (int)(GetModifiedCooldown(cooldown_time,p)-(TwosideKeeper.getServerTickTime()-current_cooldown));
}
public static List<LivingEntity> getNearbyMobs(Location l, int range) {
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
@ -3818,10 +3829,10 @@ public class GenericFunctions {
if (resistancelv+swiftaegislv<9) {
//Apply it directly.
pd.swiftaegisamt+=swiftaegislv;
logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration), (resistancelv+swiftaegislv),p,true);
logAndApplyPotionEffectToEntity(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration), (resistancelv+swiftaegislv),p,true);
} else {
pd.swiftaegisamt+=Math.max(9-resistancelv,0);
logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration),9,p,true);
logAndApplyPotionEffectToEntity(PotionEffectType.DAMAGE_RESISTANCE, Math.max(20*20, resistance_duration),9,p,true);
}
}
TwosideKeeper.log("New Aegis level: "+pd.swiftaegisamt,5);
@ -3856,11 +3867,11 @@ public class GenericFunctions {
int currentlv = getPotionEffectLevel(type,p);
PotionEffect neweffect = new PotionEffect(type,tick_duration,(currentlv+incr_amt<maxlv)?(currentlv+incr_amt):maxlv);
if (tick_duration+BUFFER >= duration) {
logAndApplyPotionEffectToPlayer(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
}
} else {
PotionEffect neweffect = new PotionEffect(type,tick_duration,0);
logAndApplyPotionEffectToPlayer(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
}
}
@ -3874,7 +3885,9 @@ public class GenericFunctions {
if (set!=null &&
(set==ItemSet.LORASYS ||
set==ItemSet.GLADOMAIN ||
set==ItemSet.MOONSHADOW)) {
set==ItemSet.MOONSHADOW ||
set==ItemSet.WOLFSBANE ||
set==ItemSet.ALUSTINE)) {
return true;
}
}
@ -3909,7 +3922,7 @@ public class GenericFunctions {
}
if (Math.random()<=removechance/100) {
if (type!=null && (!type.equals(PotionEffectType.WEAKNESS) || level<9)) {
GenericFunctions.logAndRemovePotionEffectFromPlayer(type,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(type,p);
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " ")));
}
}
@ -3944,11 +3957,11 @@ public class GenericFunctions {
public static void logToFile(String message) {
try {
if (!TwosideKeeper.getT.exists()) {
savePath.mkdir();
if (!TwosideKeeper.filesave.exists()) {
TwosideKeeper.filesave.mkdir();
}
File saveTo = new File(plugin.getDataFolder(), "aPluginLogger.txt");
File saveTo = new File(TwosideKeeper.filesave, "TwosideKeeperlogger.txt");
if (!saveTo.exists()) {
saveTo.createNewFile();
}
@ -3974,13 +3987,13 @@ public class GenericFunctions {
}
public static void applyStealth(Player p, boolean blindness_effect) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 111, p, true);
if (blindness_effect) {GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.BLINDNESS, 20*2, 111, p);}
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 111, p, true);
if (blindness_effect) {GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*2, 111, p);}
p.playSound(p.getLocation(), Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 0.5f);
}
public static void removeStealth(Player p) {
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.INVISIBILITY, p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.INVISIBILITY, p);
GenericFunctions.addIFrame(p, 10);
p.playSound(p.getLocation(), Sound.BLOCK_REDSTONE_TORCH_BURNOUT, 1.0f, 1.0f);
}
@ -4003,7 +4016,7 @@ public class GenericFunctions {
Vector facing = p.getLocation().getDirection();
if (!second_charge) {
facing = p.getLocation().getDirection().setY(0);
logAndApplyPotionEffectToPlayer(PotionEffectType.SLOW,(ex_version)?7:15,20,p);
logAndApplyPotionEffectToEntity(PotionEffectType.SLOW,(ex_version)?7:15,20,p);
}
if (!ex_version || second_charge) {
aPlugin.API.sendCooldownPacket(p, weaponused, GetModifiedCooldown(TwosideKeeper.LINEDRIVE_COOLDOWN,p));
@ -4081,6 +4094,7 @@ public class GenericFunctions {
mult += 2.0;
pitch-=1.0;
}
Location originalloc = player.getLocation().clone();
Location teleloc = target.getLocation().add(target.getLocation().getDirection().multiply(-1.0-mult));
int i=0;
while (teleloc.getBlock().getType().isSolid() || teleloc.getBlock().getType()==Material.BEDROCK) {
@ -4105,15 +4119,32 @@ public class GenericFunctions {
}
player.playSound(teleloc, Sound.BLOCK_NOTE_SNARE, 1.0f, 1.0f);
teleloc.setPitch((float)pitch);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(player);
player.teleport(teleloc);
Location newfacingdir = target.getLocation().setDirection(target.getLocation().getDirection());
target.teleport(newfacingdir);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(player);
if (name!=Material.SKULL_ITEM || pd.lastlifesavertime+GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,player)<TwosideKeeper.getServerTickTime()) { //Don't overwrite life saver cooldowns.
aPlugin.API.sendCooldownPacket(player, name, GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,player));
}
pd.lastassassinatetime=TwosideKeeper.getServerTickTime();
GenericFunctions.addIFrame(player, 10);
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(player), player, ItemSet.WOLFSBANE, 5)) {
GenericFunctions.addIFrame(player, (int)ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getHotbarItems(player), player, ItemSet.WOLFSBANE, 5, 4));
} else {
GenericFunctions.addIFrame(player, 10);
}
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(player), player, ItemSet.WOLFSBANE, 3)) {
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED, 100, 4, player);
GenericFunctions.addSuppressionTime(target, (int)ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getHotbarItems(player), player, ItemSet.WOLFSBANE, 3, 3));
}
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(player), player, ItemSet.WOLFSBANE, 7) &&
target.getLocation().distanceSquared(originalloc)<=25) {
if (name!=Material.SKULL_ITEM || pd.lastlifesavertime+GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,player)<TwosideKeeper.getServerTickTime()) { //Don't overwrite life saver cooldowns.
pd.lastassassinatetime = TwosideKeeper.getServerTickTime()-TwosideKeeper.ASSASSINATE_COOLDOWN+40;
aPlugin.API.sendCooldownPacket(player, name, 40);
}
}
}
}
@ -4199,8 +4230,10 @@ public class GenericFunctions {
}
if (ent instanceof LivingEntity) {
LivingEntity l = (LivingEntity)ent;
l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,ticks,99));
l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,ticks,99));
//l.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,ticks,99));
TwosideKeeper.log("Base Value: "+l.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue(), 5);
l.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(0d);
l.setAI(false);
}
}
@ -4219,14 +4252,24 @@ public class GenericFunctions {
};
}
//Automatically appends status effect buffs to the beginning of it.
public static void sendActionBarMessage(Player p, String message) {
String prefix=ActionBarBuffUpdater.getActionBarPrefix(p);
if (prefix.length()>0) {
aPlugin.API.sendActionBarMessage(p, message+" "+prefix);
} else {
if (message.length()>0) {
aPlugin.API.sendActionBarMessage(p, message);
sendActionBarMessage(p,message,false);
}
//Automatically appends status effect buffs to the beginning of it.
public static void sendActionBarMessage(Player p, String message, boolean important) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (important || (pd.lastimportantactionbarmsg+20<TwosideKeeper.getServerTickTime())) {
String prefix=ActionBarBuffUpdater.getActionBarPrefix(p);
if (prefix.length()>0) {
aPlugin.API.sendActionBarMessage(p, message+" "+prefix);
} else {
if (message.length()>0) {
aPlugin.API.sendActionBarMessage(p, message);
}
}
if (important) {
pd.lastimportantactionbarmsg=TwosideKeeper.getServerTickTime();
}
}
}
@ -4262,6 +4305,8 @@ public class GenericFunctions {
return new EliteZombie(target);
}
if (target instanceof Wither) {
target.setMaxHealth(188000);
target.setHealth(188000);
return new MegaWither(target);
}
TwosideKeeper.log("Elite Monster for monster "+target.getName()+" UNDEFINED. Defaulting to EliteZombie type.", 0);

@ -122,7 +122,6 @@ public class Habitation {
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@ -12,341 +12,341 @@ import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType;
import sig.plugin.TwosideKeeper.HelperStructures.CustomItem;
public enum RecipeLinker {
ic(ChatColor.YELLOW,"Item Cube",
ic("Containers",ChatColor.YELLOW,"Item Cube",
new ItemStack[]{
CustomItem.ItemCube(),
new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),
new ItemStack(Material.WOOD),new ItemStack(Material.CHEST),new ItemStack(Material.WOOD),
new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),
}),
lic(ChatColor.YELLOW,"Large Item Cube",new ItemStack[]{
lic("Containers",ChatColor.YELLOW,"Large Item Cube",new ItemStack[]{
CustomItem.LargeItemCube(),
new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),
new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.CHEST),new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),new ItemStack(Material.WOOD),
}),
eic(ChatColor.YELLOW,"Ender Item Cube",new ItemStack[]{
eic("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.CHEST),new ItemStack(Material.EMERALD),
new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),new ItemStack(Material.OBSIDIAN),
}),
dc(ChatColor.YELLOW,"Duplicate Ender Item Cube",new ItemStack[]{
dc("Containers",ChatColor.YELLOW,"Duplicate Ender Item Cube",new ItemStack[]{
CustomItem.EnderItemCube(2),
CustomItem.EnderItemCube(),new ItemStack(Material.NETHER_STAR)
}),
aq(ChatColor.RED,"Arrow Quiver",new ItemStack[]{
aq("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),
null,new ItemStack(Material.LEATHER)
}),
ihelm(ChatColor.WHITE,"Hardened Iron Helmet",new ItemStack[]{
ihelm("Hardened Armor",ChatColor.WHITE,"Hardened Iron Helmet",new ItemStack[]{
CustomItem.HardenedPiece(Material.IRON_HELMET),
new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),
new ItemStack(Material.IRON_BLOCK),null,new ItemStack(Material.IRON_BLOCK)
}),
ichest(ChatColor.WHITE,"Hardened Iron Chestplate",new ItemStack[]{
ichest("Hardened Armor",ChatColor.WHITE,"Hardened Iron Chestplate",new ItemStack[]{
CustomItem.HardenedPiece(Material.IRON_CHESTPLATE),
new ItemStack(Material.IRON_BLOCK),null,new ItemStack(Material.IRON_BLOCK),
new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),
new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK)
}),
ileg(ChatColor.WHITE,"Hardened Iron Leggings",new ItemStack[]{
ileg("Hardened Armor",ChatColor.WHITE,"Hardened Iron Leggings",new ItemStack[]{
CustomItem.HardenedPiece(Material.IRON_LEGGINGS),
new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),new ItemStack(Material.IRON_BLOCK),
new ItemStack(Material.IRON_BLOCK),null,new ItemStack(Material.IRON_BLOCK),
new ItemStack(Material.IRON_BLOCK),null,new ItemStack(Material.IRON_BLOCK)
}),
iboots(ChatColor.WHITE,"Hardened Iron Boots",new ItemStack[]{
iboots("Hardened Armor",ChatColor.WHITE,"Hardened Iron Boots",new ItemStack[]{
CustomItem.HardenedPiece(Material.IRON_BOOTS),
new ItemStack(Material.IRON_BLOCK),null,new ItemStack(Material.IRON_BLOCK),
new ItemStack(Material.IRON_BLOCK),null,new ItemStack(Material.IRON_BLOCK)
}),
dhelm(ChatColor.AQUA,"Hardened Diamond Helmet",new ItemStack[]{
dhelm("Hardened Armor",ChatColor.AQUA,"Hardened Diamond Helmet",new ItemStack[]{
CustomItem.HardenedPiece(Material.DIAMOND_HELMET),
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.DIAMOND_BLOCK),null,new ItemStack(Material.DIAMOND_BLOCK)
}),
dchest(ChatColor.AQUA,"Hardened Diamond Chestplate",new ItemStack[]{
dchest("Hardened Armor",ChatColor.AQUA,"Hardened Diamond Chestplate",new ItemStack[]{
CustomItem.HardenedPiece(Material.DIAMOND_CHESTPLATE),
new ItemStack(Material.DIAMOND_BLOCK),null,new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK)
}),
dleg(ChatColor.AQUA,"Hardened Diamond Leggings",new ItemStack[]{
dleg("Hardened Armor",ChatColor.AQUA,"Hardened Diamond Leggings",new ItemStack[]{
CustomItem.HardenedPiece(Material.DIAMOND_LEGGINGS),
new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.DIAMOND_BLOCK),null,new ItemStack(Material.DIAMOND_BLOCK),null,
new ItemStack(Material.DIAMOND_BLOCK),null,new ItemStack(Material.DIAMOND_BLOCK)
}),
dboots(ChatColor.AQUA,"Hardened Diamond Boots",new ItemStack[]{
dboots("Hardened Armor",ChatColor.AQUA,"Hardened Diamond Boots",new ItemStack[]{
CustomItem.HardenedPiece(Material.DIAMOND_BOOTS),
new ItemStack(Material.DIAMOND_BLOCK),null,new ItemStack(Material.DIAMOND_BLOCK),
new ItemStack(Material.DIAMOND_BLOCK),null,new ItemStack(Material.DIAMOND_BLOCK)
}),
ghelm(ChatColor.GOLD,"Hardened Gold Helmet",new ItemStack[]{
ghelm("Hardened Armor",ChatColor.GOLD,"Hardened Gold Helmet",new ItemStack[]{
CustomItem.HardenedPiece(Material.GOLD_HELMET),
new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.GOLD_BLOCK),null,new ItemStack(Material.GOLD_BLOCK)
}),
gchest(ChatColor.GOLD,"Hardened Gold Chestplate",new ItemStack[]{
gchest("Hardened Armor",ChatColor.GOLD,"Hardened Gold Chestplate",new ItemStack[]{
CustomItem.HardenedPiece(Material.GOLD_CHESTPLATE),
new ItemStack(Material.GOLD_BLOCK),null,new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK)
}),
gleg(ChatColor.GOLD,"Hardened Gold Leggings",new ItemStack[]{
gleg("Hardened Armor",ChatColor.GOLD,"Hardened Gold Leggings",new ItemStack[]{
CustomItem.HardenedPiece(Material.GOLD_LEGGINGS),
new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.GOLD_BLOCK),null,new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.GOLD_BLOCK),null,new ItemStack(Material.GOLD_BLOCK)
}),
gboots(ChatColor.GOLD,"Hardened Gold Boots",new ItemStack[]{
gboots("Hardened Armor",ChatColor.GOLD,"Hardened Gold Boots",new ItemStack[]{
CustomItem.HardenedPiece(Material.GOLD_BOOTS),
new ItemStack(Material.GOLD_BLOCK),null,new ItemStack(Material.GOLD_BLOCK),
new ItemStack(Material.GOLD_BLOCK),null,new ItemStack(Material.GOLD_BLOCK)
}),
@SuppressWarnings("deprecation")
wool(ChatColor.BLUE,"Wool Recoloring",new ItemStack[]{
wool("Misc Items",ChatColor.BLUE,"Wool Recoloring",new ItemStack[]{
new ItemStack(Material.WOOL,8,(short)11),
new ItemStack(Material.WOOL,1,(short)2),new ItemStack(Material.WOOL,1,(short)3),new ItemStack(Material.WOOL,1,(short)5),
new ItemStack(Material.WOOL,1,(short)7),new ItemStack(Material.getMaterial(351),1,(short)4),new ItemStack(Material.WOOL,1,(short)8),
new ItemStack(Material.WOOL,1,(short)13),new ItemStack(Material.WOOL,1,(short)11),new ItemStack(Material.WOOL,1,(short)9)
}),
slab(ChatColor.BLUE,"Slab Reconstruction",new ItemStack[]{
slab("Misc Items",ChatColor.BLUE,"Slab Reconstruction",new ItemStack[]{
new ItemStack(Material.WOOD,1,(short)2),
new ItemStack(Material.WOOD_STEP,1,(short)2),new ItemStack(Material.WOOD_STEP,1,(short)2)
}),
check(ChatColor.BLUE,"Money Check",new ItemStack[]{
check("Misc Items",ChatColor.BLUE,"Money Check",new ItemStack[]{
CustomItem.MoneyCheck(),
new ItemStack(Material.FEATHER),new ItemStack(Material.INK_SACK),null,
new ItemStack(Material.PAPER),
}),
sword(ChatColor.LIGHT_PURPLE,"Artifact Sword Recipe",new ItemStack[]{
sword("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Sword Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.SWORD),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
axe(ChatColor.LIGHT_PURPLE,"Artifact Axe Recipe",new ItemStack[]{
axe("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Axe Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.AXE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
boots(ChatColor.LIGHT_PURPLE,"Artifact Boots Recipe",new ItemStack[]{
boots("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Boots Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.BOOTS),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
}),
chest(ChatColor.LIGHT_PURPLE,"Artifact Chestplate Recipe",new ItemStack[]{
chest("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Chestplate Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.CHESTPLATE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
leg(ChatColor.LIGHT_PURPLE,"Artifact Leggings Recipe",new ItemStack[]{
leg("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Leggings Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.LEGGINGS),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
helm(ChatColor.LIGHT_PURPLE,"Artifact Helmet Recipe",new ItemStack[]{
helm("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Helmet Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.HELMET),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
bow(ChatColor.LIGHT_PURPLE,"Artifact Bow Recipe",new ItemStack[]{
bow("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Bow Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.BOW),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
scythe(ChatColor.LIGHT_PURPLE,"Artifact Scythe Recipe",new ItemStack[]{
scythe("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Scythe Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.HOE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
rod(ChatColor.LIGHT_PURPLE,"Artifact Fishing Rod Recipe",new ItemStack[]{
rod("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Fishing Rod Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.FISHING_ROD),
null,null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE)
}),
pickaxe(ChatColor.LIGHT_PURPLE,"Artifact Pickaxe Recipe",new ItemStack[]{
pickaxe("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Pickaxe Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.PICKAXE),
Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null
}),
shovel(ChatColor.LIGHT_PURPLE,"Artifact Shovel Recipe",new ItemStack[]{
shovel("Artifact Recipes",ChatColor.LIGHT_PURPLE,"Artifact Shovel Recipe",new ItemStack[]{
Artifact.createRecipe(0, ArtifactItemType.SHOVEL),
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null,
null,Artifact.createArtifactItem(ArtifactItem.MYSTERIOUS_ESSENCE),null
}),
recipe(ChatColor.DARK_AQUA,"Recipe To Artifact",new ItemStack[]{
recipe("Artifact Recipes",ChatColor.DARK_AQUA,"Recipe To Artifact",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.CHESTPLATE.getTieredItem(1),1,ArtifactItemType.CHESTPLATE.getDataValue()),
Artifact.createRecipe(0, ArtifactItemType.CHESTPLATE)
}),
t2(ChatColor.DARK_AQUA,"Upgrade to T2",new ItemStack[]{
t2("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T2",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.SHOVEL.getTieredItem(2),2,ArtifactItemType.SHOVEL.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.SHOVEL.getTieredItem(1),1,ArtifactItemType.SHOVEL.getDataValue()),Artifact.createRecipe(0, ArtifactItemType.SHOVEL)
}),
t3(ChatColor.DARK_AQUA,"Upgrade to T3",new ItemStack[]{
t3("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T3",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.LEGGINGS.getTieredItem(3),3,ArtifactItemType.LEGGINGS.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.LEGGINGS.getTieredItem(2),2,ArtifactItemType.LEGGINGS.getDataValue()),Artifact.createRecipe(2, ArtifactItemType.LEGGINGS)
}),
t4(ChatColor.DARK_AQUA,"Upgrade to T4",new ItemStack[]{
t4("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T4",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.BOOTS.getTieredItem(4),4,ArtifactItemType.BOOTS.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.BOOTS.getTieredItem(3),3,ArtifactItemType.BOOTS.getDataValue()),Artifact.createRecipe(3, ArtifactItemType.BOOTS)
}),
t5(ChatColor.DARK_AQUA,"Upgrade to T5",new ItemStack[]{
t5("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T5",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.HELMET.getTieredItem(5),5,ArtifactItemType.HELMET.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.HELMET.getTieredItem(4),4,ArtifactItemType.HELMET.getDataValue()),Artifact.createRecipe(4, ArtifactItemType.HELMET)
}),
t6(ChatColor.DARK_AQUA,"Upgrade to T6",new ItemStack[]{
t6("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T6",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.SWORD.getTieredItem(6),6,ArtifactItemType.SWORD.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.SWORD.getTieredItem(5),5,ArtifactItemType.SWORD.getDataValue()),Artifact.createRecipe(5, ArtifactItemType.SWORD)
}),
t7(ChatColor.DARK_AQUA,"Upgrade to T7",new ItemStack[]{
t7("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T7",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.HOE.getTieredItem(7),7,ArtifactItemType.HOE.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.HOE.getTieredItem(6),6,ArtifactItemType.HOE.getDataValue()),Artifact.createRecipe(6, ArtifactItemType.HOE)
}),
t8(ChatColor.DARK_AQUA,"Upgrade to T8",new ItemStack[]{
t8("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T8",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.AXE.getTieredItem(8),8,ArtifactItemType.AXE.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.AXE.getTieredItem(7),7,ArtifactItemType.AXE.getDataValue()),Artifact.createRecipe(7, ArtifactItemType.AXE)
}),
t9(ChatColor.DARK_AQUA,"Upgrade to T9",new ItemStack[]{
t9("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T9",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.PICKAXE.getTieredItem(9),9,ArtifactItemType.PICKAXE.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.PICKAXE.getTieredItem(8),8,ArtifactItemType.PICKAXE.getDataValue()),Artifact.createRecipe(8, ArtifactItemType.PICKAXE)
}),
t10(ChatColor.DARK_AQUA,"Upgrade to T10",new ItemStack[]{
t10("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T10",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.SHOVEL.getTieredItem(10),10,ArtifactItemType.SHOVEL.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.SHOVEL.getTieredItem(9),9,ArtifactItemType.SHOVEL.getDataValue()),Artifact.createRecipe(9, ArtifactItemType.SHOVEL)
}),
t11(ChatColor.DARK_AQUA,"Upgrade to T11",new ItemStack[]{
t11("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T11",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.PICKAXE.getTieredItem(11),11,ArtifactItemType.PICKAXE.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.PICKAXE.getTieredItem(10),10,ArtifactItemType.PICKAXE.getDataValue()),Artifact.createRecipe(10, ArtifactItemType.PICKAXE)
}),
t12(ChatColor.DARK_AQUA,"Upgrade to T12",new ItemStack[]{
t12("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T12",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.AXE.getTieredItem(12),12,ArtifactItemType.AXE.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.AXE.getTieredItem(11),11,ArtifactItemType.AXE.getDataValue()),Artifact.createRecipe(11, ArtifactItemType.AXE)
}),
t13(ChatColor.DARK_AQUA,"Upgrade to T13",new ItemStack[]{
t13("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T13",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.HOE.getTieredItem(13),13,ArtifactItemType.HOE.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.HOE.getTieredItem(12),12,ArtifactItemType.HOE.getDataValue()),Artifact.createRecipe(12, ArtifactItemType.HOE)
}),
t14(ChatColor.DARK_AQUA,"Upgrade to T14",new ItemStack[]{
t14("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T14",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.FISHING_ROD.getTieredItem(14),14,ArtifactItemType.FISHING_ROD.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.FISHING_ROD.getTieredItem(13),13,ArtifactItemType.FISHING_ROD.getDataValue()),Artifact.createRecipe(13, ArtifactItemType.FISHING_ROD)
}),
t15(ChatColor.DARK_AQUA,"Upgrade to T15",new ItemStack[]{
t15("Upgrade Recipes",ChatColor.DARK_AQUA,"Upgrade to T15",new ItemStack[]{
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.BOW.getTieredItem(15),15,ArtifactItemType.BOW.getDataValue()),
AwakenedArtifact.convertToAwakenedArtifact(ArtifactItemType.BOW.getTieredItem(14),14,ArtifactItemType.BOW.getDataValue()),Artifact.createRecipe(14, ArtifactItemType.BOW)
}),
t2recipe(ChatColor.WHITE,"T2 Artifact Recipe",new ItemStack[]{
t2recipe("Artifact Recipes",ChatColor.WHITE,"T2 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(2, ArtifactItemType.SHOVEL),
Artifact.createRecipe(0, ArtifactItemType.SHOVEL),Artifact.createRecipe(0, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_ESSENCE)
}),
t3recipe(ChatColor.WHITE,"T3 Artifact Recipe",new ItemStack[]{
t3recipe("Artifact Recipes",ChatColor.WHITE,"T3 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(3, ArtifactItemType.SHOVEL),
Artifact.createRecipe(2, ArtifactItemType.SHOVEL),Artifact.createRecipe(2, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE)
}),
t4recipe(ChatColor.WHITE,"T4 Artifact Recipe",new ItemStack[]{
t4recipe("Artifact Recipes",ChatColor.WHITE,"T4 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(4, ArtifactItemType.SHOVEL),
Artifact.createRecipe(3, ArtifactItemType.SHOVEL),Artifact.createRecipe(3, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_BASE)
}),
t5recipe(ChatColor.WHITE,"T5 Artifact Recipe",new ItemStack[]{
t5recipe("Artifact Recipes",ChatColor.WHITE,"T5 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(5, ArtifactItemType.SHOVEL),
Artifact.createRecipe(4, ArtifactItemType.SHOVEL),Artifact.createRecipe(4, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE)
}),
t6recipe(ChatColor.WHITE,"T6 Artifact Recipe",new ItemStack[]{
t6recipe("Artifact Recipes",ChatColor.WHITE,"T6 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(6, ArtifactItemType.SHOVEL),
Artifact.createRecipe(5, ArtifactItemType.SHOVEL),Artifact.createRecipe(5, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE)
}),
t7recipe(ChatColor.WHITE,"T7 Artifact Recipe",new ItemStack[]{
t7recipe("Artifact Recipes",ChatColor.WHITE,"T7 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(7, ArtifactItemType.SHOVEL),
Artifact.createRecipe(6, ArtifactItemType.SHOVEL),Artifact.createRecipe(6, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.ANCIENT_BASE)
}),
t8recipe(ChatColor.WHITE,"T8 Artifact Recipe",new ItemStack[]{
t8recipe("Artifact Recipes",ChatColor.WHITE,"T8 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(8, ArtifactItemType.SHOVEL),
Artifact.createRecipe(7, ArtifactItemType.SHOVEL),Artifact.createRecipe(7, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE)
}),
t9recipe(ChatColor.WHITE,"T9 Artifact Recipe",new ItemStack[]{
t9recipe("Artifact Recipes",ChatColor.WHITE,"T9 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(9, ArtifactItemType.SHOVEL),
Artifact.createRecipe(8, ArtifactItemType.SHOVEL),Artifact.createRecipe(8, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.LOST_CORE)
}),
t10recipe(ChatColor.WHITE,"T10 Artifact Recipe",new ItemStack[]{
t10recipe("Artifact Recipes",ChatColor.WHITE,"T10 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(10, ArtifactItemType.SHOVEL),
Artifact.createRecipe(9, ArtifactItemType.SHOVEL),Artifact.createRecipe(9, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.LOST_BASE)
}),
t11recipe(ChatColor.WHITE,"T11 Artifact Recipe",new ItemStack[]{
t11recipe("Artifact Recipes",ChatColor.WHITE,"T11 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(11, ArtifactItemType.SHOVEL),
Artifact.createRecipe(10, ArtifactItemType.SHOVEL),Artifact.createRecipe(10, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE)
}),
t12recipe(ChatColor.WHITE,"T12 Artifact Recipe",new ItemStack[]{
t12recipe("Artifact Recipes",ChatColor.WHITE,"T12 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(12, ArtifactItemType.SHOVEL),
Artifact.createRecipe(11, ArtifactItemType.SHOVEL),Artifact.createRecipe(11, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE)
}),
t13recipe(ChatColor.WHITE,"T13 Artifact Recipe",new ItemStack[]{
t13recipe("Artifact Recipes",ChatColor.WHITE,"T13 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(13, ArtifactItemType.SHOVEL),
Artifact.createRecipe(12, ArtifactItemType.SHOVEL),Artifact.createRecipe(12, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.DIVINE_BASE)
}),
t14recipe(ChatColor.WHITE,"T14 Artifact Recipe",new ItemStack[]{
t14recipe("Artifact Recipes",ChatColor.WHITE,"T14 Artifact Recipe",new ItemStack[]{
Artifact.createRecipe(14, ArtifactItemType.SHOVEL),
Artifact.createRecipe(13, ArtifactItemType.SHOVEL),Artifact.createRecipe(13, ArtifactItemType.SHOVEL),null,
Artifact.createArtifactItem(ArtifactItem.DIVINE_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE),
Artifact.createArtifactItem(ArtifactItem.DIVINE_BASE)
}),
tierup(ChatColor.YELLOW,"Increase Artifact Material Tier",new ItemStack[]{
tierup("Artifact Recipes",ChatColor.YELLOW,"Increase Artifact Material Tier",new ItemStack[]{
Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE),
Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE)
}),
tierdown(ChatColor.YELLOW,"Decrease Artifact Material Tier",new ItemStack[]{
tierdown("Artifact Recipes",ChatColor.YELLOW,"Decrease Artifact Material Tier",new ItemStack[]{
Artifact.createArtifactItem(ArtifactItem.ANCIENT_ESSENCE,2),
Artifact.createArtifactItem(ArtifactItem.LOST_ESSENCE)
}),
empower(ChatColor.YELLOW,"Empower Artifact Materials to Divine Tier",new ItemStack[]{
empower("Artifact Recipes",ChatColor.YELLOW,"Empower Artifact Materials to Divine Tier",new ItemStack[]{
Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE),
Artifact.createArtifactItem(ArtifactItem.ARTIFACT_CORE),new ItemStack(Material.NETHER_STAR),
}),
arrow2(ChatColor.GREEN,"Hand-made Arrow",new ItemStack[]{
arrow2("Custom Arrows",ChatColor.GREEN,"Hand-made Arrow",new ItemStack[]{
Recipes.getArrowFromMeta("DOUBLE_DAMAGE_ARR"),
new ItemStack(Material.FLINT),new ItemStack(Material.STICK),null,
new ItemStack(Material.FEATHER),
}),
arrow4(ChatColor.GREEN,"Diamond-Tipped Arrow",new ItemStack[]{
arrow4("Custom Arrows",ChatColor.GREEN,"Diamond-Tipped Arrow",new ItemStack[]{
Recipes.getArrowFromMeta("QUADRUPLE_DAMAGE_ARR"),
Recipes.getArrowFromMeta("DOUBLE_DAMAGE_ARR"),new ItemStack(Material.DIAMOND)
}),
traparrow(ChatColor.GREEN,"Trapping Arrow",new ItemStack[]{
traparrow("Custom Arrows",ChatColor.GREEN,"Trapping Arrow",new ItemStack[]{
Recipes.getArrowFromMeta("TRAP_ARR"),
new ItemStack(Material.WEB),new ItemStack(Material.STICK),null,
new ItemStack(Material.FEATHER),
}),
explodearrow(ChatColor.GREEN,"Exploding Arrow",new ItemStack[]{
explodearrow("Custom Arrows",ChatColor.GREEN,"Exploding Arrow",new ItemStack[]{
Recipes.getArrowFromMeta("EXPLODE_ARR"),
new ItemStack(Material.SULPHUR),new ItemStack(Material.STICK),null,
new ItemStack(Material.FEATHER),
}),
poisonarrow(ChatColor.GREEN,"Poison Arrow",new ItemStack[]{
poisonarrow("Custom Arrows",ChatColor.GREEN,"Poison Arrow",new ItemStack[]{
Recipes.getArrowFromMeta("POISON_ARR"),
new ItemStack(Material.RAW_FISH,1,(short)3),new ItemStack(Material.STICK),null,
new ItemStack(Material.FEATHER),
@ -355,11 +355,17 @@ public enum RecipeLinker {
String name = "";
ItemStack[] rec = null;
ChatColor col = null;
String category = "";
RecipeLinker(ChatColor col, String name, ItemStack[] recipe) {
RecipeLinker(String cat, ChatColor col, String name, ItemStack[] recipe) {
this.col=col;
this.name=name;
this.rec=recipe;
this.category=cat;
}
public String getCategory() {
return category;
}
public String getName() {

@ -153,7 +153,7 @@ public enum CustomRecipe {
pm.setDisplayName(ChatColor.GREEN+"Life Vial");
pm.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS);
LIFE_VIAL.setItemMeta(pm);
return new CustomPotion(LIFE_VIAL,effects,50,100);
return new CustomPotion(LIFE_VIAL,effects,10,20);
}
public static CustomPotion DefineStrengtheningVial() {

@ -18,12 +18,14 @@ public enum ItemSet {
SONGSTEEL(4,2, 6,2, 8,8, 20,10),
DAWNTRACKER(4,4, 20,10, 20,10, 6,4),
LORASYS(2,2, 0,0, 0,0, 0,0),
JAMDAK(1,1, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks.
DARNYS(1,1, 10,5, 20,5, 1,1),
ALIKAHN(1,1, 15,6, 30,10, 12,6),
LORASAADI(1,1, 1,1, 3,2, 2,1),
JAMDAK(3,3, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks.
DARNYS(2,1, 10,5, 20,5, 1,1),
ALIKAHN(3,1, 15,6, 30,10, 12,6),
LORASAADI(4,1, 4,2, 8,6, 8,3),
MOONSHADOW(4,2, 1,1, 8,8, 15,7),
GLADOMAIN(1,1, 12,10, 8,8, 1,1);
GLADOMAIN(1,1, 12,10, 8,8, 1,1),
WOLFSBANE(2,1, 15,10, 10,5, 15,10),
ALUSTINE(10,10, 10,-1, 5,-1, 6,4);
int baseval;
int increase_val;
@ -273,6 +275,16 @@ public enum ItemSet {
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Moonshadow Set");
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% Crit Damage");
}break;
case WOLFSBANE:{
lore.add(ChatColor.LIGHT_PURPLE+"Slayer Ornament");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Wolfsbane Set");
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% Critical Chance");
}break;
case ALUSTINE:{
lore.add(ChatColor.LIGHT_PURPLE+"Slayer Charm");
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Alustine Set");
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% EXP Gain");
}break;
}
lore.add("");
@ -319,8 +331,8 @@ public enum ItemSet {
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+"% Dodge Chance");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Dodge Chance");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+(ItemSet.GetBaseAmount(set, tier, 4)/20d)+"s Graceful Dodge");
lore.add(ChatColor.GRAY+" Gives you invulnerability after a");
lore.add(ChatColor.GRAY+" successful dodge.");
lore.add(ChatColor.GRAY+" Gives you invulnerability and "+(ItemSet.GetBaseAmount(set, tier, 4)/4)+" absorption");
lore.add(ChatColor.GRAY+" health for each successful dodge.");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Boosts All Modes of Ranger");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"Close Range Mode:");
lore.add(ChatColor.GRAY+" Increases Tumble Invincibility from");
@ -408,6 +420,30 @@ public enum ItemSet {
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"While in Stealth Mode you gain 40%");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"Dodge Chance");
}break;
case WOLFSBANE:{
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" Recovers "+ItemSet.GetBaseAmount(set, tier, 2)+"% Cooldown on Assassination per kill");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" Applies Speed V when Assassination is casted. Suppresses");
lore.add(ChatColor.DARK_AQUA+" "+ChatColor.WHITE+" the target for "+(ItemSet.GetBaseAmount(set, tier, 3)/20d)+"s");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Gain "+(ItemSet.GetBaseAmount(set, tier, 4)/20d)+" seconds of invulnerability after");
lore.add(ChatColor.DARK_AQUA+" "+ChatColor.WHITE+" Assassination is casted.");
lore.add(ChatColor.DARK_AQUA+" 7 - "+ChatColor.WHITE+" Provides the Following Bonuses:");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"Backstabs heal 2 HP (1 Heart). Assassination cooldown reduced");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"to 2 seconds when used on a target closer than 5 meters.");
}break;
case ALUSTINE:{
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" Gain immunity to Explosions.");
lore.add(ChatColor.DARK_AQUA+" "+ChatColor.WHITE+" Consumes "+ItemSet.GetBaseAmount(set, tier, 2)+" XP per absorbed hit.");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" Resists all fire, poison, and wither damage.");
lore.add(ChatColor.DARK_AQUA+" "+ChatColor.WHITE+" Consumes "+ItemSet.GetBaseAmount(set, tier, 3)+" XP per absorbed hit.");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Backstabs spill "+ItemSet.GetBaseAmount(set, tier, 4)+" XP out from the target hit.");
lore.add(ChatColor.DARK_AQUA+" "+ChatColor.WHITE+" Has a "+Math.min((ItemSet.GetBaseAmount(set, tier, 4)/20d)*100d,100)+"% chance to restore 2 HP (1 Heart) on XP gain.");
lore.add(ChatColor.DARK_AQUA+" 7 - "+ChatColor.WHITE+" Provides the Following Bonuses:");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"Deal additional base damage equal to the");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"number of levels you have. Drains XP equal");
lore.add(ChatColor.GRAY+" "+ChatColor.WHITE+"to the number of levels you have per hit.");
}break;
}
return lore;
}

@ -598,7 +598,7 @@ public class Loot {
allowed = false;
break;
}
item.setDurability((short)2);
item.setDurability((short)5);
ItemMeta m = item.getItemMeta();
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
item.setItemMeta(m);
@ -610,12 +610,36 @@ public class Loot {
break;
}
//item.setType(Material.SKULL_ITEM);
item.setDurability((short)0);
item.setDurability((short)4);
ItemMeta m = item.getItemMeta();
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
item.setItemMeta(m);
set_name = prefix+"Moonshadow Slayer Trinket";
}break;
case WOLFSBANE:{
if (!item.getType().toString().contains("SKULL_ITEM")) {
allowed = false;
break;
}
//item.setType(Material.SKULL_ITEM);
item.setDurability((short)0);
ItemMeta m = item.getItemMeta();
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
item.setItemMeta(m);
set_name = prefix+"Wolfsbane Slayer Ornament";
}break;
case ALUSTINE:{
if (!item.getType().toString().contains("SKULL_ITEM")) {
allowed = false;
break;
}
//item.setType(Material.SKULL_ITEM);
item.setDurability((short)2);
ItemMeta m = item.getItemMeta();
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
item.setItemMeta(m);
set_name = prefix+"Alustine Slayer Charm";
}break;
}
if (item.getItemMeta().hasLore()) {
lore = item.getItemMeta().getLore();

@ -36,7 +36,6 @@ public class LootStructure {
}
public LootStructure(Material mat, boolean ishardened, int minSetLevel) {
// TODO Auto-generated constructor stub
this.mat=mat;
this.hardened_item=ishardened;
this.amt=1;

@ -1,18 +1,33 @@
package sig.plugin.TwosideKeeper.HelperStructures;
import org.bukkit.entity.EntityType;
public enum MonsterType {
BLAZE,
CAVESPIDER,
CREEPER,
ENDERMAN,
ENDERMITE,
GIANT,
GUARDIAN,
PIGZOMBIE,
SILVERFISH,
SKELETON,
SPIDER,
WITCH,
WITHER,
ZOMBIE,
BLAZE(EntityType.BLAZE),
CAVESPIDER(EntityType.CAVE_SPIDER),
CREEPER(EntityType.CREEPER),
ENDERMAN(EntityType.ENDERMAN),
ENDERMITE(EntityType.ENDERMITE),
GIANT(EntityType.GIANT),
GUARDIAN(EntityType.GUARDIAN),
PIGZOMBIE(EntityType.PIG_ZOMBIE),
SILVERFISH(EntityType.SILVERFISH),
SKELETON(EntityType.SKELETON),
SPIDER(EntityType.SPIDER),
WITCH(EntityType.WITCH),
WITHER(EntityType.WITHER),
WITHER_SKELETON(EntityType.SKELETON),
ZOMBIE(EntityType.ZOMBIE);
EntityType type;
MonsterType(EntityType type) {
this.type=type;
}
public EntityType getEntityType() {
return type;
}
}

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.attribute.Attribute;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Player;
@ -17,6 +18,7 @@ public class LivingEntityStructure {
public LivingEntity m;
public boolean isLeader=false;
public boolean isElite=false;
public double original_movespd = 0.0d;
public HashMap<UUID,Long> hitlist = new HashMap<UUID,Long>();
public HashMap<Player,GlowAPI.Color> glowcolorlist = new HashMap<Player,GlowAPI.Color>();
@ -24,11 +26,13 @@ public class LivingEntityStructure {
target=null;
original_name="";
this.m=m;
this.original_movespd = m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue();
}
public LivingEntityStructure(LivingEntity m, LivingEntity target) {
this.target=target;
original_name="";
this.m=m;
this.original_movespd = m.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).getBaseValue();
}
public LivingEntity GetTarget() {
@ -87,9 +91,6 @@ public class LivingEntityStructure {
if (GenericFunctions.isSuppressed(m)) {
setGlow(p,GlowAPI.Color.BLACK);
} else
if (getLeader() || (m instanceof Monster && GenericFunctions.isBossMonster((Monster)m))) {
setGlow(p,GlowAPI.Color.DARK_RED);
} else
if (getElite()) {
boolean handled=false;
for (EliteMonster em : TwosideKeeper.elitemonsters) {
@ -102,6 +103,9 @@ public class LivingEntityStructure {
setGlow(p,GlowAPI.Color.DARK_PURPLE);
}
} else
if (getLeader() || (m instanceof Monster && GenericFunctions.isBossMonster((Monster)m))) {
setGlow(p,GlowAPI.Color.DARK_RED);
} else
if (GenericFunctions.isIsolatedTarget(m, p)) {
setGlow(p,GlowAPI.Color.WHITE);
} else {

@ -919,54 +919,11 @@ public class MonsterController {
}
public static Monster spawnAdjustedMonster(MonsterType mt,Location loc) {
EntityType et;
switch(mt) {
case BLAZE:
et=EntityType.BLAZE;
break;
case CAVESPIDER:
et=EntityType.CAVE_SPIDER;
break;
case CREEPER:
et=EntityType.CREEPER;
break;
case ENDERMAN:
et=EntityType.ENDERMAN;
break;
case ENDERMITE:
et=EntityType.ENDERMITE;
break;
case GIANT:
et=EntityType.GIANT;
break;
case GUARDIAN:
et=EntityType.GUARDIAN;
break;
case PIGZOMBIE:
et=EntityType.PIG_ZOMBIE;
break;
case SILVERFISH:
et=EntityType.SILVERFISH;
break;
case SKELETON:
et=EntityType.SKELETON;
break;
case SPIDER:
et=EntityType.SPIDER;
break;
case WITCH:
et=EntityType.WITCH;
break;
case WITHER:
et=EntityType.WITHER;
break;
case ZOMBIE:
et=EntityType.ZOMBIE;
break;
default:
et=EntityType.ZOMBIE;
Monster m = (Monster)loc.getWorld().spawnEntity(loc, mt.getEntityType());
if (mt.equals(MonsterType.WITHER_SKELETON)) {
Skeleton sk = (Skeleton)m;
sk.setSkeletonType(SkeletonType.WITHER);
}
Monster m = (Monster)loc.getWorld().spawnEntity(loc, et);
return MonsterController.convertMonster(m);
}
@ -982,7 +939,8 @@ public class MonsterController {
if (m.getType()==EntityType.ZOMBIE ||
m.getType()==EntityType.PIG_ZOMBIE ||
m.getType()==EntityType.GIANT ||
m.getType()==EntityType.SKELETON
m.getType()==EntityType.SKELETON ||
m.getType()==EntityType.WITHER
) {
return true;
}

@ -110,6 +110,8 @@ public class PlayerStructure {
public long lastlifesavertime=0;
public boolean slayermegahit=false;
public double thorns_amt = 0.0;
public long lastimportantactionbarmsg=0;
public long lasthighwinderhit=0;
public long iframetime = 0;

@ -265,7 +265,7 @@ public class Recipes {
//pm.setBasePotionData(data);
pm.addCustomEffect(new PotionEffect(PotionEffectType.INVISIBILITY,0,0),true);
List<String> lore = new ArrayList<String>();
lore.add(ChatColor.GRAY+"Explodes on Contact (+40 dmg)");
lore.add(ChatColor.GRAY+"Explodes on Contact (+80 dmg)");
pm.setLore(lore);
pm.setDisplayName(ChatColor.GRAY+"Exploding Arrow");
explosionarrow.setItemMeta(pm);

@ -102,7 +102,6 @@ public class RecyclingCenter {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@ -328,7 +328,7 @@ public class SpleefGame implements Listener {
(corner1.getBlockZ()>corner2.getBlockZ())?(corner1.getBlockZ()-2-(Math.random()*(corner1.getBlockZ()-corner2.getBlockZ()-4))):(corner2.getBlockZ()-2-(Math.random()*(corner2.getBlockZ()-corner1.getBlockZ()-4)))
), TeleportCause.PLUGIN);
//Give players Resistance 100 so they can never die.
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.DAMAGE_RESISTANCE,99999,100,Bukkit.getServer().getPlayer(players.get(i).player));
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.DAMAGE_RESISTANCE,99999,100,Bukkit.getServer().getPlayer(players.get(i).player));
}
active=true;
starttime=TwosideKeeper.getServerTickTime();
@ -385,7 +385,7 @@ public class SpleefGame implements Listener {
void RemovePlayer(SpleefPlayerData p, RemovePlayerReason rs) {
p.ClearInventory();
p.RestoreInventory();
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.DAMAGE_RESISTANCE,Bukkit.getServer().getPlayer(p.player));
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.DAMAGE_RESISTANCE,Bukkit.getServer().getPlayer(p.player));
for (int i=0;i<players.size();i++) {
if (players.get(i).player.equalsIgnoreCase(p.player)) {
players.remove(i);
@ -521,7 +521,6 @@ class SpleefPlayerData {
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@ -50,7 +50,6 @@ import org.bukkit.entity.Snowball;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.entity.TippedArrow;
import org.bukkit.entity.Witch;
import org.bukkit.entity.Zombie;
import org.bukkit.entity.minecart.HopperMinecart;
import org.bukkit.event.Event.Result;
import org.bukkit.event.EventHandler;
@ -89,7 +88,6 @@ import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.inventory.InventoryPickupItemEvent;
@ -145,7 +143,6 @@ 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.Boss.MegaWither;
import sig.plugin.TwosideKeeper.HelperStructures.AnvilItem;
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem;
@ -293,11 +290,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (absorption_amt>0) {
if (p.hasPotionEffect(PotionEffectType.ABSORPTION)) {
int oldlv = GenericFunctions.getPotionEffectLevel(PotionEffectType.ABSORPTION, p);
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4)+oldlv,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4)+oldlv,p);
} else {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4),p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION,599,(int)(absorption_amt/4),p);
}
}
if (p.hasPotionEffect(PotionEffectType.ABSORPTION)) {
CustomDamage.setAbsorptionHearts(p, Math.max(CustomDamage.getAbsorptionHearts(p),4*(GenericFunctions.getPotionEffectLevel(PotionEffectType.ABSORPTION, p)+1)));
}
}
}
}
@ -343,7 +343,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
}
cz.BreakBlocksAroundArea(1);
ChargeZombie.BreakBlocksAroundArea(cz.m,1);
}
}
for (HellfireSpider hs : hellfirespiders.values()) {
@ -373,6 +373,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
for (Entity e : suppressed_entities) {
if (e==null || !e.isValid() ||
GenericFunctions.getSuppressionTime(e)<=0) {
if (e!=null && e.isValid() && e instanceof LivingEntity) {
LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure((LivingEntity)e);
((LivingEntity)e).getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(les.original_movespd);
((LivingEntity)e).setAI(true);
}
ScheduleRemoval(suppressed_entities,e);
}
}
@ -613,7 +618,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
@Override
public void onEnable() {
// TODO Insert logic to be performed when the plugin is enabled
Bukkit.getPluginManager().registerEvents(this, this);
plugin=this;
@ -760,7 +764,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
@Override
public void onDisable() {
// TODO Insert logic to be performed when the plugin is disabled
//Clear out remaining parties.
for (int i=0;i<TeamCounter;i++) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "scoreboard objectives remove Party"+i);
@ -883,7 +886,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
DiscordMessageSender.sendToSpam(stack.toString());*/
@SuppressWarnings("unused")
Monster m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.ZOMBIE), MonsterDifficulty.ELITE);
Monster m = MonsterController.convertMonster((Monster)p.getWorld().spawnEntity(p.getLocation(),EntityType.WITHER), MonsterDifficulty.ELITE);
//GenericFunctions.sendActionBarMessage(p, "Testing/nMultiple Lines.\nLolz");
//TwosideKeeperAPI.setItemSet(p.getEquipment().getItemInMainHand(), ItemSet.PANROS);
@ -1319,15 +1322,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
GenericFunctions.updateSetItemsInInventory(ev.getPlayer().getInventory());
ev.getPlayer().setCollidable(true);
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.LEVITATION,ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.JUMP,ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,ev.getPlayer());
ev.getPlayer().setVelocity(new Vector(0,0,0));
CustomDamage.removeIframe(ev.getPlayer());
//Update player max health. Check equipment too.
setPlayerMaxHealth(ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.GLOWING,ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.NIGHT_VISION,ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.GLOWING,ev.getPlayer());
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.NIGHT_VISION,ev.getPlayer());
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setSuffix(createHealthbar(((ev.getPlayer().getHealth())/ev.getPlayer().getMaxHealth())*100,ev.getPlayer()));
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(ev.getPlayer()));
ev.getPlayer().getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0d);
@ -1941,7 +1944,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Player p = ev.getPlayer();
if (PlayerMode.isRanger(p) && p.isSneaking() && p.getEquipment().getItemInMainHand().getType()==Material.BOW) {
//Rotate Bow Modes.
GenericFunctions.logAndRemovePotionEffectFromPlayer(PotionEffectType.SLOW,p);
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.SLOW,p);
BowMode mode = GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand());
if (ev.getAction().name().contains("RIGHT")) {
@ -2065,7 +2068,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (player.isBlocking()) {
//Give absorption hearts.
if (PlayerMode.isDefender(player)) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.ABSORPTION,200,1,player);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION,200,1,player);
List<Entity> entities = player.getNearbyEntities(16, 16, 16);
for (int i=0;i<entities.size();i++) {
if (entities.get(i) instanceof Monster) {
@ -2075,7 +2078,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
} else {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.ABSORPTION,200,0,player);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.ABSORPTION,200,0,player);
}
DecimalFormat df = new DecimalFormat("0.0");
PlayerStructure pd = PlayerStructure.GetPlayerStructure(player);
@ -2757,6 +2760,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (pd.lasthitdesc!=null) {
log("Death Description: "+pd.lasthitdesc,5);
newDeathMsg = getFancyDeathMessage(p);
}
newDeathMsg=p.getName()+" "+newDeathMsg;
@ -3204,15 +3208,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
}
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
public void onInventoryDrag(InventoryDragEvent ev) {
//You are not allowed to drag arrow quivers.
if (ev.getOldCursor().getType()==Material.TIPPED_ARROW &&
ev.getOldCursor().getEnchantmentLevel(Enchantment.ARROW_INFINITE)==5) {
ev.setCancelled(true);
}
}
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
public void onItemChange(PlayerItemHeldEvent ev) {
@ -3927,12 +3922,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
//boolean applieddmg = CustomDamage.ApplyDamage(dmgdealt, null, (LivingEntity)ev.getEntity(), null, ev.getCause().name(), CustomDamage.TRUEDMG);
if (!CustomDamage.InvulnerableCheck(null, (LivingEntity)ev.getEntity())) {
boolean applieddmg=true;
dmgdealt = CustomDamage.CalculateDamage(dmgdealt, null, (LivingEntity)ev.getEntity(), null, null, CustomDamage.TRUEDMG);
dmgdealt = CustomDamage.CalculateDamage(dmgdealt, null, (LivingEntity)ev.getEntity(), null, ev.getCause().name(), CustomDamage.TRUEDMG);
if (ev.getCause()==DamageCause.FALL) {
dmgdealt *= GenericFunctions.CalculateFallResistance((LivingEntity)ev.getEntity());
}
dmgdealt = CustomDamage.subtractAbsorptionHearts(dmgdealt, (LivingEntity)ev.getEntity());
dmgdealt = CustomDamage.applyOnHitEffects(dmgdealt,null,(LivingEntity)ev.getEntity(),null ,null,CustomDamage.TRUEDMG);
dmgdealt = CustomDamage.applyOnHitEffects(dmgdealt,null,(LivingEntity)ev.getEntity(),null ,ev.getCause().name(),CustomDamage.TRUEDMG);
if ((ev.getCause()==DamageCause.CONTACT ||
ev.getCause()==DamageCause.LIGHTNING ||
ev.getCause()==DamageCause.FALLING_BLOCK ||
@ -4051,7 +4046,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
GenericFunctions.removeNoDamageTick((LivingEntity)ev.getEntity(), ev.getDamager());
CustomDamage.ApplyDamage(pd.vendetta_amt, ev.getDamager(), (LivingEntity)ev.getEntity(), null, "Vendetta");
pd.vendetta_amt=0.0;
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored");
GenericFunctions.sendActionBarMessage(p, ChatColor.YELLOW+"Vendetta: "+ChatColor.GREEN+Math.round(pd.vendetta_amt)+" dmg stored",true);
} else {
CustomDamage.ApplyDamage(0, ev.getDamager(), (LivingEntity)ev.getEntity(), weapon, null);
if (ev.getDamager() instanceof Projectile) {
@ -4265,7 +4260,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (ev.getReason()!=TargetReason.CUSTOM &&
ev.getReason()!=TargetReason.UNKNOWN) {
ev.setCancelled(true);
log("Unknown Targeting reason occurred for "+GenericFunctions.GetEntityDisplayName(m)+". Targeting: "+GenericFunctions.GetEntityDisplayName(m),1);
log("Unknown Targeting reason occurred for "+GenericFunctions.GetEntityDisplayName(m)+". Targeting: "+GenericFunctions.GetEntityDisplayName(m),5);
}
}
} else {
@ -4413,38 +4408,52 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
boolean isRanger=PlayerMode.isRanger(p);
boolean isSlayer=PlayerMode.isSlayer(p);
GenericFunctions.knockOffGreed(p);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER && pd.lastassassinatetime+20>getServerTickTime()) {
pd.lastassassinatetime=getServerTickTime()-GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,p);
ItemStack[] inv = p.getInventory().getContents();
for (int i=0;i<9;i++) {
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
aPlugin.API.sendCooldownPacket(p, inv[i], 0);
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
if (pd.lastassassinatetime+20>getServerTickTime()) { //Successful Assassination.
pd.lastassassinatetime=getServerTickTime()-GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,p);
ItemStack[] inv = p.getInventory().getContents();
for (int i=0;i<9;i++) {
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
aPlugin.API.sendCooldownPacket(p, inv[i], 0);
}
}
}
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.SPEED, 10*20, 4);
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.MOONSHADOW, 7)) {
//Apply damage to everything around the player.
//List<Monster> mobs = GenericFunctions.getNearbyMobs(m.getLocation(), 8);
List<Monster> mobs = CustomDamage.trimNonMonsterEntities(m.getNearbyEntities(8, 8, 8));
for (Monster m1 : mobs) {
if (!m1.equals(m)) {
pd.lastassassinatetime=0;
CustomDamage.ApplyDamage(0,p,m1,p.getEquipment().getItemInMainHand(),"AoE Damage",CustomDamage.NOAOE);
if (m1.isDead()) {
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 39, 2);
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.SPEED, 10*20, 4);
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.SPEED, 10*20, 4);
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.MOONSHADOW, 7)) {
//Apply damage to everything around the player.
//List<Monster> mobs = GenericFunctions.getNearbyMobs(m.getLocation(), 8);
List<Monster> mobs = CustomDamage.trimNonMonsterEntities(m.getNearbyEntities(8, 8, 8));
for (Monster m1 : mobs) {
if (!m1.equals(m)) {
pd.lastassassinatetime=0;
CustomDamage.ApplyDamage(0,p,m1,p.getEquipment().getItemInMainHand(),"AoE Damage",CustomDamage.NOAOE);
if (m1.isDead()) {
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 39, 2);
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.SPEED, 10*20, 4);
}
}
}
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 39, 2);
} else {
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 9);
}
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.GLADOMAIN, 7)) {
pd.slayermegahit=true;
}
GenericFunctions.applyStealth(p, false);
} else { //Failed Assassination.
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.WOLFSBANE, 2)) {
pd.lastassassinatetime-=GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,p)*(ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.WOLFSBANE, 2, 2)/100d);
ItemStack[] inv = p.getInventory().getContents();
for (int i=0;i<9;i++) {
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
aPlugin.API.sendCooldownPacket(p, inv[i], GenericFunctions.GetRemainingCooldownTime(p, pd.lastassassinatetime, TwosideKeeper.ASSASSINATE_COOLDOWN));
}
}
}
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 39, 2);
} else {
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 9);
}
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.GLADOMAIN, 7)) {
pd.slayermegahit=true;
}
GenericFunctions.applyStealth(p, false);
}
if (isSlayer) {
@ -4512,8 +4521,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
Bukkit.getServer().broadcastMessage(ChatColor.GREEN+participants_list.toString()+ChatColor.WHITE+" have successfully slain "+GenericFunctions.getDisplayName(m)+ChatColor.WHITE+"!");
aPlugin.API.discordSendRaw(ChatColor.GREEN+participants_list.toString()+ChatColor.WHITE+" have successfully slain **"+GenericFunctions.getDisplayName(m)+ChatColor.WHITE+"**!");
Bukkit.getServer().broadcastMessage(ChatColor.GREEN+participants_list.toString()+ChatColor.WHITE+" "+(participants_list.length()==1?"has single-handedly taken down the ":"have successfully slain ")+GenericFunctions.getDisplayName(m)+ChatColor.WHITE+"!");
aPlugin.API.discordSendRaw(ChatColor.GREEN+participants_list.toString()+ChatColor.WHITE+" "+(participants_list.length()==1?"has single-handedly taken down the ":"have successfully slain ")+"**"+GenericFunctions.getDisplayName(m)+ChatColor.WHITE+"**!");
m.getWorld().spawnEntity(m.getLocation(), EntityType.LIGHTNING);
m.getWorld().setStorm(true);
m.getWorld().setWeatherDuration(20*60*15);
@ -4663,8 +4672,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
it.setInvulnerable(true);
}
for (int i=0;i<drop.size();i++) {
Item it = deathloc.getWorld().dropItemNaturally(mer2.getLocation(), drop.get(i));
it.setInvulnerable(true);
if (drop.get(i)!=null) {
Item it = deathloc.getWorld().dropItemNaturally(mer2.getLocation(), drop.get(i));
it.setInvulnerable(true);
}
}
break;
}
@ -4699,7 +4710,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
DeathManager.continueAction(p);
}
p.setVelocity(new Vector(0,0,0));
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.LEVITATION,Integer.MAX_VALUE,255,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,Integer.MAX_VALUE,255,p);
CustomDamage.setAbsorptionHearts(p, 0.0f);
GenericFunctions.addIFrame(p, Integer.MAX_VALUE);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
@ -4773,8 +4784,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (((Entity)ev.getPlayer()).isOnGround()) {
PlayerStructure pd = (PlayerStructure)playerdata.get(ev.getPlayer().getUniqueId());
pd.velocity = new Vector(ev.getFrom().getX(),0,ev.getFrom().getZ()).distanceSquared(new Vector(ev.getTo().getX(),0,ev.getTo().getZ()));
if (pd.highwinder && pd.target!=null && !pd.target.isDead()) {
GenericFunctions.sendActionBarMessage(ev.getPlayer(), drawVelocityBar(pd.velocity,pd.highwinderdmg));
if (pd.highwinder && pd.target!=null && !pd.target.isDead() && pd.lasthighwinderhit+15<getServerTickTime()) {
GenericFunctions.sendActionBarMessage(ev.getPlayer(), drawVelocityBar(pd.velocity,pd.highwinderdmg),true);
}
}
}
@ -5696,7 +5707,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
final Player p = ev.getPlayer();
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
setPlayerMaxHealth(p);
if (p.isValid() && p.isOnline()) {
setPlayerMaxHealth(p);
}
}
},20);
}
@ -6248,7 +6261,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
log("[WARNING] Could not find the correct player data file for "+p+" to get money data from.",1);
e.printStackTrace();
}
@ -6278,7 +6290,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
log("[WARNING] Could not find the correct player data file for "+p+" to get bank money data from.",1);
e.printStackTrace();
}
@ -6357,7 +6368,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (PlayerMode.isDefender(p)) {
hp+=10;
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.REGENERATION,60,(p.isBlocking())?1:0,p,false);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,60,(p.isBlocking())?1:0,p,false);
}

@ -398,7 +398,7 @@ public final class TwosideKeeperAPI {
*/
public static String getEntityName(Entity ent) {
return GenericFunctions.GetEntityDisplayName(ent);
}
}
/**
* Returns the actual custom name of the monster without the suffix/buff bar
* attached to it. This also returns the basic name of an entity if it does

@ -149,7 +149,6 @@ public class WorldShopManager {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@ -288,7 +287,6 @@ public class WorldShopManager {
try {
workable.save(config);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

@ -161,7 +161,7 @@ final class runServerHeartbeat implements Runnable {
pd.velocity=0;
}
if (pd.highwinder && pd.target!=null && !pd.target.isDead()) {
GenericFunctions.sendActionBarMessage(p, TwosideKeeper.drawVelocityBar(pd.velocity,pd.highwinderdmg));
GenericFunctions.sendActionBarMessage(p, TwosideKeeper.drawVelocityBar(pd.velocity,pd.highwinderdmg), true);
}
if (pd.target!=null && !pd.target.isDead() && pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())>256) {
pd.target=null;
@ -178,7 +178,7 @@ final class runServerHeartbeat implements Runnable {
int duration = GenericFunctions.getPotionEffectDuration(PotionEffectType.FIRE_RESISTANCE, p);
int lv = GenericFunctions.getPotionEffectLevel(PotionEffectType.FIRE_RESISTANCE, p);
if (lv>10) {lv=10;}
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.FIRE_RESISTANCE, duration-(20*(10-lv)), lv, p, true);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.FIRE_RESISTANCE, duration-(20*(10-lv)), lv, p, true);
}
if (GenericFunctions.hasStealth(p)) {GenericFunctions.DamageRandomTool(p);}
@ -249,12 +249,12 @@ final class runServerHeartbeat implements Runnable {
for (ItemStack equip : equips) {
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, equip) &&
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().getY()<=255 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED,20,1,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,20,1,p);
}
}
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand()) &&
p.isOnGround() && p.getLocation().getY()>=0 && p.getLocation().getY()<=255 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=4) {
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED,20,1,p);
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,20,1,p);
//log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2);
}

Loading…
Cancel
Save