->Suppress
Ability now available for Artifact Shovels.
->Loot has been redone to make Slayer drops more fair and not as ridiculous. ->Baubles can randomly break on death. Hardened baubles will lose a break remaining when this occurs. ->Fixed random bugs. ->Artifact tier now appears in item info display when linking artifact items.
This commit is contained in:
parent
325987d401
commit
417ab2d367
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.8.6
|
||||
version: 3.8.6a
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
14
src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java
Normal file
14
src/sig/plugin/TwosideKeeper/ActionBarBuffUpdater.java
Normal file
@ -0,0 +1,14 @@
|
||||
package sig.plugin.TwosideKeeper;
|
||||
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
public class ActionBarBuffUpdater implements Runnable{
|
||||
PotionEffectType type;
|
||||
int ticks_remaining;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -458,6 +458,7 @@ public class CustomDamage {
|
||||
triggerEliteHitEvent(p,target,damage);
|
||||
subtractWeaponDurability(p,weapon);
|
||||
aPlugin.API.showDamage(target, GetHeartAmount(damage));
|
||||
suppressTarget(p,weapon,target);
|
||||
pd.slayermegahit=false;
|
||||
pd.lastcombat=TwosideKeeper.getServerTickTime();
|
||||
|
||||
@ -2138,4 +2139,10 @@ public class CustomDamage {
|
||||
}
|
||||
return mult;
|
||||
}
|
||||
|
||||
private static void suppressTarget(Player p, ItemStack weapon, LivingEntity target) {
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.SUPPRESS, weapon)) {
|
||||
GenericFunctions.addSuppressionTime(target, (int)(GenericFunctions.getAbilityValue(ArtifactAbility.SUPPRESS, weapon)*20));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,9 +85,9 @@ public enum ArtifactAbility {
|
||||
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,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),
|
||||
SUPPRESS("Suppression","Suppresses a mob on hit for [VAL] seconds.\n\n"
|
||||
+ "Suppression prevents movement, attacking, exploding, and teleportation."+LevelCost(10),new double[]{0.1,0.12,0.14,0.16,0.18,0.2,0.22,0.24,0.26,0.28,0.3,0.34,0.38,0.42,0.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},10,10,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,35,40,45,50,70},
|
||||
@ -451,7 +451,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.equals(ArtifactAbility.GRACEFULDODGE)) {
|
||||
if (ability.equals(ArtifactAbility.GRACEFULDODGE) ||
|
||||
ability.equals(ArtifactAbility.SUPPRESS)) {
|
||||
//Remove a level from using a temporary ability.
|
||||
AwakenedArtifact.addAP(item, -9);
|
||||
}
|
||||
|
@ -3253,7 +3253,25 @@ public class GenericFunctions {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
pd.lastdamagetaken=dmg;
|
||||
pd.lasthitdesc=reason;
|
||||
|
||||
ItemStack[] equips = p.getEquipment().getArmorContents();
|
||||
ItemStack[] hotbar = GenericFunctions.getHotbarItems(p);
|
||||
|
||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(hotbar, p, ItemSet.GLADOMAIN, 5) &&
|
||||
pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p)<=TwosideKeeper.getServerTickTime()) {
|
||||
pd.lastlifesavertime=TwosideKeeper.getServerTickTime();
|
||||
RevivePlayer(p,p.getMaxHealth());
|
||||
pd.slayermodehp = p.getMaxHealth();
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {GenericFunctions.applyStealth(p,false);}
|
||||
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED, 20*10, 3, p, true);
|
||||
deAggroNearbyTargets(p);
|
||||
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!");
|
||||
aPlugin.API.sendCooldownPacket(p, Material.SKULL_ITEM, GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p));
|
||||
return true;
|
||||
}
|
||||
|
||||
List<ItemStack> equips_with_survivor = new ArrayList<ItemStack>();
|
||||
for (int i=0;i<equips.length;i++) {
|
||||
if (isArtifactEquip(equips[i]) && ArtifactAbility.containsEnchantment(ArtifactAbility.SURVIVOR, equips[i])) {
|
||||
@ -3269,25 +3287,42 @@ public class GenericFunctions {
|
||||
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!");
|
||||
return true;
|
||||
}
|
||||
ItemStack[] hotbar = GenericFunctions.getHotbarItems(p);
|
||||
if (ItemSet.HasSetBonusBasedOnSetBonusCount(hotbar, p, ItemSet.GLADOMAIN, 5) &&
|
||||
pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p)<=TwosideKeeper.getServerTickTime()) {
|
||||
pd.lastlifesavertime=TwosideKeeper.getServerTickTime();
|
||||
RevivePlayer(p,p.getMaxHealth());
|
||||
pd.slayermodehp = p.getMaxHealth();
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {GenericFunctions.applyStealth(p,false);}
|
||||
GenericFunctions.logAndApplyPotionEffectToPlayer(PotionEffectType.SPEED, 20*10, 3, p, true);
|
||||
deAggroNearbyTargets(p);
|
||||
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!");
|
||||
aPlugin.API.sendCooldownPacket(p, Material.SKULL_ITEM, GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN, p));
|
||||
}
|
||||
|
||||
RandomlyBreakBaubles(p,hotbar);
|
||||
}
|
||||
return revived;
|
||||
}
|
||||
|
||||
private static void RandomlyBreakBaubles(Player p, ItemStack[] hotbar) {
|
||||
for (int i=0;i<9;i++) {
|
||||
ItemSet set = ItemSet.GetSet(hotbar[i]);
|
||||
if (set!=null) {
|
||||
if (set==ItemSet.GLADOMAIN ||
|
||||
set==ItemSet.MOONSHADOW) {
|
||||
if (Math.random()<=1/8d) {
|
||||
BreakBauble(p,i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void BreakBauble(Player p, int i) {
|
||||
ItemStack item = p.getInventory().getContents()[i];
|
||||
if (GenericFunctions.isHardenedItem(item)) {
|
||||
int breaks = GenericFunctions.getHardenedItemBreaks(item);
|
||||
if (breaks>0) {
|
||||
p.getInventory().setItem(i,GenericFunctions.addHardenedItemBreaks(item, -1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
p.getInventory().setItem(i, new ItemStack(Material.AIR));
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_ITEM_BREAK, 1.0f, 1.0f);
|
||||
p.sendMessage(ChatColor.GOLD+""+ChatColor.BOLD+"Unlucky! "+ChatColor.RESET+ChatColor.DARK_RED+"Your "+ChatColor.YELLOW+((item.hasItemMeta() && item.getItemMeta().hasDisplayName())?item.getItemMeta().getDisplayName():GenericFunctions.UserFriendlyMaterialName(item))+ChatColor.DARK_RED+" has broken!");
|
||||
}
|
||||
|
||||
public static void deAggroNearbyTargets(Player p) {
|
||||
List<Monster> monsters = getNearbyMobs(p.getLocation(),8);
|
||||
for (Monster m : monsters) {
|
||||
|
@ -45,6 +45,10 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.LEATHER_CHESTPLATE,78));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.LEATHER_LEGGINGS,78));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.LEATHER_BOOTS,78));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.SKULL_ITEM,8));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.SKULL_ITEM,8));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.SKULL_ITEM,8));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.addDrop(new DropMaterial(Material.SKULL_ITEM,8));
|
||||
aPlugin.API.Chests.LOOT_NORMAL.printDrops();
|
||||
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.IRON_INGOT,1000));
|
||||
@ -58,6 +62,10 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.STONE_HOE,8));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.STONE_SPADE,8));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.FISHING_ROD,8));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.SKULL_ITEM,16));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.SKULL_ITEM,16));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.SKULL_ITEM,16));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropMaterial(Material.SKULL_ITEM,16));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.ANCIENT_CORE),4));
|
||||
aPlugin.API.Chests.LOOT_DANGEROUS.printDrops();
|
||||
|
||||
@ -78,6 +86,10 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.DIAMOND_HELMET,78));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.FISHING_ROD,8));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.BOW,8));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.SKULL_ITEM,32));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.SKULL_ITEM,32));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.SKULL_ITEM,32));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropMaterial(Material.SKULL_ITEM,32));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.LOST_CORE),4));
|
||||
aPlugin.API.Chests.LOOT_DEADLY.printDrops();
|
||||
|
||||
@ -103,6 +115,10 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.GOLD_LEGGINGS,78));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.GOLD_BOOTS,78));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.GOLD_HELMET,78));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.SKULL_ITEM,64));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.SKULL_ITEM,64));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.SKULL_ITEM,64));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropMaterial(Material.SKULL_ITEM,64));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE),4));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.addDrop(new DropItem(TwosideKeeper.HUNTERS_COMPASS.getItemStack(),4));
|
||||
aPlugin.API.Chests.LOOT_HELLFIRE.printDrops();
|
||||
@ -123,6 +139,10 @@ public class Loot {
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.GOLD_LEGGINGS,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.GOLD_BOOTS,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.GOLD_HELMET,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.SKULL_ITEM,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.SKULL_ITEM,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.SKULL_ITEM,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropMaterial(Material.SKULL_ITEM,78));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.addDrop(new DropItem(Artifact.createArtifactItem(ArtifactItem.DIVINE_CORE),4));
|
||||
aPlugin.API.Chests.LOOT_CUSTOM.printDrops();
|
||||
|
||||
@ -481,9 +501,16 @@ public class Loot {
|
||||
List<String> lore = new ArrayList<String>();
|
||||
String set_name = "";
|
||||
String prefix = "";
|
||||
boolean allowed=true; //Setting this to false will not convert it to a set piece.
|
||||
prefix = (hardened)?(ChatColor.LIGHT_PURPLE+""+ChatColor.BOLD+"Hardened Mega "):(ChatColor.AQUA+""+ChatColor.BOLD+"Mega ");
|
||||
switch (set) {
|
||||
case PANROS:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
|
||||
} else
|
||||
if (!GenericFunctions.isEquip(item)) {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+"Panros Striker "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Striker set.
|
||||
}break;
|
||||
@ -491,6 +518,9 @@ public class Loot {
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.SHIELD);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!GenericFunctions.isEquip(item)) {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+"Songsteel Defender "+GenericFunctions.UserFriendlyMaterialName(item.getType()); //Defender set.
|
||||
@ -498,13 +528,16 @@ public class Loot {
|
||||
case DAWNTRACKER:{
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.valueOf(item.getType().toString().replace("SWORD","")+"AXE"));
|
||||
} else
|
||||
if (!GenericFunctions.isEquip(item)) {
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+"Dawntracker Barbarian "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
}break;
|
||||
case LORASYS:{
|
||||
if (!item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.IRON_SWORD);
|
||||
allowed = false;
|
||||
}
|
||||
tierbonus = (custom)?tierbonus:modifyTierBonus(item,tierbonus);
|
||||
set_name = prefix+"Lorasys Slayer "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
@ -513,6 +546,9 @@ public class Loot {
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Jamdak Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (Math.random()<=0.5 && tierbonus<2) {
|
||||
@ -523,6 +559,9 @@ public class Loot {
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Darnys Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (Math.random()<=0.5 && tierbonus<1) {
|
||||
@ -533,6 +572,9 @@ public class Loot {
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Alikahn Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (Math.random()<=0.1 && tierbonus<1) {
|
||||
@ -543,6 +585,9 @@ public class Loot {
|
||||
if (item.getType().toString().contains("SWORD")) {
|
||||
item.setType(Material.BOW);
|
||||
tierbonus/=(custom)?1:2;
|
||||
} else
|
||||
if (!item.getType().toString().contains("LEATHER")) {
|
||||
allowed = false;
|
||||
}
|
||||
set_name = prefix+"Lorasaadi Ranger "+GenericFunctions.UserFriendlyMaterialName(item.getType());
|
||||
if (tierbonus>0 && Math.random()<=0.5) {
|
||||
@ -550,7 +595,11 @@ public class Loot {
|
||||
}
|
||||
}break;
|
||||
case GLADOMAIN:{
|
||||
item.setType(Material.SKULL_ITEM);
|
||||
//item.setType(Material.SKULL_ITEM); else
|
||||
if (!item.getType().toString().contains("SKULL_ITEM")) {
|
||||
allowed = false;
|
||||
break;
|
||||
}
|
||||
item.setDurability((short)2);
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
@ -558,7 +607,11 @@ public class Loot {
|
||||
set_name = prefix+"Gladomain Slayer Amulet";
|
||||
}break;
|
||||
case MOONSHADOW:{
|
||||
item.setType(Material.SKULL_ITEM);
|
||||
if (!item.getType().toString().contains("SKULL_ITEM")) {
|
||||
allowed = false;
|
||||
break;
|
||||
}
|
||||
//item.setType(Material.SKULL_ITEM);
|
||||
item.setDurability((short)0);
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
@ -571,11 +624,13 @@ public class Loot {
|
||||
}
|
||||
int tier = tierbonus;
|
||||
do {tier++;} while(Math.random()<=0.25);
|
||||
lore.addAll(ItemSet.GenerateLore(set,tier));
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.setLore(lore);
|
||||
m.setDisplayName(set_name);
|
||||
item.setItemMeta(m);
|
||||
if (allowed) {
|
||||
lore.addAll(ItemSet.GenerateLore(set,tier));
|
||||
ItemMeta m = item.getItemMeta();
|
||||
m.setLore(lore);
|
||||
m.setDisplayName(set_name);
|
||||
item.setItemMeta(m);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
|
@ -3,12 +3,14 @@ package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Monster;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import aPlugin.API.Chests;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
@ -301,16 +303,21 @@ public enum MonsterDifficulty {
|
||||
LivingEntity shooter = CustomDamage.getDamagerEntity(damager);
|
||||
if (shooter instanceof Player) {
|
||||
Player p = (Player)shooter;
|
||||
if (GenericFunctions.isEquip(goodie)) {
|
||||
if (Math.random()<0.8 && isValidSetItem(goodie)) {
|
||||
if (isValidSetItem(goodie)) {
|
||||
if (Math.random()<0.8) {
|
||||
//Convert it to a set piece.
|
||||
PlayerMode pm = PlayerMode.getPlayerMode(p);
|
||||
ItemSet set = PickAnItemSet(pm);
|
||||
goodie = ConvertSetPieceIfNecessary(goodie, set);
|
||||
goodie = Loot.GenerateSetPiece(goodie.getType(), set, (Math.random()<0.1)?true:false, 0, false);
|
||||
if (AllowedToConvert(pm,goodie)) {
|
||||
ItemSet set = PickAnItemSet(pm,goodie);
|
||||
goodie = ConvertSetPieceIfNecessary(goodie, set);
|
||||
goodie = Loot.GenerateSetPiece(goodie.getType(), set, (Math.random()<0.1)?true:false, 0, false);
|
||||
}
|
||||
} else {
|
||||
//Convert it to a mega piece.
|
||||
goodie = Loot.GenerateMegaPiece(goodie.getType(), (Math.random()<0.1)?true:false);
|
||||
PlayerMode pm = PlayerMode.getPlayerMode(p);
|
||||
if (AllowedToConvert(pm,goodie)) {
|
||||
goodie = Loot.GenerateMegaPiece(goodie.getType(), (Math.random()<0.1)?true:false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -318,8 +325,19 @@ public enum MonsterDifficulty {
|
||||
droplist.add(goodie);
|
||||
}
|
||||
|
||||
private boolean AllowedToConvert(PlayerMode pm, ItemStack goodie) {
|
||||
if (goodie.getType()==Material.SKULL_ITEM && pm!=PlayerMode.NORMAL && pm!=PlayerMode.SLAYER) {
|
||||
goodie.setDurability((short)3);
|
||||
SkullMeta sm = (SkullMeta)goodie.getItemMeta();
|
||||
sm.setOwner(Bukkit.getOfflinePlayers()[(int)(Math.random()*Bukkit.getOfflinePlayers().length)].getName());
|
||||
goodie.setItemMeta(sm);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private ItemStack ConvertSetPieceIfNecessary(ItemStack goodie, ItemSet set) {
|
||||
if ((set==ItemSet.JAMDAK ||
|
||||
/*if ((set==ItemSet.JAMDAK ||
|
||||
set==ItemSet.ALIKAHN ||
|
||||
set==ItemSet.DARNYS ||
|
||||
set==ItemSet.LORASAADI) &&
|
||||
@ -334,7 +352,7 @@ public enum MonsterDifficulty {
|
||||
set==ItemSet.LORASAADI) &&
|
||||
GenericFunctions.isArmor(goodie)) {
|
||||
goodie.setType(Material.valueOf("IRON_"+goodie.getType().name().split("_")[1]));
|
||||
}
|
||||
}*/
|
||||
return goodie;
|
||||
}
|
||||
|
||||
@ -342,7 +360,7 @@ public enum MonsterDifficulty {
|
||||
return TwosideKeeper.validsetitems.contains(goodie.getType());
|
||||
}
|
||||
|
||||
public ItemSet PickAnItemSet(PlayerMode pm) {
|
||||
public ItemSet PickAnItemSet(PlayerMode pm, ItemStack item) {
|
||||
ItemSet set;
|
||||
switch (pm) {
|
||||
case STRIKER:{
|
||||
|
@ -108,6 +108,12 @@ public class WorldShop {
|
||||
public static String GetItemInfo(ItemStack item) {
|
||||
//Gets all the info about this item in one gigantic string. (Separated by new lines. Useful for tellraw()).
|
||||
String message = "";
|
||||
if (GenericFunctions.isArtifactEquip(item)) {
|
||||
if (item.hasItemMeta() &&
|
||||
item.getItemMeta().hasDisplayName()) {
|
||||
message+="\n"+ChatColor.GOLD+ChatColor.BOLD+"T"+item.getEnchantmentLevel(Enchantment.LUCK)+ChatColor.RESET+ChatColor.GOLD+" "+GenericFunctions.UserFriendlyMaterialName(item.getType())+" Artifact \n";
|
||||
}
|
||||
} else
|
||||
if (item.hasItemMeta() &&
|
||||
item.getItemMeta().hasDisplayName()) {
|
||||
message+="\n"+ChatColor.DARK_GRAY+"Item Type: "+ChatColor.ITALIC+ChatColor.GRAY+GenericFunctions.UserFriendlyMaterialName(item.getType())+"\n";
|
||||
|
@ -1132,6 +1132,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
validsetitems.add(Material.IRON_SWORD);
|
||||
validsetitems.add(Material.DIAMOND_SWORD);
|
||||
validsetitems.add(Material.GOLD_SWORD);
|
||||
validsetitems.add(Material.SKULL_ITEM);
|
||||
|
||||
TEMPORARYABILITIES.add(ArtifactAbility.GREED);
|
||||
TEMPORARYABILITIES.add(ArtifactAbility.SURVIVOR);
|
||||
@ -3797,10 +3798,11 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
//ItemCubeWindow.removeAllItemCubeWindows((Player)ev.getWhoClicked());
|
||||
Player p = (Player)ev.getWhoClicked();
|
||||
pd = PlayerStructure.GetPlayerStructure(p);
|
||||
ItemCubeWindow.popItemCubeWindow((Player)ev.getWhoClicked());
|
||||
//
|
||||
pd.opened_another_cube=true;
|
||||
ev.getWhoClicked().closeInventory();
|
||||
if (pd.itemcubelist.size()==0) {ev.getWhoClicked().closeInventory();}
|
||||
pd.opened_another_cube=false;
|
||||
ItemCubeWindow.popItemCubeWindow((Player)ev.getWhoClicked());
|
||||
}
|
||||
}
|
||||
|
||||
@ -4782,7 +4784,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER && pd.lastassassinatetime+20>getServerTickTime()) {
|
||||
pd.lastassassinatetime=getServerTickTime()-GenericFunctions.GetModifiedCooldown(TwosideKeeper.ASSASSINATE_COOLDOWN,p);
|
||||
ItemStack[] inv = p.getInventory().getContents();
|
||||
for (int i=0;i<8;i++) {
|
||||
for (int i=0;i<9;i++) {
|
||||
if (inv[i]!=null && (inv[i].getType()!=Material.SKULL_ITEM || pd.lastlifesavertime+GenericFunctions.GetModifiedCooldown(TwosideKeeper.LIFESAVER_COOLDOWN,p)<TwosideKeeper.getServerTickTime())) {
|
||||
aPlugin.API.sendCooldownPacket(p, inv[i], 0);
|
||||
}
|
||||
@ -4793,7 +4795,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
List<Monster> mobs = GenericFunctions.getNearbyMobs(m.getLocation(), 8);
|
||||
for (Monster m1 : mobs) {
|
||||
if (!m1.equals(m)) {
|
||||
pd.lastassassinatetime=0;
|
||||
CustomDamage.ApplyDamage(0,p,m1,p.getEquipment().getItemInMainHand(),"AoE Damage",CustomDamage.NOAOE);
|
||||
if (m1.isDead()) {
|
||||
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 39, 2);
|
||||
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.SPEED, 10*20, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
GenericFunctions.addStackingPotionEffect(p, PotionEffectType.INCREASE_DAMAGE, 10*20, 39, 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user