diff --git a/scripts/commands/transferitemarmor.py b/scripts/commands/transferitemarmor.py index 2b890936..bfd8486d 100644 --- a/scripts/commands/transferitemarmor.py +++ b/scripts/commands/transferitemarmor.py @@ -5,7 +5,8 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: - return + return + parsedMsg = commandString.split(' ', 3) objService = core.objectService diff --git a/scripts/commands/transferitemmisc.py b/scripts/commands/transferitemmisc.py index 79ef9455..ee205206 100644 --- a/scripts/commands/transferitemmisc.py +++ b/scripts/commands/transferitemmisc.py @@ -7,6 +7,7 @@ def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: return + parsedMsg = commandString.split(' ', 3) objService = core.objectService containerID = long(parsedMsg[1]) diff --git a/scripts/commands/transferitemweapon.py b/scripts/commands/transferitemweapon.py index 9b403eaf..2640ac0c 100644 --- a/scripts/commands/transferitemweapon.py +++ b/scripts/commands/transferitemweapon.py @@ -6,6 +6,7 @@ def setup(): def run(core, actor, target, commandString): if core.equipmentService.canEquip(actor, target) is False: return + parsedMsg = commandString.split(' ', 3) objService = core.objectService diff --git a/src/services/EquipmentService.java b/src/services/EquipmentService.java index 5588e17f..7125fa32 100644 --- a/src/services/EquipmentService.java +++ b/src/services/EquipmentService.java @@ -28,6 +28,7 @@ import java.util.TreeMap; import org.python.core.Py; import org.python.core.PyObject; +import resources.datatables.FactionStatus; import resources.objects.creature.CreatureObject; import main.NGECore; import engine.resources.objects.SWGObject; @@ -113,13 +114,17 @@ public class EquipmentService implements INetworkDispatch { if (item.getStringAttribute("class_required") != null) { String profession = ((PlayerObject) actor.getSlottedObject("ghost")).getProfession(); - if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession))) { + if (item.getStringAttribute("class_required").contentEquals(getFormalProfessionName(profession))) result = true; - } else { + else return false; - } } - + + if (item.getStringAttribute("faction_restriction") != null) + if (item.getStringAttribute("faction_restriction").toLowerCase().contentEquals(actor.getFaction()) && actor.getFactionStatus() >= FactionStatus.Combatant) + result = true; + else + return false; if (item.getAttributes().toString().contains("required_combat_level")) if (actor.getLevel() >= item.getIntAttribute("required_combat_level"))