+>'/fix price' and '/fix price <price>' commands have been added. These
commands lets you view the base price of the item you are holding at a world shop, and allows you to set the price to a different amount. (Only Aristo has permission to do this) >Special Arrows being shot from a quiver has been fixed. >Cooldowns are now saved between logins. This means you will login with the cooldowns you last had instead of it resetting on each relog. >Leader Wither now displays a Damage Breakdown when the fight is won or lost. >Applied a new Assassinate algorithm. >Fixed Fireworks from Christmas Boxes and Dimensional Boxes from having no effects. >The Leader Wither no longer drops down as dramatically when reaching the upper boundary of the Nether. >Significantly decreased the block destruction capabilities of End, Hellfire, and Deadly tier monster afterdeath explosions. >Increased the damage dealt by afterdeath explosions of End, Hellfire, and Deadly tier monsters. >Deal of the Day price sale percentages can now vary by more than 20%. >Hellfire Zombie and Pig Zombie behavior slightly modified.
This commit is contained in:
parent
bb59525e12
commit
ad79fef027
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
name: TwosideKeeper
|
name: TwosideKeeper
|
||||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||||
version: 3.10.5
|
version: 3.10.6
|
||||||
loadbefore: [aPlugin]
|
loadbefore: [aPlugin]
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
|
@ -10,6 +10,8 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;
|
|||||||
|
|
||||||
public class ChargeZombie {
|
public class ChargeZombie {
|
||||||
Monster m;
|
Monster m;
|
||||||
|
long stuckTimer=0;
|
||||||
|
Location lastLoc = null;
|
||||||
|
|
||||||
public ChargeZombie(Monster m) {
|
public ChargeZombie(Monster m) {
|
||||||
this.m=m;
|
this.m=m;
|
||||||
|
@ -4,6 +4,7 @@ import java.text.DecimalFormat;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Achievement;
|
import org.bukkit.Achievement;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -538,11 +539,14 @@ public class CustomDamage {
|
|||||||
if ((shooter instanceof Player) && target!=null) {
|
if ((shooter instanceof Player) && target!=null) {
|
||||||
Player p = (Player)shooter;
|
Player p = (Player)shooter;
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (damager instanceof TippedArrow) {
|
//TwosideKeeper.log("Exploding Arrow 2. Damager is "+GenericFunctions.GetEntityDisplayName(damager), 0);
|
||||||
TippedArrow a = (TippedArrow)damager;
|
if (damager instanceof Arrow || damager instanceof TippedArrow) {
|
||||||
|
Arrow a = (Arrow)damager;
|
||||||
|
//TwosideKeeper.log("Exploding Arrow 1", 0);
|
||||||
if (a.hasMetadata("EXPLODE_ARR")) {
|
if (a.hasMetadata("EXPLODE_ARR")) {
|
||||||
//Create an explosion.
|
//Create an explosion.
|
||||||
TwosideKeeper.log("In here", 5);
|
TwosideKeeper.log("In here", 5);
|
||||||
|
//TwosideKeeper.log("Exploding Arrow", 0);
|
||||||
Location hitloc = aPlugin.API.getArrowHitLocation(target, a);
|
Location hitloc = aPlugin.API.getArrowHitLocation(target, a);
|
||||||
GenericFunctions.DealExplosionDamageToEntities(hitloc, getBaseWeaponDamage(weapon,damager,target)+60, 6);
|
GenericFunctions.DealExplosionDamageToEntities(hitloc, getBaseWeaponDamage(weapon,damager,target)+60, 6);
|
||||||
SoundUtils.playGlobalSound(hitloc, Sound.ENTITY_ENDERDRAGON_FIREBALL_EXPLODE, 0.5f, 1.0f);
|
SoundUtils.playGlobalSound(hitloc, Sound.ENTITY_ENDERDRAGON_FIREBALL_EXPLODE, 0.5f, 1.0f);
|
||||||
@ -1205,6 +1209,15 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (target instanceof Wither) {
|
||||||
|
Wither w = (Wither)target;
|
||||||
|
for (UUID id : TwosideKeeper.custommonsters.keySet()) {
|
||||||
|
if (id.equals(w.getUniqueId())) {
|
||||||
|
sig.plugin.TwosideKeeper.Monster.Wither wi = (sig.plugin.TwosideKeeper.Monster.Wither)TwosideKeeper.custommonsters.get(id);
|
||||||
|
wi.runHitEvent(p, dmg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addHealthFromLifesteal(Player p, double damage, ItemStack weapon, String reason) {
|
private static void addHealthFromLifesteal(Player p, double damage, ItemStack weapon, String reason) {
|
||||||
@ -1809,6 +1822,7 @@ public class CustomDamage {
|
|||||||
double darknessdiv = 0;
|
double darknessdiv = 0;
|
||||||
double playermodediv = 0;
|
double playermodediv = 0;
|
||||||
double witherdiv = 0;
|
double witherdiv = 0;
|
||||||
|
double artifactmult = 0;
|
||||||
|
|
||||||
if (target instanceof LivingEntity) {
|
if (target instanceof LivingEntity) {
|
||||||
ItemStack[] armor = GenericFunctions.getArmor(target);
|
ItemStack[] armor = GenericFunctions.getArmor(target);
|
||||||
@ -1873,6 +1887,7 @@ public class CustomDamage {
|
|||||||
double dmgval=-1;
|
double dmgval=-1;
|
||||||
if (dmgval!=-1) {
|
if (dmgval!=-1) {
|
||||||
dmgreduction += dmgval;
|
dmgreduction += dmgval;
|
||||||
|
artifactmult += 0.08;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (armor[i].getType()) {
|
switch (armor[i].getType()) {
|
||||||
@ -2008,6 +2023,7 @@ public class CustomDamage {
|
|||||||
*(1d-tacticspct)
|
*(1d-tacticspct)
|
||||||
*(1d-playermodediv)
|
*(1d-playermodediv)
|
||||||
*(1d-witherdiv)
|
*(1d-witherdiv)
|
||||||
|
*(1d-artifactmult)
|
||||||
*setbonus
|
*setbonus
|
||||||
*((target instanceof Player && ((Player)target).isBlocking())?(PlayerMode.isDefender((Player)target))?0.30:0.50:1)
|
*((target instanceof Player && ((Player)target).isBlocking())?(PlayerMode.isDefender((Player)target))?0.30:0.50:1)
|
||||||
*((target instanceof Player)?((PlayerMode.isDefender((Player)target))?0.9:(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.95:1):1);
|
*((target instanceof Player)?((PlayerMode.isDefender((Player)target))?0.9:(target.getEquipment().getItemInOffHand()!=null && target.getEquipment().getItemInOffHand().getType()==Material.SHIELD)?0.95:1):1);
|
||||||
|
20
src/sig/plugin/TwosideKeeper/Drops/DropRandomFirework.java
Normal file
20
src/sig/plugin/TwosideKeeper/Drops/DropRandomFirework.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.Drops;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import aPlugin.Drop;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||||
|
|
||||||
|
public class DropRandomFirework extends Drop {
|
||||||
|
|
||||||
|
public DropRandomFirework(int min, int max, int weight) {
|
||||||
|
super(min,max,weight,"Holiday Firework");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack getItemStack() {
|
||||||
|
return ItemUtils.createRandomFirework();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -32,7 +32,7 @@ public enum ArtifactAbility {
|
|||||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
||||||
EXECUTION("Execute","Deals [VAL] extra damage for every 20% of target's missing health.",new double[]{0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.50,1.65,1.80,1.95,2.10,2.40,2.70},
|
EXECUTION("Execute","Deals [VAL] extra damage for every 20% of target's missing health.",new double[]{0.3,0.45,0.6,0.75,0.9,1.05,1.2,1.35,1.50,1.65,1.80,1.95,2.10,2.40,2.70},
|
||||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
|
||||||
LIFESTEAL("Lifesteal","Heals [VAL]% of the damage dealt to targets back to your health pool.",new double[]{0.8,1.2,1.6,2.0,2.4,2.8,3.2,3.6,4.0,4.4,4.8,5.6,6.4,7.2,8.0,8.8},
|
LIFESTEAL("Lifesteal","Heals [VAL]% of the damage dealt to targets back to your health pool.",new double[]{0.2,0.3,0.6,0.7,0.8,0.9,1.1,1.3,1.4,1.5,1.6,1.8,2.1,2.6,2.8,3.5},
|
||||||
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.75,0.75,0.7,0.7,0.6,0.6,0.5,0.5,0.4},100,1,UpgradePath.WEAPON),
|
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.75,0.75,0.7,0.7,0.6,0.6,0.5,0.5,0.4},100,1,UpgradePath.WEAPON),
|
||||||
CRITICAL("Critical","[VAL]% chance to deal critical strikes.",new double[]{1.0,1.25,1.5,1.75,2.0,2.25,2.50,2.75,3.0,3.25,3.50,3.75,4.00,4.25,4.50},
|
CRITICAL("Critical","[VAL]% chance to deal critical strikes.",new double[]{1.0,1.25,1.5,1.75,2.0,2.25,2.50,2.75,3.0,3.25,3.50,3.75,4.00,4.25,4.50},
|
||||||
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,1,UpgradePath.WEAPON),
|
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,1,UpgradePath.WEAPON),
|
||||||
|
@ -3689,7 +3689,7 @@ public class GenericFunctions {
|
|||||||
return pct;
|
return pct;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setGlowing(Monster m, Color color) {
|
public static void setGlowing(LivingEntity m, Color color) {
|
||||||
/*
|
/*
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
GlowAPI.setGlowing(m, false, p);
|
GlowAPI.setGlowing(m, false, p);
|
||||||
@ -3792,6 +3792,17 @@ public class GenericFunctions {
|
|||||||
return monsterlist;
|
return monsterlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<LivingEntity> getNearbyMonsters(Location l, int range) {
|
||||||
|
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
|
||||||
|
List<LivingEntity> monsterlist = new ArrayList<LivingEntity>();
|
||||||
|
for (Entity e : ents) {
|
||||||
|
if ((e instanceof LivingEntity) && !(e instanceof Player)) {
|
||||||
|
monsterlist.add((LivingEntity)e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return monsterlist;
|
||||||
|
}
|
||||||
|
|
||||||
public static List<Player> getNearbyPlayers(Location l, int range) {
|
public static List<Player> getNearbyPlayers(Location l, int range) {
|
||||||
List<Player> players = new ArrayList<Player>();
|
List<Player> players = new ArrayList<Player>();
|
||||||
Collection<Entity> nearbyentities = l.getWorld().getNearbyEntities(l, range, range, range);
|
Collection<Entity> nearbyentities = l.getWorld().getNearbyEntities(l, range, range, range);
|
||||||
@ -3837,7 +3848,7 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void generateNewElite(Player p, String name) {
|
public static void generateNewElite(Player p, String name) {
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new EliteMonsterLocationFinder(p,name), 20l);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new EliteMonsterLocationFinder(p,name), 2l);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isHunterCompass(ItemStack item) {
|
public static boolean isHunterCompass(ItemStack item) {
|
||||||
@ -4328,7 +4339,33 @@ public class GenericFunctions {
|
|||||||
public static void PerformAssassinate(Player player, Material name) {
|
public static void PerformAssassinate(Player player, Material name) {
|
||||||
//Try to find a target to look at.
|
//Try to find a target to look at.
|
||||||
//LivingEntity target = aPlugin.API.rayTraceTargetEntity(player, 100);
|
//LivingEntity target = aPlugin.API.rayTraceTargetEntity(player, 100);
|
||||||
LivingEntity target = aPlugin.API.getTargetEntity(player, 100);
|
Location originalloc = player.getLocation().clone();
|
||||||
|
if (aPlugin.API.performAssassinate(player)) {
|
||||||
|
SoundUtils.playGlobalSound(player.getLocation(), Sound.BLOCK_NOTE_SNARE, 1.0f, 1.0f);
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(player);
|
||||||
|
LivingEntity target = aPlugin.API.getTargetEntity(player, 100);
|
||||||
|
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();
|
||||||
|
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) {
|
||||||
|
pd.lastassassinatetime = TwosideKeeper.getServerTickTime()-TwosideKeeper.ASSASSINATE_COOLDOWN+40;
|
||||||
|
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, 40);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*LivingEntity target = aPlugin.API.getTargetEntity(player, 100);
|
||||||
if (target!=null && !target.isDead()) {
|
if (target!=null && !target.isDead()) {
|
||||||
//We found a target, try to jump behind them now.
|
//We found a target, try to jump behind them now.
|
||||||
double mult = 0.0;
|
double mult = 0.0;
|
||||||
@ -4340,7 +4377,7 @@ public class GenericFunctions {
|
|||||||
Location originalloc = player.getLocation().clone();
|
Location originalloc = player.getLocation().clone();
|
||||||
Location teleloc = target.getLocation().add(target.getLocation().getDirection().multiply(-1.0-mult));
|
Location teleloc = target.getLocation().add(target.getLocation().getDirection().multiply(-1.0-mult));
|
||||||
int i=0;
|
int i=0;
|
||||||
/*while (!(teleloc.getBlock().getRelative(0, -1, 0).getType().isSolid() && teleloc.getBlock().getType()==Material.AIR && teleloc.getBlock().getRelative(0, 1, 0).getType()==Material.AIR)) {
|
while (!(teleloc.getBlock().getRelative(0, -1, 0).getType().isSolid() && teleloc.getBlock().getType()==Material.AIR && teleloc.getBlock().getRelative(0, 1, 0).getType()==Material.AIR)) {
|
||||||
if (i==0) {
|
if (i==0) {
|
||||||
teleloc=target.getLocation();
|
teleloc=target.getLocation();
|
||||||
} else
|
} else
|
||||||
@ -4359,7 +4396,7 @@ public class GenericFunctions {
|
|||||||
teleloc=teleloc.add(0,1,0);
|
teleloc=teleloc.add(0,1,0);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}*/
|
}
|
||||||
int tries = 0;
|
int tries = 0;
|
||||||
while (tries<2) {
|
while (tries<2) {
|
||||||
if ((TwosideKeeper.isNatural.contains(teleloc.getBlock().getType()) || teleloc.getBlock().getType()==Material.AIR) &&
|
if ((TwosideKeeper.isNatural.contains(teleloc.getBlock().getType()) || teleloc.getBlock().getType()==Material.AIR) &&
|
||||||
@ -4405,7 +4442,7 @@ public class GenericFunctions {
|
|||||||
aPlugin.API.sendCooldownPacket(player, name, 40);
|
aPlugin.API.sendCooldownPacket(player, name, 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void DamageRandomTool(Player p) {
|
public static void DamageRandomTool(Player p) {
|
||||||
|
@ -18,7 +18,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
|||||||
public enum ItemSet {
|
public enum ItemSet {
|
||||||
PANROS(1,1, 6,4, 10,10, 20,10),
|
PANROS(1,1, 6,4, 10,10, 20,10),
|
||||||
SONGSTEEL(4,2, 6,2, 8,8, 20,10),
|
SONGSTEEL(4,2, 6,2, 8,8, 20,10),
|
||||||
DAWNTRACKER(2,1, 20,10, 20,10, 10,5),
|
DAWNTRACKER(2,1, 20,10, 10,5, 10,5),
|
||||||
LORASYS(2,2, 0,0, 0,0, 0,0),
|
LORASYS(2,2, 0,0, 0,0, 0,0),
|
||||||
JAMDAK(3,3, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks.
|
JAMDAK(3,3, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks.
|
||||||
DARNYS(2,1, 10,5, 20,5, 1,1),
|
DARNYS(2,1, 10,5, 20,5, 1,1),
|
||||||
|
@ -143,7 +143,7 @@ public class WorldShop {
|
|||||||
price = pricelist.get(item.getType().name());
|
price = pricelist.get(item.getType().name());
|
||||||
}
|
}
|
||||||
if (TwosideKeeper.DEAL_OF_THE_DAY_ITEM.isSimilar(item)) {
|
if (TwosideKeeper.DEAL_OF_THE_DAY_ITEM.isSimilar(item)) {
|
||||||
return price*0.8;
|
return price*(1-TwosideKeeper.DEAL_OF_THE_DAY_PCT);
|
||||||
}
|
}
|
||||||
return ModifyPriceBasedOnLocation(price);
|
return ModifyPriceBasedOnLocation(price);
|
||||||
}
|
}
|
||||||
@ -219,6 +219,23 @@ public class WorldShop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SaveAllPriceEntriesToFile() {
|
||||||
|
try(
|
||||||
|
FileWriter fw = new FileWriter(price_file);
|
||||||
|
BufferedWriter bw = new BufferedWriter(fw);)
|
||||||
|
{
|
||||||
|
for (String str : pricelist.keySet()) {
|
||||||
|
bw.write(str+","+pricelist.get(str));
|
||||||
|
bw.newLine();
|
||||||
|
}
|
||||||
|
bw.close();
|
||||||
|
TwosideKeeper.log("Saved all Shop Price entries to "+price_file, 2);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
TwosideKeeper.log("Something terrible happened while trying to save Shop Price entries!", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int getID() {
|
public int getID() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -1249,6 +1266,18 @@ public class WorldShop {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns 0.0-1.0 of the Percent off of the Deal of the Day.
|
||||||
|
public static double generatePercentOffForDealOftheDay() {
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
int seed = cal.get(Calendar.YEAR)*cal.get(Calendar.DAY_OF_YEAR);
|
||||||
|
Random r = new Random();
|
||||||
|
r.setSeed(seed);
|
||||||
|
Set<String> items = WorldShop.pricelist.keySet();
|
||||||
|
int rand = r.nextInt(5); //20-60%
|
||||||
|
double pctoff = 0.2+(rand*0.1);
|
||||||
|
return pctoff;
|
||||||
|
}
|
||||||
|
|
||||||
public static ItemStack generateItemDealOftheDay(int iter) {
|
public static ItemStack generateItemDealOftheDay(int iter) {
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
int seed = cal.get(Calendar.YEAR)*cal.get(Calendar.DAY_OF_YEAR)*iter;
|
int seed = cal.get(Calendar.YEAR)*cal.get(Calendar.DAY_OF_YEAR)*iter;
|
||||||
|
@ -41,6 +41,7 @@ import sig.plugin.TwosideKeeper.CustomDamage;
|
|||||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
import sig.plugin.TwosideKeeper.aPluginAPIWrapper;
|
import sig.plugin.TwosideKeeper.aPluginAPIWrapper;
|
||||||
|
import sig.plugin.TwosideKeeper.Drops.DropRandomFirework;
|
||||||
import sig.plugin.TwosideKeeper.Drops.SigDrop;
|
import sig.plugin.TwosideKeeper.Drops.SigDrop;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
||||||
@ -534,7 +535,7 @@ public class Christmas {
|
|||||||
c.addDrop(new DropMaterial(Material.LAPIS_BLOCK,1,4,5));
|
c.addDrop(new DropMaterial(Material.LAPIS_BLOCK,1,4,5));
|
||||||
c.addDrop(new DropMaterial(Material.DIAMOND_BLOCK,1,4,5));
|
c.addDrop(new DropMaterial(Material.DIAMOND_BLOCK,1,4,5));
|
||||||
c.addDrop(new DropMaterial(Material.EMERALD_BLOCK,1,4,5));
|
c.addDrop(new DropMaterial(Material.EMERALD_BLOCK,1,4,5));
|
||||||
c.addDrop(new DropMaterial(Material.FIREWORK,32,64,30));
|
c.addDrop(new DropRandomFirework(32,64,30));
|
||||||
c.addDrop(new DropMaterial(Material.NETHER_STAR,1));
|
c.addDrop(new DropMaterial(Material.NETHER_STAR,1));
|
||||||
c.addDrop(new DropItem(getCookieItem(),1,3,20));
|
c.addDrop(new DropItem(getCookieItem(),1,3,20));
|
||||||
c.addDrop(new DropItem(getSmallCandyItem(),1,3,5));
|
c.addDrop(new DropItem(getSmallCandyItem(),1,3,5));
|
||||||
|
@ -1,9 +1,15 @@
|
|||||||
package sig.plugin.TwosideKeeper.Monster;
|
package sig.plugin.TwosideKeeper.Monster;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Monster;
|
import org.bukkit.entity.Monster;
|
||||||
@ -12,6 +18,7 @@ import org.bukkit.entity.Skeleton;
|
|||||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.ChargeZombie;
|
import sig.plugin.TwosideKeeper.ChargeZombie;
|
||||||
|
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||||
import sig.plugin.TwosideKeeper.CustomMonster;
|
import sig.plugin.TwosideKeeper.CustomMonster;
|
||||||
import sig.plugin.TwosideKeeper.MonsterController;
|
import sig.plugin.TwosideKeeper.MonsterController;
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
@ -24,6 +31,8 @@ public class Wither extends CustomMonster{
|
|||||||
private long lastWitherSkeletonSpawned=0;
|
private long lastWitherSkeletonSpawned=0;
|
||||||
private long stuckTimer=0;
|
private long stuckTimer=0;
|
||||||
private Location lastLoc = null;
|
private Location lastLoc = null;
|
||||||
|
private List<Player> activeplayers = new ArrayList<Player>();
|
||||||
|
private HashMap<String,Double> dmgbreakdown = new HashMap<String,Double>();
|
||||||
|
|
||||||
public Wither(LivingEntity m) {
|
public Wither(LivingEntity m) {
|
||||||
super(m);
|
super(m);
|
||||||
@ -38,8 +47,29 @@ public class Wither extends CustomMonster{
|
|||||||
this.lastSkullShot = TwosideKeeper.getServerTickTime();
|
this.lastSkullShot = TwosideKeeper.getServerTickTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void runHitEvent(Entity damager, double damage) { //Runs when this monster gets hit.
|
||||||
|
LivingEntity shooter = CustomDamage.getDamagerEntity(damager);
|
||||||
|
if (shooter instanceof Player) {
|
||||||
|
Player p = (Player)shooter;
|
||||||
|
if (dmgbreakdown.containsKey(p.getName())) {
|
||||||
|
dmgbreakdown.put(p.getName(), dmgbreakdown.get(p.getName())+damage);
|
||||||
|
} else {
|
||||||
|
dmgbreakdown.put(p.getName(), damage);
|
||||||
|
}
|
||||||
|
if (!activeplayers.contains(p)) {
|
||||||
|
activeplayers.add(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void runTick() {
|
public void runTick() {
|
||||||
if (m instanceof Monster) {
|
if (m instanceof Monster) {
|
||||||
|
RemoveInactivePlayers();
|
||||||
|
|
||||||
|
if (activeplayers.size()==0 && dmgbreakdown.size()>0) {
|
||||||
|
DisplayFailedDPSReport();
|
||||||
|
}
|
||||||
|
|
||||||
if (((Monster) m).getTarget()!=null) {
|
if (((Monster) m).getTarget()!=null) {
|
||||||
ChargeZombie.BreakBlocksAroundArea((Monster)m, 2);
|
ChargeZombie.BreakBlocksAroundArea((Monster)m, 2);
|
||||||
}
|
}
|
||||||
@ -57,7 +87,7 @@ public class Wither extends CustomMonster{
|
|||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
||||||
m.teleport(m.getLocation().add(Math.random()*10-5,0,0));
|
m.teleport(m.getLocation().add(Math.random()*10-5,0,0));
|
||||||
} else
|
} else
|
||||||
if (numb<=0.33) {
|
if (numb<=0.5) {
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
||||||
m.teleport(m.getLocation().add(0,0,Math.random()*10-5));
|
m.teleport(m.getLocation().add(0,0,Math.random()*10-5));
|
||||||
} else
|
} else
|
||||||
@ -70,8 +100,13 @@ public class Wither extends CustomMonster{
|
|||||||
if (m.getHealth()<m.getMaxHealth()) {
|
if (m.getHealth()<m.getMaxHealth()) {
|
||||||
m.setHealth(Math.min(m.getMaxHealth(), m.getHealth()+5));
|
m.setHealth(Math.min(m.getMaxHealth(), m.getHealth()+5));
|
||||||
}
|
}
|
||||||
if (m.getLocation().getY()>=128) {
|
if (m.getWorld().getName().equalsIgnoreCase("world_nether") && m.getLocation().getY()>=128) {
|
||||||
m.teleport(m.getLocation().add(0,-32,0));
|
m.teleport(m.getLocation().add(0,-4,0));
|
||||||
|
} else
|
||||||
|
if (m.getWorld().getName().equalsIgnoreCase("world") && m.getLocation().getY()>=164) {
|
||||||
|
Location newloc = m.getLocation().clone();
|
||||||
|
newloc.setY(164);
|
||||||
|
m.teleport(newloc);
|
||||||
}
|
}
|
||||||
if (m.getHealth()<86000 && lastWitherSkeletonSpawned+40<TwosideKeeper.getServerTickTime() &&
|
if (m.getHealth()<86000 && lastWitherSkeletonSpawned+40<TwosideKeeper.getServerTickTime() &&
|
||||||
GenericFunctions.GetNearbyMonsterCount(m, 32)<50) {
|
GenericFunctions.GetNearbyMonsterCount(m, 32)<50) {
|
||||||
@ -92,6 +127,61 @@ public class Wither extends CustomMonster{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RemoveInactivePlayers() {
|
||||||
|
for (Player pl : activeplayers) {
|
||||||
|
if (pl==null || !pl.isValid() || pl.isDead() || !pl.isOnline()) {
|
||||||
|
TwosideKeeper.ScheduleRemoval(activeplayers, pl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisplayFailedDPSReport() {
|
||||||
|
Bukkit.getServer().broadcastMessage(GenericFunctions.getDisplayName(m)+" Takedown Failed...");
|
||||||
|
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
|
||||||
|
Bukkit.getServer().broadcastMessage(generateDPSReport());
|
||||||
|
aPlugin.API.discordSendRaw(GenericFunctions.getDisplayName(m)+" Takedown Failed...\n\n"+ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+generateDPSReport()+"\n```");
|
||||||
|
dmgbreakdown.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DisplaySuccessfulDPSReport() {
|
||||||
|
Bukkit.getServer().broadcastMessage(GenericFunctions.getDisplayName(m)+" has been defeated!");
|
||||||
|
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
|
||||||
|
Bukkit.getServer().broadcastMessage(generateDPSReport());
|
||||||
|
aPlugin.API.discordSendRaw(GenericFunctions.getDisplayName(m)+" has been defeated!\n\n"+ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+generateDPSReport()+"\n```");
|
||||||
|
dmgbreakdown.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String generateDPSReport() {
|
||||||
|
//Sorts a list of players by DPS contribution.
|
||||||
|
List<Double> sorted_dmg = new ArrayList<Double>();
|
||||||
|
List<String> sorted_pl = new ArrayList<String>();
|
||||||
|
double totaldmg = 0;
|
||||||
|
for (String pl : dmgbreakdown.keySet()) {
|
||||||
|
double dmg = dmgbreakdown.get(pl);
|
||||||
|
int slot = 0;
|
||||||
|
totaldmg+=dmg;
|
||||||
|
for (int i=0;i<sorted_dmg.size();i++) {
|
||||||
|
if (dmg>sorted_dmg.get(i)) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
slot++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sorted_pl.add(slot,pl);
|
||||||
|
sorted_dmg.add(slot,dmg);
|
||||||
|
}
|
||||||
|
StringBuilder finalstr = new StringBuilder();
|
||||||
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
|
for (int i=0;i<sorted_pl.size();i++) {
|
||||||
|
if (finalstr.length()!=0) {
|
||||||
|
finalstr.append("\n");
|
||||||
|
}
|
||||||
|
finalstr.append(sorted_pl.get(i)+": "+df.format(sorted_dmg.get(i))+" dmg ("+df.format((sorted_dmg.get(i)/totaldmg)*100)+"%)");
|
||||||
|
}
|
||||||
|
return finalstr.toString();
|
||||||
|
}
|
||||||
|
|
||||||
private Player FindClosestNearbyTarget() {
|
private Player FindClosestNearbyTarget() {
|
||||||
Player closestplayer=null;
|
Player closestplayer=null;
|
||||||
double dist=999999;
|
double dist=999999;
|
||||||
|
@ -1313,6 +1313,8 @@ public class MonsterController {
|
|||||||
LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(ent);
|
LivingEntityStructure les = LivingEntityStructure.getLivingEntityStructure(ent);
|
||||||
les.SetLeader(true);
|
les.SetLeader(true);
|
||||||
les.m.setMaxHealth(480000);
|
les.m.setMaxHealth(480000);
|
||||||
|
les.m.setCustomName(ChatColor.RED+"Leader Wither");
|
||||||
|
les.m.setCustomNameVisible(true);
|
||||||
les.m.setHealth(les.m.getMaxHealth());
|
les.m.setHealth(les.m.getMaxHealth());
|
||||||
if (les.m.getLocation().getY()>=128) {
|
if (les.m.getLocation().getY()>=128) {
|
||||||
les.m.teleport(les.m.getLocation().add(0,-32,0));
|
les.m.teleport(les.m.getLocation().add(0,-32,0));
|
||||||
|
@ -25,6 +25,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
|
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
import sig.plugin.TwosideKeeper.Logging.DamageLogger;
|
import sig.plugin.TwosideKeeper.Logging.DamageLogger;
|
||||||
|
|
||||||
//import com.google.common.graph.*;
|
//import com.google.common.graph.*;
|
||||||
@ -242,7 +243,6 @@ public class PlayerStructure {
|
|||||||
this.isPlayingSpleef=false;
|
this.isPlayingSpleef=false;
|
||||||
this.iframetime=TwosideKeeper.getServerTickTime();
|
this.iframetime=TwosideKeeper.getServerTickTime();
|
||||||
//Set defaults first, in case this is a new user.
|
//Set defaults first, in case this is a new user.
|
||||||
setDefaultCooldowns(p);
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
p.getInventory().addItem(new ItemStack(Material.PORTAL));
|
p.getInventory().addItem(new ItemStack(Material.PORTAL));
|
||||||
|
|
||||||
@ -282,17 +282,20 @@ public class PlayerStructure {
|
|||||||
|
|
||||||
//Joined always gets set to new time.
|
//Joined always gets set to new time.
|
||||||
this.joined = serverTickTime;
|
this.joined = serverTickTime;
|
||||||
|
setDefaultCooldowns(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultCooldowns(Player p) {
|
private void setDefaultCooldowns(Player p) {
|
||||||
aPlugin.API.sendCooldownPacket(p, Material.BOW, TwosideKeeper.DODGE_COOLDOWN);
|
aPlugin.API.sendCooldownPacket(p, Material.BOW, GenericFunctions.GetRemainingCooldownTime(p, last_dodge, TwosideKeeper.DODGE_COOLDOWN));
|
||||||
applyCooldownToAllTypes(p,"HOE",TwosideKeeper.DEATHMARK_COOLDOWN);
|
applyCooldownToAllTypes(p,"HOE",GenericFunctions.GetRemainingCooldownTime(p, last_deathmark, TwosideKeeper.DEATHMARK_COOLDOWN));
|
||||||
applyCooldownToAllTypes(p,"SPADE",TwosideKeeper.EARTHWAVE_COOLDOWN);
|
applyCooldownToAllTypes(p,"SPADE",GenericFunctions.GetRemainingCooldownTime(p, lastusedearthwave, TwosideKeeper.EARTHWAVE_COOLDOWN));
|
||||||
applyCooldownToAllTypes(p,"SWORD",TwosideKeeper.LINEDRIVE_COOLDOWN);
|
applyCooldownToAllTypes(p,"SWORD",GenericFunctions.GetRemainingCooldownTime(p, last_strikerspell, TwosideKeeper.LINEDRIVE_COOLDOWN));
|
||||||
aPlugin.API.sendCooldownPacket(p, Material.SHIELD, TwosideKeeper.REJUVENATE_COOLDOWN);
|
aPlugin.API.sendCooldownPacket(p, Material.SHIELD, GenericFunctions.GetRemainingCooldownTime(p, last_rejuvenate, TwosideKeeper.REJUVENATE_COOLDOWN));
|
||||||
aPlugin.API.sendCooldownPacket(p, Material.SKULL_ITEM, TwosideKeeper.LIFESAVER_COOLDOWN);
|
aPlugin.API.sendCooldownPacket(p, Material.SKULL_ITEM, GenericFunctions.GetRemainingCooldownTime(p, lastlifesavertime, TwosideKeeper.LIFESAVER_COOLDOWN));
|
||||||
aPlugin.API.sendCooldownPacket(p, Material.WATCH, TwosideKeeper.ICEWAND_COOLDOWN);
|
aPlugin.API.sendCooldownPacket(p, Material.WATCH, GenericFunctions.GetRemainingCooldownTime(p, icewandused, TwosideKeeper.ICEWAND_COOLDOWN));
|
||||||
|
aPlugin.API.sendCooldownPacket(p, Material.RAW_FISH, GenericFunctions.GetRemainingCooldownTime(p, lastcandyconsumed, 40));
|
||||||
|
aPlugin.API.sendCooldownPacket(p, Material.GOLDEN_APPLE, GenericFunctions.GetRemainingCooldownTime(p, lastrevivecandyconsumed, 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyCooldownToAllTypes(Player p, String item, int cooldown) {
|
private void applyCooldownToAllTypes(Player p, String item, int cooldown) {
|
||||||
@ -306,7 +309,7 @@ public class PlayerStructure {
|
|||||||
//Save the configuration.
|
//Save the configuration.
|
||||||
public void saveConfig() {
|
public void saveConfig() {
|
||||||
File config;
|
File config;
|
||||||
config = new File(TwosideKeeper.filesave,"users/"+name+".data");
|
config = new File(TwosideKeeper.filesave,"users/"+Bukkit.getPlayer(name).getUniqueId()+".data");
|
||||||
FileConfiguration workable = YamlConfiguration.loadConfiguration(config);
|
FileConfiguration workable = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
workable.set("name", name);
|
workable.set("name", name);
|
||||||
@ -351,6 +354,25 @@ public class PlayerStructure {
|
|||||||
workable.set("deathloc_y", deathloc_y);
|
workable.set("deathloc_y", deathloc_y);
|
||||||
workable.set("deathloc_z", deathloc_z);
|
workable.set("deathloc_z", deathloc_z);
|
||||||
workable.set("deathloc_world", deathloc_world);
|
workable.set("deathloc_world", deathloc_world);
|
||||||
|
workable.set("COOLDOWN_deathmark", last_deathmark);
|
||||||
|
workable.set("COOLDOWN_shovelspell", last_shovelspell);
|
||||||
|
workable.set("COOLDOWN_strikerspell", last_strikerspell);
|
||||||
|
workable.set("COOLDOWN_usedearthwave", lastusedearthwave);
|
||||||
|
workable.set("COOLDOWN_arrowbarrage", last_arrowbarrage);
|
||||||
|
workable.set("COOLDOWN_laughtime", last_laugh_time);
|
||||||
|
workable.set("COOLDOWN_rejuvenate", last_rejuvenate);
|
||||||
|
workable.set("COOLDOWN_swordhit", last_swordhit);
|
||||||
|
workable.set("COOLDOWN_strikerspell", last_strikerspell);
|
||||||
|
workable.set("COOLDOWN_absorptionhealthgiven", lastabsorptionhealthgiven);
|
||||||
|
workable.set("COOLDOWN_ignoretargetarmor", ignoretargetarmor);
|
||||||
|
workable.set("COOLDOWN_lastrevivecandyconsumed", lastrevivecandyconsumed);
|
||||||
|
workable.set("COOLDOWN_lastcandyconsumed", lastcandyconsumed);
|
||||||
|
workable.set("COOLDOWN_icewandused", icewandused);
|
||||||
|
workable.set("COOLDOWN_lastdodge", last_dodge);
|
||||||
|
workable.set("COOLDOWN_lastsiphon", last_siphon);
|
||||||
|
workable.set("COOLDOWN_lastmock", last_mock);
|
||||||
|
workable.set("COOLDOWN_lastassassinatetime", lastassassinatetime);
|
||||||
|
workable.set("COOLDOWN_lastlifesavertime", lastlifesavertime);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
workable.save(config);
|
workable.save(config);
|
||||||
@ -361,8 +383,14 @@ public class PlayerStructure {
|
|||||||
|
|
||||||
//Create a config for the player.
|
//Create a config for the player.
|
||||||
public void loadConfig(){
|
public void loadConfig(){
|
||||||
File config;
|
Player p = Bukkit.getPlayer(name);
|
||||||
config = new File(TwosideKeeper.filesave,"users/"+name+".data");
|
File config,testconfig;
|
||||||
|
testconfig = new File(TwosideKeeper.filesave,"users/"+name+".data");
|
||||||
|
config = new File(TwosideKeeper.filesave,"users/"+p.getUniqueId()+".data");
|
||||||
|
if (testconfig.exists()) {
|
||||||
|
TwosideKeeper.log("Renaming old config for player "+ChatColor.YELLOW+name+ChatColor.RESET+" to UUID "+ChatColor.YELLOW+p.getUniqueId(), 1);
|
||||||
|
testconfig.renameTo(config);
|
||||||
|
}
|
||||||
FileConfiguration workable = YamlConfiguration.loadConfiguration(config);
|
FileConfiguration workable = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
//Add all our default settings here.
|
//Add all our default settings here.
|
||||||
@ -382,6 +410,7 @@ public class PlayerStructure {
|
|||||||
workable.addDefault("weaponcharges", weaponcharges);
|
workable.addDefault("weaponcharges", weaponcharges);
|
||||||
workable.addDefault("lifestealstacks", lifestealstacks);
|
workable.addDefault("lifestealstacks", lifestealstacks);
|
||||||
workable.addDefault("vendetta_amt", vendetta_amt);
|
workable.addDefault("vendetta_amt", vendetta_amt);
|
||||||
|
workable.addDefault("lastvendettastack", lastvendettastack);
|
||||||
workable.addDefault("weatherwatch", weatherwatch);
|
workable.addDefault("weatherwatch", weatherwatch);
|
||||||
workable.addDefault("weatherwatch_user", weatherwatch_user);
|
workable.addDefault("weatherwatch_user", weatherwatch_user);
|
||||||
workable.addDefault("holidaychest1", holidaychest1);
|
workable.addDefault("holidaychest1", holidaychest1);
|
||||||
@ -390,12 +419,31 @@ public class PlayerStructure {
|
|||||||
workable.addDefault("holidaychest4", holidaychest4);
|
workable.addDefault("holidaychest4", holidaychest4);
|
||||||
workable.addDefault("lastsantabox2", lastsantabox2);
|
workable.addDefault("lastsantabox2", lastsantabox2);
|
||||||
workable.addDefault("playermode_on_death", playermode_on_death.name());
|
workable.addDefault("playermode_on_death", playermode_on_death.name());
|
||||||
|
workable.addDefault("COOLDOWN_deathmark", last_deathmark);
|
||||||
|
workable.addDefault("COOLDOWN_shovelspell", last_shovelspell);
|
||||||
|
workable.addDefault("COOLDOWN_strikerspell", last_strikerspell);
|
||||||
|
workable.addDefault("COOLDOWN_usedearthwave", lastusedearthwave);
|
||||||
|
workable.addDefault("COOLDOWN_arrowbarrage", last_arrowbarrage);
|
||||||
|
workable.addDefault("COOLDOWN_laughtime", last_laugh_time);
|
||||||
|
workable.addDefault("COOLDOWN_rejuvenate", last_rejuvenate);
|
||||||
|
workable.addDefault("COOLDOWN_swordhit", last_swordhit);
|
||||||
|
workable.addDefault("COOLDOWN_strikerspell", last_strikerspell);
|
||||||
|
workable.addDefault("COOLDOWN_absorptionhealthgiven", lastabsorptionhealthgiven);
|
||||||
|
workable.addDefault("COOLDOWN_ignoretargetarmor", ignoretargetarmor);
|
||||||
|
workable.addDefault("COOLDOWN_lastrevivecandyconsumed", lastrevivecandyconsumed);
|
||||||
|
workable.addDefault("COOLDOWN_lastcandyconsumed", lastcandyconsumed);
|
||||||
|
workable.addDefault("COOLDOWN_icewandused", icewandused);
|
||||||
|
workable.addDefault("COOLDOWN_lastdodge", last_dodge);
|
||||||
|
workable.addDefault("COOLDOWN_lastsiphon", last_siphon);
|
||||||
|
workable.addDefault("COOLDOWN_lastmock", last_mock);
|
||||||
|
workable.addDefault("COOLDOWN_lastassassinatetime", lastassassinatetime);
|
||||||
|
workable.addDefault("COOLDOWN_lastlifesavertime", lastlifesavertime);
|
||||||
|
|
||||||
workable.options().copyDefaults();
|
workable.options().copyDefaults();
|
||||||
|
|
||||||
//Set all variables.
|
//Set all variables.
|
||||||
|
|
||||||
this.name = workable.getString("name");
|
//this.name = workable.getString("name");
|
||||||
//this.displayName = workable.getString("displayName");
|
//this.displayName = workable.getString("displayName");
|
||||||
this.joined = workable.getLong("joined");
|
this.joined = workable.getLong("joined");
|
||||||
this.firstjoined = workable.getLong("firstjoined");
|
this.firstjoined = workable.getLong("firstjoined");
|
||||||
@ -424,7 +472,27 @@ public class PlayerStructure {
|
|||||||
this.holidaychest3 = workable.getBoolean("holidaychest3");
|
this.holidaychest3 = workable.getBoolean("holidaychest3");
|
||||||
this.holidaychest4 = workable.getBoolean("holidaychest4");
|
this.holidaychest4 = workable.getBoolean("holidaychest4");
|
||||||
this.lastsantabox2 = workable.getLong("lastsantabox2");
|
this.lastsantabox2 = workable.getLong("lastsantabox2");
|
||||||
|
this.lastvendettastack = workable.getLong("lastvendettastack");
|
||||||
this.playermode_on_death = PlayerMode.valueOf(workable.getString("playermode_on_death"));
|
this.playermode_on_death = PlayerMode.valueOf(workable.getString("playermode_on_death"));
|
||||||
|
this.last_deathmark = workable.getLong("COOLDOWN_deathmark");
|
||||||
|
this.last_shovelspell = workable.getLong("COOLDOWN_shovelspell");
|
||||||
|
this.last_strikerspell = workable.getLong("COOLDOWN_strikerspell");
|
||||||
|
this.lastusedearthwave = workable.getLong("COOLDOWN_usedearthwave");
|
||||||
|
this.last_arrowbarrage = workable.getLong("COOLDOWN_arrowbarrage");
|
||||||
|
this.last_laugh_time = workable.getLong("COOLDOWN_laughtime");
|
||||||
|
this.last_rejuvenate = workable.getLong("COOLDOWN_rejuvenate");
|
||||||
|
this.last_swordhit = workable.getLong("COOLDOWN_swordhit");
|
||||||
|
this.last_strikerspell = workable.getLong("COOLDOWN_strikerspell");
|
||||||
|
this.lastabsorptionhealthgiven = workable.getLong("COOLDOWN_absorptionhealthgiven");
|
||||||
|
this.ignoretargetarmor = workable.getLong("COOLDOWN_ignoretargetarmor");
|
||||||
|
this.lastrevivecandyconsumed = workable.getLong("COOLDOWN_lastrevivecandyconsumed");
|
||||||
|
this.lastcandyconsumed = workable.getLong("COOLDOWN_lastcandyconsumed");
|
||||||
|
this.icewandused = workable.getLong("COOLDOWN_icewandused");
|
||||||
|
this.last_dodge = workable.getLong("COOLDOWN_lastdodge");
|
||||||
|
this.last_siphon = workable.getLong("COOLDOWN_lastsiphon");
|
||||||
|
this.last_mock = workable.getLong("COOLDOWN_lastmock");
|
||||||
|
this.lastassassinatetime = workable.getLong("COOLDOWN_lastassassinatetime");
|
||||||
|
this.lastlifesavertime = workable.getLong("COOLDOWN_lastlifesavertime");
|
||||||
|
|
||||||
if (this.hasDied) {
|
if (this.hasDied) {
|
||||||
List<ItemStack> deathlootlist = new ArrayList<ItemStack>();
|
List<ItemStack> deathlootlist = new ArrayList<ItemStack>();
|
||||||
|
@ -480,6 +480,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public int sleepingPlayers=0;
|
public int sleepingPlayers=0;
|
||||||
public static List<Material> validsetitems = new ArrayList<Material>();
|
public static List<Material> validsetitems = new ArrayList<Material>();
|
||||||
|
|
||||||
|
public static double DEAL_OF_THE_DAY_PCT=0.2;
|
||||||
|
|
||||||
public final static boolean CHRISTMASEVENT_ACTIVATED=false;
|
public final static boolean CHRISTMASEVENT_ACTIVATED=false;
|
||||||
public final static boolean CHRISTMASLINGERINGEVENT_ACTIVATED=false; //Limited Christmas drops/functionality remain while the majority of it is turned off.
|
public final static boolean CHRISTMASLINGERINGEVENT_ACTIVATED=false; //Limited Christmas drops/functionality remain while the majority of it is turned off.
|
||||||
|
|
||||||
@ -653,36 +655,72 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
//This is fine! Clear away blocks.
|
//This is fine! Clear away blocks.
|
||||||
Monster m = cz.GetZombie();
|
Monster m = cz.GetZombie();
|
||||||
|
|
||||||
|
if (cz.lastLoc!=null && cz.lastLoc.distance(m.getLocation())<=0.4) {
|
||||||
|
cz.stuckTimer++;
|
||||||
|
//TwosideKeeper.log("Stuck. "+stuckTimer, 0);
|
||||||
|
} else {
|
||||||
|
cz.stuckTimer=0;
|
||||||
|
}
|
||||||
|
cz.lastLoc = m.getLocation().clone();
|
||||||
|
if (cz.stuckTimer>5) {
|
||||||
|
//Teleport randomly.
|
||||||
|
double numb = Math.random();
|
||||||
|
if (numb<=0.33) {
|
||||||
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
||||||
|
m.teleport(m.getLocation().add(Math.random()*6-3,0,0));
|
||||||
|
} else
|
||||||
|
if (numb<=0.5) {
|
||||||
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
||||||
|
m.teleport(m.getLocation().add(0,0,Math.random()*6-3));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_ENDERMEN_TELEPORT, 1.0f, 1.0f);
|
||||||
|
m.teleport(m.getLocation().add(0,Math.random()*6-3,0));
|
||||||
|
}
|
||||||
|
cz.stuckTimer=0;
|
||||||
|
}
|
||||||
if (m.getTarget().getLocation().getY()>=m.getLocation().getY()+2 &&
|
if (m.getTarget().getLocation().getY()>=m.getLocation().getY()+2 &&
|
||||||
Math.abs(m.getTarget().getLocation().getX()-m.getLocation().getX())<1 &&
|
Math.abs(m.getTarget().getLocation().getX()-m.getLocation().getX())<3 &&
|
||||||
Math.abs(m.getTarget().getLocation().getZ()-m.getLocation().getZ())<1) {
|
Math.abs(m.getTarget().getLocation().getZ()-m.getLocation().getZ())<3) {
|
||||||
//This target is higher than we can reach... Let's pillar.
|
//This target is higher than we can reach... Let's pillar.
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
r.setSeed(m.getUniqueId().getMostSignificantBits());
|
r.setSeed(m.getUniqueId().getMostSignificantBits());
|
||||||
//Block type is chosen based on the seed. Will be cobblestone, dirt, or gravel.
|
//Block type is chosen based on the seed. Will be cobblestone, dirt, or gravel.
|
||||||
if (m.getLocation().getBlock().getType()==Material.AIR &&
|
for (int x=-1;x<2;x++) {
|
||||||
m.getLocation().add(0,-1,0).getBlock().getType()!=Material.AIR &&
|
for (int z=-1;z<2;z++) {
|
||||||
!m.getLocation().add(0,-1,0).getBlock().isLiquid()) {
|
if (m.getLocation().add(x,-1,z).getBlock().getType()==Material.AIR ||
|
||||||
m.setVelocity(new Vector(0,0.5,0));
|
m.getLocation().add(x,-1,z).getBlock().isLiquid()) {
|
||||||
if (m.getLocation().getWorld().getName().equalsIgnoreCase("world_nether")) {
|
m.setVelocity(new Vector(0,0.5,0));
|
||||||
m.getLocation().getBlock().setType(Material.NETHERRACK);
|
if (m.getLocation().getWorld().getName().equalsIgnoreCase("world_nether")) {
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.BLOCK_STONE_PLACE, 1.0f, 1.0f);
|
m.getLocation().getBlock().getRelative(x,0,z).setType(Material.NETHERRACK);
|
||||||
} else {
|
|
||||||
switch (r.nextInt(3)) {
|
|
||||||
case 0:{
|
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.BLOCK_GRAVEL_PLACE, 1.0f, 1.0f);
|
|
||||||
}break;
|
|
||||||
case 1:{
|
|
||||||
m.getLocation().getBlock().setType(Material.COBBLESTONE);
|
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.BLOCK_STONE_PLACE, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.BLOCK_STONE_PLACE, 1.0f, 1.0f);
|
||||||
}break;
|
} else {
|
||||||
case 2:{
|
switch (r.nextInt(3)) {
|
||||||
m.getLocation().getBlock().setType(Material.GRAVEL);
|
case 0:{
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.BLOCK_GRAVEL_PLACE, 1.0f, 1.0f);
|
m.getLocation().getBlock().getRelative(x,0,z).setType(Material.DIRT);
|
||||||
}break;
|
SoundUtils.playGlobalSound(m.getLocation().add(x,0,z), Sound.BLOCK_GRAVEL_PLACE, 1.0f, 1.0f);
|
||||||
|
}break;
|
||||||
|
case 1:{
|
||||||
|
m.getLocation().getBlock().getRelative(x,0,z).setType(Material.COBBLESTONE);
|
||||||
|
SoundUtils.playGlobalSound(m.getLocation().add(x,0,z), Sound.BLOCK_STONE_PLACE, 1.0f, 1.0f);
|
||||||
|
}break;
|
||||||
|
case 2:{
|
||||||
|
m.getLocation().getBlock().getRelative(x,0,z).setType(Material.GRAVEL);
|
||||||
|
SoundUtils.playGlobalSound(m.getLocation().add(x,0,z), Sound.BLOCK_GRAVEL_PLACE, 1.0f, 1.0f);
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Command all nearby entities to jump too.
|
||||||
|
List<LivingEntity> ents = GenericFunctions.getNearbyMonsters(m.getLocation(), 2);
|
||||||
|
for (LivingEntity ent : ents) {
|
||||||
|
if (!ent.equals(m)) {
|
||||||
|
ent.setVelocity(new Vector(0,0.5,0));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ChargeZombie.BreakBlocksAroundArea(cz.m,1);
|
ChargeZombie.BreakBlocksAroundArea(cz.m,1);
|
||||||
}
|
}
|
||||||
@ -893,6 +931,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
WorldShop.createWorldShopRecipes();
|
WorldShop.createWorldShopRecipes();
|
||||||
WorldShop.loadShopPrices();
|
WorldShop.loadShopPrices();
|
||||||
TwosideKeeper.DEAL_OF_THE_DAY_ITEM = WorldShop.generateItemDealOftheDay(1);
|
TwosideKeeper.DEAL_OF_THE_DAY_ITEM = WorldShop.generateItemDealOftheDay(1);
|
||||||
|
TwosideKeeper.DEAL_OF_THE_DAY_PCT = WorldShop.generatePercentOffForDealOftheDay();
|
||||||
log("Deal of the day loaded successfully: "+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM),2);
|
log("Deal of the day loaded successfully: "+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM),2);
|
||||||
|
|
||||||
if (!LOOT_TABLE_NEEDS_POPULATING) {
|
if (!LOOT_TABLE_NEEDS_POPULATING) {
|
||||||
@ -1155,6 +1194,49 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (p.getLocation().add(0,0,0).getBlock().getType()==Material.PISTON_MOVING_PIECE) {
|
if (p.getLocation().add(0,0,0).getBlock().getType()==Material.PISTON_MOVING_PIECE) {
|
||||||
p.getLocation().add(0,0,0).getBlock().setType(Material.AIR);
|
p.getLocation().add(0,0,0).getBlock().setType(Material.AIR);
|
||||||
}
|
}
|
||||||
|
if (args.length>0) {
|
||||||
|
ItemStack item = new ItemStack(p.getEquipment().getItemInMainHand().getType(),1,p.getEquipment().getItemInMainHand().getDurability());
|
||||||
|
if (GenericFunctions.isEquip(item)) {
|
||||||
|
item.setDurability((short) 0);
|
||||||
|
}
|
||||||
|
switch (args[0]) {
|
||||||
|
case "price":{
|
||||||
|
if (args.length<2) { //Display the price of the item in hand.
|
||||||
|
if (item!=null && item.getType()!=Material.AIR) {
|
||||||
|
double price = WorldShop.getBaseWorldShopPrice(item);
|
||||||
|
p.sendMessage("The base shop price of "+ChatColor.YELLOW+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.RESET+" is "+ChatColor.GREEN+"$"+df.format(price)+ChatColor.RESET+".");
|
||||||
|
} else {
|
||||||
|
p.sendMessage("That is an invalid item!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (p.getName().equalsIgnoreCase("ishiyama") || p.isOp()) {
|
||||||
|
if (isNumeric(args[1])) {
|
||||||
|
double newprice = Double.parseDouble(args[1]);
|
||||||
|
if (item!=null && item.getType()!=Material.AIR) {
|
||||||
|
double price = WorldShop.getBaseWorldShopPrice(item);
|
||||||
|
Bukkit.broadcastMessage(ChatColor.YELLOW+"The base cost of "+ChatColor.GREEN+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.YELLOW+" has been updated!");
|
||||||
|
Bukkit.broadcastMessage(" "+ChatColor.GRAY+ChatColor.STRIKETHROUGH+"$"+df.format(price)+ChatColor.RESET+" -> "+ChatColor.BLUE+ChatColor.BOLD+"$"+df.format(newprice));
|
||||||
|
aPlugin.API.discordSendRawItalicized(ChatColor.YELLOW+"The base cost of **"+ChatColor.GREEN+GenericFunctions.UserFriendlyMaterialName(item)+ChatColor.YELLOW+"** has been updated!");
|
||||||
|
aPlugin.API.discordSendRawItalicized(" ~~"+ChatColor.GRAY+ChatColor.STRIKETHROUGH+"$"+df.format(price)+ChatColor.RESET+"~~ -> **"+ChatColor.BLUE+ChatColor.BOLD+"$"+df.format(newprice)+"**");
|
||||||
|
String searchstring = item.getType().name();
|
||||||
|
if (item.getDurability()!=0) {
|
||||||
|
searchstring = item.getType().name()+","+item.getDurability();
|
||||||
|
}
|
||||||
|
WorldShop.pricelist.put(searchstring, newprice);
|
||||||
|
WorldShop.SaveAllPriceEntriesToFile();
|
||||||
|
} else {
|
||||||
|
p.sendMessage("That is an invalid item!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
p.sendMessage("That is an invalid price!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
p.sendMessage("No permission!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (p.isOp()) {
|
if (p.isOp()) {
|
||||||
/*PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
/*PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.swordcombo=20;*/
|
pd.swordcombo=20;*/
|
||||||
@ -2194,7 +2276,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
p.sendMessage("--------------------");
|
p.sendMessage("--------------------");
|
||||||
p.sendMessage(ChatColor.DARK_AQUA+""+ChatColor.BOLD+"Deal of the Day:");
|
p.sendMessage(ChatColor.DARK_AQUA+""+ChatColor.BOLD+"Deal of the Day:");
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
p.sendMessage(" "+ChatColor.GREEN+""+ChatColor.BOLD+""+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)+" "+ChatColor.RESET+ChatColor.STRIKETHROUGH+"$"+df.format(TwosideKeeperAPI.getWorldShopItemBasePrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM))+ChatColor.RESET+ChatColor.GOLD+""+ChatColor.BOLD+" $"+df.format(TwosideKeeperAPI.getWorldShopItemBasePrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)*0.8)+" "+ChatColor.DARK_GREEN+ChatColor.BOLD+"20% Off");
|
DecimalFormat df2 = new DecimalFormat("0");
|
||||||
|
p.sendMessage(" "+ChatColor.GREEN+""+ChatColor.BOLD+""+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)+" "+ChatColor.RESET+ChatColor.STRIKETHROUGH+"$"+df.format(TwosideKeeperAPI.getWorldShopItemBasePrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM))+ChatColor.RESET+ChatColor.GOLD+""+ChatColor.BOLD+" $"+df.format(TwosideKeeperAPI.getWorldShopItemBasePrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)*(1-TwosideKeeper.DEAL_OF_THE_DAY_PCT))+" "+ChatColor.DARK_GREEN+ChatColor.BOLD+""+df2.format(TwosideKeeper.DEAL_OF_THE_DAY_PCT*100)+"% Off");
|
||||||
p.sendMessage(" "+ChatColor.RED+ChatColor.BOLD+"TODAY ONLY!"+ChatColor.RESET+ChatColor.YELLOW+" Find the offer at your local world shops!");
|
p.sendMessage(" "+ChatColor.RED+ChatColor.BOLD+"TODAY ONLY!"+ChatColor.RESET+ChatColor.YELLOW+" Find the offer at your local world shops!");
|
||||||
p.sendMessage("--------------------");
|
p.sendMessage("--------------------");
|
||||||
}
|
}
|
||||||
@ -5985,6 +6068,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
log("In here 1",5);
|
log("In here 1",5);
|
||||||
Monster m = (Monster)ev.getEntity();
|
Monster m = (Monster)ev.getEntity();
|
||||||
|
|
||||||
|
if (ev.getTarget() instanceof Monster &&
|
||||||
|
m.getTarget() instanceof Player) {
|
||||||
|
ev.setCancelled(true); //Monsters will not target other Monsters if they are already targeting a player.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ev.getTarget() instanceof Wither) {
|
if (ev.getTarget() instanceof Wither) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return; //Monsters will not target the Wither, even with friendly fire.
|
return; //Monsters will not target the Wither, even with friendly fire.
|
||||||
@ -6369,6 +6458,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
AttemptToPlaceChest(m.getLocation(),1,1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
|
AttemptToPlaceChest(m.getLocation(),1,1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
|
||||||
AttemptToPlaceChest(m.getLocation(),1,1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
|
AttemptToPlaceChest(m.getLocation(),1,1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
|
||||||
|
|
||||||
|
for (UUID id : custommonsters.keySet()) {
|
||||||
|
if (id.equals(m.getUniqueId())) {
|
||||||
|
sig.plugin.TwosideKeeper.Monster.Wither w = (sig.plugin.TwosideKeeper.Monster.Wither)custommonsters.get(id);
|
||||||
|
w.DisplaySuccessfulDPSReport();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isElite && m instanceof Monster) {
|
if (isElite && m instanceof Monster) {
|
||||||
@ -6409,7 +6505,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
it.setPickupDelay(0);
|
it.setPickupDelay(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
|
|
||||||
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+"!");
|
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+"**!");
|
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().spawnEntity(m.getLocation(), EntityType.LIGHTNING);
|
||||||
@ -6419,6 +6514,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW+"DPS Breakdown:");
|
||||||
Bukkit.getServer().broadcastMessage(em.generateDPSReport());
|
Bukkit.getServer().broadcastMessage(em.generateDPSReport());
|
||||||
aPlugin.API.discordSendRaw(ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+em.generateDPSReport()+"\n```");
|
aPlugin.API.discordSendRaw(ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+em.generateDPSReport()+"\n```");
|
||||||
em.Cleanup();
|
em.Cleanup();
|
||||||
@ -6474,11 +6570,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!mer.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer.getLocation().getBlockY()<48) {
|
if (!mer.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer.getLocation().getBlockY()<48) {
|
||||||
mer.getWorld().createExplosion(mer.getLocation().getBlockX(), mer.getLocation().getBlockY(), mer.getLocation().getBlockZ(), 3.0f, false, true);
|
mer.getWorld().createExplosion(mer.getLocation().getBlockX(), mer.getLocation().getBlockY(), mer.getLocation().getBlockZ(), 1.5f, false, true);
|
||||||
GenericFunctions.DealExplosionDamageToEntities(mer.getLocation(), 8, 3);
|
aPlugin.API.sendSoundlessExplosion(mer.getLocation(), 3.0f);
|
||||||
|
GenericFunctions.DealExplosionDamageToEntities(mer.getLocation(), 20, 3);
|
||||||
} else {
|
} else {
|
||||||
mer.getWorld().createExplosion(mer.getLocation().getBlockX(), mer.getLocation().getBlockY(), mer.getLocation().getBlockZ(), 6.0f, false, false);
|
mer.getWorld().createExplosion(mer.getLocation().getBlockX(), mer.getLocation().getBlockY(), mer.getLocation().getBlockZ(), 6.0f, false, false);
|
||||||
GenericFunctions.DealExplosionDamageToEntities(mer.getLocation(), 8, 6);
|
GenericFunctions.DealExplosionDamageToEntities(mer.getLocation(), 20, 6);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
,30);
|
,30);
|
||||||
@ -6505,12 +6602,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!mer1.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer1.getLocation().getBlockY()<48) {
|
if (!mer1.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer1.getLocation().getBlockY()<48) {
|
||||||
mer1.getWorld().createExplosion(mer1.getLocation().getBlockX(), mer1.getLocation().getBlockY(), mer1.getLocation().getBlockZ(), 5.0f, false, true);
|
mer1.getWorld().createExplosion(mer1.getLocation().getBlockX(), mer1.getLocation().getBlockY(), mer1.getLocation().getBlockZ(), 2.0f, false, true);
|
||||||
GenericFunctions.DealExplosionDamageToEntities(mer1.getLocation(), 12, 5);
|
aPlugin.API.sendSoundlessExplosion(mer1.getLocation(), 5.0f);
|
||||||
|
GenericFunctions.DealExplosionDamageToEntities(mer1.getLocation(), 36, 5);
|
||||||
GenericFunctions.RandomlyCreateFire(mer1.getLocation(),2);
|
GenericFunctions.RandomlyCreateFire(mer1.getLocation(),2);
|
||||||
} else {
|
} else {
|
||||||
mer1.getWorld().createExplosion(mer1.getLocation().getBlockX(), mer1.getLocation().getBlockY(), mer1.getLocation().getBlockZ(), 6.0f, false, false);
|
mer1.getWorld().createExplosion(mer1.getLocation().getBlockX(), mer1.getLocation().getBlockY(), mer1.getLocation().getBlockZ(), 6.0f, false, false);
|
||||||
GenericFunctions.DealExplosionDamageToEntities(mer1.getLocation(), 12, 6);
|
GenericFunctions.DealExplosionDamageToEntities(mer1.getLocation(), 36, 6);
|
||||||
GenericFunctions.RandomlyCreateFire(mer1.getLocation(),3);
|
GenericFunctions.RandomlyCreateFire(mer1.getLocation(),3);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@ -6538,7 +6636,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!mer4.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer4.getLocation().getBlockY()<48) {
|
if (!mer4.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer4.getLocation().getBlockY()<48) {
|
||||||
mer4.getWorld().createExplosion(mer4.getLocation().getBlockX(), mer4.getLocation().getBlockY(), mer4.getLocation().getBlockZ(), 5.0f, false, true);
|
mer4.getWorld().createExplosion(mer4.getLocation().getBlockX(), mer4.getLocation().getBlockY(), mer4.getLocation().getBlockZ(), 2.0f, false, true);
|
||||||
|
aPlugin.API.sendSoundlessExplosion(mer4.getLocation(), 5.0f);
|
||||||
GenericFunctions.DealExplosionDamageToEntities(mer4.getLocation(), 150, 5);
|
GenericFunctions.DealExplosionDamageToEntities(mer4.getLocation(), 150, 5);
|
||||||
GenericFunctions.RandomlyCreateFire(mer4.getLocation(),2);
|
GenericFunctions.RandomlyCreateFire(mer4.getLocation(),2);
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,14 +78,15 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
//SAVE SERVER SETTINGS.
|
//SAVE SERVER SETTINGS.
|
||||||
final long serverTickTime = TwosideKeeper.getServerTickTime();
|
final long serverTickTime = TwosideKeeper.getServerTickTime();
|
||||||
if (serverTickTime-TwosideKeeper.LASTSERVERCHECK>=TwosideKeeper.SERVERCHECKERTICKS) { //15 MINUTES (DEFAULT)
|
if (serverTickTime-TwosideKeeper.LASTSERVERCHECK>=TwosideKeeper.SERVERCHECKERTICKS) { //15 MINUTES (DEFAULT)
|
||||||
|
|
||||||
if (TwosideKeeper.LAST_DEAL!=Calendar.getInstance().get(Calendar.DAY_OF_WEEK)) {
|
if (TwosideKeeper.LAST_DEAL!=Calendar.getInstance().get(Calendar.DAY_OF_WEEK)) {
|
||||||
//This means the deal of the day has to be updated!
|
//This means the deal of the day has to be updated!
|
||||||
TwosideKeeper.LAST_DEAL = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
|
TwosideKeeper.LAST_DEAL = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
|
||||||
TwosideKeeper.DEAL_OF_THE_DAY_ITEM = WorldShop.generateItemDealOftheDay(1);
|
TwosideKeeper.DEAL_OF_THE_DAY_ITEM = WorldShop.generateItemDealOftheDay(1);
|
||||||
|
TwosideKeeper.DEAL_OF_THE_DAY_PCT = WorldShop.generatePercentOffForDealOftheDay();
|
||||||
if (TwosideKeeper.SERVER_TYPE!=ServerType.QUIET) {
|
if (TwosideKeeper.SERVER_TYPE!=ServerType.QUIET) {
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.00");
|
||||||
aPlugin.API.discordSendRaw("*The Deal of the Day has been updated!*\n **"+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)+"** ~~$"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM))+"~~ $"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)*0.8)+" **20% Off!**");
|
DecimalFormat df2 = new DecimalFormat("0");
|
||||||
|
aPlugin.API.discordSendRaw("*The Deal of the Day has been updated!*\n **"+GenericFunctions.UserFriendlyMaterialName(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)+"** ~~$"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM))+"~~ $"+df.format(WorldShop.getBaseWorldShopPrice(TwosideKeeper.DEAL_OF_THE_DAY_ITEM)*(1-TwosideKeeper.DEAL_OF_THE_DAY_PCT))+" **"+df2.format(TwosideKeeper.DEAL_OF_THE_DAY_PCT*100)+"% Off!**");
|
||||||
//MessageUtils.announceMessage("The Deal of the Day has been updated!");
|
//MessageUtils.announceMessage("The Deal of the Day has been updated!");
|
||||||
}
|
}
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
@ -193,75 +194,25 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!aPlugin.API.isAFK(p)) {
|
if (!aPlugin.API.isAFK(p)) {
|
||||||
if (TwosideKeeper.TwosideShops.IsPlayerUsingTerminal(p) &&
|
EndShopSession(p);
|
||||||
(TwosideKeeper.TwosideShops.GetSession(p).GetSign().getBlock()==null || TwosideKeeper.TwosideShops.GetSession(p).IsTimeExpired())) {
|
|
||||||
p.sendMessage(ChatColor.RED+"Ran out of time! "+ChatColor.WHITE+"Shop session closed.");
|
|
||||||
TwosideKeeper.TwosideShops.RemoveSession(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
GenericFunctions.RemoveNewDebuffs(p);
|
GenericFunctions.RemoveNewDebuffs(p);
|
||||||
|
|
||||||
if (ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.DASHER)>0) {
|
ModifyDasherSetSpeedMultiplier(p);
|
||||||
double spdmult = ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.DASHER)/100d;
|
|
||||||
aPlugin.API.setPlayerSpeedMultiplier(p, (float)(1.0f+spdmult));
|
|
||||||
}
|
|
||||||
|
|
||||||
pd.highwinder=ArtifactAbility.containsEnchantment(ArtifactAbility.HIGHWINDER, p.getEquipment().getItemInMainHand());
|
ManageHighwinder(p, pd);
|
||||||
if (pd.highwinder) {
|
RemoveInvalidTarget(p, pd);
|
||||||
pd.highwinderdmg=GenericFunctions.getAbilityValue(ArtifactAbility.HIGHWINDER, p.getEquipment().getItemInMainHand());
|
|
||||||
}
|
|
||||||
if (93.182445*pd.velocity>4.317) {
|
|
||||||
pd.velocity/=2;
|
|
||||||
} else {
|
|
||||||
pd.velocity=0;
|
|
||||||
}
|
|
||||||
if (pd.highwinder && pd.target!=null && !pd.target.isDead()) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pd.lasthittarget+20*15<=serverTickTime && pd.storedbowxp>0 && GenericFunctions.isArtifactEquip(p.getEquipment().getItemInMainHand()) &&
|
GiveArtifactBowXP(serverTickTime, p, pd);
|
||||||
p.getEquipment().getItemInMainHand().getType()==Material.BOW) {
|
|
||||||
AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), pd.storedbowxp, p);
|
|
||||||
TwosideKeeper.log("Added "+pd.storedbowxp+" Artifact XP", 4);
|
|
||||||
pd.storedbowxp=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p.getFireTicks()>0 && p.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE)) {
|
ReduceFireResistanceDuration(p);
|
||||||
int duration = GenericFunctions.getPotionEffectDuration(PotionEffectType.FIRE_RESISTANCE, p);
|
|
||||||
int lv = GenericFunctions.getPotionEffectLevel(PotionEffectType.FIRE_RESISTANCE, p);
|
|
||||||
if (lv>10) {lv=10;}
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.FIRE_RESISTANCE, duration-(20*(10-lv)), lv, p, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p.getWorld().getName().equalsIgnoreCase("world_the_end")) {
|
ControlTheEnd(p, pd);
|
||||||
if (!pd.endnotification) {
|
|
||||||
pd.endnotification=true;
|
|
||||||
playEndWarningNotification(p);
|
|
||||||
}
|
|
||||||
randomlyAggroNearbyEndermen(p);
|
|
||||||
} else {
|
|
||||||
if (pd.endnotification) {
|
|
||||||
pd.endnotification=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack[] equips = p.getEquipment().getArmorContents();
|
ItemStack[] equips = p.getEquipment().getArmorContents();
|
||||||
|
|
||||||
for (ItemStack equip : equips) {
|
ShadowWalkerApplication(p, 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()<=7) {
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,20,1,p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (p.getLocation().getY()>=0 && p.getLocation().getY()<=255 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=7) {
|
|
||||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand())) {
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,20,1,p);
|
|
||||||
}
|
|
||||||
//log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2);
|
|
||||||
}
|
|
||||||
|
|
||||||
//PopulatePlayerBlockList(p,15,15,2,5,false);
|
//PopulatePlayerBlockList(p,15,15,2,5,false);
|
||||||
PopRandomLavaBlock(p);
|
PopRandomLavaBlock(p);
|
||||||
@ -271,161 +222,47 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
if (GenericFunctions.hasStealth(p)) {GenericFunctions.DamageRandomTool(p);}
|
if (GenericFunctions.hasStealth(p)) {GenericFunctions.DamageRandomTool(p);}
|
||||||
|
|
||||||
//See if this player is sleeping.
|
//See if this player is sleeping.
|
||||||
if (p.isSleeping()) {
|
HealForSleeping(p, pd);
|
||||||
p.setHealth(Bukkit.getPlayer(pd.name).getMaxHealth()); //Heals the player fully when sleeping.
|
|
||||||
}
|
|
||||||
|
|
||||||
//We need to see if this player's damage reduction has changed recently. If so, notify them.
|
//We need to see if this player's damage reduction has changed recently. If so, notify them.
|
||||||
//Check damage reduction by sending an artifical "1" damage to the player.
|
//Check damage reduction by sending an artifical "1" damage to the player.
|
||||||
if (!p.isDead()) {TwosideKeeper.log("Player is not dead.",5); TwosideKeeper.setPlayerMaxHealth(p);}
|
ManagePlayerScoreboardAndHealth(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));
|
|
||||||
|
|
||||||
if (PlayerMode.isBarbarian(p)) {
|
if (PlayerMode.isBarbarian(p)) {
|
||||||
AutoConsumeFoods(p);
|
AutoConsumeFoods(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.getAttribute(Attribute.GENERIC_ARMOR).setBaseValue(20*(1.0d-CustomDamage.CalculateDamageReduction(1,p,null))+subtractVanillaArmorBar(p.getEquipment().getArmorContents()));
|
ModifyArmorBar(p);
|
||||||
|
|
||||||
ItemStack[] equips = p.getEquipment().getArmorContents();
|
ItemStack[] equips = p.getEquipment().getArmorContents();
|
||||||
|
|
||||||
if (pd.lastcombat+(20*60)<serverTickTime) {
|
ResetVendetta(serverTickTime, pd);
|
||||||
pd.vendetta_amt=0;
|
ResetLifestealStacks(serverTickTime, pd);
|
||||||
pd.thorns_amt=0;
|
|
||||||
pd.weaponcharges=0;
|
|
||||||
}
|
|
||||||
if (pd.vendetta_amt>0 && pd.lastvendettastack+200<serverTickTime) {
|
|
||||||
pd.vendetta_amt=0;
|
|
||||||
}
|
|
||||||
pd.vendetta_amt=50000;
|
|
||||||
pd.lastvendettastack=TwosideKeeper.getServerTickTime()+500;
|
|
||||||
if (pd.lastattacked+(20*5)<serverTickTime) {
|
|
||||||
pd.lastattacked=0;
|
|
||||||
pd.lifestealstacks=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED) {
|
ManagePlayerLink(p, pd);
|
||||||
if (TwosideKeeper.LastSnowmanHunt+36000<TwosideKeeper.getServerTickTime() && TwosideKeeper.SnowmanHuntList.size()>7) {
|
|
||||||
TwosideKeeper.HuntingForSnowman = TwosideKeeper.SnowmanHuntList.get((int)(Math.random()*TwosideKeeper.SnowmanHuntList.size()));
|
|
||||||
aPlugin.API.discordSendRaw("The Hunt is on to kill the Snowman named **"+TwosideKeeper.HuntingForSnowman+"**!");
|
|
||||||
Bukkit.broadcastMessage("The Hunt is on to kill the Snowman named "+ChatColor.BOLD+TwosideKeeper.HuntingForSnowman+ChatColor.RESET+"!");
|
|
||||||
Bukkit.broadcastMessage(ChatColor.AQUA+" You will earn Holiday Tokens for successfully completing this mission!");
|
|
||||||
TwosideKeeper.LastSnowmanHunt=TwosideKeeper.getServerTickTime();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pd.linkplayer!=null && pd.linkplayer.isValid()) {
|
DepleteDamagePool(serverTickTime, p, pd);
|
||||||
GlowAPI.setGlowing(pd.linkplayer, true, p);
|
|
||||||
if (pd.lastlinkteleport!=0 && pd.lastlinkteleport+12000<TwosideKeeper.getServerTickTime()) {
|
|
||||||
GlowAPI.setGlowing(pd.linkplayer, false, p);
|
|
||||||
pd.linkplayer=null;
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
if (pd.linkplayer!=null && !pd.linkplayer.isValid()) {
|
|
||||||
GlowAPI.setGlowing(pd.linkplayer, false, p);
|
|
||||||
pd.linkplayer=null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pd.damagepool>0 && pd.damagepooltime+20<=serverTickTime) {
|
AdventurerModeSetExhaustion(p);
|
||||||
double transferdmg = CustomDamage.getTransferDamage(p)+(pd.damagepool*0.01);
|
|
||||||
TwosideKeeper.log("Transfer Dmg is "+transferdmg+". Damage Pool: "+pd.damagepool, 5);
|
|
||||||
CustomDamage.ApplyDamage(transferdmg, null, p, null, "Damage Pool", CustomDamage.IGNORE_DAMAGE_TICK|CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE);
|
|
||||||
if (pd.damagepool-transferdmg<=0) {
|
|
||||||
pd.damagepool=0;
|
|
||||||
} else {
|
|
||||||
pd.damagepool-=transferdmg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL) {
|
CalculateHealthRegeneration(serverTickTime, p, pd, equips);
|
||||||
p.setExhaustion(Math.max(0, p.getExhaustion()-0.5f));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pd.last_regen_time+TwosideKeeper.HEALTH_REGENERATION_RATE<=serverTickTime) {
|
ResetSwordCombo(serverTickTime, p, pd);
|
||||||
pd.last_regen_time=serverTickTime;
|
|
||||||
//See if this player needs to be healed.
|
|
||||||
if (p!=null &&
|
|
||||||
!p.isDead() && //Um, don't heal them if they're dead...That's just weird.
|
|
||||||
p.getHealth()<p.getMaxHealth() &&
|
|
||||||
p.getFoodLevel()>=16) {
|
|
||||||
|
|
||||||
if (PlayerMode.getPlayerMode(p)!=PlayerMode.SLAYER || pd.lastcombat+(20*60)<serverTickTime) {
|
ResetSlayerAggro(serverTickTime, p, pd);
|
||||||
double totalregen = 1+(p.getMaxHealth()*0.05);
|
|
||||||
double bonusregen = 0.0;
|
|
||||||
bonusregen += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.ALIKAHN, 4, 4);
|
|
||||||
totalregen += bonusregen;
|
|
||||||
for (ItemStack equip : equips) {
|
|
||||||
if (GenericFunctions.isArtifactEquip(equip)) {
|
|
||||||
double regenamt = GenericFunctions.getAbilityValue(ArtifactAbility.HEALTH_REGEN, equip);
|
|
||||||
bonusregen += regenamt;
|
|
||||||
TwosideKeeper.log("Bonus regen increased by "+regenamt,5);
|
|
||||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, equip)) {
|
|
||||||
totalregen /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, equip)?2:1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())) {
|
|
||||||
totalregen /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())?2:1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pd.pctbonusregentime+100>TwosideKeeper.getServerTickTime()) {
|
ApplyCometRegenBonus(p);
|
||||||
totalregen += totalregen*pd.pctbonusregen;
|
|
||||||
}
|
|
||||||
totalregen += totalregen*((PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL)?0.5d:0d);
|
|
||||||
p.setHealth((p.getHealth()+totalregen>p.getMaxHealth())?p.getMaxHealth():p.getHealth()+totalregen);
|
|
||||||
|
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
DasherFoodRegenPerk(p);
|
||||||
pd.slayermodehp=p.getHealth();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.COMBO, p.getEquipment().getItemInMainHand()) &&
|
GivePartyNightVision(p);
|
||||||
pd.last_swordhit+40<serverTickTime) {
|
|
||||||
pd.swordcombo=0; //Reset the sword combo meter since the time limit expired.
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlayerMode.isSlayer(p)) {
|
|
||||||
if (pd.lastsneak+50<=serverTickTime &&
|
|
||||||
p.isSneaking() &&
|
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.MOONSHADOW, 7)) {
|
|
||||||
GenericFunctions.deAggroNearbyTargets(p);
|
|
||||||
GenericFunctions.applyStealth(p, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
double regenbuff = ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.COMET);
|
|
||||||
if (regenbuff>0) {
|
|
||||||
List<Player> partymembers = PartyManager.getPartyMembers(p);
|
|
||||||
for (Player pl : partymembers) {
|
|
||||||
PlayerStructure pld = PlayerStructure.GetPlayerStructure(pl);
|
|
||||||
pld.pctbonusregen=regenbuff/100d;
|
|
||||||
pld.pctbonusregentime=TwosideKeeper.getServerTickTime();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p.isSprinting() && p.getFoodLevel()<20
|
|
||||||
&& ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getArmor(p), p, ItemSet.DASHER, 4)) {
|
|
||||||
p.setFoodLevel(p.getFoodLevel()+1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getArmor(p), p, ItemSet.RUDOLPH, 4)) {
|
|
||||||
if (!p.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1, p, true);
|
|
||||||
}
|
|
||||||
List<Player> partymembers = PartyManager.getPartyMembers(p);
|
|
||||||
for (Player pl : partymembers) {
|
|
||||||
if (!pl.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
|
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1, pl, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//TwosideKeeper.outputArmorDurability(p,">");
|
//TwosideKeeper.outputArmorDurability(p,">");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ManageSnowmanHunt();
|
||||||
|
|
||||||
CheckAndAnnounceWeather();
|
CheckAndAnnounceWeather();
|
||||||
|
|
||||||
Christmas.ChristmasHeartbeat();
|
Christmas.ChristmasHeartbeat();
|
||||||
@ -439,6 +276,265 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
performTimingsReport();
|
performTimingsReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ManagePlayerScoreboardAndHealth(Player p) {
|
||||||
|
if (!p.isDead()) {TwosideKeeper.log("Player is not dead.",5); TwosideKeeper.setPlayerMaxHealth(p);}
|
||||||
|
if (p.getScoreboard().getTeam(p.getName().toLowerCase())==null) {
|
||||||
|
p.getScoreboard().registerNewTeam(p.getName().toLowerCase()).addPlayer(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));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HealForSleeping(Player p, PlayerStructure pd) {
|
||||||
|
if (p.isSleeping()) {
|
||||||
|
p.setHealth(Bukkit.getPlayer(pd.name).getMaxHealth()); //Heals the player fully when sleeping.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShadowWalkerApplication(Player p, ItemStack[] equips) {
|
||||||
|
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()<=7) {
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,20,1,p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (p.getLocation().getY()>=0 && p.getLocation().getY()<=255 && p.getLocation().add(0,0,0).getBlock().getLightLevel()<=7) {
|
||||||
|
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SHADOWWALKER, p.getEquipment().getItemInMainHand())) {
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SPEED,20,1,p);
|
||||||
|
}
|
||||||
|
//log("Apply speed. The light level here is "+p.getLocation().add(0,-1,0).getBlock().getLightLevel(),2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ControlTheEnd(Player p, PlayerStructure pd) {
|
||||||
|
if (p.getWorld().getName().equalsIgnoreCase("world_the_end")) {
|
||||||
|
if (!pd.endnotification) {
|
||||||
|
pd.endnotification=true;
|
||||||
|
playEndWarningNotification(p);
|
||||||
|
}
|
||||||
|
randomlyAggroNearbyEndermen(p);
|
||||||
|
} else {
|
||||||
|
if (pd.endnotification) {
|
||||||
|
pd.endnotification=false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReduceFireResistanceDuration(Player p) {
|
||||||
|
if (p.getFireTicks()>0 && p.hasPotionEffect(PotionEffectType.FIRE_RESISTANCE)) {
|
||||||
|
int duration = GenericFunctions.getPotionEffectDuration(PotionEffectType.FIRE_RESISTANCE, p);
|
||||||
|
int lv = GenericFunctions.getPotionEffectLevel(PotionEffectType.FIRE_RESISTANCE, p);
|
||||||
|
if (lv>10) {lv=10;}
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.FIRE_RESISTANCE, duration-(20*(10-lv)), lv, p, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GiveArtifactBowXP(final long serverTickTime, Player p, PlayerStructure pd) {
|
||||||
|
if (pd.lasthittarget+20*15<=serverTickTime && pd.storedbowxp>0 && GenericFunctions.isArtifactEquip(p.getEquipment().getItemInMainHand()) &&
|
||||||
|
p.getEquipment().getItemInMainHand().getType()==Material.BOW) {
|
||||||
|
AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), pd.storedbowxp, p);
|
||||||
|
TwosideKeeper.log("Added "+pd.storedbowxp+" Artifact XP", 4);
|
||||||
|
pd.storedbowxp=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveInvalidTarget(Player p, PlayerStructure pd) {
|
||||||
|
if (pd.target!=null && !pd.target.isDead() && pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())>256) {
|
||||||
|
pd.target=null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ManageHighwinder(Player p, PlayerStructure pd) {
|
||||||
|
pd.highwinder=ArtifactAbility.containsEnchantment(ArtifactAbility.HIGHWINDER, p.getEquipment().getItemInMainHand());
|
||||||
|
if (pd.highwinder) {
|
||||||
|
pd.highwinderdmg=GenericFunctions.getAbilityValue(ArtifactAbility.HIGHWINDER, p.getEquipment().getItemInMainHand());
|
||||||
|
}
|
||||||
|
if (93.182445*pd.velocity>4.317) {
|
||||||
|
pd.velocity/=2;
|
||||||
|
} else {
|
||||||
|
pd.velocity=0;
|
||||||
|
}
|
||||||
|
if (pd.highwinder && pd.target!=null && !pd.target.isDead()) {
|
||||||
|
GenericFunctions.sendActionBarMessage(p, TwosideKeeper.drawVelocityBar(pd.velocity,pd.highwinderdmg),true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ModifyDasherSetSpeedMultiplier(Player p) {
|
||||||
|
if (ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.DASHER)>0) {
|
||||||
|
double spdmult = ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.DASHER)/100d;
|
||||||
|
aPlugin.API.setPlayerSpeedMultiplier(p, (float)(1.0f+spdmult));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndShopSession(Player p) {
|
||||||
|
if (TwosideKeeper.TwosideShops.IsPlayerUsingTerminal(p) &&
|
||||||
|
(TwosideKeeper.TwosideShops.GetSession(p).GetSign().getBlock()==null || TwosideKeeper.TwosideShops.GetSession(p).IsTimeExpired())) {
|
||||||
|
p.sendMessage(ChatColor.RED+"Ran out of time! "+ChatColor.WHITE+"Shop session closed.");
|
||||||
|
TwosideKeeper.TwosideShops.RemoveSession(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ModifyArmorBar(Player p) {
|
||||||
|
p.getAttribute(Attribute.GENERIC_ARMOR).setBaseValue(20*(1.0d-CustomDamage.CalculateDamageReduction(1,p,null))+subtractVanillaArmorBar(p.getEquipment().getArmorContents()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetVendetta(final long serverTickTime, PlayerStructure pd) {
|
||||||
|
if (pd.lastcombat+(20*60)<serverTickTime) {
|
||||||
|
pd.vendetta_amt=0;
|
||||||
|
pd.thorns_amt=0;
|
||||||
|
pd.weaponcharges=0;
|
||||||
|
}
|
||||||
|
if (pd.vendetta_amt>0 && pd.lastvendettastack+200<serverTickTime) {
|
||||||
|
pd.vendetta_amt=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetLifestealStacks(final long serverTickTime, PlayerStructure pd) {
|
||||||
|
if (pd.lastattacked+(20*5)<serverTickTime) {
|
||||||
|
pd.lastattacked=0;
|
||||||
|
pd.lifestealstacks=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ManageSnowmanHunt() {
|
||||||
|
if (TwosideKeeper.CHRISTMASEVENT_ACTIVATED) {
|
||||||
|
if (TwosideKeeper.LastSnowmanHunt+36000<TwosideKeeper.getServerTickTime() && TwosideKeeper.SnowmanHuntList.size()>7) {
|
||||||
|
TwosideKeeper.HuntingForSnowman = TwosideKeeper.SnowmanHuntList.get((int)(Math.random()*TwosideKeeper.SnowmanHuntList.size()));
|
||||||
|
aPlugin.API.discordSendRaw("The Hunt is on to kill the Snowman named **"+TwosideKeeper.HuntingForSnowman+"**!");
|
||||||
|
Bukkit.broadcastMessage("The Hunt is on to kill the Snowman named "+ChatColor.BOLD+TwosideKeeper.HuntingForSnowman+ChatColor.RESET+"!");
|
||||||
|
Bukkit.broadcastMessage(ChatColor.AQUA+" You will earn Holiday Tokens for successfully completing this mission!");
|
||||||
|
TwosideKeeper.LastSnowmanHunt=TwosideKeeper.getServerTickTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ManagePlayerLink(Player p, PlayerStructure pd) {
|
||||||
|
if (pd.linkplayer!=null && pd.linkplayer.isValid()) {
|
||||||
|
GlowAPI.setGlowing(pd.linkplayer, true, p);
|
||||||
|
if (pd.lastlinkteleport!=0 && pd.lastlinkteleport+12000<TwosideKeeper.getServerTickTime()) {
|
||||||
|
GlowAPI.setGlowing(pd.linkplayer, false, p);
|
||||||
|
pd.linkplayer=null;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
if (pd.linkplayer!=null && !pd.linkplayer.isValid()) {
|
||||||
|
GlowAPI.setGlowing(pd.linkplayer, false, p);
|
||||||
|
pd.linkplayer=null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DepleteDamagePool(final long serverTickTime, Player p, PlayerStructure pd) {
|
||||||
|
if (pd.damagepool>0 && pd.damagepooltime+20<=serverTickTime) {
|
||||||
|
double transferdmg = CustomDamage.getTransferDamage(p)+(pd.damagepool*0.01);
|
||||||
|
TwosideKeeper.log("Transfer Dmg is "+transferdmg+". Damage Pool: "+pd.damagepool, 5);
|
||||||
|
CustomDamage.ApplyDamage(transferdmg, null, p, null, "Damage Pool", CustomDamage.IGNORE_DAMAGE_TICK|CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE);
|
||||||
|
if (pd.damagepool-transferdmg<=0) {
|
||||||
|
pd.damagepool=0;
|
||||||
|
} else {
|
||||||
|
pd.damagepool-=transferdmg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AdventurerModeSetExhaustion(Player p) {
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL) {
|
||||||
|
p.setExhaustion(Math.max(0, p.getExhaustion()-0.5f));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DasherFoodRegenPerk(Player p) {
|
||||||
|
if (p.isSprinting() && p.getFoodLevel()<20
|
||||||
|
&& ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getArmor(p), p, ItemSet.DASHER, 4)) {
|
||||||
|
p.setFoodLevel(p.getFoodLevel()+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GivePartyNightVision(Player p) {
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getArmor(p), p, ItemSet.RUDOLPH, 4)) {
|
||||||
|
if (!p.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1, p, true);
|
||||||
|
}
|
||||||
|
List<Player> partymembers = PartyManager.getPartyMembers(p);
|
||||||
|
for (Player pl : partymembers) {
|
||||||
|
if (!pl.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1, pl, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyCometRegenBonus(Player p) {
|
||||||
|
double regenbuff = ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.COMET);
|
||||||
|
if (regenbuff>0) {
|
||||||
|
List<Player> partymembers = PartyManager.getPartyMembers(p);
|
||||||
|
for (Player pl : partymembers) {
|
||||||
|
PlayerStructure pld = PlayerStructure.GetPlayerStructure(pl);
|
||||||
|
pld.pctbonusregen=regenbuff/100d;
|
||||||
|
pld.pctbonusregentime=TwosideKeeper.getServerTickTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetSlayerAggro(final long serverTickTime, Player p, PlayerStructure pd) {
|
||||||
|
if (PlayerMode.isSlayer(p)) {
|
||||||
|
if (pd.lastsneak+50<=serverTickTime &&
|
||||||
|
p.isSneaking() &&
|
||||||
|
ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getHotbarItems(p), p, ItemSet.MOONSHADOW, 7)) {
|
||||||
|
GenericFunctions.deAggroNearbyTargets(p);
|
||||||
|
GenericFunctions.applyStealth(p, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetSwordCombo(final long serverTickTime, Player p, PlayerStructure pd) {
|
||||||
|
if (ArtifactAbility.containsEnchantment(ArtifactAbility.COMBO, p.getEquipment().getItemInMainHand()) &&
|
||||||
|
pd.last_swordhit+40<serverTickTime) {
|
||||||
|
pd.swordcombo=0; //Reset the sword combo meter since the time limit expired.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CalculateHealthRegeneration(final long serverTickTime, Player p, PlayerStructure pd,
|
||||||
|
ItemStack[] equips) {
|
||||||
|
if (pd.last_regen_time+TwosideKeeper.HEALTH_REGENERATION_RATE<=serverTickTime) {
|
||||||
|
pd.last_regen_time=serverTickTime;
|
||||||
|
//See if this player needs to be healed.
|
||||||
|
if (p!=null &&
|
||||||
|
!p.isDead() && //Um, don't heal them if they're dead...That's just weird.
|
||||||
|
p.getHealth()<p.getMaxHealth() &&
|
||||||
|
p.getFoodLevel()>=16) {
|
||||||
|
|
||||||
|
if (PlayerMode.getPlayerMode(p)!=PlayerMode.SLAYER || pd.lastcombat+(20*60)<serverTickTime) {
|
||||||
|
double totalregen = 1+(p.getMaxHealth()*0.05);
|
||||||
|
double bonusregen = 0.0;
|
||||||
|
bonusregen += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.ALIKAHN, 4, 4);
|
||||||
|
totalregen += bonusregen;
|
||||||
|
for (ItemStack equip : equips) {
|
||||||
|
if (GenericFunctions.isArtifactEquip(equip)) {
|
||||||
|
double regenamt = GenericFunctions.getAbilityValue(ArtifactAbility.HEALTH_REGEN, equip);
|
||||||
|
bonusregen += regenamt;
|
||||||
|
TwosideKeeper.log("Bonus regen increased by "+regenamt,5);
|
||||||
|
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, equip)) {
|
||||||
|
totalregen /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, equip)?2:1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())) {
|
||||||
|
totalregen /= ArtifactAbility.containsEnchantment(ArtifactAbility.GREED, p.getEquipment().getItemInMainHand())?2:1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pd.pctbonusregentime+100>TwosideKeeper.getServerTickTime()) {
|
||||||
|
totalregen += totalregen*pd.pctbonusregen;
|
||||||
|
}
|
||||||
|
totalregen += totalregen*((PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL)?0.5d:0d);
|
||||||
|
p.setHealth((p.getHealth()+totalregen>p.getMaxHealth())?p.getMaxHealth():p.getHealth()+totalregen);
|
||||||
|
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
||||||
|
pd.slayermodehp=p.getHealth();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void performTimingsReport() {
|
private void performTimingsReport() {
|
||||||
double tps = MinecraftServer.getServer().recentTps[0];
|
double tps = MinecraftServer.getServer().recentTps[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user