->Fixed a bug where players can duplicate items after dying by leaving

the game with the Death Loot inventory open.
->Fixed a bug where shield durability would be subtracted when using
Defender's Rejuvenate skill even when it was on cooldown.
->Fixed a bug where Line Drive's cooldown was not visually correct with
the cooldown indicator.
->Fixed a bug where Thorns was not applying the proper amount of damage
to mobs and players.
->The new artifact tier cap is T15. All stats leading up to T15 have
been scaled accordingly.
->Added 'Survival' perk to Artifact Armor.
->The secondary explosion from mobs exploding now does proper damage to
players.
This commit is contained in:
sigonasr2 2016-08-04 22:30:28 -05:00
parent 41cbe5250f
commit 3cb966aa6b
9 changed files with 330 additions and 110 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
name: TwosideKeeper
main: sig.plugin.TwosideKeeper.TwosideKeeper
version: 3.7.3br2
version: 3.7.3c
commands:
money:
description: Tells the player the amount of money they are holding.

View File

@ -135,6 +135,10 @@ public class DeathManager {
if (structure.deathloc.getBlockY()<=60) {
price += 24-(structure.deathloc.getBlockY()/2.5);
}
PlayerStructure pd = PlayerStructure.GetPlayerStructure(Bukkit.getPlayer(p.getName()));
pd.hasDied=false;
p.openInventory(deathinv);
p.sendMessage(ChatColor.AQUA+"You can buy back up to "+ChatColor.YELLOW+(int)(totalmoney/price)+ChatColor.AQUA+" items, costing $"+ChatColor.GREEN+price+ChatColor.WHITE+" per item.");
p.sendMessage(" The rest will drop at your death location.");

View File

@ -28,70 +28,70 @@ public enum ArtifactAbility {
//Temporary abilities: Work for 1 level and wear off afterward.
//Weapon Abilities
DAMAGE("Strike","Improves Base Damage by [VAL]",new double[]{1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
new double[]{1.0,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,1,UpgradePath.BASIC),
ARMOR_PEN("Piercing","[VAL]% of your damage is ignored by resistances. ([PENDMG] damage)",new double[]{1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.7,0.7,0.6,0.5},100,1,UpgradePath.BASIC),
EXECUTION("Execute","Deals [VAL] extra damage for every 20% of target's missing health.",new double[]{0.125,0.25,1.375,0.5,0.625,0.75,0.875,1.0,1.125,1.25},
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.7,0.7,0.6,0.5},100,1,UpgradePath.BASIC),
LIFESTEAL("Lifesteal","Heals [VAL]% of the damage dealt to targets back to your health pool.",new double[]{1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1,UpgradePath.WEAPON),
CRITICAL("Critical","[VAL]% chance to deal critical strikes.",new double[]{2.0,2.25,2.5,2.75,3.0,3.25,3.50,3.75,4.0,4.25},
new double[]{1.0,1.0,0.9,0.9,0.8,0.8,0.7,0.7,0.6,0.5},100,1,UpgradePath.WEAPON),
CRIT_DMG("Crit Damage","Critical Strikes deal [VAL]% damage.",new double[]{210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0,210.0},
new double[]{5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0},100,1,UpgradePath.WEAPON),
HIGHWINDER("Highwinder","While moving fast or sprinting, you deal [VAL] extra damage for every 1m of speed.",new double[]{0.18,0.225,0.27,0.315,0.36,0.405,0.45,0.495,0.54,0.61},
new double[]{0.675,0.65,0.625,0.6,0.575,0.55,0.525,0.5,0.475,0.45},100,15,UpgradePath.WEAPON),
DAMAGE("Strike","Improves Base Damage by [VAL]",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0},
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
ARMOR_PEN("Piercing","[VAL]% of your damage is ignored by resistances. ([PENDMG] damage)",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0},
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.4},100,1,UpgradePath.BASIC),
EXECUTION("Execute","Deals [VAL] extra damage for every 20% of target's missing health.",new double[]{0.1,0.125,0.15,0.175,0.2,0.225,0.25,0.275,0.3,0.35,0.4,0.5,0.7,0.9,1.25},
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,1,UpgradePath.BASIC),
LIFESTEAL("Lifesteal","Heals [VAL]% of the damage dealt to targets back to your health pool.",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1,UpgradePath.WEAPON),
CRITICAL("Critical","[VAL]% chance to deal critical strikes.",new double[]{1.0,1.25,1.5,1.75,2.0,2.25,2.50,2.75,3.0,3.25,3.50,3.75,4.00,4.25,4.50},
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,1,UpgradePath.WEAPON),
CRIT_DMG("Crit Damage","Critical Strikes deal [VAL]% damage.",new double[]{200.0,201.0,202.0,204.0,206.0,210.0,215.0,219.0,222.0,226.0,230.0,235.0,240.0,245.0,260.0},
new double[]{5.0,4.9,4.8,4.7,4.6,4.5,4.4,4.3,4.2,4.1,4.0,3.8,3.6,3.4,3.0},100,1,UpgradePath.WEAPON),
HIGHWINDER("Highwinder","While moving fast or sprinting, you deal [VAL] extra damage for every 1m of speed.",new double[]{0.18,0.225,0.27,0.315,0.36,0.405,0.45,0.495,0.54,0.61,0.79,0.99,1.30,1.70,2.50},
new double[]{0.675,0.65,0.625,0.6,0.575,0.55,0.525,0.5,0.475,0.45,0.425,0.4,0.375,0.35,0.30},100,15,UpgradePath.WEAPON),
//Bow Abilities
MARKSMAN("Marksman","Increases headshot hitbox size by [VAL]% .",new double[]{10.0,15,20,25,30,35,40,45,50,55},
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55},10,15,UpgradePath.BOW),
MARKSMAN("Marksman","Increases headshot hitbox size by [VAL]% .",new double[]{10.0,15,20,25,30,35,40,45,50,55,60,70,80,90,100},
new double[]{1.0,0.975,0.95,0.875,0.85,0.825,0.8,0.775,0.75,0.725,0.70,0.675,0.65,0.55,0.45},10,15,UpgradePath.BOW),
SIEGESTANCE("Siege Stance",ChatColor.GRAY+"[Unimplemented] Activate by Sneaking for three seconds. Sneak again to de-activate.\n\n"
+ "Applies Slowness V and Resistance VI. While in Siege Stance you fire clusters of 7 arrows per shot. Each arrow deals [VAL] damage.",new double[]{3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,20,UpgradePath.BOW),
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.BOW),
ARROWSHOWER("Arrow Shower",ChatColor.GRAY+"[Unimplemented] Shift-Left Click to activate. Applies Slowness X for three seconds while firing arrows into the sky and onto enemies in a large area in front of you. Each arrow deals [VAL] damage.",new double[]{0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7,0.7},
new double[]{0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4},100,40,UpgradePath.BOW),
new double[]{0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4},100,1000,UpgradePath.BOW),
TARGETING("Targeting",ChatColor.GRAY+"[Unimplemented] Left-click a mob to target them. Fire arrows to release homing missiles at your target. Each missile explodes and deals [VAL] damage.",new double[]{10,10,10,10,10,10,10,10,10,10},
new double[]{0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},100,75,UpgradePath.BOW),
new double[]{0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3},100,1000,UpgradePath.BOW),
ENDERTURRET("Ender Turret",ChatColor.GRAY+"[Unimplemented] Place Eyes of Ender in your hotbar to use as ammo. Each eye fired launches forward and upward before releasing a barrage of homing missiles that lock onto enemy targets. Each missile explodes and deals [VAL] damage.",new double[]{25,25,25,25,25,25,25,25,25,25},
new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},100,100,UpgradePath.BOW),
new double[]{0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5},100,1000,UpgradePath.BOW),
//Armor abilities
DAMAGE_REDUCTION("Defense","Increases Base Damage reduction by [VAL]%",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5},
new double[]{2.2,2.1,2.0,1.9,1.8,1.7,1.6,1.5,1.4,1.3},100,1,UpgradePath.ARMOR),
HEALTH("Health","Increases Maximum Health by [VAL].",new double[]{0.35,0.70,1.05,1.40,1.70,2.0,2.3,2.6,2.9,3.2},
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.75,0.7,0.65},100,1,UpgradePath.ARMOR),
HEALTH_REGEN("Regeneration","Regenerates an extra [VAL] health every 5 seconds.",new double[]{0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.29166666666666666666666666666667,0.33333333333333333333333333333333,0.375,0.41666666666666666666666666666667},
new double[]{1.0,0.90,0.85,0.8,0.75,0.7,0.6,0.55,0.5,0.45},100,1,UpgradePath.ARMOR),
STATUS_EFFECT_RESISTANCE("Resistance","When a debuff is applied, there is a [VAL]% chance to remove it.",new double[]{3,3.5,4,4.5,5,5.5,6,6.5,7,7.5},
new double[]{4.0,3.85,3.70,3.55,3.40,3.25,3.10,2.95,2.80,2.65},100,1,UpgradePath.ARMOR),
SHADOWWALKER("Shadow Walker","Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas.",new double[]{5,5,5,5,5,5,5,5,5,5},
new double[]{1.5,1.4,1.3,1.2,1.1,1.0,0.9,0.8,0.7,0.55},100,10,UpgradePath.ARMOR),
/*SURVIVOR("Survivor",ChatColor.GRAY+"[Unimplemented] Taking fatal damage will not kill you and instead consume this ability, removes all debuffs, and restoring your health.",new double[]{-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0},
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},1,1000,UpgradePath.ARMOR),*/
DODGE("Dodge",ChatColor.GRAY+"You have a [VAL]% chance to dodge incoming damage from any damage source.",new double[]{0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55},
new double[]{1.0,1.0,1.0,0.8,0.7,0.6,0.5,0.4,0.3,0.2},100,40,UpgradePath.ARMOR),
GRACEFULDODGE("Graceful Dodge","Whenever a dodge occurs, you will gain [VAL] seconds of invulnerability.",new double[]{0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.5},
new double[]{1.8,1.78,1.76,1.74,1.72,1.70,1.68,1.66,1.64,1.62},10,40,UpgradePath.ARMOR),
DAMAGE_REDUCTION("Defense","Increases Base Damage reduction by [VAL]%",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.1,5.2,5.25,5.3,5.35,5.5},
new double[]{2.2,2.1,2.0,1.9,1.8,1.7,1.6,1.55,1.5,1.475,1.45,1.425,1.4,1.35,1.3},100,1,UpgradePath.ARMOR),
HEALTH("Health","Increases Maximum Health by [VAL].",new double[]{0.35,0.70,1.05,1.40,1.70,2.0,2.3,2.6,2.9,3.0,3.1,3.2,3.3,3.4,3.6},
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.75,0.7,0.675,0.65,0.625,0.6,0.55,0.5},100,1,UpgradePath.ARMOR),
HEALTH_REGEN("Regeneration","Regenerates an extra [VAL] health every 5 seconds.",new double[]{0.03125,0.0625,0.09375,0.125,0.15625,0.1875,0.29166666666666666666666666666667,0.33333333333333333333333333333333,0.375,0.4,0.42,0.44,0.46,0.48,0.55},
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.475,0.45,0.425,0.4},100,1,UpgradePath.ARMOR),
STATUS_EFFECT_RESISTANCE("Resistance","When a debuff is applied, there is a [VAL]% chance to remove it.",new double[]{3,3.5,4,4.5,5,5.5,6,6.5,7,7.1,7.2,7.3,7.4,7.45,7.5},
new double[]{4.0,3.85,3.70,3.55,3.40,3.25,3.10,2.95,2.80,2.775,2.75,2.725,2.7,2.675,2.65},100,1,UpgradePath.ARMOR),
SHADOWWALKER("Shadow Walker","Increases your speed in dark areas. Damage Reduction increases by [VAL]% in dark areas. Dodge chance increases by [DODGEVAL]% in dark areas.",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
new double[]{1.5,1.4,1.3,1.2,1.1,1.0,0.9,0.8,0.7,0.65,0.625,0.6,0.585,0.565,0.55},100,10,UpgradePath.ARMOR),
SURVIVOR("Survivor","Taking fatal damage will not kill you and instead consumes this ability, removes all debuffs, and restores your health by [VAL]%"+TemporarySkill(),new double[]{4,4.25,4.5,4.75,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10},
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},10,25,UpgradePath.ARMOR),
DODGE("Dodge","You have a [VAL]% chance to dodge incoming damage from any damage source.",new double[]{0.1,0.125,0.15,0.175,0.225,0.25,0.275,0.3,0.325,0.35,0.375,0.4,0.45,0.5,0.55},
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55,0.5,0.45,0.35,0.25,0.2},100,40,UpgradePath.ARMOR),
GRACEFULDODGE("Graceful Dodge","Whenever a dodge occurs, you will gain [VAL] seconds of invulnerability.",new double[]{0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.9,1.0,1.05,1.1,1.2,1.3,1.4,1.5},
new double[]{1.8,1.79,1.78,1.77,1.76,1.75,1.74,1.73,1.72,1.71,1.70,1.69,1.67,1.65,1.62},10,40,UpgradePath.ARMOR),
//Sword abilities
PROVOKE("Provoke","Your attacks provoke enemies for [VAL] seconds.",new double[]{3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0},
new double[]{3.0,2.8,2.6,2.4,2.2,2.2,2.0,1.8,1.6,1.4},100,10,UpgradePath.SWORD),
COMBO("Belligerent","[VAL]% more damage for each successive strike on a mob. Resets after 2 seconds of no combat.",new double[]{1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5},
new double[]{1.0,0.95,0.9,0.85,0.8,0.75,0.7,0.65,0.6,0.55},100,40,UpgradePath.SWORD),
PROVOKE("Provoke","Your attacks provoke enemies for [VAL] seconds.",new double[]{3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,10.0,12.0},
new double[]{3.0,2.9,2.8,2.7,2.6,2.5,2.4,2.3,2.2,2.1,2.0,1.9,1.8,1.6,1.4},100,10,UpgradePath.SWORD),
COMBO("Belligerent","[VAL]% more damage for each successive strike on a mob. Resets after 2 seconds of no combat.",new double[]{1.0,1.2,1.4,1.6,1.8,2.0,2.2,2.4,2.6,2.8,3.0,3.25,3.5,4.0,5.5},
new double[]{1.0,0.975,0.95,0.925,0.9,0.875,0.85,0.825,0.8,0.75,0.7,0.65,0.6,0.55,0.5},100,40,UpgradePath.SWORD),
//Pickaxe abilities
SCAVENGE("Scavenge",ChatColor.GRAY+"[Unimplemented] Breaks off resources from armor. [VAL]% chance per hit.",new double[]{5,5,5,5,5,5,5,5,5,5},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE),
MINES("Land Mine",ChatColor.GRAY+"[Unimplemented]While in combat, throw your pickaxe to send land mines towards your enemies. On contact they deal [VAL] damage.",new double[]{5,5,5,5,5,5,5,5,5,5},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE),
SCAVENGE("Scavenge",ChatColor.GRAY+"[Unimplemented] Breaks off resources from armor. [VAL]% chance per hit.",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE),
MINES("Land Mine",ChatColor.GRAY+"[Unimplemented]While in combat, throw your pickaxe to send land mines towards your enemies. On contact they deal [VAL] damage.",new double[]{5,5,5,5,5,5,5,5,5,5,5,5,5,5,5},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.PICKAXE),
//Shovel abilities
SUPPRESS("Suppression",ChatColor.GRAY+"[Unimplemented] Suppresses a mob on hit for [VAL] seconds.\n\n"
+ "Suppression prevents movement, attacking, exploding, and teleportation.",new double[]{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.SHOVEL),
ERUPTION("Eruption","Sneak while Left-clicking a mob to damage mobs for [VAL] damage and knock them up. The eruption also destroys the ground beneath you.",new double[]{11.0,13,15.0,17,19.0,21,24.0,27,30.0,40},
new double[]{1.0,0.925,0.85,0.775,0.7,0.625,0.55,0.475,0.4,0.325},100,40,UpgradePath.SHOVEL),
+ "Suppression prevents movement, attacking, exploding, and teleportation.",new double[]{0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},100,1000,UpgradePath.SHOVEL),
ERUPTION("Eruption","Sneak while Left-clicking a mob to damage mobs for [VAL] damage and knock them up. The eruption also destroys the ground beneath you.",new double[]{11.0,12.0,13.0,14.0,16.0,18.0,20.0,23,26.0,29,32.0,35.0,37.5,39.5,50},
new double[]{1.0,0.925,0.85,0.775,0.7,0.625,0.55,0.475,0.45,0.425,0.4,0.375,0.35,0.325,0.3},100,40,UpgradePath.SHOVEL),
EARTHWAVE("Earth Wave","While in combat, destroy a block to send a wave of earth towards your enemies. Enemies standing inside of the waves take [VAL] damage every second.",new double[]{10,12,14,16,18,20,22,24,26,30},
new double[]{2.4,2.2,2.0,1.9,1.8,1.7,1.6,1.5,1.4,1.2},100,100,UpgradePath.SHOVEL),
@ -112,7 +112,7 @@ public enum ArtifactAbility {
//General abilities
AUTOREPAIR("Auto Repair","1% chance every second to repair [VAL] durability to the artifact item\n\nThe item must be sitting in your hotbar or must be equipped for this ability to work. This ability is less effective with no sunlight!",new double[]{3,3.5,4,4.5,5,5.5,6,6.5,7,7.5},
new double[]{1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0},10,1,UpgradePath.ALL),
GREED("Greed","Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved. Each hit has a [GREEDCHANCE]% chance to consume the Greed buff.\n\n"+ChatColor.RED+"Costs 1 Artifact Level.",new double[]{1,2,3,4,5,7,9,11,13,15},
GREED("Greed","Increases Drop rate by [VAL]% . Health is halved, health regeneration is halved. Each hit has a [GREEDCHANCE]% chance to consume the Greed buff."+TemporarySkill(),new double[]{1,2,3,4,5,7,9,11,13,15},
new double[]{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},10,10,UpgradePath.ALL),
/*GROWTH("Growth",ChatColor.GRAY+"[Unimplemented] Increases artifact EXP gained by [VAL]% . Health is halved, health regeneration is halved, and damage reduction is halved. Consumes one level of Growth per level up.",new double[]{100,100,100,100,100,100,100,100,100,100},
new double[]{2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0,2.0},100,1000,UpgradePath.ALL),*/
@ -170,6 +170,10 @@ public enum ArtifactAbility {
this.upgrade=upgrade;
}
private static String TemporarySkill() {
return "\n\n"+ChatColor.RED+"Costs 1 Artifact Level.";
}
public String GetName() {
return this.name;
}
@ -428,8 +432,8 @@ public enum ArtifactAbility {
item = applyEnchantment(ability,level+1,item);
AwakenedArtifact.addAP(item, -1);
p.sendMessage(ChatColor.AQUA+"Successfully applied "+ChatColor.BLUE+ability.GetName()+" "+(level+1)+ChatColor.AQUA+" to your artifact!");
if (ability==ArtifactAbility.GREED) {
//Remove a level from using Greed.
if (TwosideKeeper.TEMPORARYABILITIES.contains(ability)) {
//Remove a level from using a temporary ability.
AwakenedArtifact.setLV(item, AwakenedArtifact.getLV(item)-1, p);
}
int apamt = AwakenedArtifact.getAP(item);
@ -550,7 +554,7 @@ public enum ArtifactAbility {
text=DisplayAbility(HEALTH_REGEN,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(STATUS_EFFECT_RESISTANCE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(SHADOWWALKER,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
//text=DisplayAbility(SURVIVOR,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(SURVIVOR,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(DODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
text=DisplayAbility(GRACEFULDODGE,playerdmgval,targetitem,slot);msg1.addExtra(text);if(!text.getText().equalsIgnoreCase("")){++i;}if(i%4==0){msg1.addExtra("\n");}
} else

View File

@ -24,18 +24,28 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_AXE), //T8
new ItemStack(Material.DIAMOND_AXE), //T9
new ItemStack(Material.DIAMOND_AXE), //T10
new ItemStack(Material.DIAMOND_AXE), //T11
new ItemStack(Material.DIAMOND_AXE), //T12
new ItemStack(Material.DIAMOND_AXE), //T13
new ItemStack(Material.DIAMOND_AXE), //T14
new ItemStack(Material.DIAMOND_AXE), //T15
},
new double[]{
1.0d, //T1
1.5d, //T2
2.0d, //T3
2.5d, //T4
3.0d, //T5
3.5d, //T6
4.0d, //T7
4.5d, //T8
5.0d, //T9
6.0d //T10
1.25d, //T2
1.50d, //T3
1.75d, //T4
2.0d, //T5
2.25d, //T6
2.50d, //T7
2.75d, //T8
3.0d, //T9
3.25d, //T10
3.5d, //T11
4.5d, //T12
5.5d, //T13
6.5d, //T14
8.0d, //T15
}),
SWORD(1,"SWORD",TierType.ALL,UpgradePath.SWORD,new String[]{"EEE","EEE","EEE"},
new ItemStack[]{
@ -49,18 +59,28 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_SWORD), //T8
new ItemStack(Material.DIAMOND_SWORD), //T9
new ItemStack(Material.DIAMOND_SWORD), //T10
new ItemStack(Material.DIAMOND_SWORD), //T11
new ItemStack(Material.DIAMOND_SWORD), //T12
new ItemStack(Material.DIAMOND_SWORD), //T13
new ItemStack(Material.DIAMOND_SWORD), //T14
new ItemStack(Material.DIAMOND_SWORD), //T15
},
new double[]{
2.0d, //T1
3.0d, //T2
4.0d, //T3
5.0d, //T4
6.0d, //T5
7.0d, //T6
8.0d, //T7
9.0d, //T8
10.0d, //T9
12.0d //T10
2.5d, //T2
3.0d, //T3
3.5d, //T4
4.0d, //T5
4.5d, //T6
5.0d, //T7
5.5d, //T8
6.0d, //T9
6.5d, //T10
7.0d, //T11
8.0d, //T12
9.0d, //T13
10.0d, //T14
12.0d, //T15
}),
PICKAXE(2,"PICKAXE",TierType.ALL,UpgradePath.PICKAXE,new String[]{"EEE","xEx","xEx"},
new ItemStack[]{
@ -74,6 +94,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_PICKAXE), //T8
new ItemStack(Material.DIAMOND_PICKAXE), //T9
new ItemStack(Material.DIAMOND_PICKAXE), //T10
new ItemStack(Material.DIAMOND_PICKAXE), //T11
new ItemStack(Material.DIAMOND_PICKAXE), //T12
new ItemStack(Material.DIAMOND_PICKAXE), //T13
new ItemStack(Material.DIAMOND_PICKAXE), //T14
new ItemStack(Material.DIAMOND_PICKAXE), //T15
}),
HOE(3,"SCYTHE",TierType.ALL,UpgradePath.SCYTHE,new String[]{"EEx","xEx","xEx"},
new ItemStack[]{
@ -87,6 +112,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_HOE), //T8
new ItemStack(Material.DIAMOND_HOE), //T9
new ItemStack(Material.DIAMOND_HOE), //T10
new ItemStack(Material.DIAMOND_HOE), //T11
new ItemStack(Material.DIAMOND_HOE), //T12
new ItemStack(Material.DIAMOND_HOE), //T13
new ItemStack(Material.DIAMOND_HOE), //T14
new ItemStack(Material.DIAMOND_HOE), //T15
}),
BOW(4,"BOW",TierType.ONE,UpgradePath.BOW,new String[]{"EEx","ExE","EEx"},
new ItemStack[]{
@ -100,6 +130,11 @@ public enum ArtifactItemType {
new ItemStack(Material.BOW), //T8
new ItemStack(Material.BOW), //T9
new ItemStack(Material.BOW), //T10
new ItemStack(Material.BOW), //T11
new ItemStack(Material.BOW), //T12
new ItemStack(Material.BOW), //T13
new ItemStack(Material.BOW), //T14
new ItemStack(Material.BOW), //T15
}),
SHOVEL(5,"SHOVEL",TierType.ALL,UpgradePath.SHOVEL,new String[]{"E","E","E"},
new ItemStack[]{
@ -113,6 +148,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_SPADE), //T8
new ItemStack(Material.DIAMOND_SPADE), //T9
new ItemStack(Material.DIAMOND_SPADE), //T10
new ItemStack(Material.DIAMOND_SPADE), //T11
new ItemStack(Material.DIAMOND_SPADE), //T12
new ItemStack(Material.DIAMOND_SPADE), //T13
new ItemStack(Material.DIAMOND_SPADE), //T14
new ItemStack(Material.DIAMOND_SPADE), //T15
}),
HELMET(6,"HELMET",TierType.ARMOR,UpgradePath.ARMOR,new String[]{"EEE","ExE"},
new ItemStack[]{
@ -126,6 +166,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_HELMET), //T8
new ItemStack(Material.DIAMOND_HELMET), //T9
new ItemStack(Material.DIAMOND_HELMET), //T10
new ItemStack(Material.DIAMOND_HELMET), //T11
new ItemStack(Material.DIAMOND_HELMET), //T12
new ItemStack(Material.DIAMOND_HELMET), //T13
new ItemStack(Material.DIAMOND_HELMET), //T14
new ItemStack(Material.DIAMOND_HELMET), //T15
},
new double[]{
3.75d, //T1
@ -163,6 +208,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_CHESTPLATE), //T8
new ItemStack(Material.DIAMOND_CHESTPLATE), //T9
new ItemStack(Material.DIAMOND_CHESTPLATE), //T10
new ItemStack(Material.DIAMOND_CHESTPLATE), //T11
new ItemStack(Material.DIAMOND_CHESTPLATE), //T12
new ItemStack(Material.DIAMOND_CHESTPLATE), //T13
new ItemStack(Material.DIAMOND_CHESTPLATE), //T14
new ItemStack(Material.DIAMOND_CHESTPLATE), //T15
},
new double[]{
3.75d, //T1
@ -200,6 +250,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_LEGGINGS), //T8
new ItemStack(Material.DIAMOND_LEGGINGS), //T9
new ItemStack(Material.DIAMOND_LEGGINGS), //T10
new ItemStack(Material.DIAMOND_LEGGINGS), //T11
new ItemStack(Material.DIAMOND_LEGGINGS), //T12
new ItemStack(Material.DIAMOND_LEGGINGS), //T13
new ItemStack(Material.DIAMOND_LEGGINGS), //T14
new ItemStack(Material.DIAMOND_LEGGINGS), //T15
},
new double[]{
3.75d, //T1
@ -237,6 +292,11 @@ public enum ArtifactItemType {
new ItemStack(Material.DIAMOND_BOOTS), //T8
new ItemStack(Material.DIAMOND_BOOTS), //T9
new ItemStack(Material.DIAMOND_BOOTS), //T10
new ItemStack(Material.DIAMOND_BOOTS), //T11
new ItemStack(Material.DIAMOND_BOOTS), //T12
new ItemStack(Material.DIAMOND_BOOTS), //T13
new ItemStack(Material.DIAMOND_BOOTS), //T14
new ItemStack(Material.DIAMOND_BOOTS), //T15
},
new double[]{
3.75d, //T1
@ -274,6 +334,11 @@ public enum ArtifactItemType {
new ItemStack(Material.FISHING_ROD), //T8
new ItemStack(Material.FISHING_ROD), //T9
new ItemStack(Material.FISHING_ROD), //T10
new ItemStack(Material.FISHING_ROD), //T11
new ItemStack(Material.FISHING_ROD), //T12
new ItemStack(Material.FISHING_ROD), //T13
new ItemStack(Material.FISHING_ROD), //T14
new ItemStack(Material.FISHING_ROD), //T15
},
new double[]{
3.75d, //T1
@ -704,7 +769,7 @@ public enum ArtifactItemType {
ouritem.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
}
}break;
case 10:{
default:{
if (upgrade==UpgradePath.WEAPON ||
upgrade==UpgradePath.SWORD ||
upgrade==UpgradePath.AXE ||

View File

@ -2604,16 +2604,20 @@ public class GenericFunctions {
@Deprecated
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, boolean truedmg) {
DealDamageToMob(dmg,target,damager,null);
DealDamageToMob(dmg,target,damager,null,"");
}
public static void DealDamageToMob(double dmg, LivingEntity target, Entity damager) {
DealDamageToMob(dmg,target,NewCombat.getDamagerEntity(damager),null);
DealDamageToMob(dmg,target,NewCombat.getDamagerEntity(damager),null,"");
}
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact) {
DealDamageToMob(dmg,target,damager,artifact,"");
}
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact, String reason) {
if (damager!=null && (target instanceof Monster)) {
Monster m = (Monster)target;
if (damager instanceof Player) {
@ -2623,8 +2627,13 @@ public class GenericFunctions {
}
aPlugin.API.sendEntityHurtAnimation(target);
TwosideKeeper.log("Call event with "+dmg, 5);
if (damager!=null) {
TwosideKeeper.log(GenericFunctions.GetEntityDisplayName(damager)+"->"+
GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,2);
} else {
TwosideKeeper.log(reason+"->"+
GenericFunctions.GetEntityDisplayName(target)+ChatColor.WHITE+": Damage dealt was "+dmg,2);
}
double oldhp=((LivingEntity)target).getHealth();
GenericFunctions.subtractHealth(target, damager, dmg, artifact);
if (artifact!=null &&
@ -2794,18 +2803,22 @@ public class GenericFunctions {
//Bukkit.getPluginManager().callEvent(new EntityDamageByEntityEvent(damager,entity,DamageCause.CUSTOM,dmg+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER));
} else {
//Use old system if we cannot get a valid damager.
if (entity.getHealth()>dmg) {
entity.setHealth(entity.getHealth()-dmg);
aPlugin.API.sendEntityHurtAnimation(entity);
if (entity.getHealth()>dmg && entity instanceof Player) {
if (!AttemptRevive((Player)entity,dmg)) {
entity.setHealth(((Player)entity).getHealth()-dmg);
aPlugin.API.sendEntityHurtAnimation((Player)entity);
}
} else {
//List<ItemStack> drops = new ArrayList<ItemStack>();
//EntityDeathEvent ev = new EntityDeathEvent(entity,drops);
//Bukkit.getPluginManager().callEvent(ev);
//entity.setHealth(0);
if (entity instanceof Player && !AttemptRevive((Player)entity,Integer.MAX_VALUE)) {
entity.damage(Integer.MAX_VALUE);
}
}
}
}
public static boolean isViewingInventory(Player p) {
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
@ -2823,6 +2836,7 @@ public class GenericFunctions {
if (pd.last_rejuvenate+TwosideKeeper.REJUVENATE_COOLDOWN<=TwosideKeeper.getServerTickTime()) {
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_VILLAGER_CURE, 1.0f, 1.0f);
addIFrame(player,40);
aPlugin.API.damageItem(player, player.getEquipment().getItemInMainHand(), 400);
player.removePotionEffect(PotionEffectType.REGENERATION);
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,200,9));
aPlugin.API.sendCooldownPacket(player, player.getEquipment().getItemInMainHand(), TwosideKeeper.REJUVENATE_COOLDOWN);
@ -2921,4 +2935,104 @@ public class GenericFunctions {
ExperienceOrb orb = location.getWorld().spawn(location, ExperienceOrb.class);
orb.setExperience(orb.getExperience() + expAmount);
}
public static boolean AttemptRevive(Player p, double dmg) {
boolean revived=false;
if (p.getHealth()<=dmg) {
//This means we would die from this attack. Attempt to revive the player.
//Check all artifact armor for a perk.
ItemStack[] equips = p.getEquipment().getArmorContents();
for (int i=0;i<equips.length;i++) {
if (isArtifactEquip(equips[i]) && ArtifactAbility.containsEnchantment(ArtifactAbility.SURVIVOR, equips[i])) {
//We can revive!
RevivePlayer(p, p.getMaxHealth()*(getAbilityValue(ArtifactAbility.SURVIVOR,equips[i])/100d));
ArtifactAbility.removeEnchantment(ArtifactAbility.SURVIVOR, equips[i]);
revived=true;
Bukkit.broadcastMessage(ChatColor.GOLD+p.getName()+ChatColor.WHITE+" almost died... But came back to life!");
aPlugin.API.discordSendRawItalicized(ChatColor.GOLD+p.getName()+ChatColor.WHITE+" almost died... But came back to life!");
break;
}
}
}
return revived;
}
private static void RevivePlayer(Player p, double healdmg) {
p.setHealth(healdmg);
p.playSound(p.getLocation(), Sound.BLOCK_REDSTONE_TORCH_BURNOUT, 1.0f, 1.5f);
for (PotionEffect eff : p.getActivePotionEffects()) {
if (isBadEffect(eff.getType())) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin,
() -> {
p.removePotionEffect(eff.getType());
}, 1);
}
}
p.setFireTicks(0);
p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,20,0));
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,20,0));
}
public static void DealExplosionDamageToEntities(Location l, double basedmg, double range) {
List<Entity> nearbyentities = new ArrayList<Entity>();
nearbyentities.addAll(l.getWorld().getNearbyEntities(l, range, range, range));
for (int i=0;i<nearbyentities.size();i++) {
Entity ent = nearbyentities.get(i);
if (!(ent instanceof LivingEntity)) {
nearbyentities.remove(i);
i--;
}
}
//We cleared the non-living entities, deal damage to the rest.
for (int i=0;i<nearbyentities.size();i++) {
double damage_mult = 2.0d/(l.distance(nearbyentities.get(i).getLocation())+1.0);
damage_mult*=TwosideKeeper.EXPLOSION_DMG_MULT;
damage_mult*=CalculateBlastResistance((LivingEntity)nearbyentities.get(i));
double dmg = basedmg * damage_mult;
DealDamageToMob(dmg,(LivingEntity)nearbyentities.get(i),null,null,"Explosion");
}
}
private static double CalculateBlastResistance(LivingEntity l) {
int explosionlv = 0;
ItemStack[] equips = l.getEquipment().getArmorContents();
for (int i=0;i<equips.length;i++) {
if (equips[i]!=null && equips[i].getType()!=Material.AIR && equips[i].containsEnchantment(Enchantment.PROTECTION_EXPLOSIONS)) {
explosionlv+=equips[i].getEnchantmentLevel(Enchantment.PROTECTION_EXPLOSIONS);
}
}
return 1-(explosionlv*0.01);
}
public static void playProperEquipSound(Player p, Material type) {
switch (type) {
case LEATHER_HELMET:
case LEATHER_CHESTPLATE:
case LEATHER_LEGGINGS:
case LEATHER_BOOTS:{
p.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_LEATHER, 1.0f, 1.0f);
}break;
case IRON_HELMET:
case IRON_CHESTPLATE:
case IRON_LEGGINGS:
case IRON_BOOTS:{
p.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_IRON, 1.0f, 1.0f);
}break;
case GOLD_HELMET:
case GOLD_CHESTPLATE:
case GOLD_LEGGINGS:
case GOLD_BOOTS:{
p.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_GOLD, 1.0f, 1.0f);
}break;
case DIAMOND_HELMET:
case DIAMOND_CHESTPLATE:
case DIAMOND_LEGGINGS:
case DIAMOND_BOOTS:{
p.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_DIAMOND, 1.0f, 1.0f);
}break;
default:{
p.playSound(p.getLocation(), Sound.ITEM_ARMOR_EQUIP_GENERIC, 1.0f, 1.0f);
}
}
}
}

View File

@ -7,9 +7,12 @@ import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Monster;
@ -80,14 +83,15 @@ public class Habitation {
}
public void increaseHabitationLevels() {
for(int i=0;i<locationhashes.keySet().toArray().length;i++) {
String hash = (String)locationhashes.keySet().toArray()[i];
for(String hash : locationhashes.keySet()) {
int spawnamt = locationhashes.get(hash);
TwosideKeeper.log("[Habitat]Habitat Location "+hash+" has Spawn Amont "+spawnamt+".",4);
if (spawnamt<20) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin,
() -> {
locationhashes.remove(hash);
TwosideKeeper.log("[Habitat]It's now clear~!",4);
i--;
}, 1);
} else {
if (Math.random()<=0.5) {
locationhashes.put(hash, (int)(spawnamt*0.9));

View File

@ -400,6 +400,7 @@ public class NewCombat {
if (!m.hasPotionEffect(PotionEffectType.GLOWING)) {m.setTarget(p);}
if (TwosideKeeper.monsterdata.containsKey(m.getUniqueId())) {
MonsterStructure ms = (MonsterStructure)TwosideKeeper.monsterdata.get(m.getUniqueId());
ms.SetTarget(p);
} else {
TwosideKeeper.monsterdata.put(m.getUniqueId(),new MonsterStructure(m,p));
}

View File

@ -246,6 +246,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public static double ARTIFACT_RARITY=1.5; //The multiplier of artifact drops.
public static ServerType SERVER_TYPE=ServerType.TEST; //The type of server this is running on.
public static int COMMONITEMPCT=3;
public static List<ArtifactAbility> TEMPORARYABILITIES = new ArrayList<ArtifactAbility>();
public static final int DODGE_COOLDOWN=100;
public static final int DEATHMARK_COOLDOWN=240;
@ -384,6 +385,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
banksessions = new HashMap();
monsterdata = new HashMap<UUID,MonsterStructure>();
TEMPORARYABILITIES.add(ArtifactAbility.GREED);
TEMPORARYABILITIES.add(ArtifactAbility.SURVIVOR);
//tpstracker = new Lag();
//Let's not assume there are no players online. Load their data.
@ -2791,7 +2795,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.setCancelled(true);
if (ev.getPlayer().getEquipment().getItemInMainHand()==null || ev.getPlayer().getEquipment().getItemInMainHand().getType()==Material.AIR) {
ev.getPlayer().getEquipment().setItemInMainHand(ev.getItemDrop().getItemStack());
aPlugin.API.damageItem(ev.getPlayer(), ev.getItemDrop().getItemStack(), 400);
GenericFunctions.PerformRejuvenate(ev.getPlayer());
ev.getPlayer().getEquipment().setItemInMainHand(new ItemStack(Material.AIR));
}
@ -2826,8 +2829,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SLOW,(ex_version)?7:15,20));
}
if (!ex_version || second_charge) {
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), LINEDRIVE_COOLDOWN);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), LINEDRIVE_COOLDOWN);
pd.last_strikerspell=getServerTickTime();
}
ev.getPlayer().playSound(ev.getPlayer().getLocation(), Sound.UI_BUTTON_CLICK, 1.0f, 1.0f);
@ -2893,8 +2896,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (ex_version) {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), 160);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), LINEDRIVE_COOLDOWN);
aPlugin.API.sendCooldownPacket(ev.getPlayer(), ev.getItemDrop().getItemStack(), LINEDRIVE_COOLDOWN);
pd.last_strikerspell=getServerTickTime();
}
},17);
@ -3804,8 +3807,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (ev.getCause()==DamageCause.THORNS &&
GenericFunctions.isRanger(p)) {
dodgechance=1;
p.setHealth(p.getHealth()-0.25);
double dmg = p.getHealth()-0.25;
if (!GenericFunctions.AttemptRevive(p,dmg)) {
ev.setDamage(dmg);
p.playSound(p.getLocation(), Sound.ENCHANT_THORNS_HIT, 0.8f, 3.0f);
} else {
ev.setCancelled(true);
}
}
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
@ -3835,6 +3843,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (!ev.isCancelled() && GenericFunctions.AttemptRevive(p,ev.getFinalDamage())) {
ev.setCancelled(true);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
if (p!=null) {
@ -3867,7 +3879,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
ev.setDamage(NewCombat.CalculateDamageReduction(ev.getDamage()*EXPLOSION_DMG_MULT*((100-protectionlevel)*0.01),m,null));
double dmg = NewCombat.CalculateDamageReduction(ev.getDamage()*EXPLOSION_DMG_MULT*((100-protectionlevel)*0.01),m,null);
ev.setDamage(dmg);
//log("Damage is "+ev.getDamage(),4);
//ev.setDamage(CalculateDamageReduction(ev.getDamage()*EXPLOSION_DMG_MULT,p,null));
}
@ -3932,6 +3945,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
c.getLocation().getWorld().createExplosion(c.getLocation().getX(),c.getLocation().getY(),c.getLocation().getZ(),4.0f,false,false);
GenericFunctions.DealExplosionDamageToEntities(c.getLocation(), 6, 4);
}}
,10);
} else
@ -3940,6 +3954,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
c.getLocation().getWorld().createExplosion(c.getLocation().getX(),c.getLocation().getY(),c.getLocation().getZ(),6.0f,true,false);
GenericFunctions.DealExplosionDamageToEntities(c.getLocation(), 12, 6);
}}
,10);
} else
@ -3952,12 +3967,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
c.getLocation().getWorld().createExplosion(c.getLocation().getX()+offset.getX(),c.getLocation().getY()+offset.getY(),c.getLocation().getZ()+offset.getZ(),6.0f,true,false);
GenericFunctions.DealExplosionDamageToEntities(c.getLocation(), 12, 6);
}}
,val+4);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
c.getLocation().getWorld().createExplosion(c.getLocation().getX(),c.getLocation().getY(),c.getLocation().getZ(),8.0f,true,false);
GenericFunctions.DealExplosionDamageToEntities(c.getLocation(), 24, 8);
}}
,30);
}
@ -4012,10 +4029,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ev.setDamage(DamageModifier.BASE,storeddmg-CUSTOM_DAMAGE_IDENTIFIER);
ev.setDamage(storeddmg-CUSTOM_DAMAGE_IDENTIFIER);
log("New Damage: "+ev.getFinalDamage(),4);
if (ev.getEntity() instanceof Monster &&
ev.getDamager() instanceof Player) {
NewCombat.addMonsterToTargetList((Monster)ev.getEntity(), (Player)ev.getDamager());
}
} else {
double dmg = 0.0;
if (ev.getEntity() instanceof Player) {
@ -4065,6 +4078,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (ev.getCause()==DamageCause.THORNS) {
if (ev.getEntity() instanceof LivingEntity) {
NewCombat.setupTrueDamage(ev); //Apply this as true damage.
((LivingEntity)ev.getEntity()).setNoDamageTicks(10);
((LivingEntity)ev.getEntity()).damage(Math.min(GenericFunctions.getMaxThornsLevel((LivingEntity)ev.getDamager()),((LivingEntity)ev.getEntity()).getHealth()/0.05));
}
@ -4076,8 +4090,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
if (ev.getEntity() instanceof LivingEntity) {
((LivingEntity)ev.getEntity()).setNoDamageTicks(10);
final double oldhp=((LivingEntity)ev.getEntity()).getHealth();
if (ev.getEntity() instanceof Player) {
if (!GenericFunctions.AttemptRevive((Player)ev.getEntity(), dmg)) {
ev.setDamage(DamageModifier.BASE,dmg);
ev.setDamage(dmg);
} else {
ev.setCancelled(true);
}
}
if (NewCombat.getDamagerEntity(ev.getDamager()) instanceof Player) {
if (ev.getDamager() instanceof Projectile) {
ev.getDamager().remove();
@ -4095,9 +4116,6 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1);
}
GenericFunctions.knockOffGreed(p);
if (ev.getEntity() instanceof Monster) {
NewCombat.addMonsterToTargetList((Monster)ev.getEntity(), (Player)ev.getDamager());
}
}
}
} //Negative damage doesn't make sense. We'd apply it normally.
@ -4284,8 +4302,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public void run() {
if (mer.getLocation().getBlockY()<48) {
mer.getWorld().createExplosion(mer.getLocation().getBlockX(), mer.getLocation().getBlockY(), mer.getLocation().getBlockZ(), 3.0f, false, true);
GenericFunctions.DealExplosionDamageToEntities(mer.getLocation(), 8, 3);
} else {
mer.getWorld().createExplosion(mer.getLocation().getBlockX(), mer.getLocation().getBlockY(), mer.getLocation().getBlockZ(), 6.0f, false, false);
GenericFunctions.DealExplosionDamageToEntities(mer.getLocation(), 8, 6);
}
}}
,30);
@ -4311,8 +4331,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
public void run() {
if (mer1.getLocation().getBlockY()<48) {
mer1.getWorld().createExplosion(mer1.getLocation().getBlockX(), mer1.getLocation().getBlockY(), mer1.getLocation().getBlockZ(), 5.0f, true, true);
GenericFunctions.DealExplosionDamageToEntities(mer1.getLocation(), 12, 5);
} else {
mer1.getWorld().createExplosion(mer1.getLocation().getBlockX(), mer1.getLocation().getBlockY(), mer1.getLocation().getBlockZ(), 6.0f, true, false);
GenericFunctions.DealExplosionDamageToEntities(mer1.getLocation(), 12, 6);
}
}}
,30);
@ -4358,7 +4380,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
DeathManager.continueAction(p);
}
}
},20);
},1);
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
pd.hasDied=false;
}
@ -4484,7 +4506,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
GenericFunctions.RemovePermEnchantmentChance(p.getEquipment().getItemInMainHand(), p);
if (ArtifactAbility.containsEnchantment(ArtifactAbility.EARTHWAVE, p.getEquipment().getItemInMainHand()) &&
pd.target!=null && !pd.target.isDead() && pd.last_shovelspell<getServerTickTime()) {
if (pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())<=256) {
/*if (pd.target.getLocation().getWorld().equals(p.getWorld()) && pd.target.getLocation().distanceSquared(p.getLocation())<=256) {
final Player p1 = p;
AreaEffectCloud lp = (AreaEffectCloud)p.getWorld().spawnEntity(p.getLocation(), EntityType.AREA_EFFECT_CLOUD);
lp.setColor(Color.OLIVE);
@ -4532,7 +4555,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
} else {
pd.target=null;
}
}*/
}
}
}
@ -4682,6 +4705,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.getEquipment().setBoots(armor);
p.sendMessage(ChatColor.DARK_AQUA+"Automatically equipped "+ChatColor.YELLOW+(ev.getItem().getItemStack().getItemMeta().hasDisplayName()?ev.getItem().getItemStack().getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(ev.getItem().getItemStack())));
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
GenericFunctions.playProperEquipSound(p,armor.getType());
ev.getItem().remove();
ev.setCancelled(true);
} else
@ -4691,6 +4715,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.getEquipment().setLeggings(armor);
p.sendMessage(ChatColor.DARK_AQUA+"Automatically equipped "+ChatColor.YELLOW+(ev.getItem().getItemStack().getItemMeta().hasDisplayName()?ev.getItem().getItemStack().getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(ev.getItem().getItemStack())));
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
GenericFunctions.playProperEquipSound(p,armor.getType());
ev.getItem().remove();
ev.setCancelled(true);
} else
@ -4700,6 +4725,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.getEquipment().setChestplate(armor);
p.sendMessage(ChatColor.DARK_AQUA+"Automatically equipped "+ChatColor.YELLOW+(ev.getItem().getItemStack().getItemMeta().hasDisplayName()?ev.getItem().getItemStack().getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(ev.getItem().getItemStack())));
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
GenericFunctions.playProperEquipSound(p,armor.getType());
ev.getItem().remove();
ev.setCancelled(true);
} else
@ -4709,6 +4735,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.getEquipment().setHelmet(armor);
p.sendMessage(ChatColor.DARK_AQUA+"Automatically equipped "+ChatColor.YELLOW+(ev.getItem().getItemStack().getItemMeta().hasDisplayName()?ev.getItem().getItemStack().getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(ev.getItem().getItemStack())));
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
GenericFunctions.playProperEquipSound(p,armor.getType());
ev.getItem().remove();
ev.setCancelled(true);
} else
@ -4719,6 +4746,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.getInventory().setExtraContents(new ItemStack[]{armor});
p.sendMessage(ChatColor.DARK_AQUA+"Automatically equipped "+ChatColor.YELLOW+(ev.getItem().getItemStack().getItemMeta().hasDisplayName()?ev.getItem().getItemStack().getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(ev.getItem().getItemStack())));
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_PICKUP, 1.0f, 1.0f);
GenericFunctions.playProperEquipSound(p,armor.getType());
ev.getItem().remove();
ev.setCancelled(true);
}
@ -5084,7 +5112,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
if (items_found==2 && slot_found!=0 && ev.getInventory().getResult().getType()!=null && ev.getInventory().getResult().getType()!=Material.AIR) {
log("Artifact tier: "+artifact_tier+", Tier Found: "+tier_found,2);
if (artifact_tier!=tier_found || tier_found==10) {
if (artifact_tier!=tier_found || tier_found==15) {
ev.getInventory().setResult(new ItemStack(Material.AIR));
} else {
ItemStack newitem = ArtifactItemType.getTypeFromData(ev.getInventory().getItem(slot_found).getDurability()).getTieredItem(tier_found+1);
@ -5128,7 +5156,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
int tier = ev.getInventory().getItem(slot_found).getEnchantmentLevel(Enchantment.LUCK);
log("This is tier "+tier+". Enchantment level of "+ev.getInventory().getItem(slot_found).toString(),5);
//Decompose this into a higher tier of the next item.
if (tier==tier_recipe && tier<9) {
if (tier==tier_recipe && tier<14) {
ItemStack newitem1 = Artifact.convert(new ItemStack(Material.STAINED_GLASS_PANE,1,ev.getInventory().getItem(slot_found).getDurability()));
ItemMeta m = newitem1.getItemMeta();
List<String> lore = m.getLore();
@ -5152,7 +5180,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
ItemStack newitem1 = Artifact.convert(new ItemStack(Material.STAINED_GLASS_PANE,1,ev.getInventory().getItem(slot_found).getDurability()));
ItemMeta m = newitem1.getItemMeta();
List<String> lore = m.getLore();
int tier=10;
int tier=14;
lore.add(0,ChatColor.GOLD+""+ChatColor.BOLD+"T"+(tier)+" Crafting Recipe");
//lore.add(1,ChatColor.GOLD+""+ChatColor.BOLD+"T"+tier+ChatColor.RESET+ChatColor.GOLD+" "+GenericFunctions.CapitalizeFirstLetters(item.getItemName())+" Recipe");