Minor changes to teleportation formula. Still not solved.

master_event
sigonasr2 11 years ago
parent 25f10a7a46
commit 0d0d08d03c
  1. 2
      BankEconomyMod/src/me/kaZep/Base/Main.java
  2. 6
      BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java

@ -3741,7 +3741,7 @@ public void payDay(int time)
//Level up! Level up! YEAH! //Level up! Level up! YEAH!
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp")-getJobExp(job,getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")))); getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp", Double.valueOf(getAccountsConfig().getDouble(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"exp")-getJobExp(job,getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv"))));
getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv", Integer.valueOf(getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")+1)); getAccountsConfig().set(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv", Integer.valueOf(getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")+1));
Bukkit.broadcastMessage(p.getName().toLowerCase()+" is now a Level "+getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")+" "+getJobColor(job)+job+ChatColor.WHITE+"."); Bukkit.broadcastMessage(p.getName()+" is now a Level "+getAccountsConfig().getInt(p.getName().toLowerCase()+".jobs.job"+(slot+1)+"lv")+" "+getJobColor(job)+job+ChatColor.WHITE+".");
if (getJobTotalLvs(p)%5==0) { if (getJobTotalLvs(p)%5==0) {
Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+" has reached Level "+getJobTotalLvs(p)+"!"); Bukkit.broadcastMessage(ChatColor.GREEN+p.getName()+" has reached Level "+getJobTotalLvs(p)+"!");
if ((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))>0) { if ((((getJobTotalLvs(p)/5+1)-getStatPointTotal(p)))>0) {

@ -1580,7 +1580,7 @@ public String convertToItemName(String val) {
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money");
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz); double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate"); finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
finalcost = finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth()); finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax"); //finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
if (mymoney>=finalcost) { if (mymoney>=finalcost) {
//Allow teleport to occur. //Allow teleport to occur.
@ -1591,7 +1591,7 @@ public String convertToItemName(String val) {
//Give exp for doing so. //Give exp for doing so.
//this.plugin.gainMoneyExp(p,"Support",0,100); //this.plugin.gainMoneyExp(p,"Support",0,100);
} }
p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName().toLowerCase()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost)); p.sendMessage("Teleported to "+ChatColor.GREEN+target.getName()+ChatColor.WHITE+" for $"+ChatColor.YELLOW+df.format(finalcost)+ChatColor.WHITE+". New Account balance: $"+df.format(mymoney-finalcost));
target.sendMessage(ChatColor.GREEN+p.getName().toLowerCase()+ChatColor.WHITE+" teleported to your location."); target.sendMessage(ChatColor.GREEN+p.getName().toLowerCase()+ChatColor.WHITE+" teleported to your location.");
if (is_in_vehicle) { if (is_in_vehicle) {
vehicle.eject(); vehicle.eject();
@ -1627,7 +1627,7 @@ public String convertToItemName(String val) {
double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money"); double mymoney = this.plugin.getAccountsConfig().getDouble(p.getName().toLowerCase().toLowerCase() + ".money");
double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz); double finalcost = Math.abs(p.getLocation().getX()-otherx)+Math.abs(p.getLocation().getY()-othery)+Math.abs(p.getLocation().getZ()-otherz);
finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate"); finalcost *= this.plugin.getConfig().getDouble("teleport-cost-rate");
finalcost = finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth()); finalcost += finalcost * 15 * ((p.getMaxHealth()-p.getHealth())/p.getMaxHealth());
//finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax"); //finalcost += mymoney*this.plugin.getConfig().getDouble("teleport-cost-tax");
if (mymoney>=finalcost) { if (mymoney>=finalcost) {
//Allow teleport to occur. //Allow teleport to occur.

Loading…
Cancel
Save