->During thunderstorms, mobs will have a normal spawn rate, even on the
surface. ->Basic item decomposition has been removed. Transmutation through Alchemy is the preferred method to decompose materials now. ->Zombie minion damage slightly nerfed. ->You know how I said Anvil renaming was really fixed, like really, and I meant it? Well, I now I really mean it for the last time. Really. ->Ranger Close Mode receieves modifications: ---> Rangers that kill a mob in Close Range mode will obtain a "Full Dodge" buff. This buff lasts until the player takes damage from any damage source. The buff provides 100% dodge chance. ---> Rangers can now tumble by holding shift and left-clicking to gain 1 second of invincibility and a speed buff. Rangers who have a full set will gain 3 seconds of invincibility from this ability.
This commit is contained in:
parent
2f0304f9f1
commit
ca2b7c8a79
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: TwosideKeeper
|
||||
main: sig.plugin.TwosideKeeper.TwosideKeeper
|
||||
version: 3.6.1r1
|
||||
version: 3.6.2
|
||||
commands:
|
||||
money:
|
||||
description: Tells the player the amount of money they are holding.
|
||||
|
52
src/sig/plugin/TwosideKeeper/HelperStructures/AnvilItem.java
Normal file
52
src/sig/plugin/TwosideKeeper/HelperStructures/AnvilItem.java
Normal file
@ -0,0 +1,52 @@
|
||||
package sig.plugin.TwosideKeeper.HelperStructures;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import sig.plugin.TwosideKeeper.TwosideKeeper;
|
||||
|
||||
public class AnvilItem {
|
||||
ItemStack olditem;
|
||||
ItemStack newitem;
|
||||
|
||||
public AnvilItem(ItemStack olditem, ItemStack newitem) {
|
||||
this.olditem=olditem;
|
||||
this.newitem=newitem;
|
||||
}
|
||||
|
||||
public static boolean validitem(ItemStack item) {
|
||||
return (item!=null && item.getType()!=Material.AIR &&
|
||||
item.hasItemMeta() && item.getItemMeta().hasDisplayName());
|
||||
}
|
||||
|
||||
public String getColorCodes() {
|
||||
ItemMeta m = olditem.getItemMeta();
|
||||
return m.getDisplayName().replace(ChatColor.stripColor(m.getDisplayName()), "");
|
||||
}
|
||||
|
||||
public ItemStack renameItemProperly() {
|
||||
if (validitem(olditem) && validitem(newitem)) {
|
||||
//Input Item : ᶲ2+Test New Item: 2Jelly
|
||||
String var = getColorCodes(); //var = ChatColor.RED (ᶲ2)
|
||||
TwosideKeeper.log("var = "+var, 2);
|
||||
String newcol = newitem.getItemMeta().getDisplayName(); //2Jelly
|
||||
String colors = "";
|
||||
if (var.length()>=2) {
|
||||
colors = var.replace(ChatColor.COLOR_CHAR+"", ""); //2
|
||||
}
|
||||
|
||||
if (newcol.indexOf(colors)==0) {
|
||||
//See if the new name starts with the color codes.
|
||||
ItemMeta m = newitem.getItemMeta();
|
||||
m.setDisplayName(newcol.replace(colors, var)); //ᶲ2+jelly
|
||||
newitem.setItemMeta(m);
|
||||
return newitem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return newitem;
|
||||
}
|
||||
}
|
@ -2377,6 +2377,9 @@ public class GenericFunctions {
|
||||
if (isRanger(p)) {
|
||||
dodgechance+=0.5;
|
||||
}
|
||||
if (pd.fulldodge) {
|
||||
dodgechance = 1.0;
|
||||
}
|
||||
return dodgechance;
|
||||
}
|
||||
|
||||
|
@ -37,13 +37,19 @@ public class MonsterController {
|
||||
* @return Returns false if this spawn is not allowed.
|
||||
*/
|
||||
public static boolean MobHeightControl(LivingEntity ent, boolean minion) {
|
||||
|
||||
if (ent instanceof Monster) {
|
||||
Monster m = (Monster)ent;
|
||||
m.setAI(true);
|
||||
}
|
||||
|
||||
//Modify spawning algorithm.
|
||||
int ylv = ent.getLocation().getBlockY();
|
||||
if (minion) {
|
||||
ylv+=16;
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,999999,1));
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,999999,1));
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,4));
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE,999999,0));
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE,999999,3));
|
||||
ent.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,999999,4));
|
||||
}
|
||||
if (isZombieLeader(ent)) {
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -64,6 +65,10 @@ public class PlayerStructure {
|
||||
public boolean hasfullrangerset=false;
|
||||
public double lastarrowpower=0;
|
||||
public int headshotcombo=0;
|
||||
public List<InventoryView> itemcubeviews;
|
||||
public boolean openinginventory=false;
|
||||
public boolean fulldodge=false;
|
||||
public long last_dodge=TwosideKeeper.getServerTickTime();
|
||||
|
||||
public double prev_weapondmg=0.0;
|
||||
public double prev_buffdmg=0.0;
|
||||
@ -105,6 +110,10 @@ public class PlayerStructure {
|
||||
this.nextarrowxp=0;
|
||||
this.hasfullrangerset=false;
|
||||
this.last_strikerspell=TwosideKeeper.getServerTickTime();
|
||||
this.itemcubeviews = new ArrayList<InventoryView>();
|
||||
this.openinginventory = false;
|
||||
this.fulldodge=false;
|
||||
this.last_dodge=TwosideKeeper.getServerTickTime();
|
||||
//Set defaults first, in case this is a new user.
|
||||
loadConfig();
|
||||
|
||||
|
@ -158,6 +158,7 @@ import net.md_5.bungee.api.chat.HoverEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.minecraft.server.v1_9_R1.MinecraftServer;
|
||||
import net.minecraft.server.v1_9_R1.Vector3f;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.AnvilItem;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactAbility;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItem;
|
||||
import sig.plugin.TwosideKeeper.HelperStructures.ArtifactItemType;
|
||||
@ -269,7 +270,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_ItemCube_Recipes();
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_ArrowQuiver_Recipe();
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_BlockArmor_Recipes();
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_ItemDeconstruction_Recipes();
|
||||
//sig.plugin.TwosideKeeper.Recipes.Initialize_ItemDeconstruction_Recipes();
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_WoolRecolor_Recipes();
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_SlabReconstruction_Recipes();
|
||||
sig.plugin.TwosideKeeper.Recipes.Initialize_Artifact_Recipes();
|
||||
@ -826,6 +827,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
p.getLocation().add(0,0,0).getBlock().setType(Material.AIR);
|
||||
}
|
||||
if (SERVER_TYPE==ServerType.TEST || SERVER_TYPE==ServerType.QUIET) {
|
||||
TwosideKeeperAPI.spawnAdjustedMonster(MonsterType.GIANT, p.getLocation());
|
||||
//GenericFunctions.setBowMode(p.getEquipment().getItemInMainHand(), BowMode.SNIPE);
|
||||
//p.sendMessage("This is bow mode "+GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand()));
|
||||
/*for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
@ -1797,6 +1799,31 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
//Check for a roll attempt here.
|
||||
if ((ev.getAction()==Action.LEFT_CLICK_AIR || ev.getAction()==Action.LEFT_CLICK_BLOCK)) {
|
||||
Player p = ev.getPlayer();
|
||||
if (p.isSneaking() && p.isOnGround() && GenericFunctions.isRanger(p) &&
|
||||
GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) {
|
||||
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
|
||||
if (pd.last_dodge+100<=getServerTickTime()) {
|
||||
pd.last_dodge=getServerTickTime();
|
||||
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100);
|
||||
aPlugin.API.sendCooldownPacket(p, p.getEquipment().getItemInMainHand(), 100);
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_DONKEY_CHEST, 1.0f, 1.0f);
|
||||
|
||||
int dodgeduration = 20;
|
||||
|
||||
if (GenericFunctions.HasFullRangerSet(p)) {
|
||||
dodgeduration=60;
|
||||
}
|
||||
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,dodgeduration,0));
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,dodgeduration,2));
|
||||
p.addPotionEffect(new PotionEffect(PotionEffectType.GLOWING,dodgeduration,0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for a Scythe right click here.
|
||||
if ((ev.getAction()==Action.RIGHT_CLICK_AIR || ev.getAction()==Action.RIGHT_CLICK_BLOCK) &&
|
||||
GenericFunctions.isArtifactEquip(player.getEquipment().getItemInMainHand())) {
|
||||
@ -2789,6 +2816,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.getResult().setItemMeta(m);
|
||||
ev.setResult(ev.getResult());
|
||||
} else {
|
||||
AnvilItem item = new AnvilItem(ev.getInventory().getItem(0),ev.getResult());
|
||||
ev.setResult(item.renameItemProperly());
|
||||
/*if (ev.getResult()!=null &&
|
||||
ev.getInventory().getItem(0)!=null &&
|
||||
ev.getInventory().getItem(0).getItemMeta().hasDisplayName()) {
|
||||
@ -3192,6 +3221,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
if (!ItemCube.isSomeoneViewingItemCube(idnumb,p)) {
|
||||
ev.setCancelled(true);
|
||||
ev.setResult(Result.DENY);
|
||||
//pd.itemcubeviews.add(p.getOpenInventory());
|
||||
InventoryView newinv = p.openInventory(Bukkit.getServer().createInventory(p, inventory_size, "Item Cube #"+idnumb));
|
||||
openItemCubeInventory(newinv.getTopInventory(),newinv);
|
||||
pd.isViewingItemCube=true;
|
||||
@ -3200,7 +3230,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
ev.setCancelled(true);
|
||||
ev.setResult(Result.DENY);
|
||||
//ItemCube.displayErrorMessage(p);
|
||||
p.openInventory(ItemCube.getViewingItemCubeInventory(idnumb, p));
|
||||
//pd.itemcubeviews.add(p.getOpenInventory());
|
||||
p.openInventory(ItemCube.getViewingItemCubeInventory(idnumb, p));
|
||||
pd.isViewingItemCube=true;
|
||||
p.playSound(p.getLocation(), Sound.BLOCK_CHEST_OPEN, 1.0f, 1.0f);
|
||||
}
|
||||
@ -3533,37 +3564,47 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
//final double pcthp = ((p.getHealth())/p.getMaxHealth())*100;
|
||||
|
||||
double dodgechance = GenericFunctions.CalculateDodgeChance(p);
|
||||
|
||||
if (ev.getCause()==DamageCause.THORNS &&
|
||||
GenericFunctions.isRanger(p)) {
|
||||
dodgechance=1;
|
||||
}
|
||||
|
||||
if (Math.random()<=dodgechance) {
|
||||
//Cancel this event, we dodged the attack.
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
|
||||
log("Triggered Dodge.",2);
|
||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
ItemStack equip = p.getEquipment().getArmorContents()[i];
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GRACEFULDODGE, equip)) {
|
||||
p.addPotionEffect(
|
||||
new PotionEffect(PotionEffectType.GLOWING,
|
||||
(int)(ArtifactAbility.calculateValue(ArtifactAbility.GRACEFULDODGE, equip.getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.GRACEFULDODGE, equip))*20),
|
||||
0)
|
||||
);
|
||||
}
|
||||
}
|
||||
ev.setCancelled(true);
|
||||
}
|
||||
//If glowing, the player is invulnerable.
|
||||
if (p.hasPotionEffect(PotionEffectType.GLOWING)) {
|
||||
p.setNoDamageTicks(20);
|
||||
ev.setCancelled(true);
|
||||
} else {
|
||||
//Dodge should not activate when we have invincibility frames.
|
||||
|
||||
//final double pcthp = ((p.getHealth())/p.getMaxHealth())*100;
|
||||
|
||||
double dodgechance = GenericFunctions.CalculateDodgeChance(p);
|
||||
|
||||
if (ev.getCause()==DamageCause.THORNS &&
|
||||
GenericFunctions.isRanger(p)) {
|
||||
dodgechance=1;
|
||||
}
|
||||
|
||||
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
|
||||
|
||||
if (pd.fulldodge) {
|
||||
pd.fulldodge=false;
|
||||
}
|
||||
|
||||
if (Math.random()<=dodgechance) {
|
||||
//Cancel this event, we dodged the attack.
|
||||
p.playSound(p.getLocation(), Sound.ENTITY_PLAYER_ATTACK_SWEEP, 3.0f, 1.0f);
|
||||
log("Triggered Dodge.",2);
|
||||
for (int i=0;i<p.getEquipment().getArmorContents().length;i++) {
|
||||
ItemStack equip = p.getEquipment().getArmorContents()[i];
|
||||
if (ArtifactAbility.containsEnchantment(ArtifactAbility.GRACEFULDODGE, equip)) {
|
||||
p.addPotionEffect(
|
||||
new PotionEffect(PotionEffectType.GLOWING,
|
||||
(int)(ArtifactAbility.calculateValue(ArtifactAbility.GRACEFULDODGE, equip.getEnchantmentLevel(Enchantment.LUCK), ArtifactAbility.getEnchantmentLevel(ArtifactAbility.GRACEFULDODGE, equip))*20),
|
||||
0)
|
||||
);
|
||||
}
|
||||
}
|
||||
ev.setCancelled(true);
|
||||
}
|
||||
log("Dodge chance is "+dodgechance,5);
|
||||
|
||||
}
|
||||
log("Dodge chance is "+dodgechance,5);
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
public void run() {
|
||||
@ -4313,6 +4354,12 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
|
||||
|
||||
if (GenericFunctions.isRanger(p) &&
|
||||
GenericFunctions.getBowMode(p.getEquipment().getItemInMainHand())==BowMode.CLOSE) {
|
||||
pd.fulldodge=true;
|
||||
}
|
||||
|
||||
dropmult+=pd.partybonus*0.33; //Party bonus increases drop rate by 33% per party member.
|
||||
ItemStack item = p.getEquipment().getItemInMainHand();
|
||||
if (item!=null &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user