todo:

Transfer and Char stash window sizes

records\ui\caravan\caravan_stashwindow.dbr, char stash
InventoryHeight,18, correct grid size, unlike inventoryXSize from caravan_stashinventory.dbr
InventoryWidth,10,

Stasher
InventoryHeight,20,
InventoryWidth,30,

records\ui\caravan\caravan_stashinventory.dbr char stash
inventoryX,13,
inventoryXSize,320, 320/32 = 10 -> wrong size info
inventoryY,0,
inventoryYSize,160, 160/32 = 5 -> wrong size info

Stasher
inventoryX,14,
inventoryXSize,960,
inventoryY,18,
inventoryYSize,640,


records\ui\caravan\caravan_transferinventory.dbr transfer stash
inventoryX,44,
inventoryXSize,256, 256/32 = 8, actual size 346x595 = (44 + 256 + 44 + 2) x (39 + 512 + 39 + 5)
inventoryY,39,
inventoryYSize,512, 512/32 = 16

Stasher
inventoryX,45,
inventoryXSize,928, 928/32 = 29, actual size 986x654 -> grid size
inventoryY,-60,
inventoryYSize,640, 640/32 = 20

====>

char stash

records\ui\caravan\caravan_stashwindow.dbr
InventoryHeight,18,
InventoryWidth,10,

transfer stash

records\ui\caravan\caravan_transferinventory.dbr
inventoryXSize,256, 256/32 =  8
inventoryYSize,512, 512/32 = 16



TXT_OFF_ABS_RANGE_DUR_CHANCE  
Dawnguard Gauntlets

- TXT_OFF_PERC_DUR_CHANCE
  breakpoint GDItemCraftPane.updateDescription
  -> DetailComposer.getItemText -> createComposer
  -> BonusDetail.createDamageInfos

- search by damage type
  should work for stash now too, need to verify by loading items with affixes and searching them


  variables used in formulas
  - itemPrefixCost
      lootRandomizerCost,600, ?                             add to DBAffix, GracefulDusk uses 0
      Affix costs are set in the affixes. If the item has any affixes,
      it uses the values set in them to modify the item's price.
      Affixes may also have market modifiers, which are like multipliers.
  - itemSuffixCost
      lootRandomizerCost,600, ?                             add to DBAffix, GracefulDusk uses 0
  - itemLevel
      itemLevel,1,                                          DBItem.getItemLevel
  - defenseAttrArmor (armor)
      defensiveProtection,196.000000,                       DBDamage, type defensiveProtection
  - shieldBlockDefense (shield)
      defensiveBlock,33.000000,                             DBDamage, type defensiveBlock
  - shieldBlockChance (shield)
      defensiveBlockChance,14.000000,                       DBDamage, type defensiveBlock
  - totalAttCount (on weapon, armor, jewelry, shield...)    
      Attribute count is the total number of unique attributes the item has
      from its base stats and any affixes. Base weapon damage, for example,
      would be 1 attribute. If it has pierce ratio, that's another.
  - damageAvgBase (on weapon and shield)                    sum DBDamages of type base*
  - damageAvgPierceRatio (on weapon)
      offensivePierceRatioMax,0.000000,                     DBDamage, type offensivePierceRatio
      offensivePierceRatioMin,35.000000,                    DBDamage, type offensivePierceRatio
  - charAttackSpeed (on weapon)
      characterAttackSpeed,0.000000,                        add to DBCharBonus
      characterAttackSpeedModifier,0.000000,                DBCharBonus.getAttackSpeedPerc
      characterBaseAttackSpeed,-0.210000,                   add to DBCharBonus
      Attack speed is the base attack speed set on the item, does not include any modifiers. 

- component selection, add selection by completion bonus

REFLECT			495		DEF
PROTECTION		490		DEF
ARMOR_ABSORPTION	485		DEF
BLOCK_CHANCE		480		DEF
BLOCK_AMOUNT		475		DEF

LIFE_LEECH		395				OFF
TOTALDAMAGE		390				OFF		RET
ALL			385		DEF
PHYSICAL		380		DEF		OFF		RET
PHYSICAL_BONUS		375				OFF
PIERCE			370		DEF		OFF		RET
PIERCE_RATIO		365				OFF
ELEMENTAL		360		DEF		OFF		RET
POISON			355		DEF		OFF		RET
AETHER			350		DEF		OFF		RET
CHAOS			345		DEF		OFF		RET
COLD			340		DEF		OFF		RET
FIRE			335		DEF		OFF		RET
LIGHTNING		330		DEF		OFF		RET
LIFE			325		DEF		OFF		RET

SLOW_LIFE_LEECH		295				OFF		RET
SLOW_PHYSICAL		290				OFF		RET
SLOW_BLEED		285				OFF		RET
SLOW_COLD		280				OFF		RET
SLOW_FIRE		275				OFF		RET
SLOW_LIGHTNING		270				OFF		RET
SLOW_POISON		265				OFF		RET
SLOW_LIFE		260				OFF		RET
OFF_LIFE_PERC		255				OFF		RET

TOTALDMGRED		195				OFF
SLOW_TOTALSPEED		190				OFF
SLOW_ATTACK		185				OFF		RET
SLOW_OFF_RED		180				OFF		RET
PHYS_DMG_RED		175				OFF
SLOW_OFFENSE		170				OFF		RET
SLOW_DEFENSE		165				OFF		RET
SLOW_DEF_RED		160				OFF
SLOW_RUNSPEED		155				OFF		RET
TOTALRESRED		150				OFF
PHYS_RES_RED_ABS	145				OFF
MANA_BURN_RATIO		140				OFF
SLOW_MANA_LEECH		135				OFF

STUN			 95		DEF		OFF		RET
FREEZE			 90		DEF		OFF		RET
PETRIFY			 85		DEF		OFF		RET
SLEEP			 80		DEF		OFF		RET
TRAP			 75		DEF		OFF		RET
DISRUPTION		 70		DEF		OFF
KNOCKDOWN		 65		DEF		OFF
CONVERT			 60		DEF		OFF		RET
CONFUSION		 55		DEF		OFF		RET
FEAR			 50		DEF		OFF		RET
LIFE_PERC		 45		DEF
SLOW_LIFE_LEECH		 40		DEF
BLEED		 	 35		DEF
TOTALSPEED_RES		 30		DEF
SLOW_MANA_LEECH		 25		DEF				RET
MANA_BURN		 20		DEF
TAUNT			 15		DEF


GDItem
  private static final byte[] X_00 = {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00};
  private static final byte[] X_01 = {(byte) 0x00, (byte) 0x00, (byte) 0x80, (byte) 0x3F};
  private static final byte[] X_02 = {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x40};
  private static final byte[] X_03 = {(byte) 0x00, (byte) 0x00, (byte) 0x40, (byte) 0x40};
  private static final byte[] X_04 = {(byte) 0x00, (byte) 0x00, (byte) 0x80, (byte) 0x40};
  private static final byte[] X_05 = {(byte) 0x00, (byte) 0x00, (byte) 0xA0, (byte) 0x40};
  private static final byte[] X_06 = {(byte) 0x00, (byte) 0x00, (byte) 0xC0, (byte) 0x40};
  private static final byte[] X_07 = {(byte) 0x00, (byte) 0x00, (byte) 0xE0, (byte) 0x40};
  private static final byte[] X_08 = {(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x41};
  private static final byte[] X_09 = {(byte) 0x00, (byte) 0x00, (byte) 0x10, (byte) 0x41};
  private static final byte[] X_10 = {(byte) 0x00, (byte) 0x00, (byte) 0x20, (byte) 0x41};
  private static final byte[] X_11 = {(byte) 0x00, (byte) 0x00, (byte) 0x30, (byte) 0x41};
  private static final byte[] X_12 = {(byte) 0x00, (byte) 0x00, (byte) 0x40, (byte) 0x41};
  private static final byte[] X_13 = {(byte) 0x00, (byte) 0x00, (byte) 0x50, (byte) 0x41};
  private static final byte[] X_14 = {(byte) 0x00, (byte) 0x00, (byte) 0x60, (byte) 0x41};
  private static final byte[] X_15 = {(byte) 0x00, (byte) 0x00, (byte) 0x70, (byte) 0x41};
  
  private static final byte[][] X = {X_00, X_01, X_02, X_03, X_04, X_05, X_06,
    X_07, X_08, X_09, X_10, X_11, X_12, X_13, X_14, X_15 };
  
  private static final int POS_00 = ByteBuffer.wrap(X_00).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_01 = ByteBuffer.wrap(X_01).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_02 = ByteBuffer.wrap(X_02).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_03 = ByteBuffer.wrap(X_03).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_04 = ByteBuffer.wrap(X_04).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_05 = ByteBuffer.wrap(X_05).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_06 = ByteBuffer.wrap(X_06).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_07 = ByteBuffer.wrap(X_07).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_08 = ByteBuffer.wrap(X_08).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_09 = ByteBuffer.wrap(X_09).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_10 = ByteBuffer.wrap(X_10).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_11 = ByteBuffer.wrap(X_11).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_12 = ByteBuffer.wrap(X_12).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_13 = ByteBuffer.wrap(X_13).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_14 = ByteBuffer.wrap(X_14).order(ByteOrder.LITTLE_ENDIAN).getInt();
  private static final int POS_15 = ByteBuffer.wrap(X_15).order(ByteOrder.LITTLE_ENDIAN).getInt();
  
  private static final int[] POS = {POS_00, POS_01, POS_02, POS_03, POS_04, POS_05, POS_06,
    POS_07, POS_08, POS_09, POS_10, POS_11, POS_12, POS_13, POS_14, POS_15 };
  
