diff --git a/src/protocol/swg/objectControllerObjects/CombatSpam.java b/src/protocol/swg/objectControllerObjects/CombatSpam.java index fbf836de..26d64b9a 100644 --- a/src/protocol/swg/objectControllerObjects/CombatSpam.java +++ b/src/protocol/swg/objectControllerObjects/CombatSpam.java @@ -26,7 +26,7 @@ import java.nio.ByteOrder; import org.apache.mina.core.buffer.IoBuffer; import protocol.swg.ObjControllerMessage; -import services.combat.CombatService.HitType; +import resources.datatables.HitType; public class CombatSpam extends ObjControllerObject{ diff --git a/src/resources/datatables/HitType.java b/src/resources/datatables/HitType.java new file mode 100644 index 00000000..a0736a2e --- /dev/null +++ b/src/resources/datatables/HitType.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ +package resources.datatables; + +public class HitType { + public static final byte MISS = 0; + public static final byte DODGE = 1; + public static final byte PARRY = 2; + public static final byte STRIKETHROUGH = 3; + public static final byte CRITICAL = 4; + public static final byte PUNISHING = 5; + public static final byte HIT = 6; + public static final byte BLOCK = 7; + public static final byte EVASION = 8; + public static final byte GLANCE = 9; +} diff --git a/src/resources/datatables/Posture.java b/src/resources/datatables/Posture.java index f319ea46..d64cba45 100644 --- a/src/resources/datatables/Posture.java +++ b/src/resources/datatables/Posture.java @@ -1,3 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2013 + * + * This File is part of NGECore2. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Using NGEngine to work with NGECore2 is making a combined work based on NGEngine. + * Therefore all terms and conditions of the GNU Lesser General Public License cover the combination. + ******************************************************************************/ package resources.datatables; public class Posture { diff --git a/src/services/combat/CombatService.java b/src/services/combat/CombatService.java index 8e85c53e..1a265c8c 100644 --- a/src/services/combat/CombatService.java +++ b/src/services/combat/CombatService.java @@ -65,6 +65,7 @@ import engine.resources.objects.SWGObject; import engine.resources.scene.Point3D; import engine.resources.service.INetworkDispatch; import engine.resources.service.INetworkRemoteEvent; +import resources.datatables.HitType; public class CombatService implements INetworkDispatch { @@ -750,6 +751,12 @@ public class CombatService implements INetworkDispatch { float glanceChance = (float) target.getSkillModBase("display_only_glancing_blow") / 10000; + if(weapon.isRanged()) + glanceChance += target.getSkillModBase("expertise_glancing_blow_ranged"); + + if(weapon.isMelee()) + glanceChance += target.getSkillModBase("expertise_glancing_blow_melee"); + r = random.nextFloat(); if(r <= glanceChance) return HitType.GLANCE; @@ -1359,33 +1366,5 @@ public class CombatService implements INetworkDispatch { defenderList.stream().forEach(attacker -> defender.removeDefender(attacker)); } } - - public enum HitType{; - - public static final byte MISS = 0; - public static final byte DODGE = 1; - public static final byte PARRY = 2; - public static final byte STRIKETHROUGH = 3; - public static final byte CRITICAL = 4; - public static final byte PUNISHING = 5; - public static final byte HIT = 6; - public static final byte BLOCK = 7; - public static final byte EVASION = 8; - public static final byte GLANCE = 9; - - } - - public enum ElementalType {; - - public static final int KINETIC = 1; - public static final int ENERGY = 2; - public static final int BLAST = 4; - public static final int STUN = 8; - public static final int HEAT = 32; - public static final int COLD = 64; - public static final int ACID = 128; - public static final int ELECTRICITY = 256; - - } }