Jump to content

EquipItem and Enchantments


zaira

Recommended Posts

Posted

If I use clothes with custom enchantments EquipItem() won't apply the enchantment to the NPC.

function EquipOutfit(Armor[] clothes,Actor npc,Enchantment ench)
	int x = clothes.Length
	while x > 0
		x -= 1
		if Math.LogicalAnd(clothes[x].GetSlotMask(),0x04)
			clothes[x].SetEnchantment(ench)
		endif
		npc.EquipItem(clothes[x])
	endwhile
endfunction

Any idea what's wrong? If I replace EquipItem with EquipItemEx the NPC ends naked.

 
Posted

Before equipping check if the npc has the armor, if not, then add it to the inventory.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...