diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index bc8f5c88..bd8c7d1b 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -216,6 +216,7 @@ public class dbItemHandler extends dbHandlerBase { } } + public Item GET_ITEM(final int itemUUID) { Item item; diff --git a/src/engine/db/handlers/dbPlayerCharacterHandler.java b/src/engine/db/handlers/dbPlayerCharacterHandler.java index cfb672e8..b36fe1d2 100644 --- a/src/engine/db/handlers/dbPlayerCharacterHandler.java +++ b/src/engine/db/handlers/dbPlayerCharacterHandler.java @@ -11,7 +11,10 @@ package engine.db.handlers; import engine.Enum; import engine.gameManager.DbManager; -import engine.objects.*; +import engine.objects.AbstractWorldObject; +import engine.objects.Heraldry; +import engine.objects.PlayerCharacter; +import engine.objects.PlayerFriends; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 66bfac4d..844cdcda 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -139,7 +139,7 @@ public enum CombatManager { //calculate hit chance based off ATR and DEF int hitChance; - if(def == 0) + if (def == 0) def = 1; float dif = atr / def; @@ -152,7 +152,7 @@ public enum CombatManager { hitChance = 100; int passiveAnim = getSwingAnimation(null, null, slot.equals(Enum.EquipSlotType.RHELD)); - if(attacker.charItemManager.getEquipped().get(slot) != null){ + if (attacker.charItemManager.getEquipped().get(slot) != null) { passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true); } @@ -290,9 +290,9 @@ public enum CombatManager { else ((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage); - int attackAnim = getSwingAnimation(null,null,slot.equals(Enum.EquipSlotType.RHELD)); + int attackAnim = getSwingAnimation(null, null, slot.equals(Enum.EquipSlotType.RHELD)); if (attacker.charItemManager.getEquipped().get(slot) != null) { - attackAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template,null,slot.equals(Enum.EquipSlotType.RHELD)); + attackAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, slot.equals(Enum.EquipSlotType.RHELD)); } TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim); DispatchMessage.sendToAllInRange(target, cmm); diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index f96c2779..109cf919 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -351,9 +351,9 @@ public enum NPCManager { int strength = guard.getStatStrCurrent(); int baseAtr = guard.mobBase.getAttackRating(); if (guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD) != null) - guard.atrHandOne = baseAtr + (int) ((strength * 0.5f) + ((int)guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int)guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 3)); + guard.atrHandOne = baseAtr + (int) ((strength * 0.5f) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 3)); else if (guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD) != null && !ItemTemplate.isShield(guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template)) - guard.atrHandTwo = baseAtr + (int) ((strength * 0.5f) + ((int)guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int)guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 3)); + guard.atrHandTwo = baseAtr + (int) ((strength * 0.5f) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 3)); else guard.atrHandOne = baseAtr; } diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index c150ccdc..1401aded 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -115,7 +115,7 @@ public class MobAI { if (mob.isMoving() && mob.getRange() > 20) return; - CombatManager.combatCycle(mob,mob.combatTarget); + CombatManager.combatCycle(mob, mob.combatTarget); } if (target.getPet() != null) @@ -149,7 +149,7 @@ public class MobAI { MovementManager.sendRWSSMsg(mob); - CombatManager.combatCycle(mob, target); + CombatManager.combatCycle(mob, target); if (mob.isSiege()) { PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target); @@ -172,7 +172,7 @@ public class MobAI { //no weapons, default mob attack speed 3 seconds. - CombatManager.combatCycle(mob, target); + CombatManager.combatCycle(mob, target); } catch (Exception e) { Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage()); diff --git a/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java b/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java index 88603c77..5b82b08e 100644 --- a/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java +++ b/src/engine/net/client/handlers/ArcLoginNotifyMsgHandler.java @@ -12,7 +12,10 @@ import engine.net.client.msg.ArcLoginNotifyMsg; import engine.net.client.msg.ClientNetMsg; import engine.net.client.msg.HotzoneChangeMsg; import engine.net.client.msg.PetMsg; -import engine.objects.*; +import engine.objects.Account; +import engine.objects.Guild; +import engine.objects.PlayerCharacter; +import engine.objects.PlayerFriends; import engine.server.MBServerStatics; import engine.session.Session; import org.pmw.tinylog.Logger; diff --git a/src/engine/net/client/msg/WhoResponseMsg.java b/src/engine/net/client/msg/WhoResponseMsg.java index 6242c427..43609d50 100644 --- a/src/engine/net/client/msg/WhoResponseMsg.java +++ b/src/engine/net/client/msg/WhoResponseMsg.java @@ -14,7 +14,10 @@ import engine.gameManager.SessionManager; import engine.net.*; import engine.net.client.ClientConnection; import engine.net.client.Protocol; -import engine.objects.*; +import engine.objects.Guild; +import engine.objects.GuildStatusController; +import engine.objects.PlayerCharacter; +import engine.objects.PromotionClass; import engine.server.MBServerStatics; import org.pmw.tinylog.Logger; diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index c7a8a8f6..fb97a4b8 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -597,7 +597,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { } - public static void AssignDefenseValue(AbstractCharacter abstractCharacter){ + public static void AssignDefenseValue(AbstractCharacter abstractCharacter) { ConcurrentHashMap equipped = abstractCharacter.charItemManager.getEquipped(); if (abstractCharacter.effects != null && abstractCharacter.effects.containsKey("DeathShroud")) abstractCharacter.defenseRating = (short) 0; @@ -638,6 +638,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { abstractCharacter.defenseRating = (short) (defense + 0.5f); } } + /** * @param abstractCharacter * @ Calculates Atr (both hands) Defense, and Damage for pc @@ -655,12 +656,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject { ConcurrentHashMap equipped = abstractCharacter.charItemManager.getEquipped(); AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.RHELD), true, equipped.get(EquipSlotType.RHELD)); AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD)); - if(abstractCharacter.getObjectType().equals(GameObjectType.Mob)){ + if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) { Mob mob = (Mob) abstractCharacter; - abstractCharacter.minDamageHandOne += (int)mob.mobBase.getDamageMin(); - abstractCharacter.minDamageHandTwo += (int)mob.mobBase.getDamageMin(); - abstractCharacter.maxDamageHandOne += (int)mob.mobBase.getDamageMax(); - abstractCharacter.maxDamageHandTwo += (int)mob.mobBase.getDamageMax(); + abstractCharacter.minDamageHandOne += (int) mob.mobBase.getDamageMin(); + abstractCharacter.minDamageHandTwo += (int) mob.mobBase.getDamageMin(); + abstractCharacter.maxDamageHandOne += (int) mob.mobBase.getDamageMax(); + abstractCharacter.maxDamageHandTwo += (int) mob.mobBase.getDamageMax(); abstractCharacter.atrHandOne += mob.mobBase.getAttackRating(); abstractCharacter.atrHandTwo += mob.mobBase.getAttackRating(); abstractCharacter.defenseRating += mob.mobBase.getDefenseRating(); @@ -1025,12 +1026,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject { //through SkillCalcJob. Designed to only run from one worker thread public static void runSkillCalc(AbstractCharacter abstractCharacter) { - //see if any new skills or powers granted - CharacterSkill.calculateSkills(abstractCharacter); - // calculate granted Trains in powers. - CharacterPower.grantTrains(abstractCharacter); - //see if any new powers unlocked from previous check - CharacterPower.calculatePowers(abstractCharacter); + //see if any new skills or powers granted + CharacterSkill.calculateSkills(abstractCharacter); + // calculate granted Trains in powers. + CharacterPower.grantTrains(abstractCharacter); + //see if any new powers unlocked from previous check + CharacterPower.calculatePowers(abstractCharacter); } @@ -1147,6 +1148,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { public final short getUnusedStatPoints() { return this.unusedStatPoints; } + @Override public String getName() { if (this.firstName.length() == 0 && this.lastName.length() == 0) { diff --git a/src/engine/objects/CharacterSkill.java b/src/engine/objects/CharacterSkill.java index 13934134..89dbfc66 100644 --- a/src/engine/objects/CharacterSkill.java +++ b/src/engine/objects/CharacterSkill.java @@ -484,7 +484,7 @@ public class CharacterSkill extends AbstractGameObject { if (absChar == null && absChar.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) == false) return; - PlayerCharacter pc = (PlayerCharacter)absChar; + PlayerCharacter pc = (PlayerCharacter) absChar; ConcurrentHashMap skills = pc.getSkills(); diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index f3f21480..55ec3f5e 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -23,7 +23,6 @@ public class ItemTemplate { // Global template lookup public static HashMap templates = new HashMap<>(); - public int template_id; // Template Properties diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 9da64b4f..a5263292 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -1069,7 +1069,7 @@ public class NPC extends AbstractCharacter { for (Integer itemID : fullItemList) { itemTemplate = ItemTemplate.templates.get(itemID); - if(itemTemplate.item_skill_required.values().iterator().hasNext()) + if (itemTemplate.item_skill_required.values().iterator().hasNext()) skillRequired = itemTemplate.item_skill_required.values().iterator().next(); boolean exclude = skillRequired == 0 && ItemTemplate.templates.get(itemID).item_type.equals(ItemType.WEAPON);