|
|
|
@ -530,23 +530,24 @@ public class ItemTemplate {
@@ -530,23 +530,24 @@ public class ItemTemplate {
|
|
|
|
|
if (itemManager == null || abstractCharacter == null) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (abstractCharacter.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { |
|
|
|
|
// Early exit for mobiles and NPCS.
|
|
|
|
|
// Perhaps not needed now that mobs have skills.
|
|
|
|
|
|
|
|
|
|
if (!validForSlot(slot, itemManager.getEquipped(), item)) |
|
|
|
|
return false; |
|
|
|
|
if (EnumSet.of(Enum.GameObjectType.NPC, Enum.GameObjectType.Mob).contains(abstractCharacter.getObjectType())) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (!validForSkills(item, abstractCharacter.getSkills())) |
|
|
|
|
return false; |
|
|
|
|
if (!validForSlot(slot, itemManager.getEquipped(), item)) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
if (canCharacterEquip(item, abstractCharacter) == false) |
|
|
|
|
return false; |
|
|
|
|
if (!validForSkills(item, abstractCharacter.getSkills())) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
//players can't wear 0 value items.
|
|
|
|
|
if (canCharacterEquip(item, abstractCharacter) == false) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
return item.template.item_value != 0 || Kit.IsNoobGear(item.getItemBase().uuid); |
|
|
|
|
//players can't wear 0 value items.
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return item.template.item_value != 0 || Kit.IsNoobGear(item.getItemBase().uuid); |
|
|
|
|
|
|
|
|
|
return true; //Mobiles and NPC's don't need to check equip
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|