+>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/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/plugins/aPlugin (91).jar"/>
|
||||
<classpathentry kind="lib" path="D:/Documents/Test Server/plugins/aPlugin (95).jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.10.9
|
||||
version: 3.10.9a
|
||||
loadbefore: [aPlugin]
|
||||
commands:
|
||||
money:
|
||||
|
@ -97,9 +97,9 @@ public class AwakenedArtifact {
|
||||
item = addMaxAP(item,totalval/1000);
|
||||
item = setEXP(item,totalval%1000);
|
||||
item = addAP(item,totalval/1000);
|
||||
double potentialred = 10.0d;
|
||||
potentialred *= 1 - (5+GenericFunctions.getAbilityValue(ArtifactAbility.PRESERVATION, artifact))/100d;
|
||||
TwosideKeeper.log("Potential reduction is reduced by "+(10-potentialred), 4);
|
||||
double potentialred = 0.1d * getPotential(item); //5
|
||||
potentialred *= 1d - (5d+GenericFunctions.getAbilityValue(ArtifactAbility.PRESERVATION, artifact))/100d;
|
||||
TwosideKeeper.log("Potential is reduced by "+(potentialred)+"% from "+getPotential(item), 0);
|
||||
if (getPotential(item)>potentialred) {
|
||||
item = setPotential(item,(int)(getPotential(item)-potentialred));
|
||||
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)+"!");
|
||||
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)+"]");
|
||||
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 sig.plugin.TwosideKeeper.EliteMonster;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.Camera;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public class EliteGuardian extends EliteMonster{
|
||||
@ -18,6 +19,7 @@ public class EliteGuardian extends EliteMonster{
|
||||
boolean cutsceneplayed=false;
|
||||
STATE state = STATE.WAITINGFORCUTSCENE;
|
||||
int cutscenetimer=0;
|
||||
Camera cam;
|
||||
|
||||
public EliteGuardian(Monster m) {
|
||||
super(m);
|
||||
@ -41,14 +43,17 @@ public class EliteGuardian extends EliteMonster{
|
||||
switch (state) {
|
||||
case PASSIVE:
|
||||
m.setAI(true);
|
||||
m.setInvulnerable(false);
|
||||
break;
|
||||
case WAITINGFORCUTSCENE:
|
||||
m.setInvulnerable(true);
|
||||
List<Player> nearby = GenericFunctions.getNearbyPlayers(m.getLocation(), 4);
|
||||
if (nearby.size()>0) {
|
||||
List<Player> nearby2 = GenericFunctions.getNearbyPlayers(m.getLocation(), 16);
|
||||
//Play the cutscene for all of these players.
|
||||
for (Player p : nearby2) {
|
||||
p.setVelocity(new Vector(0,0,0));
|
||||
targetlist.add(p);
|
||||
if (cutscenetimer==0) {
|
||||
p.setGameMode(GameMode.SPECTATOR);
|
||||
p.setSpectatorTarget(m);
|
||||
@ -58,19 +63,31 @@ public class EliteGuardian extends EliteMonster{
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 40, 1, m);
|
||||
}
|
||||
cutscenetimer++;
|
||||
if (cutscenetimer>100) {
|
||||
if (cutscenetimer>20) {
|
||||
state=STATE.PASSIVE;
|
||||
//Play the cutscene for all of these players.
|
||||
for (Player p : nearby2) {
|
||||
for (Player p : targetlist) {
|
||||
if (p!=null && p.isValid() && p.isOnline()) {
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m.setAI(false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (Player p : targetlist) {
|
||||
adjustMiningFatigue(p);
|
||||
}
|
||||
}
|
||||
|
||||
private void adjustMiningFatigue(Player p) {
|
||||
if (p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) && ((GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==2 && GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING, p)>=4800) || (GenericFunctions.getPotionEffectLevel(PotionEffectType.SLOW_DIGGING, p)==20 && GenericFunctions.getPotionEffectDuration(PotionEffectType.SLOW_DIGGING, p)<4800))) {
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.SLOW_DIGGING, 6000, 20, p, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void runHitEvent(LivingEntity damager, double dmg) {
|
||||
|
@ -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.ChatColor;
|
||||
import org.bukkit.Difficulty;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -1577,6 +1578,12 @@ public class CustomDamage {
|
||||
if (damager instanceof Player && target instanceof Player && !damager.getWorld().getPVP()) {
|
||||
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)) {
|
||||
GenericFunctions.removeNoDamageTick(target, damager);
|
||||
}
|
||||
@ -2383,10 +2390,15 @@ public class CustomDamage {
|
||||
dmg += ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter),(Player)shooter, ItemSet.OLIVE, 3, 3);
|
||||
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), (Player)shooter, ItemSet.LORASYS, 1) ||
|
||||
(ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(shooter), (Player)shooter, ItemSet.LORASYS, 1) &&
|
||||
ItemSet.GetBaubleTier((Player)shooter)>=9) ||
|
||||
GenericFunctions.HasFullRangerSet((Player)shooter)) {
|
||||
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;
|
||||
@ -2599,6 +2611,17 @@ public class CustomDamage {
|
||||
if (reason!=null && reason.equalsIgnoreCase("power swing")) {
|
||||
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;
|
||||
@ -2750,7 +2773,8 @@ public class CustomDamage {
|
||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(GenericFunctions.getEquipment(p,true), p, ItemSet.DAWNTRACKER, 5)) {
|
||||
finaldmg += dmg*0.5;
|
||||
} 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*aPlugin.API.getPlayerBonuses(p).getBonusArmorPenetration();
|
||||
@ -2956,6 +2980,9 @@ public class CustomDamage {
|
||||
if (pd.rage_time>TwosideKeeper.getServerTickTime()) {
|
||||
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")) {
|
||||
lifestealpct*=2;
|
||||
}
|
||||
@ -3096,6 +3123,9 @@ public class CustomDamage {
|
||||
double cooldown = 0.0;
|
||||
cooldown+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(GenericFunctions.getBaubles(p), p, ItemSet.GLADOMAIN, 2, 2)/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;
|
||||
}
|
||||
|
||||
|
@ -35,13 +35,15 @@ public class DeathManager {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,15,-2,p,true);
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,15,100,p,true);
|
||||
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,15,-2,p,true);
|
||||
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.JUMP,15,100,p,true);
|
||||
p.setVelocity(new Vector(0,0,0));
|
||||
CustomDamage.removeIframe(p);
|
||||
Location loc = p.getLocation();
|
||||
if (p.getBedSpawnLocation()!=null) {loc.setY(p.getBedSpawnLocation().getY());}
|
||||
p.teleport(loc);
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,p);
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,p);
|
||||
}},1);
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
//pd.deathloot.clear();
|
||||
|
@ -263,7 +263,7 @@ public class EliteMonster {
|
||||
currentdps = dpslist.get(p.getName());
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
@ -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:{
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (ticks==1 && amplifier==0) {
|
||||
//Force it to be added.
|
||||
TwosideKeeper.log("Removing "+type.getName(), 5);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
|
||||
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);
|
||||
if (amplifier==-1 || ticks==0) {
|
||||
//Something really bad happened!!!
|
||||
@ -3106,7 +3146,7 @@ public class GenericFunctions {
|
||||
if (pd.last_rejuvenate+GetModifiedCooldown(TwosideKeeper.REJUVENATE_COOLDOWN,player)<=TwosideKeeper.getServerTickTime()) {
|
||||
SoundUtils.playGlobalSound(player.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0f, 1.0f);
|
||||
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));
|
||||
}
|
||||
}
|
||||
@ -4280,9 +4320,9 @@ public class GenericFunctions {
|
||||
int duration = getPotionEffectDuration(type,p);
|
||||
int currentlv = getPotionEffectLevel(type,p);
|
||||
PotionEffect neweffect = new PotionEffect(type,tick_duration,(currentlv+incr_amt<maxlv)?(currentlv+incr_amt):maxlv);
|
||||
if (tick_duration+BUFFER >= duration) {
|
||||
//if (tick_duration+BUFFER >= duration) {
|
||||
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
|
||||
}
|
||||
//}
|
||||
} else {
|
||||
PotionEffect neweffect = new PotionEffect(type,tick_duration,incr_amt-1);
|
||||
logAndApplyPotionEffectToEntity(neweffect.getType(), neweffect.getDuration(),neweffect.getAmplifier(), p, true);
|
||||
@ -4320,7 +4360,7 @@ public class GenericFunctions {
|
||||
}
|
||||
}
|
||||
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);
|
||||
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++) {
|
||||
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() {
|
||||
public void run() {
|
||||
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) &&
|
||||
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.
|
||||
aPlugin.API.sendCooldownPacket(player, name, 40);
|
||||
}
|
||||
@ -4617,7 +4665,11 @@ public class GenericFunctions {
|
||||
}
|
||||
|
||||
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 &&
|
||||
ItemSet.GetBaubleTier(p)>=27 && ItemSet.GetTier(p.getEquipment().getItemInMainHand())>=3) {
|
||||
return;
|
||||
} else {
|
||||
if (!aPlugin.API.isAFK(p)) {
|
||||
ItemStack[] inv = p.getInventory().getContents();
|
||||
for (int i=0;i<9;i++) {
|
||||
if (inv[i]!=null &&
|
||||
@ -4627,6 +4679,7 @@ public class GenericFunctions {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetNearbyMonsterCount(LivingEntity ent, double range) {
|
||||
List<Entity> ents = ent.getNearbyEntities(range, range, range);
|
||||
|
@ -13,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.BaublePouch;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||
|
||||
public enum ItemSet {
|
||||
@ -24,9 +25,9 @@ public enum ItemSet {
|
||||
DARNYS(2,1, 10,5, 20,5, 1,1),
|
||||
ALIKAHN(3,1, 15,6, 30,10, 1,1),
|
||||
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),
|
||||
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),
|
||||
DASHER(5,5, 3,3, 5,5, 0,0),
|
||||
DANCER(5,1, 3,3, 5,5, 0,0),
|
||||
@ -441,20 +442,39 @@ public enum ItemSet {
|
||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" Powered Mock");
|
||||
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
||||
lore.add(ChatColor.WHITE+" +15 Damage");
|
||||
lore.add(ChatColor.GRAY+" ");
|
||||
lore.add(ChatColor.GRAY+" Mock cooldown decreases from");
|
||||
lore.add(ChatColor.GRAY+" 20 -> 10 seconds, making it stackable.");
|
||||
lore.add(ChatColor.GRAY+" All Lifesteal Stacks and Weapon Charges");
|
||||
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;
|
||||
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.GOLD+""+ChatColor.ITALIC+"of all baubles in your bauble pouch.");
|
||||
lore.add(ChatColor.DARK_AQUA+" T9 - ");
|
||||
lore.add(ChatColor.WHITE+" +50% Armor Penetration");
|
||||
lore.add(ChatColor.WHITE+" +15 Damage");
|
||||
lore.add(ChatColor.GRAY+" ");
|
||||
lore.add(ChatColor.WHITE+" Stealth does not cause durability to decrease.");
|
||||
if (tier>=2) {
|
||||
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;
|
||||
case JAMDAK: {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
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.MinecraftServer;
|
||||
import sig.plugin.AutoPluginUpdate.AnnounceUpdateEvent;
|
||||
import sig.plugin.TwosideKeeper.Boss.SendMiningFatigueToAllNearbyElderGuardians;
|
||||
import sig.plugin.TwosideKeeper.Events.EntityDamagedEvent;
|
||||
import sig.plugin.TwosideKeeper.Events.PlayerDodgeEvent;
|
||||
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.BaublePouch;
|
||||
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.Habitation;
|
||||
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<BlockModifyQueue> blockqueue = new ArrayList<BlockModifyQueue>();
|
||||
public static List<JobRecipe> jobrecipes = new ArrayList<JobRecipe>();
|
||||
public static List<Camera> cameras = new ArrayList<Camera>();
|
||||
long LastClearStructureTime = 0;
|
||||
|
||||
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()) {
|
||||
runServerHeartbeat.runFilterCubeCollection(p);
|
||||
runServerHeartbeat.runVacuumCubeSuckup(p);
|
||||
if (PlayerStructure.GetPlayerStructure(p).last_rejuvenate+200>TwosideKeeper.getServerTickTime()) {
|
||||
GenericFunctions.HealEntity(p, 5);
|
||||
}
|
||||
/*if (p.getVehicle() instanceof EnderDragon) {
|
||||
EnderDragon ed = (EnderDragon)p.getVehicle();
|
||||
ed.setVelocity(p.getLocation().getDirection().multiply(2.0f));
|
||||
@ -804,6 +811,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ScheduleRemoval(temporary_ice_list,tl);
|
||||
}
|
||||
}
|
||||
for (Camera cam : cameras) {
|
||||
if (!cam.runTick()) {
|
||||
ScheduleRemoval(cameras,cam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 += totalregen*pd.pctbonusregen;
|
||||
if (p.hasPotionEffect(PotionEffectType.REGENERATION)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1039,6 +1054,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
getServer().getScheduler().runTaskLaterAsynchronously(this, new DiscordStatusUpdater(), 300l);
|
||||
|
||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new ReapplyAbsorptionHeartsFromSet(),0l,600l);
|
||||
//getServer().getScheduler().scheduleSyncRepeatingTask(this, new SendMiningFatigueToAllNearbyElderGuardians(),0l,600l);
|
||||
|
||||
//This is the constant timing method.
|
||||
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);
|
||||
//GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE);
|
||||
//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]) &&
|
||||
GenericFunctions.isArtifactArmor(p.getEquipment().getArmorContents()[i])) {
|
||||
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("Suppression Time: "+GenericFunctions.getSuppressionTime(p), 1);
|
||||
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("Suppressed: "+GenericFunctions.isSuppressed(p),1);*/
|
||||
//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);
|
||||
fb.setMetadata("DESTROY", new FixedMetadataValue(this,true));
|
||||
GlowAPI.setGlowing(fb, GlowAPI.Color.YELLOW, Bukkit.getOnlinePlayers());*/
|
||||
@ -2414,8 +2430,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
GenericFunctions.updateSetItemsInInventory(ev.getPlayer().getInventory());
|
||||
ev.getPlayer().setCollidable(true);
|
||||
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION,ev.getPlayer());
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.JUMP,ev.getPlayer());
|
||||
ev.getPlayer().setVelocity(new Vector(0,0,0));
|
||||
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));
|
||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.GLOWING,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()).setPrefix(GenericFunctions.PlayerModePrefix(ev.getPlayer()));
|
||||
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)
|
||||
public void onPlayerLeave(PlayerQuitEvent ev) {
|
||||
Player p = ev.getPlayer();
|
||||
|
||||
if (p.getGameMode()==GameMode.SPECTATOR) {
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
}
|
||||
|
||||
TwosideSpleefGames.PassEvent(ev);
|
||||
for (EliteMonster em : elitemonsters) {
|
||||
em.runPlayerLeaveEvent(ev.getPlayer());
|
||||
@ -4556,6 +4577,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||
public void onPlayerSwapItem(PlayerSwapHandItemsEvent ev) {
|
||||
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 &&
|
||||
ev.getOffHandItem().getType()==Material.BOW && ArrowQuiver.isValidQuiver(ev.getMainHandItem())) {
|
||||
ev.setCancelled(true);
|
||||
@ -4662,6 +4689,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
//ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
|
||||
GenericFunctions.PerformAssassinate(ev.getPlayer(),ev.getItemDrop().getItemStack().getType());
|
||||
//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;
|
||||
}
|
||||
@ -6126,7 +6155,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
dmgdealt=0.25;
|
||||
} else
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -6279,6 +6309,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||
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())) {
|
||||
ev.setTo(ev.getFrom());
|
||||
@ -6466,7 +6503,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
LivingEntityStructure ms = LivingEntityStructure.getLivingEntityStructure(m);
|
||||
if (ms.getElite()) {
|
||||
log("In here 2",5);
|
||||
log("Target reason is "+ev.getReason(),5);
|
||||
EliteMonster em = null;
|
||||
for (int i=0;i<elitemonsters.size();i++) {
|
||||
if (elitemonsters.get(i).m.equals(ev.getEntity())) {
|
||||
@ -6539,6 +6576,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (GenericFunctions.hasStealth(p) &&
|
||||
m.getTarget()==null) {
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (ev.getTarget() instanceof Player &&
|
||||
@ -6783,7 +6821,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
||||
if (pd.lastassassinatetime+20>getServerTickTime()) { //Successful Assassination.
|
||||
pd.lastassassinatetime=getServerTickTime()-GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,p);
|
||||
pd.lastassassinatetime=0;
|
||||
ItemStack[] inv = p.getInventory().getContents();
|
||||
for (int i=0;i<9;i++) {
|
||||
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
|
||||
@ -6827,7 +6865,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
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()) {
|
||||
pd.slayermodehp+=restore_amt;
|
||||
} else {
|
||||
@ -7002,9 +7048,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.setDroppedExp((int)(totalexp*0.75));
|
||||
final LivingEntity mer = m;
|
||||
final int expdrop = totalexp;
|
||||
if (!GenericFunctions.isSuppressed(m)) {
|
||||
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
||||
droplist.addAll(originaldroplist);
|
||||
if (!GenericFunctions.isSuppressed(m)) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
if (!mer.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer.getLocation().getBlockY()<48) {
|
||||
@ -7017,7 +7063,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}}
|
||||
,30);
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
for (int i=0;i<drop.size();i++) {
|
||||
@ -7027,6 +7072,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
GenericFunctions.spawnXP(mer.getLocation(), (int)(expdrop*0.25));
|
||||
}}
|
||||
,50);
|
||||
}
|
||||
break;
|
||||
case HELLFIRE:
|
||||
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));
|
||||
final LivingEntity mer1 = m;
|
||||
final int expdrop1 = totalexp;
|
||||
if (!GenericFunctions.isSuppressed(m)) {
|
||||
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
||||
droplist.addAll(originaldroplist);
|
||||
if (!GenericFunctions.isSuppressed(m)) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
if (!mer1.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer1.getLocation().getBlockY()<48) {
|
||||
@ -7051,7 +7097,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}}
|
||||
,30);
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
for (int i=0;i<drop.size();i++) {
|
||||
@ -7061,6 +7106,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
GenericFunctions.spawnXP(mer1.getLocation(), (int)(expdrop1*0.25));
|
||||
}}
|
||||
,50);
|
||||
}
|
||||
break;
|
||||
case END:
|
||||
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));
|
||||
final LivingEntity mer4 = m;
|
||||
final int expdrop4 = totalexp;
|
||||
if (!GenericFunctions.isSuppressed(m)) {
|
||||
droplist.clear(); //Clear the drop list. We are going to delay the drops.
|
||||
droplist.addAll(originaldroplist);
|
||||
if (!GenericFunctions.isSuppressed(m)) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
if (!mer4.getLocation().getWorld().getName().equalsIgnoreCase("world") || mer4.getLocation().getBlockY()<48) {
|
||||
@ -7085,7 +7131,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}}
|
||||
,30);
|
||||
}
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
for (int i=0;i<drop.size();i++) {
|
||||
@ -7095,6 +7140,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
GenericFunctions.spawnXP(mer4.getLocation(), (int)(expdrop4*0.25));
|
||||
}}
|
||||
,50);
|
||||
}
|
||||
break;
|
||||
case ELITE:
|
||||
totalexp=ev.getDroppedExp()*300;
|
||||
@ -7617,6 +7663,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
boolean handled = AutoEquipItem(ev.getItem().getItemStack(), p);
|
||||
if (handled) {
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
ev.setCancelled(handled);
|
||||
return;
|
||||
@ -7624,6 +7671,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
if (AutoConsumeItem(p,ev.getItem().getItemStack())) {
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_GENERIC_EAT, 1.0f, 1.0f);
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
ev.setCancelled(true);
|
||||
return;
|
||||
@ -7638,6 +7686,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (GenericFunctions.isValidArrow(ev.getItem().getItemStack()) && ArrowQuiver.getArrowQuiverInPlayerInventory(p)!=null) {
|
||||
ev.setCancelled(true);
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
AddToPlayerInventory(ev.getItem().getItemStack(), p);
|
||||
return;
|
||||
@ -7653,6 +7702,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (remaining.length==0) {
|
||||
ev.setCancelled(true);
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
return;
|
||||
} else {
|
||||
@ -7666,6 +7716,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (remaining.length==0) {
|
||||
ev.setCancelled(true);
|
||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(ev.getItem().getItemStack()));
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
return;
|
||||
} else {
|
||||
@ -7680,9 +7731,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
givenitem.setAmount(ev.getRemaining());
|
||||
GenericFunctions.giveItem(p, givenitem);
|
||||
}
|
||||
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||
ev.getItem().remove();
|
||||
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) {
|
||||
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) {
|
||||
setPlayerMaxHealth(p,null);
|
||||
setPlayerMaxHealth(p,null,false);
|
||||
}
|
||||
|
||||
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.
|
||||
if (EquipmentUpdated(p)) {
|
||||
if (EquipmentUpdated(p) || force) {
|
||||
TwosideKeeper.log("Equipment updated. Checking health...", 5);
|
||||
double hp=10; //Get the base max health.
|
||||
//Get all equips.
|
||||
@ -9303,7 +9363,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
if (PlayerMode.isDefender(p)) {
|
||||
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();
|
||||
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.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) {
|
||||
TwosideKeeper.log("Player Mode is Normal.", 0);
|
||||
hp+=10;
|
||||
}
|
||||
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);
|
||||
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);
|
||||
TwosideKeeper.HeartbeatLogger.AddEntry("Reset Sword Combo", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||
@ -291,6 +291,9 @@ final class runServerHeartbeat implements Runnable {
|
||||
|
||||
GivePartyNightVision(p);
|
||||
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,">");
|
||||
}
|
||||
@ -321,6 +324,12 @@ final class runServerHeartbeat implements Runnable {
|
||||
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() {
|
||||
if (TwosideKeeper.lastPigmanAggroTime+20<TwosideKeeper.getServerTickTime()) {
|
||||
TwosideKeeper.pigmanAggroCount=0;
|
||||
@ -550,44 +559,8 @@ final class runServerHeartbeat implements Runnable {
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (PlayerMode.isDefender(p)) {
|
||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.REGENERATION,60,(p.isBlocking())?3:1,p,false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -650,12 +623,11 @@ final class runServerHeartbeat implements Runnable {
|
||||
ItemStack[] remaining = InventoryUtils.insertItemsInFilterCube(p, it.getItemStack());
|
||||
if (remaining.length==0) {
|
||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(it.getItemStack()));
|
||||
TwosideKeeper.PlayPickupParticle(p,it);
|
||||
it.remove();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
it.remove();
|
||||
return;
|
||||
}
|
||||
}
|
||||
count++;
|
||||
@ -683,7 +655,6 @@ final class runServerHeartbeat implements Runnable {
|
||||
double xvel = 0;
|
||||
double yvel = 0;
|
||||
double zvel = 0;
|
||||
count++;
|
||||
if (deltax>0.25) {
|
||||
xvel=-SPD*(Math.min(10, Math.abs(deltax)));
|
||||
} else
|
||||
@ -715,6 +686,7 @@ final class runServerHeartbeat implements Runnable {
|
||||
ItemStack[] remaining = InventoryUtils.insertItemsInVacuumCube(p, ((Item) ent).getItemStack());
|
||||
if (remaining.length==0) {
|
||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(((Item) ent).getItemStack()));
|
||||
TwosideKeeper.PlayPickupParticle(p,(Item)ent);
|
||||
ent.remove();
|
||||
return;
|
||||
}
|
||||
@ -722,6 +694,10 @@ final class runServerHeartbeat implements Runnable {
|
||||
ent.remove();
|
||||
return;
|
||||
}
|
||||
count++;
|
||||
if (count>8) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (pd.vacuumsuckup) {
|
||||
@ -743,9 +719,6 @@ final class runServerHeartbeat implements Runnable {
|
||||
} else {
|
||||
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