+>Rejuvenation no longer applies Regeneration X for 10 seconds, but
instead heals 5 HP (2.5 Hearts) every 0.5 seconds for 10 seconds. +>Critical Rate of Wolfsbane trinkets increased from 2+(1*tier)% to 3+(2*tier)%. +>Crit Damage of Moonshadow trinkets increased from 3+(2*tier)% to 6+(3*tier)%. +>Lorasys Set has been revamped to gain power based on total tier level of trinkets. +>Dawntracker Set now has a 6 piece set bonus. +>Artifact calculations have been revamped. In short: Multipliers were nerfed, base damage / flat numbers were buffed. This also improves the calculation speed of artifact abilities internally. Most artifact abilities now go up to Level 10000, requiring a lot more grinding for levels than before. +>The proper item pickup animation now plays when picking up items. (A visual effect that was never added back in.) >Fixed application of potion effects to prevent unnecessary overriding with potion effects that are clearly superior to current buffs. >Fixed a bug causing Artifacts to take away 10% of total Potential per level up, instead of 10% of remaining Potential per level up. >Fixed a bug allowing players to use the swap key on a Bauble Pouch to gain 10 extra Health when swapping to Slayer mode. >Drops from suppressed mobs now appear immediately instead of after a delay. >Fixed localization of Prismarine, Prismarine Bricks, Dark Prismarine. >Fixed a bug preventing multiple items from being picked up at the same time due to automatic pickup. >Fixed a bug causing Cooldown Reduction to make successful assassinations increase the cooldown of Assassinate instead of resetting it. >Fixed a bug causing Regeneration multipliers to not properly multiply base regeneration. ->Line Drive no longer goes through walls or solid areas.
This commit is contained in:
parent
5ac899616e
commit
417a4273a1
@ -5,6 +5,6 @@
|
|||||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/AutoPluginUpdate.jar"/>
|
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/AutoPluginUpdate.jar"/>
|
||||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/GlowAPI_v1.4.4.jar"/>
|
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/GlowAPI_v1.4.4.jar"/>
|
||||||
<classpathentry kind="lib" path="D:/Documents/Test Server/spigot-1.9.2-R0.1-SNAPSHOT.jar"/>
|
<classpathentry kind="lib" path="D:/Documents/Test Server/spigot-1.9.2-R0.1-SNAPSHOT.jar"/>
|
||||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/aPlugin (91).jar"/>
|
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/aPlugin (95).jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
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.9
|
version: 3.10.9a
|
||||||
loadbefore: [aPlugin]
|
loadbefore: [aPlugin]
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
|
@ -97,9 +97,9 @@ public class AwakenedArtifact {
|
|||||||
item = addMaxAP(item,totalval/1000);
|
item = addMaxAP(item,totalval/1000);
|
||||||
item = setEXP(item,totalval%1000);
|
item = setEXP(item,totalval%1000);
|
||||||
item = addAP(item,totalval/1000);
|
item = addAP(item,totalval/1000);
|
||||||
double potentialred = 10.0d;
|
double potentialred = 0.1d * getPotential(item); //5
|
||||||
potentialred *= 1 - (5+GenericFunctions.getAbilityValue(ArtifactAbility.PRESERVATION, artifact))/100d;
|
potentialred *= 1d - (5d+GenericFunctions.getAbilityValue(ArtifactAbility.PRESERVATION, artifact))/100d;
|
||||||
TwosideKeeper.log("Potential reduction is reduced by "+(10-potentialred), 4);
|
TwosideKeeper.log("Potential is reduced by "+(potentialred)+"% from "+getPotential(item), 0);
|
||||||
if (getPotential(item)>potentialred) {
|
if (getPotential(item)>potentialred) {
|
||||||
item = setPotential(item,(int)(getPotential(item)-potentialred));
|
item = setPotential(item,(int)(getPotential(item)-potentialred));
|
||||||
if (Math.random() < (potentialred % 1)) {
|
if (Math.random() < (potentialred % 1)) {
|
||||||
@ -111,7 +111,7 @@ public class AwakenedArtifact {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.sendMessage("Your "+artifact.getItemMeta().getDisplayName()+ChatColor.RESET+" has upgraded to "+ChatColor.YELLOW+"Level "+getLV(artifact)+"!");
|
p.sendMessage("Your "+artifact.getItemMeta().getDisplayName()+ChatColor.RESET+" has upgraded to "+ChatColor.YELLOW+"Level "+getLV(artifact)+"!");
|
||||||
TextComponent tc1 = new TextComponent("You have "+getAP(item)+" Ability Point"+((getAP(item)==1)?"":"s")+" to spend! ");
|
TextComponent tc1 = new TextComponent("You have "+getAP(item)+" Ability Point"+((getAP(item)==1)?"":"s")+" to spend!");
|
||||||
|
|
||||||
TextComponent tc = new TextComponent(ChatColor.GREEN+"["+Character.toString((char)0x25b2)+"]");
|
TextComponent tc = new TextComponent(ChatColor.GREEN+"["+Character.toString((char)0x25b2)+"]");
|
||||||
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder("Click to upgrade abilities on this artifact. "+ChatColor.GREEN+"Available AP: "+ChatColor.BLUE+AwakenedArtifact.getAP(item)).create()));
|
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,new ComponentBuilder("Click to upgrade abilities on this artifact. "+ChatColor.GREEN+"Available AP: "+ChatColor.BLUE+AwakenedArtifact.getAP(item)).create()));
|
||||||
|
@ -11,6 +11,7 @@ import org.bukkit.potion.PotionEffectType;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.EliteMonster;
|
import sig.plugin.TwosideKeeper.EliteMonster;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.Camera;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
|
|
||||||
public class EliteGuardian extends EliteMonster{
|
public class EliteGuardian extends EliteMonster{
|
||||||
@ -18,6 +19,7 @@ public class EliteGuardian extends EliteMonster{
|
|||||||
boolean cutsceneplayed=false;
|
boolean cutsceneplayed=false;
|
||||||
STATE state = STATE.WAITINGFORCUTSCENE;
|
STATE state = STATE.WAITINGFORCUTSCENE;
|
||||||
int cutscenetimer=0;
|
int cutscenetimer=0;
|
||||||
|
Camera cam;
|
||||||
|
|
||||||
public EliteGuardian(Monster m) {
|
public EliteGuardian(Monster m) {
|
||||||
super(m);
|
super(m);
|
||||||
@ -41,14 +43,17 @@ public class EliteGuardian extends EliteMonster{
|
|||||||
switch (state) {
|
switch (state) {
|
||||||
case PASSIVE:
|
case PASSIVE:
|
||||||
m.setAI(true);
|
m.setAI(true);
|
||||||
|
m.setInvulnerable(false);
|
||||||
break;
|
break;
|
||||||
case WAITINGFORCUTSCENE:
|
case WAITINGFORCUTSCENE:
|
||||||
|
m.setInvulnerable(true);
|
||||||
List<Player> nearby = GenericFunctions.getNearbyPlayers(m.getLocation(), 4);
|
List<Player> nearby = GenericFunctions.getNearbyPlayers(m.getLocation(), 4);
|
||||||
if (nearby.size()>0) {
|
if (nearby.size()>0) {
|
||||||
List<Player> nearby2 = GenericFunctions.getNearbyPlayers(m.getLocation(), 16);
|
List<Player> nearby2 = GenericFunctions.getNearbyPlayers(m.getLocation(), 16);
|
||||||
//Play the cutscene for all of these players.
|
//Play the cutscene for all of these players.
|
||||||
for (Player p : nearby2) {
|
for (Player p : nearby2) {
|
||||||
p.setVelocity(new Vector(0,0,0));
|
p.setVelocity(new Vector(0,0,0));
|
||||||
|
targetlist.add(p);
|
||||||
if (cutscenetimer==0) {
|
if (cutscenetimer==0) {
|
||||||
p.setGameMode(GameMode.SPECTATOR);
|
p.setGameMode(GameMode.SPECTATOR);
|
||||||
p.setSpectatorTarget(m);
|
p.setSpectatorTarget(m);
|
||||||
@ -58,11 +63,13 @@ public class EliteGuardian extends EliteMonster{
|
|||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 40, 1, m);
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 40, 1, m);
|
||||||
}
|
}
|
||||||
cutscenetimer++;
|
cutscenetimer++;
|
||||||
if (cutscenetimer>100) {
|
if (cutscenetimer>20) {
|
||||||
state=STATE.PASSIVE;
|
state=STATE.PASSIVE;
|
||||||
//Play the cutscene for all of these players.
|
//Play the cutscene for all of these players.
|
||||||
for (Player p : nearby2) {
|
for (Player p : targetlist) {
|
||||||
p.setGameMode(GameMode.SURVIVAL);
|
if (p!=null && p.isValid() && p.isOnline()) {
|
||||||
|
p.setGameMode(GameMode.SURVIVAL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,6 +78,16 @@ public class EliteGuardian extends EliteMonster{
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Player p : targetlist) {
|
||||||
|
adjustMiningFatigue(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void adjustMiningFatigue(Player p) {
|
||||||
|
if (p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) && ((GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==2 && GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING, p)>=4800) || (GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==20 && GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING, p)<4800))) {
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW_DIGGING, 6000, 20, p, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runHitEvent(LivingEntity damager, double dmg) {
|
public void runHitEvent(LivingEntity damager, double dmg) {
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.Boss;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Guardian;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.EliteMonster;
|
||||||
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
|
|
||||||
|
public class SendMiningFatigueToAllNearbyElderGuardians extends BukkitRunnable {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
for (EliteMonster em : TwosideKeeper.elitemonsters) {
|
||||||
|
if (em.getMonster() instanceof Guardian) {
|
||||||
|
//Apply Mining Fatigue 100 to all players.
|
||||||
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
|
if (!p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) || GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING,p)<1200 ||
|
||||||
|
GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)<20) {
|
||||||
|
//p.getWorld().playEffect(p.getLocation(), Effect., arg2);
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW_DIGGING, 6000, 20, p, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -10,6 +10,7 @@ import org.bukkit.Achievement;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Difficulty;
|
import org.bukkit.Difficulty;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@ -1577,6 +1578,12 @@ public class CustomDamage {
|
|||||||
if (damager instanceof Player && target instanceof Player && !damager.getWorld().getPVP()) {
|
if (damager instanceof Player && target instanceof Player && !damager.getWorld().getPVP()) {
|
||||||
return true; //Cancel all PvP related events.
|
return true; //Cancel all PvP related events.
|
||||||
}
|
}
|
||||||
|
if (target instanceof Player && (((Player)target).getGameMode()==GameMode.SPECTATOR || ((Player)target).getGameMode()==GameMode.CREATIVE)) {
|
||||||
|
return true; //Cancel any damage events in Spectator mode or Creative Mode.
|
||||||
|
}
|
||||||
|
if (target.isInvulnerable()) {
|
||||||
|
return true; //Cancel any damage events when the target is invulnerable.
|
||||||
|
}
|
||||||
if (isFlagSet(flags,IGNORE_DAMAGE_TICK)) {
|
if (isFlagSet(flags,IGNORE_DAMAGE_TICK)) {
|
||||||
GenericFunctions.removeNoDamageTick(target, damager);
|
GenericFunctions.removeNoDamageTick(target, damager);
|
||||||
}
|
}
|
||||||
@ -2383,10 +2390,15 @@ public class CustomDamage {
|
|||||||
dmg += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter),(Player)shooter, ItemSet.OLIVE, 3, 3);
|
dmg += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter),(Player)shooter, ItemSet.OLIVE, 3, 3);
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.PANROS, 5) ||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.PANROS, 5) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter,true), (Player)shooter, ItemSet.DAWNTRACKER, 5) ||
|
ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter,true), (Player)shooter, ItemSet.DAWNTRACKER, 5) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.LORASYS, 1) ||
|
(ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.LORASYS, 1) &&
|
||||||
|
ItemSet.GetBaubleTier((Player)shooter)>=9) ||
|
||||||
GenericFunctions.HasFullRangerSet((Player)shooter)) {
|
GenericFunctions.HasFullRangerSet((Player)shooter)) {
|
||||||
dmg += 15;
|
dmg += 15;
|
||||||
}
|
}
|
||||||
|
if ((ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.LORASYS, 1) &&
|
||||||
|
ItemSet.GetBaubleTier((Player)shooter)>=40) && ItemSet.GetTier(shooter.getEquipment().getItemInMainHand())>=4) {
|
||||||
|
dmg += 55;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dmg;
|
return dmg;
|
||||||
@ -2599,6 +2611,17 @@ public class CustomDamage {
|
|||||||
if (reason!=null && reason.equalsIgnoreCase("power swing")) {
|
if (reason!=null && reason.equalsIgnoreCase("power swing")) {
|
||||||
critchance += 1.0d;
|
critchance += 1.0d;
|
||||||
}
|
}
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.LORASYS, 1)) {
|
||||||
|
if (ItemSet.GetBaubleTier((Player)shooter)>=18 && ItemSet.GetTier(shooter.getEquipment().getItemInMainHand())>=2) {
|
||||||
|
critchance += 0.1d;
|
||||||
|
}
|
||||||
|
if (ItemSet.GetBaubleTier((Player)shooter)>=27 && ItemSet.GetTier(shooter.getEquipment().getItemInMainHand())>=3) {
|
||||||
|
critchance += 0.2d;
|
||||||
|
}
|
||||||
|
if (ItemSet.GetBaubleTier((Player)shooter)>=40 && ItemSet.GetTier(shooter.getEquipment().getItemInMainHand())>=4) {
|
||||||
|
critchance += 0.45d;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return critchance;
|
return critchance;
|
||||||
@ -2750,7 +2773,8 @@ public class CustomDamage {
|
|||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p,true), p, ItemSet.DAWNTRACKER, 5)) {
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p,true), p, ItemSet.DAWNTRACKER, 5)) {
|
||||||
finaldmg += dmg*0.5;
|
finaldmg += dmg*0.5;
|
||||||
} else
|
} else
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.LORASYS, 1)) {
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.LORASYS, 1) &&
|
||||||
|
ItemSet.GetBaubleTier(p)>=9) {
|
||||||
finaldmg += dmg*0.5;
|
finaldmg += dmg*0.5;
|
||||||
}
|
}
|
||||||
finaldmg += dmg*aPlugin.API.getPlayerBonuses(p).getBonusArmorPenetration();
|
finaldmg += dmg*aPlugin.API.getPlayerBonuses(p).getBonusArmorPenetration();
|
||||||
@ -2956,6 +2980,9 @@ public class CustomDamage {
|
|||||||
if (pd.rage_time>TwosideKeeper.getServerTickTime()) {
|
if (pd.rage_time>TwosideKeeper.getServerTickTime()) {
|
||||||
lifestealpct += (pd.rage_amt/2)*0.01;
|
lifestealpct += (pd.rage_amt/2)*0.01;
|
||||||
}
|
}
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p, true), p, ItemSet.DAWNTRACKER,6)) {
|
||||||
|
lifestealpct+=0.25d*ItemSet.GetTier(p.getEquipment().getItemInMainHand());
|
||||||
|
}
|
||||||
if (reason!=null && reason.equalsIgnoreCase("sweep up")) {
|
if (reason!=null && reason.equalsIgnoreCase("sweep up")) {
|
||||||
lifestealpct*=2;
|
lifestealpct*=2;
|
||||||
}
|
}
|
||||||
@ -3096,6 +3123,9 @@ public class CustomDamage {
|
|||||||
double cooldown = 0.0;
|
double cooldown = 0.0;
|
||||||
cooldown+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getBaubles(p), p, ItemSet.GLADOMAIN, 2, 2)/100d;
|
cooldown+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getBaubles(p), p, ItemSet.GLADOMAIN, 2, 2)/100d;
|
||||||
cooldown+=ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.VIXEN)/100d;
|
cooldown+=ItemSet.GetTotalBaseAmount(GenericFunctions.getEquipment(p), p, ItemSet.VIXEN)/100d;
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.LORASYS, 1) && ItemSet.GetBaubleTier(p)>=40 && ItemSet.GetTier(p.getEquipment().getItemInMainHand())>=4) {
|
||||||
|
cooldown += 0.45d;
|
||||||
|
}
|
||||||
return cooldown;
|
return cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,13 +35,15 @@ public class DeathManager {
|
|||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,15,-2,p,true);
|
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,15,-2,p,true);
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,15,100,p,true);
|
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,15,100,p,true);
|
||||||
p.setVelocity(new Vector(0,0,0));
|
p.setVelocity(new Vector(0,0,0));
|
||||||
CustomDamage.removeIframe(p);
|
CustomDamage.removeIframe(p);
|
||||||
Location loc = p.getLocation();
|
Location loc = p.getLocation();
|
||||||
if (p.getBedSpawnLocation()!=null) {loc.setY(p.getBedSpawnLocation().getY());}
|
if (p.getBedSpawnLocation()!=null) {loc.setY(p.getBedSpawnLocation().getY());}
|
||||||
p.teleport(loc);
|
p.teleport(loc);
|
||||||
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
|
||||||
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,p);
|
||||||
}},1);
|
}},1);
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
//pd.deathloot.clear();
|
//pd.deathloot.clear();
|
||||||
|
@ -263,7 +263,7 @@ public class EliteMonster {
|
|||||||
currentdps = dpslist.get(p.getName());
|
currentdps = dpslist.get(p.getName());
|
||||||
}
|
}
|
||||||
dpslist.put(p.getName(), currentdps+dmg);
|
dpslist.put(p.getName(), currentdps+dmg);
|
||||||
TwosideKeeper.log(p.getName()+"'s Damage: "+dpslist.get(p.getName()), 0);
|
TwosideKeeper.log(p.getName()+"'s Damage: "+dpslist.get(p.getName()), 5);
|
||||||
}
|
}
|
||||||
last_regen_time=TwosideKeeper.getServerTickTime();
|
last_regen_time=TwosideKeeper.getServerTickTime();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,71 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.HelperStructures.Common;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.ArmorStand;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
|
|
||||||
|
public class Camera {
|
||||||
|
ArmorStand camera_ent;
|
||||||
|
HashMap<UUID,Location> camera_viewerlocs;
|
||||||
|
public Camera(Location startingloc,Player...viewers) {
|
||||||
|
camera_ent = (ArmorStand)startingloc.getWorld().spawnEntity(startingloc, EntityType.ARMOR_STAND);
|
||||||
|
camera_ent.setGravity(false);
|
||||||
|
camera_ent.setVisible(false);
|
||||||
|
camera_ent.setInvulnerable(true);
|
||||||
|
camera_ent.setArms(false);
|
||||||
|
for (Player p : viewers) {
|
||||||
|
AddCameraViewer(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void AddCameraViewer(Player p) {
|
||||||
|
camera_viewerlocs.put(p.getUniqueId(), p.getLocation());
|
||||||
|
p.setGameMode(GameMode.SPECTATOR);
|
||||||
|
p.setSpectatorTarget(camera_ent);
|
||||||
|
}
|
||||||
|
public void removeCameraViewer(Player p) {
|
||||||
|
if (camera_viewerlocs.containsKey(p.getUniqueId())) {
|
||||||
|
p.setGameMode(GameMode.SURVIVAL);
|
||||||
|
p.teleport(camera_viewerlocs.get(p.getUniqueId()));
|
||||||
|
camera_viewerlocs.remove(p.getUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public boolean runTick() {
|
||||||
|
if (camera_ent==null || !camera_ent.isValid() || camera_viewerlocs.size()==0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (UUID id : camera_viewerlocs.keySet()) {
|
||||||
|
Player p = Bukkit.getPlayer(id);
|
||||||
|
if (p!=null && p.isValid()) {
|
||||||
|
p.setGameMode(GameMode.SPECTATOR);
|
||||||
|
if (p.getSpectatorTarget()==null || !(p.getSpectatorTarget() instanceof ArmorStand)) {
|
||||||
|
//If this player is on multiple cameras for some reason, we don't want to overwrite the previous camera.
|
||||||
|
p.setSpectatorTarget(camera_ent);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TwosideKeeper.ScheduleRemoval(camera_viewerlocs, p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public ArmorStand getEnt() {
|
||||||
|
return camera_ent;
|
||||||
|
}
|
||||||
|
public void Cleanup() {
|
||||||
|
for (UUID id : camera_viewerlocs.keySet()) {
|
||||||
|
Player p = Bukkit.getPlayer(id);
|
||||||
|
if (p!=null && p.isValid()) {
|
||||||
|
p.setGameMode(GameMode.SURVIVAL);
|
||||||
|
p.teleport(camera_viewerlocs.get(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -986,6 +986,19 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case PRISMARINE:{
|
||||||
|
switch (type.getDurability()) {
|
||||||
|
case 0:{
|
||||||
|
return "Prismarine";
|
||||||
|
}
|
||||||
|
case 1:{
|
||||||
|
return "Prismarine Bricks";
|
||||||
|
}
|
||||||
|
case 2:{
|
||||||
|
return "Dark Prismarine";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case SULPHUR:{
|
case SULPHUR:{
|
||||||
return "Gunpowder";
|
return "Gunpowder";
|
||||||
}
|
}
|
||||||
@ -2886,11 +2899,38 @@ public class GenericFunctions {
|
|||||||
TwosideKeeper.log(ChatColor.RED+" This should not be overwritten due to no FORCE!", TwosideKeeper.POTION_DEBUG_LEVEL);
|
TwosideKeeper.log(ChatColor.RED+" This should not be overwritten due to no FORCE!", TwosideKeeper.POTION_DEBUG_LEVEL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
if (ticks==1 && amplifier==0) {
|
||||||
public void run() {
|
//Force it to be added.
|
||||||
p.addPotionEffect(new PotionEffect(type,ticks,amplifier),force);
|
TwosideKeeper.log("Removing "+type.getName(), 5);
|
||||||
}
|
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||||
},1);
|
public void run() {
|
||||||
|
p.addPotionEffect(new PotionEffect(type,ticks,amplifier),true);
|
||||||
|
}
|
||||||
|
},1);
|
||||||
|
} else
|
||||||
|
if (p.hasPotionEffect(type)) {
|
||||||
|
if (GenericFunctions.getPotionEffectLevel(type,p)<amplifier) {
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
p.addPotionEffect(new PotionEffect(type,ticks,amplifier),true);
|
||||||
|
}
|
||||||
|
},1);
|
||||||
|
} else
|
||||||
|
if (GenericFunctions.getPotionEffectLevel(type,p)==amplifier && GenericFunctions.getPotionEffectDuration(type,p)<ticks) {
|
||||||
|
TwosideKeeper.log("Already applied "+type.getName()+". Reapplying.", 5);
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
p.addPotionEffect(new PotionEffect(type,ticks,amplifier),true);
|
||||||
|
}
|
||||||
|
},1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
p.addPotionEffect(new PotionEffect(type,ticks,amplifier),force);
|
||||||
|
}
|
||||||
|
},1);
|
||||||
|
}
|
||||||
TwosideKeeper.log(ChatColor.GRAY+" Effect on Player "+p.getName()+" is now "+type.getName()+" "+WorldShop.toRomanNumeral((amplifier+1))+"("+amplifier+"), Duration: "+ticks+" ticks", TwosideKeeper.POTION_DEBUG_LEVEL);
|
TwosideKeeper.log(ChatColor.GRAY+" Effect on Player "+p.getName()+" is now "+type.getName()+" "+WorldShop.toRomanNumeral((amplifier+1))+"("+amplifier+"), Duration: "+ticks+" ticks", TwosideKeeper.POTION_DEBUG_LEVEL);
|
||||||
if (amplifier==-1 || ticks==0) {
|
if (amplifier==-1 || ticks==0) {
|
||||||
//Something really bad happened!!!
|
//Something really bad happened!!!
|
||||||
@ -3106,7 +3146,7 @@ public class GenericFunctions {
|
|||||||
if (pd.last_rejuvenate+GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player)<=TwosideKeeper.getServerTickTime()) {
|
if (pd.last_rejuvenate+GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player)<=TwosideKeeper.getServerTickTime()) {
|
||||||
SoundUtils.playGlobalSound(player.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(player.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0f, 1.0f);
|
||||||
addIFrame(player,40);
|
addIFrame(player,40);
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,200,9,player,true);
|
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,200,9,player,true);
|
||||||
aPlugin.API.sendCooldownPacket(player, player.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player));
|
aPlugin.API.sendCooldownPacket(player, player.getEquipment().getItemInMainHand(), GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4280,9 +4320,9 @@ public class GenericFunctions {
|
|||||||
int duration = getPotionEffectDuration(type,p);
|
int duration = getPotionEffectDuration(type,p);
|
||||||
int currentlv = getPotionEffectLevel(type,p);
|
int currentlv = getPotionEffectLevel(type,p);
|
||||||
PotionEffect neweffect = new PotionEffect(type,tick_duration,(currentlv+incr_amt<maxlv)?(currentlv+incr_amt):maxlv);
|
PotionEffect neweffect = new PotionEffect(type,tick_duration,(currentlv+incr_amt<maxlv)?(currentlv+incr_amt):maxlv);
|
||||||
if (tick_duration+BUFFER >= duration) {
|
//if (tick_duration+BUFFER >= duration) {
|
||||||
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
|
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
|
||||||
}
|
//}
|
||||||
} else {
|
} else {
|
||||||
PotionEffect neweffect = new PotionEffect(type,tick_duration,incr_amt-1);
|
PotionEffect neweffect = new PotionEffect(type,tick_duration,incr_amt-1);
|
||||||
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
|
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
|
||||||
@ -4320,7 +4360,7 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Math.random()<=removechance/100) {
|
if (Math.random()<=removechance/100) {
|
||||||
if (type!=null && (!type.equals(PotionEffectType.WEAKNESS) || level<9)) {
|
if (type!=null && (!type.equals(PotionEffectType.WEAKNESS) || level<9) && (!type.equals(PotionEffectType.SLOW_DIGGING) || (level!=2 && level!=20))) {
|
||||||
GenericFunctions.logAndRemovePotionEffectFromEntity(type,p);
|
GenericFunctions.logAndRemovePotionEffectFromEntity(type,p);
|
||||||
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " ")));
|
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(type.getName().replace("_", " ")));
|
||||||
}
|
}
|
||||||
@ -4487,6 +4527,14 @@ public class GenericFunctions {
|
|||||||
for (int j=0;j<50;j++) {
|
for (int j=0;j<50;j++) {
|
||||||
newpos.getWorld().playEffect(newpos, Effect.FLAME, 60);
|
newpos.getWorld().playEffect(newpos, Effect.FLAME, 60);
|
||||||
}
|
}
|
||||||
|
if (newpos2.getBlock().getType()!=Material.AIR &&
|
||||||
|
!newpos2.getBlock().isLiquid() &&
|
||||||
|
!(newpos2.getBlock().getType()==Material.STEP) &&
|
||||||
|
!(newpos2.getBlock().getType()==Material.WOOD_STEP) &&
|
||||||
|
!(newpos2.getBlock().getType()==Material.PURPUR_SLAB) &&
|
||||||
|
!(newpos2.getBlock().getType()==Material.STONE_SLAB2)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("TwosideKeeper"), new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("TwosideKeeper"), new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
DealDamageToNearbyMobs(newpos2, dmgdealt, 2, true, 0.4d, p, weaponused, true);
|
DealDamageToNearbyMobs(newpos2, dmgdealt, 2, true, 0.4d, p, weaponused, true);
|
||||||
@ -4530,7 +4578,7 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getBaubles(player), player, ItemSet.WOLFSBANE, 7) &&
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getBaubles(player), player, ItemSet.WOLFSBANE, 7) &&
|
||||||
target.getLocation().distanceSquared(originalloc)<=25) {
|
target.getLocation().distanceSquared(originalloc)<=25) {
|
||||||
pd.lastassassinatetime = TwosideKeeper.getServerTickTime()-TwosideKeeper.ASSASSINATE_COOLDOWN+40;
|
pd.lastassassinatetime = TwosideKeeper.getServerTickTime()-GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,player)+40;
|
||||||
if (name!=Material.SKULL_ITEM || pd.lastlifesavertime+GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,player)<TwosideKeeper.getServerTickTime()) { //Don't overwrite life saver cooldowns.
|
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);
|
aPlugin.API.sendCooldownPacket(player, name, 40);
|
||||||
}
|
}
|
||||||
@ -4617,12 +4665,17 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void DamageRandomTool(Player p) {
|
public static void DamageRandomTool(Player p) {
|
||||||
if (!aPlugin.API.isAFK(p) && ItemSet.GetSetCount(GenericFunctions.getEquipment(p), ItemSet.LORASYS, p)==0) {
|
if (ItemSet.GetSetCount(GenericFunctions.getEquipment(p), ItemSet.LORASYS, p)>=1 &&
|
||||||
ItemStack[] inv = p.getInventory().getContents();
|
ItemSet.GetBaubleTier(p)>=27 && ItemSet.GetTier(p.getEquipment().getItemInMainHand())>=3) {
|
||||||
for (int i=0;i<9;i++) {
|
return;
|
||||||
if (inv[i]!=null &&
|
} else {
|
||||||
isTool(inv[i]) && inv[i].getType()!=Material.BOW) {
|
if (!aPlugin.API.isAFK(p)) {
|
||||||
aPlugin.API.damageItem(p.getInventory(), inv[i], 1);
|
ItemStack[] inv = p.getInventory().getContents();
|
||||||
|
for (int i=0;i<9;i++) {
|
||||||
|
if (inv[i]!=null &&
|
||||||
|
isTool(inv[i]) && inv[i].getType()!=Material.BOW) {
|
||||||
|
aPlugin.API.damageItem(p.getInventory(), inv[i], 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
|
|
||||||
public enum ItemSet {
|
public enum ItemSet {
|
||||||
@ -24,9 +25,9 @@ public enum ItemSet {
|
|||||||
DARNYS(2,1, 10,5, 20,5, 1,1),
|
DARNYS(2,1, 10,5, 20,5, 1,1),
|
||||||
ALIKAHN(3,1, 15,6, 30,10, 1,1),
|
ALIKAHN(3,1, 15,6, 30,10, 1,1),
|
||||||
LORASAADI(4,1, 4,2, 8,6, 8,3),
|
LORASAADI(4,1, 4,2, 8,6, 8,3),
|
||||||
MOONSHADOW(4,2, 1,1, 8,8, 15,7),
|
MOONSHADOW(6,3, 1,1, 8,8, 15,7),
|
||||||
GLADOMAIN(1,1, 12,4, 8,4, 1,1),
|
GLADOMAIN(1,1, 12,4, 8,4, 1,1),
|
||||||
WOLFSBANE(2,1, 15,10, 10,5, 15,10),
|
WOLFSBANE(3,2, 15,10, 10,5, 15,10),
|
||||||
ALUSTINE(3,2, 300,-30, 50,-5, 6,2),
|
ALUSTINE(3,2, 300,-30, 50,-5, 6,2),
|
||||||
DASHER(5,5, 3,3, 5,5, 0,0),
|
DASHER(5,5, 3,3, 5,5, 0,0),
|
||||||
DANCER(5,1, 3,3, 5,5, 0,0),
|
DANCER(5,1, 3,3, 5,5, 0,0),
|
||||||
@ -439,22 +440,41 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Lifesteal");
|
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Lifesteal");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+" Max Health");
|
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+" Max Health");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Powered Mock");
|
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Powered Mock");
|
||||||
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
||||||
lore.add(ChatColor.WHITE+" +15 Damage");
|
lore.add(ChatColor.WHITE+" +15 Damage");
|
||||||
lore.add(ChatColor.GRAY+" ");
|
|
||||||
lore.add(ChatColor.GRAY+" Mock cooldown decreases from");
|
lore.add(ChatColor.GRAY+" Mock cooldown decreases from");
|
||||||
lore.add(ChatColor.GRAY+" 20 -> 10 seconds, making it stackable.");
|
lore.add(ChatColor.GRAY+" 20 -> 10 seconds, making it stackable.");
|
||||||
lore.add(ChatColor.GRAY+" All Lifesteal Stacks and Weapon Charges");
|
lore.add(ChatColor.GRAY+" All Lifesteal Stacks and Weapon Charges");
|
||||||
lore.add(ChatColor.GRAY+" gained are doubled.");
|
lore.add(ChatColor.GRAY+" gained are doubled.");
|
||||||
|
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
||||||
|
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Lifesteal");
|
||||||
|
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Health Regeneration");
|
||||||
|
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Maximum Health");
|
||||||
}break;
|
}break;
|
||||||
case LORASYS:{
|
case LORASYS:{
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Bonus Effects");
|
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Increases in power based on "+ChatColor.BOLD+"Total Tier Amount");
|
||||||
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"of all baubles in your bauble pouch.");
|
||||||
lore.add(ChatColor.WHITE+" +15 Damage");
|
lore.add(ChatColor.DARK_AQUA+" T9 - ");
|
||||||
lore.add(ChatColor.GRAY+" ");
|
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
||||||
lore.add(ChatColor.WHITE+" Stealth does not cause durability to decrease.");
|
lore.add(ChatColor.WHITE+" +15 Damage");
|
||||||
lore.add(ChatColor.WHITE+" Hitting enemies with Thorns does not damage you.");
|
if (tier>=2) {
|
||||||
lore.add(ChatColor.WHITE+" Each kill restores 2 Hearts (4 HP) instead of 1.");
|
lore.add(ChatColor.DARK_AQUA+" T18 - ");
|
||||||
|
lore.add(ChatColor.WHITE+" +10% Critical Chance");
|
||||||
|
lore.add(ChatColor.WHITE+" Hitting enemies with Thorns does not damage you.");
|
||||||
|
lore.add(ChatColor.WHITE+" Each kill restores 2 Hearts (4 HP) instead of 1.");
|
||||||
|
if (tier>=3) {
|
||||||
|
lore.add(ChatColor.DARK_AQUA+" T27 - ");
|
||||||
|
lore.add(ChatColor.WHITE+" +20% Critical Chance");
|
||||||
|
lore.add(ChatColor.WHITE+" Stealth does not cause durability to decrease.");
|
||||||
|
lore.add(ChatColor.WHITE+" Each kill restores 3 Hearts (6 HP) instead of 2.");
|
||||||
|
if (tier>=4) {
|
||||||
|
lore.add(ChatColor.DARK_AQUA+" T40 - ");
|
||||||
|
lore.add(ChatColor.WHITE+" +55 Damage");
|
||||||
|
lore.add(ChatColor.WHITE+" +45% Critical Chance");
|
||||||
|
lore.add(ChatColor.WHITE+" +20% Cooldown Reduction");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case JAMDAK: {
|
case JAMDAK: {
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||||
@ -681,4 +701,16 @@ public enum ItemSet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int GetBaubleTier(Player p) {
|
||||||
|
int tier = 0;
|
||||||
|
if (BaublePouch.isBaublePouch(p.getEquipment().getItemInOffHand())) {
|
||||||
|
int id = BaublePouch.getBaublePouchID(p.getEquipment().getItemInOffHand());
|
||||||
|
List<ItemStack> contents = BaublePouch.getBaublePouchContents(id);
|
||||||
|
for (ItemStack item : contents) {
|
||||||
|
tier += ItemSet.GetTier(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tier;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ public class MonsterController {
|
|||||||
if (GenericFunctions.PercentBlocksAroundArea(ent.getLocation().getBlock(),Material.AIR,16,8,16)>=75 &&
|
if (GenericFunctions.PercentBlocksAroundArea(ent.getLocation().getBlock(),Material.AIR,16,8,16)>=75 &&
|
||||||
GenericFunctions.AllNaturalBlocks(ent.getLocation().getBlock(),16,8,16) &&
|
GenericFunctions.AllNaturalBlocks(ent.getLocation().getBlock(),16,8,16) &&
|
||||||
ent.getNearbyEntities(64, 32, 64).size()<=3) {
|
ent.getNearbyEntities(64, 32, 64).size()<=3) {
|
||||||
TwosideKeeper.LAST_ELITE_SPAWN=TwosideKeeper.getServerTickTime();
|
TwosideKeeper.LAST_ELITE_SPAWN=TwosideKeeper.getServerTickTime();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
@ -192,6 +193,7 @@ import net.md_5.bungee.api.chat.TextComponent;
|
|||||||
import net.minecraft.server.v1_9_R1.EnumParticle;
|
import net.minecraft.server.v1_9_R1.EnumParticle;
|
||||||
import net.minecraft.server.v1_9_R1.MinecraftServer;
|
import net.minecraft.server.v1_9_R1.MinecraftServer;
|
||||||
import sig.plugin.AutoPluginUpdate.AnnounceUpdateEvent;
|
import sig.plugin.AutoPluginUpdate.AnnounceUpdateEvent;
|
||||||
|
import sig.plugin.TwosideKeeper.Boss.SendMiningFatigueToAllNearbyElderGuardians;
|
||||||
import sig.plugin.TwosideKeeper.Events.EntityDamagedEvent;
|
import sig.plugin.TwosideKeeper.Events.EntityDamagedEvent;
|
||||||
import sig.plugin.TwosideKeeper.Events.PlayerDodgeEvent;
|
import sig.plugin.TwosideKeeper.Events.PlayerDodgeEvent;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.AnvilItem;
|
import sig.plugin.TwosideKeeper.HelperStructures.AnvilItem;
|
||||||
@ -221,6 +223,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.WorldShopSession;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.ArrowQuiver;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.Camera;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.Habitation;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.Habitation;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.ItemContainer;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.ItemContainer;
|
||||||
@ -463,6 +466,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static List<Chunk> temporary_chunks = new ArrayList<Chunk>();
|
public static List<Chunk> temporary_chunks = new ArrayList<Chunk>();
|
||||||
public static List<BlockModifyQueue> blockqueue = new ArrayList<BlockModifyQueue>();
|
public static List<BlockModifyQueue> blockqueue = new ArrayList<BlockModifyQueue>();
|
||||||
public static List<JobRecipe> jobrecipes = new ArrayList<JobRecipe>();
|
public static List<JobRecipe> jobrecipes = new ArrayList<JobRecipe>();
|
||||||
|
public static List<Camera> cameras = new ArrayList<Camera>();
|
||||||
long LastClearStructureTime = 0;
|
long LastClearStructureTime = 0;
|
||||||
|
|
||||||
public static final Set<Material> isNatural = ImmutableSet.of(Material.CLAY, Material.DIRT, Material.GRASS,
|
public static final Set<Material> isNatural = ImmutableSet.of(Material.CLAY, Material.DIRT, Material.GRASS,
|
||||||
@ -788,6 +792,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
runServerHeartbeat.runFilterCubeCollection(p);
|
runServerHeartbeat.runFilterCubeCollection(p);
|
||||||
runServerHeartbeat.runVacuumCubeSuckup(p);
|
runServerHeartbeat.runVacuumCubeSuckup(p);
|
||||||
|
if (PlayerStructure.GetPlayerStructure(p).last_rejuvenate+200>TwosideKeeper.getServerTickTime()) {
|
||||||
|
GenericFunctions.HealEntity(p, 5);
|
||||||
|
}
|
||||||
/*if (p.getVehicle() instanceof EnderDragon) {
|
/*if (p.getVehicle() instanceof EnderDragon) {
|
||||||
EnderDragon ed = (EnderDragon)p.getVehicle();
|
EnderDragon ed = (EnderDragon)p.getVehicle();
|
||||||
ed.setVelocity(p.getLocation().getDirection().multiply(2.0f));
|
ed.setVelocity(p.getLocation().getDirection().multiply(2.0f));
|
||||||
@ -804,6 +811,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ScheduleRemoval(temporary_ice_list,tl);
|
ScheduleRemoval(temporary_ice_list,tl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (Camera cam : cameras) {
|
||||||
|
if (!cam.runTick()) {
|
||||||
|
ScheduleRemoval(cameras,cam);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateLavaBlock(Block lavamod) {
|
private void UpdateLavaBlock(Block lavamod) {
|
||||||
@ -876,10 +888,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
totalregen += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.ALIKAHN, 4, 4)/2;
|
totalregen += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(p), p, ItemSet.ALIKAHN, 4, 4)/2;
|
||||||
totalregen += totalregen*pd.pctbonusregen;
|
|
||||||
if (p.hasPotionEffect(PotionEffectType.REGENERATION)) {
|
if (p.hasPotionEffect(PotionEffectType.REGENERATION)) {
|
||||||
totalregen += (GenericFunctions.getPotionEffectLevel(PotionEffectType.REGENERATION, p)+1)*baseregen;
|
totalregen += (GenericFunctions.getPotionEffectLevel(PotionEffectType.REGENERATION, p)+1)*baseregen;
|
||||||
}
|
}
|
||||||
|
totalregen += (totalregen+baseregen)*pd.pctbonusregen;
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p, true), p, ItemSet.DAWNTRACKER,6)) {
|
||||||
|
totalregen += (totalregen+baseregen) * (0.25d*ItemSet.GetTier(p.getEquipment().getItemInMainHand()));
|
||||||
|
}
|
||||||
return totalregen+baseregen;
|
return totalregen+baseregen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1039,6 +1054,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
getServer().getScheduler().runTaskLaterAsynchronously(this, new DiscordStatusUpdater(), 300l);
|
getServer().getScheduler().runTaskLaterAsynchronously(this, new DiscordStatusUpdater(), 300l);
|
||||||
|
|
||||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new ReapplyAbsorptionHeartsFromSet(),0l,600l);
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new ReapplyAbsorptionHeartsFromSet(),0l,600l);
|
||||||
|
//getServer().getScheduler().scheduleSyncRepeatingTask(this, new SendMiningFatigueToAllNearbyElderGuardians(),0l,600l);
|
||||||
|
|
||||||
//This is the constant timing method.
|
//This is the constant timing method.
|
||||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new runServerHeartbeat(this), 20l, 20l);
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new runServerHeartbeat(this), 20l, 20l);
|
||||||
@ -1763,13 +1779,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
//Arrow newar = p.getWorld().spawnArrow(p.getLocation(), p.getLocation().getDirection(), 1f, 12f);
|
//Arrow newar = p.getWorld().spawnArrow(p.getLocation(), p.getLocation().getDirection(), 1f, 12f);
|
||||||
//GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE);
|
//GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE);
|
||||||
//p.sendMessage("This is bow mode "+GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand()));
|
//p.sendMessage("This is bow mode "+GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand()));
|
||||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
/*for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||||
if (GenericFunctions.isArtifactEquip(p.getEquipment().getArmorContents()[i]) &&
|
if (GenericFunctions.isArtifactEquip(p.getEquipment().getArmorContents()[i]) &&
|
||||||
GenericFunctions.isArtifactArmor(p.getEquipment().getArmorContents()[i])) {
|
GenericFunctions.isArtifactArmor(p.getEquipment().getArmorContents()[i])) {
|
||||||
AwakenedArtifact.addPotentialEXP(p.getEquipment().getArmorContents()[i], 999999, p);
|
AwakenedArtifact.addPotentialEXP(p.getEquipment().getArmorContents()[i], 999999, p);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
GenericFunctions.giveItem(p, TwosideKeeperAPI.generateSetPiece(Material.GOLD_AXE, ItemSet.DAWNTRACKER, true, 2));
|
||||||
/*TwosideKeeper.log("Suppressed: "+GenericFunctions.isSuppressed(p),1);
|
/*TwosideKeeper.log("Suppressed: "+GenericFunctions.isSuppressed(p),1);
|
||||||
TwosideKeeper.log("Suppression Time: "+GenericFunctions.getSuppressionTime(p), 1);
|
TwosideKeeper.log("Suppression Time: "+GenericFunctions.getSuppressionTime(p), 1);
|
||||||
GenericFunctions.setSuppressionTime(p, 20);
|
GenericFunctions.setSuppressionTime(p, 20);
|
||||||
@ -1778,7 +1794,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
TwosideKeeper.log("Suppression Time: "+GenericFunctions.getSuppressionTime(p), 1);
|
TwosideKeeper.log("Suppression Time: "+GenericFunctions.getSuppressionTime(p), 1);
|
||||||
TwosideKeeper.log("Suppressed: "+GenericFunctions.isSuppressed(p),1);*/
|
TwosideKeeper.log("Suppressed: "+GenericFunctions.isSuppressed(p),1);*/
|
||||||
//ItemStack item = p.getEquipment().getItemInMainHand();
|
//ItemStack item = p.getEquipment().getItemInMainHand();
|
||||||
AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), 999999, p);
|
//AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), 999999, p);
|
||||||
/*FallingBlock fb = p.getWorld().spawnFallingBlock(p.getLocation(), Material.REDSTONE_BLOCK, (byte)0);
|
/*FallingBlock fb = p.getWorld().spawnFallingBlock(p.getLocation(), Material.REDSTONE_BLOCK, (byte)0);
|
||||||
fb.setMetadata("DESTROY", new FixedMetadataValue(this,true));
|
fb.setMetadata("DESTROY", new FixedMetadataValue(this,true));
|
||||||
GlowAPI.setGlowing(fb, GlowAPI.Color.YELLOW, Bukkit.getOnlinePlayers());*/
|
GlowAPI.setGlowing(fb, GlowAPI.Color.YELLOW, Bukkit.getOnlinePlayers());*/
|
||||||
@ -2414,8 +2430,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
GenericFunctions.updateSetItemsInInventory(ev.getPlayer().getInventory());
|
GenericFunctions.updateSetItemsInInventory(ev.getPlayer().getInventory());
|
||||||
ev.getPlayer().setCollidable(true);
|
ev.getPlayer().setCollidable(true);
|
||||||
|
|
||||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,ev.getPlayer());
|
|
||||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,ev.getPlayer());
|
|
||||||
ev.getPlayer().setVelocity(new Vector(0,0,0));
|
ev.getPlayer().setVelocity(new Vector(0,0,0));
|
||||||
CustomDamage.removeIframe(ev.getPlayer());
|
CustomDamage.removeIframe(ev.getPlayer());
|
||||||
|
|
||||||
@ -2424,6 +2438,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "scoreboard players set "+ev.getPlayer().getName()+" Deaths "+ev.getPlayer().getStatistic(Statistic.DEATHS));
|
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "scoreboard players set "+ev.getPlayer().getName()+" Deaths "+ev.getPlayer().getStatistic(Statistic.DEATHS));
|
||||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.GLOWING,ev.getPlayer());
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.GLOWING,ev.getPlayer());
|
||||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.NIGHT_VISION,ev.getPlayer());
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.NIGHT_VISION,ev.getPlayer());
|
||||||
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,ev.getPlayer());
|
||||||
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,ev.getPlayer());
|
||||||
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setSuffix(createHealthbar(((ev.getPlayer().getHealth())/ev.getPlayer().getMaxHealth())*100,ev.getPlayer()));
|
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setSuffix(createHealthbar(((ev.getPlayer().getHealth())/ev.getPlayer().getMaxHealth())*100,ev.getPlayer()));
|
||||||
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(ev.getPlayer()));
|
ev.getPlayer().getScoreboard().getTeam(ev.getPlayer().getName().toLowerCase()).setPrefix(GenericFunctions.PlayerModePrefix(ev.getPlayer()));
|
||||||
ev.getPlayer().getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0d);
|
ev.getPlayer().getAttribute(Attribute.GENERIC_ATTACK_SPEED).setBaseValue(4.0d);
|
||||||
@ -2442,6 +2458,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||||
public void onPlayerLeave(PlayerQuitEvent ev) {
|
public void onPlayerLeave(PlayerQuitEvent ev) {
|
||||||
Player p = ev.getPlayer();
|
Player p = ev.getPlayer();
|
||||||
|
|
||||||
|
if (p.getGameMode()==GameMode.SPECTATOR) {
|
||||||
|
p.setGameMode(GameMode.SURVIVAL);
|
||||||
|
}
|
||||||
|
|
||||||
TwosideSpleefGames.PassEvent(ev);
|
TwosideSpleefGames.PassEvent(ev);
|
||||||
for (EliteMonster em : elitemonsters) {
|
for (EliteMonster em : elitemonsters) {
|
||||||
em.runPlayerLeaveEvent(ev.getPlayer());
|
em.runPlayerLeaveEvent(ev.getPlayer());
|
||||||
@ -4556,6 +4577,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||||
public void onPlayerSwapItem(PlayerSwapHandItemsEvent ev) {
|
public void onPlayerSwapItem(PlayerSwapHandItemsEvent ev) {
|
||||||
Player p = ev.getPlayer();
|
Player p = ev.getPlayer();
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
setPlayerMaxHealth(p,p.getHealth()/p.getMaxHealth(),true);
|
||||||
|
}
|
||||||
|
},1);
|
||||||
if (ev.getOffHandItem()!=null &&
|
if (ev.getOffHandItem()!=null &&
|
||||||
ev.getOffHandItem().getType()==Material.BOW && ArrowQuiver.isValidQuiver(ev.getMainHandItem())) {
|
ev.getOffHandItem().getType()==Material.BOW && ArrowQuiver.isValidQuiver(ev.getMainHandItem())) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
@ -4662,6 +4689,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
//ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
|
//ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
|
||||||
GenericFunctions.PerformAssassinate(ev.getPlayer(),ev.getItemDrop().getItemStack().getType());
|
GenericFunctions.PerformAssassinate(ev.getPlayer(),ev.getItemDrop().getItemStack().getType());
|
||||||
//ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR));
|
//ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR));
|
||||||
|
} else {
|
||||||
|
TwosideKeeper.log("Not time yet! have to wait "+((pd.lastassassinatetime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,ev.getPlayer()))-TwosideKeeper.getServerTickTime())+" more ticks.", 0);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -6126,7 +6155,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
dmgdealt=0.25;
|
dmgdealt=0.25;
|
||||||
} else
|
} else
|
||||||
if (PlayerMode.isSlayer((Player)ev.getEntity()) &&
|
if (PlayerMode.isSlayer((Player)ev.getEntity()) &&
|
||||||
ItemSet.GetSetCount(GenericFunctions.getEquipment((Player)ev.getEntity()), ItemSet.LORASYS, (Player)ev.getEntity())>0) {
|
ItemSet.GetSetCount(GenericFunctions.getEquipment((Player)ev.getEntity()), ItemSet.LORASYS, (Player)ev.getEntity())>0 &&
|
||||||
|
ItemSet.GetBaubleTier((Player)ev.getEntity())>=18 && ItemSet.GetTier(((Player)ev.getEntity()).getEquipment().getItemInMainHand())>=2) {
|
||||||
dmgdealt=0.0;
|
dmgdealt=0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6279,6 +6309,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||||
public void onEndermanTeleport(EntityTeleportEvent ev) {
|
public void onEndermanTeleport(EntityTeleportEvent ev) {
|
||||||
|
if (ev.getEntity() instanceof Player) {
|
||||||
|
Player p = (Player)ev.getEntity();
|
||||||
|
if (p.getGameMode()==GameMode.SPECTATOR) {
|
||||||
|
ev.setCancelled(true); //Cancel all teleport events done in spectator mode, by anything.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (GenericFunctions.isSuppressed(ev.getEntity())) {
|
if (GenericFunctions.isSuppressed(ev.getEntity())) {
|
||||||
ev.setTo(ev.getFrom());
|
ev.setTo(ev.getFrom());
|
||||||
@ -6466,7 +6503,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
LivingEntityStructure ms = LivingEntityStructure.getLivingEntityStructure(m);
|
LivingEntityStructure ms = LivingEntityStructure.getLivingEntityStructure(m);
|
||||||
if (ms.getElite()) {
|
if (ms.getElite()) {
|
||||||
log("In here 2",5);
|
log("Target reason is "+ev.getReason(),5);
|
||||||
EliteMonster em = null;
|
EliteMonster em = null;
|
||||||
for (int i=0;i<elitemonsters.size();i++) {
|
for (int i=0;i<elitemonsters.size();i++) {
|
||||||
if (elitemonsters.get(i).m.equals(ev.getEntity())) {
|
if (elitemonsters.get(i).m.equals(ev.getEntity())) {
|
||||||
@ -6539,6 +6576,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (GenericFunctions.hasStealth(p) &&
|
if (GenericFunctions.hasStealth(p) &&
|
||||||
m.getTarget()==null) {
|
m.getTarget()==null) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ev.getTarget() instanceof Player &&
|
if (ev.getTarget() instanceof Player &&
|
||||||
@ -6783,7 +6821,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
||||||
if (pd.lastassassinatetime+20>getServerTickTime()) { //Successful Assassination.
|
if (pd.lastassassinatetime+20>getServerTickTime()) { //Successful Assassination.
|
||||||
pd.lastassassinatetime=getServerTickTime()-GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,p);
|
pd.lastassassinatetime=0;
|
||||||
ItemStack[] inv = p.getInventory().getContents();
|
ItemStack[] inv = p.getInventory().getContents();
|
||||||
for (int i=0;i<9;i++) {
|
for (int i=0;i<9;i++) {
|
||||||
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
|
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
|
||||||
@ -6827,7 +6865,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isSlayer) {
|
if (isSlayer) {
|
||||||
int restore_amt = (ItemSet.GetSetCount(GenericFunctions.getEquipment(p), ItemSet.LORASYS, p)>0)?4:2;
|
int restore_amt = 2;
|
||||||
|
if (ItemSet.GetSetCount(GenericFunctions.getEquipment(p), ItemSet.LORASYS, p)>0) {
|
||||||
|
if (ItemSet.GetBaubleTier(p)>=18 && ItemSet.GetTier((p).getEquipment().getItemInMainHand())>=2) {
|
||||||
|
restore_amt = 4;
|
||||||
|
} else
|
||||||
|
if (ItemSet.GetBaubleTier(p)>=27 && ItemSet.GetTier((p).getEquipment().getItemInMainHand())>=3) {
|
||||||
|
restore_amt = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (pd.slayermodehp+restore_amt<p.getMaxHealth()) {
|
if (pd.slayermodehp+restore_amt<p.getMaxHealth()) {
|
||||||
pd.slayermodehp+=restore_amt;
|
pd.slayermodehp+=restore_amt;
|
||||||
} else {
|
} else {
|
||||||
@ -7002,9 +7048,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.setDroppedExp((int)(totalexp*0.75));
|
ev.setDroppedExp((int)(totalexp*0.75));
|
||||||
final LivingEntity mer = m;
|
final LivingEntity mer = m;
|
||||||
final int expdrop = totalexp;
|
final int expdrop = totalexp;
|
||||||
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
|
||||||
droplist.addAll(originaldroplist);
|
|
||||||
if (!GenericFunctions.isSuppressed(m)) {
|
if (!GenericFunctions.isSuppressed(m)) {
|
||||||
|
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
||||||
|
droplist.addAll(originaldroplist);
|
||||||
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) {
|
||||||
@ -7017,16 +7063,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
,30);
|
,30);
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
for (int i=0;i<drop.size();i++) {
|
||||||
|
Item it = deathloc.getWorld().dropItemNaturally(mer.getLocation(), drop.get(i));
|
||||||
|
it.setInvulnerable(true);
|
||||||
|
}
|
||||||
|
GenericFunctions.spawnXP(mer.getLocation(), (int)(expdrop*0.25));
|
||||||
|
}}
|
||||||
|
,50);
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
for (int i=0;i<drop.size();i++) {
|
|
||||||
Item it = deathloc.getWorld().dropItemNaturally(mer.getLocation(), drop.get(i));
|
|
||||||
it.setInvulnerable(true);
|
|
||||||
}
|
|
||||||
GenericFunctions.spawnXP(mer.getLocation(), (int)(expdrop*0.25));
|
|
||||||
}}
|
|
||||||
,50);
|
|
||||||
break;
|
break;
|
||||||
case HELLFIRE:
|
case HELLFIRE:
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1.0f, 1.0f);
|
||||||
@ -7034,9 +7080,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.setDroppedExp((int)(totalexp*0.75));
|
ev.setDroppedExp((int)(totalexp*0.75));
|
||||||
final LivingEntity mer1 = m;
|
final LivingEntity mer1 = m;
|
||||||
final int expdrop1 = totalexp;
|
final int expdrop1 = totalexp;
|
||||||
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
|
||||||
droplist.addAll(originaldroplist);
|
|
||||||
if (!GenericFunctions.isSuppressed(m)) {
|
if (!GenericFunctions.isSuppressed(m)) {
|
||||||
|
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
||||||
|
droplist.addAll(originaldroplist);
|
||||||
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) {
|
||||||
@ -7051,16 +7097,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
,30);
|
,30);
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
for (int i=0;i<drop.size();i++) {
|
||||||
|
Item it = deathloc.getWorld().dropItemNaturally(mer1.getLocation(), drop.get(i));
|
||||||
|
it.setInvulnerable(true);
|
||||||
|
}
|
||||||
|
GenericFunctions.spawnXP(mer1.getLocation(), (int)(expdrop1*0.25));
|
||||||
|
}}
|
||||||
|
,50);
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
for (int i=0;i<drop.size();i++) {
|
|
||||||
Item it = deathloc.getWorld().dropItemNaturally(mer1.getLocation(), drop.get(i));
|
|
||||||
it.setInvulnerable(true);
|
|
||||||
}
|
|
||||||
GenericFunctions.spawnXP(mer1.getLocation(), (int)(expdrop1*0.25));
|
|
||||||
}}
|
|
||||||
,50);
|
|
||||||
break;
|
break;
|
||||||
case END:
|
case END:
|
||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1.0f, 1.0f);
|
||||||
@ -7068,9 +7114,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.setDroppedExp((int)(totalexp*0.75));
|
ev.setDroppedExp((int)(totalexp*0.75));
|
||||||
final LivingEntity mer4 = m;
|
final LivingEntity mer4 = m;
|
||||||
final int expdrop4 = totalexp;
|
final int expdrop4 = totalexp;
|
||||||
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
|
||||||
droplist.addAll(originaldroplist);
|
|
||||||
if (!GenericFunctions.isSuppressed(m)) {
|
if (!GenericFunctions.isSuppressed(m)) {
|
||||||
|
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
||||||
|
droplist.addAll(originaldroplist);
|
||||||
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) {
|
||||||
@ -7085,16 +7131,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
,30);
|
,30);
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
for (int i=0;i<drop.size();i++) {
|
||||||
|
Item it = deathloc.getWorld().dropItemNaturally(mer4.getLocation(), drop.get(i));
|
||||||
|
it.setInvulnerable(true);
|
||||||
|
}
|
||||||
|
GenericFunctions.spawnXP(mer4.getLocation(), (int)(expdrop4*0.25));
|
||||||
|
}}
|
||||||
|
,50);
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
for (int i=0;i<drop.size();i++) {
|
|
||||||
Item it = deathloc.getWorld().dropItemNaturally(mer4.getLocation(), drop.get(i));
|
|
||||||
it.setInvulnerable(true);
|
|
||||||
}
|
|
||||||
GenericFunctions.spawnXP(mer4.getLocation(), (int)(expdrop4*0.25));
|
|
||||||
}}
|
|
||||||
,50);
|
|
||||||
break;
|
break;
|
||||||
case ELITE:
|
case ELITE:
|
||||||
totalexp=ev.getDroppedExp()*300;
|
totalexp=ev.getDroppedExp()*300;
|
||||||
@ -7617,6 +7663,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
boolean handled = AutoEquipItem(ev.getItem().getItemStack(), p);
|
boolean handled = AutoEquipItem(ev.getItem().getItemStack(), p);
|
||||||
if (handled) {
|
if (handled) {
|
||||||
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
ev.setCancelled(handled);
|
ev.setCancelled(handled);
|
||||||
return;
|
return;
|
||||||
@ -7624,6 +7671,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
if (AutoConsumeItem(p,ev.getItem().getItemStack())) {
|
if (AutoConsumeItem(p,ev.getItem().getItemStack())) {
|
||||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_GENERIC_EAT, 1.0f, 1.0f);
|
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_GENERIC_EAT, 1.0f, 1.0f);
|
||||||
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -7638,6 +7686,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (GenericFunctions.isValidArrow(ev.getItem().getItemStack()) && ArrowQuiver.getArrowQuiverInPlayerInventory(p)!=null) {
|
if (GenericFunctions.isValidArrow(ev.getItem().getItemStack()) && ArrowQuiver.getArrowQuiverInPlayerInventory(p)!=null) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||||
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
AddToPlayerInventory(ev.getItem().getItemStack(), p);
|
AddToPlayerInventory(ev.getItem().getItemStack(), p);
|
||||||
return;
|
return;
|
||||||
@ -7653,6 +7702,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (remaining.length==0) {
|
if (remaining.length==0) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||||
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -7666,6 +7716,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (remaining.length==0) {
|
if (remaining.length==0) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||||
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -7680,9 +7731,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
givenitem.setAmount(ev.getRemaining());
|
givenitem.setAmount(ev.getRemaining());
|
||||||
GenericFunctions.giveItem(p, givenitem);
|
GenericFunctions.giveItem(p, givenitem);
|
||||||
}
|
}
|
||||||
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
public static void PlayPickupParticle(Player p, Item item) {
|
||||||
|
//aPluginAPIWrapper.sendParticle(ev.getItem().getLocation(), EnumParticle.ITEM_TAKE, 1, 1, 1, 1, 1);
|
||||||
|
aPlugin.API.sendItemPickupPacket(p, item);
|
||||||
|
}
|
||||||
|
|
||||||
private void HandlePickupAchievements(Player p, ItemStack item) {
|
private void HandlePickupAchievements(Player p, ItemStack item) {
|
||||||
if (p.hasAchievement(Achievement.ACQUIRE_IRON) && item.getType()==Material.DIAMOND && !p.hasAchievement(Achievement.GET_DIAMONDS)) {
|
if (p.hasAchievement(Achievement.ACQUIRE_IRON) && item.getType()==Material.DIAMOND && !p.hasAchievement(Achievement.GET_DIAMONDS)) {
|
||||||
@ -9216,12 +9272,16 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setPlayerMaxHealth(Player p) {
|
public static void setPlayerMaxHealth(Player p) {
|
||||||
setPlayerMaxHealth(p,null);
|
setPlayerMaxHealth(p,null,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setPlayerMaxHealth(Player p, Double ratio) {
|
public static void setPlayerMaxHealth(Player p, Double ratio) {
|
||||||
|
setPlayerMaxHealth(p,ratio,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setPlayerMaxHealth(Player p, Double ratio, boolean force) {
|
||||||
//Determine player max HP based on armor being worn.
|
//Determine player max HP based on armor being worn.
|
||||||
if (EquipmentUpdated(p)) {
|
if (EquipmentUpdated(p) || force) {
|
||||||
TwosideKeeper.log("Equipment updated. Checking health...", 5);
|
TwosideKeeper.log("Equipment updated. Checking health...", 5);
|
||||||
double hp=10; //Get the base max health.
|
double hp=10; //Get the base max health.
|
||||||
//Get all equips.
|
//Get all equips.
|
||||||
@ -9303,7 +9363,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
if (PlayerMode.isDefender(p)) {
|
if (PlayerMode.isDefender(p)) {
|
||||||
hp+=10;
|
hp+=10;
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,60,(p.isBlocking())?3:1,p,false);
|
|
||||||
}
|
}
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Defender HP and Regeneration", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Defender HP and Regeneration", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
if (PlayerMode.isBarbarian(p)) {
|
if (PlayerMode.isBarbarian(p)) {
|
||||||
@ -9354,7 +9413,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LORASAADI, 4, 4)+
|
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LORASAADI, 4, 4)+
|
||||||
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.JAMDAK, 4, 4);*/
|
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.JAMDAK, 4, 4);*/
|
||||||
|
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p, true), p, ItemSet.DAWNTRACKER,6)) {
|
||||||
|
hp+=0.25d*ItemSet.GetTier(p.getEquipment().getItemInMainHand());
|
||||||
|
}
|
||||||
|
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL) {
|
||||||
|
TwosideKeeper.log("Player Mode is Normal.", 0);
|
||||||
hp+=10;
|
hp+=10;
|
||||||
}
|
}
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Adventurer Mode HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Adventurer Mode HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
|
@ -275,7 +275,7 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
AdventurerModeSetExhaustion(p);
|
AdventurerModeSetExhaustion(p);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Adventurer Mode Exhaustion", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Adventurer Mode Exhaustion", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
|
|
||||||
//CalculateHealthRegeneration(serverTickTime, p, pd, equips);
|
CalculateHealthRegeneration(serverTickTime, p, pd, equips);
|
||||||
|
|
||||||
ResetSwordCombo(serverTickTime, p, pd);
|
ResetSwordCombo(serverTickTime, p, pd);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Sword Combo", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Sword Combo", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
@ -291,6 +291,9 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
|
|
||||||
GivePartyNightVision(p);
|
GivePartyNightVision(p);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Party Night Vision", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Party Night Vision", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
|
|
||||||
|
adjustMiningFatigue(p);
|
||||||
|
TwosideKeeper.HeartbeatLogger.AddEntry("Adjust Mining Fatigue", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
}
|
}
|
||||||
//TwosideKeeper.outputArmorDurability(p,">");
|
//TwosideKeeper.outputArmorDurability(p,">");
|
||||||
}
|
}
|
||||||
@ -321,6 +324,12 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Pigman Aggro", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Pigman Aggro", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void adjustMiningFatigue(Player p) {
|
||||||
|
if (p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) && ((GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==2))) {
|
||||||
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW_DIGGING, 6000, 20, p, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void resetPigmanAggro() {
|
private void resetPigmanAggro() {
|
||||||
if (TwosideKeeper.lastPigmanAggroTime+20<TwosideKeeper.getServerTickTime()) {
|
if (TwosideKeeper.lastPigmanAggroTime+20<TwosideKeeper.getServerTickTime()) {
|
||||||
TwosideKeeper.pigmanAggroCount=0;
|
TwosideKeeper.pigmanAggroCount=0;
|
||||||
@ -550,44 +559,8 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
|
|
||||||
private void CalculateHealthRegeneration(final long serverTickTime, Player p, PlayerStructure pd,
|
private void CalculateHealthRegeneration(final long serverTickTime, Player p, PlayerStructure pd,
|
||||||
ItemStack[] equips) {
|
ItemStack[] equips) {
|
||||||
if (pd.last_regen_time+TwosideKeeper.HEALTH_REGENERATION_RATE<=serverTickTime) {
|
if (PlayerMode.isDefender(p)) {
|
||||||
pd.last_regen_time=serverTickTime;
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,60,(p.isBlocking())?3:1,p,false);
|
||||||
//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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,12 +623,11 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
ItemStack[] remaining = InventoryUtils.insertItemsInFilterCube(p, it.getItemStack());
|
ItemStack[] remaining = InventoryUtils.insertItemsInFilterCube(p, it.getItemStack());
|
||||||
if (remaining.length==0) {
|
if (remaining.length==0) {
|
||||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(it.getItemStack()));
|
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(it.getItemStack()));
|
||||||
|
TwosideKeeper.PlayPickupParticle(p,it);
|
||||||
it.remove();
|
it.remove();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
it.remove();
|
it.remove();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
@ -683,7 +655,6 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
double xvel = 0;
|
double xvel = 0;
|
||||||
double yvel = 0;
|
double yvel = 0;
|
||||||
double zvel = 0;
|
double zvel = 0;
|
||||||
count++;
|
|
||||||
if (deltax>0.25) {
|
if (deltax>0.25) {
|
||||||
xvel=-SPD*(Math.min(10, Math.abs(deltax)));
|
xvel=-SPD*(Math.min(10, Math.abs(deltax)));
|
||||||
} else
|
} else
|
||||||
@ -715,6 +686,7 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
ItemStack[] remaining = InventoryUtils.insertItemsInVacuumCube(p, ((Item) ent).getItemStack());
|
ItemStack[] remaining = InventoryUtils.insertItemsInVacuumCube(p, ((Item) ent).getItemStack());
|
||||||
if (remaining.length==0) {
|
if (remaining.length==0) {
|
||||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(((Item) ent).getItemStack()));
|
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(((Item) ent).getItemStack()));
|
||||||
|
TwosideKeeper.PlayPickupParticle(p,(Item)ent);
|
||||||
ent.remove();
|
ent.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -722,6 +694,10 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
ent.remove();
|
ent.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
count++;
|
||||||
|
if (count>8) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (pd.vacuumsuckup) {
|
if (pd.vacuumsuckup) {
|
||||||
@ -743,9 +719,6 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
} else {
|
} else {
|
||||||
ent.setVelocity(ent.getVelocity().setZ(-SPD*(10-Math.min(10,Math.abs(p.getLocation().getZ()-ent.getLocation().getZ())))));
|
ent.setVelocity(ent.getVelocity().setZ(-SPD*(10-Math.min(10,Math.abs(p.getLocation().getZ()-ent.getLocation().getZ())))));
|
||||||
}*/
|
}*/
|
||||||
if (count>8) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user