|
|
@ -21,6 +21,7 @@ import net.milkbowl.vault.economy.EconomyResponse; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.bukkit.Bukkit; |
|
|
|
import org.bukkit.Bukkit; |
|
|
|
import org.bukkit.ChatColor; |
|
|
|
import org.bukkit.ChatColor; |
|
|
|
import org.bukkit.Chunk; |
|
|
|
import org.bukkit.Chunk; |
|
|
@ -178,6 +179,8 @@ import org.bukkit.scoreboard.Team; |
|
|
|
import org.bukkit.util.Vector; |
|
|
|
import org.bukkit.util.Vector; |
|
|
|
import org.bukkit.potion.Potion; |
|
|
|
import org.bukkit.potion.Potion; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import sig.ItemSets.DiabloDropsHook; |
|
|
|
|
|
|
|
|
|
|
|
import com.google.common.base.Objects; |
|
|
|
import com.google.common.base.Objects; |
|
|
|
import com.sk89q.worldedit.CuboidClipboard; |
|
|
|
import com.sk89q.worldedit.CuboidClipboard; |
|
|
|
import com.sk89q.worldedit.EditSession; |
|
|
|
import com.sk89q.worldedit.EditSession; |
|
|
@ -319,7 +322,7 @@ implements Listener |
|
|
|
if (this.plugin.PlayerinJob(p, "Enchanter") && this.plugin.getJobLv("Enchanter", p)>=5) { |
|
|
|
if (this.plugin.PlayerinJob(p, "Enchanter") && this.plugin.getJobLv("Enchanter", p)>=5) { |
|
|
|
e.setAmount(e.getAmount()*2); |
|
|
|
e.setAmount(e.getAmount()*2); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) { |
|
|
|
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled") || this.plugin.getConfig().getBoolean("thanksgiving-enabled")) { |
|
|
|
e.setAmount(e.getAmount()*2); |
|
|
|
e.setAmount(e.getAmount()*2); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) { |
|
|
|
if (this.plugin.getAccountsConfig().getBoolean(p.getName().toLowerCase()+".settings.notify3")) { |
|
|
@ -5279,6 +5282,8 @@ implements Listener |
|
|
|
// 2 = mythic item
|
|
|
|
// 2 = mythic item
|
|
|
|
// 3 = plentiful items
|
|
|
|
// 3 = plentiful items
|
|
|
|
// 4 = multiple items
|
|
|
|
// 4 = multiple items
|
|
|
|
|
|
|
|
// 5 = chaos items (diablodrops items)
|
|
|
|
|
|
|
|
// 999 = Survivor's kit
|
|
|
|
switch (tier) { |
|
|
|
switch (tier) { |
|
|
|
case 1: { |
|
|
|
case 1: { |
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
@ -5288,13 +5293,13 @@ implements Listener |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 3: { |
|
|
|
case 3: { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.LOG, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.NETHER_BRICK, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.RAW_FISH, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.RAW_FISH, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.BOOKSHELF, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.HAY_BLOCK, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.CLAY, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.CLAY, (int)(Math.random() * 64) + 1)); |
|
|
@ -5303,36 +5308,57 @@ implements Listener |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.EXP_BOTTLE, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.EXP_BOTTLE, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.OBSIDIAN, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.NOTE_BLOCK, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.MOSSY_COBBLESTONE, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.MOSSY_COBBLESTONE, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.HAY_BLOCK, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.BOOKSHELF, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.QUARTZ_BLOCK, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.QUARTZ_BLOCK, (int)(Math.random() * 64) + 1)); |
|
|
|
} else |
|
|
|
} else |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
if (Math.random() < 0.1) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.NETHER_BRICK, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.OBSIDIAN, (int)(Math.random() * 64) + 1)); |
|
|
|
|
|
|
|
} else |
|
|
|
|
|
|
|
if (Math.random() < 0.1) { |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.REDSTONE_LAMP_OFF, (int)(Math.random() * 64) + 1)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
// Damn you got unlucky, better try next time
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WOOL, (int)(Math.random() * 64) + 1)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WOOL, (int)(Math.random() * 64) + 1)); |
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 4: { |
|
|
|
case 4: { |
|
|
|
// Drop at least one stack, and five rolls for a 20% chance at an extra stack.
|
|
|
|
// Drop at least two stacks, and four rolls for a 20% chance at an extra stack.
|
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
for (int i = 0; i < 4; i++) { |
|
|
|
|
|
|
|
// Averages one extra drop. Can be up to 4.
|
|
|
|
if (Math.random() < 0.2) { |
|
|
|
if (Math.random() < 0.2) { |
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
|
loc.getWorld().dropItemNaturally(loc, getGoodie(0)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 5: { |
|
|
|
case 5: { |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, DiabloDropsHook.getRandomItem()); |
|
|
|
|
|
|
|
for (int i = 0; i < 10 && Math.random() < 0.2; i++) { |
|
|
|
|
|
|
|
// 20% for one extra, 4% for two extra, 0.8% for three extra, etc.
|
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, DiabloDropsHook.getRandomItem()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}break; |
|
|
|
|
|
|
|
case 6: { |
|
|
|
// OMG NOT CODED YET WTF THIS SHOULDN'T HAPPEN
|
|
|
|
// OMG NOT CODED YET WTF THIS SHOULDN'T HAPPEN
|
|
|
|
}break; |
|
|
|
}break; |
|
|
|
|
|
|
|
case 999: { |
|
|
|
|
|
|
|
// Not yet obtainable
|
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WORKBENCH)); |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.FURNACE)); |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.WOOD, 16)); |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.COBBLESTONE, 16)); |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.TORCH, 16)); |
|
|
|
|
|
|
|
loc.getWorld().dropItemNaturally(loc, new ItemStack(Material.BREAD, 16)); |
|
|
|
|
|
|
|
}break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -5343,7 +5369,7 @@ implements Listener |
|
|
|
|
|
|
|
|
|
|
|
public ItemStack getGoodie(int rar /*1=Mythical 0=Normal -1=Only an equipment*/) { |
|
|
|
public ItemStack getGoodie(int rar /*1=Mythical 0=Normal -1=Only an equipment*/) { |
|
|
|
ItemStack item = null; |
|
|
|
ItemStack item = null; |
|
|
|
if (Math.random()<0.33 || rar==-1) { |
|
|
|
if (Math.random()<0.33 || rar==-1 || rar==1) { |
|
|
|
//Add a weapon/armor piece.
|
|
|
|
//Add a weapon/armor piece.
|
|
|
|
int rand = (int)(Math.random()*5); |
|
|
|
int rand = (int)(Math.random()*5); |
|
|
|
String type = ""; |
|
|
|
String type = ""; |
|
|
@ -6225,7 +6251,7 @@ implements Listener |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled")) { |
|
|
|
if (this.plugin.getAccountsConfig().getBoolean("halloween-enabled") || this.plugin.getConfig().getBoolean("thanksgiving-enabled")) { |
|
|
|
e.setDroppedExp(e.getDroppedExp()*2); |
|
|
|
e.setDroppedExp(e.getDroppedExp()*2); |
|
|
|
} |
|
|
|
} |
|
|
|
if (f.getKiller()!=null && f.getKiller().getType()==EntityType.PLAYER) { |
|
|
|
if (f.getKiller()!=null && f.getKiller().getType()==EntityType.PLAYER) { |
|
|
@ -6480,9 +6506,23 @@ implements Listener |
|
|
|
@EventHandler |
|
|
|
@EventHandler |
|
|
|
public void onFishCatch(PlayerFishEvent e) { |
|
|
|
public void onFishCatch(PlayerFishEvent e) { |
|
|
|
if (e.getState()==State.CAUGHT_FISH) { |
|
|
|
if (e.getState()==State.CAUGHT_FISH) { |
|
|
|
if (this.plugin.getConfig().getBoolean("thanksgiving-enabled") && Math.random() < 0.10) { |
|
|
|
if (this.plugin.getConfig().getBoolean("thanksgiving-enabled")) { |
|
|
|
// 5% chance of fishing up a loot chest
|
|
|
|
if (Math.random() < 0.50) { |
|
|
|
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), this.plugin.generate_LootChest()); |
|
|
|
// 50% chance of fishing up a chicken plus feathers
|
|
|
|
|
|
|
|
e.setExpToDrop(e.getExpToDrop() * 2); |
|
|
|
|
|
|
|
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), new ItemStack(Material.RAW_CHICKEN)); |
|
|
|
|
|
|
|
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), new ItemStack(Material.FEATHER, 1 + (int)(Math.random() * 4))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (int c = 0; c < 5 && Math.random() < 0.20; c++) { |
|
|
|
|
|
|
|
// 20% chance each of catching additional fish
|
|
|
|
|
|
|
|
e.setExpToDrop(e.getExpToDrop() + (int)(Math.random() * 6) + 1); |
|
|
|
|
|
|
|
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), new ItemStack(Material.RAW_FISH)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Math.random() < 0.10) { |
|
|
|
|
|
|
|
// 10% chance of fishing up a loot chest
|
|
|
|
|
|
|
|
e.setExpToDrop(e.getExpToDrop() + (int)(Math.random() * 6) + 1); |
|
|
|
|
|
|
|
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation(), this.plugin.generate_LootChest()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Player p = e.getPlayer(); |
|
|
|
Player p = e.getPlayer(); |
|
|
|
if (this.plugin.PlayerinJob(p, "Fisherman")) { |
|
|
|
if (this.plugin.PlayerinJob(p, "Fisherman")) { |
|
|
@ -11529,7 +11569,7 @@ implements Listener |
|
|
|
item = new ItemStack(Material.BROWN_MUSHROOM); |
|
|
|
item = new ItemStack(Material.BROWN_MUSHROOM); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 92:{ |
|
|
|
case 92:{ |
|
|
|
item = new ItemStack(Material.SNOW_BALL); |
|
|
|
item = new ItemStack(Material.SNOW_BALL, 1 + (int)(Math.random() * 16)); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 93:{ |
|
|
|
case 93:{ |
|
|
|
item = new ItemStack(Material.FENCE); |
|
|
|
item = new ItemStack(Material.FENCE); |
|
|
@ -11697,7 +11737,7 @@ implements Listener |
|
|
|
item = new ItemStack(Material.DIAMOND); |
|
|
|
item = new ItemStack(Material.DIAMOND); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 3:{ |
|
|
|
case 3:{ |
|
|
|
item = new ItemStack(Material.GOLD_INGOT); |
|
|
|
item = new ItemStack(Material.GOLD_INGOT, 1 + (int)(Math.random() * 2)); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 4:{ |
|
|
|
case 4:{ |
|
|
|
item = new ItemStack(Material.GOLDEN_APPLE); |
|
|
|
item = new ItemStack(Material.GOLDEN_APPLE); |
|
|
@ -11756,7 +11796,7 @@ implements Listener |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
case 3:{ |
|
|
|
case 3:{ |
|
|
|
item = new ItemStack(Material.SKULL_ITEM); |
|
|
|
item = new ItemStack(Material.SKULL_ITEM, 1 + (int)(Math.random() * 6)); |
|
|
|
item.setData(new MaterialData(Material.SKULL_ITEM, (byte) 1)); |
|
|
|
item.setData(new MaterialData(Material.SKULL_ITEM, (byte) 1)); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 4:{ |
|
|
|
case 4:{ |
|
|
@ -11774,13 +11814,13 @@ implements Listener |
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 107:{ |
|
|
|
case 107:{ |
|
|
|
item = new ItemStack(Material.COOKIE, 8); |
|
|
|
item = new ItemStack(Material.COOKIE, 1 + (int)(Math.random() * 8)); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 108:{ |
|
|
|
case 108:{ |
|
|
|
item = new ItemStack(Material.SEEDS, 42); |
|
|
|
item = new ItemStack(Material.SEEDS, 1 + (int)(Math.random() * 64)); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 109:{ |
|
|
|
case 109:{ |
|
|
|
item = new ItemStack(Material.PAINTING, 16); |
|
|
|
item = new ItemStack(Material.PAINTING, 1 + (int)(Math.random() * 32)); |
|
|
|
}break; |
|
|
|
}break; |
|
|
|
case 110:{ |
|
|
|
case 110:{ |
|
|
|
item = getGoodie(0); |
|
|
|
item = getGoodie(0); |
|
|
|