QUOTE (Lord Hog Fred @ July 30, 2006 05:17 pm) |
Can I add generic attachments to players with names that can be checked against when equipping items? Basically I want to add to an items script a check that looks if an attachment named "X" is on the player and if so allow them to equip it. If not then it won't allow the player to equip the item. Any ideas on how I may go about doing this? Thanks , |
CODE |
public override bool CanEquip(Mobile m) { if (XmlAttach.FindAttachment(m, typeof(XmlData), "X") == null) { // didnt find the XmlData attachment with that name on the mobile, so cant equip return false; } return base.CanEquip(m); } |
CODE |
using Server.Engines.XmlSpawner2; |
QUOTE (Lord Hog Fred @ July 30, 2006 06:10 pm) |
Ah thank you very much. the fact XmlSpawner allows this has just made my life so much easier Could I add the attachment "X" to a player via a deed or some other item when used? |
CODE |
XmlAttach.AttachTo(player, new XmlData("X")); |