Implemented PRIDE set. Began work on Assassin sword set. Fixed bug with
damage numbers not changing color with different attributes.
This commit is contained in:
parent
91841bba18
commit
ed2f549416
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.13
|
version: 3.10.14
|
||||||
loadbefore: [aPlugin]
|
loadbefore: [aPlugin]
|
||||||
commands:
|
commands:
|
||||||
money:
|
money:
|
||||||
@ -148,11 +148,6 @@ commands:
|
|||||||
usage: /debugreport
|
usage: /debugreport
|
||||||
permission: TwosideKeeper.fulldebugreport
|
permission: TwosideKeeper.fulldebugreport
|
||||||
permission-message: No permissions!
|
permission-message: No permissions!
|
||||||
vac:
|
|
||||||
description: Toggle Vacuum Cube suction
|
|
||||||
usage: /vac
|
|
||||||
permission: TwosideKeeper.money
|
|
||||||
permission-message: No permissions!
|
|
||||||
equip_weapon:
|
equip_weapon:
|
||||||
description: Toggle Automatic Equipping of Weapons
|
description: Toggle Automatic Equipping of Weapons
|
||||||
usage: /equip_weapon
|
usage: /equip_weapon
|
||||||
@ -163,3 +158,18 @@ commands:
|
|||||||
usage: /equip_armor
|
usage: /equip_armor
|
||||||
permission: TwosideKeeper.money
|
permission: TwosideKeeper.money
|
||||||
permission-message: No permissions!
|
permission-message: No permissions!
|
||||||
|
options:
|
||||||
|
description: Displays a menu to toggle plugin-specific options.
|
||||||
|
usage: /options
|
||||||
|
permission: TwosideKeeper.money
|
||||||
|
permission-message: No permissions!
|
||||||
|
settings:
|
||||||
|
description: Displays a menu to toggle plugin-specific options.
|
||||||
|
usage: /settings
|
||||||
|
permission: TwosideKeeper.money
|
||||||
|
permission-message: No permissions!
|
||||||
|
damage_numbers:
|
||||||
|
description: Toggles the damage numbers that display while dealing damage.
|
||||||
|
usage: /damage_numbers
|
||||||
|
permission: TwosideKeeper.money
|
||||||
|
permission-message: No permissions!
|
@ -314,7 +314,7 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
TwosideKeeper.log("Damage: "+dmg+", Armor Pen Damage: "+armorpendmg, 3);
|
TwosideKeeper.log("Damage: "+dmg+", Armor Pen Damage: "+armorpendmg, 3);
|
||||||
|
|
||||||
setupDamagePropertiesForPlayer(damager,((crit)?IS_CRIT:0)|((headshot)?IS_HEADSHOT:0)|((preemptive)?IS_PREEMPTIVE:0));
|
setupDamagePropertiesForPlayer(damager,((crit)?IS_CRIT:0)|((headshot)?IS_HEADSHOT:0)|((preemptive)?IS_PREEMPTIVE:0),true);
|
||||||
dmg = hardCapDamage(dmg+armorpendmg,target,reason);
|
dmg = hardCapDamage(dmg+armorpendmg,target,reason);
|
||||||
return dmg;
|
return dmg;
|
||||||
}
|
}
|
||||||
@ -398,10 +398,10 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static double getDamageFromBarbarianSetBonus(LivingEntity target) {
|
private static double getDamageFromBarbarianSetBonus(LivingEntity target) {
|
||||||
if (target instanceof Player) {
|
/*if (target instanceof Player) {
|
||||||
Player p = (Player)target;
|
Player p = (Player)target;
|
||||||
return (ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER)+1)/3;
|
return (ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER)+1)/3;
|
||||||
}
|
}*/
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -755,11 +755,12 @@ public class CustomDamage {
|
|||||||
applyLightningStriketoFoe(p,target);
|
applyLightningStriketoFoe(p,target);
|
||||||
pd.slayermegahit=false;
|
pd.slayermegahit=false;
|
||||||
pd.lastcombat=TwosideKeeper.getServerTickTime();
|
pd.lastcombat=TwosideKeeper.getServerTickTime();
|
||||||
increaseBarbarianStacks(p,weapon);
|
increaseBarbarianStacks(p,weapon,reason);
|
||||||
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);
|
||||||
createFirePool(p,damager,target,damage,reason);
|
createFirePool(p,damager,target,damage,reason);
|
||||||
|
addSweepupBonus(p,damage,reason);
|
||||||
|
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
||||||
if (isFlagSet(pd.lasthitproperties,IS_CRIT)) {
|
if (isFlagSet(pd.lasthitproperties,IS_CRIT)) {
|
||||||
@ -833,6 +834,15 @@ public class CustomDamage {
|
|||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addSweepupBonus(Player p, double damage, String reason) {
|
||||||
|
if (reason!=null && reason.equalsIgnoreCase("sweep up")) {
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE, 5)) {
|
||||||
|
TwosideKeeper.log("In here. Damage: "+damage, 0);
|
||||||
|
GenericFunctions.HealEntity(p, damage/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void applySustenanceSetonHitEffects(Player p) {
|
private static void applySustenanceSetonHitEffects(Player p) {
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SUSTENANCE, 2)) {
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SUSTENANCE, 2)) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
@ -1252,7 +1262,12 @@ public class CustomDamage {
|
|||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
||||||
if (reason!=null) {
|
if (reason!=null) {
|
||||||
if (reason.equalsIgnoreCase("power swing")) {
|
if (reason.equalsIgnoreCase("power swing")) {
|
||||||
IncreaseLifestealStacks(p,10);
|
double lifestealstack_incramt = 10;
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE, 3)) {
|
||||||
|
lifestealstack_incramt *= 2;
|
||||||
|
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.REGENERATION, 20*15, 9, (int)ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.PRIDE, 3, 3));
|
||||||
|
}
|
||||||
|
IncreaseLifestealStacks(p,(int)lifestealstack_incramt);
|
||||||
pd.weaponcharges-=10;
|
pd.weaponcharges-=10;
|
||||||
//GenericFunctions.sendActionBarMessage(p, "");
|
//GenericFunctions.sendActionBarMessage(p, "");
|
||||||
pd.customtitle.updateSideTitleStats(p);
|
pd.customtitle.updateSideTitleStats(p);
|
||||||
@ -1267,11 +1282,25 @@ public class CustomDamage {
|
|||||||
double xspd=p.getLocation().getDirection().getX();
|
double xspd=p.getLocation().getDirection().getX();
|
||||||
double zspd=p.getLocation().getDirection().getZ();
|
double zspd=p.getLocation().getDirection().getZ();
|
||||||
Location attackloc = p.getLocation().clone();
|
Location attackloc = p.getLocation().clone();
|
||||||
|
boolean appliesPoisonDebuff=false;
|
||||||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE, 4)) {
|
||||||
|
appliesPoisonDebuff=true;
|
||||||
|
}
|
||||||
for (int i=0;i<10;i++) {
|
for (int i=0;i<10;i++) {
|
||||||
attackloc = attackloc.add(xspd,0,zspd);
|
attackloc = attackloc.add(xspd,0,zspd);
|
||||||
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_FIREBALL_EXPLODE, 0.1f, 1.4f);
|
SoundUtils.playGlobalSound(p.getLocation(), Sound.ENTITY_ENDERDRAGON_FIREBALL_EXPLODE, 0.1f, 1.4f);
|
||||||
aPlugin.API.sendSoundlessExplosion(attackloc, 0.6f);
|
aPlugin.API.sendSoundlessExplosion(attackloc, 0.6f);
|
||||||
GenericFunctions.DealDamageToNearbyMobs(attackloc, dmg, 1, true, 0.6, p, weapon, false, "Forceful Strike");
|
List<LivingEntity> ents = GenericFunctions.DealDamageToNearbyMobs(attackloc, dmg, 1, true, 0.6, p, weapon, false, "Forceful Strike");
|
||||||
|
if (appliesPoisonDebuff) {
|
||||||
|
int poisonlv = (int)ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.PRIDE, 4, 4);
|
||||||
|
for (Entity e : ents) {
|
||||||
|
if (e instanceof LivingEntity && !(e instanceof Player)) {
|
||||||
|
//GenericFunctions.logAndApplyPotionEffectToEntity(PotionEffectType.POISON, 20*15, poisonlv-1, (LivingEntity)e);
|
||||||
|
Buff.addBuff((LivingEntity)e, "Poison", new Buff("Poison",20*15,poisonlv,Color.YELLOW,ChatColor.YELLOW+"☣",false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
pd.weaponcharges-=30;
|
pd.weaponcharges-=30;
|
||||||
pd.customtitle.updateSideTitleStats(p);
|
pd.customtitle.updateSideTitleStats(p);
|
||||||
@ -1303,6 +1332,12 @@ public class CustomDamage {
|
|||||||
if (ItemSet.hasFullSet(p, ItemSet.DAWNTRACKER)) {
|
if (ItemSet.hasFullSet(p, ItemSet.DAWNTRACKER)) {
|
||||||
amt*=2;
|
amt*=2;
|
||||||
}
|
}
|
||||||
|
double pct = ItemSet.GetTotalBaseAmount(p, ItemSet.PRIDE)/100d;
|
||||||
|
amt+=(int)(amt*pct);
|
||||||
|
//TwosideKeeper.log("pct is "+pct+". Trying RNG for roll "+(pct%1.0), 0);
|
||||||
|
if (Math.random()<=pct%1.0) {
|
||||||
|
amt+=1;
|
||||||
|
}
|
||||||
pd.lifestealstacks=Math.min(100,pd.lifestealstacks+amt*((pd.rage_time>TwosideKeeper.getServerTickTime())?2:1));
|
pd.lifestealstacks=Math.min(100,pd.lifestealstacks+amt*((pd.rage_time>TwosideKeeper.getServerTickTime())?2:1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1314,7 +1349,9 @@ public class CustomDamage {
|
|||||||
pd.damagepooltime=TwosideKeeper.getServerTickTime();
|
pd.damagepooltime=TwosideKeeper.getServerTickTime();
|
||||||
}
|
}
|
||||||
if (damage>getTransferDamage(p)) {
|
if (damage>getTransferDamage(p)) {
|
||||||
|
if ((damage-getTransferDamage(p))*getDamagePoolMult(p)>0) {
|
||||||
pd.damagepool+=(damage-getTransferDamage(p))*getDamagePoolMult(p);
|
pd.damagepool+=(damage-getTransferDamage(p))*getDamagePoolMult(p);
|
||||||
|
}
|
||||||
return getTransferDamage(p);
|
return getTransferDamage(p);
|
||||||
} else {
|
} else {
|
||||||
//pd.damagepool=0;
|
//pd.damagepool=0;
|
||||||
@ -1331,8 +1368,9 @@ public class CustomDamage {
|
|||||||
return mult;
|
return mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void increaseBarbarianStacks(Player p, ItemStack weapon) {
|
private static void increaseBarbarianStacks(Player p, ItemStack weapon, String reason) {
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN &&
|
||||||
|
(reason==null || !reason.equalsIgnoreCase("forceful strike"))) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (pd.rage_time>TwosideKeeper.getServerTickTime()) {
|
if (pd.rage_time>TwosideKeeper.getServerTickTime()) {
|
||||||
IncreaseLifestealStacks(p,2);
|
IncreaseLifestealStacks(p,2);
|
||||||
@ -1341,7 +1379,9 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
pd.lastattacked=TwosideKeeper.getServerTickTime();
|
pd.lastattacked=TwosideKeeper.getServerTickTime();
|
||||||
if (p.getEquipment().getItemInMainHand().equals(weapon)) {
|
if (p.getEquipment().getItemInMainHand().equals(weapon)) {
|
||||||
IncreaseWeaponCharges(p,1);
|
double charge_amt = 1;
|
||||||
|
charge_amt += ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.PRIDE, 2, 2)/2;
|
||||||
|
IncreaseWeaponCharges(p,(int)charge_amt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2720,11 +2760,11 @@ public class CustomDamage {
|
|||||||
dmg += ItemSet.TotalBaseAmountBasedOnSetBonusCount((Player)shooter, ItemSet.OLIVE, 3, 3);
|
dmg += ItemSet.TotalBaseAmountBasedOnSetBonusCount((Player)shooter, ItemSet.OLIVE, 3, 3);
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount((Player)shooter, ItemSet.PANROS, 5) ||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount((Player)shooter, ItemSet.PANROS, 5) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount((Player)shooter, ItemSet.DAWNTRACKER, 5) ||
|
ItemSet.HasSetBonusBasedOnSetBonusCount((Player)shooter, ItemSet.DAWNTRACKER, 5) ||
|
||||||
(ItemSet.meetsLorasysSwordConditions(9, 1, (Player)shooter)) ||
|
(ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 9, 1, (Player)shooter)) ||
|
||||||
GenericFunctions.HasFullRangerSet((Player)shooter)) {
|
GenericFunctions.HasFullRangerSet((Player)shooter)) {
|
||||||
dmg += 15;
|
dmg += 15;
|
||||||
}
|
}
|
||||||
if (ItemSet.meetsLorasysSwordConditions(40, 4, (Player)shooter)) {
|
if (ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 40, 4, (Player)shooter)) {
|
||||||
dmg += 55;
|
dmg += 55;
|
||||||
}
|
}
|
||||||
dmg += ItemSet.GetTotalBaseAmount((Player)shooter, ItemSet.WINDRY);
|
dmg += ItemSet.GetTotalBaseAmount((Player)shooter, ItemSet.WINDRY);
|
||||||
@ -3166,7 +3206,7 @@ public class CustomDamage {
|
|||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 5)) {
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 5)) {
|
||||||
finaldmg += dmg*0.5;
|
finaldmg += dmg*0.5;
|
||||||
} else
|
} else
|
||||||
if (ItemSet.meetsLorasysSwordConditions(9, 1, p)) {
|
if (ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 9, 1, p)) {
|
||||||
finaldmg += dmg*0.5;
|
finaldmg += dmg*0.5;
|
||||||
}
|
}
|
||||||
finaldmg += dmg*aPlugin.API.getPlayerBonuses(p).getBonusArmorPenetration();
|
finaldmg += dmg*aPlugin.API.getPlayerBonuses(p).getBonusArmorPenetration();
|
||||||
@ -3379,7 +3419,7 @@ public class CustomDamage {
|
|||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) ||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) ||
|
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) {
|
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) {
|
||||||
lifestealpct+=0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand());
|
lifestealpct+=0.1d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand());
|
||||||
}
|
}
|
||||||
lifestealpct+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LEGION, 2, 2)/100d;
|
lifestealpct+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.LEGION, 2, 2)/100d;
|
||||||
if (reason!=null && reason.equalsIgnoreCase("sweep up")) {
|
if (reason!=null && reason.equalsIgnoreCase("sweep up")) {
|
||||||
@ -3404,10 +3444,18 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void setupDamagePropertiesForPlayer(Entity damager, int i) {
|
private static void setupDamagePropertiesForPlayer(Entity damager, int i) {
|
||||||
|
setupDamagePropertiesForPlayer(damager,i,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setupDamagePropertiesForPlayer(Entity damager, int i, boolean overwrite) {
|
||||||
if (getDamagerEntity(damager) instanceof Player) {
|
if (getDamagerEntity(damager) instanceof Player) {
|
||||||
Player pl = (Player)getDamagerEntity(damager);
|
Player pl = (Player)getDamagerEntity(damager);
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(pl);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(pl);
|
||||||
|
if (overwrite) {
|
||||||
pd.lasthitproperties = i;
|
pd.lasthitproperties = i;
|
||||||
|
} else {
|
||||||
|
pd.lasthitproperties |= i;
|
||||||
|
}
|
||||||
TwosideKeeper.log("Flag properties set to "+pd.lasthitproperties,5);
|
TwosideKeeper.log("Flag properties set to "+pd.lasthitproperties,5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3522,9 +3570,10 @@ public class CustomDamage {
|
|||||||
double cooldown = 0.0;
|
double cooldown = 0.0;
|
||||||
cooldown=addMultiplicativeValue(cooldown,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.GLADOMAIN, 2, 2)/100d);
|
cooldown=addMultiplicativeValue(cooldown,ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.GLADOMAIN, 2, 2)/100d);
|
||||||
cooldown=addMultiplicativeValue(cooldown,ItemSet.GetTotalBaseAmount(p, ItemSet.VIXEN)/100d);
|
cooldown=addMultiplicativeValue(cooldown,ItemSet.GetTotalBaseAmount(p, ItemSet.VIXEN)/100d);
|
||||||
if (ItemSet.meetsLorasysSwordConditions(40, 4, p)) {
|
if (ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 40, 4, p)) {
|
||||||
cooldown = addMultiplicativeValue(cooldown,0.45d);
|
cooldown = addMultiplicativeValue(cooldown,0.45d);
|
||||||
}
|
}
|
||||||
|
cooldown=addMultiplicativeValue(cooldown,ItemSet.GetTotalBaseAmount(p, ItemSet.ASSASSIN)/100d);
|
||||||
return cooldown;
|
return cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3630,7 +3679,8 @@ public class CustomDamage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int GetDamageReductionFromDawntrackerPieces(Player p) {
|
public static int GetDamageReductionFromDawntrackerPieces(Player p) {
|
||||||
return (ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER))/3;
|
//return (ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER))/3;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double increaseDamageDealtByFireTicks(Player p, double damage, String reason) {
|
private static double increaseDamageDealtByFireTicks(Player p, double damage, String reason) {
|
||||||
|
@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
|||||||
import sig.plugin.TwosideKeeper.PlayerStructure;
|
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.DebugUtils;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Utils.PlayerUtils;
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.PlayerUtils;
|
||||||
|
|
||||||
public class AdvancedTitle {
|
public class AdvancedTitle {
|
||||||
@ -113,6 +114,7 @@ public class AdvancedTitle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateSideTitleStats(Player p) {
|
public void updateSideTitleStats(Player p) {
|
||||||
|
//DebugUtils.showStackTrace();
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.BARBARIAN) {
|
||||||
modifyLargeLeftTitle(ChatColor.DARK_AQUA+"☤"+Integer.toString((int)pd.weaponcharges),100);
|
modifyLargeLeftTitle(ChatColor.DARK_AQUA+"☤"+Integer.toString((int)pd.weaponcharges),100);
|
||||||
|
@ -7,6 +7,7 @@ import java.io.PrintWriter;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ import org.bukkit.Chunk;
|
|||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.attribute.Attribute;
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -3990,13 +3992,15 @@ public class GenericFunctions {
|
|||||||
/**
|
/**
|
||||||
* Use this to customize dealing damage to nearby mobs.
|
* Use this to customize dealing damage to nearby mobs.
|
||||||
*/
|
*/
|
||||||
public static void DealDamageToNearbyMobs(Location l, double basedmg, double range, boolean knockup, double knockupamt, Entity damager, ItemStack weapon, boolean isLineDrive, String reason) {
|
public static List<LivingEntity> DealDamageToNearbyMobs(Location l, double basedmg, double range, boolean knockup, double knockupamt, Entity damager, ItemStack weapon, boolean isLineDrive, String reason) {
|
||||||
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
|
Collection<Entity> ents = l.getWorld().getNearbyEntities(l, range, range, range);
|
||||||
|
List<LivingEntity> affectedents = new ArrayList<LivingEntity>();
|
||||||
//We cleared the non-living entities, deal damage to the rest.
|
//We cleared the non-living entities, deal damage to the rest.
|
||||||
double origdmg = basedmg;
|
double origdmg = basedmg;
|
||||||
for (Entity e : ents) {
|
for (Entity e : ents) {
|
||||||
if (e instanceof LivingEntity && !(e instanceof Player) && !e.equals(damager)) {
|
if (e instanceof LivingEntity && !(e instanceof Player) && !e.equals(damager)) {
|
||||||
LivingEntity m = (LivingEntity)e;
|
LivingEntity m = (LivingEntity)e;
|
||||||
|
affectedents.add(m);
|
||||||
if (enoughTicksHavePassed(m,(Player)damager)) {
|
if (enoughTicksHavePassed(m,(Player)damager)) {
|
||||||
basedmg=origdmg;
|
basedmg=origdmg;
|
||||||
boolean isForcefulStrike = (reason!=null && reason.equalsIgnoreCase("forceful strike"));
|
boolean isForcefulStrike = (reason!=null && reason.equalsIgnoreCase("forceful strike"));
|
||||||
@ -4036,6 +4040,7 @@ public class GenericFunctions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return affectedents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetRemainingCooldownTime(Player p, long current_cooldown, int cooldown_time) {
|
public static int GetRemainingCooldownTime(Player p, long current_cooldown, int cooldown_time) {
|
||||||
@ -4650,6 +4655,61 @@ public class GenericFunctions {
|
|||||||
aPlugin.API.sendCooldownPacket(player, name, 40);
|
aPlugin.API.sendCooldownPacket(player, name, 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (ItemSet.meetsSlayerSwordConditions(ItemSet.ASSASSIN, 9, 1, player)) {
|
||||||
|
Set<Material> set = new HashSet<Material>();
|
||||||
|
set.add(Material.AIR);
|
||||||
|
set.add(Material.LAVA);
|
||||||
|
set.add(Material.STATIONARY_LAVA);
|
||||||
|
set.add(Material.WATER);
|
||||||
|
set.add(Material.STATIONARY_WATER);
|
||||||
|
Block b = player.getTargetBlock(set, 100);
|
||||||
|
if (b!=null && b.getType()!=Material.AIR) {
|
||||||
|
SoundUtils.playGlobalSound(player.getLocation(), Sound.BLOCK_NOTE_BASS, 1.0f, 1.0f);
|
||||||
|
Vector dir = player.getLocation().getDirection();
|
||||||
|
//player.teleport();
|
||||||
|
Location blockcenter = b.getLocation().add(0.5,0.5,0.5);
|
||||||
|
//-Z : North
|
||||||
|
//+X : East
|
||||||
|
//+Z : South
|
||||||
|
//-X : West
|
||||||
|
double xincr=0;
|
||||||
|
double yincr=0;
|
||||||
|
double zincr=0;
|
||||||
|
Location teleportloc = null;
|
||||||
|
if (player.getLocation().getX()<blockcenter.getX()) {
|
||||||
|
//WEST.
|
||||||
|
teleportloc = b.getRelative(BlockFace.WEST).getLocation();
|
||||||
|
if (player.getLocation().getZ()<blockcenter.getZ()) {
|
||||||
|
teleportloc = b.getRelative(BlockFace.NORTH_WEST).getLocation();
|
||||||
|
teleportloc = CalculateBlockHeightLoc(player, blockcenter, teleportloc);
|
||||||
|
} else {
|
||||||
|
teleportloc = b.getRelative(BlockFace.SOUTH_WEST).getLocation();
|
||||||
|
teleportloc = CalculateBlockHeightLoc(player, blockcenter, teleportloc);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//EAST.
|
||||||
|
teleportloc = b.getRelative(BlockFace.EAST).getLocation();
|
||||||
|
if (player.getLocation().getZ()<blockcenter.getZ()) {
|
||||||
|
teleportloc = b.getRelative(BlockFace.NORTH_EAST).getLocation();
|
||||||
|
teleportloc = CalculateBlockHeightLoc(player, blockcenter, teleportloc);
|
||||||
|
} else {
|
||||||
|
teleportloc = b.getRelative(BlockFace.SOUTH_EAST).getLocation();
|
||||||
|
teleportloc = CalculateBlockHeightLoc(player, blockcenter, teleportloc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
teleportloc.add(0.5,0,0.5);
|
||||||
|
blockcenter.getWorld().spawnParticle(Particle.NOTE, teleportloc, 5);
|
||||||
|
teleportloc.setDirection(dir);
|
||||||
|
player.teleport(teleportloc);
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(player);
|
||||||
|
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, (int)(GetModifiedCooldown((TwosideKeeper.ASSASSINATE_COOLDOWN),player)*0.3));
|
||||||
|
}
|
||||||
|
pd.lastassassinatetime=TwosideKeeper.getServerTickTime()-(int)(GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,player)*0.7);
|
||||||
|
//TwosideKeeper.log("Tick Time: "+TwosideKeeper.getServerTickTime()+". New Assassinate Time: "+pd.lastassassinatetime+".", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*LivingEntity target = aPlugin.API.getTargetEntity(player, 100);
|
/*LivingEntity target = aPlugin.API.getTargetEntity(player, 100);
|
||||||
if (target!=null && !target.isDead()) {
|
if (target!=null && !target.isDead()) {
|
||||||
@ -4731,6 +4791,15 @@ public class GenericFunctions {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Location CalculateBlockHeightLoc(Player player, Location blockcenter, Location teleportloc) {
|
||||||
|
if (player.getEyeLocation().getY()<blockcenter.getY()) {
|
||||||
|
teleportloc = teleportloc.getBlock().getRelative(BlockFace.DOWN).getLocation();
|
||||||
|
} else {
|
||||||
|
teleportloc = teleportloc.getBlock().getRelative(BlockFace.UP).getLocation();
|
||||||
|
}
|
||||||
|
return teleportloc;
|
||||||
|
}
|
||||||
|
|
||||||
public static void DamageRandomTool(Player p) {
|
public static void DamageRandomTool(Player p) {
|
||||||
if (ItemSet.GetSetCount(ItemSet.LORASYS, p)>=1 &&
|
if (ItemSet.GetSetCount(ItemSet.LORASYS, p)>=1 &&
|
||||||
ItemSet.GetBaubleTier(p)>=27 && ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())>=3) {
|
ItemSet.GetBaubleTier(p)>=27 && ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())>=3) {
|
||||||
|
@ -24,7 +24,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Utils.TextUtils;
|
|||||||
public enum ItemSet {
|
public enum ItemSet {
|
||||||
PANROS(1,1, 6,4, 10,10, 20,10),
|
PANROS(1,1, 6,4, 10,10, 20,10),
|
||||||
SONGSTEEL(4,2, 6,2, 8,8, 20,10),
|
SONGSTEEL(4,2, 6,2, 8,8, 20,10),
|
||||||
DAWNTRACKER(3,1, 20,10, 10,5, 10,5),
|
DAWNTRACKER(2,2, 20,10, 10,5, 10,5),
|
||||||
LORASYS(2,2, 0,0, 0,0, 0,0),
|
LORASYS(2,2, 0,0, 0,0, 0,0),
|
||||||
JAMDAK(3,3, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks.
|
JAMDAK(3,3, 5,1, 10,1, 10,2), //Graceful Dodge is in ticks.
|
||||||
DARNYS(2,1, 10,5, 20,5, 1,1),
|
DARNYS(2,1, 10,5, 20,5, 1,1),
|
||||||
@ -368,7 +368,7 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Dawntracker Set");
|
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Dawntracker Set");
|
||||||
if (((ItemSet.GetBaseAmount(set, tier, 1))/3)>0) {
|
if (((ItemSet.GetBaseAmount(set, tier, 1))/3)>0) {
|
||||||
lore.add(ChatColor.YELLOW+"-"+((ItemSet.GetBaseAmount(set, tier, 1)+1)/3)+" Damage taken per hit");
|
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+" Health");
|
||||||
}
|
}
|
||||||
}break;
|
}break;
|
||||||
case LORASYS:{
|
case LORASYS:{
|
||||||
@ -505,7 +505,7 @@ public enum ItemSet {
|
|||||||
case PRIDE:
|
case PRIDE:
|
||||||
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
lore.add(ChatColor.LIGHT_PURPLE+"Barbarian Gear");
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Pride Set");
|
lore.add(ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+" Pride Set");
|
||||||
lore.add(ChatColor.YELLOW+"-"+ItemSet.GetBaseAmount(set, tier, 1)+"% Lifesteal Stacks");
|
lore.add(ChatColor.YELLOW+"+"+ItemSet.GetBaseAmount(set, tier, 1)+"% Lifesteal Stacks");
|
||||||
break;
|
break;
|
||||||
case PROTECTOR:
|
case PROTECTOR:
|
||||||
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
|
lore.add(ChatColor.LIGHT_PURPLE+"Defender Gear");
|
||||||
@ -579,9 +579,9 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.GRAY+" All Lifesteal Stacks and Weapon Charges");
|
lore.add(ChatColor.GRAY+" All Lifesteal Stacks and Weapon Charges");
|
||||||
lore.add(ChatColor.GRAY+" gained are doubled.");
|
lore.add(ChatColor.GRAY+" gained are doubled.");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Lifesteal");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Lifesteal");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Health Regeneration");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Health Regeneration");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Maximum Health");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Maximum Health");
|
||||||
}break;
|
}break;
|
||||||
case LORASYS:{
|
case LORASYS:{
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Increases in power based on "+ChatColor.BOLD+"Total Tier Amount");
|
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Increases in power based on "+ChatColor.BOLD+"Total Tier Amount");
|
||||||
@ -856,9 +856,9 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.GRAY+" ");
|
lore.add(ChatColor.GRAY+" ");
|
||||||
lore.add(ChatColor.GRAY+" (120s Cooldown)");
|
lore.add(ChatColor.GRAY+" (120s Cooldown)");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Lifesteal");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Lifesteal");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Health Regeneration");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Health Regeneration");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Maximum Health");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Maximum Health");
|
||||||
break;
|
break;
|
||||||
case LUCI:
|
case LUCI:
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+"Set Bonus:");
|
||||||
@ -878,7 +878,7 @@ public enum ItemSet {
|
|||||||
break;
|
break;
|
||||||
case PRIDE:
|
case PRIDE:
|
||||||
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)+" Weapon Charges per hit");
|
lore.add(ChatColor.DARK_AQUA+" 2 - "+ChatColor.WHITE+" +"+(ItemSet.GetBaseAmount(set, tier, 2)/2)+" Weapon Charges when left-clicking.");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" "+ABILITY_LABEL+"Power Swing"+ABILITY_LABEL_END+" (Right-Click) provides double");
|
lore.add(ChatColor.DARK_AQUA+" 3 - "+ChatColor.WHITE+" "+ABILITY_LABEL+"Power Swing"+ABILITY_LABEL_END+" (Right-Click) provides double");
|
||||||
lore.add(" "+ChatColor.WHITE+" the lifesteal stacks and increases Regeneration");
|
lore.add(" "+ChatColor.WHITE+" the lifesteal stacks and increases Regeneration");
|
||||||
lore.add(" "+ChatColor.WHITE+" level by "+ItemSet.GetBaseAmount(set, tier, 3)+" for 15 seconds. (Max. 10 Levels)");
|
lore.add(" "+ChatColor.WHITE+" level by "+ItemSet.GetBaseAmount(set, tier, 3)+" for 15 seconds. (Max. 10 Levels)");
|
||||||
@ -887,9 +887,9 @@ public enum ItemSet {
|
|||||||
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" "+ABILITY_LABEL+"Sweep Up"+ABILITY_LABEL_END+" (Shift+Right-Click) heals");
|
lore.add(ChatColor.DARK_AQUA+" 5 - "+ChatColor.WHITE+" "+ABILITY_LABEL+"Sweep Up"+ABILITY_LABEL_END+" (Shift+Right-Click) heals");
|
||||||
lore.add(" "+ChatColor.WHITE+" half the health it deals as HP directly.");
|
lore.add(" "+ChatColor.WHITE+" half the health it deals as HP directly.");
|
||||||
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
lore.add(ChatColor.DARK_AQUA+" 6 - "+ChatColor.WHITE+"");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Lifesteal");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Lifesteal");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Health Regeneration");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Health Regeneration");
|
||||||
lore.add(ChatColor.WHITE+" +"+(tier*25)+"% Maximum Health");
|
lore.add(ChatColor.WHITE+" +"+(tier*10)+"% Maximum Health");
|
||||||
break;
|
break;
|
||||||
case PROTECTOR:
|
case PROTECTOR:
|
||||||
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+PlayerMode.SLAYER.getColor()+PlayerMode.SLAYER.getName()+"s"+ChatColor.GOLD+" do not benefit from party effects");
|
lore.add(ChatColor.GOLD+""+ChatColor.ITALIC+PlayerMode.SLAYER.getColor()+PlayerMode.SLAYER.getName()+"s"+ChatColor.GOLD+" do not benefit from party effects");
|
||||||
@ -1091,9 +1091,9 @@ public enum ItemSet {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean meetsLorasysSwordConditions(int baubletier, int swordtier, Player p) {
|
public static boolean meetsSlayerSwordConditions(ItemSet set, int baubletier, int swordtier, Player p) {
|
||||||
//TwosideKeeper.log("["+baubletier+"||"+swordtier+"] Is a Lorasys Set? "+ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LORASYS, 1)+";;Bauble Tier: "+(ItemSet.GetBaubleTier(p))+"/"+baubletier+";;Meets Sword Requirement? "+((swordtier==1 || ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())>=swordtier)), 0);
|
//TwosideKeeper.log("["+baubletier+"||"+swordtier+"] Is a Lorasys Set? "+ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LORASYS, 1)+";;Bauble Tier: "+(ItemSet.GetBaubleTier(p))+"/"+baubletier+";;Meets Sword Requirement? "+((swordtier==1 || ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())>=swordtier)), 0);
|
||||||
return ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LORASYS, 1) && ItemSet.GetBaubleTier(p)>=baubletier && (swordtier==1 || ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())>=swordtier);
|
return ItemSet.HasSetBonusBasedOnSetBonusCount(p, set, 1) && ItemSet.GetBaubleTier(p)>=baubletier && (swordtier==1 || ItemSet.GetItemTier(p.getEquipment().getItemInMainHand())>=swordtier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getHighestTierInSet(Player p, ItemSet set) {
|
public static int getHighestTierInSet(Player p, ItemSet set) {
|
||||||
|
221
src/sig/plugin/TwosideKeeper/HelperStructures/OptionsMenu.java
Normal file
221
src/sig/plugin/TwosideKeeper/HelperStructures/OptionsMenu.java
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
import org.bukkit.inventory.ItemFlag;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.material.MaterialData;
|
||||||
|
|
||||||
|
import sig.plugin.TwosideKeeper.PlayerStructure;
|
||||||
|
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
|
||||||
|
|
||||||
|
public class OptionsMenu {
|
||||||
|
Player p;
|
||||||
|
Inventory inv;
|
||||||
|
List<Option> options;
|
||||||
|
|
||||||
|
final int NUMBER_OF_ROWS = (OptionName.values().length/3)+(((OptionName.values().length%3)!=0)?1:0);
|
||||||
|
|
||||||
|
public OptionsMenu(Player p) {
|
||||||
|
this.p=p;
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
pd.optionsmenu=this;
|
||||||
|
inv = Bukkit.createInventory(p, NUMBER_OF_ROWS*9, ChatColor.BLUE+"Options Menu");
|
||||||
|
this.options = new ArrayList<Option>();
|
||||||
|
|
||||||
|
PopulateInterface(p);
|
||||||
|
|
||||||
|
//inv.setItem(arg0, arg1);
|
||||||
|
|
||||||
|
p.openInventory(inv);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PopulateInterface(Player p) {
|
||||||
|
for (int i=0;i<OptionName.values().length;i++) {
|
||||||
|
Option o = new Option(OptionName.values()[i],i*3,(i*3)+1);
|
||||||
|
ItemStack it = o.getOption().getMaterialData().toItemStack();
|
||||||
|
SetupDescriptions(o, it);
|
||||||
|
ItemStack it2 = new ItemStack(o.getTorchIcon(p));
|
||||||
|
it2.setAmount(0);
|
||||||
|
SetupDescriptions(o, it2);
|
||||||
|
//TwosideKeeper.log(o+";;"+it+";;"+it2, 0);
|
||||||
|
|
||||||
|
inv.setItem(o.getPositions()[0], it);
|
||||||
|
inv.setItem(o.getPositions()[1], it2);
|
||||||
|
options.add(o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupDescriptions(Option o, ItemStack it) {
|
||||||
|
ItemUtils.setDisplayName(it, o.getOption().getTitle());
|
||||||
|
ItemUtils.addLore(it, o.getOption().getDescription());
|
||||||
|
ItemUtils.addFlag(it, ItemFlag.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean runOptionsMenuClick(InventoryClickEvent ev) {
|
||||||
|
InventoryHolder holder = ev.getInventory().getHolder();
|
||||||
|
if (holder!=null && holder instanceof Player) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)holder);
|
||||||
|
if (pd.optionsmenu!=null) {
|
||||||
|
if (ev.getClickedInventory().equals(pd.optionsmenu.getInventory())) {
|
||||||
|
pd.optionsmenu.checkForClick(ev.getSlot());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkForClick(int slot) {
|
||||||
|
for (Option o : options) {
|
||||||
|
for (Integer i : o.getPositions()) {
|
||||||
|
if (i==slot) {
|
||||||
|
boolean val = o.getOption().isOptionEnabled(p, true);
|
||||||
|
doExtraThings(o.getOption());
|
||||||
|
p.sendMessage(o.getOption().getTitle()+" is now turned "+(val?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
||||||
|
PopulateInterface(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void doExtraThings(OptionName o) {
|
||||||
|
if (o==OptionName.DPS && !o.isOptionEnabled(p, false)) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
p.sendMessage(pd.damagedata.OutputResults());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Inventory getInventory() {
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Option{
|
||||||
|
int iconpos;
|
||||||
|
int torchpos;
|
||||||
|
OptionName option;
|
||||||
|
|
||||||
|
Option(OptionName option, int iconslot, int torchslot) {
|
||||||
|
this.option=option;
|
||||||
|
this.iconpos=iconslot;
|
||||||
|
this.torchpos=torchslot;
|
||||||
|
}
|
||||||
|
|
||||||
|
OptionName getOption() {
|
||||||
|
return option;
|
||||||
|
}
|
||||||
|
int[] getPositions() {
|
||||||
|
return new int[]{iconpos,torchpos};
|
||||||
|
}
|
||||||
|
Material getTorchIcon(Player p) {
|
||||||
|
return (getOption().isOptionEnabled(p,false)?Material.SLIME_BALL:Material.FIREBALL);
|
||||||
|
}
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Option(option=");
|
||||||
|
sb.append(option);
|
||||||
|
sb.append(",iconpos=");
|
||||||
|
sb.append(iconpos);
|
||||||
|
sb.append(",torchpos=");
|
||||||
|
sb.append(torchpos);
|
||||||
|
sb.append(")");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum OptionName{
|
||||||
|
DPSDISPLAY("Damage Number Display",ChatColor.GRAY+"Toggles the display of Damage Numbers on/off.",Material.SKULL_ITEM,(byte)0),
|
||||||
|
DPS("DPS Tracking",ChatColor.GRAY+"Toggles the tracking of damage stats on/off.\nTurning it off reports the last damage session breakdown.",Material.WRITTEN_BOOK,(byte)0),
|
||||||
|
HEALTHBARDISPLAY("Healthbar Display",ChatColor.GRAY+"Toggles the healthbar near the player's cursor\nwhen attacking or getting hit by mobs.",Material.BED,(byte)0),
|
||||||
|
AUTOEQUIPARMOR("Auto-Equip Armor",ChatColor.GRAY+"Toggles automatically equipping appropriate armor.",Material.LEATHER_CHESTPLATE,(byte)0),
|
||||||
|
AUTOEQUIPWEAPON("Auto-Equip Weapon",ChatColor.GRAY+"Toggles automatically equipping appropriate weapons.",Material.IRON_SWORD,(byte)0),
|
||||||
|
SOUNDS("Login/Logout Sounds",ChatColor.GRAY+"Toggles the playing of login/logout sound\nnotifications as well as message sound notifications.",Material.RECORD_7,(byte)0);
|
||||||
|
|
||||||
|
String title;
|
||||||
|
String description;
|
||||||
|
MaterialData data;
|
||||||
|
|
||||||
|
OptionName(String title, String desc, Material icon, byte data) {
|
||||||
|
this.data = new MaterialData(icon,data);
|
||||||
|
this.title=title;
|
||||||
|
this.description=desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialData getMaterialData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isOptionEnabled(Player p, boolean toggle) {
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
switch (this) {
|
||||||
|
case DPSDISPLAY:{
|
||||||
|
if (toggle) {
|
||||||
|
pd.damagenumbers=!pd.damagenumbers;
|
||||||
|
}
|
||||||
|
return pd.damagenumbers;
|
||||||
|
}
|
||||||
|
case DPS:{
|
||||||
|
if (toggle) {
|
||||||
|
pd.damagelogging=!pd.damagelogging;
|
||||||
|
}
|
||||||
|
return pd.damagelogging;
|
||||||
|
}
|
||||||
|
case AUTOEQUIPARMOR:{
|
||||||
|
if (toggle) {
|
||||||
|
pd.equiparmor=!pd.equiparmor;
|
||||||
|
}
|
||||||
|
return pd.equiparmor;
|
||||||
|
}
|
||||||
|
case AUTOEQUIPWEAPON:{
|
||||||
|
if (toggle) {
|
||||||
|
pd.equipweapons=!pd.equipweapons;
|
||||||
|
}
|
||||||
|
return pd.equipweapons;
|
||||||
|
}
|
||||||
|
case SOUNDS:{
|
||||||
|
if (toggle) {
|
||||||
|
pd.sounds_enabled=!pd.sounds_enabled;
|
||||||
|
}
|
||||||
|
return pd.sounds_enabled;
|
||||||
|
}
|
||||||
|
case HEALTHBARDISPLAY:{
|
||||||
|
if (toggle) {
|
||||||
|
pd.healthbardisplay=!pd.healthbardisplay;
|
||||||
|
}
|
||||||
|
return pd.healthbardisplay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TwosideKeeper.log("WARNING! Value for Option "+title+" does not exist!", 1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("OptionName(title=");
|
||||||
|
sb.append(title);
|
||||||
|
sb.append(",description=");
|
||||||
|
sb.append(description);
|
||||||
|
sb.append(",data=");
|
||||||
|
sb.append(data);
|
||||||
|
sb.append(")");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -44,6 +44,18 @@ public class ItemUtils {
|
|||||||
item.setItemMeta(m);
|
item.setItemMeta(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void addFlag(ItemStack item, ItemFlag...flags) {
|
||||||
|
ItemMeta m = item.getItemMeta();
|
||||||
|
m.addItemFlags(flags);
|
||||||
|
item.setItemMeta(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeFlag(ItemStack item, ItemFlag...flags) {
|
||||||
|
ItemMeta m = item.getItemMeta();
|
||||||
|
m.removeItemFlags(flags);
|
||||||
|
item.setItemMeta(m);
|
||||||
|
}
|
||||||
|
|
||||||
public static void setDisplayName(ItemStack item, String name) {
|
public static void setDisplayName(ItemStack item, String name) {
|
||||||
ItemMeta m = item.getItemMeta();
|
ItemMeta m = item.getItemMeta();
|
||||||
m.setDisplayName(name);
|
m.setDisplayName(name);
|
||||||
|
@ -9,7 +9,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
|||||||
public class PlayerUtils {
|
public class PlayerUtils {
|
||||||
public static boolean PlayerIsInCombat(Player p) {
|
public static boolean PlayerIsInCombat(Player p) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
return (pd.lastattack+250<=TwosideKeeper.getServerTickTime() || (pd.target!=null && pd.target.isValid() && !pd.target.isDead() && pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())<256));
|
return (pd.lastattack+100>TwosideKeeper.getServerTickTime() || (pd.target!=null && pd.target.isValid() && !pd.target.isDead() && pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())<256));
|
||||||
}
|
}
|
||||||
public static boolean cooldownAvailable(long basetimer, int cooldown, Player p) {
|
public static boolean cooldownAvailable(long basetimer, int cooldown, Player p) {
|
||||||
return (basetimer+GenericFunctions.GetModifiedCooldown(cooldown, p)<=TwosideKeeper.getServerTickTime());
|
return (basetimer+GenericFunctions.GetModifiedCooldown(cooldown, p)<=TwosideKeeper.getServerTickTime());
|
||||||
|
@ -28,6 +28,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.BowMode;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
import sig.plugin.TwosideKeeper.HelperStructures.Channel;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.FilterCubeItem;
|
import sig.plugin.TwosideKeeper.HelperStructures.FilterCubeItem;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.OptionsMenu;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
|
import sig.plugin.TwosideKeeper.HelperStructures.ServerType;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions;
|
||||||
@ -158,6 +159,7 @@ public class PlayerStructure {
|
|||||||
public AdvancedTitle customtitle;
|
public AdvancedTitle customtitle;
|
||||||
public long lastattack = TwosideKeeper.getServerTickTime();
|
public long lastattack = TwosideKeeper.getServerTickTime();
|
||||||
public boolean lastHitWasThorns=false;
|
public boolean lastHitWasThorns=false;
|
||||||
|
public boolean healthbardisplay=true;
|
||||||
|
|
||||||
public long iframetime = 0;
|
public long iframetime = 0;
|
||||||
|
|
||||||
@ -225,6 +227,8 @@ public class PlayerStructure {
|
|||||||
public List<UUID> ignoreItemsList = new ArrayList<UUID>();
|
public List<UUID> ignoreItemsList = new ArrayList<UUID>();
|
||||||
public HashMap<String,Buff> buffs = new HashMap<String,Buff>();
|
public HashMap<String,Buff> buffs = new HashMap<String,Buff>();
|
||||||
public HashMap<String,HashMap<Integer,Integer>> itemsets = new HashMap<String,HashMap<Integer,Integer>>(); //HashMap<"Set Name",HashMap<"Tier","Amt">>
|
public HashMap<String,HashMap<Integer,Integer>> itemsets = new HashMap<String,HashMap<Integer,Integer>>(); //HashMap<"Set Name",HashMap<"Tier","Amt">>
|
||||||
|
public boolean damagenumbers=true;
|
||||||
|
public OptionsMenu optionsmenu;
|
||||||
|
|
||||||
//Needs the instance of the player object to get all other info. Only to be called at the beginning.
|
//Needs the instance of the player object to get all other info. Only to be called at the beginning.
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@ -393,6 +397,7 @@ public class PlayerStructure {
|
|||||||
workable.set("vacuumsuckup", vacuumsuckup);
|
workable.set("vacuumsuckup", vacuumsuckup);
|
||||||
workable.set("equipweapons", equipweapons);
|
workable.set("equipweapons", equipweapons);
|
||||||
workable.set("equiparmor", equiparmor);
|
workable.set("equiparmor", equiparmor);
|
||||||
|
workable.set("healthbardisplay", healthbardisplay);
|
||||||
workable.set("playermode_on_death", playermode_on_death.name());
|
workable.set("playermode_on_death", playermode_on_death.name());
|
||||||
workable.set("rangermode", rangermode.name());
|
workable.set("rangermode", rangermode.name());
|
||||||
//ConfigurationSection deathlootlist = workable.createSection("deathloot");
|
//ConfigurationSection deathlootlist = workable.createSection("deathloot");
|
||||||
@ -411,6 +416,7 @@ public class PlayerStructure {
|
|||||||
workable.set("deathloc_x", deathloc_x);
|
workable.set("deathloc_x", deathloc_x);
|
||||||
workable.set("deathloc_y", deathloc_y);
|
workable.set("deathloc_y", deathloc_y);
|
||||||
workable.set("deathloc_z", deathloc_z);
|
workable.set("deathloc_z", deathloc_z);
|
||||||
|
workable.set("damagenumbers", damagenumbers);
|
||||||
workable.set("deathloc_world", deathloc_world);
|
workable.set("deathloc_world", deathloc_world);
|
||||||
workable.set("COOLDOWN_deathmark", last_deathmark);
|
workable.set("COOLDOWN_deathmark", last_deathmark);
|
||||||
workable.set("COOLDOWN_shovelspell", last_shovelspell);
|
workable.set("COOLDOWN_shovelspell", last_shovelspell);
|
||||||
@ -537,6 +543,8 @@ public class PlayerStructure {
|
|||||||
workable.addDefault("COOLDOWN_lastusedunstoppableteam", lastusedunstoppableteam);
|
workable.addDefault("COOLDOWN_lastusedunstoppableteam", lastusedunstoppableteam);
|
||||||
workable.addDefault("BUFFCOUNT", 0);
|
workable.addDefault("BUFFCOUNT", 0);
|
||||||
workable.addDefault("rangermode", "CLOSE");
|
workable.addDefault("rangermode", "CLOSE");
|
||||||
|
workable.addDefault("damagenumbers", damagenumbers);
|
||||||
|
workable.addDefault("healthbardisplay", healthbardisplay);
|
||||||
|
|
||||||
workable.options().copyDefaults();
|
workable.options().copyDefaults();
|
||||||
|
|
||||||
@ -599,6 +607,8 @@ public class PlayerStructure {
|
|||||||
this.equipweapons = workable.getBoolean("equipweapons");
|
this.equipweapons = workable.getBoolean("equipweapons");
|
||||||
this.equiparmor = workable.getBoolean("equiparmor");
|
this.equiparmor = workable.getBoolean("equiparmor");
|
||||||
this.rangermode = BowMode.valueOf(workable.getString("rangermode"));
|
this.rangermode = BowMode.valueOf(workable.getString("rangermode"));
|
||||||
|
this.damagenumbers = workable.getBoolean("damagenumbers");
|
||||||
|
this.healthbardisplay = workable.getBoolean("healthbardisplay");
|
||||||
String tempworld = workable.getString("restartloc_world");
|
String tempworld = workable.getString("restartloc_world");
|
||||||
if (tempworld!=null && !tempworld.equalsIgnoreCase("null")) {
|
if (tempworld!=null && !tempworld.equalsIgnoreCase("null")) {
|
||||||
this.restartLoc = new Location(Bukkit.getWorld(tempworld),workable.getDouble("restartloc_x"),workable.getDouble("restartloc_y"),workable.getDouble("restartloc_z"));
|
this.restartLoc = new Location(Bukkit.getWorld(tempworld),workable.getDouble("restartloc_x"),workable.getDouble("restartloc_y"),workable.getDouble("restartloc_z"));
|
||||||
|
@ -212,6 +212,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.LivingEntityDifficulty;
|
|||||||
import sig.plugin.TwosideKeeper.HelperStructures.Loot;
|
import sig.plugin.TwosideKeeper.HelperStructures.Loot;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MalleableBaseQuest;
|
import sig.plugin.TwosideKeeper.HelperStructures.MalleableBaseQuest;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty;
|
||||||
|
import sig.plugin.TwosideKeeper.HelperStructures.OptionsMenu;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.Pronouns;
|
import sig.plugin.TwosideKeeper.HelperStructures.Pronouns;
|
||||||
import sig.plugin.TwosideKeeper.HelperStructures.QuestStatus;
|
import sig.plugin.TwosideKeeper.HelperStructures.QuestStatus;
|
||||||
@ -974,7 +975,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) ||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) ||
|
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) {
|
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) {
|
||||||
regenmult += (0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()));
|
regenmult += (0.1d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SUSTENANCE, 4)) {
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.SUSTENANCE, 4)) {
|
||||||
@ -2434,17 +2435,34 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
p.sendMessage("Automatic Weapon Equipping is now turned "+(pd.equipweapons?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
p.sendMessage("Automatic Weapon Equipping is now turned "+(pd.equipweapons?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
|
if (cmd.getName().equalsIgnoreCase("damage_numbers")) {
|
||||||
|
Player p = (Player)sender;
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
pd.damagenumbers=!pd.damagenumbers;
|
||||||
|
p.sendMessage("Damage Numbers are now turned "+(pd.damagenumbers?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
if (cmd.getName().equalsIgnoreCase("equip_armor")) {
|
if (cmd.getName().equalsIgnoreCase("equip_armor")) {
|
||||||
Player p = (Player)sender;
|
Player p = (Player)sender;
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
pd.equiparmor=!pd.equiparmor;
|
pd.equiparmor=!pd.equiparmor;
|
||||||
p.sendMessage("Automatic Armor Equipping is now turned "+(pd.equiparmor?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
p.sendMessage("Automatic Armor Equipping is now turned "+(pd.equiparmor?ChatColor.GREEN+"ON":ChatColor.RED+"OFF")+ChatColor.RESET+".");
|
||||||
return true;
|
return true;
|
||||||
|
} else
|
||||||
|
if (cmd.getName().equalsIgnoreCase("options") ||
|
||||||
|
cmd.getName().equalsIgnoreCase("settings")) {
|
||||||
|
Player p = (Player)sender;
|
||||||
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
openOptionsMenu(p);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Implement console/admin version later (Let's you check any name's money.)
|
//Implement console/admin version later (Let's you check any name's money.)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
private void openOptionsMenu(Player p) {
|
||||||
|
new OptionsMenu(p);
|
||||||
}
|
}
|
||||||
public Arrow CreateOverlayText(Player p, int dmg) {
|
public Arrow CreateOverlayText(Player p, int dmg) {
|
||||||
Arrow aec = (Arrow)p.getWorld().spawnEntity(p.getLocation(), EntityType.ARROW);
|
Arrow aec = (Arrow)p.getWorld().spawnEntity(p.getLocation(), EntityType.ARROW);
|
||||||
@ -4523,7 +4541,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (!Christmas.ChristmasPlaceEvent(ev)) {
|
if (!Christmas.ChristmasPlaceEvent(ev)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TwosideKeeper.log("1- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("1- Cancelled? "+ev.isCancelled(), 0);
|
||||||
if (ev.getBlockPlaced().getType()==Material.CHEST ||
|
if (ev.getBlockPlaced().getType()==Material.CHEST ||
|
||||||
ev.getBlockPlaced().getType()==Material.TRAPPED_CHEST) {
|
ev.getBlockPlaced().getType()==Material.TRAPPED_CHEST) {
|
||||||
//Check for a chest or trapped chest around each side of the block.
|
//Check for a chest or trapped chest around each side of the block.
|
||||||
@ -4546,7 +4564,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TwosideKeeper.log("2- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("2- Cancelled? "+ev.isCancelled(), 0);
|
||||||
if (WorldShop.isPlaceableWorldShop(ev.getItemInHand())) {
|
if (WorldShop.isPlaceableWorldShop(ev.getItemInHand())) {
|
||||||
if (BlockUtils.LocationInFrontOfBlockIsFree(ev.getBlockPlaced())) {
|
if (BlockUtils.LocationInFrontOfBlockIsFree(ev.getBlockPlaced())) {
|
||||||
//ev.getPlayer().sendMessage("ALLOWED!");
|
//ev.getPlayer().sendMessage("ALLOWED!");
|
||||||
@ -4557,7 +4575,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TwosideKeeper.log("3- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("3- Cancelled? "+ev.isCancelled(), 0);
|
||||||
|
|
||||||
if (ev.getItemInHand().hasItemMeta() &&
|
if (ev.getItemInHand().hasItemMeta() &&
|
||||||
ev.getItemInHand().getItemMeta().hasLore() &&
|
ev.getItemInHand().getItemMeta().hasLore() &&
|
||||||
@ -4568,24 +4586,24 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TwosideKeeper.log("4- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("4- Cancelled? "+ev.isCancelled(), 0);
|
||||||
if (Artifact.isArtifact(ev.getItemInHand()) && !GenericFunctions.isArtifactEquip(ev.getItemInHand())) {
|
if (Artifact.isArtifact(ev.getItemInHand()) && !GenericFunctions.isArtifactEquip(ev.getItemInHand())) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TwosideKeeper.log("5- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("5- Cancelled? "+ev.isCancelled(), 0);
|
||||||
|
|
||||||
if (ItemSet.isSetItem(ev.getItemInHand())) {
|
if (ItemSet.isSetItem(ev.getItemInHand())) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TwosideKeeper.log("6- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("6- Cancelled? "+ev.isCancelled(), 0);
|
||||||
if (BaublePouch.isBaublePouch(ev.getItemInHand())) { //Do not allow bauble pouches to be built.
|
if (BaublePouch.isBaublePouch(ev.getItemInHand())) { //Do not allow bauble pouches to be built.
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TwosideKeeper.log("7- Cancelled? "+ev.isCancelled(), 0);
|
//TwosideKeeper.log("7- Cancelled? "+ev.isCancelled(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled = true)
|
||||||
@ -4611,6 +4629,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pd.lastattack=0;
|
||||||
if (pd.lasthitdesc!=null) {
|
if (pd.lasthitdesc!=null) {
|
||||||
log("Death Description: "+pd.lasthitdesc,5);
|
log("Death Description: "+pd.lasthitdesc,5);
|
||||||
newDeathMsg = getFancyDeathMessage(p);
|
newDeathMsg = getFancyDeathMessage(p);
|
||||||
@ -5293,6 +5312,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
PlayerStructure pd = (PlayerStructure) playerdata.get(p.getUniqueId());
|
PlayerStructure pd = (PlayerStructure) playerdata.get(p.getUniqueId());
|
||||||
pd.isViewingInventory=false;
|
pd.isViewingInventory=false;
|
||||||
|
pd.optionsmenu=null;
|
||||||
log("Closed Inventory.",5);
|
log("Closed Inventory.",5);
|
||||||
if (ev.getInventory().getHolder() instanceof Hopper &&
|
if (ev.getInventory().getHolder() instanceof Hopper &&
|
||||||
((Hopper)(ev.getInventory().getHolder())).getWorld().getName().equalsIgnoreCase("FilterCube")) {
|
((Hopper)(ev.getInventory().getHolder())).getWorld().getName().equalsIgnoreCase("FilterCube")) {
|
||||||
@ -5424,8 +5444,8 @@ 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() {
|
||||||
setPlayerMaxHealth(player,player.getHealth()/player.getMaxHealth());
|
|
||||||
ItemSet.updateItemSets(player);
|
ItemSet.updateItemSets(player);
|
||||||
|
setPlayerMaxHealth(player,player.getHealth()/player.getMaxHealth());
|
||||||
}
|
}
|
||||||
},1);
|
},1);
|
||||||
Christmas.RunPlayerItemHeldEvent(ev);
|
Christmas.RunPlayerItemHeldEvent(ev);
|
||||||
@ -5529,6 +5549,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
////////////////////////DO NOT PUT ANYTHING HERE! DEATH STRUCTURE NEEDS TO OVERRIDE ALL BEHAVIORS.
|
////////////////////////DO NOT PUT ANYTHING HERE! DEATH STRUCTURE NEEDS TO OVERRIDE ALL BEHAVIORS.
|
||||||
|
|
||||||
|
if (!OptionsMenu.runOptionsMenuClick(ev)) {
|
||||||
|
ev.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
InventoryUpdateEvent.TriggerUpdateInventoryEvent(player,ev.getCursor(),UpdateReason.INVENTORYUPDATE);
|
InventoryUpdateEvent.TriggerUpdateInventoryEvent(player,ev.getCursor(),UpdateReason.INVENTORYUPDATE);
|
||||||
|
|
||||||
if (DeathManager.deathStructureExists(player) && ev.getInventory().getTitle().equalsIgnoreCase("Death Loot")) {
|
if (DeathManager.deathStructureExists(player) && ev.getInventory().getTitle().equalsIgnoreCase("Death Loot")) {
|
||||||
@ -6662,7 +6687,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
dmgdealt=0.25;
|
dmgdealt=0.25;
|
||||||
} else
|
} else
|
||||||
if (PlayerMode.isSlayer((Player)ev.getEntity()) &&
|
if (PlayerMode.isSlayer((Player)ev.getEntity()) &&
|
||||||
ItemSet.meetsLorasysSwordConditions(18, 2, (Player)ev.getEntity())) {
|
ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 18, 2, (Player)ev.getEntity())) {
|
||||||
dmgdealt=0.0;
|
dmgdealt=0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6781,10 +6806,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static void updateHealthbarDisplay(Player p, LivingEntity target, double damage, int flags) {
|
public static void updateHealthbarDisplay(Player p, LivingEntity target, double damage, int flags) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
updateHealthbarDisplay(p,target);
|
updateHealthbarDisplay(p,target);
|
||||||
if (pd.damagelogging) {
|
if (pd.damagenumbers) {
|
||||||
if (Bukkit.getPlayer(pd.name)!=null && target!=null) {
|
if (Bukkit.getPlayer(pd.name)!=null && target!=null) {
|
||||||
if (Bukkit.getPlayer(pd.name)!=null && target!=null) {
|
if (Bukkit.getPlayer(pd.name)!=null && target!=null) {
|
||||||
ChatColor col = ChatColor.AQUA;
|
ChatColor col = ChatColor.AQUA;
|
||||||
|
//TwosideKeeper.log("Last hit properties: "+pd.lasthitproperties, 0);
|
||||||
if (CustomDamage.isFlagSet(pd.lasthitproperties, CustomDamage.IS_CRIT)) {
|
if (CustomDamage.isFlagSet(pd.lasthitproperties, CustomDamage.IS_CRIT)) {
|
||||||
col = ChatColor.YELLOW;
|
col = ChatColor.YELLOW;
|
||||||
} else
|
} else
|
||||||
@ -6811,7 +6837,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
public static void updateHealthbarDisplay(Player p, LivingEntity target) {
|
public static void updateHealthbarDisplay(Player p, LivingEntity target) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (Bukkit.getPlayer(pd.name)!=null && target!=null) {
|
if (Bukkit.getPlayer(pd.name)!=null && target!=null && pd.healthbardisplay) {
|
||||||
String MonsterName = target.getType().toString().toLowerCase();
|
String MonsterName = target.getType().toString().toLowerCase();
|
||||||
MonsterName = GenericFunctions.getDisplayName(target);
|
MonsterName = GenericFunctions.getDisplayName(target);
|
||||||
|
|
||||||
@ -7489,10 +7515,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
if (isSlayer) {
|
if (isSlayer) {
|
||||||
int restore_amt = 2;
|
int restore_amt = 2;
|
||||||
if (ItemSet.meetsLorasysSwordConditions(18, 2, p)) {
|
if (ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 18, 2, p)) {
|
||||||
restore_amt = 4;
|
restore_amt = 4;
|
||||||
} else
|
} else
|
||||||
if (ItemSet.meetsLorasysSwordConditions(27, 3, p)) {
|
if (ItemSet.meetsSlayerSwordConditions(ItemSet.LORASYS, 27, 3, p)) {
|
||||||
restore_amt = 6;
|
restore_amt = 6;
|
||||||
}
|
}
|
||||||
if (pd.slayermodehp+restore_amt<p.getMaxHealth()) {
|
if (pd.slayermodehp+restore_amt<p.getMaxHealth()) {
|
||||||
@ -8460,6 +8486,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static boolean AutoEquipItem(ItemStack item, Player p) {
|
public static boolean AutoEquipItem(ItemStack item, Player p) {
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL && PlayerUtils.PlayerIsInCombat(p)) {
|
if (PlayerMode.getPlayerMode(p)==PlayerMode.NORMAL && PlayerUtils.PlayerIsInCombat(p)) {
|
||||||
|
//TwosideKeeper.log("In combat? "+PlayerUtils.PlayerIsInCombat(p), 0);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (item.getType().toString().contains("BOOTS") ||
|
if (item.getType().toString().contains("BOOTS") ||
|
||||||
@ -10069,6 +10096,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Barbarian HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Barbarian HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
|
|
||||||
|
|
||||||
|
hp+=ItemSet.GetTotalBaseAmount(p, ItemSet.DAWNTRACKER);
|
||||||
hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 4, 4);
|
hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER, 4, 4);
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 2, 2);
|
hp+=ItemSet.TotalBaseAmountBasedOnSetBonusCount(p, ItemSet.SONGSTEEL, 2, 2);
|
||||||
@ -10116,7 +10144,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) ||
|
if (ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.DAWNTRACKER,6) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) ||
|
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.LEGION,6) ||
|
||||||
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) {
|
ItemSet.HasSetBonusBasedOnSetBonusCount(p, ItemSet.PRIDE,6)) {
|
||||||
hp*=1.0+(0.25d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()));
|
hp*=1.0+(0.1d*ItemSet.GetItemTier(p.getEquipment().getItemInMainHand()));
|
||||||
}
|
}
|
||||||
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker bonus HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
TwosideKeeper.HeartbeatLogger.AddEntry("----====]> Dawntracker bonus HP Calculation", (int)(System.nanoTime()-time));time = System.nanoTime();
|
||||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||||
|
@ -729,7 +729,10 @@ final class runServerHeartbeat implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ResetVendetta(final long serverTickTime, PlayerStructure pd) {
|
private void ResetVendetta(final long serverTickTime, PlayerStructure pd) {
|
||||||
if (pd.lastcombat+(20*60)<serverTickTime) {
|
if (pd.lastcombat+(20*60)<serverTickTime &&
|
||||||
|
(pd.vendetta_amt>0 ||
|
||||||
|
pd.thorns_amt>0 ||
|
||||||
|
pd.weaponcharges>0)) {
|
||||||
pd.vendetta_amt=0;
|
pd.vendetta_amt=0;
|
||||||
pd.thorns_amt=0;
|
pd.thorns_amt=0;
|
||||||
pd.weaponcharges=0;
|
pd.weaponcharges=0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user