Added functionality for Ranger sets.

WoodenVogog
sigonasr2 8 years ago
parent 51b6759d7f
commit f9f4935463
  1. 3
      .gitignore
  2. BIN
      TwosideKeeper.jar
  3. 5
      src/sig/plugin/TwosideKeeper/Buff.java
  4. 69
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  5. 2
      src/sig/plugin/TwosideKeeper/CustomMonster.java
  6. 21
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  7. 14
      src/sig/plugin/TwosideKeeper/HelperStructures/ItemSet.java
  8. 8
      src/sig/plugin/TwosideKeeper/HelperStructures/Loot.java
  9. 1
      src/sig/plugin/TwosideKeeper/LivingEntityStructure.java
  10. 14
      src/sig/plugin/TwosideKeeper/Monster/Dummy.java
  11. 2
      src/sig/plugin/TwosideKeeper/PlayerStructure.java
  12. 19
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java
  13. 20
      src/sig/plugin/TwosideKeeper/runServerHeartbeat.java

3
.gitignore vendored

@ -1,2 +1,3 @@
.* .*
/bin /bin
/projectBuilder.xml

Binary file not shown.

@ -241,4 +241,9 @@ public class Buff {
public String getBuffIcon() { public String getBuffIcon() {
return icon; return icon;
} }
public static boolean buffCanBeRemoved() {
//For now, there are no buffs that cannot be removed.
return true;
}
} }

@ -487,7 +487,7 @@ public class CustomDamage {
aPlugin.API.sendEntityHurtAnimation(target); aPlugin.API.sendEntityHurtAnimation(target);
} }
if (damager==null && reason.equalsIgnoreCase("POISON") && !(target instanceof Player)) { if (damager==null && (reason.equalsIgnoreCase("POISON") || reason.equalsIgnoreCase("Shrapnel")) && !(target instanceof Player)) {
EntityUtils.applyDamageIndicator(target, damage, IndicatorType.DOT); EntityUtils.applyDamageIndicator(target, damage, IndicatorType.DOT);
} }
@ -512,6 +512,7 @@ public class CustomDamage {
*/ */
static double applyOnHitEffects(double damage, Entity damager, LivingEntity target, ItemStack weapon, static double applyOnHitEffects(double damage, Entity damager, LivingEntity target, ItemStack weapon,
String reason, int flags) { String reason, int flags) {
triggerDummyHitEvent(target,damage);
if (target instanceof Player) { if (target instanceof Player) {
Player p = (Player)target; Player p = (Player)target;
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
@ -707,6 +708,8 @@ public class CustomDamage {
damage = applyBarbarianBonuses(p,target,weapon,damage,reason); damage = applyBarbarianBonuses(p,target,weapon,damage,reason);
increaseWindCharges(p); increaseWindCharges(p);
applyWindSlashEffects(p,target,damage,reason); applyWindSlashEffects(p,target,damage,reason);
applyShrapnel(p,target);
applyDoTs(p,target);
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) { if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
if (isFlagSet(pd.lasthitproperties,IS_CRIT)) { if (isFlagSet(pd.lasthitproperties,IS_CRIT)) {
@ -775,6 +778,34 @@ public class CustomDamage {
return damage; return damage;
} }
private static void applyDoTs(Player p, LivingEntity target) {
double basechance = ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.TOXIN, 2, 2)/100d;
if (Math.random()<=)
}
private static void triggerDummyHitEvent(LivingEntity target, double damage) {
if (target instanceof Villager) {
Villager v = (Villager)target;
/*for (UUID id : TwosideKeeper.custommonsters.keySet()) {
if (id.equals(v.getUniqueId())) {
sig.plugin.TwosideKeeper.Monster.Wither wi = (sig.plugin.TwosideKeeper.Monster.Wither)TwosideKeeper.custommonsters.get(id);
wi.runHitEvent(p, dmg);
}
}*/
if (TwosideKeeper.custommonsters.containsKey(v.getUniqueId())) {
Dummy dm = (Dummy)TwosideKeeper.custommonsters.get(v.getUniqueId());
dm.customHitHandler(damage);
}
}
}
private static void applyShrapnel(Player p, LivingEntity target) {
if (ItemSet.hasFullSet(p, ItemSet.SHARD)) {
int shrapnellv = ItemSet.getHighestTierInSet(p, ItemSet.SHARD);
Buff.addBuff(target, "SHRAPNEL", new Buff("Shrapnel",20*10,shrapnellv,Color.RED,ChatColor.RED+"❂",false), true);
}
}
private static void applyWindSlashEffects(Player p, LivingEntity target, double damage, String reason) { private static void applyWindSlashEffects(Player p, LivingEntity target, double damage, String reason) {
if (reason!=null && reason.equalsIgnoreCase("Wind Slash")) { if (reason!=null && reason.equalsIgnoreCase("Wind Slash")) {
GenericFunctions.knockupEntities(0.4d, target); GenericFunctions.knockupEntities(0.4d, target);
@ -1265,7 +1296,7 @@ public class CustomDamage {
} }
} }
private static int GetHeartAmount(double dmg) { public static int GetHeartAmount(double dmg) {
int heartcount = 1; int heartcount = 1;
double dmgamountcopy = dmg; double dmgamountcopy = dmg;
//TwosideKeeper.log("Starting Damage: "+dmgamountcopy, 0); //TwosideKeeper.log("Starting Damage: "+dmgamountcopy, 0);
@ -1332,7 +1363,8 @@ public class CustomDamage {
}*/ }*/
if (TwosideKeeper.custommonsters.containsKey(v.getUniqueId())) { if (TwosideKeeper.custommonsters.containsKey(v.getUniqueId())) {
Dummy dm = (Dummy)TwosideKeeper.custommonsters.get(v.getUniqueId()); Dummy dm = (Dummy)TwosideKeeper.custommonsters.get(v.getUniqueId());
dm.customHitHandler(p, dmg); dm.addPlayerToHitList(p);
//dm.customHitHandler(dmg);
} }
} }
} }
@ -1905,6 +1937,9 @@ public class CustomDamage {
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.DARNYS)/100d); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.DARNYS)/100d);
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.JAMDAK)/100d); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.JAMDAK)/100d);
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.LORASAADI)/100d); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.LORASAADI)/100d);
TwosideKeeper.log("Dodge Chance: "+dodgechance, 0);
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.GetTotalBaseAmount(p, ItemSet.SHARD)/100d);
TwosideKeeper.log("Dodge Chance: "+dodgechance, 0);
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LUCI, 2)) { if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LUCI, 2)) {
dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LUCI, 2, 2)/100d); dodgechance=addMultiplicativeValue(dodgechance,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LUCI, 2, 2)/100d);
} }
@ -2605,6 +2640,9 @@ public class CustomDamage {
SoundUtils.playLocalSound(p, Sound.ENTITY_LIGHTNING_IMPACT, 0.1f, 0.24f); SoundUtils.playLocalSound(p, Sound.ENTITY_LIGHTNING_IMPACT, 0.1f, 0.24f);
} else { } else {
mult+=2.0; mult+=2.0;
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SHARD, 2)) {
mult+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SHARD, 2, 2)/100d;
}
p.sendMessage(ChatColor.DARK_RED+"Headshot! x2 Damage"); p.sendMessage(ChatColor.DARK_RED+"Headshot! x2 Damage");
isheadshot=true; isheadshot=true;
} }
@ -2779,6 +2817,21 @@ public class CustomDamage {
} }
return resist; return resist;
} }
//0.0-1.0. 0% meaning no resistance. 100% meaning full resistance.
public static double getFireResistance(LivingEntity target) {
double resist=0.0d;
resist+=GenericFunctions.getPotionEffectLevel(PotionEffectType.FIRE_RESISTANCE, target)*0.1d;
if (target instanceof Player) {
//Nothing here yet.
} else {
if (target instanceof Blaze ||
target instanceof MagmaCube) {
resist+=0.5d;
}
}
return resist;
}
//Chance is between 0.0-1.0. 1.0 is 100%. //Chance is between 0.0-1.0. 1.0 is 100%.
static boolean isCriticalStrike(double chance) { static boolean isCriticalStrike(double chance) {
@ -2803,6 +2856,9 @@ public class CustomDamage {
} }
critdmg+=API.getPlayerBonuses(p).getBonusCriticalDamage(); critdmg+=API.getPlayerBonuses(p).getBonusCriticalDamage();
critdmg+=ItemSet.GetTotalBaseAmount(p, ItemSet.MOONSHADOW)/100d; critdmg+=ItemSet.GetTotalBaseAmount(p, ItemSet.MOONSHADOW)/100d;
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SHARD, 3)) {
critdmg+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SHARD, 3, 3)/100d;
}
} }
TwosideKeeper.log("Crit Damage is "+critdmg, 5); TwosideKeeper.log("Crit Damage is "+critdmg, 5);
return critdmg; return critdmg;
@ -3403,6 +3459,13 @@ public class CustomDamage {
} }
return damage+(Math.max(p.getFireTicks()/(80*(((TotalFireProtectionLevel(p))/10)+1)),0)); return damage+(Math.max(p.getFireTicks()/(80*(((TotalFireProtectionLevel(p))/10)+1)),0));
} }
//0.0-1.0
public static double calculateDebuffChance(Player p) {
double chance = 0.0d;
chance += ItemSet.GetTotalBaseAmount(p, ItemSet.TOXIN)/100d;
return chance;
}
private static int TotalFireProtectionLevel(Player p) { private static int TotalFireProtectionLevel(Player p) {
ItemStack[] items = GenericFunctions.getArmor(p); ItemStack[] items = GenericFunctions.getArmor(p);

@ -46,7 +46,7 @@ public class CustomMonster {
public void customHitHandler() { public void customHitHandler() {
} }
public void customHitHandler(Player p, double dmg) { public void customHitHandler(double dmg) {
} }
} }

@ -3820,6 +3820,10 @@ public class GenericFunctions {
} }
public static void DealExplosionDamageToEntities(Location l, double basedmg, double range, Entity damager) { public static void DealExplosionDamageToEntities(Location l, double basedmg, double range, Entity damager) {
DealExplosionDamageToEntities(l, basedmg, range, damager, "Explosion");
}
public static void DealExplosionDamageToEntities(Location l, double basedmg, double range, Entity damager, String reason) {
//nearbyentities.addAll(); //nearbyentities.addAll();
final double rangeSquared=range*range; final double rangeSquared=range*range;
for (Entity ent: l.getWorld().getNearbyEntities(l, range, range, range)) { for (Entity ent: l.getWorld().getNearbyEntities(l, range, range, range)) {
@ -3832,7 +3836,7 @@ public class GenericFunctions {
TwosideKeeper.log("dmg mult is "+damage_mult,4); TwosideKeeper.log("dmg mult is "+damage_mult,4);
dmg = basedmg * damage_mult; dmg = basedmg * damage_mult;
if (ent instanceof Player) {TwosideKeeper.log("Damage is "+dmg, 5);} if (ent instanceof Player) {TwosideKeeper.log("Damage is "+dmg, 5);}
CustomDamage.ApplyDamage(dmg, damager, (LivingEntity)ent, null, "Explosion", CustomDamage.NONE); CustomDamage.ApplyDamage(dmg, damager, (LivingEntity)ent, null, reason, CustomDamage.NONE);
//subtractHealth((LivingEntity)nearbyentities.get(i),null,NewCombat.CalculateDamageReduction(dmg, (LivingEntity)nearbyentities.get(i), null)); //subtractHealth((LivingEntity)nearbyentities.get(i),null,NewCombat.CalculateDamageReduction(dmg, (LivingEntity)nearbyentities.get(i), null));
} }
} }
@ -4388,6 +4392,7 @@ public class GenericFunctions {
if (GenericFunctions.isBadEffect(pe.getType())) { if (GenericFunctions.isBadEffect(pe.getType())) {
type=pe.getType(); type=pe.getType();
level=pe.getAmplifier(); level=pe.getAmplifier();
break;
} }
} }
if (Math.random()<=removechance/100) { if (Math.random()<=removechance/100) {
@ -4399,6 +4404,20 @@ public class GenericFunctions {
} }
pd.lasteffectlist.clear(); pd.lasteffectlist.clear();
pd.lasteffectlist.addAll(p.getActivePotionEffects()); pd.lasteffectlist.addAll(p.getActivePotionEffects());
HashMap<String,Buff> buffdata = Buff.getBuffData(p);
if (pd.lastbufflist.size()<buffdata.size()) {
for (String key : buffdata.keySet()) {
Buff b = buffdata.get(key);
if (b.isDebuff()) {
if (Math.random()<=removechance/100 && Buff.buffCanBeRemoved()) {
Buff.removeBuff(p, key);
p.sendMessage(ChatColor.DARK_GRAY+"You successfully resisted the application of "+ChatColor.WHITE+GenericFunctions.CapitalizeFirstLetters(b.getDisplayName().replace("_", " ")));
}
}
}
}
pd.lastbufflist.clear();
pd.lastbufflist.putAll(buffdata);
} }
} }

@ -908,7 +908,7 @@ public enum ItemSet {
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Critical Damage"); lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Critical Damage");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+" Health"); lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+" Health");
lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Shrapnel Bombs"+ABILITY_LABEL_END); lore.add(ChatColor.DARK_AQUA+" 5 - "+ABILITY_LABEL+" Shrapnel Bombs"+ABILITY_LABEL_END);
lore.add(ChatColor.GRAY+" When arrows land or hit a target, they explode"); lore.add(ChatColor.GRAY+" When projectiles land or hit a target, they explode");
lore.add(ChatColor.GRAY+" into shrapnel, dealing damage to all nearby targets"); lore.add(ChatColor.GRAY+" into shrapnel, dealing damage to all nearby targets");
lore.add(ChatColor.GRAY+" and dealing ticks of additional fire damage for 10"); lore.add(ChatColor.GRAY+" and dealing ticks of additional fire damage for 10");
lore.add(ChatColor.GRAY+" seconds. Shrapnel stacks infinitely on a target."); lore.add(ChatColor.GRAY+" seconds. Shrapnel stacks infinitely on a target.");
@ -950,17 +950,17 @@ public enum ItemSet {
break; break;
case TOXIN: case TOXIN:
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:"); lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+"% Chance of applying Bleeding "+WorldShop.toRomanNumeral(tier)+" to target."); lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 2)+"% Chance of projectiles applying Bleeding "+WorldShop.toRomanNumeral(tier)+" to target.");
lore.add(ChatColor.GRAY+" (Bleed deals faster damage over time compared to Poison."); lore.add(ChatColor.GRAY+" (Bleed deals faster damage over time compared to Poison.");
lore.add(ChatColor.GRAY+" it is not affected by Poison Resistance.)"); lore.add(ChatColor.GRAY+" it is not affected by Poison Resistance.)");
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Chance of applying Infection "+WorldShop.toRomanNumeral(tier)+" to target."); lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 3)+"% Chance of projectiles applying Infection "+WorldShop.toRomanNumeral(tier)+" to target.");
lore.add(ChatColor.GRAY+" (Infection deals damage over time and applies all debuffs"); lore.add(ChatColor.GRAY+" (Infection deals damage over time and applies all debuffs");
lore.add(ChatColor.GRAY+" this target has to nearby targets.)"); lore.add(ChatColor.GRAY+" this target has to nearby targets.)");
lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% Chance of applying Cripple "+WorldShop.toRomanNumeral(tier)+" to target."); lore.add(ChatColor.DARK_AQUA+" 4 - "+ChatColor.WHITE+" +"+ItemSet.GetBaseAmount(set, tier, 4)+"% Chance of projectiles applying Cripple "+WorldShop.toRomanNumeral(tier)+" to target.");
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+" by 10% per level.)"); lore.add(ChatColor.GRAY+" 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+" Shooting arrows at the ground converts the land into"); lore.add(ChatColor.GRAY+" Shooting projectiles at the ground converts the land into");
lore.add(ChatColor.GRAY+" a temporary fire pool, applying stacking Burn to all"); lore.add(ChatColor.GRAY+" a temporary fire pool, 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.)");
@ -1098,8 +1098,8 @@ public enum ItemSet {
if (pd.itemsets.containsKey(set.name())) { if (pd.itemsets.containsKey(set.name())) {
HashMap<Integer,Integer> tiermap = pd.itemsets.get(set.name()); HashMap<Integer,Integer> tiermap = pd.itemsets.get(set.name());
for (Integer tier : tiermap.keySet()) { for (Integer tier : tiermap.keySet()) {
if (tiermap.get(tier)>=highest) { if (tier>=highest) {
highest = tiermap.get(tier); highest = tier;
} }
} }
} }

@ -3,6 +3,7 @@ package sig.plugin.TwosideKeeper.HelperStructures;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Color; import org.bukkit.Color;
import org.bukkit.Material; import org.bukkit.Material;
@ -196,7 +197,12 @@ public class Loot {
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(Christmas.getChristmasBox(),5)); aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(Christmas.getChristmasBox(),5));
aPlugin.API.Chests.LOOT_CUSTOM_5.setProbability(0.8); aPlugin.API.Chests.LOOT_CUSTOM_5.setProbability(0.8);
aPlugin.API.Chests.LOOT_CUSTOM_5.printDrops(); aPlugin.API.Chests.LOOT_CUSTOM_5.printDrops();
/*for (Chests loot : Chests.values()) {
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
loot.printDrops();
}, 90);
}*/
//aPlugin.API.Chests..addDrop(new DropItem(TwosideKeeper.HUNTERS_COMPASS.getItemStack(),10)); //aPlugin.API.Chests..addDrop(new DropItem(TwosideKeeper.HUNTERS_COMPASS.getItemStack(),10));
} }

@ -30,6 +30,7 @@ public class LivingEntityStructure {
public HashMap<String,Buff> buffs = new HashMap<String,Buff>(); public HashMap<String,Buff> buffs = new HashMap<String,Buff>();
public long lastpotionparticles=0; public long lastpotionparticles=0;
public long lastPoisonTick=0; public long lastPoisonTick=0;
public long lastShrapnelTick=0;
public LivingEntityStructure(LivingEntity m) { public LivingEntityStructure(LivingEntity m) {
target=null; target=null;

@ -84,18 +84,20 @@ public class Dummy extends CustomMonster{
sb.append(" dmg)"); sb.append(" dmg)");
return sb.toString(); return sb.toString();
} }
public void addPlayerToHitList(Player p) {
if (!playerHitList.contains(p)) {
playerHitList.add(p);
}
}
public void customHitHandler(Player p, double dmg) { public void customHitHandler(double dmg) {
super.customHitHandler(p,dmg); super.customHitHandler(dmg);
if (numbOfHits==0) { if (numbOfHits==0) {
timeStartedHitting=TwosideKeeper.getServerTickTime(); timeStartedHitting=TwosideKeeper.getServerTickTime();
dmgdealt=0; dmgdealt=0;
} }
if (!playerHitList.contains(p)) {
playerHitList.add(p);
}
lastHitTime=TwosideKeeper.getServerTickTime(); lastHitTime=TwosideKeeper.getServerTickTime();
numbOfHits++; numbOfHits++;

@ -110,6 +110,7 @@ public class PlayerStructure {
public int swiftaegisamt=0; public int swiftaegisamt=0;
public PlayerMode lastmode=PlayerMode.NORMAL; public PlayerMode lastmode=PlayerMode.NORMAL;
public List<PotionEffect> lasteffectlist=null; public List<PotionEffect> lasteffectlist=null;
public HashMap<String,Buff> lastbufflist=new HashMap<String,Buff>();
public boolean stealthmode=false; public boolean stealthmode=false;
public long lastcompassnotification=0; public long lastcompassnotification=0;
public boolean endnotification=false; public boolean endnotification=false;
@ -200,6 +201,7 @@ public class PlayerStructure {
public long lastpotionparticles=0; public long lastpotionparticles=0;
public Location restartLoc = null; //Set to a value when the player has to be re-teleported after being controlled by a camera. public Location restartLoc = null; //Set to a value when the player has to be re-teleported after being controlled by a camera.
public long lastPoisonTick=0; public long lastPoisonTick=0;
public long lastShrapnelTick=0;
List<ItemStack> equipmentset = new ArrayList<ItemStack>(); List<ItemStack> equipmentset = new ArrayList<ItemStack>();

@ -3145,6 +3145,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public void onArrowHitBlock(ProjectileHitEvent ev) { public void onArrowHitBlock(ProjectileHitEvent ev) {
if (ev.getEntity() instanceof Arrow) { if (ev.getEntity() instanceof Arrow) {
Arrow a = (Arrow)ev.getEntity(); Arrow a = (Arrow)ev.getEntity();
LivingEntity shooter = CustomDamage.getDamagerEntity(a);
if (shooter!=null && shooter instanceof Player) {
Player p = (Player)shooter;
if (ItemSet.hasFullSet(p, ItemSet.SHARD)) {
GenericFunctions.DealExplosionDamageToEntities(ev.getEntity().getLocation(), 40f+shooter.getHealth()*0.1, 2, shooter, "Shrapnel Explosion");
aPlugin.API.sendSoundlessExplosion(ev.getEntity().getLocation(), 1);
SoundUtils.playGlobalSound(ev.getEntity().getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.6f, 0.5f);
}
}
a.setCustomName("HIT"); a.setCustomName("HIT");
return; return;
} }
@ -5366,6 +5375,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override @Override
public void run() { public void run() {
ItemSet.updateItemSets(player);
setPlayerMaxHealth(player); setPlayerMaxHealth(player);
} }
},1); },1);
@ -5912,7 +5922,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
} }
ItemSet.updateItemSets(player);
} }
public void PerformVacuumCubeChecks(InventoryClickEvent ev) { public void PerformVacuumCubeChecks(InventoryClickEvent ev) {
@ -7441,10 +7450,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
log("Drop list contains "+(droplist.size()+originaldroplist.size())+" elements.",5); log("Drop list contains "+(droplist.size()+originaldroplist.size())+" elements.",5);
log(" Drops "+"["+(drop.size()+originaldroplist.size())+"]: "+ChatColor.GOLD+ChatColor.stripColor(originaldroplist.toString())+ChatColor.WHITE+","+ChatColor.LIGHT_PURPLE+ChatColor.stripColor(drop.toString()),LOOT_DEBUG); log(" Drops "+"["+(drop.size()+originaldroplist.size())+"]: "+ChatColor.GOLD+ChatColor.stripColor(originaldroplist.toString())+ChatColor.WHITE+","+ChatColor.LIGHT_PURPLE+ChatColor.stripColor(drop.toString()),LOOT_DEBUG);
} }
livingentitydata.remove(m.getUniqueId());
chargezombies.remove(m.getUniqueId());
custommonsters.remove(m.getUniqueId());
} }
} }
public void PlaceWitherLootChestsWithDefinedLayout(LivingEntity m, double chance_to_place_reward_chest, public void PlaceWitherLootChestsWithDefinedLayout(LivingEntity m, double chance_to_place_reward_chest,
@ -9711,7 +9716,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DARNYS, 4, 4)+ ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DARNYS, 4, 4)+
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LORASAADI, 4, 4)+ ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LORASAADI, 4, 4)+
ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.JAMDAK, 4, 4);*/ ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.JAMDAK, 4, 4);*/
hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SHARD, 4, 4);
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6)) { if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6)) {
hp+=0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()); hp+=0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand());
} }
@ -10172,6 +10177,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
double debuffresistchance = CustomDamage.CalculateDebuffResistance(p); double debuffresistchance = CustomDamage.CalculateDebuffResistance(p);
if (all || debuffresistchance>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Debuff Resistance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(debuffresistchance)+"%");} if (all || debuffresistchance>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Debuff Resistance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(debuffresistchance)+"%");}
double debuffchance = CustomDamage.calculateDebuffChance(p);
if (all || debuffchance>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Debuff Chance: "+ChatColor.RESET+""+ChatColor.YELLOW+"+"+df.format(debuffchance*100d)+"%");}
double cooldownreduction = CustomDamage.calculateCooldownReduction(p); double cooldownreduction = CustomDamage.calculateCooldownReduction(p);
if (all || cooldownreduction>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Cooldown Reduction: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(cooldownreduction*100)+"%");} if (all || cooldownreduction>0) {receiver.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Cooldown Reduction: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format(cooldownreduction*100)+"%");}
TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: "); TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: ");

@ -346,15 +346,28 @@ final class runServerHeartbeat implements Runnable {
if (ent instanceof Player) { if (ent instanceof Player) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)ent); PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)ent);
if (Buff.hasBuff(ent, "Poison") && pd.lastPoisonTick+getPoisonTickDelay(ent)<=TwosideKeeper.getServerTickTime()) { if (Buff.hasBuff(ent, "Poison") && pd.lastPoisonTick+getPoisonTickDelay(ent)<=TwosideKeeper.getServerTickTime()) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "Poison").getAmplifier(), null, ent, null, "POISON", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG); CustomDamage.ApplyDamage(Buff.getBuff(ent, "Poison").getAmplifier(), null, ent, null, "POISON", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastPoisonTick=TwosideKeeper.getServerTickTime(); pd.lastPoisonTick=TwosideKeeper.getServerTickTime();
} }
if (Buff.hasBuff(ent, "SHRAPNEL") && pd.lastShrapnelTick<=TwosideKeeper.getServerTickTime()) {
CustomDamage.ApplyDamage((Buff.getBuff(ent, "SHRAPNEL").getAmplifier()*2)*(1d-CustomDamage.getFireResistance(ent)), null, ent, null, "Shrapnel", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
pd.lastShrapnelTick=TwosideKeeper.getServerTickTime();
SoundUtils.playLocalSound((Player)ent, Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
ent.getWorld().spawnParticle(Particle.LAVA, ent.getEyeLocation(), CustomDamage.GetHeartAmount(Buff.getBuff(ent, "SHRAPNEL").getAmplifier())*5);
}
} else { } else {
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent); LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent);
if (Buff.hasBuff(ent, "Poison") && les.lastPoisonTick+getPoisonTickDelay(ent)<=TwosideKeeper.getServerTickTime()) { if (Buff.hasBuff(ent, "Poison") && les.lastPoisonTick+getPoisonTickDelay(ent)<=TwosideKeeper.getServerTickTime()) {
CustomDamage.ApplyDamage(Buff.getBuff(ent, "Poison").getAmplifier(), null, ent, null, "POISON", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG); CustomDamage.ApplyDamage(Buff.getBuff(ent, "Poison").getAmplifier(), null, ent, null, "POISON", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
les.lastPoisonTick=TwosideKeeper.getServerTickTime(); les.lastPoisonTick=TwosideKeeper.getServerTickTime();
} }
if (Buff.hasBuff(ent, "SHRAPNEL") && les.lastShrapnelTick<=TwosideKeeper.getServerTickTime()) {
CustomDamage.ApplyDamage((Buff.getBuff(ent, "SHRAPNEL").getAmplifier()*2)*(1d-CustomDamage.getFireResistance(ent)), null, ent, null, "Shrapnel", CustomDamage.IGNOREDODGE|CustomDamage.TRUEDMG|CustomDamage.IGNORE_DAMAGE_TICK);
les.lastShrapnelTick=TwosideKeeper.getServerTickTime();
//SoundUtils.playLocalSound((Player)ent, Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
SoundUtils.playGlobalSound(ent.getLocation(), Sound.ENTITY_GENERIC_EXTINGUISH_FIRE, 1.0f, 1.0f);
ent.getWorld().spawnParticle(Particle.LAVA, ent.getEyeLocation(), CustomDamage.GetHeartAmount(Buff.getBuff(ent, "SHRAPNEL").getAmplifier())*5);
}
} }
} }
@ -916,6 +929,8 @@ final class runServerHeartbeat implements Runnable {
if (!ms.m.isValid() || ms.m instanceof Player) { if (!ms.m.isValid() || ms.m instanceof Player) {
//TwosideKeeper.monsterdata.remove(data); //TwosideKeeper.monsterdata.remove(data);
TwosideKeeper.ScheduleRemoval(TwosideKeeper.livingentitydata, ms); TwosideKeeper.ScheduleRemoval(TwosideKeeper.livingentitydata, ms);
TwosideKeeper.ScheduleRemoval(TwosideKeeper.chargezombies, id);
TwosideKeeper.ScheduleRemoval(TwosideKeeper.custommonsters, id);
TwosideKeeper.ScheduleRemoval(data, id); TwosideKeeper.ScheduleRemoval(data, id);
TwosideKeeper.ScheduleRemoval(TwosideKeeper.habitat_data.startinglocs, id); TwosideKeeper.ScheduleRemoval(TwosideKeeper.habitat_data.startinglocs, id);
ms.m.setCustomName(ms.getOriginalName()); ms.m.setCustomName(ms.getOriginalName());
@ -940,6 +955,7 @@ final class runServerHeartbeat implements Runnable {
PerformPoisonTick(ms.m); PerformPoisonTick(ms.m);
TwosideKeeper.HeartbeatLogger.AddEntry("Monster Management - Perform Poison Tick", (int)(System.nanoTime()-time));time=System.nanoTime(); TwosideKeeper.HeartbeatLogger.AddEntry("Monster Management - Perform Poison Tick", (int)(System.nanoTime()-time));time=System.nanoTime();
} }
} }
} }

Loading…
Cancel
Save