Merge branch 'master' of ssh://dev1.mineplex.com:7999/min/mineplex

Conflicts:
	Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/ISkill.java
	Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Skill.java
This commit is contained in:
Chiss 2014-03-28 14:55:13 +11:00
commit 4386ce0b96
105 changed files with 488 additions and 611 deletions

View File

@ -33,7 +33,6 @@ import mineplex.hub.server.ServerManager;
import mineplex.minecraft.game.classcombat.Class.ClassManager;
import mineplex.minecraft.game.classcombat.Condition.SkillConditionManager;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.shop.ClassCombatCustomBuildShop;
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
import mineplex.minecraft.game.core.IRelation;
@ -103,7 +102,7 @@ public class Hub extends JavaPlugin implements INautilusPlugin, IRelation
ClassManager classManager = new ClassManager(this, clientManager, donationManager, skillManager, GetWebServerAddress());
ClassShopManager shopManager = new ClassShopManager(this, classManager, skillManager, null);
new ClassCombatCustomBuildShop(shopManager, clientManager, donationManager, "Class Shop");
new ClassCombatShop(shopManager, clientManager, donationManager, "Class Shop");
//Updates
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Updater(this), 1, 1);

View File

@ -1,23 +1,17 @@
package mineplex.minecraft.game.classcombat.Class;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Class.repository.ClassRepository;
import mineplex.minecraft.game.classcombat.Class.repository.token.ClassToken;
import mineplex.minecraft.game.classcombat.Class.repository.token.ClientClassTokenWrapper;
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
import mineplex.minecraft.game.classcombat.Class.repository.token.SlotToken;
import mineplex.minecraft.game.classcombat.Skill.ISkill;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.account.event.ClientWebResponseEvent;
import mineplex.core.donation.DonationManager;
import mineplex.core.donation.repository.GameSalesPackageToken;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
@ -91,27 +85,6 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
Material.LEATHER_HELMET, Material.LEATHER_CHESTPLATE, Material.LEATHER_LEGGINGS, Material.LEATHER_BOOTS,
Color.fromRGB(20, 100, 0)));
*/
List<ClassToken> classTokens = new ArrayList<ClassToken>();
for (IPvpClass pvpClass : _classes.values())
{
ClassToken classToken = new ClassToken();
classToken.Name = pvpClass.GetName();
classToken.SalesPackage = new GameSalesPackageToken();
classToken.SalesPackage.Gems = pvpClass.GetCost();
classTokens.add(classToken);
}
for (ClassToken classToken : _repository.GetClasses(classTokens))
{
if (_classes.containsKey(classToken.Name))
{
_classes.get(classToken.Name).Update(classToken);
_classSalesPackageIdMap.put(classToken.SalesPackage.GameSalesPackageId, _classes.get(classToken.Name));
}
}
}
private void AddAssassin()
@ -119,12 +92,12 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
CustomBuildToken customBuild = new CustomBuildToken();
customBuild.Name = "Default Build";
customBuild.SwordSkillId = _skillFactory.GetSkill("Evade").GetSalesPackageId();
customBuild.AxeSkillId = _skillFactory.GetSkill("Blink").GetSalesPackageId();
customBuild.BowSkillId = _skillFactory.GetSkill("Marked for Death").GetSalesPackageId();
customBuild.ClassPassiveASkillId = _skillFactory.GetSkill("Stealth").GetSalesPackageId();
customBuild.ClassPassiveBSkillId = _skillFactory.GetSkill("Repeated Strikes").GetSalesPackageId();
customBuild.GlobalPassiveSkillId = _skillFactory.GetSkill("Break Fall").GetSalesPackageId();
customBuild.SwordSkill = "Evade";
customBuild.AxeSkill = "Blink";
customBuild.BowSkill = "Marked for Death";
customBuild.ClassPassiveASkill = "Stealth";
customBuild.ClassPassiveBSkill = "Repeated Strikes";
customBuild.GlobalPassiveSkill = "Break Fall";
AddClass(new PvpClass(
this,
@ -141,12 +114,12 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
CustomBuildToken customBuild = new CustomBuildToken();
customBuild.Name = "Default Build";
customBuild.SwordSkillId = _skillFactory.GetSkill("Blizzard").GetSalesPackageId();
customBuild.AxeSkillId = _skillFactory.GetSkill("Freezing Blast").GetSalesPackageId();
customBuild.BowSkillId = -1;
customBuild.ClassPassiveASkillId = _skillFactory.GetSkill("Arctic Armor").GetSalesPackageId();
customBuild.ClassPassiveBSkillId = _skillFactory.GetSkill("Glacial Blade").GetSalesPackageId();
customBuild.GlobalPassiveSkillId = _skillFactory.GetSkill("Fitness").GetSalesPackageId();
customBuild.SwordSkill = "Blizzard";
customBuild.AxeSkill = "Freezing Blast";
customBuild.BowSkill = "";
customBuild.ClassPassiveASkill = "Arctic Armor";
customBuild.ClassPassiveBSkill = "Glacial Blade";
customBuild.GlobalPassiveSkill = "Fitness";
AddClass(new PvpClass(this,
4,
@ -162,12 +135,12 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
CustomBuildToken customBuild = new CustomBuildToken();
customBuild.Name = "Default Build";
customBuild.SwordSkillId = _skillFactory.GetSkill("Dwarf Toss").GetSalesPackageId();
customBuild.AxeSkillId = _skillFactory.GetSkill("Seismic Slam").GetSalesPackageId();
customBuild.BowSkillId = -1;
customBuild.ClassPassiveASkillId = _skillFactory.GetSkill("Stampede").GetSalesPackageId();
customBuild.ClassPassiveBSkillId = _skillFactory.GetSkill("Crippling Blow").GetSalesPackageId();
customBuild.GlobalPassiveSkillId = _skillFactory.GetSkill("Recharge").GetSalesPackageId();
customBuild.SwordSkill = "Dwarf Toss";
customBuild.AxeSkill = "Seismic Slam";
customBuild.BowSkill = "";
customBuild.ClassPassiveASkill = "Stampede";
customBuild.ClassPassiveBSkill = "Crippling Blow";
customBuild.GlobalPassiveSkill = "Recharge";
AddClass(new PvpClass(this,
3,
@ -183,12 +156,12 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
CustomBuildToken customBuild = new CustomBuildToken();
customBuild.Name = "Default Build";
customBuild.SwordSkillId = _skillFactory.GetSkill("Disengage").GetSalesPackageId();
customBuild.AxeSkillId = _skillFactory.GetSkill("Agility").GetSalesPackageId();
customBuild.BowSkillId = _skillFactory.GetSkill("Napalm Shot").GetSalesPackageId();
customBuild.ClassPassiveASkillId = _skillFactory.GetSkill("Barrage").GetSalesPackageId();
customBuild.ClassPassiveBSkillId = _skillFactory.GetSkill("Barbed Arrows").GetSalesPackageId();
customBuild.GlobalPassiveSkillId = _skillFactory.GetSkill("Quick Recovery").GetSalesPackageId();
customBuild.SwordSkill = "Disengage";
customBuild.AxeSkill = "Agility";
customBuild.BowSkill = "Napalm Shot";
customBuild.ClassPassiveASkill = "Barrage";
customBuild.ClassPassiveBSkill = "Barbed Arrows";
customBuild.GlobalPassiveSkill = "Quick Recovery";
AddClass(new PvpClass(this,
-1,
@ -204,12 +177,12 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
CustomBuildToken customBuild = new CustomBuildToken();
customBuild.Name = "Default Build";
customBuild.SwordSkillId = _skillFactory.GetSkill("Hilt Smash").GetSalesPackageId();
customBuild.AxeSkillId = _skillFactory.GetSkill("Bulls Charge").GetSalesPackageId();
customBuild.BowSkillId = -1;
customBuild.ClassPassiveASkillId = _skillFactory.GetSkill("Swordsmanship").GetSalesPackageId();
customBuild.ClassPassiveBSkillId = _skillFactory.GetSkill("Fortitude").GetSalesPackageId();
customBuild.GlobalPassiveSkillId = _skillFactory.GetSkill("Resistance").GetSalesPackageId();
customBuild.SwordSkill = "Hilt Smash";
customBuild.AxeSkill = "Bulls Charge";
customBuild.BowSkill = "";
customBuild.ClassPassiveASkill = "Swordsmanship";
customBuild.ClassPassiveBSkill = "Fortitude";
customBuild.GlobalPassiveSkill = "Resistance";
AddClass(new PvpClass(
this,

View File

@ -1,5 +1,6 @@
package mineplex.minecraft.game.classcombat.Class;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -38,7 +39,7 @@ public class ClientClass
private IPvpClass _lastClass;
private NautHashMap<Integer, ItemStack> _lastItems = new NautHashMap<Integer, ItemStack>();
private ItemStack[] _lastArmor = new ItemStack[4];
private NautHashMap<SkillType, ISkill> _lastSkillMap = new NautHashMap<SkillType, ISkill>();
private NautHashMap<SkillType, Entry<ISkill, Integer>> _lastSkillMap = new NautHashMap<SkillType, Entry<ISkill, Integer>>();
private NautHashMap<IPvpClass, HashMap<Integer, CustomBuildToken>> _customBuilds;
private NautHashMap<IPvpClass, CustomBuildToken> _activeCustomBuilds;
@ -74,31 +75,31 @@ public class ClientClass
if (buildToken.CustomBuildNumber == 0)
continue;
IPvpClass pvpClass = _classFactory.GetClass(buildToken.PvpClassId);
IPvpClass pvpClass = _classFactory.GetClass(buildToken.PvpClass);
ISkill swordSkill = _skillFactory.GetSkillBySalesPackageId(buildToken.SwordSkillId);
ISkill axeSkill = _skillFactory.GetSkillBySalesPackageId(buildToken.AxeSkillId);
ISkill bowSkill = _skillFactory.GetSkillBySalesPackageId(buildToken.BowSkillId);
ISkill classPassiveASkill = _skillFactory.GetSkillBySalesPackageId(buildToken.ClassPassiveASkillId);
ISkill classPassiveBSkill = _skillFactory.GetSkillBySalesPackageId(buildToken.ClassPassiveBSkillId);
ISkill globalPassive = _skillFactory.GetSkillBySalesPackageId(buildToken.GlobalPassiveSkillId);
ISkill swordSkill = _skillFactory.GetSkill(buildToken.SwordSkill);
ISkill axeSkill = _skillFactory.GetSkill(buildToken.AxeSkill);
ISkill bowSkill = _skillFactory.GetSkill(buildToken.BowSkill);
ISkill classPassiveASkill = _skillFactory.GetSkill(buildToken.ClassPassiveASkill);
ISkill classPassiveBSkill = _skillFactory.GetSkill(buildToken.ClassPassiveBSkill);
ISkill globalPassive = _skillFactory.GetSkill(buildToken.GlobalPassiveSkill);
if (!ValidSkill(buildToken.SwordSkillId, swordSkill, SkillType.Sword))
if (!ValidSkill(buildToken.SwordSkill, swordSkill, SkillType.Sword))
continue;
if (!ValidSkill(buildToken.AxeSkillId, axeSkill, SkillType.Axe))
if (!ValidSkill(buildToken.AxeSkill, axeSkill, SkillType.Axe))
continue;
if (!ValidSkill(buildToken.BowSkillId, bowSkill, SkillType.Bow))
if (!ValidSkill(buildToken.BowSkill, bowSkill, SkillType.Bow))
continue;
if (!ValidSkill(buildToken.ClassPassiveASkillId, classPassiveASkill, SkillType.PassiveA))
if (!ValidSkill(buildToken.ClassPassiveASkill, classPassiveASkill, SkillType.PassiveA))
continue;
if (!ValidSkill(buildToken.ClassPassiveBSkillId, classPassiveBSkill, SkillType.PassiveB))
if (!ValidSkill(buildToken.ClassPassiveBSkill, classPassiveBSkill, SkillType.PassiveB))
continue;
if (!ValidSkill(buildToken.GlobalPassiveSkillId, globalPassive, SkillType.GlobalPassive))
if (!ValidSkill(buildToken.GlobalPassiveSkill, globalPassive, SkillType.GlobalPassive))
continue;
_customBuilds.get(pvpClass).put(buildToken.CustomBuildNumber, buildToken);
@ -134,51 +135,8 @@ public class ClientClass
{
_savingCustomBuild.PlayerName = _client.GetPlayerName();
ISkill swordSkill = GetSkillByType(SkillType.Sword);
if (swordSkill != null)
_savingCustomBuild.SwordSkillId = swordSkill.GetSalesPackageId();
else
_savingCustomBuild.SwordSkillId = -1;
ISkill axeSkill = GetSkillByType(SkillType.Axe);
if (axeSkill != null)
_savingCustomBuild.AxeSkillId = axeSkill.GetSalesPackageId();
else
_savingCustomBuild.AxeSkillId = -1;
ISkill bowSkill = GetSkillByType(SkillType.Bow);
if (bowSkill != null)
_savingCustomBuild.BowSkillId = bowSkill.GetSalesPackageId();
else
_savingCustomBuild.BowSkillId = -1;
ISkill passiveASkill = GetSkillByType(SkillType.PassiveA);
if (passiveASkill != null)
_savingCustomBuild.ClassPassiveASkillId = passiveASkill.GetSalesPackageId();
else
_savingCustomBuild.ClassPassiveASkillId = -1;
ISkill passiveBSkill = GetSkillByType(SkillType.PassiveB);
if (passiveBSkill != null)
_savingCustomBuild.ClassPassiveBSkillId = passiveBSkill.GetSalesPackageId();
else
_savingCustomBuild.ClassPassiveBSkillId = -1;
ISkill globalPassiveSkill = GetSkillByType(SkillType.GlobalPassive);
if (globalPassiveSkill != null)
_savingCustomBuild.GlobalPassiveSkillId = globalPassiveSkill.GetSalesPackageId();
else
_savingCustomBuild.GlobalPassiveSkillId = -1;
_savingCustomBuild.Slots = new ArrayList<SlotToken>(9);
System.out.println("Custom build saving: ");
_savingCustomBuild.printInfo();
_classFactory.GetRepository().SaveCustomBuild(_savingCustomBuild);
_savingCustomBuild = null;
}
@ -186,7 +144,7 @@ public class ClientClass
public void SetSavingCustomBuild(IPvpClass pvpClass, CustomBuildToken customBuild)
{
_savingCustomBuild = customBuild;
_savingCustomBuild.PvpClassId = pvpClass.GetSalesPackageId();
_savingCustomBuild.PvpClass = pvpClass.GetName();
_customBuilds.get(pvpClass).put(_savingCustomBuild.CustomBuildNumber, _savingCustomBuild);
}
@ -224,7 +182,7 @@ public class ClientClass
public void EquipCustomBuild(CustomBuildToken customBuild, boolean notify)
{
_lastClass = _classFactory.GetClass(customBuild.PvpClassId);
_lastClass = _classFactory.GetClass(customBuild.PvpClass);
if (_lastClass == null)
return;
@ -236,33 +194,33 @@ public class ClientClass
SetDefaultLegs(ItemStackFactory.Instance.CreateStack(_lastClass.GetLeggings()));
SetDefaultFeet(ItemStackFactory.Instance.CreateStack(_lastClass.GetBoots()));
if (customBuild.SwordSkillId != -1)
_lastSkillMap.put(SkillType.Sword, _skillFactory.GetSkillBySalesPackageId(customBuild.SwordSkillId));
if (!customBuild.SwordSkill.isEmpty())
_lastSkillMap.put(SkillType.Sword, new AbstractMap.SimpleEntry<ISkill, Integer>(_skillFactory.GetSkill(customBuild.SwordSkill), customBuild.SwordLevel));
else
_lastSkillMap.remove(SkillType.Sword);
if (customBuild.AxeSkillId != -1)
_lastSkillMap.put(SkillType.Axe, _skillFactory.GetSkillBySalesPackageId(customBuild.AxeSkillId));
if (!customBuild.AxeSkill.isEmpty())
_lastSkillMap.put(SkillType.Axe, new AbstractMap.SimpleEntry<ISkill, Integer>(_skillFactory.GetSkill(customBuild.AxeSkill), customBuild.AxeLevel));
else
_lastSkillMap.remove(SkillType.Axe);
if (customBuild.BowSkillId != -1)
_lastSkillMap.put(SkillType.Bow, _skillFactory.GetSkillBySalesPackageId(customBuild.BowSkillId));
if (!customBuild.BowSkill.isEmpty())
_lastSkillMap.put(SkillType.Bow, new AbstractMap.SimpleEntry<ISkill, Integer>(_skillFactory.GetSkill(customBuild.BowSkill), customBuild.BowLevel));
else
_lastSkillMap.remove(SkillType.Bow);
if (customBuild.ClassPassiveASkillId != -1)
_lastSkillMap.put(SkillType.PassiveA, _skillFactory.GetSkillBySalesPackageId(customBuild.ClassPassiveASkillId));
if (!customBuild.ClassPassiveASkill.isEmpty())
_lastSkillMap.put(SkillType.PassiveA, new AbstractMap.SimpleEntry<ISkill, Integer>(_skillFactory.GetSkill(customBuild.ClassPassiveASkill), customBuild.ClassPassiveALevel));
else
_lastSkillMap.remove(SkillType.PassiveA);
if (customBuild.ClassPassiveBSkillId != -1)
_lastSkillMap.put(SkillType.PassiveB, _skillFactory.GetSkillBySalesPackageId(customBuild.ClassPassiveBSkillId));
if (!customBuild.ClassPassiveBSkill.isEmpty())
_lastSkillMap.put(SkillType.PassiveB, new AbstractMap.SimpleEntry<ISkill, Integer>(_skillFactory.GetSkill(customBuild.ClassPassiveBSkill), customBuild.ClassPassiveBLevel));
else
_lastSkillMap.remove(SkillType.PassiveB);
if (customBuild.GlobalPassiveSkillId != -1)
_lastSkillMap.put(SkillType.GlobalPassive, _skillFactory.GetSkillBySalesPackageId(customBuild.GlobalPassiveSkillId));
if (!customBuild.GlobalPassiveSkill.isEmpty())
_lastSkillMap.put(SkillType.GlobalPassive, new AbstractMap.SimpleEntry<ISkill, Integer>(_skillFactory.GetSkill(customBuild.GlobalPassiveSkill), customBuild.GlobalPassiveLevel));
else
_lastSkillMap.remove(SkillType.GlobalPassive);
@ -309,7 +267,7 @@ public class ClientClass
for (ISkill skill : _lastClass.GetDefaultSkills().keySet())
{
if (skill.GetSkillType() != SkillType.Class)
_lastSkillMap.put(skill.GetSkillType(), skill);
_lastSkillMap.put(skill.GetSkillType(), new AbstractMap.SimpleEntry<ISkill, Integer>(skill, _lastClass.GetDefaultSkills().get(skill)));
}
}
@ -370,11 +328,26 @@ public class ClientClass
for (ISkill cur : _gameClass.GetDefaultSkills().keySet())
{
if (cur.GetSkillType() == SkillType.Class)
AddSkill(cur);
AddSkill(cur, _gameClass.GetDefaultSkills().get(cur));
}
for (ISkill skill : _lastSkillMap.values())
AddSkill(skill);
System.out.println("Adding back skills");
for (Entry<ISkill, Integer> skill : _lastSkillMap.values())
{
if (skill == null)
System.out.println("Skill is null in ClientClass.ClearSkills()");
if (skill.getKey() == null)
System.out.println("Skill key is null in ClientClass.ClearSkills()");
if (skill.getValue() == null)
System.out.println("Skill value is null in ClientClass.ClearSkills()");
System.out.println("Key : " + skill.getKey());
System.out.println("Value : " + skill.getValue());
AddSkill(skill.getKey(), skill.getValue());
}
}
public void ClearSkills()
@ -403,7 +376,7 @@ public class ClientClass
public void ClearDefaultSkills()
{
_lastSkillMap = new NautHashMap<SkillType, ISkill>();
_lastSkillMap = new NautHashMap<SkillType, Entry<ISkill, Integer>>();
}
public void SetGameClass(IPvpClass gameClass)
@ -418,7 +391,7 @@ public class ClientClass
for (ISkill cur : gameClass.GetDefaultSkills().keySet())
{
if (cur.GetSkillType() == SkillType.Class)
AddSkill(cur);
AddSkill(cur, gameClass.GetDefaultSkills().get(cur));
}
//Inform
@ -447,7 +420,7 @@ public class ClientClass
return _skillMap.values();
}
public Collection<ISkill> GetDefaultSkills()
public Collection<Entry<ISkill, Integer>> GetDefaultSkills()
{
return _lastSkillMap.values();
}
@ -463,7 +436,7 @@ public class ClientClass
return null;
}
public void AddSkill(ISkill skill)
public void AddSkill(ISkill skill, int level)
{
if (_skillMap == null)
_skillMap = new NautHashMap<SkillType, ISkill>();
@ -472,9 +445,12 @@ public class ClientClass
_skillMap.get(skill.GetSkillType()).RemoveUser(_client.GetPlayer());
_skillMap.put(skill.GetSkillType(), skill);
_lastSkillMap.put(skill.GetSkillType(), skill);
_lastSkillMap.put(skill.GetSkillType(), new AbstractMap.SimpleEntry<ISkill, Integer>(skill, level));
skill.AddUser(_client.GetPlayer());
skill.AddUser(_client.GetPlayer(), level);
if (IsSavingCustomBuild())
_savingCustomBuild.setSkill(skill, level);
}
public void RemoveSkill(ISkill skill)
@ -507,9 +483,9 @@ public class ClientClass
_lastSkillMap.clear();
}
private boolean ValidSkill(int skillId, ISkill skill, SkillType expectedType)
private boolean ValidSkill(String skillName, ISkill skill, SkillType expectedType)
{
if (skillId != -1 && (skill == null || skill.GetSkillType() != expectedType || (!skill.IsFree() && !_donor.Owns(skillId) && !_client.GetRank().Has(Rank.ULTRA) && !_donor.OwnsUnknownPackage("Competitive ULTRA"))))
if (!skillName.isEmpty() && (skill == null || skill.GetSkillType() != expectedType || (!skill.IsFree() && !_donor.OwnsUnknownPackage("Champions " + skillName) && !_client.GetRank().Has(Rank.ULTRA) && !_donor.OwnsUnknownPackage("Competitive ULTRA"))))
return false;
return true;

View File

@ -3,7 +3,6 @@ package mineplex.minecraft.game.classcombat.Class;
import java.util.HashMap;
import java.util.HashSet;
import mineplex.minecraft.game.classcombat.Class.repository.token.ClassToken;
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
import mineplex.minecraft.game.classcombat.Skill.ISkill;
@ -36,7 +35,6 @@ public interface IPvpClass
void checkEquip();
Integer GetCost();
boolean IsFree();
void Update(ClassToken classToken);
String[] GetDesc();
void ApplyArmor(Player caller);
CustomBuildToken getDefaultBuild();

View File

@ -5,7 +5,6 @@ import java.util.HashSet;
import mineplex.core.common.util.UtilGear;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.minecraft.game.classcombat.Class.repository.token.ClassToken;
import mineplex.minecraft.game.classcombat.Class.repository.token.CustomBuildToken;
import mineplex.minecraft.game.classcombat.Skill.ISkill;
@ -257,15 +256,6 @@ public class PvpClass implements IPvpClass
{
return _free;
}
@Override
public void Update(ClassToken classToken)
{
_salesPackageId = classToken.SalesPackage.GameSalesPackageId;
_cost = classToken.SalesPackage.Gems;
_free = classToken.SalesPackage.Free;
_customBuild.PvpClassId = classToken.SalesPackage.GameSalesPackageId;
}
@Override
public void ApplyArmor(Player caller)

View File

@ -3,56 +3,138 @@ package mineplex.minecraft.game.classcombat.Class.repository.token;
import java.util.ArrayList;
import java.util.List;
public class CustomBuildToken
{
public int CustomBuildId;
import mineplex.minecraft.game.classcombat.Skill.ISkill;
public String PlayerName;
public String Name;
public boolean Active;
public Integer CustomBuildNumber = 0;
public int PvpClassId = -1;
public class CustomBuildToken
{
public int CustomBuildId;
public int SwordSkillId = -1;
public String PlayerName;
public String Name;
public boolean Active;
public int AxeSkillId = -1;
public Integer CustomBuildNumber = 0;
public int BowSkillId = -1;
public String PvpClass = "";
public int ClassPassiveASkillId = -1;
public int ClassPassiveBSkillId = -1;
public String SwordSkill = "";
public Integer SwordLevel = 0;
public int GlobalPassiveSkillId = -1;
public String AxeSkill = "";
public Integer AxeLevel = 0;
public List<SlotToken> Slots = new ArrayList<SlotToken>();;
public void printInfo()
{
System.out.println("CustomBuildId : " + CustomBuildId);
System.out.println("PlayerName : " + PlayerName);
System.out.println("Name : " + Name);
System.out.println("Active : " + Active);
System.out.println("CustomBuildNumber : " + CustomBuildNumber);
System.out.println("PvpClassId : " + PvpClassId);
public String BowSkill = "";
public Integer BowLevel = 0;
System.out.println("SwordSkillId : " + SwordSkillId);
public String ClassPassiveASkill = "";
public Integer ClassPassiveALevel = 0;
System.out.println("AxeSkillId : " + AxeSkillId);
public String ClassPassiveBSkill = "";
public Integer ClassPassiveBLevel = 0;
System.out.println("BowSkillId : " + BowSkillId);
public String GlobalPassiveSkill = "";
public Integer GlobalPassiveLevel = 0;
System.out.println("ClassPassiveASkillId : " + ClassPassiveASkillId);
System.out.println("ClassPassiveBSkillId : " + ClassPassiveBSkillId);
public List<SlotToken> Slots = new ArrayList<SlotToken>();
System.out.println("GlobalPassiveSkillId : " + GlobalPassiveSkillId);
for (SlotToken token : Slots)
{
token.printInfo();
}
}
public void printInfo()
{
System.out.println("CustomBuildId : " + CustomBuildId);
System.out.println("PlayerName : " + PlayerName);
System.out.println("Name : " + Name);
System.out.println("Active : " + Active);
System.out.println("CustomBuildNumber : " + CustomBuildNumber);
System.out.println("PvpClass : " + PvpClass);
System.out.println("SwordSkill : " + SwordSkill);
System.out.println("SwordLevel : " + SwordLevel);
System.out.println("AxeSkill : " + AxeSkill);
System.out.println("AxeLevel : " + AxeLevel);
System.out.println("BowSkill : " + BowSkill);
System.out.println("BowLevel : " + BowLevel);
System.out.println("ClassPassiveASkill : " + ClassPassiveASkill);
System.out.println("ClassPassiveALevel : " + ClassPassiveALevel);
System.out.println("ClassPassiveBSkill : " + ClassPassiveBSkill);
System.out.println("ClassPassiveBLevel : " + ClassPassiveBLevel);
System.out.println("GlobalPassiveSkill : " + GlobalPassiveSkill);
System.out.println("GlobalPassiveLevel : " + GlobalPassiveLevel);
for (SlotToken token : Slots)
{
token.printInfo();
}
}
public void setSkill(ISkill skill, int level)
{
switch (skill.GetSkillType())
{
case Axe:
AxeSkill = skill.GetName();
AxeLevel = level;
break;
case Bow:
BowSkill = skill.GetName();
BowLevel = level;
break;
case Class:
break;
case GlobalPassive:
GlobalPassiveSkill = skill.GetName();
GlobalPassiveLevel = level;
break;
case PassiveA:
ClassPassiveASkill = skill.GetName();
ClassPassiveALevel = level;
break;
case PassiveB:
ClassPassiveBSkill = skill.GetName();
ClassPassiveBLevel = level;
break;
case Sword:
SwordSkill = skill.GetName();
SwordLevel = level;
break;
default:
break;
}
}
public boolean hasSkill(ISkill skill)
{
return SwordSkill.equalsIgnoreCase(skill.GetName())
|| AxeSkill.equalsIgnoreCase(skill.GetName())
|| BowSkill.equalsIgnoreCase(skill.GetName())
|| ClassPassiveASkill.equalsIgnoreCase(skill.GetName())
|| ClassPassiveBSkill.equalsIgnoreCase(skill.GetName())
|| GlobalPassiveSkill.equalsIgnoreCase(skill.GetName());
}
public int getLevel(ISkill skill)
{
switch (skill.GetSkillType())
{
case Axe:
return AxeLevel;
case Bow:
return BowLevel;
case GlobalPassive:
return GlobalPassiveLevel;
case PassiveA:
return ClassPassiveALevel;
case PassiveB:
return ClassPassiveBLevel;
case Sword:
return SwordLevel;
default:
return 0;
}
}
}

View File

@ -64,7 +64,7 @@ public class Assassin extends Skill
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
event.SetKnockback(false);
@ -83,7 +83,7 @@ public class Assassin extends Skill
Player player = event.GetDamageePlayer();
if (player == null) return;
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
event.AddMod(null, GetName(), -1, false);

View File

@ -47,7 +47,7 @@ public class BackStab extends Skill
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
LivingEntity damagee = event.GetDamageeEntity();

View File

@ -116,7 +116,7 @@ public class Evade extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
if (!mineplex.core.recharge.Recharge.Instance.use(damagee, GetName(), 500, false))

View File

@ -93,7 +93,7 @@ public class MarkedForDeath extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You used " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
}
@ -121,7 +121,7 @@ public class MarkedForDeath extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Effect

View File

@ -62,7 +62,7 @@ public class Recall extends Skill
{
Player player = event.getPlayer();
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))

View File

@ -49,7 +49,7 @@ public class RepeatedStrikes extends Skill
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
if (!_repeat.containsKey(damager))

View File

@ -41,7 +41,7 @@ public class ShockingStrikes extends Skill
if (!UtilGear.isWeapon(damager.getItemInHand()))
return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
LivingEntity damagee = event.GetDamageeEntity();

View File

@ -91,7 +91,7 @@ public class SilencingArrow extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
}
@ -118,7 +118,7 @@ public class SilencingArrow extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Confuse

View File

@ -52,7 +52,7 @@ public class SmokeBomb extends Skill
{
Player player = event.getPlayer();
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
@ -92,7 +92,7 @@ public class SmokeBomb extends Skill
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
if (GetLevel(damagee) == 0)
if (getLevel(damagee) == 0)
return;
//End
@ -108,7 +108,7 @@ public class SmokeBomb extends Skill
Player damager = event.GetDamagerPlayer(true);
if (damager == null) return;
if (GetLevel(damager) == 0)
if (getLevel(damager) == 0)
return;
//End
@ -118,7 +118,7 @@ public class SmokeBomb extends Skill
@EventHandler
public void EndInteract(PlayerInteractEvent event)
{
if (GetLevel(event.getPlayer()) == 0)
if (getLevel(event.getPlayer()) == 0)
return;
Factory.Condition().EndCondition(event.getPlayer(), null, GetName());

View File

@ -58,7 +58,7 @@ public class Stealth extends Skill
{
Player player = event.getPlayer();
if (GetLevel(player) == 0)
if (getLevel(player) == 0)
return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
@ -129,7 +129,7 @@ public class Stealth extends Skill
for (Player cur : GetUsers())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
//Proximity Decloak
@ -199,7 +199,7 @@ public class Stealth extends Skill
continue;
//Level
if (GetLevel(cur) == 0)
if (getLevel(cur) == 0)
{
Remove(cur, null);
continue;

View File

@ -91,7 +91,7 @@ public class ToxicArrow extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
}
@ -118,7 +118,7 @@ public class ToxicArrow extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Confuse

View File

@ -51,7 +51,7 @@ public class WoundingStrikes extends Skill
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
if (!UtilGear.isAxe(damager.getItemInHand()))

View File

@ -78,7 +78,7 @@ public class BlockToss extends mineplex.minecraft.game.classcombat.Skill.Skill i
return;
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
Block grab = event.getClickedBlock();

View File

@ -53,7 +53,7 @@ public class Bloodlust extends Skill
continue;
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
//Offset
@ -102,7 +102,7 @@ public class Bloodlust extends Skill
if (System.currentTimeMillis() > _time.get(player))
{
int str = _str.remove(player);
UtilPlayer.message(player, F.main(GetClassType().name(), "Your " + F.skill(GetName(GetLevel(player))) +
UtilPlayer.message(player, F.main(GetClassType().name(), "Your " + F.skill(GetName(getLevel(player))) +
" has ended at " + F.elem("Level " + (str+1)) + "."));
_time.remove(player);

View File

@ -34,7 +34,7 @@ public class Brute extends Skill
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
//Damage
@ -45,7 +45,7 @@ public class Brute extends Skill
@EventHandler
public void BowShoot(EntityShootBowEvent event)
{
if (GetLevel(event.getEntity()) == 0)
if (getLevel(event.getEntity()) == 0)
return;
event.getProjectile().setVelocity(event.getProjectile().getVelocity().multiply(0.75));

View File

@ -31,7 +31,7 @@ public class Colossus extends Skill
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
//Damage

View File

@ -49,7 +49,7 @@ public class CripplingBlow extends Skill
return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Stun

View File

@ -100,7 +100,7 @@ public class DwarfToss extends SkillActive
public boolean CanUse(Player player)
{
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return false;
//Check Material
@ -147,7 +147,7 @@ public class DwarfToss extends SkillActive
Player player = event.getPlayer();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Set Used
@ -318,7 +318,7 @@ public class DwarfToss extends SkillActive
LivingEntity target = _holding.remove(cur);
_charge.remove(cur);
_charged.remove(cur);
int level = GetLevel(cur);
int level = getLevel(cur);
UtilPlayer.message(cur, F.main(GetClassType().name(), F.name(UtilEnt.getName(target)) + " escaped your " + F.skill(GetName(level)) + "."));
}
@ -327,7 +327,7 @@ public class DwarfToss extends SkillActive
{
LivingEntity target = _holding.remove(cur);
long charge = _charge.remove(cur);
int level = GetLevel(cur);
int level = getLevel(cur);
_charged.remove(cur);
//Throw

View File

@ -98,7 +98,7 @@ public class FleshHook extends SkillActive implements IThrown
continue;
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) return;
//Add Charge
@ -171,7 +171,7 @@ public class FleshHook extends SkillActive implements IThrown
Player player = (Player)data.GetThrower();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
if (target == null)

View File

@ -35,14 +35,14 @@ public class Intimidation extends Skill
for (Player cur : GetUsers())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
HashMap<Player, Double> targets = UtilPlayer.getInRadius(cur.getLocation(), 2d * level);
for (Player other : targets.keySet())
if (!other.equals(cur))
if (Factory.Relation().CanHurt(cur, other))
if (GetLevel(other) < level)
if (getLevel(other) < level)
{
double dist = targets.get(other);
int mult = 0;

View File

@ -48,7 +48,7 @@ public class Overwhelm extends Skill
return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
diff = Math.min(diff, 3);

View File

@ -109,7 +109,7 @@ public class Rampage extends SkillActive
for (Player cur : _rampageStart.keySet())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
remove.add(cur);

View File

@ -102,7 +102,7 @@ public class SeismicSlam extends SkillActive
if (!_live.containsKey(player))
continue;
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) continue;
if (!UtilTime.elapsed(_live.get(player), 1000))

View File

@ -55,7 +55,7 @@ public class Stampede extends Skill
for (Player cur : GetUsers())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
//Active - Check for Disable
@ -125,7 +125,7 @@ public class Stampede extends Skill
if (_sprintStr.get(damager) == 0)
return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
LivingEntity damagee = event.GetDamageeEntity();

View File

@ -99,7 +99,7 @@ public class Takedown extends SkillActive
if (!_live.containsKey(player))
continue;
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) continue;
if (!UtilTime.elapsed(_live.get(player), 1000))
@ -157,7 +157,7 @@ public class Takedown extends SkillActive
public void DoTakeDown(Player damager, LivingEntity damagee)
{
int level = GetLevel(damager);
int level = getLevel(damager);
int damage = 10;
//Damage Event

View File

@ -35,7 +35,7 @@ public class BreakFall extends Skill
Player player = event.GetDamageePlayer();
if (player == null) return;
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
event.AddMod(null, GetName(), -2, false);

View File

@ -34,7 +34,7 @@ public class Rations extends Skill
for (Player cur : UtilServer.getPlayers())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level > 0)
{

View File

@ -31,7 +31,7 @@ public class Recharge extends Skill
if (event.GetReason() != EnergyChangeReason.Recharge)
return;
if (GetLevel(event.GetPlayer()) <= 0)
if (getLevel(event.GetPlayer()) <= 0)
return;
long duration = System.currentTimeMillis() - Factory.Energy().Get(event.GetPlayer()).LastEnergy;

View File

@ -42,7 +42,7 @@ public class Swim extends Skill
return;
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0)
return;

View File

@ -1,8 +1,8 @@
package mineplex.minecraft.game.classcombat.Skill;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
@ -21,17 +21,18 @@ public interface ISkill
}
String GetName();
int getLevel(Entity ent);
ClassType GetClassType();
SkillType GetSkillType();
int GetCost();
boolean IsFree();
ArrayList<String> GetDesc(int curLevel);
String[] GetDesc();
void Reset(Player player);
List<Player> GetUsers();
void AddUser(Player player);
Set<Player> GetUsers();
void AddUser(Player player, int level);
void RemoveUser(Player player);
Integer GetSalesPackageId();
int getMaxLevel();
}

View File

@ -90,7 +90,7 @@ public class BullsCharge extends SkillActive
return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Condition

View File

@ -47,7 +47,7 @@ public class Cleave extends Skill
if (!UtilGear.isAxe(damager.getItemInHand()))
return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Damagee

View File

@ -92,7 +92,7 @@ public class DefensiveStance extends SkillActive
if (!damagee.isBlocking())
return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
LivingEntity damager = event.GetDamagerEntity(true);

View File

@ -49,7 +49,7 @@ public class Fortitude extends Skill
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
_health.put(damagee, Math.min(5, damage));
@ -66,7 +66,7 @@ public class Fortitude extends Skill
for (Player cur : _health.keySet())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
if (UtilTime.elapsed(_last.get(cur), 1500))

View File

@ -77,7 +77,7 @@ public class HiltSmash extends SkillActive
public boolean CanUse(Player player)
{
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0)
return false;
@ -108,7 +108,7 @@ public class HiltSmash extends SkillActive
Player player = event.getPlayer();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
if (!CanUse(player))
@ -149,7 +149,7 @@ public class HiltSmash extends SkillActive
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
LivingEntity damagee = event.GetDamageeEntity();

View File

@ -77,7 +77,7 @@ public class HoldPosition extends SkillActive
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
Condition data = Factory.Condition().GetActiveCondition(damagee, ConditionType.DAMAGE_RESISTANCE);

View File

@ -23,7 +23,7 @@ public class Knight extends Skill
@EventHandler
public void BowShoot(EntityShootBowEvent event)
{
if (GetLevel(event.getEntity()) == 0)
if (getLevel(event.getEntity()) == 0)
return;
event.getProjectile().setVelocity(event.getProjectile().getVelocity().multiply(0.75));

View File

@ -49,7 +49,7 @@ public class LevelField extends Skill
if (damager == null) return;
//Level
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
int alt = 0;
@ -93,7 +93,7 @@ public class LevelField extends Skill
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
int alt = 0;

View File

@ -95,7 +95,7 @@ public class Riposte extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
//Prepare
@ -134,7 +134,7 @@ public class Riposte extends SkillActive
return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Counter

View File

@ -43,7 +43,7 @@ public class Vengeance extends Skill
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
//Damager
@ -75,7 +75,7 @@ public class Vengeance extends Skill
Player damager = event.GetDamagerPlayer(false);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
if (!_vengeance.containsKey(damager))

View File

@ -56,7 +56,7 @@ public class ArcticArmor extends Skill
{
Player player = event.getPlayer();
if (GetLevel(player) == 0)
if (getLevel(player) == 0)
return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
@ -118,7 +118,7 @@ public class ArcticArmor extends Skill
continue;
//Level
if (GetLevel(cur) == 0)
if (getLevel(cur) == 0)
{
Remove(cur);
continue;
@ -192,7 +192,7 @@ public class ArcticArmor extends Skill
if (block.getData() == 0)
continue;
if (GetLevel(cur) > 0)
if (getLevel(cur) > 0)
continue;
int level = 0;

View File

@ -100,7 +100,7 @@ public class Blizzard extends SkillActive
}
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
_active.remove(cur);

View File

@ -96,7 +96,7 @@ public class FireBlast extends SkillActive
Player player = (Player)proj.getShooter();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Velocity Players

View File

@ -114,7 +114,7 @@ public class FreezingBlast extends SkillActive implements IThrown
Player player = (Player)data.GetThrower();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Snow Spread

View File

@ -56,7 +56,7 @@ public class Immolate extends Skill
{
Player player = event.getPlayer();
if (GetLevel(player) == 0)
if (getLevel(player) == 0)
return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
@ -110,7 +110,7 @@ public class Immolate extends Skill
continue;
//Level
if (GetLevel(cur) == 0)
if (getLevel(cur) == 0)
{
Remove(cur);
continue;

View File

@ -88,7 +88,7 @@ public class Inferno extends SkillActive
}
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
_active.remove(cur);

View File

@ -59,7 +59,7 @@ public class LifeBonds extends Skill
{
Player player = event.getPlayer();
if (GetLevel(player) == 0)
if (getLevel(player) == 0)
return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
@ -110,7 +110,7 @@ public class LifeBonds extends Skill
continue;
//Level
if (GetLevel(cur) == 0)
if (getLevel(cur) == 0)
{
Remove(cur);
continue;

View File

@ -112,7 +112,7 @@ public class LightningOrb extends SkillActive implements IThrown
Player player = (Player)data.GetThrower();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Others

View File

@ -23,7 +23,7 @@ public class Mage extends Skill
@EventHandler
public void BowShoot(EntityShootBowEvent event)
{
if (GetLevel(event.getEntity()) == 0)
if (getLevel(event.getEntity()) == 0)
return;
event.getProjectile().setVelocity(event.getProjectile().getVelocity().multiply(0.75));

View File

@ -49,7 +49,7 @@ public class MagmaBlade extends Skill
if (!UtilGear.isSword(damager.getItemInHand()))
return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Damage

View File

@ -82,7 +82,7 @@ public class Magnetize extends SkillActive
}
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
_active.remove(cur);

View File

@ -41,7 +41,7 @@ public class NullBlade extends Skill
if (!UtilGear.isSword(damager.getItemInHand()))
return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Damagee

View File

@ -52,7 +52,7 @@ public class RootingAxe extends Skill
if (!UtilGear.isAxe(damager.getItemInHand()))
return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Damagee

View File

@ -140,7 +140,7 @@ public class Rupture extends SkillActive
continue;
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) return;
//Add Charge
@ -274,7 +274,7 @@ public class Rupture extends SkillActive
double range = 2 + 2 * (power/5d);
double mult = 0.5 + 0.5 * (power/maxPower);
int level = GetLevel(player);
int level = getLevel(player);
//Fling
HashMap<LivingEntity, Double> targets = UtilEnt.getInRadius(loc, range);

View File

@ -55,7 +55,7 @@ public class Void extends Skill
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
return;
if (GetLevel(player) == 0)
if (getLevel(player) == 0)
return;
event.setCancelled(true);
@ -152,7 +152,7 @@ public class Void extends Skill
if (!_active.contains(damagee))
return;
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
double dmgToEnergy = 8;

View File

@ -112,7 +112,7 @@ public class Agility extends SkillActive
//Inform
UtilPlayer.message(event.GetDamagerPlayer(true), F.main(GetClassType().name(),
F.name(damagee.getName()) + " is using " + F.skill(GetName(GetLevel(damagee))) + "."));
F.name(damagee.getName()) + " is using " + F.skill(GetName(getLevel(damagee))) + "."));
//Effect
damagee.getWorld().playSound(damagee.getLocation(), Sound.BLAZE_BREATH, 0.5f, 2f);

View File

@ -48,7 +48,7 @@ public class BarbedArrows extends Skill
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
Player damageePlayer = event.GetDamageePlayer();

View File

@ -79,7 +79,7 @@ public class Barrage extends Skill
}
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Start Charge
@ -103,7 +103,7 @@ public class Barrage extends Skill
if (_firing.contains(cur))
continue;
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
//Max Charge

View File

@ -93,7 +93,7 @@ public class Disengage extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damagee);
int level = getLevel(damagee);
if (level == 0) return;
//Cancel

View File

@ -59,7 +59,7 @@ public class Fletcher extends Skill
Player player = (Player)event.getEntity();
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
for (int i=0 ; i<=8 ; i++)
@ -166,7 +166,7 @@ public class Fletcher extends Skill
@EventHandler
public void InvDisable(InventoryOpenEvent event)
{
if (GetLevel(event.getPlayer()) > 0)
if (getLevel(event.getPlayer()) > 0)
_fletchDisable.add(event.getPlayer());
}

View File

@ -98,7 +98,7 @@ public class HealingShot extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
}
@ -137,7 +137,7 @@ public class HealingShot extends SkillActive
Player damager = (Player)projectile.getShooter();
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Remove

View File

@ -36,7 +36,7 @@ public class HeavyArrows extends Skill
Player player = (Player)event.getEntity();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Backboost

View File

@ -92,7 +92,7 @@ public class IncendiaryShot extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
event.getProjectile().setFireTicks(200);
@ -120,7 +120,7 @@ public class IncendiaryShot extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Ignite

View File

@ -52,7 +52,7 @@ public class Longshot extends Skill
if (!(event.getEntity() instanceof Player))
return;
int level = GetLevel((Player)event.getEntity());
int level = getLevel((Player)event.getEntity());
if (level == 0) return;
//Save
@ -108,7 +108,7 @@ public class Longshot extends Skill
{
Player player = event.getPlayer();
if (GetLevel(player) == 0)
if (getLevel(player) == 0)
return;
if (UtilGear.isWeapon(player.getItemInHand()))
@ -149,8 +149,8 @@ public class Longshot extends Skill
continue;
}
if (GetLevel(cur) > 0)
Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1 + (GetLevel(cur)), false, true, false, true);
if (getLevel(cur) > 0)
Factory.Condition().Factory().Slow(GetName(), cur, cur, 1.9, 1 + (getLevel(cur)), false, true, false, true);
}
}

View File

@ -92,7 +92,7 @@ public class NapalmShot extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
event.getProjectile().setFireTicks(120);
@ -113,7 +113,7 @@ public class NapalmShot extends SkillActive
return;
Player damager = (Player)proj.getShooter();
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
proj.getWorld().playSound(proj.getLocation(), Sound.EXPLODE, 0.4f, 2f);

View File

@ -72,7 +72,7 @@ public class Overcharge extends Skill
}
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
//Start Charge
@ -177,7 +177,7 @@ public class Overcharge extends Skill
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
int damage = _arrows.remove(projectile) * 2;

View File

@ -113,7 +113,7 @@ public class PinDown extends SkillActive
if (damager == null) return;
//Level
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
//Cripple

View File

@ -86,7 +86,7 @@ public class RopedArrow extends SkillActive
return;
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(GetLevel(player))) + "."));
UtilPlayer.message(player, F.main(GetClassType().name(), "You fired " + F.skill(GetName(getLevel(player))) + "."));
_arrows.add(event.getProjectile());
}
@ -106,7 +106,7 @@ public class RopedArrow extends SkillActive
return;
//Level
int level = GetLevel(((Player)proj.getShooter()));
int level = getLevel(((Player)proj.getShooter()));
if (level == 0) return;
Vector vec = UtilAlg.getTrajectory(proj.getShooter(), proj);

View File

@ -54,7 +54,7 @@ public class Shadowmeld extends Skill
for (Player cur : GetUsers())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
//Proximity Decloak

View File

@ -46,7 +46,7 @@ public class Sharpshooter extends Skill
if (!(event.getEntity() instanceof Player))
return;
int level = GetLevel((Player)event.getEntity());
int level = getLevel((Player)event.getEntity());
if (level == 0) return;
//Store

View File

@ -35,7 +35,7 @@ public class VitalitySpores extends Skill
for (Player cur : GetUsers())
{
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
if (UtilTime.elapsed(Factory.Combat().Get(cur).LastDamaged, 10000))

View File

@ -126,7 +126,7 @@ public class WolfsFury extends SkillActive
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
if (!_swing.remove(damager))

View File

@ -62,7 +62,7 @@ public class WolfsPounce extends mineplex.minecraft.game.classcombat.Skill.Skill
for (Player cur : UtilServer.getPlayers())
{
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0) continue;
if (cur.isBlocking())
@ -153,7 +153,7 @@ public class WolfsPounce extends mineplex.minecraft.game.classcombat.Skill.Skill
LivingEntity damagee = event.GetDamageeEntity();
if (damagee == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
if (!_pounceTime.containsKey(damager)|| UtilTime.elapsed(_pounceTime.get(damager), 250))

View File

@ -142,7 +142,7 @@ public class Flap extends SkillActive
}
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
_active.remove(cur);

View File

@ -41,7 +41,7 @@ public abstract class FormBase extends Skill
{
Player player = event.getPlayer();
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
if (!UtilGear.isWeapon(event.getItemDrop().getItemStack()))
@ -80,11 +80,11 @@ public abstract class FormBase extends Skill
ClientClass cc = Factory.ClassManager().Get(player);
for (ISkill skill : GetFormSkills())
cc.AddSkill(skill, GetLevel(player));
cc.AddSkill(skill, getLevel(player));
//Inform
UtilPlayer.message(player, F.main(GetClassType().name(), "You shapeshifted into " + F.skill(GetName() + " " + GetLevel(player))));
UtilPlayer.message(player, F.main(GetClassType().name(), "You shapeshifted into " + F.skill(GetName() + " " + getLevel(player))));
}
public void Unmorph(Player player)

View File

@ -88,7 +88,7 @@ public class MagneticPull extends SkillActive
}
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
_active.remove(cur);
@ -120,7 +120,7 @@ public class MagneticPull extends SkillActive
if (player.equals(other))
continue;
if (UtilMath.offset(player, other) < 2 || UtilMath.offset(loc, other.getLocation()) > 2 + ((GetLevel(player) * 0.5)))
if (UtilMath.offset(player, other) < 2 || UtilMath.offset(loc, other.getLocation()) > 2 + ((getLevel(player) * 0.5)))
continue;
if (other instanceof Player)

View File

@ -79,7 +79,7 @@ public class Needler extends SkillActive
continue;
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
continue;
//Water
@ -165,15 +165,15 @@ public class Needler extends SkillActive
{
//Dont recharge while firing
if (_fired.containsKey(cur))
if (!UtilTime.elapsed(_fired.get(cur), 1000 - (GetLevel(cur) * 50)))
if (!UtilTime.elapsed(_fired.get(cur), 1000 - (getLevel(cur) * 50)))
continue;
int charges = _stored.get(cur);
if (charges >= 3 + (1 * GetLevel(cur)))
if (charges >= 3 + (1 * getLevel(cur)))
continue;
if (!Recharge.Instance.use(cur, GetName() + " Recharge", 100 - (GetLevel(cur) * 10), false))
if (!Recharge.Instance.use(cur, GetName() + " Recharge", 100 - (getLevel(cur) * 10), false))
continue;
charges += 1;

View File

@ -52,7 +52,7 @@ public class Pounce extends SkillActive
Player damager = event.GetDamagerPlayer(true);
if (damager == null) return;
int level = GetLevel(damager);
int level = getLevel(damager);
if (level == 0) return;
event.SetCancelled(GetName());

View File

@ -54,7 +54,7 @@ public class SpinWeb extends SkillActive
return;
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level <= 0) return;
if (!CustomCheck(player, level))

View File

@ -52,7 +52,7 @@ public class Construction extends SkillActive
return;
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level <= 0) return;
if (!CustomCheck(player, level))

View File

@ -85,7 +85,7 @@ public class Propel extends SkillActive
}
//Level
int level = GetLevel(cur);
int level = getLevel(cur);
if (level == 0)
{
_active.remove(cur);

View File

@ -74,7 +74,7 @@ public class Polysmash extends SkillActive
public boolean CanUse(Player player)
{
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0)
return false;
@ -102,7 +102,7 @@ public class Polysmash extends SkillActive
Player player = event.getPlayer();
//Level
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0) return;
if (!CanUse(player))

View File

@ -1,9 +1,9 @@
package mineplex.minecraft.game.classcombat.Skill;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import mineplex.core.common.util.C;
import mineplex.core.common.util.NautHashMap;
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
import mineplex.minecraft.game.classcombat.Skill.repository.token.SkillToken;
@ -19,26 +19,29 @@ public abstract class Skill implements ISkill, Listener
//Properties
private String _name;
private String[] _desc;
private String[] _descFull;
private ClassType _classType;
private SkillType _skillType;
private int _salesPackageId;
private int _cost;
private int _cost = 1000;
private int _maxLevel = 1;
private boolean _free;
private List<Player> _users;
private NautHashMap<Player, Integer> _users;
public SkillFactory Factory;
public Skill(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int levels)
public Skill(SkillFactory skills, String name, ClassType classType, SkillType skillType, int cost, int maxLevel)
{
Factory = skills;
_name = name;
_desc = new String[] { "<Skill Description>" };
_classType = classType;
_skillType = skillType;
_users = new ArrayList<Player>();
_users = new NautHashMap<Player, Integer>();
_maxLevel = maxLevel;
}
@Override
@ -84,81 +87,56 @@ public abstract class Skill implements ISkill, Listener
return _cost;
}
public int GetLevel(Entity ent)
@Override
public int getMaxLevel()
{
return _maxLevel;
}
public int getLevel(Entity ent)
{
if (!(ent instanceof Player))
return 0;
Player player = (Player)ent;
if (!_users.contains(player))
if (!_users.containsKey(player))
return 0;
return 1;
}
@Override
public ArrayList<String> GetDesc(int curLevel)
public String[] GetDesc()
{
ArrayList<String> descOut = new ArrayList<String>();
if (_descFull != null)
return _descFull;
String recharge = GetRechargeString();
String energy = GetEnergyString();
if (recharge == null && energy == null)
_descFull = _desc;
ArrayList<String> descFull = new ArrayList<String>();
//Parse Desc
for (String line : _desc)
{
String newLine = "";
//Check for Level Tokens
for (String token : line.split(" "))
{
if (token.length() <= 0)
continue;
//Parse Level Token
if (token.charAt(0) == '#')
{
String[] numberToks = token.split("#");
try
{
double base = Double.parseDouble(numberToks[0]);
double bonus = Double.parseDouble(numberToks[1]);
double levelValue = base + ((double)curLevel * bonus);
char plusMinus = '+';
if (bonus < 0)
plusMinus = '-';
descFull.add(line);
token = C.cYellow + levelValue + C.cGray + " (" + C.cGreen + plusMinus + bonus + C.cGray + ")";
}
catch (Exception e)
{
token = C.cRed + token + C.cGray;
break;
}
}
newLine += token + " ";
}
//Remove Space
if (newLine.length() > 0)
newLine = newLine.substring(0, newLine.length()-1);
descOut.add(newLine);
}
//Append Energy & Recharge
if (GetEnergyString() != null || GetRechargeString() != null)
descOut.add("");
if (energy != null || recharge != null)
descFull.add("");
if (GetEnergyString() != null)
descOut.add(GetEnergyString());
if (energy != null)
descFull.add(energy);
if (GetRechargeString() != null)
descOut.add(GetRechargeString());
if (recharge != null)
descFull.add(recharge);
return descOut;
_descFull = new String[descFull.size()];
for (int i=0 ; i<descFull.size() ; i++)
_descFull[i] = descFull.get(i);
return _descFull;
}
public String GetEnergyString()
@ -172,16 +150,15 @@ public abstract class Skill implements ISkill, Listener
}
@Override
public List<Player> GetUsers()
public Set<Player> GetUsers()
{
_users.remove(null);
return _users;
return _users.keySet();
}
@Override
public void AddUser(Player player)
public void AddUser(Player player, int level)
{
_users.add(player);
_users.put(player, level);
OnPlayerAdd(player);
}

View File

@ -72,7 +72,7 @@ public abstract class SkillActive extends Skill implements Listener
public boolean SkillCheck(Player player, Action action, Block block)
{
int level = GetLevel(player);
int level = getLevel(player);
if (level == 0)
return false;

View File

@ -206,7 +206,7 @@ public class SkillFactory extends MiniPlugin implements ISkillFactory
skillToken.Name = skill.GetName();
skillToken.Level = i + 1;
skillToken.SalesPackage = new GameSalesPackageToken();
skillToken.SalesPackage.Gems = 1200;
skillToken.SalesPackage.Gems = 1000;
skillTokens.add(skillToken);
}

View File

@ -1,23 +0,0 @@
package mineplex.minecraft.game.classcombat.shop;
import org.bukkit.entity.Player;
import mineplex.core.account.CoreClientManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.ShopBase;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.minecraft.game.classcombat.shop.page.ArmorPage;
public class ClassCombatCustomBuildShop extends ClassCombatShop
{
public ClassCombatCustomBuildShop(ClassShopManager plugin, CoreClientManager clientManager, DonationManager donationManager, String name)
{
super(plugin, clientManager, donationManager, name);
}
@Override
protected ShopPageBase<ClassShopManager, ? extends ShopBase<ClassShopManager>> BuildPagesFor(Player player)
{
return new ArmorPage(Plugin, this, ClientManager, DonationManager, player, true);
}
}

View File

@ -7,12 +7,12 @@ import org.bukkit.inventory.ItemStack;
import mineplex.core.account.CoreClientManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.ShopBase;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.NautHashMap;
import mineplex.minecraft.game.classcombat.Class.ClientClass;
import mineplex.minecraft.game.classcombat.shop.page.CustomBuildPage;
public abstract class ClassCombatShop extends ShopBase<ClassShopManager>
public class ClassCombatShop extends ShopBase<ClassShopManager>
{
public ClassCombatShop(ClassShopManager plugin, CoreClientManager clientManager, DonationManager donationManager, String name)
{
@ -64,4 +64,10 @@ public abstract class ClassCombatShop extends ShopBase<ClassShopManager>
clientClass.SaveActiveCustomBuild();
}
}
@Override
protected ShopPageBase<ClassShopManager, ? extends ShopBase<ClassShopManager>> BuildPagesFor(Player player)
{
return new CustomBuildPage(Plugin, this, ClientManager, DonationManager, player);
}
}

View File

@ -1,25 +0,0 @@
package mineplex.minecraft.game.classcombat.shop.button;
import org.bukkit.entity.Player;
import mineplex.core.shop.item.IButton;
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
import mineplex.minecraft.game.classcombat.shop.page.ArmorPage;
public class SelectClassButton implements IButton
{
ArmorPage _page;
private IPvpClass _pvpClass;
public SelectClassButton(ArmorPage page, IPvpClass pvpClass)
{
_page = page;
_pvpClass = pvpClass;
}
@Override
public void Clicked(Player player)
{
_page.SelectClass(player, _pvpClass);
}
}

View File

@ -10,16 +10,19 @@ public class SelectSkillButton implements IButton
{
private SkillPage _page;
private ISkill _skill;
private int _level;
public SelectSkillButton(SkillPage page, ISkill skill)
public SelectSkillButton(SkillPage page, ISkill skill, int level)
{
_page = page;
_skill = skill;
_level = level;
}
@Override
public void Clicked(Player player)
{
_page.SelectSkill(player, _skill);
System.out.println("Selecting skill : " + _skill.GetName() + " lvl " + _level);
_page.SelectSkill(player, _skill, _level);
}
}

View File

@ -1,93 +0,0 @@
package mineplex.minecraft.game.classcombat.shop.page;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.Sound;
import mineplex.minecraft.game.classcombat.Class.ClientClass;
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
import mineplex.minecraft.game.classcombat.shop.button.SelectClassButton;
import mineplex.core.account.CoreClientManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.shop.item.ShopItem;
import mineplex.core.shop.page.ShopPageBase;
import mineplex.core.common.util.C;
public class ArmorPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
{
private boolean _purchasing;
public ArmorPage(ClassShopManager shopManager, ClassCombatShop shop, CoreClientManager clientManager, DonationManager donationManager, Player player, boolean purchasing)
{
super(shopManager, shop, clientManager, donationManager, " Armor", player);
_purchasing = purchasing;
BuildPage();
}
public void SelectClass(Player player, IPvpClass pvpClass)
{
player.playSound(player.getLocation(), Sound.ORB_PICKUP, 1f, .6f);
if (_purchasing)
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, pvpClass));
else
{
ClientClass clientClass = Plugin.GetClassManager().Get(player);
player.getInventory().clear();
clientClass.SetGameClass(pvpClass);
pvpClass.ApplyArmor(player);
clientClass.ClearDefaults();
Shop.OpenPageForPlayer(Player, new CustomBuildPage(Plugin, Shop, ClientManager, DonationManager, player));
}
}
@Override
protected void BuildPage()
{
int slot = 9;
for (IPvpClass gameClass : Plugin.GetClassManager().GetGameClasses())
{
BuildArmorSelectPackage(gameClass, slot);
slot += 2;
}
}
private void BuildArmorSelectPackage(IPvpClass gameClass, int slot)
{
List<String> lockedClassDesc = new ArrayList<String>();
List<String> unlockedClassDesc = new ArrayList<String>();
lockedClassDesc.add(C.cBlack);
unlockedClassDesc.add(C.cBlack);
lockedClassDesc.addAll(Arrays.asList(gameClass.GetDesc()));
unlockedClassDesc.addAll(Arrays.asList(gameClass.GetDesc()));
for (int i = 1; i < lockedClassDesc.size(); i++)
{
lockedClassDesc.set(i, C.cGray + lockedClassDesc.get(i));
}
for (int i = 1; i < unlockedClassDesc.size(); i++)
{
unlockedClassDesc.set(i, C.cGray + unlockedClassDesc.get(i));
}
AddButton(slot, new ShopItem(gameClass.GetHead(), gameClass.GetName(), 1, false), new SelectClassButton(this, gameClass));
AddButton(slot + 9, new ShopItem(gameClass.GetChestplate(), gameClass.GetName(), 1, false), new SelectClassButton(this, gameClass));
AddButton(slot + 18, new ShopItem(gameClass.GetLeggings(), gameClass.GetName(), 1, false), new SelectClassButton(this, gameClass));
AddButton(slot + 27, new ShopItem(gameClass.GetBoots(), gameClass.GetName(), 1, false), new SelectClassButton(this, gameClass));
}
}

View File

@ -13,7 +13,6 @@ import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
import mineplex.minecraft.game.classcombat.shop.button.DeleteCustomBuildButton;
import mineplex.minecraft.game.classcombat.shop.button.EditAndSaveCustomBuildButton;
import mineplex.minecraft.game.classcombat.shop.button.SelectCustomBuildButton;
import mineplex.core.account.CoreClientManager;
import mineplex.core.common.Rank;
import mineplex.core.donation.DonationManager;
@ -104,7 +103,7 @@ public class CustomBuildPage extends ShopPageBase<ClassShopManager, ClassCombatS
customBuild = new CustomBuildToken();
customBuild.CustomBuildNumber = i;
customBuild.Name = "Build " + (i + 1);
customBuild.PvpClassId = _pvpClass.GetSalesPackageId();
customBuild.PvpClass = _pvpClass.GetName();
}
if (i != 0)
@ -137,6 +136,9 @@ public class CustomBuildPage extends ShopPageBase<ClassShopManager, ClassCombatS
clientClass.EquipCustomBuild(customBuild, false);
clientClass.SetSavingCustomBuild(_pvpClass, customBuild);
System.out.println("Custom build editing: ");
customBuild.printInfo();
Shop.OpenPageForPlayer(Player, new SkillPage(Plugin, Shop, ClientManager, DonationManager, Player, _pvpClass));
}

View File

@ -57,12 +57,14 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
ButtonMap.clear();
clear();
BuildClassSkills(_pvpClass);
BuildGlobalSkills();
ClientClass clientClass = Plugin.GetClassManager().Get(Player);
BuildClassSkills(_pvpClass, clientClass);
BuildGlobalSkills(clientClass);
//BuildItemPacks();
}
private void BuildClassSkills(IPvpClass gameClass)
private void BuildClassSkills(IPvpClass gameClass, ClientClass clientClass)
{
getInventory().setItem(0, new ShopItem(Material.IRON_SWORD, "Sword Skills", null, 1, true, true).getHandle());
getInventory().setItem(9, new ShopItem(Material.IRON_AXE, "Axe Skills", null, 1, true, true).getHandle());
@ -107,11 +109,11 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
continue;
}
BuildSkillItem(skill, slotNumber);
BuildSkillItem(skill, slotNumber, clientClass);
}
}
private void BuildGlobalSkills()
private void BuildGlobalSkills(ClientClass clientClass)
{
getInventory().setItem(45, new ShopItem(Material.INK_SACK, (byte)11, "Global Passive Skills", null, 1, true, true).getHandle());
@ -119,11 +121,11 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
for (ISkill skill : Plugin.GetSkillFactory().GetGlobalSkills())
{
BuildSkillItem(skill, slotNumber++);
BuildSkillItem(skill, slotNumber++, clientClass);
}
}
protected void BuildSkillItem(ISkill skill, int slotNumber)
protected void BuildSkillItem(ISkill skill, int slotNumber, ClientClass clientClass)
{
List<String> skillLore = new ArrayList<String>();
@ -142,12 +144,16 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
skillLore.set(i, C.cGray + skillLore.get(i));
}
ShopItem skillItem = new ShopItem(locked ? Material.BOOK_AND_QUILL : (skill.GetUsers().contains(Player) ? Material.WRITTEN_BOOK : Material.BOOK), (locked ? ChatColor.RED + skill.GetName() + " (Locked)" : skill.GetName()), skillLore.toArray(new String[skillLore.size()]), 1, locked, true);
Material material = locked ? Material.EMERALD : (clientClass.GetSavingCustomBuild().hasSkill(skill) ? Material.WRITTEN_BOOK : Material.BOOK);
int level = clientClass.GetSavingCustomBuild().hasSkill(skill) ? clientClass.GetSavingCustomBuild().getLevel(skill) : 1;
String name = (locked ? ChatColor.RED + skill.GetName() + " (Locked)" : skill.GetName() + " Lvl " + level);
ShopItem skillItem = new ShopItem(material, name, skillLore.toArray(new String[skillLore.size()]), level, locked, true);
if (locked)
AddButton(slotNumber, skillItem, new PurchaseSkillButton(this, skill));
else
AddButton(slotNumber, skillItem, new SelectSkillButton(this, skill));
AddButton(slotNumber, skillItem, new SelectSkillButton(this, skill, Math.min(clientClass.GetSavingCustomBuild().getLevel(skill) + 1, skill.getMaxLevel())));
}
/*
@ -199,7 +205,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
}
}
*/
public void SelectSkill(Player player, ISkill skill)
public void SelectSkill(Player player, ISkill skill, int level)
{
ClientClass clientClass = Plugin.GetClassManager().Get(player);
ISkill existingSkill = clientClass.GetSkillByType(skill.GetSkillType());
@ -209,7 +215,7 @@ public class SkillPage extends ShopPageBase<ClassShopManager, ClassCombatShop>
clientClass.RemoveSkill(existingSkill);
}
clientClass.AddSkill(skill);
clientClass.AddSkill(skill, level);
PlayAcceptSound(player);

View File

@ -11,7 +11,6 @@ import java.io.InputStreamReader;
import mineplex.core.account.CoreClientManager;
import mineplex.core.antihack.AntiHack;
import mineplex.core.antistack.AntiStack;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.blood.Blood;
import mineplex.core.command.CommandCenter;
import mineplex.core.common.util.FileUtil;
@ -19,16 +18,13 @@ import mineplex.core.common.util.UtilServer;
import mineplex.core.creature.Creature;
import mineplex.core.disguise.DisguiseManager;
import mineplex.core.donation.DonationManager;
import mineplex.core.energy.Energy;
import mineplex.core.itemstack.ItemStackFactory;
import mineplex.core.memory.MemoryFix;
import mineplex.core.message.MessageManager;
import mineplex.core.monitor.LagMeter;
import mineplex.core.npc.NpcManager;
import mineplex.core.packethandler.PacketHandler;
import mineplex.core.pet.PetManager;
import mineplex.core.portal.Portal;
import mineplex.core.projectile.ProjectileManager;
import mineplex.core.punish.Punish;
import mineplex.core.recharge.Recharge;
import mineplex.core.spawn.Spawn;
@ -39,11 +35,9 @@ import mineplex.core.updater.Updater;
import mineplex.minecraft.game.core.combat.CombatManager;
import mineplex.minecraft.game.core.condition.ConditionManager;
import mineplex.minecraft.game.core.damage.DamageManager;
import mineplex.minecraft.game.core.fire.Fire;
import nautilus.game.arcade.game.GameServerConfig;
import nautilus.minecraft.core.INautilusPlugin;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
@ -57,15 +51,6 @@ public class Arcade extends JavaPlugin implements INautilusPlugin
private CoreClientManager _clientManager;
private DonationManager _donationManager;
private DamageManager _damageManager;
private BlockRestore _blockRestore;
private Blood _blood;
private ConditionManager _condition;
private Creature _creature;
private Fire _fire;
private PetManager _petManager;
private Spawn _spawn;
private Teleport _teleport;
private ProjectileManager _throw;
private ArcadeManager _gameManager;

View File

@ -32,10 +32,9 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.server.ServerListPingEvent;
import mineplex.minecraft.game.classcombat.Class.ClassManager;
import mineplex.minecraft.game.classcombat.Class.IPvpClass;
import mineplex.minecraft.game.classcombat.Skill.SkillFactory;
import mineplex.minecraft.game.classcombat.itempack.ItemPackFactory;
import mineplex.minecraft.game.classcombat.shop.ClassCombatCustomBuildShop;
import mineplex.minecraft.game.classcombat.shop.ClassCombatShop;
import mineplex.minecraft.game.classcombat.shop.ClassShopManager;
import mineplex.minecraft.game.core.IRelation;
import mineplex.minecraft.game.core.combat.CombatManager;
@ -99,7 +98,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
private ClassManager _classManager;
private SkillFactory _skillFactory;
private ClassShopManager _classShopManager;
private ClassCombatCustomBuildShop _classCustomBuildShop;
private ClassCombatShop _classShop;
//Server Games
private GameServerConfig _serverConfig;
@ -149,7 +148,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_classManager = new ClassManager(plugin, clientManager, donationManager, _skillFactory, webAddress);
_classShopManager = new ClassShopManager(_plugin, _classManager, _skillFactory, new ItemPackFactory(_plugin));
_classCustomBuildShop = new ClassCombatCustomBuildShop(_classShopManager, clientManager, donationManager, webAddress);
_classShop = new ClassCombatShop(_classShopManager, clientManager, donationManager, webAddress);
}
//_statsManager = new StatsManager(plugin);
@ -548,14 +547,14 @@ public class ArcadeManager extends MiniPlugin implements IRelation
return _classManager;
}
public ClassCombatCustomBuildShop getClassShop()
public ClassCombatShop getClassShop()
{
return _classCustomBuildShop;
return _classShop;
}
public void openClassShop(Player player)
{
_classCustomBuildShop.attemptShopOpen(player);
_classShop.attemptShopOpen(player);
}
@EventHandler

Some files were not shown because too many files have changed in this diff Show More