Adding a "TwoHand" enchant allows that enchant on 1H weapons

Topics: Rawr.Mage
Mar 9, 2009 at 6:19 PM
So I'm putting any new mage-able items from the PTR (mainly using wowhead's "Latest" list for the PTR:  http://ptr.wowhead.com/?latest=additions), and wanted to add the 81 spellpower staff enchant to see how staff + huge enchant, and 1H + Offhand + smaller enchant would compare.  I added the enchant to the XML (because I don't believe there's an 'add enchant' interface of sorts in Rawr), hoping that because the enchant uses regular stats it wouldn't need specific coding like the lightweave embroidery did.  This is the XML I added:

<Enchant>
    <Id>4000</Id>
    <Name>Greater Spellpower</Name>
    <Slot>TwoHand</Slot>
    <Stats>
      <SpellPower>81</SpellPower>
    </Stats>
  </Enchant>

I chose an arbitrary ID of '4000' because I couldn't figure out where any of the other enchants got their ID number from.  Looking at those other enchants on wowhead, whether from the recipe, or from the spell detail, none of the enchants match (These are all 4-digit id numbers, wowhead tends to use 5-digit id numbers for it's enchant "Spell" id's.).  Anyway, it appeared to work when I loaded up rawr, and showed the enchant in the comparisons chart and let me check and uncheck it for the optimizer.  The only problem, though, is that rawr doesn't appear to honor the "TwoHand" slot type.  The optimizer was sticking it on 1-handers, and I could manually put it on 1-handers.

It seems to me like the enchant code needs to be cleaned up some, it should honor both slot types *and* item types.  Right now it tends to ignore if an item is "held in offhand" and tries to put enchants on those...It shouldn't be up to each individual models to handle what *item types* enchants can be placed on.  This should be handled by the enchanting & item code.  There's also other item-type-specific enchants, like "Shield"-only enchants, and now this new "Staff"-only enchant. 


Coordinator
Mar 9, 2009 at 6:32 PM
What you describe is already how it works. The Mage model just hasn't been updated with restrictions about 1H vs 2H enchants.
Mar 9, 2009 at 6:36 PM
But why is it model-specific?  Enchantments are not restricted based upon class or spec, but upon the item types they can be placed on.
Coordinator
Mar 9, 2009 at 6:56 PM
Well, that's partly a good point. Selection of enchants needs to be model specific, but I could still enforce the requirements in the calculation of enchants. ie, only add the stats of the enchant if the enchant fits on the item.
Coordinator
Mar 10, 2009 at 1:56 AM
Selection of enchants is right now based on character slot only. Should we include an item slot filter on it?
Coordinator
Mar 10, 2009 at 2:55 AM
No, I think they should just have no value if they don't fit the item. It'd be annoying to have enchants get deselected, or not be selectable, which flipping between items.