Maintenance / Quick Fixes to many bugs.
This commit is contained in:
parent
0869df5fad
commit
1a3ab570eb
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.17
|
version: 3.11.1a
|
||||||
loadbefore: [aPlugin]
|
loadbefore: [aPlugin]
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
|
@ -140,11 +140,15 @@ public class EliteMonster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void displayHealthbarToNearbyPlayers() {
|
protected void displayHealthbarToNearbyPlayers() {
|
||||||
|
try {
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
if (m.getLocation().distanceSquared(p.getLocation())<=2500) {
|
if (m.getLocation().getWorld().equals(p.getLocation().getWorld()) && m.getLocation().distanceSquared(p.getLocation())<=2500) {
|
||||||
bar.addPlayer(p);
|
bar.addPlayer(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void resetToSpawn() {
|
protected void resetToSpawn() {
|
||||||
@ -197,6 +201,9 @@ public class EliteMonster {
|
|||||||
public GlowAPI.Color getGlow() {
|
public GlowAPI.Color getGlow() {
|
||||||
GlowAPI.Color col = GlowAPI.Color.DARK_PURPLE;
|
GlowAPI.Color col = GlowAPI.Color.DARK_PURPLE;
|
||||||
if (m.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE)) {
|
if (m.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE)) {
|
||||||
|
col = GlowAPI.Color.DARK_BLUE;
|
||||||
|
}
|
||||||
|
if (Channel.isChanneling(m)) {
|
||||||
col = GlowAPI.Color.YELLOW;
|
col = GlowAPI.Color.YELLOW;
|
||||||
}
|
}
|
||||||
if (storingenergy) {
|
if (storingenergy) {
|
||||||
|
@ -3644,27 +3644,31 @@ public class GenericFunctions {
|
|||||||
|
|
||||||
public static void ConvertSetColor(ItemStack item, ItemSet set) {
|
public static void ConvertSetColor(ItemStack item, ItemSet set) {
|
||||||
if (item.getType().name().contains("LEATHER_")) {
|
if (item.getType().name().contains("LEATHER_")) {
|
||||||
if (set==ItemSet.JAMDAK) {
|
org.bukkit.Color col = org.bukkit.Color.fromRGB(0, 0, 0);
|
||||||
LeatherArmorMeta lm = (LeatherArmorMeta)item.getItemMeta();
|
switch (set) {
|
||||||
lm.setColor(org.bukkit.Color.fromRGB(128, 64, 0));
|
case JAMDAK:{
|
||||||
item.setItemMeta(lm);
|
col=org.bukkit.Color.fromRGB(128, 64, 0);
|
||||||
|
}break;
|
||||||
|
case DARNYS:{
|
||||||
|
col=org.bukkit.Color.fromRGB(224, 224, 224);
|
||||||
|
}break;
|
||||||
|
case ALIKAHN:{
|
||||||
|
col=org.bukkit.Color.fromRGB(64, 0, 64);
|
||||||
|
}break;
|
||||||
|
case LORASAADI:{
|
||||||
|
col=org.bukkit.Color.fromRGB(0, 64, 0);
|
||||||
|
}break;
|
||||||
|
case SHARD:{
|
||||||
|
col=org.bukkit.Color.fromRGB(224, 0, 24);
|
||||||
|
}break;
|
||||||
|
case TOXIN:{
|
||||||
|
col=org.bukkit.Color.fromRGB(196, 196, 0);
|
||||||
|
}break;
|
||||||
}
|
}
|
||||||
if (set==ItemSet.DARNYS) {
|
|
||||||
LeatherArmorMeta lm = (LeatherArmorMeta)item.getItemMeta();
|
LeatherArmorMeta lm = (LeatherArmorMeta)item.getItemMeta();
|
||||||
lm.setColor(org.bukkit.Color.fromRGB(224, 224, 224));
|
lm.setColor(col);
|
||||||
item.setItemMeta(lm);
|
item.setItemMeta(lm);
|
||||||
}
|
}
|
||||||
if (set==ItemSet.ALIKAHN) {
|
|
||||||
LeatherArmorMeta lm = (LeatherArmorMeta)item.getItemMeta();
|
|
||||||
lm.setColor(org.bukkit.Color.fromRGB(64, 0, 64));
|
|
||||||
item.setItemMeta(lm);
|
|
||||||
}
|
|
||||||
if (set==ItemSet.LORASAADI) {
|
|
||||||
LeatherArmorMeta lm = (LeatherArmorMeta)item.getItemMeta();
|
|
||||||
lm.setColor(org.bukkit.Color.fromRGB(0, 64, 0));
|
|
||||||
item.setItemMeta(lm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ExperienceOrb spawnXP(Location location, int expAmount) {
|
public static ExperienceOrb spawnXP(Location location, int expAmount) {
|
||||||
@ -3675,6 +3679,7 @@ public class GenericFunctions {
|
|||||||
|
|
||||||
public static boolean AttemptRevive(Player p, double dmg, String reason) {
|
public static boolean AttemptRevive(Player p, double dmg, String reason) {
|
||||||
boolean revived=false;
|
boolean revived=false;
|
||||||
|
boolean fromRoom=false;
|
||||||
if (p.getHealth()<=dmg) {
|
if (p.getHealth()<=dmg) {
|
||||||
//This means we would die from this attack. Attempt to revive the player.
|
//This means we would die from this attack. Attempt to revive the player.
|
||||||
//Check all artifact armor for a perk.
|
//Check all artifact armor for a perk.
|
||||||
@ -3685,6 +3690,18 @@ public class GenericFunctions {
|
|||||||
|
|
||||||
ItemStack[] equips = p.getEquipment().getArmorContents();
|
ItemStack[] equips = p.getEquipment().getArmorContents();
|
||||||
|
|
||||||
|
|
||||||
|
if (!revived) {
|
||||||
|
for (Room r : TwosideKeeper.roominstances) {
|
||||||
|
if (r.onPlayerDeath(p)) {
|
||||||
|
revived=true;
|
||||||
|
fromRoom=true;
|
||||||
|
RevivePlayer(p, p.getMaxHealth());
|
||||||
|
return true; //Intentionally prevent other revive effects from working.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!revived) {
|
if (!revived) {
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION, 5)) {
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION, 5)) {
|
||||||
if (!Buff.hasBuff(p, "COOLDOWN_UNDYING_RAGE") || Buff.hasBuff(p, "UNKILLABLE")) {
|
if (!Buff.hasBuff(p, "COOLDOWN_UNDYING_RAGE") || Buff.hasBuff(p, "UNKILLABLE")) {
|
||||||
@ -3738,17 +3755,10 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!revived) {
|
if (!fromRoom) {
|
||||||
if (pd.inTankChallengeRoom || pd.inParkourChallengeRoom) {
|
|
||||||
for (Room r : TwosideKeeper.roominstances) {
|
|
||||||
r.onPlayerDeath(p);
|
|
||||||
}
|
|
||||||
revived=true;
|
|
||||||
RevivePlayer(p, p.getMaxHealth());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RandomlyBreakBaubles(p);
|
RandomlyBreakBaubles(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return revived;
|
return revived;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3779,16 +3789,16 @@ public class GenericFunctions {
|
|||||||
set==ItemSet.WOLFSBANE)) {
|
set==ItemSet.WOLFSBANE)) {
|
||||||
double basechance = 1/8d;
|
double basechance = 1/8d;
|
||||||
if (set==ItemSet.WOLFSBANE) {
|
if (set==ItemSet.WOLFSBANE) {
|
||||||
basechance += 0.0d * ItemSet.GetItemTier(bauble);
|
basechance += 1/16d;
|
||||||
}
|
}
|
||||||
if (set==ItemSet.ALUSTINE) {
|
if (set==ItemSet.ALUSTINE) {
|
||||||
basechance += 1/16d * ItemSet.GetItemTier(bauble);
|
basechance += 1/16d;
|
||||||
}
|
}
|
||||||
if (set==ItemSet.MOONSHADOW) {
|
if (set==ItemSet.MOONSHADOW) {
|
||||||
basechance += 1/8d * ItemSet.GetItemTier(bauble);
|
basechance += 1/8d;
|
||||||
}
|
}
|
||||||
if (set==ItemSet.GLADOMAIN) {
|
if (set==ItemSet.GLADOMAIN) {
|
||||||
basechance += 1/4d * ItemSet.GetItemTier(bauble);
|
basechance += 1/4d;
|
||||||
}
|
}
|
||||||
if (Math.random()<=basechance) {
|
if (Math.random()<=basechance) {
|
||||||
if (GenericFunctions.isHardenedItem(bauble)) {
|
if (GenericFunctions.isHardenedItem(bauble)) {
|
||||||
|
@ -993,7 +993,7 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.GRAY+" (Cripple slows the target and decreases target's damage");
|
lore.add(ChatColor.GRAY+" (Cripple slows the target and decreases target's damage");
|
||||||
lore.add(ChatColor.GRAY+" output by 10% per level.)");
|
lore.add(ChatColor.GRAY+" output by 10% per level.)");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Fire Cesspool"+ABILITY_LABEL_END);
|
lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Fire Cesspool"+ABILITY_LABEL_END);
|
||||||
lore.add(ChatColor.GRAY+" When projectiles hit a target, a temporary file pool");
|
lore.add(ChatColor.GRAY+" When projectiles hit a target, a temporary fire pool");
|
||||||
lore.add(ChatColor.GRAY+" is created around it, applying stacking Burn to all");
|
lore.add(ChatColor.GRAY+" is created around it, applying stacking Burn to all");
|
||||||
lore.add(ChatColor.GRAY+" enemy targets in the fire pool. (Burn deals more damage");
|
lore.add(ChatColor.GRAY+" enemy targets in the fire pool. (Burn deals more damage");
|
||||||
lore.add(ChatColor.GRAY+" as the number of stacks increase.)");
|
lore.add(ChatColor.GRAY+" as the number of stacks increase.)");
|
||||||
|
@ -18,6 +18,7 @@ import org.bukkit.inventory.meta.LeatherArmorMeta;
|
|||||||
import aPlugin.DropItem;
|
import aPlugin.DropItem;
|
||||||
import aPlugin.DropMaterial;
|
import aPlugin.DropMaterial;
|
||||||
import aPlugin.API.Chests;
|
import aPlugin.API.Chests;
|
||||||
|
import aPlugin.Drop;
|
||||||
import sig.plugin.TwosideKeeper.Artifact;
|
import sig.plugin.TwosideKeeper.Artifact;
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
import sig.plugin.TwosideKeeper.Drops.SigDrop;
|
import sig.plugin.TwosideKeeper.Drops.SigDrop;
|
||||||
@ -186,7 +187,8 @@ public class Loot {
|
|||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.setName(ChatColor.RED+"Leader Wither Loot Box");
|
aPlugin.API.Chests.LOOT_CUSTOM_5.setName(ChatColor.RED+"Leader Wither Loot Box");
|
||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,1000,"[Leader Wither] Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,1000,"[Leader Wither] Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,1000,"[Leader Wither] Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,1000,"[Leader Wither] Armor",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropMaterial(Material.NETHER_STAR,70));
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropMaterial(Material.NETHER_STAR,140));
|
||||||
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(CustomItem.DailyToken(),140));
|
||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,70,"[Leader Wither] Hardened Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,70,"[Leader Wither] Hardened Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DANGEROUS));
|
||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,70,"[Leader Wither] Hardened Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,70,"[Leader Wither] Hardened Armor",SigDrop.HARDENED,SigDrop.SET,SigDrop.ARMOR,LivingEntityDifficulty.DEADLY));
|
||||||
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,40,"[Leader Wither] Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,40,"[Leader Wither] Set Weapon",SigDrop.NONHARDENED,SigDrop.SET,SigDrop.WEAPON,LivingEntityDifficulty.DEADLY));
|
||||||
|
@ -18,17 +18,16 @@ public class SoundUtils {
|
|||||||
*/
|
*/
|
||||||
public static void playGlobalSound(Location loc, Sound sound, float vol, float pitch) {
|
public static void playGlobalSound(Location loc, Sound sound, float vol, float pitch) {
|
||||||
loc.getWorld().playSound(loc, sound, vol, pitch);
|
loc.getWorld().playSound(loc, sound, vol, pitch);
|
||||||
|
//playIndividualGlobalSound(loc,sound,vol,pitch);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Same as playGlobalSound. Just done for every single player locally.
|
* Same as playGlobalSound. Just done for every single player locally.
|
||||||
*/
|
*/
|
||||||
public static void playIndividualGlobalSound(Location loc, Sound sound, float vol, float pitch) {
|
public static void playIndividualGlobalSound(Location loc, Sound sound, float vol, float pitch) {
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
if (p.getLocation().distanceSquared(loc)<=2500) {
|
|
||||||
p.playSound(loc, sound, vol, pitch);
|
p.playSound(loc, sound, vol, pitch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Plays a sound at the player's location, as if they were hearing a regular sound in the client.
|
* Plays a sound at the player's location, as if they were hearing a regular sound in the client.
|
||||||
*/
|
*/
|
||||||
|
@ -196,9 +196,20 @@ public class LivingEntityStructure {
|
|||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
//if (p!=null && p.isValid() && !p.isDead()) {
|
//if (p!=null && p.isValid() && !p.isDead()) {
|
||||||
if (isImportantGlowEnemy) {
|
if (isImportantGlowEnemy) {
|
||||||
|
if (TwosideKeeper.custommonsters.containsKey(m.getUniqueId()) &&
|
||||||
|
TwosideKeeper.custommonsters.get(m.getUniqueId()).getGlowColor()!=null) {
|
||||||
|
CustomMonster cm = TwosideKeeper.custommonsters.get(m.getUniqueId());
|
||||||
|
if (cm.getGlowColor()!=null) {
|
||||||
|
setGlow(p,cm.getGlowColor());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
if (GenericFunctions.isSuppressed(m)) {
|
if (GenericFunctions.isSuppressed(m)) {
|
||||||
setGlow(p,GlowAPI.Color.BLACK);
|
setGlow(p,GlowAPI.Color.BLACK);
|
||||||
} else
|
} else
|
||||||
|
if (Channel.isChanneling(m)) {
|
||||||
|
setGlow(p,GlowAPI.Color.YELLOW);
|
||||||
|
} else
|
||||||
if (getElite()) {
|
if (getElite()) {
|
||||||
boolean handled=false;
|
boolean handled=false;
|
||||||
for (EliteMonster em : TwosideKeeper.elitemonsters) {
|
for (EliteMonster em : TwosideKeeper.elitemonsters) {
|
||||||
@ -219,14 +230,7 @@ public class LivingEntityStructure {
|
|||||||
if (GenericFunctions.isIsolatedTarget(m, p)) {
|
if (GenericFunctions.isIsolatedTarget(m, p)) {
|
||||||
setGlow(p,GlowAPI.Color.WHITE);
|
setGlow(p,GlowAPI.Color.WHITE);
|
||||||
} else
|
} else
|
||||||
if (TwosideKeeper.custommonsters.containsKey(m.getUniqueId()) &&
|
{
|
||||||
TwosideKeeper.custommonsters.get(m.getUniqueId()).getGlowColor()!=null) {
|
|
||||||
CustomMonster cm = TwosideKeeper.custommonsters.get(m.getUniqueId());
|
|
||||||
if (cm.getGlowColor()!=null) {
|
|
||||||
setGlow(p,cm.getGlowColor());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//No glow.
|
//No glow.
|
||||||
//setGlow(p,null);
|
//setGlow(p,null);
|
||||||
if (glowcolorlist.containsKey(p.getUniqueId())) {
|
if (glowcolorlist.containsKey(p.getUniqueId())) {
|
||||||
|
@ -5,6 +5,7 @@ import org.bukkit.Color;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.attribute.Attribute;
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.inventivetalent.glow.GlowAPI;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.CustomMonster;
|
import sig.plugin.TwosideKeeper.CustomMonster;
|
||||||
import sig.plugin.TwosideKeeper.LivingEntityStructure;
|
import sig.plugin.TwosideKeeper.LivingEntityStructure;
|
||||||
@ -28,6 +29,10 @@ public class Bloodmite extends CustomMonster{
|
|||||||
main = ss;
|
main = ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GlowAPI.Color getGlowColor() {
|
||||||
|
return GlowAPI.Color.WHITE;
|
||||||
|
}
|
||||||
|
|
||||||
public void runTick() {
|
public void runTick() {
|
||||||
if (lastBloodPool+90<=TwosideKeeper.getServerTickTime()) {
|
if (lastBloodPool+90<=TwosideKeeper.getServerTickTime()) {
|
||||||
TemporaryBlock.createTemporaryBlockCircle(m.getLocation(), 1, Material.WOOL, (byte)14, 20*30, "BLOODPOOL");
|
TemporaryBlock.createTemporaryBlockCircle(m.getLocation(), 1, Material.WOOL, (byte)14, 20*30, "BLOODPOOL");
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Spider;
|
import org.bukkit.entity.Spider;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.inventivetalent.glow.GlowAPI;
|
||||||
|
|
||||||
import sig.plugin.TwosideKeeper.Buff;
|
import sig.plugin.TwosideKeeper.Buff;
|
||||||
import sig.plugin.TwosideKeeper.CustomDamage;
|
import sig.plugin.TwosideKeeper.CustomDamage;
|
||||||
@ -56,6 +57,16 @@ public class DarkSpider extends CustomMonster{
|
|||||||
if (canCastSpells()) { //SPELL CASTS HERE.
|
if (canCastSpells()) { //SPELL CASTS HERE.
|
||||||
castSpiderSummon();
|
castSpiderSummon();
|
||||||
}
|
}
|
||||||
|
removeIfCannotFindMaster();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void removeIfCannotFindMaster() {
|
||||||
|
if (linked_knight==null) {
|
||||||
|
for (LivingEntity l : temp_spiders) {
|
||||||
|
l.remove();
|
||||||
|
}
|
||||||
|
m.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void castSpiderSummon() {
|
private void castSpiderSummon() {
|
||||||
@ -206,4 +217,16 @@ public class DarkSpider extends CustomMonster{
|
|||||||
}
|
}
|
||||||
m.remove();
|
m.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GlowAPI.Color getGlowColor() {
|
||||||
|
if (Channel.isChanneling(m)) {
|
||||||
|
return GlowAPI.Color.YELLOW;
|
||||||
|
} else {
|
||||||
|
if (GenericFunctions.isSuppressed(m)) {
|
||||||
|
return GlowAPI.Color.BLACK;
|
||||||
|
} else {
|
||||||
|
return GlowAPI.Color.NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
17
src/sig/plugin/TwosideKeeper/Monster/ExplosiveMite.java
Normal file
17
src/sig/plugin/TwosideKeeper/Monster/ExplosiveMite.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.Monster;
|
||||||
|
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.inventivetalent.glow.GlowAPI;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.CustomMonster;
|
||||||
|
|
||||||
|
public class ExplosiveMite extends CustomMonster{
|
||||||
|
|
||||||
|
public ExplosiveMite(LivingEntity m) {
|
||||||
|
super(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlowAPI.Color getGlowColor() {
|
||||||
|
return GlowAPI.Color.RED;
|
||||||
|
}
|
||||||
|
}
|
@ -38,6 +38,7 @@ public class GenericBoss extends CustomMonster{
|
|||||||
private long stuckTimer=0;
|
private long stuckTimer=0;
|
||||||
long lasthit;
|
long lasthit;
|
||||||
double baseHP;
|
double baseHP;
|
||||||
|
protected boolean isFlying=false;
|
||||||
|
|
||||||
public GenericBoss(LivingEntity m) {
|
public GenericBoss(LivingEntity m) {
|
||||||
super(m);
|
super(m);
|
||||||
@ -134,6 +135,11 @@ public class GenericBoss extends CustomMonster{
|
|||||||
healthbar.setProgress(m.getHealth()/m.getMaxHealth());
|
healthbar.setProgress(m.getHealth()/m.getMaxHealth());
|
||||||
Monster me = (Monster)m;
|
Monster me = (Monster)m;
|
||||||
String healthbarfooter = ((me.getTarget()!=null && (me.getTarget() instanceof Player))?(ChatColor.DARK_AQUA+" "+arrow+" "+ChatColor.YELLOW+((Player)me.getTarget()).getName()):"");
|
String healthbarfooter = ((me.getTarget()!=null && (me.getTarget() instanceof Player))?(ChatColor.DARK_AQUA+" "+arrow+" "+ChatColor.YELLOW+((Player)me.getTarget()).getName()):"");
|
||||||
|
for (Player p : participantlist) {
|
||||||
|
if (p.isFlying()) {
|
||||||
|
p.setFlying(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (Channel.isChanneling(m)) {
|
if (Channel.isChanneling(m)) {
|
||||||
healthbar.setTitle(LivingEntityStructure.getChannelingBar(m)+healthbarfooter);
|
healthbar.setTitle(LivingEntityStructure.getChannelingBar(m)+healthbarfooter);
|
||||||
} else {
|
} else {
|
||||||
@ -171,17 +177,21 @@ public class GenericBoss extends CustomMonster{
|
|||||||
aPlugin.API.discordSendRaw(GenericFunctions.getDisplayName(m)+" Takedown Failed...\n\n"+ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+generateDPSReport()+"\n```");
|
aPlugin.API.discordSendRaw(GenericFunctions.getDisplayName(m)+" Takedown Failed...\n\n"+ChatColor.YELLOW+"DPS Breakdown:"+"\n```\n"+generateDPSReport()+"\n```");
|
||||||
dpslist.clear();
|
dpslist.clear();
|
||||||
healthbar.setColor(BarColor.WHITE);
|
healthbar.setColor(BarColor.WHITE);
|
||||||
|
if (m instanceof Monster) {
|
||||||
|
Monster me = (Monster)m;
|
||||||
|
me.setTarget(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTargetIfLost() {
|
private void updateTargetIfLost() {
|
||||||
Monster mm = (Monster)m;
|
Monster mm = (Monster)m;
|
||||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||||
if (mm.getTarget()==null || !mm.getTarget().isValid() ||
|
if ((mm.getTarget()==null || !mm.getTarget().isValid() ||
|
||||||
les.GetTarget()==null || !mm.getTarget().isValid() ||
|
les.GetTarget()==null || !mm.getTarget().isValid() ||
|
||||||
((mm.getTarget().getLocation().distanceSquared(mm.getLocation())>2500 ||
|
(((mm.getTarget().getLocation().distanceSquared(mm.getLocation())>2500 ||
|
||||||
les.GetTarget().getLocation().distanceSquared(mm.getLocation())>2500
|
les.GetTarget().getLocation().distanceSquared(mm.getLocation())>2500))))
|
||||||
))) {
|
&& !isFlying) {
|
||||||
//See if there's another participant in the list. Choose randomly.
|
//See if there's another participant in the list. Choose randomly.
|
||||||
while (participantlist.size()>0) {
|
while (participantlist.size()>0) {
|
||||||
Player p = participantlist.get((int)(Math.random()*participantlist.size()));
|
Player p = participantlist.get((int)(Math.random()*participantlist.size()));
|
||||||
@ -204,9 +214,6 @@ public class GenericBoss extends CustomMonster{
|
|||||||
|
|
||||||
private void updateHealthbarForNearbyPlayers() {
|
private void updateHealthbarForNearbyPlayers() {
|
||||||
for (Player p : healthbar.getPlayers()) {
|
for (Player p : healthbar.getPlayers()) {
|
||||||
if (p.isFlying()) {
|
|
||||||
p.setFlying(false);
|
|
||||||
}
|
|
||||||
if (p.getWorld().equals(m.getWorld()) && p.getLocation().distanceSquared(m.getLocation())>2500) {
|
if (p.getWorld().equals(m.getWorld()) && p.getLocation().distanceSquared(m.getLocation())>2500) {
|
||||||
healthbar.removePlayer(p);
|
healthbar.removePlayer(p);
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ import org.bukkit.entity.LightningStrike;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Monster;
|
import org.bukkit.entity.Monster;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Silverfish;
|
||||||
import org.bukkit.entity.Skeleton;
|
import org.bukkit.entity.Skeleton;
|
||||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||||
import org.inventivetalent.glow.GlowAPI.Color;
|
import org.inventivetalent.glow.GlowAPI.Color;
|
||||||
@ -81,7 +82,6 @@ public class Knight extends GenericBoss{
|
|||||||
|
|
||||||
DarkSpider spider_pet;
|
DarkSpider spider_pet;
|
||||||
BossBar shieldbar;
|
BossBar shieldbar;
|
||||||
boolean isFlying=false;
|
|
||||||
Location lastlandedloc = null;
|
Location lastlandedloc = null;
|
||||||
final static double[] SHIELD_AMT = new double[]{1800,4700,16000};
|
final static double[] SHIELD_AMT = new double[]{1800,4700,16000};
|
||||||
Location targetloc = null;
|
Location targetloc = null;
|
||||||
@ -152,11 +152,31 @@ public class Knight extends GenericBoss{
|
|||||||
removeDebuffs();
|
removeDebuffs();
|
||||||
updateAI();
|
updateAI();
|
||||||
removeIfTooOld();
|
removeIfTooOld();
|
||||||
|
updateShieldBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateShieldBar() {
|
||||||
|
if (shieldbar!=null) {
|
||||||
|
shieldbar.setProgress(Math.min(1,CustomDamage.getAbsorptionHearts(m)/SHIELD_AMT[getDifficultySlot()]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color getGlowColor() {
|
public Color getGlowColor() {
|
||||||
|
if (Channel.isChanneling(m)) {
|
||||||
|
Channel c = Channel.getCurrentChannel(m);
|
||||||
|
if (c.getSpellName().equalsIgnoreCase("Dark Cleanse")) {
|
||||||
|
return Color.PURPLE;
|
||||||
|
} else {
|
||||||
|
return Color.YELLOW;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (GenericFunctions.isSuppressed(m)) {
|
||||||
|
return Color.BLACK;
|
||||||
|
} else {
|
||||||
return Color.AQUA;
|
return Color.AQUA;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void removeIfTooOld() {
|
private void removeIfTooOld() {
|
||||||
if (m.getTicksLived()>72000 && !startedfight) {
|
if (m.getTicksLived()>72000 && !startedfight) {
|
||||||
@ -215,7 +235,7 @@ public class Knight extends GenericBoss{
|
|||||||
endermites.clear();
|
endermites.clear();
|
||||||
silverfish=null;
|
silverfish=null;
|
||||||
} else
|
} else
|
||||||
if (silverfish!=null && silverfishtimer+(MINDFIELD.getCooldowns()[getDifficultySlot()]/2)<=TwosideKeeper.getServerTickTime()) {
|
if (silverfish!=null/* && silverfishtimer+(MINDFIELD.getCooldowns()[getDifficultySlot()]/2)<=TwosideKeeper.getServerTickTime()*/) {
|
||||||
silverfish.setGlowing(true);
|
silverfish.setGlowing(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -383,6 +403,7 @@ public class Knight extends GenericBoss{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void triggerEndermiteKill(LivingEntity endermite) {
|
public void triggerEndermiteKill(LivingEntity endermite) {
|
||||||
|
if (endermites.contains(endermite)) {
|
||||||
List<Player> players = GenericFunctions.DealDamageToNearbyPlayers(m.getLocation(), MINDFIELD.getDamageValues()[getDifficultySlot()].getTruePctDmgComponent(), 50, false, false, 0, m, "Endermite Popped", false, true);
|
List<Player> players = GenericFunctions.DealDamageToNearbyPlayers(m.getLocation(), MINDFIELD.getDamageValues()[getDifficultySlot()].getTruePctDmgComponent(), 50, false, false, 0, m, "Endermite Popped", false, true);
|
||||||
for (Player p : players) {
|
for (Player p : players) {
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*3, 0, p, true);
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.BLINDNESS, 20*3, 0, p, true);
|
||||||
@ -390,6 +411,7 @@ public class Knight extends GenericBoss{
|
|||||||
}
|
}
|
||||||
SoundUtils.playLocalGlobalSound(Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
|
SoundUtils.playLocalGlobalSound(Sound.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void triggerSilverfishKill(LivingEntity silverfish) {
|
public void triggerSilverfishKill(LivingEntity silverfish) {
|
||||||
silverfishtimer = 0;
|
silverfishtimer = 0;
|
||||||
@ -398,6 +420,14 @@ public class Knight extends GenericBoss{
|
|||||||
}
|
}
|
||||||
endermites.clear();
|
endermites.clear();
|
||||||
this.silverfish=null;
|
this.silverfish=null;
|
||||||
|
List<Entity> ents = m.getNearbyEntities(50, 50, 50);
|
||||||
|
for (Entity e : ents) {
|
||||||
|
if (e instanceof Silverfish ||
|
||||||
|
e instanceof Endermite ||
|
||||||
|
e instanceof Spider) {
|
||||||
|
e.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void spawnEndermiteAndSilverfishNearby() {
|
private void spawnEndermiteAndSilverfishNearby() {
|
||||||
@ -411,6 +441,7 @@ public class Knight extends GenericBoss{
|
|||||||
Endermite end = (Endermite)spawnloc.getWorld().spawnEntity(m.getLocation(), EntityType.ENDERMITE);
|
Endermite end = (Endermite)spawnloc.getWorld().spawnEntity(m.getLocation(), EntityType.ENDERMITE);
|
||||||
end.setTarget(pickRandomTarget());
|
end.setTarget(pickRandomTarget());
|
||||||
endermites.add(end);
|
endermites.add(end);
|
||||||
|
TwosideKeeper.custommonsters.put(end.getUniqueId(), new ExplosiveMite(end));
|
||||||
}
|
}
|
||||||
|
|
||||||
Location spawnloc = GetFreeRandomLocationAroundPoint(10);
|
Location spawnloc = GetFreeRandomLocationAroundPoint(10);
|
||||||
@ -522,6 +553,11 @@ public class Knight extends GenericBoss{
|
|||||||
SoundUtils.playGlobalSound(m.getLocation(), Sound.UI_BUTTON_CLICK, 1.0f, 0.9f);}},
|
SoundUtils.playGlobalSound(m.getLocation(), Sound.UI_BUTTON_CLICK, 1.0f, 0.9f);}},
|
||||||
()->{
|
()->{
|
||||||
if (attemptSpellCast(DARKCLEANSE)) {
|
if (attemptSpellCast(DARKCLEANSE)) {
|
||||||
|
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||||
|
shieldbar = Bukkit.getServer().createBossBar(les.getDifficultyAndMonsterName()+"'s Shield", BarColor.PURPLE, BarStyle.SEGMENTED_6, BarFlag.CREATE_FOG);
|
||||||
|
for (Player p : participantlist) {
|
||||||
|
shieldbar.addPlayer(p);
|
||||||
|
}
|
||||||
CustomDamage.setAbsorptionHearts(m, (float)SHIELD_AMT[getDifficultySlot()]);}},
|
CustomDamage.setAbsorptionHearts(m, (float)SHIELD_AMT[getDifficultySlot()]);}},
|
||||||
()->{
|
()->{
|
||||||
performGrandSlam();},
|
performGrandSlam();},
|
||||||
@ -629,7 +665,6 @@ public class Knight extends GenericBoss{
|
|||||||
SoundUtils.playLocalGlobalSound(Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 0.5f);
|
SoundUtils.playLocalGlobalSound(Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 0.5f);
|
||||||
},90);
|
},90);
|
||||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,()->{
|
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,()->{
|
||||||
isFlying=false;
|
|
||||||
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION, m);
|
GenericFunctions.logAndRemovePotionEffectFromEntity(PotionEffectType.LEVITATION, m);
|
||||||
m.teleport(lastlandedloc);
|
m.teleport(lastlandedloc);
|
||||||
for (int i=0;i<5;i++) {
|
for (int i=0;i<5;i++) {
|
||||||
@ -648,6 +683,9 @@ public class Knight extends GenericBoss{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},100);
|
},100);
|
||||||
|
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin,()->{
|
||||||
|
isFlying=false;
|
||||||
|
},105);
|
||||||
lastusedgrandslam = TwosideKeeper.getServerTickTime();
|
lastusedgrandslam = TwosideKeeper.getServerTickTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -791,6 +829,10 @@ public class Knight extends GenericBoss{
|
|||||||
public void announceFailedTakedown() {
|
public void announceFailedTakedown() {
|
||||||
super.announceFailedTakedown();
|
super.announceFailedTakedown();
|
||||||
if (dpslist.size()>0 && !m.isDead()) {
|
if (dpslist.size()>0 && !m.isDead()) {
|
||||||
|
if (shieldbar!=null) {
|
||||||
|
shieldbar.removeAll();
|
||||||
|
shieldbar=null;
|
||||||
|
}
|
||||||
phaseii=false;
|
phaseii=false;
|
||||||
PerformSpiderCleanup();
|
PerformSpiderCleanup();
|
||||||
PerformSilverfishAndEndermiteCleanup();
|
PerformSilverfishAndEndermiteCleanup();
|
||||||
@ -930,6 +972,7 @@ public class Knight extends GenericBoss{
|
|||||||
super.cleanup();
|
super.cleanup();
|
||||||
if (shieldbar!=null) {
|
if (shieldbar!=null) {
|
||||||
shieldbar.removeAll();
|
shieldbar.removeAll();
|
||||||
|
shieldbar=null;
|
||||||
}
|
}
|
||||||
if (startedfight) {
|
if (startedfight) {
|
||||||
announceFailedTakedown();
|
announceFailedTakedown();
|
||||||
@ -952,6 +995,14 @@ public class Knight extends GenericBoss{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
endermites.clear();
|
endermites.clear();
|
||||||
|
List<Entity> ents = m.getNearbyEntities(50, 50, 50);
|
||||||
|
for (Entity e : ents) {
|
||||||
|
if (e instanceof Silverfish ||
|
||||||
|
e instanceof Endermite ||
|
||||||
|
e instanceof Spider) {
|
||||||
|
e.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupBonusLoot() {
|
public void setupBonusLoot() {
|
||||||
@ -959,7 +1010,9 @@ public class Knight extends GenericBoss{
|
|||||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||||
GlobalLoot gl = GlobalLoot.spawnGlobalLoot(m.getLocation(), ChatColor.AQUA+""+ChatColor.BOLD+les.getDifficultyAndMonsterName()+ChatColor.AQUA+""+ChatColor.BOLD+" Miniboss Loot");
|
GlobalLoot gl = GlobalLoot.spawnGlobalLoot(m.getLocation(), ChatColor.AQUA+""+ChatColor.BOLD+les.getDifficultyAndMonsterName()+ChatColor.AQUA+""+ChatColor.BOLD+" Miniboss Loot");
|
||||||
double lootrate=1.0;
|
double lootrate=1.0;
|
||||||
for (Player p : participantlist) {
|
for (String s : dpslist.keySet()) {
|
||||||
|
Player p = Bukkit.getPlayer(s);
|
||||||
|
if (p!=null) {
|
||||||
PlayerMode mode = getMostUsedPlayerMode(p);
|
PlayerMode mode = getMostUsedPlayerMode(p);
|
||||||
switch (diff) {
|
switch (diff) {
|
||||||
case T2_MINIBOSS:{
|
case T2_MINIBOSS:{
|
||||||
@ -1012,6 +1065,7 @@ public class Knight extends GenericBoss{
|
|||||||
AttemptRoll(gl, 0.1*lootrate, p, CustomItem.DailyToken());
|
AttemptRoll(gl, 0.1*lootrate, p, CustomItem.DailyToken());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ItemStack getVial(LivingEntityDifficulty diff) {
|
private ItemStack getVial(LivingEntityDifficulty diff) {
|
||||||
switch (diff) {
|
switch (diff) {
|
||||||
|
@ -148,6 +148,7 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
if (mode!=ShotMode.NORMAL &&
|
if (mode!=ShotMode.NORMAL &&
|
||||||
shotmodeExpireTime<=TwosideKeeper.getServerTickTime()) {
|
shotmodeExpireTime<=TwosideKeeper.getServerTickTime()) {
|
||||||
mode=ShotMode.NORMAL;
|
mode=ShotMode.NORMAL;
|
||||||
|
LivingEntityStructure.setCustomLivingEntityName(m, "Sniper Skeleton");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,14 +167,23 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
|
|
||||||
public Color getGlowColor() {
|
public Color getGlowColor() {
|
||||||
if (isInIframe()) {
|
if (isInIframe()) {
|
||||||
return Color.WHITE;
|
return Color.GRAY;
|
||||||
|
} else
|
||||||
|
if (Channel.isChanneling(m)) {
|
||||||
|
return Color.YELLOW;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (GenericFunctions.isSuppressed(m)) {
|
||||||
|
return Color.BLACK;
|
||||||
} else {
|
} else {
|
||||||
switch (mode) {
|
return Color.AQUA;
|
||||||
|
}
|
||||||
|
/*switch (mode) {
|
||||||
case NORMAL: return Color.AQUA;
|
case NORMAL: return Color.AQUA;
|
||||||
case POISON: return Color.YELLOW;
|
case POISON: return Color.YELLOW;
|
||||||
case BLEED: return Color.RED;
|
case BLEED: return Color.RED;
|
||||||
default: return Color.AQUA;
|
default: return Color.AQUA;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,8 +226,10 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
} else {
|
} else {
|
||||||
if (Math.random()<=0.5) {
|
if (Math.random()<=0.5) {
|
||||||
mode=ShotMode.POISON;
|
mode=ShotMode.POISON;
|
||||||
|
LivingEntityStructure.setCustomLivingEntityName(m, ChatColor.YELLOW+"Poison Skeleton");
|
||||||
} else {
|
} else {
|
||||||
mode=ShotMode.BLEED;
|
mode=ShotMode.BLEED;
|
||||||
|
LivingEntityStructure.setCustomLivingEntityName(m, ChatColor.RED+"Blood Skeleton");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MODE_SHIFT.setLastCastedTime(TwosideKeeper.getServerTickTime());
|
MODE_SHIFT.setLastCastedTime(TwosideKeeper.getServerTickTime());
|
||||||
@ -422,6 +434,7 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
()->{attemptSpellCast(CRIPPLING_INFECTION);},
|
()->{attemptSpellCast(CRIPPLING_INFECTION);},
|
||||||
};
|
};
|
||||||
final Runnable[] actions2 = new Runnable[]{
|
final Runnable[] actions2 = new Runnable[]{
|
||||||
|
()->{performDodge();},
|
||||||
()->{attemptSpellCast(MODE_SHIFT);},
|
()->{attemptSpellCast(MODE_SHIFT);},
|
||||||
()->{attemptSpellCast(CRIPPLING_INFECTION);},
|
()->{attemptSpellCast(CRIPPLING_INFECTION);},
|
||||||
()->{if (meetsConditionsForSiphon()) {
|
()->{if (meetsConditionsForSiphon()) {
|
||||||
@ -459,6 +472,7 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
ent.remove();
|
ent.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LivingEntityStructure.setCustomLivingEntityName(m, "Sniper Skeleton");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,7 +690,9 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(m);
|
||||||
GlobalLoot gl = GlobalLoot.spawnGlobalLoot(m.getLocation(), ChatColor.AQUA+""+ChatColor.BOLD+les.getDifficultyAndMonsterName()+ChatColor.AQUA+""+ChatColor.BOLD+" Miniboss Loot");
|
GlobalLoot gl = GlobalLoot.spawnGlobalLoot(m.getLocation(), ChatColor.AQUA+""+ChatColor.BOLD+les.getDifficultyAndMonsterName()+ChatColor.AQUA+""+ChatColor.BOLD+" Miniboss Loot");
|
||||||
double lootrate=1.0;
|
double lootrate=1.0;
|
||||||
for (Player p : participantlist) {
|
for (String s : dpslist.keySet()) {
|
||||||
|
Player p = Bukkit.getPlayer(s);
|
||||||
|
if (p!=null) {
|
||||||
PlayerMode mode = getMostUsedPlayerMode(p);
|
PlayerMode mode = getMostUsedPlayerMode(p);
|
||||||
switch (diff) {
|
switch (diff) {
|
||||||
case T2_MINIBOSS:{
|
case T2_MINIBOSS:{
|
||||||
@ -729,6 +745,7 @@ public class SniperSkeleton extends GenericBoss{
|
|||||||
AttemptRoll(gl, 0.1*lootrate, p, CustomItem.DailyToken());
|
AttemptRoll(gl, 0.1*lootrate, p, CustomItem.DailyToken());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private ItemStack getVial(LivingEntityDifficulty diff) {
|
private ItemStack getVial(LivingEntityDifficulty diff) {
|
||||||
switch (diff) {
|
switch (diff) {
|
||||||
|
@ -71,8 +71,8 @@ public class Room {
|
|||||||
public void onLeaveEvent(Player p) {
|
public void onLeaveEvent(Player p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPlayerDeath(Player p) {
|
public boolean onPlayerDeath(Player p) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getTankRoomMultiplier() {
|
public double getTankRoomMultiplier() {
|
||||||
|
@ -53,12 +53,14 @@ public class DPSChallengeRoom extends Room{
|
|||||||
BossBar timer;
|
BossBar timer;
|
||||||
HashMap<PlayerMode,Integer> modes = new HashMap<PlayerMode,Integer>();
|
HashMap<PlayerMode,Integer> modes = new HashMap<PlayerMode,Integer>();
|
||||||
boolean roomFinished=false;
|
boolean roomFinished=false;
|
||||||
|
boolean died=false;
|
||||||
|
|
||||||
public DPSChallengeRoom(Player p, ChunkGenerator generator) {
|
public DPSChallengeRoom(Player p, ChunkGenerator generator) {
|
||||||
super(generator);
|
super(generator);
|
||||||
this.p=p;
|
this.p=p;
|
||||||
this.dmg=0;
|
this.dmg=0;
|
||||||
this.expireTime=0;
|
this.expireTime=0;
|
||||||
|
boolean died=false;
|
||||||
this.started=false;
|
this.started=false;
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.locBeforeInstance = p.getLocation().clone();
|
pd.locBeforeInstance = p.getLocation().clone();
|
||||||
@ -105,6 +107,7 @@ public class DPSChallengeRoom extends Room{
|
|||||||
|
|
||||||
private void keepHealthbarUpdated() {
|
private void keepHealthbarUpdated() {
|
||||||
if (timer!=null) {
|
if (timer!=null) {
|
||||||
|
if (!died) {
|
||||||
if (expireTime-TwosideKeeper.getServerTickTime()>0) {
|
if (expireTime-TwosideKeeper.getServerTickTime()>0) {
|
||||||
timer.setProgress((expireTime-TwosideKeeper.getServerTickTime())/1200d);
|
timer.setProgress((expireTime-TwosideKeeper.getServerTickTime())/1200d);
|
||||||
if (expireTime-TwosideKeeper.getServerTickTime()<400) {
|
if (expireTime-TwosideKeeper.getServerTickTime()<400) {
|
||||||
@ -144,6 +147,11 @@ public class DPSChallengeRoom extends Room{
|
|||||||
roomFinished=true;
|
roomFinished=true;
|
||||||
}, 20*5);
|
}, 20*5);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
timer.removeAll();
|
||||||
|
timer=null;
|
||||||
|
SoundUtils.playGlobalSound(new Location(instance,ROOM_WIDTH/2,1,ROOM_LENGTH/2), Sound.BLOCK_NOTE_PLING, 1.0f, 0.5f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,4 +359,23 @@ public class DPSChallengeRoom extends Room{
|
|||||||
TwosideKeeper.custommonsters.put(z.getUniqueId(), new ChallengeZombie(z));
|
TwosideKeeper.custommonsters.put(z.getUniqueId(), new ChallengeZombie(z));
|
||||||
mobs.add(z);
|
mobs.add(z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean onPlayerDeath(Player p) {
|
||||||
|
if (p.equals(this.p) && started) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
pd.customtitle.modifyLargeCenterTitle(ChatColor.RED+"FAILED", 60);
|
||||||
|
died=true;
|
||||||
|
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||||
|
if (p!=null && p.isValid()) {
|
||||||
|
p.teleport(pd.locBeforeInstance);
|
||||||
|
p.setFireTicks(0);
|
||||||
|
pd.locBeforeInstance=null;
|
||||||
|
}
|
||||||
|
roomFinished=true;
|
||||||
|
}, 5);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ public class ParkourChallengeRoom extends Room{
|
|||||||
|
|
||||||
private void StartChallenge() {
|
private void StartChallenge() {
|
||||||
startTime = TwosideKeeper.getServerTickTime();
|
startTime = TwosideKeeper.getServerTickTime();
|
||||||
lastLavaTime = TwosideKeeper.getServerTickTime();
|
lastLavaTime = TwosideKeeper.getServerTickTime()+200;
|
||||||
Block chest = instance.getBlockAt(ROOM_WIDTH/2, 1, ROOM_LENGTH/2);
|
Block chest = instance.getBlockAt(ROOM_WIDTH/2, 1, ROOM_LENGTH/2);
|
||||||
chest.setType(Material.CHEST);
|
chest.setType(Material.CHEST);
|
||||||
Chest c = (Chest)(chest.getState());
|
Chest c = (Chest)(chest.getState());
|
||||||
@ -346,7 +346,7 @@ public class ParkourChallengeRoom extends Room{
|
|||||||
inv.addItem(levitationpotion);
|
inv.addItem(levitationpotion);
|
||||||
ItemStack speedpotion = createCustomPotion(PotionEffectType.SPEED,20*60,2);
|
ItemStack speedpotion = createCustomPotion(PotionEffectType.SPEED,20*60,2);
|
||||||
inv.addItem(speedpotion);
|
inv.addItem(speedpotion);
|
||||||
inv.addItem(new ItemStack(Material.PUMPKIN_PIE,64,(byte)1));
|
inv.addItem(new ItemStack(Material.PUMPKIN_PIE,64));
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack createCustomPotion(PotionEffectType type, int duration, int amplifier) {
|
private ItemStack createCustomPotion(PotionEffectType type, int duration, int amplifier) {
|
||||||
@ -357,7 +357,7 @@ public class ParkourChallengeRoom extends Room{
|
|||||||
ItemUtils.setDisplayName(finalpotion, "Potion of "+GenericFunctions.CapitalizeFirstLetters(effects.get(0).getType().getName().replaceAll("_", "")));
|
ItemUtils.setDisplayName(finalpotion, "Potion of "+GenericFunctions.CapitalizeFirstLetters(effects.get(0).getType().getName().replaceAll("_", "")));
|
||||||
return finalpotion;
|
return finalpotion;
|
||||||
}
|
}
|
||||||
public void onPlayerDeath(Player p) {
|
public boolean onPlayerDeath(Player p) {
|
||||||
if (p.equals(this.p) && started) {
|
if (p.equals(this.p) && started) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.inParkourChallengeRoom=false;
|
pd.inParkourChallengeRoom=false;
|
||||||
@ -373,6 +373,8 @@ public class ParkourChallengeRoom extends Room{
|
|||||||
}
|
}
|
||||||
roomFinished=true;
|
roomFinished=true;
|
||||||
}, 5);
|
}, 5);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,7 @@ public class TankChallengeRoom extends Room {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onPlayerDeath(Player p) {
|
public boolean onPlayerDeath(Player p) {
|
||||||
if (p.equals(this.p) && started && !finished) {
|
if (p.equals(this.p) && started && !finished) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.inTankChallengeRoom=false;
|
pd.inTankChallengeRoom=false;
|
||||||
@ -262,7 +262,9 @@ public class TankChallengeRoom extends Room {
|
|||||||
}
|
}
|
||||||
roomFinished=true;
|
roomFinished=true;
|
||||||
}, 20*5);
|
}, 20*5);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getTankRoomMultiplier() {
|
public double getTankRoomMultiplier() {
|
||||||
|
@ -1255,6 +1255,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new runServerHeartbeat(this), 20l, 20l);
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new runServerHeartbeat(this), 20l, 20l);
|
||||||
getServer().getScheduler().scheduleSyncRepeatingTask(this, new runServerTick(), 1l, 1l);
|
getServer().getScheduler().scheduleSyncRepeatingTask(this, new runServerTick(), 1l, 1l);
|
||||||
|
|
||||||
|
InitializeBotCommands();
|
||||||
//log(Calendar.getInstance().get(Calendar.DAY_OF_WEEK)+"",0);
|
//log(Calendar.getInstance().get(Calendar.DAY_OF_WEEK)+"",0);
|
||||||
|
|
||||||
/*MonsterTemplate newtemp = new MonsterTemplate(new File(filesave+"/monsterdata/KingSlime.md"));
|
/*MonsterTemplate newtemp = new MonsterTemplate(new File(filesave+"/monsterdata/KingSlime.md"));
|
||||||
@ -1264,7 +1265,33 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void InitializeBotCommands() {
|
private static void InitializeBotCommands() {
|
||||||
//aPlugin.API.addCommand(StatCommand, "stats");
|
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||||
|
|
||||||
|
aPlugin.API.addCommand(args->{
|
||||||
|
if (args.length==1) {
|
||||||
|
aPlugin.API.discordSendRawItalicized("Possible completions: ");
|
||||||
|
aPlugin.API.discordSendRaw(" **!daily dps**");
|
||||||
|
aPlugin.API.discordSendRaw(" **!daily tank**");
|
||||||
|
aPlugin.API.discordSendRaw(" **!daily parkour**");
|
||||||
|
} else
|
||||||
|
if (args.length==2) {
|
||||||
|
switch (args[1].toLowerCase()) {
|
||||||
|
case "dps":{
|
||||||
|
dpschallenge_records.announceRecords();
|
||||||
|
dpschallenge_recordsHOF.announceRecords();
|
||||||
|
}break;
|
||||||
|
case "tank":{
|
||||||
|
tankchallenge_records.announceRecords();
|
||||||
|
tankchallenge_recordsHOF.announceRecords();
|
||||||
|
}break;
|
||||||
|
case "parkour":{
|
||||||
|
parkourchallenge_records.announceRecords();
|
||||||
|
parkourchallenge_recordsHOF.announceRecords();
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},"daily");
|
||||||
|
}, 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||||
@ -2203,7 +2230,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
GenericFunctions.giveItem(p, shard);
|
GenericFunctions.giveItem(p, shard);
|
||||||
}
|
}
|
||||||
case "INSTANCE":{
|
case "INSTANCE":{
|
||||||
new ParkourChallengeRoom(p,new ParkourRoom(32,32));
|
//new ParkourChallengeRoom(p,new ParkourRoom(32,32));
|
||||||
|
new DPSChallengeRoom(p,new DPSRoom(32,32));
|
||||||
}break;
|
}break;
|
||||||
case "CHALLENGEZOMBIE":{
|
case "CHALLENGEZOMBIE":{
|
||||||
Zombie z = (Zombie)(p.getWorld().spawnEntity(p.getLocation(), EntityType.ZOMBIE));
|
Zombie z = (Zombie)(p.getWorld().spawnEntity(p.getLocation(), EntityType.ZOMBIE));
|
||||||
@ -2220,7 +2248,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
dpschallenge_records.announceRecords();
|
dpschallenge_records.announceRecords();
|
||||||
}break;
|
}break;
|
||||||
case "DAILYTOKEN":{
|
case "DAILYTOKEN":{
|
||||||
|
if (args.length==1) {
|
||||||
GenericFunctions.giveItem(p, CustomItem.DailyToken());
|
GenericFunctions.giveItem(p, CustomItem.DailyToken());
|
||||||
|
} else {
|
||||||
|
GenericFunctions.giveItem(Bukkit.getPlayer(args[1]), CustomItem.DailyToken());
|
||||||
|
SoundUtils.playLocalSound(Bukkit.getPlayer(args[1]), Sound.ENTITY_PLAYER_LEVELUP, 1.0f, 1.0f);
|
||||||
|
Bukkit.getPlayer(args[1]).sendMessage(ChatColor.GREEN+"You have been given a Daily Challenge Token.");
|
||||||
|
}
|
||||||
}break;
|
}break;
|
||||||
case "CHALLENGEREWARDS":{
|
case "CHALLENGEREWARDS":{
|
||||||
ChallengeReward.provideAwards();
|
ChallengeReward.provideAwards();
|
||||||
@ -4601,7 +4635,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
pd.lastuseddailysign=TwosideKeeper.getServerTickTime();
|
pd.lastuseddailysign=TwosideKeeper.getServerTickTime();
|
||||||
p.sendMessage(ChatColor.GOLD+"Click this sign again to play "+pd.nameoflastdailysign+ChatColor.RESET+".");
|
p.sendMessage(ChatColor.GOLD+"Click this sign again to play "+pd.nameoflastdailysign+ChatColor.RESET+".");
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(ChatColor.GOLD+"You must wait 24 hours to play "+pd.nameoflastdailysign+ChatColor.RESET+" again.");
|
long tickdiff = (pd.lastdpsDailyChallenge+12096000)-TwosideKeeper.getServerTickTime();
|
||||||
|
TwosideKeeper.log("tickdiff is "+tickdiff, 5);
|
||||||
|
DecimalFormat df = new DecimalFormat("00");
|
||||||
|
p.sendMessage(ChatColor.GOLD+"You must wait "+ChatColor.AQUA+DisplayTimeDifference(tickdiff)+ChatColor.RESET+" to play "+pd.nameoflastdailysign+ChatColor.RESET+" again.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -4619,7 +4656,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
pd.lastuseddailysign=TwosideKeeper.getServerTickTime();
|
pd.lastuseddailysign=TwosideKeeper.getServerTickTime();
|
||||||
p.sendMessage(ChatColor.GOLD+"Click this sign again to play "+pd.nameoflastdailysign+ChatColor.RESET+".");
|
p.sendMessage(ChatColor.GOLD+"Click this sign again to play "+pd.nameoflastdailysign+ChatColor.RESET+".");
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(ChatColor.GOLD+"You must wait 24 hours to play "+pd.nameoflastdailysign+ChatColor.RESET+" again.");
|
long tickdiff = (pd.lasttankDailyChallenge+12096000)-TwosideKeeper.getServerTickTime();
|
||||||
|
TwosideKeeper.log("tickdiff is "+tickdiff, 5);
|
||||||
|
DecimalFormat df = new DecimalFormat("00");
|
||||||
|
p.sendMessage(ChatColor.GOLD+"You must wait "+ChatColor.AQUA+DisplayTimeDifference(tickdiff)+ChatColor.RESET+" to play "+pd.nameoflastdailysign+ChatColor.RESET+" again.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -4637,7 +4677,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
pd.lastuseddailysign=TwosideKeeper.getServerTickTime();
|
pd.lastuseddailysign=TwosideKeeper.getServerTickTime();
|
||||||
p.sendMessage(ChatColor.GOLD+"Click this sign again to play "+pd.nameoflastdailysign+ChatColor.RESET+".");
|
p.sendMessage(ChatColor.GOLD+"Click this sign again to play "+pd.nameoflastdailysign+ChatColor.RESET+".");
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(ChatColor.GOLD+"You must wait 24 hours to play "+pd.nameoflastdailysign+ChatColor.RESET+" again.");
|
|
||||||
|
long tickdiff = (pd.lastparkourDailyChallenge+12096000)-TwosideKeeper.getServerTickTime();
|
||||||
|
TwosideKeeper.log("tickdiff is "+tickdiff, 5);
|
||||||
|
DecimalFormat df = new DecimalFormat("00");
|
||||||
|
p.sendMessage(ChatColor.GOLD+"You must wait "+ChatColor.AQUA+DisplayTimeDifference(tickdiff)+ChatColor.RESET+" to play "+pd.nameoflastdailysign+ChatColor.RESET+" again.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5029,6 +5073,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public void onPlayerDeath(PlayerDeathEvent ev) {
|
public void onPlayerDeath(PlayerDeathEvent ev) {
|
||||||
//Modify the death message. This is a fix for getting rid of the healthbar from the player name.
|
//Modify the death message. This is a fix for getting rid of the healthbar from the player name.
|
||||||
final Player p = ev.getEntity();
|
final Player p = ev.getEntity();
|
||||||
|
if (!p.getWorld().getName().contains("Instance")) {
|
||||||
if (!DeathManager.deathStructureExists(p)) {
|
if (!DeathManager.deathStructureExists(p)) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.playermode_on_death=pd.lastmode;
|
pd.playermode_on_death=pd.lastmode;
|
||||||
@ -5080,6 +5125,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
EliteMonster em = elitemonsters.get(i);
|
EliteMonster em = elitemonsters.get(i);
|
||||||
em.targetlist.remove(p);
|
em.targetlist.remove(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ev.setKeepInventory(true);
|
ev.setKeepInventory(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8532,11 +8578,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
//Look for a death structure for this player. If found, continue.
|
//Look for a death structure for this player. If found, continue.
|
||||||
if (DeathManager.getDeathStructure(p)!=null) {
|
if (DeathManager.getDeathStructure(p)!=null) {
|
||||||
DeathManager.continueAction(p);
|
DeathManager.continueAction(p);
|
||||||
}
|
|
||||||
p.setVelocity(new Vector(0,0,0));
|
p.setVelocity(new Vector(0,0,0));
|
||||||
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,Integer.MAX_VALUE,255,p);
|
GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.LEVITATION,Integer.MAX_VALUE,255,p);
|
||||||
CustomDamage.setAbsorptionHearts(p, 0.0f);
|
|
||||||
GenericFunctions.addIFrame(p, Integer.MAX_VALUE);
|
GenericFunctions.addIFrame(p, Integer.MAX_VALUE);
|
||||||
|
}
|
||||||
|
CustomDamage.setAbsorptionHearts(p, 0.0f);
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.lastdeath=getServerTickTime();
|
pd.lastdeath=getServerTickTime();
|
||||||
log("Last death: "+pd.lastdeath, 2);
|
log("Last death: "+pd.lastdeath, 2);
|
||||||
@ -8903,11 +8949,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
ev.setCancelled(handled);
|
ev.setCancelled(handled);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (AutoConsumeItem(p,newstack)) {
|
/*if (AutoConsumeItem(p,newstack)) {
|
||||||
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);
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
if (GenericFunctions.isValidArrow(newstack) && ArrowQuiver.getArrowQuiverInPlayerInventory(p)!=null) {
|
if (GenericFunctions.isValidArrow(newstack) && ArrowQuiver.getArrowQuiverInPlayerInventory(p)!=null) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(newstack));
|
SoundUtils.playGlobalSound(ev.getPlayer().getLocation(), Sound.ENTITY_ITEM_PICKUP, 0.6f, SoundUtils.DetermineItemPitch(newstack));
|
||||||
@ -9059,13 +9105,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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());
|
PlayPickupParticle(ev.getPlayer(),ev.getItem());
|
||||||
ev.getItem().remove();
|
ev.getItem().remove();
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
TwosideKeeper.PickupLogger.AddEntry("Auto Consume Item Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
TwosideKeeper.PickupLogger.AddEntry("Auto Consume Item Check", (int)(System.nanoTime()-time));time=System.nanoTime();
|
||||||
|
|
||||||
if (ev.getItem().hasMetadata("INFINITEARROW")) { //Not allowed to be picked up, this was an infinite arrow.
|
if (ev.getItem().hasMetadata("INFINITEARROW")) { //Not allowed to be picked up, this was an infinite arrow.
|
||||||
|
@ -111,6 +111,18 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
}
|
}
|
||||||
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY && TwosideKeeper.LAST_WEEKLY_RESET+6912000<=TwosideKeeper.getServerTickTime()) {
|
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK)==Calendar.SUNDAY && TwosideKeeper.LAST_WEEKLY_RESET+6912000<=TwosideKeeper.getServerTickTime()) {
|
||||||
TwosideKeeper.LAST_WEEKLY_RESET = TwosideKeeper.getServerTickTime();
|
TwosideKeeper.LAST_WEEKLY_RESET = TwosideKeeper.getServerTickTime();
|
||||||
|
|
||||||
|
aPlugin.API.discordSendRaw("__**Last Week's Challenge Standings**__ *(Use !daily to see Hall of Fame)*");
|
||||||
|
if (TwosideKeeper.dpschallenge_records.recordlist.size()>0) {
|
||||||
|
TwosideKeeper.dpschallenge_records.announceRecords();
|
||||||
|
}
|
||||||
|
if (TwosideKeeper.tankchallenge_records.recordlist.size()>0) {
|
||||||
|
TwosideKeeper.tankchallenge_records.announceRecords();
|
||||||
|
}
|
||||||
|
if (TwosideKeeper.parkourchallenge_records.recordlist.size()>0) {
|
||||||
|
TwosideKeeper.parkourchallenge_records.announceRecords();
|
||||||
|
}
|
||||||
|
|
||||||
aPlugin.API.discordSendRawItalicized("All Weekly Challenge Leaderboards have been reset!");
|
aPlugin.API.discordSendRawItalicized("All Weekly Challenge Leaderboards have been reset!");
|
||||||
TwosideKeeper.dpschallenge_records.resetRecords();
|
TwosideKeeper.dpschallenge_records.resetRecords();
|
||||||
TwosideKeeper.tankchallenge_records.resetRecords();
|
TwosideKeeper.tankchallenge_records.resetRecords();
|
||||||
@ -851,7 +863,7 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
|
|
||||||
private void DepleteDamagePool(final long serverTickTime, Player p, PlayerStructure pd) {
|
private void DepleteDamagePool(final long serverTickTime, Player p, PlayerStructure pd) {
|
||||||
if (pd.damagepool>0 && pd.damagepooltime+20<=serverTickTime) {
|
if (pd.damagepool>0 && pd.damagepooltime+20<=serverTickTime) {
|
||||||
double transferdmg = CustomDamage.getTransferDamage(p)+(pd.damagepool*0.03);
|
double transferdmg = CustomDamage.getTransferDamage(p)+(pd.damagepool*0.02);
|
||||||
TwosideKeeper.log("Transfer Dmg is "+transferdmg+". Damage Pool: "+pd.damagepool, 5);
|
TwosideKeeper.log("Transfer Dmg is "+transferdmg+". Damage Pool: "+pd.damagepool, 5);
|
||||||
CustomDamage.ApplyDamage(transferdmg, null, p, null, "Damage Pool", CustomDamage.IGNORE_DAMAGE_TICK|CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE);
|
CustomDamage.ApplyDamage(transferdmg, null, p, null, "Damage Pool", CustomDamage.IGNORE_DAMAGE_TICK|CustomDamage.TRUEDMG|CustomDamage.IGNOREDODGE);
|
||||||
if (pd.damagepool-transferdmg<1) {
|
if (pd.damagepool-transferdmg<1) {
|
||||||
@ -861,6 +873,24 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
}
|
}
|
||||||
pd.customtitle.updateSideTitleStats(p);
|
pd.customtitle.updateSideTitleStats(p);
|
||||||
}
|
}
|
||||||
|
if (pd.rage_time>TwosideKeeper.getServerTickTime()) {
|
||||||
|
//Set all armor to durability 0.
|
||||||
|
ItemStack[] items = GenericFunctions.getEquipment(p, true);
|
||||||
|
for (ItemStack i : items) {
|
||||||
|
i.setDurability((short)0);
|
||||||
|
}
|
||||||
|
p.getEquipment().setItemInMainHand(items[0]);
|
||||||
|
p.getEquipment().setItemInOffHand(items[1]);
|
||||||
|
p.getEquipment().setHelmet(items[2]);
|
||||||
|
p.getEquipment().setChestplate(items[3]);
|
||||||
|
p.getEquipment().setLeggings(items[4]);
|
||||||
|
p.getEquipment().setBoots(items[5]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean RottenFleshOnHotbar(Player p) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AdventurerModeSetExhaustion(Player p) {
|
private void AdventurerModeSetExhaustion(Player p) {
|
||||||
@ -1156,6 +1186,7 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void AutoConsumeFoods(Player p) {
|
private void AutoConsumeFoods(Player p) {
|
||||||
|
/*
|
||||||
if (p.getFoodLevel()<20 && PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
if (p.getFoodLevel()<20 && PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
||||||
ItemStack[] contents = p.getInventory().getStorageContents();
|
ItemStack[] contents = p.getInventory().getStorageContents();
|
||||||
for (int i=0;i<contents.length;i++) {
|
for (int i=0;i<contents.length;i++) {
|
||||||
@ -1170,6 +1201,31 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
p.getInventory().removeItem(singlecopy);
|
p.getInventory().removeItem(singlecopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
if ((pd.damagepool*0.02)>=1) {
|
||||||
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
||||||
|
for (int i=0;i<9;i++) {
|
||||||
|
if (p.getInventory().getItem(i)!=null &&
|
||||||
|
GenericFunctions.isAutoConsumeFood(p.getInventory().getItem(i))) {
|
||||||
|
p.setFoodLevel(Math.min(20, p.getFoodLevel()+1));
|
||||||
|
double basepercent = p.getMaxHealth()*0.01;
|
||||||
|
pd.damagepool = pd.damagepool*0.99;
|
||||||
|
GenericFunctions.HealEntity(p,basepercent);
|
||||||
|
//p.getInventory().removeItem(singlecopy);
|
||||||
|
ItemStack item = p.getInventory().getItem(i).clone();
|
||||||
|
if (item.getAmount()>1) {
|
||||||
|
item.setAmount(item.getAmount()-1);
|
||||||
|
p.getInventory().setItem(i, item);
|
||||||
|
SoundUtils.playLocalSound(p, Sound.ENTITY_GENERIC_EAT, 1.0f, 1.0f);
|
||||||
|
} else {
|
||||||
|
p.getInventory().setItem(i, new ItemStack(Material.AIR));
|
||||||
|
SoundUtils.playLocalSound(p, Sound.ENTITY_PLAYER_BURP, 1.0f, 1.0f);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user