Continue Dungeon class. Fixed issue #19.
This commit is contained in:
parent
163949e354
commit
66b18762e3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -23,3 +23,5 @@ commands:
|
|||||||
description: Unenchant your currently held item.
|
description: Unenchant your currently held item.
|
||||||
event:
|
event:
|
||||||
description: Toggles or untoggles events.
|
description: Toggles or untoggles events.
|
||||||
|
dungeon:
|
||||||
|
description: X
|
@ -190,6 +190,7 @@ public class Main extends JavaPlugin
|
|||||||
getCommand("settings").setExecutor(new commandBankEconomy(this));
|
getCommand("settings").setExecutor(new commandBankEconomy(this));
|
||||||
getCommand("maintenance").setExecutor(new commandBankEconomy(this));
|
getCommand("maintenance").setExecutor(new commandBankEconomy(this));
|
||||||
getCommand("event").setExecutor(new commandBankEconomy(this));
|
getCommand("event").setExecutor(new commandBankEconomy(this));
|
||||||
|
getCommand("dungeon").setExecutor(new commandBankEconomy(this));
|
||||||
|
|
||||||
setupEconomy();
|
setupEconomy();
|
||||||
|
|
||||||
@ -3153,9 +3154,14 @@ public void payDay(int time)
|
|||||||
p.sendMessage(ChatColor.GOLD+"Sorry, that is not a valid job!");
|
p.sendMessage(ChatColor.GOLD+"Sorry, that is not a valid job!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getAccountsConfig().set(p.getName()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob]));
|
if (PlayerinJob(p,job)) {
|
||||||
saveAccountsConfig();
|
getAccountsConfig().set(p.getName()+".jobs.ultimate", String.valueOf(ValidJobs[matchedjob]));
|
||||||
p.sendMessage(ChatColor.YELLOW+"Set Declared Ultimate job to "+job);
|
saveAccountsConfig();
|
||||||
|
p.sendMessage(ChatColor.YELLOW+"Set Declared Ultimate job to "+job);
|
||||||
|
} else {
|
||||||
|
p.sendMessage(ChatColor.GOLD+"Sorry, you are not in that job!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean joinJob(Player p, String job) {
|
public boolean joinJob(Player p, String job) {
|
||||||
|
@ -1367,15 +1367,29 @@ public class PlayerListener
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPortalEnter(PlayerTeleportEvent e) {
|
public void onPortalEnter(PlayerTeleportEvent e) {
|
||||||
if (e.getPlayer().getLocation().distanceSquared(new Location(Bukkit.getWorld("world"),1606d,66d,-365d))<900) {
|
final Player p = e.getPlayer();
|
||||||
//This is a player trying to enter a portal. Verify if they have selected their ultimate.
|
if (e.getFrom().getWorld()==Bukkit.getWorld("world")) {
|
||||||
if (this.plugin.getAccountsConfig().contains(e.getPlayer().getName()+".jobs.ultimate")) {
|
if (e.getFrom().distanceSquared(new Location(Bukkit.getWorld("world"),1606d,66d,-365d))<900) {
|
||||||
//Check if this job's ultimate level is high enough.
|
//This is a player trying to enter a portal. Verify if they have selected their ultimate.
|
||||||
if (this.plugin.getJobLv(this.plugin.getAccountsConfig().getString(e.getPlayer().getName()+".jobs.ultimate"), e.getPlayer())>=40) {
|
if (this.plugin.getAccountsConfig().contains(e.getPlayer().getName()+".jobs.ultimate")) {
|
||||||
//Allow this teleport.
|
//Check if this job's ultimate level is high enough.
|
||||||
e.setTo(new Location(Bukkit.getWorld("world"),-8990,68,-4));
|
if (this.plugin.getJobLv(this.plugin.getAccountsConfig().getString(e.getPlayer().getName()+".jobs.ultimate"), e.getPlayer())>=40) {
|
||||||
} else {
|
//Allow this teleport.
|
||||||
e.setCancelled(true);
|
//e.setTo(new Location(Bukkit.getWorld("world"),-8990,68,-4));
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
p.getPlayer().teleport(new Location(Bukkit.getWorld("world"),-8990,68,-4));
|
||||||
|
}
|
||||||
|
},5);
|
||||||
|
} else {
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
p.getPlayer().teleport(new Location(Bukkit.getWorld("world"),1606d,66d,-365d));
|
||||||
|
}
|
||||||
|
},5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2939,10 +2953,12 @@ public class PlayerListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pot.getType()==PotionType.INSTANT_HEAL) {
|
if (pot.getType()==PotionType.INSTANT_HEAL) {
|
||||||
if (p.getHealth()+24>p.getMaxHealth()) {
|
if (!p.isDead()) {
|
||||||
p.setHealth(p.getMaxHealth());
|
if (p.getHealth()+24>p.getMaxHealth()) {
|
||||||
} else {
|
p.setHealth(p.getMaxHealth());
|
||||||
p.setHealth(p.getHealth()+24);
|
} else {
|
||||||
|
p.setHealth(p.getHealth()+24);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2998,18 +3014,20 @@ public class PlayerListener
|
|||||||
this.plugin.gainMoneyExp(shooter,"Support",0.25,12);
|
this.plugin.gainMoneyExp(shooter,"Support",0.25,12);
|
||||||
}
|
}
|
||||||
if (nextpotioneffect.getType().getName().compareTo("HEAL")==0) {
|
if (nextpotioneffect.getType().getName().compareTo("HEAL")==0) {
|
||||||
if (p.getHealth()/p.getMaxHealth()<=0.30) {
|
if (!p.isDead()) {
|
||||||
this.plugin.gainMoneyExp(shooter,"Support",0.60,30);
|
if (p.getHealth()/p.getMaxHealth()<=0.30) {
|
||||||
//shooter.sendMessage("This is a big heal.");
|
this.plugin.gainMoneyExp(shooter,"Support",0.60,30);
|
||||||
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth()));
|
//shooter.sendMessage("This is a big heal.");
|
||||||
|
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth()));
|
||||||
|
}
|
||||||
|
this.plugin.gainMoneyExp(shooter,"Support",0.30,14);
|
||||||
|
if (p.getHealth()+12>p.getMaxHealth()) {
|
||||||
|
p.setHealth(p.getMaxHealth());
|
||||||
|
} else {
|
||||||
|
p.setHealth(p.getHealth()+12);
|
||||||
|
}
|
||||||
|
//shooter.sendMessage("This is a heal.");
|
||||||
}
|
}
|
||||||
this.plugin.gainMoneyExp(shooter,"Support",0.30,14);
|
|
||||||
if (p.getHealth()+12>p.getMaxHealth()) {
|
|
||||||
p.setHealth(p.getMaxHealth());
|
|
||||||
} else {
|
|
||||||
p.setHealth(p.getHealth()+12);
|
|
||||||
}
|
|
||||||
//shooter.sendMessage("This is a heal.");
|
|
||||||
}
|
}
|
||||||
if (nextpotioneffect.getType().getName().compareTo("REGENERATION")==0) {
|
if (nextpotioneffect.getType().getName().compareTo("REGENERATION")==0) {
|
||||||
if (p.getHealth()/p.getMaxHealth()<=0.30) {
|
if (p.getHealth()/p.getMaxHealth()<=0.30) {
|
||||||
@ -3082,13 +3100,15 @@ public class PlayerListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextpotioneffect.getType().getName().compareTo("HEAL")==0) {
|
if (nextpotioneffect.getType().getName().compareTo("HEAL")==0) {
|
||||||
if (p.getHealth()+12>p.getMaxHealth()) {
|
if (!p.isDead()) {
|
||||||
p.setHealth(p.getMaxHealth());
|
if (p.getHealth()+12>p.getMaxHealth()) {
|
||||||
} else {
|
p.setHealth(p.getMaxHealth());
|
||||||
p.setHealth(p.getHealth()+12);
|
} else {
|
||||||
|
p.setHealth(p.getHealth()+12);
|
||||||
|
}
|
||||||
|
//shooter.sendMessage("This is a heal.");
|
||||||
|
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth()));
|
||||||
}
|
}
|
||||||
//shooter.sendMessage("This is a heal.");
|
|
||||||
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ConcurrentModificationException ex_e) {
|
} catch (ConcurrentModificationException ex_e) {
|
||||||
@ -3131,12 +3151,14 @@ public class PlayerListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextpotioneffect.getType().getName().compareTo("HEAL")==0) {
|
if (nextpotioneffect.getType().getName().compareTo("HEAL")==0) {
|
||||||
if (p.getHealth()+12>p.getMaxHealth()) {
|
if (!p.isDead()) {
|
||||||
p.setHealth(p.getMaxHealth());
|
if (p.getHealth()+12>p.getMaxHealth()) {
|
||||||
} else {
|
p.setHealth(p.getMaxHealth());
|
||||||
p.setHealth(p.getHealth()+12);
|
} else {
|
||||||
|
p.setHealth(p.getHealth()+12);
|
||||||
|
}
|
||||||
|
//shooter.sendMessage("This is a heal.");
|
||||||
}
|
}
|
||||||
//shooter.sendMessage("This is a heal.");
|
|
||||||
}
|
}
|
||||||
effects.remove();
|
effects.remove();
|
||||||
}
|
}
|
||||||
|
@ -5,11 +5,13 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import me.kaZep.Base.Dungeon;
|
||||||
import me.kaZep.Base.Main;
|
import me.kaZep.Base.Main;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
@ -264,6 +266,9 @@ public class commandBankEconomy
|
|||||||
}
|
}
|
||||||
this.plugin.saveConfig();
|
this.plugin.saveConfig();
|
||||||
}
|
}
|
||||||
|
} else
|
||||||
|
if (cmd.getName().equalsIgnoreCase("dungeon") && p.hasPermission("maintenance-mode-admin") && args.length==1) {
|
||||||
|
Dungeon x = new Dungeon(new Location(Bukkit.getWorld("world"),-8990,0,-4),new Location(Bukkit.getWorld("world"),50,255,50),Integer.valueOf(args[0]));
|
||||||
} else
|
} else
|
||||||
if (cmd.getName().equalsIgnoreCase("transfer") && args.length==1) {
|
if (cmd.getName().equalsIgnoreCase("transfer") && args.length==1) {
|
||||||
p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player.");
|
p.sendMessage("Usage: "+ChatColor.RED+"/transfer name money"+ChatColor.WHITE+" - Transfer money to a player.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user