Adjusted how Leader Withers spawned loot containers to allow players

more chances at getting items from individual containers. More
participants in a fight lead to more rewards.
testdev
sigonasr2 8 years ago
parent 1fc4adb469
commit e7bfc1324e
  1. BIN
      TwosideKeeper.jar
  2. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/Loot.java
  3. 4
      src/sig/plugin/TwosideKeeper/Monster/Wither.java
  4. 26
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -194,7 +194,7 @@ public class Loot {
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new SigDrop(1,5,"[Leader Wither] Hardened Tool",SigDrop.HARDENED,SigDrop.SET,SigDrop.TOOL,LivingEntityDifficulty.DANGEROUS));
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(aPlugin.API.getChestItem(Chests.ELITE),5));
aPlugin.API.Chests.LOOT_CUSTOM_5.addDrop(new DropItem(Christmas.getChristmasBox(),5));
aPlugin.API.Chests.LOOT_CUSTOM_5.setProbability(0.2);
aPlugin.API.Chests.LOOT_CUSTOM_5.setProbability(0.8);
aPlugin.API.Chests.LOOT_CUSTOM_5.printDrops();
//aPlugin.API.Chests..addDrop(new DropItem(TwosideKeeper.HUNTERS_COMPASS.getItemStack(),10));

@ -39,6 +39,10 @@ public class Wither extends CustomMonster{
this.lastSkullShot=TwosideKeeper.getServerTickTime();
}
public List<Player> getActiveParticipants() {
return activeplayers;
}
public long getLastSkullShot() {
return lastSkullShot;
}

@ -6465,18 +6465,30 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
//Spawn 8 chests at different quadrants.
AttemptToPlaceChest(m.getLocation(),-1,-1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),1,1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),1,-1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
/*
AttemptToPlaceChest(m.getLocation(),-1,-1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),1,-1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),-1,-1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),-1,1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),-1,1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),1,1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),1,1,1,aPlugin.API.Chests.LOOT_CUSTOM_5);
AttemptToPlaceChest(m.getLocation(),1,1,-1,aPlugin.API.Chests.LOOT_CUSTOM_5);*/
double chance_to_place_reward_chest = 0.0;
for (UUID id : custommonsters.keySet()) {
if (id.equals(m.getUniqueId())) {
sig.plugin.TwosideKeeper.Monster.Wither w = (sig.plugin.TwosideKeeper.Monster.Wither)custommonsters.get(id);
chance_to_place_reward_chest = (w.getActiveParticipants().size()-2)*(1/6d);
Integer[] chest_positions = new Integer[]{
-1,-1,-1,
1,-1,1,
-1,-1,1,
-1,1,-1,
-1,1,1,
1,1,-1};
PlaceWitherLootChestsWithDefinedLayout(m, chance_to_place_reward_chest, chest_positions);
w.DisplaySuccessfulDPSReport();
break;
}
@ -6698,6 +6710,14 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
custommonsters.remove(m.getUniqueId());
}
}
public void PlaceWitherLootChestsWithDefinedLayout(LivingEntity m, double chance_to_place_reward_chest,
Integer[] chest_positions) {
for (int i=0;i<chest_positions.length/3;i++) {
if (Math.random()<=chance_to_place_reward_chest) {
AttemptToPlaceChest(m.getLocation(),chest_positions[0+i*3],chest_positions[1+i*3],chest_positions[2+i*3],aPlugin.API.Chests.LOOT_CUSTOM_5);
}
}
}
private void AttemptToPlaceChest(Location refloc, int i, int j, int k, Chests chest) {
int tries=0;

Loading…
Cancel
Save