diff --git a/src/resources/objects/creature/CreatureObject.java b/src/resources/objects/creature/CreatureObject.java index a7a173aaf..29f225b51 100644 --- a/src/resources/objects/creature/CreatureObject.java +++ b/src/resources/objects/creature/CreatureObject.java @@ -27,6 +27,8 @@ ***********************************************************************************/ package resources.objects.creature; +import java.util.List; + import network.packets.swg.zone.SceneEndBaselines; import network.packets.swg.zone.UpdatePostureMessage; import network.packets.swg.zone.UpdatePvpStatusMessage; @@ -109,6 +111,23 @@ public class CreatureObject extends TangibleObject { initBaseAttributes(); } + /** + * It is only recommended that this method be used when you have + * an item and you won't know which slots it will occupy until you've + * looped through the arrangement list that resides within SWGObject. + * + * If you know the slot which your object is supposed to occupy, it's + * recommended that you instead use setSlot(), effectively skipping + * the process of looping. + * + * @param item to equip + */ + public void equipItem(TangibleObject item) { + for(List slotNameList : item.getArrangement()) + for(String slotName : slotNameList) + super.setSlot(slotName, item); + } + public void addEquipment(SWGObject obj) { synchronized(equipmentList) { if (obj instanceof WeaponObject)