Merge branch 'master_event2' into master_event

master_event
Nonoriri 11 years ago
commit c0c2321a7c
  1. 27
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 80
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
  3. 6
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -3716,7 +3716,7 @@ public void payDay(int time)
public void gainMoneyExp(Player p,String job,double amount,double exp) { public void gainMoneyExp(Player p,String job,double amount,double exp) {
String[] jobs = getJobs(p); String[] jobs = getJobs(p);
int slot=-1; int slot=-1;
if (getConfig().getBoolean("halloween-enabled")) { if (getConfig().getBoolean("halloween-enabled") || getConfig().getBoolean("thanksgiving-enabled")) {
amount*=2; amount*=2;
exp*=2; exp*=2;
} }
@ -3805,7 +3805,7 @@ public void payDay(int time)
public void gainMoney(Player p,String job,double amount) { public void gainMoney(Player p,String job,double amount) {
String[] jobs = getJobs(p); String[] jobs = getJobs(p);
int slot=-1; int slot=-1;
if (getConfig().getBoolean("halloween-enabled")) { if (getConfig().getBoolean("halloween-enabled") || getConfig().getBoolean("thanksgiving-enabled")) {
amount*=2; amount*=2;
} }
//Add to how much we've earned so far. //Add to how much we've earned so far.
@ -4716,6 +4716,9 @@ public void payDay(int time)
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of")) { if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"You can feel a variety of")) {
return 4; // Multiloot return 4; // Multiloot
} }
if (chest.getItemMeta().getLore().get(i).equalsIgnoreCase(ChatColor.GRAY+""+ChatColor.ITALIC+"A torrential flow of dark")) {
return 5; // Chaos loot
}
} }
@ -4767,9 +4770,23 @@ public void payDay(int time)
chest_name.setLore(chestlore); chest_name.setLore(chestlore);
chest.setItemMeta(chest_name); chest.setItemMeta(chest_name);
} else if (rand < 0.1 || tier == 4) { } else if (rand < 0.04 || tier == 5) {
// Generate a double chest // Generate a chaos chest
chest_name.setDisplayName(ChatColor.YELLOW+"Closed Chest"); chest_name.setDisplayName(ChatColor.RED+"Chaos Chest");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A torrential flow of dark");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"energy causes the chest to");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"shake uncontrollably! You");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"have absolutely zero idea");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"what may be inside.");
chest_name.setLore(chestlore);
chest.setItemMeta(chest_name);
} else if (rand < 0.12 || tier == 4) {
// Generate a loaded chest
chest_name.setDisplayName(ChatColor.YELLOW+"Loaded Chest");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!"); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"A mysterious chest!");
chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+""); chestlore.add(ChatColor.GRAY+""+ChatColor.ITALIC+"");

@ -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);

@ -559,9 +559,13 @@ public String convertToItemName(String val) {
} }
} }
if (args[0].equalsIgnoreCase("loot")) { if (args[0].equalsIgnoreCase("loot")) {
p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest()); } p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest());
}
} else } else
if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) { if (cmd.getName().toLowerCase().equalsIgnoreCase("event") && args.length==2 && p.hasPermission("maintenance-mode-admin")) {
if (args[0].equalsIgnoreCase("loot")) {
p.getWorld().dropItemNaturally(p.getLocation(), this.plugin.generate_LootChest(Integer.valueOf(args[1])));
}
if (args[0].equalsIgnoreCase("head")) { if (args[0].equalsIgnoreCase("head")) {
ItemStack m = new ItemStack(Material.SKULL_ITEM, 64, (short)SkullType.PLAYER.ordinal()); ItemStack m = new ItemStack(Material.SKULL_ITEM, 64, (short)SkullType.PLAYER.ordinal());
SkullMeta skullMeta = (SkullMeta) m.getItemMeta(); SkullMeta skullMeta = (SkullMeta) m.getItemMeta();

Loading…
Cancel
Save