From fb74bb080077fea95960cccceeef589c5458db28 Mon Sep 17 00:00:00 2001 From: Innocentius Date: Thu, 23 Apr 2015 11:12:00 -0500 Subject: [PATCH] init commit --- cjfw/.classpath | 26 + cjfw/.gitignore | 1 + cjfw/.project | 23 + cjfw/.settings/org.eclipse.jdt.core.prefs | 5 + cjfw/.settings/org.eclipse.m2e.core.prefs | 4 + cjfw/META-INF/MANIFEST.MF | 2 + cjfw/plugin.yml | 30 + cjfw/pom.xml | 35 + .../innocentius/net/cjfw/CJFWListener.class | Bin 0 -> 71170 bytes .../innocentius/net/cjfw/CJFWListener.java | 3416 +++++++++++++++++ .../www/innocentius/net/cjfw/CJFWmain$1.class | Bin 0 -> 908 bytes .../www/innocentius/net/cjfw/CJFWmain$2.class | Bin 0 -> 970 bytes cjfw/www/innocentius/net/cjfw/CJFWmain.class | Bin 0 -> 6229 bytes cjfw/www/innocentius/net/cjfw/CJFWmain.java | 274 ++ 14 files changed, 3816 insertions(+) create mode 100644 cjfw/.classpath create mode 100644 cjfw/.gitignore create mode 100644 cjfw/.project create mode 100644 cjfw/.settings/org.eclipse.jdt.core.prefs create mode 100644 cjfw/.settings/org.eclipse.m2e.core.prefs create mode 100644 cjfw/META-INF/MANIFEST.MF create mode 100644 cjfw/plugin.yml create mode 100644 cjfw/pom.xml create mode 100644 cjfw/www/innocentius/net/cjfw/CJFWListener.class create mode 100644 cjfw/www/innocentius/net/cjfw/CJFWListener.java create mode 100644 cjfw/www/innocentius/net/cjfw/CJFWmain$1.class create mode 100644 cjfw/www/innocentius/net/cjfw/CJFWmain$2.class create mode 100644 cjfw/www/innocentius/net/cjfw/CJFWmain.class create mode 100644 cjfw/www/innocentius/net/cjfw/CJFWmain.java diff --git a/cjfw/.classpath b/cjfw/.classpath new file mode 100644 index 0000000..01edbc4 --- /dev/null +++ b/cjfw/.classpath @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cjfw/.gitignore b/cjfw/.gitignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/cjfw/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/cjfw/.project b/cjfw/.project new file mode 100644 index 0000000..cbe0c74 --- /dev/null +++ b/cjfw/.project @@ -0,0 +1,23 @@ + + + CJFWPlugin + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/cjfw/.settings/org.eclipse.jdt.core.prefs b/cjfw/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..d59e09c --- /dev/null +++ b/cjfw/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/cjfw/.settings/org.eclipse.m2e.core.prefs b/cjfw/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..14b697b --- /dev/null +++ b/cjfw/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/cjfw/META-INF/MANIFEST.MF b/cjfw/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/cjfw/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/cjfw/plugin.yml b/cjfw/plugin.yml new file mode 100644 index 0000000..5c86e6a --- /dev/null +++ b/cjfw/plugin.yml @@ -0,0 +1,30 @@ +name: DesertBaseDefence +main: www.innocentius.net.cjfw.CJFWmain +version: 1.0.0-REVGAME +website: http://www.innocentius.net/wordpress +description: > + CJFWmain +commands: + cjfw: + description: the control for the whole game + permission: cjfw.admin + usage: | + /cjfw - for a hello message and this usage page + /cjfw init - init the game, DO THIS BEFORE SETBASE + /cjfw start - start game, MUST initialize first + /cjfw stop - pause game, can use start to re-open the game from current process. + /cjfw reset - reset critical parameter for re-init + /cjfw rank - broadcast rank of current players, COULD ONLY BE USED AFTER GAME IS FINISHED + /cjfw choose - INVALID_let player choose their career + /cjfw showhp - show current hp of base, must start game + /cjfw showloc - show the current position of bases. + /cjfw setdiff - set the difficulty of game, 1 as default, 0 as no mobs spawned, DON'T GO BEYOND 3 + + /cjfw setbase - set the location of three bases, basenumber must be 1 for blue or 2 for aqua or 3 for purple, DO THIS AFTER INIT + /cjfw heal - heal a base 5% with sender's name, ONLY USE THIS IN COM_BLOCK + /cjfw fortify - fortify a base for 3 sec with sender's name, ONLY USE IN COM_BLOCK + +permissions: + cjfw.admin: + description: op has the control of game + default: op \ No newline at end of file diff --git a/cjfw/pom.xml b/cjfw/pom.xml new file mode 100644 index 0000000..8e20aff --- /dev/null +++ b/cjfw/pom.xml @@ -0,0 +1,35 @@ + + 4.0.0 + www.innocentius.net + CJFWPlugin + 1.0.0 + Cai_Jue_Ji_Di_Fang_Wei_Zhan + The plugin is for a short game, 30min bases + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + + + + bukkit-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + + + + org.bukkit + bukkit + 1.8-R0.1-SNAPSHOT + + + + \ No newline at end of file diff --git a/cjfw/www/innocentius/net/cjfw/CJFWListener.class b/cjfw/www/innocentius/net/cjfw/CJFWListener.class new file mode 100644 index 0000000000000000000000000000000000000000..1aab599bbec873fac7f16400baae06864d9d7475 GIT binary patch literal 71170 zcmeEv2V4}_+V?qU&de;ZN>>pJSOGy)6crRJ_7<^3Qw$<17BGM@reeq53s{0(V{Zud z^xk{FN!SI_`%P|glkb0KW_M?oMa}(^o4oJu&Gj;~r#|O7Pd{az{`K4?LP&f5p-LDf zE$7Uc6Q7lxos*H7ou4&3FFrdnKR#pH$u2K5^|Br7jJGdnX^C7hCgY3X;Q$InR5 zo)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fRuEKGw831vmr@(=~_jHczhLjj!Kyf01M zTsEMzw^5YE8HtQdqYM$0#c8500~3C-wreg&JgYAGSiTrw$!ljL=H|XxJhuVGzm2NY z7Q?rljxT%t-y)l + * The class will handle everything happens in the game, include: + * The initialize of game + * The state of game + * INVALID_The calculation of player score during game + * The calculation of damage to base during game + * The calculation of player action to base + * + * @author Michael_Innocentius_Shellingford + * + */ + +@SuppressWarnings("deprecation") +public class CJFWListener implements Listener +{ + boolean on; + boolean init; + Random random; + int wave; + int player_count; + int wave_time; + int bonus_time; + int back_timer; + boolean finish; + boolean wave9_switch; + boolean bonus_switch; + boolean bonus_finish_switch; + boolean last_boss_phase1; + boolean last_boss_phase2; + boolean last_boss_phase3; + double difficulty; + Wither final_boss; + LivingEntity last_boss; + Zombie last_boss1; + Zombie last_boss2; + Zombie last_boss3; + //LivingEntity tp; //debug use + Scoreboard sb; + UUID x; + Map baselist = new HashMap(); + Map Base_HP = new HashMap(); + Map Base_damageable = new HashMap(); + Map Player_score = new HashMap(); + Map Player_use_heal = new HashMap(); + Map Player_use_fort = new HashMap(); + /** + * Create a new CJFWListener object. + * Contains: + * on - the switch of game, false for default + * random - the random seed for game use + * wave - the stage of game + * player - the total player of game + */ + public CJFWListener () + { + on = false; + init = false; + random = new Random(); + wave = -1; + player_count = 0; + wave_time = 0; + finish = false; + difficulty = 1; + } + /** + * reset the game. + */ + public void reset() + { + on = false; + init = false; + baselist.clear(); + Base_HP.clear(); + Base_damageable.clear(); + Player_score.clear(); + Player_use_heal.clear(); + Player_use_fort.clear(); + wave9_switch = false; + bonus_switch = false; + bonus_finish_switch = false; + last_boss_phase1 = false; + last_boss_phase2 = false; + last_boss_phase3 = false; + last_boss = null; + last_boss1 = null; + last_boss2 = null; + last_boss3 = null; + final_boss = null; + back_timer = 0; + player_count = 0; + bonus_time = 0; + finish = false; + wave = -1; + wave_time = 0; + difficulty = 1; + try + { + sb.getObjective("cjfw").unregister(); + sb.getObjective("contri_point").unregister(); + } + catch(Exception x) + { + + } + } + /** + * initialize the game. + * initialize also calls reset(), making sure it was properly reset + * @param back_timer + */ + public void init() + { + reset(); + wave = 0; + wave_time = -1; + finish = false; + wave9_switch = false; + bonus_switch = false; + bonus_finish_switch = false; + sb = Bukkit.getServer().getScoreboardManager().getMainScoreboard(); + int i = Bukkit.getOnlinePlayers().length; + player_count = i; + last_boss_phase1 = false; + last_boss_phase2 = false; + last_boss_phase3 = false; + difficulty = 1; + bonus_time = 0; + back_timer = 0; + int hpfull = counthp(player_count); + Base_HP.put("BLUE", hpfull); + Base_HP.put("AQUA", hpfull); + Base_HP.put("PURPLE", hpfull); + Base_damageable.put("BLUE", true); + Base_damageable.put("AQUA", true); + Base_damageable.put("PURPLE", true); + try + { + sb.registerNewObjective("cjfw", "dummy"); + + sb.registerNewObjective("contri_point", "totalKillCount"); + } + catch(Exception x) + { + + } + sb.getObjective("cjfw").setDisplayName("GameStat"); + sb.getObjective("cjfw").setDisplaySlot(DisplaySlot.SIDEBAR); + sb.getObjective("contri_point").setDisplayName("Kill"); + sb.getObjective("contri_point").setDisplaySlot(DisplaySlot.BELOW_NAME); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set Wave cjfw " + wave); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set Time cjfw " + wave_time); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set BLUE cjfw " + Base_HP.get("BLUE")); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set AQUA cjfw " + Base_HP.get("AQUA")); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set PURPLE cjfw " + Base_HP.get("PURPLE")); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard objectives setdisplay sidebar cjfw"); + init = true; + } + /** + * start the game. + * @return true if game is successfully started, false if not + */ + public boolean start() + { + if(on) + { + return false; + } + else + { + if(!init) + { + Bukkit.getConsoleSender().sendMessage("Game start without init, may flaw"); + return false; + } + if(baselist.get("BLUE") == null || baselist.get("AQUA") == null || + baselist.get("PURPLE") == null) + { + return false; + } + else + { + on = true; + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + return true; + } + } + } + /** + * pause the game. + * @return true if successfully stopped, false if not + */ + public boolean stop() + { + if(!on) + { + return false; + } + else + { + on = false; + return true; + } + } + /** + * the method to modify the hit point of base + * @param basename - the name of base which will be modified + * @param amount - the amount which hitpoint will be modified, + or - + */ + private void HPModify(String basename, int amount) + { + if(Base_HP.containsKey(basename)) + { + if(Base_HP.get(basename) != 0) + { + Base_HP.put(basename, Base_HP.get(basename) + amount); + if(Base_HP.get(basename) < 0) + { + Base_HP.put(basename, 0); + } + else if(Base_HP.get(basename) > counthp(player_count)) + { + Base_HP.put(basename, counthp(player_count)); + } + } + } + } + /** + * Count the base hp for bases based on the base player count and basic counting method. + * + * @param i the players online + * @return the number of base hp of base + */ + public int counthp(int i) + { + int hp = 0; + if(i > 20) + { + hp = 4000 + (i - 20) * 150; + } + else if(i > 10 && i <= 20) + { + hp = 2000 + (i - 10) * 200; + } + else + { + hp = 2000; + } + return hp; + } + /** + * get location of the player calling this method. + * WARNING!: THIS METHOD WILL NOT WORK ON CONSOLE! + * @param name the name of player called this method. + * @return the location of the player called this method. + */ + public Location getloc(String name) + { + + return Bukkit.getPlayer(name).getLocation(); + } + /** + * set the location for three bases + * @param basenum - the number represent base + * @param i - location of base + */ + public void setbaselocation(int basenum, Location i) + { + String basekey; + if(!on) + { + if(basenum == 1) + { + basekey = "BLUE"; + } + else if(basenum == 2) + { + basekey = "AQUA"; + } + else if(basenum == 3) + { + basekey = "PURPLE"; + } + else + { + basekey = "FOO"; + } + baselist.put(basekey, i); + } + } + /** + * The sender will receive the current hp of bases. + * If not on or init, this method will send error messages. + * @param sender - the sender who called the method. + */ + public void showhp(CommandSender sender) + { + if(!on) + { + sender.sendMessage(ChatColor.RED+"The game is not " + + "running!"); + } + else if(!init) + { + sender.sendMessage(ChatColor.RED+"The game is not initialized!"); + } + else + { + sender.sendMessage("BLUE: " + Base_HP.get("BLUE").toString()); + sender.sendMessage("AUQA: " + Base_HP.get("AQUA").toString()); + sender.sendMessage("PURPLE :" + Base_HP.get("PURPLE").toString()); + } + } + /** + * Goes when a Ender Dragon dies + * To prevent the unknown bug caused by the death of dragon + * Remove it from game when detect its death. + * @param kill + */ + @EventHandler + public void onDragonDeath(EntityDeathEvent kill) + { + if(on) + { + if(kill.getEntity() instanceof EnderDragon) + { + kill.getEntity().remove(); + } + } + } + /** + * Goes of when explode. + * It checks if the explode is caused by creeper. + * It then checks the distance between the explode and tower + * if < 26 distance, the tower will be damaged + * @param boom - the event of boom. + */ + @EventHandler + public void onCreeperBomb(EntityExplodeEvent boom) + { + if(on) + { + if(boom.getEntity() instanceof Creeper) + { + if(baselist.get("BLUE") != null && baselist.get("AQUA") != null && + baselist.get("PURPLE") != null) + { + Location a = boom.getLocation(); + if(boom.getLocation().getWorld() == baselist.get("BLUE").getWorld() + &&boom.getLocation().getWorld() == baselist.get("AQUA").getWorld() + &&boom.getLocation().getWorld() == baselist.get("PURPLE").getWorld()) + { + if(Math.pow((a.getX() - baselist.get("AQUA").getX()), 2) + Math.pow((a.getZ() - baselist.get("AQUA").getZ()), 2) < 676 + && Base_damageable.get("AQUA")) + { + HPModify("AQUA", -100); + } + if(Math.pow((a.getX() - baselist.get("BLUE").getX()), 2) + Math.pow((a.getZ() - baselist.get("BLUE").getZ()), 2) < 676 + && Base_damageable.get("BLUE")) + { + HPModify("BLUE", -100); + } + + if(Math.pow((a.getX() - baselist.get("PURPLE").getX()), 2) + Math.pow((a.getZ() - baselist.get("PURPLE").getZ()), 2) < 676 + && Base_damageable.get("PURPLE")) + { + HPModify("PURPLE", -100); + } + } + } + } + + + } + } + /** + * The method check the area around the center location &l with a radius of &radius + * @param l - the center location + * @param radius - the radius of detect area + * @return the list of entity without sort + * @author At least not me + */ + public static Entity[] getNearbyEntities(Location l, int radius) + { + int chunkRadius = radius < 16 ? 1 : (radius - (radius % 16))/16; + HashSet radiusEntities = new HashSet(); + for (int chX = 0 -chunkRadius; chX <= chunkRadius; chX ++) + { + for (int chZ = 0 -chunkRadius; chZ <= chunkRadius; chZ++) + { + int x=(int) l.getX(),y=(int) l.getY(),z=(int) l.getZ(); + for (Entity e : new Location(l.getWorld(),x+(chX*16),y,z+(chZ*16)).getChunk().getEntities()) + { + if (e.getLocation().distance(l) <= radius && e.getLocation().getBlock() != l.getBlock()) radiusEntities.add(e); + } + } + } + return radiusEntities.toArray(new Entity[radiusEntities.size()]); + } + /** + * get location of set base, If base is not set, the location will not be + * displayed + * @param string - base name + * @param sender - the sender param use to send back message + */ + public void getbaseloc(String string, CommandSender sender) { + if(baselist.get(string) != null) + { + sender.sendMessage(string + " tower is at" + baselist.get(string).getX() + + " " + baselist.get(string).getY() + " " + + baselist.get(string).getZ()+ " " + baselist.get(string).getWorld().getName()); + } + } + /** + * The public method is called by main, then turn to private method + * to check damage to tower by mobs. + */ + public void checkdamage() { + + if(on && !finish && !wave9_switch && !bonus_switch) + { + dodamage("BLUE"); + dodamage("AQUA"); + dodamage("PURPLE"); + if(Base_HP.get("BLUE") == 0) + { + baselist.put("BLUE", baselist.get("PURPLE").clone()); + } + if(Base_HP.get("AQUA") == 0 && Base_HP.get("BLUE") != 0) + { + baselist.put("AQUA", baselist.get("BLUE").clone()); + } + if(Base_HP.get("AQUA") == 0 && Base_HP.get("BLUE") == 0) + { + baselist.put("AQUA", baselist.get("PURPLE").clone()); + } + if(Base_HP.get("PURPLE") == 0 && Base_HP.get("BLUE") != 0) + { + baselist.put("PURPLE", baselist.get("BLUE").clone()); + } + if(Base_HP.get("PURPLE") == 0 && Base_HP.get("BLUE") == 0) + { + baselist.put("PURPLE", baselist.get("AQUA").clone()); + baselist.put("BLUE", baselist.get("AQUA").clone()); + } + } + } + private void dodamage(String key) + { + if(Base_damageable.get(key)) + { + Location loc; + Entity[] temp = getNearbyEntities(baselist.get(key), 21); + for(Entity ent:temp) + { + if(ent instanceof PigZombie || ent instanceof Zombie|| ent instanceof Spider) + { + loc = ent.getLocation(); + if(loc.distance(baselist.get(key)) < 14) + { + HPModify(key, -15); + } + } + if(ent instanceof Skeleton) + { + HPModify(key, -10); + } + if(ent instanceof Wither) + { + HPModify(key, -40); + } + } + } + } + /** + * heal target base for 5% health + * @param string - the name of base + */ + public boolean heal(String string, String name) { + if(on) + { + if(Player_use_heal.containsKey(name) == false) + { + double a = 0.05 * counthp(player_count); + Double doubleobj = new Double(a); + HPModify(string, doubleobj.intValue()); + Player_use_heal.put(name, 1); + return true; + } + else if(Player_use_heal.get(name) < 2) + { + double a = 0.05 * counthp(player_count); + Double doubleobj = new Double(a); + HPModify(string, doubleobj.intValue()); + Player_use_heal.put(name, Player_use_heal.get(name) + 1); + return true; + } + else + { + return false; + } + } + return false; + } + private LivingEntity summonCreatures(String base_name, CreatureType x, String name, Location spawnarea, boolean namevisible) + { + LivingEntity temp_eni; + temp_eni = baselist.get(base_name).getWorld().spawnCreature(spawnarea, x); + temp_eni.setRemoveWhenFarAway(false); + temp_eni.setCustomName(name); + temp_eni.setCustomNameVisible(namevisible); + changerange(temp_eni); + return temp_eni; + } + /** + * The whole progress of game will be generated here. + * @param time + */ + public void update(int time) + { + //the update of wave should be the first step + Location temp; + LivingEntity e; + if(!finish && !wave9_switch && !bonus_switch) + { + if(wave_time == 0) + { + wave++; + } + //wave 9 methods + if(wave == 9 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 8 FINISH!"); + } + wave_time = -45; + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 9 && wave_time == -40) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW+"在最後一波結束后將不能使用塔防支援!請各位尚餘回血的玩家儘快使用,不要浪費!"); + } + } + if(wave == 9 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"FINAL WAVE START!"); + } + + wave_time = 300; + baselist.get("BLUE").getWorld().setTime(6000); + } + if(wave == 9 && wave_time == 295) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,10,-45); + Entity temp_eni; + temp_eni = baselist.get("BLUE").getWorld().spawnEntity(temp, EntityType.WITHER); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName(ChatColor.RED+"第二型巴特勒"); + a.setCustomNameVisible(true); + changerange(a); + a.setMaxHealth(200 * player_count * difficulty); + a.setHealth(200 * player_count * difficulty); + final_boss = (Wither)a; + + } + if(wave == 9 && wave_time > 0 && wave_time < 295 && wave_time % 15 == 0) + { + if(final_boss != null) + { + if(!final_boss.isDead()) + { + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-50); + for(int i = 0; i < 0.5 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團近衛", temp, false); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_DAMAGE, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-50); + for(int i = 0; i < 0.5 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_DAMAGE, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + } + } + } + if(wave == 9 && wave_time > 0 && wave_time < 200 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + wave9_switch = true; + } + } + if(wave == 9 && wave_time == 1) + { + wavefinalremove(); + wave9_switch = true; + } + //wave 8 methods + if(wave == 8 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 7 FINISH!"); + } + wave_time = -30; + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 8 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 8 START!"); + } + + wave_time = 270; + baselist.get("BLUE").getWorld().setTime(6000); + } + if(wave == 8 && wave_time == 265) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED+"凋零軍團本隊來襲!"); + } + temp = baselist.get("BLUE").clone(); + temp.add(0,10,-45); + e = summonCreatures("BLUE", CreatureType.ENDER_DRAGON, ChatColor.GOLD+"凋零軍團副官", temp, true); + e.setMaxHealth(2000 * player_count * difficulty); + e.setHealth(2000 * player_count * difficulty); + temp = baselist.get("AQUA").clone(); + temp.add(-20,10,-45); + e = summonCreatures("AQUA", CreatureType.ENDER_DRAGON, ChatColor.GOLD+"凋零軍團副官", temp, true); + e.setMaxHealth(2000 * player_count * difficulty); + e.setHealth(2000 * player_count * difficulty); + temp = baselist.get("PURPLE").clone(); + temp.add(20,10,-45); + e = summonCreatures("PURPLE", CreatureType.ENDER_DRAGON, ChatColor.GOLD+"凋零軍團副官", temp, true); + e.setMaxHealth(2000 * player_count * difficulty); + e.setHealth(200 * player_count * difficulty); + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < 0.5 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + e.setMaxHealth(80D); + e.setHealth(80D); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_DAMAGE, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + for(int i = 0; i < 1.2 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + e.setMaxHealth(100D); + e.setHealth(100D); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.DAMAGE_ALL, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + temp = baselist.get("AQUA").clone(); + temp.add(-20,0,-30); + for(int i = 0; i < 1.2 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + e.setMaxHealth(80D); + e.setHealth(80D); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_DAMAGE, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + for(int i = 0; i < 1.2 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + e.setMaxHealth(100D); + e.setHealth(100D); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.DAMAGE_ALL, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(20,0,-30); + for(int i = 0; i < 1.2 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + e.setMaxHealth(80D); + e.setHealth(80D); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_DAMAGE, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + for(int i = 0; i < 1.0 * player_count * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團本部", temp, false); + e.setMaxHealth(100D); + e.setHealth(100D); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.DAMAGE_ALL, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(301))); + skelMC.setEquipment(2, new ItemStack(Item.d(300))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(4, new ItemStack(Item.d(298))); + } + } + if(wave == 8 && wave_time > 0 && wave_time < 200 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + + } + } + if(wave == 8 && wave_time == 1) + { + wavefinalremove(); + } + //wave 7 methods + if(wave == 7 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 6 FINISH!"); + } + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + wave_time = -30; + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 7 && wave_time == -25) + { + gettop(); + } + if(wave == 7 && wave_time == -10) + { + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard objectives setdisplay sidebar cjfw"); + } + if(wave == 7 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 7 START!"); + } + + wave_time = 240; + baselist.get("BLUE").getWorld().setTime(17000); + } + if(wave == 7 && wave_time == 240) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 1.0 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.75 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.4 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.75 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.4 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + } + if(wave == 7 && wave_time == 200) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.75 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.4 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + Entity temp_eni; + temp_eni = baselist.get("BLUE").getWorld().spawnEntity(temp, EntityType.WITCH); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName("凋零軍團巫師"); + a.setCustomNameVisible(true); + changerange(a); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.85 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + Entity temp_eni; + temp_eni = baselist.get("AQUA").getWorld().spawnEntity(temp, EntityType.WITCH); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName(ChatColor.GREEN+"凋零軍團巫師"); + a.setCustomNameVisible(true); + changerange(a); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.85 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.25 * difficulty; i++) + { + Entity temp_eni; + temp_eni = baselist.get("PURPLE").getWorld().spawnEntity(temp, EntityType.WITCH); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName(ChatColor.GREEN+"凋零軍團巫師"); + a.setCustomNameVisible(true); + changerange(a); + } + } + if(wave == 7 && wave_time == 185) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.RED+"中路有強力的敵人出現!"); + } + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.BLACK+"凋零型巴特勒", temp, true); + e.setMaxHealth(250 * player_count * difficulty); + e.setHealth(250 * player_count * difficulty); + Skeleton skel = (Skeleton)e; + skel.setSkeletonType(SkeletonType.WITHER); + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(276)); + item.addEnchantment(Enchantment.KNOCKBACK, 2); + item.addEnchantment(Enchantment.FIRE_ASPECT, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(309))); + skelMC.setEquipment(2, new ItemStack(Item.d(308))); + skelMC.setEquipment(4, new ItemStack(Item.d(306))); + item = new ItemStack(Item.d(307)); + item.addEnchantment(Enchantment.THORNS, 2); + skelMC.setEquipment(3, item); + } + if(wave == 7 && wave_time == 140) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.5 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.1 * difficulty; i++) + { + Entity temp_eni; + temp_eni = baselist.get("BLUE").getWorld().spawnEntity(temp, EntityType.WITCH); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName("凋零軍團巫師"); + a.setCustomNameVisible(true); + changerange(a); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.6 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.3 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.1 * difficulty; i++) + { + Entity temp_eni; + temp_eni = baselist.get("AQUA").getWorld().spawnEntity(temp, EntityType.WITCH); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName(ChatColor.GREEN+"凋零軍團巫師"); + a.setCustomNameVisible(true); + changerange(a); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.6 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團前衛", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.3 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"凋零軍團先鋒", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + } + for(int i = 0; i < player_count * 0.1 * difficulty; i++) + { + Entity temp_eni; + temp_eni = baselist.get("PURPLE").getWorld().spawnEntity(temp, EntityType.WITCH); + LivingEntity a = (LivingEntity)temp_eni; + a.setRemoveWhenFarAway(false); + a.setCustomName(ChatColor.GREEN+"凋零軍團巫師"); + a.setCustomNameVisible(true); + changerange(a); + } + } + if(wave == 7 && wave_time == 120) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.RED+"偵測到隱形的自爆部隊!"); + } + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-32); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, ChatColor.GREEN+"凋零軍團自爆連", temp, true); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-32); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, ChatColor.GREEN+"凋零軍團自爆連", temp, true); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-32); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, ChatColor.GREEN+"凋零軍團自爆連", temp, true); + } + } + if(wave == 7 && wave_time == 110) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.6 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團近衛", temp, false); + e.setMaxHealth(38D); + e.setHealth(38D); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.6 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團近衛", temp, false); + e.setMaxHealth(38D); + e.setHealth(38D); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.6 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"凋零軍團近衛", temp, false); + e.setMaxHealth(38D); + e.setHealth(38D); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + } + } + if(wave == 7 && wave_time > 0 && wave_time < 70 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 7 && wave_time == 1) + { + wavefinalremove(); + } + //wave 6 methods + if(wave == 6 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 5 FINISH!"); + } + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + wave_time = -30; + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 6 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 6 START!"); + } + + wave_time = 240; + baselist.get("BLUE").getWorld().setTime(5000); + } + if(wave == 6 && wave_time == 240) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 0.3 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.GRAY+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.9 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 6 && wave_time == 235) + { + temp = baselist.get("AQUA").clone(); + temp.add(-20,0,-35); + for(int i = 0; i < player_count * 0.3 * difficulty; i ++) + { + e = summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.GRAY+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.9 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(20,0,-35); + for(int i = 0; i < player_count * 0.3 * difficulty; i ++) + { + e = summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.GRAY+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.9 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 6 && wave_time == 215) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-50); + for(int i = 0; i < player_count * 0.3 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"天災遠程小兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.9 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("AQUA").clone(); + temp.add(-20,0,-35); + for(int i = 0; i < player_count * 0.2 * difficulty; i ++) + { + e = summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.WHITE+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.6 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(20,0,-35); + for(int i = 0; i < player_count * 0.2 * difficulty; i ++) + { + e = summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.WHITE+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.6 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 6 && wave_time == 180) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-50); + for(int i = 0; i < player_count * 0.9 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 1); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 1.9 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.4 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, ChatColor.GREEN+"地精工程師", temp, true); + } + } + if(wave == 6 && wave_time == 160) + { + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-50); + e = summonCreatures("AQUA", CreatureType.GIANT, ChatColor.DARK_PURPLE+"腐肉山型巴特勒", temp, true); + e.setMaxHealth(100 * player_count * difficulty); + e.setHealth(100 * player_count * difficulty); + changeattack(e); + Giant gian = (Giant)e; + CraftGiant skelc = (CraftGiant)gian; + EntityGiantZombie skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 10); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(2, new ItemStack(Item.d(316))); + skelMC.setEquipment(3, new ItemStack(Item.d(315))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-50); + e = summonCreatures("PURPLE", CreatureType.GIANT, ChatColor.DARK_PURPLE+"腐肉山型巴特勒", temp, true); + e.setMaxHealth(100 * player_count * difficulty); + e.setHealth(100 * player_count * difficulty); + changeattack(e); + gian = (Giant)e; + skelc = (CraftGiant)gian; + skelMC = skelc.getHandle(); + item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 10); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(2, new ItemStack(Item.d(316))); + skelMC.setEquipment(3, new ItemStack(Item.d(315))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + if(wave == 6 && wave_time == 120) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-50); + for(int i = 0; i < player_count * 0.8 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 2); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 1.6 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 2); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.3 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, ChatColor.GREEN+"地精工程師", temp, true); + } + } + if(wave == 6 && wave_time == 80) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-50); + for(int i = 0; i < player_count * 0.4 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.WHITE+"天災遠程兵", temp, false); + changeattack(e); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(261)); + item.addEnchantment(Enchantment.ARROW_KNOCKBACK, 2); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.8 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(272)); + item.addEnchantment(Enchantment.KNOCKBACK, 2); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(317))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 6 && wave_time > 0 && wave_time < 60 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 6 && wave_time == 1) + { + wavefinalremove(); + } + //wave 5 methods + if(wave == 5 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 4 FINISH!"); + } + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + wave_time = -60; + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 5 && wave_time == -55) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"中場休息60秒!"); + } + } + if(wave == 5 && wave_time == -45) + { + gettop(); + } + if(wave == 5 && wave_time == -15) + { + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard objectives setdisplay sidebar cjfw"); + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.RED+"下一波敵人還有15秒到達戰場!"); + } + } + if(wave == 5 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 5 START!"); + } + + wave_time = 210; + baselist.get("BLUE").getWorld().setTime(16000); + } + if(wave == 5 && wave_time == 208) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.RED+"清冥之加護:敵方行進速度增加20%!"); + } + } + if(wave == 5 && wave_time == 206) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.RED+"左塔出現了強大的敵人!"); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-40); + temp.getWorld().strikeLightningEffect(temp); + e = summonCreatures("AQUA" , CreatureType.ZOMBIE, ChatColor.RED+"Yan's WIFI", temp, true); + + e.setMaxHealth(200 * player_count * difficulty); + e.setHealth(200 * player_count * difficulty); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack item = new ItemStack(Item.d(267)); + item.addEnchantment(Enchantment.DAMAGE_ALL, 1); + item.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, item); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(308))); + zombMC.setEquipment(3, new ItemStack(Item.d(307))); + zombMC.setEquipment(4, new ItemStack(Item.d(306))); + } + if(wave == 5 && wave_time == 205) + { + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1 * difficulty; i ++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(269))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.3 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"幽靈", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(261))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-45); + for(int i = 0; i < player_count * 1.5 * difficulty; i ++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(269))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"幽靈", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(261))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1.5 * difficulty; i ++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.WHITE+"鬼魂", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(269))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.3 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.WHITE+"幽靈", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(261))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 5 && wave_time == 160) + { + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1 * difficulty; i ++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.WHITE+"僵尸(真的)", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(267))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1 * difficulty; i ++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"僵尸(真的)", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(267))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 5 && wave_time == 110) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.6 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"僵尸(真的)", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(267))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.6 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"幽靈", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(261))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 5 & wave_time == 80) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.4 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.WHITE+"僵尸(真的)", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(267))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.4 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.WHITE+"幽靈", temp, false); + changespeed(e); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(261))); + zombMC.setEquipment(1, new ItemStack(Item.d(309))); + zombMC.setEquipment(2, new ItemStack(Item.d(313))); + zombMC.setEquipment(3, new ItemStack(Item.d(312))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 5 && wave_time > 0 && wave_time < 60 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 5 && wave_time == 1) + { + wavefinalremove(); + } + //wave 4 methods + if(wave == 4 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 3 FINISH!"); + } + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + wave_time = -30; + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 4 && wave_time == -25) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("防衛結束后會根據基地剩餘血量決定獎勵數量!"); + } + } + if(wave == 4 && wave_time == -15) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("如果防衛失敗的話只會拿到少量參與獎,請小心應對!"); + } + } + if(wave == 4 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 4 START!"); + } + + wave_time = 150; + baselist.get("BLUE").getWorld().setTime(4000); + } + if(wave == 4 && wave_time == 147) + { + for(int i = 0; i < 4; i++) + { + + Bukkit.broadcastMessage(ChatColor.YELLOW+"左塔附近出現了大量的怪物!"); + } + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"动员兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(270))); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.GRAY+"防空(假的)步兵", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + temp.add(0,0,5); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"恐怖分子", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(272))); + } + } + if(wave == 4 && wave_time == 140) + { + temp = baselist.get("AQUA").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"恐怖分子", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(272))); + } + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"动员兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(270))); + } + } + if(wave == 4 && wave_time == 110) + { + for(int i = 0; i < 4; i++) + { + + Bukkit.broadcastMessage(ChatColor.YELLOW+"中塔附近出現了大量的怪物!"); + } + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"重装大兵(没穿鞋的)", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(270))); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.GRAY+"美国大(新)兵", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + temp.add(0,0,5); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"自爆机器(划掉)人", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(272))); + } + } + if(wave == 4 && wave_time == 100) + { + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"自爆机器(划掉)人", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(272))); + } + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"美国大(新)兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(270))); + } + } + if(wave == 4 && wave_time == 70) + { + for(int i = 0; i < 4; i++) + { + + Bukkit.broadcastMessage(ChatColor.YELLOW+"右塔附近出現了大量的怪物!"); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"尤裡(被)控制人", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(270))); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.GRAY+"尤裡新兵", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(3, new ItemStack(Item.d(299))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + temp.add(0,0,5); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"(回收用)市民", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(272))); + } + } + if(wave == 4 && wave_time == 60) + { + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"尤裡敢死隊", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(272))); + } + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"尤裡老(真的很老)兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + zombMC.setEquipment(0, new ItemStack(Item.d(270))); + } + } + if(wave == 4 && wave_time > 0 && wave_time < 50 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 4 && wave_time == 1) + { + wavefinalremove(); + } + //wave 3 methods + if(wave == 3 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 2 FINISH!"); + } + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + wave_time = -30; + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 3 && wave_time == -25) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("總計九輪的防禦過後會根據人頭數排名頒發榮譽獎!"); + } + gettop(); + } + if(wave == 3 && wave_time == -20) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("榮譽獎不會過高,請各位專心于防衛!"); + } + } + if(wave == 3 && wave_time == -15) + { + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard objectives setdisplay sidebar cjfw"); + sb.getObjective("contri_point").setDisplaySlot(DisplaySlot.BELOW_NAME); + } + if(wave == 3 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 3 START!"); + } + + wave_time = 180; + baselist.get("BLUE").getWorld().setTime(14000); + } + if(wave == 3 && wave_time == 180) + { + temp = baselist.get("AQUA").clone(); + temp.add(0, 0, -30); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵+", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GREEN+"先鋒精英工兵", temp, true); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(268))); + zombMC.setEquipment(1, new ItemStack(Item.d(301))); + zombMC.setEquipment(2, new ItemStack(Item.d(300))); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(298))); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 0.1 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, "先鋒自爆連", temp, true); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0,0,-30); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒敢死隊", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GREEN+"先鋒精英工兵", temp, true); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(0, new ItemStack(Item.d(283))); + zombMC.setEquipment(1, new ItemStack(Item.d(301))); + zombMC.setEquipment(2, new ItemStack(Item.d(300))); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + zombMC.setEquipment(4, new ItemStack(Item.d(298))); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 0.1 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.CREEPER, "先鋒自爆連", temp, true); + } + } + if(wave == 3 && wave_time == 160) + { + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵+", temp, false); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.GRAY+"先鋒弓箭手", temp, false); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.CREEPER, "先鋒自爆連", temp, true); + } + } + if(wave == 3 && wave_time == 150) + { + temp = baselist.get("AQUA").clone(); + temp.add(-20,0,-30); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵+", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + } + temp.add(20,0,-15); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, "先鋒自爆連", temp, true); + } + temp = baselist.get("PURPLE").clone(); + temp.add(20,0,-30); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵+", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(3, new ItemStack(Item.d(299))); + } + temp.add(-20,0,-15); + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.CREEPER, "先鋒自爆連", temp, true); + } + } + if(wave == 3 && wave_time == 124) + { + Bukkit.broadcastMessage(ChatColor.RED+"变异型巴特勒:【就算没有魔王的指示,我也能一个人把你们全部打烂!】"); + } + if(wave == 3 && wave_time == 120) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW+"中塔附近出現了強大的敵人!"); + } + baselist.get("BLUE").getWorld().setStorm(true); + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + e = summonCreatures("BLUE" , CreatureType.SKELETON, ChatColor.RED+"变异型巴特勒", temp, true); + e.setMaxHealth(150 * player_count * difficulty); + e.setHealth(150 * player_count * difficulty); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + ItemStack item = new ItemStack(Item.d(283)); + item.addEnchantment(Enchantment.DAMAGE_ALL, 3); + skelMC.setEquipment(0, item); + skelMC.setEquipment(1, new ItemStack(Item.d(317))); + skelMC.setEquipment(2, new ItemStack(Item.d(316))); + skelMC.setEquipment(3, new ItemStack(Item.d(315))); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵+", temp, false); + } + temp.add(0,0,-5); + for(int i = 0; i < player_count * 1.0 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.GRAY+"先鋒弓箭手", temp, false); + skel = (Skeleton)e; + skelc = (CraftSkeleton)skel; + skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + for(int i = 0; i < player_count * 0.2 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.CREEPER, "先鋒自爆連", temp, true); + } + + } + if(wave == 3 && wave_time == 70) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW+"中塔附近出現了大量的怪物!"); + } + temp = baselist.get("BLUE").clone(); + temp.add(0,0,-40); + for(int i = 0; i < player_count * 3.5 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.GRAY+"先鋒弓箭手", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + } + if(wave == 3 && wave_time == 40) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW+"偷襲部隊時刻有可能出現,請小心應對!"); + } + + } + if(wave == 3 && wave_time > 0 && wave_time < 61 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 3 && wave_time == 1) + { + wavefinalremove(); + Bukkit.broadcastMessage(ChatColor.RED+"变异型巴特勒:可恶啊!!要是再多给我一点时间的话..."); + } + //wave 2 methods + if(wave == 2 && wave_time == 0) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("每波之间有30秒钟休息时间!"); + } + baselist.get("BLUE").getWorld().setStorm(false); + baselist.get("BLUE").getWorld().setThundering(false); + baselist.get("BLUE").getWorld().setWeatherDuration(1000000); + wave_time = -30; + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "revclass supply confirm"); + } + if(wave == 2 && wave_time == -25) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"WAVE 1 FINISH!"); + } + } + if(wave == 2 && wave_time == -20) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"每波結束各職業都會有不同的補給品發出!"); + } + } + if(wave == 2 && wave_time == -15) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GREEN+"請善加利用!"); + } + } + if(wave == 2 && wave_time == -1) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 2 START!"); + } + wave_time = 150; + } + if(wave == 2 && wave_time == 150) + { + baselist.get("BLUE").getWorld().setTime(0); + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("AQUA").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.2 * difficulty; i++) + { + + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 2 && wave_time == 120) + { + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.7 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.GRAY+"先鋒工兵", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + temp = baselist.get("AQUA").clone(); + temp.add(-20, 0, -30); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.7 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.GRAY+"先鋒弓箭手", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(20, 0, -30); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒工兵", temp, false); + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + for(int i = 0; i < player_count * 0.7 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.GRAY+"先鋒弓箭手", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(261))); + } + } + if(wave == 2 && wave_time == 90) + { + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒敢死隊", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("AQUA").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒敢死隊", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + temp = baselist.get("PURPLE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"先鋒敢死隊", temp, false); + Zombie zomb = (Zombie)e; + zomb.setBaby(true); + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.setEquipment(4, new ItemStack(Item.d(314))); + } + } + if(wave == 2 && wave_time == 60) + { + temp = baselist.get("PURPLE").clone(); + temp.add(20, 0, -30); + for(int i = 0; i < player_count * 0.7 * difficulty; i++) + { + e = summonCreatures("PURPLE", CreatureType.SKELETON, "拿錯裝備的", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(268))); + } + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 0.7 * difficulty; i++) + { + e = summonCreatures("BLUE", CreatureType.SKELETON, "拿錯裝備的", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(268))); + } + temp = baselist.get("AQUA").clone(); + temp.add(-20, 0, -30); + for(int i = 0; i < player_count * 0.7 * difficulty; i++) + { + e = summonCreatures("AQUA", CreatureType.SKELETON, "拿錯裝備的", temp, true); + Skeleton skel = (Skeleton)e; + CraftSkeleton skelc = (CraftSkeleton)skel; + EntitySkeleton skelMC = skelc.getHandle(); + skelMC.setEquipment(4, new ItemStack(Item.d(314))); + skelMC.setEquipment(0, new ItemStack(Item.d(268))); + } + } + if(wave == 2 && wave_time > 0 && wave_time < 55 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 2 && wave_time == 1) + { + wavefinalremove(); + } + //wave 1 methods + if(wave == 1 && wave_time == 0) + { + for(int i = 0; i < 8; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"WAVE 1 START!"); + } + + wave_time = 120; + baselist.get("BLUE").getWorld().setTime(14000); + + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1.5 * difficulty; i++) + { + summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.GRAY+"渣渣", temp, false); + } + } + if(wave == 1 && wave_time == 110) + { + temp = baselist.get("AQUA").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 1 * difficulty; i++) + { + summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.GRAY+"炮灰", temp, false); + } + } + if(wave == 1 && wave_time == 100) + { + temp = baselist.get("PURPLE").clone(); + temp.add(0, 0, -35); + for(int i = 0; i < player_count * 1 * difficulty; i++) + { + summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.GRAY+"菜鳥", temp, false); + } + for(int i = 0; i < player_count * 0.25 * difficulty; i++) + { + summonCreatures("PURPLE", CreatureType.ZOMBIE, ChatColor.GRAY+"難民", temp, false); + } + } + if(wave == 1 && wave_time == 90) + { + temp = baselist.get("AQUA").clone(); + temp.add(-20, 0 ,-30); + for(int i = 0; i < player_count * 0.75 * difficulty; i++) + { + summonCreatures("AQUA", CreatureType.SKELETON, ChatColor.GRAY+"雜魚", temp, false); + } + } + if(wave == 1 && wave_time == 80) + { + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + for(int i = 0; i < player_count * 0.5 * difficulty; i++) + { + summonCreatures("BLUE", CreatureType.SKELETON, ChatColor.GRAY+"兵痞", temp, false); + } + } + if(wave == 1 && wave_time == 60) + { + temp = baselist.get("PURPLE").clone(); + temp.add(20, 0 , -30); + for(int i = 0; i < player_count * 1 * difficulty; i++) + { + summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.GRAY+"民兵", temp, false); + } + } + if(wave == 1 && wave_time > 0 && wave_time < 60 && wave_time % 5 == 0) + { + if(checkentitydata()) + { + bonus_time = bonus_time + wave_time; + wave_time = 0; + } + } + if(wave == 1 && wave_time == 1) + { + wavefinalremove(); + } + //wave 0 methods + if(wave == 0 && wave_time == -1) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("欢迎各位参加防卫战的勇士们!"); + } + wave_time = 90; + } + if(wave == 0 && wave_time == 75) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("敌人即将入侵采掘基地,请各位利用手中的武器保护基地!"); + } + //temp = baselist.get("PURPLE").clone(); + //temp.add(20, 0 , -20); + //tp = summonCreatures("PURPLE", CreatureType.SKELETON, ChatColor.GRAY+"民兵", temp, false); + } + if(wave == 0 && wave_time == 60) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("请避免让近程怪物靠近红圈,远程怪物靠近黄圈!进入该范围的怪物将会使基地损伤!"); + } + //if(tp.isDead()) + //{ + // Bukkit.broadcastMessage("you got it."); + //} + } + if(wave == 0 && wave_time == 50) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage("撑过一波的方法有两种!"); + Bukkit.broadcastMessage(ChatColor.RED+"其一是wave时间耗尽!"); + Bukkit.broadcastMessage(ChatColor.GREEN+"其二是将所有怪物歼灭!"); + } + } + if(wave == 0 && wave_time == 45) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.RED+"敌军还有45秒到达战场!"); + } + } + if(wave == 0 && wave_time == 30) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("自爆类的怪物在绿圈内自爆会对基地造成大损伤!请一定注意!"); + } + } + if(wave == 0 && wave_time == 20) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("每位玩家均有兩次开启某一塔塔防和恢复塔受损耐久值的机会!可以在塔的后方开启,请好好利用!"); + } + } + if(wave == 0 && wave_time == 15) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage("每波会有额外的道具提供!请法师记得清理物品栏!"); + } + } + if(wave == 0 && wave_time == 10) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD+"介绍就到这里,以上!祝各位武运昌隆!"); + } + } + //the update of wave_time should be the last step before refresh scoreboard + if(wave_time < 0) + { + wave_time ++; + } + if(wave_time > 0) + { + wave_time --; + } + + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set Wave cjfw " + wave); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set Time cjfw " + wave_time); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set BLUE cjfw " + Base_HP.get("BLUE")); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set AQUA cjfw " + Base_HP.get("AQUA")); + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set PURPLE cjfw " + Base_HP.get("PURPLE")); + if(Base_HP.get("BLUE") == 0 && Base_HP.get("AQUA") == 0 && Base_HP.get("PURPLE") == 0) + { + finish = true; + } + } + if(!finish && wave9_switch && !bonus_switch) + { + String rank = calculate_rank(); + Bukkit.broadcastMessage(ChatColor.GREEN + "防衛成功!"); + Bukkit.broadcastMessage(ChatColor.BLUE + "本次防衛的評價為:"); + Bukkit.broadcastMessage(ChatColor.GOLD + rank + "!"); + if(bonus_time > 180) + { + bonus_switch = true; + back_timer = -10; + for(int i = 0; i < 3; i++) + { + baselist.get("BLUE").getWorld().setTime(0000); + Bukkit.broadcastMessage("一分鐘后傳送主城!"); + } + } + else + { + gettop(); + for(int i = 0; i < 3; i++) + { + Bukkit.broadcastMessage("活動結束!請等待傳送和獎勵發放!"); + } + finish = true; + } + } + //HIDDEN BOSS + if(!finish && wave9_switch && bonus_switch && !bonus_finish_switch) + { + if(back_timer < 0 ) + { + back_timer ++; + } + else + { + if(back_timer == 0 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW+"【傳送主城...?有意思。】"); + } + } + if(back_timer == 5 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.RED + "【費盡千辛萬苦才等到這麼一個好機會...】"); + } + } + if(back_timer == 15 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "吾烈焰魔王【伊諾增忒斯】會讓你們這麼容易逃走嗎?!"); + } + } + if(back_timer == 20 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "爲了讓你們輕敵,吾可是故意偽裝成深淵魔王進攻啊..."); + } + } + if(back_timer == 25 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "沒想到你們這麼容易就上當了...真是可笑啊..."); + } + } + if(back_timer == 30 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "哼...吾可是會出全力的,看你們能撐到什麼時候!"); + } + } + if(back_timer == 32 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + temp = baselist.get("BLUE").clone(); + temp.add(0, 0, -40); + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.DARK_RED+"烈焰魔王Innocentius", temp, true); + e.setMaxHealth(300 * player_count * difficulty); + e.setHealth(300 * player_count * difficulty); + changespeed(e); + changeattack(e); + last_boss = e; + Zombie zomb = (Zombie)e; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack i = new ItemStack(Item.d(276)); + i.addEnchantment(Enchantment.DAMAGE_ALL, 5); + i.addEnchantment(Enchantment.FIRE_ASPECT, 2); + i.addEnchantment(Enchantment.KNOCKBACK, 4); + zombMC.setEquipment(0, i); + i = new ItemStack(Item.d(305)); + i.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1); + zombMC.setEquipment(1, i); + i = new ItemStack(Item.d(304)); + i.addEnchantment(Enchantment.PROTECTION_FIRE, 1); + zombMC.setEquipment(2, i); + i = new ItemStack(Item.d(303)); + i.addEnchantment(Enchantment.THORNS, 2); + zombMC.setEquipment(3, i); + i = new ItemStack(Item.d(302)); + i.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1); + zombMC.setEquipment(4, i); + } + if(back_timer == 37 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW + "最終boss:Innocentius出現了!"); + } + } + if(back_timer == 40 && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 4; i++) + { + Bukkit.broadcastMessage(ChatColor.YELLOW + "本回合不計算時間,不計算總評價,不計算對塔的傷害。"); + } + } + if(last_boss != null && !last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + Damageable a = (Damageable)last_boss; + if((a.getHealth() / a.getMaxHealth() < 0.7) && !last_boss_phase1 && !last_boss_phase3) + { + last_boss_phase1 = true; + back_timer = 0; + } + } + if(back_timer == 0 && last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 哦?頗有點意思呢。"); + } + } + if(back_timer == 3 && last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 出來吧!吾之守護!"); + } + } + if(back_timer == 5 && last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + last_boss.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 1000000, 5), true); + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.AQUA+"烈風", last_boss.getLocation(), true); + e.setMaxHealth(40 * player_count * difficulty); + e.setHealth(40 * player_count * difficulty); + Zombie zomb = (Zombie)e; + last_boss1 = zomb; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + ItemStack i = new ItemStack(Item.d(276)); + i.addEnchantment(Enchantment.DAMAGE_ALL, 1); + i.addEnchantment(Enchantment.KNOCKBACK, 3); + zombMC.setEquipment(0, i); + i = new ItemStack(Item.d(305)); + zombMC.setEquipment(1, i); + i = new ItemStack(Item.d(304)); + zombMC.setEquipment(2, i); + i = new ItemStack(Item.d(303)); + zombMC.setEquipment(3, i); + i = new ItemStack(Item.d(302)); + zombMC.setEquipment(4, i); + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.DARK_GREEN+"森木", last_boss.getLocation(), true); + e.setMaxHealth(40 * player_count * difficulty); + e.setHealth(40 * player_count * difficulty); + zomb = (Zombie)e; + last_boss2 = zomb; + zombc = (CraftZombie)zomb; + zombMC = zombc.getHandle(); + i = new ItemStack(Item.d(276)); + i.addEnchantment(Enchantment.DAMAGE_ALL, 3); + i.addEnchantment(Enchantment.KNOCKBACK, 1); + zombMC.setEquipment(0, i); + i = new ItemStack(Item.d(305)); + zombMC.setEquipment(1, i); + i = new ItemStack(Item.d(304)); + zombMC.setEquipment(2, i); + i = new ItemStack(Item.d(303)); + zombMC.setEquipment(3, i); + i = new ItemStack(Item.d(302)); + zombMC.setEquipment(4, i); + e = summonCreatures("BLUE", CreatureType.ZOMBIE, ChatColor.RED+"焱魔", last_boss.getLocation(), true); + e.setMaxHealth(40 * player_count * difficulty); + e.setHealth(40 * player_count * difficulty); + zomb = (Zombie)e; + last_boss3 = zomb; + zombc = (CraftZombie)zomb; + zombMC = zombc.getHandle(); + i = new ItemStack(Item.d(276)); + i.addEnchantment(Enchantment.DAMAGE_ALL, 1); + i.addEnchantment(Enchantment.KNOCKBACK, 1); + i.addEnchantment(Enchantment.FIRE_ASPECT, 2); + zombMC.setEquipment(0, i); + i = new ItemStack(Item.d(305)); + zombMC.setEquipment(1, i); + i = new ItemStack(Item.d(304)); + zombMC.setEquipment(2, i); + i = new ItemStack(Item.d(303)); + zombMC.setEquipment(3, i); + i = new ItemStack(Item.d(302)); + zombMC.setEquipment(4, i); + + } + if(back_timer == 8 && last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 只要吾之三大守護尚在,吾就不會受到分毫傷害!"); + } + } + if(last_boss_phase1 && !last_boss_phase2 && !last_boss_phase3 && last_boss1 != null && last_boss2 != null && last_boss3 != null) + { + if(last_boss1.isDead() && last_boss2.isDead() && last_boss3.isDead()) + { + last_boss_phase2 = true; + back_timer = 0; + } + } + if(back_timer == 0 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + Zombie zomb = (Zombie)last_boss; + CraftZombie zombc = (CraftZombie)zomb; + EntityZombie zombMC = zombc.getHandle(); + zombMC.removeAllEffects(); + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 唔唔唔...可惡的臭蟲們!"); + } + } + if(back_timer == 3 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 但是你們以為吾是單槍匹馬到來的嗎...嘿嘿嘿..."); + } + } + if(back_timer == 6 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 顯現吧!吾之燃燒軍團!!"); + } + } + if(back_timer == 8 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + last_boss.getWorld().setStorm(true); + last_boss.getWorld().setWeatherDuration(100000); + } + if(back_timer == 14 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: ...什麽?!"); + } + } + if(back_timer == 17 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 下雨了?!你【嗶---】在逗吾烈焰魔王!"); + } + } + if(back_timer == 20 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 明明是沙漠,為什麼會下雨啊啊啊啊啊啊啊啊!!!"); + } + } + if(back_timer == 22 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + last_boss.getWorld().strikeLightning(last_boss.getLocation()); + } + if(back_timer == 25 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 啊啊啊啊啊啊啊!可惡啊啊啊啊啊!"); + } + last_boss.setHealth(120 * player_count * difficulty); + last_boss.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1000000, 3)); + last_boss.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 1000000, 1)); + } + if(back_timer == 30 && last_boss_phase1 && last_boss_phase2 && !last_boss_phase3) + { + for(int i = 0; i < 5; i++) + { + Bukkit.broadcastMessage(ChatColor.WHITE + "現在正是好時機!乘勝追擊消滅烈焰魔王吧!"); + } + } + if(last_boss_phase1 && last_boss_phase2 && !last_boss_phase3 && last_boss != null) + { + Damageable a = (Damageable)last_boss; + if(a.getHealth() / a.getMaxHealth() < 0.3) + { + last_boss_phase3 = true; + back_timer = 0; + } + + } + if(back_timer == 0 && last_boss_phase1 && last_boss_phase2 && last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 可惡啊啊啊啊啊!為何你們不會被燃盡!!"); + } + } + if(back_timer == 3 && last_boss_phase1 && last_boss_phase2 && last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: ??!!這是什麽情況!!"); + } + } + if(back_timer == 5 && last_boss_phase1 && last_boss_phase2 && last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius:你們的鎧甲...為何被附魔了最高級的火焰防護!"); + } + } + if(back_timer == 8 && last_boss_phase1 && last_boss_phase2 && last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 怎麼會...吾居然被人算計了。"); + } + } + if(back_timer == 11 && last_boss_phase1 && last_boss_phase2 && last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 是誰敢算計本大爺?!光明神嗎?水神嗎?可惡啊啊啊啊啊啊啊啊!"); + } + } + if(back_timer == 15 && last_boss_phase1 && last_boss_phase2 && last_boss_phase3) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 我死不瞑目啊啊啊啊啊啊!"); + } + } + if(last_boss_phase1 && last_boss_phase2 && last_boss_phase3 && last_boss != null) + { + if(last_boss.isDead()) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.DARK_RED + "Innocentius: 我恨啊啊啊啊啊啊啊啊啊啊啊啊啊!"); + bonus_finish_switch = true; + } + } + } + if(back_timer < 60) + { + back_timer ++; + } + + } + } + if(!finish && wave9_switch && bonus_switch && bonus_finish_switch) + { + for(int i = 0; i < 2; i++) + { + Bukkit.broadcastMessage(ChatColor.GOLD + "恭喜通過隱藏關卡!最終評價上升一級!"); + } + gettop(); + for(int i = 0; i < 3; i++) + { + Bukkit.broadcastMessage("活動結束!請等待傳送和獎勵發放!"); + } + finish = true; + } + } + private String calculate_rank() { + int full = 3 *counthp(player_count); + int fin = Base_HP.get("BLUE") + Base_HP.get("AQUA") + Base_HP.get("PURPLE"); + int brok = 0; + String rank = ""; + if(Base_HP.get("BLUE") == 0) + { + brok++; + } + if(Base_HP.get("AQUA") == 0) + { + brok++; + } + if(Base_HP.get("PURPLE") == 0) + { + brok++; + } + if(fin > 0.97 * full) + { + rank = "SS"; + } + if(fin > 0.80 * full && fin < 0.97 * full) + { + rank = "S"; + } + if(fin > 0.60 * full && fin < 0.8 * full) + { + rank = "A"; + } + if((fin > 0.4 * full && fin < 0.6 * full) || brok == 1) + { + rank = "B"; + } + if((fin < 0.4 * full) || brok == 2) + { + rank = "C"; + } + return rank; + + } + private void wavefinalremove() + { + for(Entity ent:getNearbyEntities(baselist.get("BLUE"), 70)) + { + if(ent instanceof Monster || ent instanceof EnderDragon) + { + ((Monster) ent).setHealth(0D); + } + } + for(Entity ent:getNearbyEntities(baselist.get("AQUA"), 70)) + { + if(ent instanceof Monster || ent instanceof EnderDragon) + { + ((Monster) ent).setHealth(0D); + } + } + for(Entity ent:getNearbyEntities(baselist.get("PURPLE"), 70)) + { + if(ent instanceof Monster || ent instanceof EnderDragon) + { + ((Monster) ent).setHealth(0D); + } + } + } + private void gettop() + { + try + { + sb.registerNewObjective("top", "dummy"); + sb.getObjective("top").setDisplayName("Kills"); + } + catch (Exception e) + { + sb.getObjective("top").unregister(); + sb.registerNewObjective("top", "dummy"); + sb.getObjective("top").setDisplayName("Kills"); + } + OfflinePlayer[] a = new OfflinePlayer[8]; + for(OfflinePlayer player:Bukkit.getOfflinePlayers()) + { + try + { + for(int i = 0; i < 8; i++) + { + + if(a[i] != null) + { + if (sb.getObjective("contri_point").getScore(player).getScore() > sb.getObjective("contri_point").getScore(a[i]).getScore()) + { + int j = 0; + for(j = 0; j < 8; j++) + { + if(a[j] == null) + { + break; + } + } + if(j == 8) + { + j --; + } + for(int l = j; l >= i + 1; l --) + { + a[l] = a[l-1]; + } + a[i] = player; + break; + } + } + else if(a[i] == null && i < 8) + { + a[i] = player; + break; + } + } + + } + catch (Exception e) + { + + } + + } + for(OfflinePlayer e:a) + { + if(e != null) + { + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard players set " + e.getName() + " top " + sb.getObjective("contri_point").getScore(e).getScore()); + } + } + Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "scoreboard objectives setdisplay sidebar top"); + } + private boolean checkentitydata() + { + Entity[] temp_dat; + temp_dat = getNearbyEntities(baselist.get("BLUE"), 70); + for(Entity ent:temp_dat) + { + if(ent instanceof Monster || ent instanceof EnderDragon) + { + return false; + } + } + temp_dat = getNearbyEntities(baselist.get("AQUA"), 70); + for(Entity ent:temp_dat) + { + if(ent instanceof Monster || ent instanceof EnderDragon) + { + return false; + } + + } + temp_dat = getNearbyEntities(baselist.get("PURPLE"), 70); + for(Entity ent:temp_dat) + { + if(ent instanceof Monster || ent instanceof EnderDragon) + { + return false; + } + } + return true; + } + /** + * The selected tower will go fortified + * @param string - the name of tower + */ + public boolean fortify(String string, String name) + { + if(on) + { + if(Player_use_fort.containsKey(name) == false) + { + Base_damageable.put(string, false); + Player_use_fort.put(name, 1); + return true; + } + else if(Player_use_fort.get(name) < 2) + { + Base_damageable.put(string, false); + Player_use_fort.put(name, Player_use_fort.get(name) + 1); + return true; + } + else + { + return false; + } + } + return false; + } + /** + * The selected tower will be defortified + * @param string - the name of tower + */ + public void defortify(String string) + { + Base_damageable.put(string, true); + + } + private void changerange(LivingEntity temp_eni) + { + EntityInsentient nmsEntity = (EntityInsentient) ((CraftLivingEntity) temp_eni).getHandle(); + AttributeInstance attributes = nmsEntity.getAttributeInstance(GenericAttributes.b); + x = UUID.randomUUID(); + attributes.a(new AttributeModifier(x, "" + random.nextInt(), 60D, 0)); + } + private void changespeed(LivingEntity temp_eni) + { + EntityInsentient nmsEntity = (EntityInsentient) ((CraftLivingEntity) temp_eni).getHandle(); + AttributeInstance attributes = nmsEntity.getAttributeInstance(GenericAttributes.d); + x = UUID.randomUUID(); + attributes.a(new AttributeModifier(x, "" + random.nextInt(), 0.2, 1)); + } + private void changeattack(LivingEntity temp_eni) + { + EntityInsentient nmsEntity = (EntityInsentient) ((CraftLivingEntity) temp_eni).getHandle(); + AttributeInstance attributes = nmsEntity.getAttributeInstance(GenericAttributes.e); + x = UUID.randomUUID(); + attributes.a(new AttributeModifier(x, "" + random.nextInt(), 0.3, 1)); + } + /** + * get player killing rank at the end of game + * ONLY when on and finish + */ + public void getrank() + { + if(on && finish) + { + gettop(); + } + + } + /** + * set game difficulty, default is 1 + * @param i + */ + public void setdifficulty(double i) + { + difficulty = i; + + } + public void setwave(String string) { + if(init) + { + wave = Integer.parseInt(string); + } + + } + public void settime(String string) { + if(init) + { + wave_time = Integer.parseInt(string); + } + + } +} \ No newline at end of file diff --git a/cjfw/www/innocentius/net/cjfw/CJFWmain$1.class b/cjfw/www/innocentius/net/cjfw/CJFWmain$1.class new file mode 100644 index 0000000000000000000000000000000000000000..c55a38306bb78d65c67615f285076a0b647eb5fa GIT binary patch literal 908 zcma)4TW`}a7(H&oLb7ZN1Sh8#%pYMFvU%!9+1klAp6E%jd>2&H#rLsta{YUsZS$090CtS~g@=-Wyu9wvfer5wqk^_awirRqJRKb1VQ05l;?zF7I(Y9a{x=Obv^wx;o+4}~k^BwD7 zPdS$~cKV~OKcPWyhio)@8CU3JxC(cs@`9N9uh}_l6*ZNh2id e=r7ggOtp?}V$`sMT{;b#8xMPQ)A4E#wEh6mXWg{` literal 0 HcmV?d00001 diff --git a/cjfw/www/innocentius/net/cjfw/CJFWmain$2.class b/cjfw/www/innocentius/net/cjfw/CJFWmain$2.class new file mode 100644 index 0000000000000000000000000000000000000000..3e6eda8bec51fc419d93f1d8bbf0934b9eca78fc GIT binary patch literal 970 zcma)5+iuf95Iq}*xN+UaNn7rhUR;`{1w-CYxI9Eu0vV79Y9)BuIGc1+XD#{Ch|fZ5 zLE?cA;CFaHydY-NR7JE(u(Y1t+1WEQ=j?v}{q-Awhqz}V$FMdW4n3(<6bO~dEb){` zy`bM6dd-(Rdjl?&TQ`wsaQgg^dm&dn?@hZeg49HTp>pPZn<>THpYZ$U~RMy@X-mgMS9tN@J;d6i|39l}w*9JgWW&-~|wyyA1he)DcB6lx&!o(X+CR zA}k9A7HrI7k-@0y(2_5ec%2Q}B7S$$QN@n}9`5p3>h;)}*KIPaPp`?XQx`^@sUmLR zmWi7TD^r=VaT|B2?j9cyryG;A_%ca_5^=-A3f4@lQe6`>oF1^@Vx6Jb5#1+>eGI4e1(i>uz$N-yqXWbQe&8~#^+5{96;K)H5=`6FB>EQ5q69iAeSZK& CwDX<- literal 0 HcmV?d00001 diff --git a/cjfw/www/innocentius/net/cjfw/CJFWmain.class b/cjfw/www/innocentius/net/cjfw/CJFWmain.class new file mode 100644 index 0000000000000000000000000000000000000000..3bdca3430fee0949341289745dbe2a629c9fb5fc GIT binary patch literal 6229 zcmb7I31AfE75@I2-R!WL1lVu|qih5uhh!lj2;ndn7z~F=06{ICY$nN)&FnfmOAK1Y zv*1xY00FTEk76|{pe_j@w$);_)@rp{EA?n0sI{Iwyh{82nN4;!2c>~zX8!m7cYg1^ zf9Ay#`wsz_%*tI57_wVhT6_Ub3;9*e2t*@3O*MS})%7jD(gpLDH!A_n1qZQ(^afvT zw5cgz_`<34U#LK%8*|PE>rXXe~vFYjK)BOVeHA>dXj1Ca;*M}+gtW3i#7Y9)mxh{~6|Ih;K1sLVTK2`s)v8uUxU!4y#Zgpgf;OmV z4Zdna4`>ZV7x!JtUFk*vCb{5a7;OtuFJUq!qmaQxd01oue;9?ok9-MJ38cKB+?a-Q zU6@X(>&+!&24)hp)ytwvkU~5>$0lfT?P}F;6y>gTVHU&4-g`@;fgriXx3-KC9+Q5p({bQvWmC2NW=Tw2U9!XBs|o+2)&T*f@iCxeu5n1aeMu|I=sHd?`q zn^Gj9f}ya6%EU|mjYidLLBU%e(!Gk8w+U~V8c}t_TcSkxe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1WA>(?^=osAl6(!{*Y5m}2_IvJjWB<@BAz zPpvMDI%d#yEmXFd4gkC9tHu-bwc;?E*voW%4MFw^H1-+7>^rOxQgFH8L9393wZe2< zAynZ?VJWT_8nI3Y(>01~g%(^dT!;0-t=J&kg`0$(xLLR#8-)jPhtQ5qLI>^^_TwJm zFzyvzMVs&%?i1d{1HwmmQ1}?TgsDg7=zCp^YMkF8eckU@r^^JYZJb8XgJ}xjpqLy%;DI?206A+6!~zh;$zmaH9mvr zj!k9f@EJvS)7W%A + * @author Shellingford + * + */ +public final class CJFWmain extends JavaPlugin +{ + + public final CJFWListener game = new CJFWListener(); + public BukkitScheduler scheduler; + public void onEnable() + { + PluginManager pm = getServer().getPluginManager(); + pm.registerEvents(this.game, this); + } + + public void onDisable() + { + } + + public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, final String[] args) + { + //There is only one main command: cjfw + if(cmd.getName().equals("cjfw")) + { + if(args.length == 0) + // If no argument, display a welcome signal + // also, return false to get usage + { + sender.sendMessage(ChatColor.AQUA+"This is the plugin for a game Desert Base Defence!"); + return false; + } + else if(args.length == 1) + { + if(args[0].equalsIgnoreCase("init")) + // call listener to initialize the game + // The initialize will 100% succeed + { + scheduler = Bukkit.getServer().getScheduler(); + scheduler.cancelTasks(this); + sender.sendMessage(ChatColor.GREEN+"Initializing Desert Base Defend... Standby."); + game.init(); + sender.sendMessage(ChatColor.GOLD+"Successfully initialized!"); + sender.sendMessage("Total Player : " + Bukkit.getOnlinePlayers().length); + sender.sendMessage("Base_HP = " + game.counthp(Bukkit.getOnlinePlayers().length)); + return true; + } + else if(args[0].equalsIgnoreCase("showhp")) + // call listener to show the current hitpoint of bases + // if game not begin, or not initialized + // the sender will get a error message + { + game.showhp(sender); + return true; + } + else if(args[0].equalsIgnoreCase("rank")) + // show the current score rank of players + // the top 6 will be shown + // if game not begin, or not initialized + // the sender will get a error message + { + game.getrank(); + return true; + } + else if(args[0].equalsIgnoreCase("reset")) + // call listener to reset the game + // The reset will 100% succeed + // The boolean is also change to false for re-initialize + // reset can be done while running + // after reset, the status of game will return to stop + { + game.reset(); + scheduler = Bukkit.getServer().getScheduler(); + scheduler.cancelTasks(this); + sender.sendMessage(ChatColor.YELLOW+"Reset complete! Please re-initialize."); + return true; + } + else if(args[0].equalsIgnoreCase("start")) + { + // call listener to start the game + // If the game is not initialized, or is already started + // The start action will fail and send an error message to sender + if(game.start()) + { + scheduler = Bukkit.getServer().getScheduler(); + scheduler.scheduleSyncRepeatingTask(this, new Runnable() { + public void run() { + game.checkdamage(); + game.update(1); + } + }, 0L, 20L); + sender.sendMessage(ChatColor.GOLD+"Desert Base Defence is started!"); + sender.sendMessage(ChatColor.GOLD+"Timer is started."); + } + else + { + sender.sendMessage(ChatColor.BLUE+"The game is already " + + "running"); + sender.sendMessage(ChatColor.RED+"Or it has not been properly initialized!"); + } + return true; + } + else if(args[0].equalsIgnoreCase("stop")) + { + // call listener to pause the game + // The game will remain its critical parameters + // If the game is not running + // The stop action will fail and send an error message to sender + if(game.stop()) + { + scheduler = Bukkit.getServer().getScheduler(); + scheduler.cancelTasks(this); + sender.sendMessage(ChatColor.YELLOW+"Desert Base Defence is paused"); + sender.sendMessage(ChatColor.GRAY+"All parameters are keeped."); + } + else + { + sender.sendMessage(ChatColor.RED+"The game is not " + + "running!"); + } + return true; + } + else if(args[0].equalsIgnoreCase("showloc")) + //call listener to show the location of towers + //don't show if three towers are not initialized. + { + game.getbaseloc("BLUE", sender); + game.getbaseloc("AQUA", sender); + game.getbaseloc("PURPLE", sender); + return true; + } + else + { + return false; + } + } + else if(args.length == 2) + { + if(args[0].equalsIgnoreCase("choose")) + // Is this necessary? + // Let players choose from 4 careers + // If the players already chose a career + // The action will fail and send an error message to sender + { + + return true; + } + else if(args[0].equalsIgnoreCase("setwave")) + { + game.setwave(args[1]); + return true; + } + else if(args[0].equalsIgnoreCase("settime")) + { + game.settime(args[1]); + return true; + } + else if(args[0].equalsIgnoreCase("setdiff")) + { + try + { + double i = Double.parseDouble(args[1]); + game.setdifficulty(i); + return true; + } + catch(Exception x) + { + return false; + } + } + else if(args[0].equalsIgnoreCase("setbase")) + // Call Listener to set the base location for the game + // The location can be reset + // The action will cause exceptions + // So it is surrounded with try catch + { + try + { + if(Integer.parseInt(args[1]) > 3 || Integer.parseInt(args[1]) <= 0) + { + sender.sendMessage("Please enter the correct parameter!"); + return false; + } + else + { + game.setbaselocation(Integer.parseInt(args[1]), game.getloc(sender.getName())); + sender.sendMessage("Set Location for tower" + Integer.parseInt(args[1])); + } + } + catch(NumberFormatException nfe) + { + sender.sendMessage("Please enter an integer for tower number!"); + return false; + } + return true; + } + + else + { + return false; + } + } + else if (args.length == 3) + { + if(args[0].equalsIgnoreCase("heal")) + //Call listener to heal the hit point of one of the bases for a portion (5%) + //args[1] is the number of base + //This method is called by players hitting heal button + //This method won't fail unless the game is not started or initialized + //The final hit point of base will not exceed its original one + //If player is out of usage of this method, it will give back an error message + { + if(game.heal(args[1], args[2])) + { + Bukkit.broadcastMessage(ChatColor.GREEN + args[2] + " 治疗了 " + args[1] + " !"); + } + else + { + Bukkit.getPlayer(args[2]).sendMessage(ChatColor.DARK_RED+"你已经没有使用次数或者游戏尚未开始!"); + } + return true; + } + else if(args[0].equalsIgnoreCase("fortify")) + //Call listener to fortify the base for a period of time(60 ticks now) + //args[1] is the number of the base + //This method is called by players hitting the fortify button + //This method won't fail unless the game is not started or initialized + //If player is out of usage of this method, it will give back an error message + { + if(game.fortify(args[1], args[2])) + { + Bukkit.broadcastMessage(args[2] + " 开启了 " + args[1] + " 的防护!"); + scheduler = Bukkit.getServer().getScheduler(); + scheduler.scheduleSyncDelayedTask(this, new Runnable() + { + public void run() + { + game.defortify(args[1]); + + } + }, 60L); + } + else + { + Bukkit.getPlayer(args[2]).sendMessage(ChatColor.DARK_RED+"你已经没有使用次数或者游戏尚未开始!"); + } + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + else + { + return false; + } + + } +} \ No newline at end of file