E:\_GD\ModComponents\Vanilla_v121\gdx1\database\records\items\lootsets\itemset_d115.dbr

augmentSkillLevel1,0;0;0;3,
augmentSkillLevel2,0;0;0;3,
augmentSkillName1,records/skills/playerclass05/mindovermatter2.dbr,
augmentSkillName2,records/skills/playerclass07/lightningnet1.dbr,

+3 to skill for the 4th item of the set

DBSkillBonus
GD_ITEM_SKILLS
GD_AFFIX_SKILLS

itemSkillModifierControl,0;0;0;1,
modifiedSkillName1,records/skills/playerclass07/lightningnet1.dbr,
modifierSkillName1,records/skills/itemskillsgdx1/skillmodifiers/legendarygdx1/set_d115_stormbox.dbr,

skill modifier for the 4th item of the set

GD_ITEM_SKILLMODIFIER
GD_AFFIX_SKILLMODIFIER





modifiedSkillName1,records/skills/playerclass03/sigilofdestruction1.dbr,
modifierSkillName1,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/sword1h_d003_sigilofconsumption.dbr,

conversionInType,Life,
conversionOutType,Fire,
conversionPercentage,75.000000,

x% <in type> converted to <out type> to <skill>
Not shown yet!!!!
    TYPE_CHAR_CONVERSION_PCT, TXT_CONVERT_FROM_TO
-> fixed    


modifiedSkillName2,records/skills/playerclass02/thermitemines1.dbr,
modifierSkillName2,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/sword1h_d003_thermitemine.dbr,

petSkillName,records/skills/playerclass02/pets/modifier_thermitemine_swordd003.dbr,
skillTargetRadius,0.300000, +x Meter Radius to <skill> / +x Meter Target Area to <skill>

-----------------------------------------------------------------------------------

modifiedSkillName1,records/skills/playerclass04/veilofshadows1.dbr,
modifiedSkillName2,records/skills/playerclass05/chillingsurge.dbr,
modifierSkillName1,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/medal_d009_veilofshadows.dbr,
modifierSkillName2,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/medal_d009_flashfreeze.dbr,

skillTargetRadius,2.000000, +x Meter Target Area to <skill>

characterDefensiveAbility,-60.000000, -60 Defensive Ability to <skill>
Not shown yet!!!!
-> fixed, presumably for all negative values
-----------------------------------------------------------------------------------

modifiedSkillName1,records/skills/playerclass06/squall1.dbr,
modifiedSkillName2,records/skills/playerclass05/skyshard1.dbr,
modifierSkillName1,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/caster_d008_winddevil.dbr,
modifierSkillName2,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/caster_d008_skyshard.dbr,

skillCooldownTime,-0.500000, -x Second Skill Recharge to <skill>
skillCooldownTime,-1.000000,
Not shown yet!!!!

-----------------------------------------------------------------------------------

modifiedSkillName1,records/skills/playerclass03/summon_raven1.dbr,
modifiedSkillName2,records/skills/playerclass06/summon_manticore1.dbr,
modifierSkillName1,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/necklace_d001_summonfamiliar.dbr,
modifierSkillName2,records/skills/itemskillsgdx1/skillmodifiers/upgradedgdx1/necklace_d001_summonmanticore.dbr,

skillManaCostReduction,100.000000, -100% Skill Energy Cost to <skill>

petBurstSpawn,1, +x Summon to <skill>
petLimit,1, +x Summon Limit to <skill>


=> new tags to parse for skill modifiers -> to DBStat

skillTargetRadius
petBurstSpawn
petLimit


  public static final String TYPE_SKILL_PET_SUMMON_INC         = "petBurstSpawn";
  public static final String TYPE_SKILL_PET_LIMIT_INC          = "petLimit";
  public static final String TYPE_SKILL_TARGET_RADIUS          = "skillTargetRadius";


    info = new TagInfo("STAT_SKILL_RADIUS", 392);
    map.put(DBStat.TYPE_SKILL_TARGET_RADIUS, info);
    
    info = new TagInfo("STAT_PET_SUMMON", 390);
    map.put(DBStat.TYPE_SKILL_PET_SUMMON_INC, info);
    
    info = new TagInfo("STAT_PET_LIMIT", 388);
    map.put(DBStat.TYPE_SKILL_PET_LIMIT_INC, info);



when resizing the font, the selected item in the transfer pane gets lost
because the model gets rebuilt

---------------------------------------

tags not used

characterJewelryIntelligenceReqReduction
characterMeleeIntelligenceReqReduction
characterShieldStrengthReqReduction
characterWeaponIntelligenceReqReduction
defensiveManaBurn
defensivePercentReflectionResistance
offensiveTotalDamageReductionAbsoluteDurationMin
offensiveTotalDamageReductionAbsoluteMin
skillActiveLifeCost
skillActiveManaCost

--------------------------------------------------------------

templateAutoCast,records/controllers/itemskills/cast_@enemyonattack_20%.dbr,

records\controllers\itemskills

templateName,database/templates/skillautocastcontroller.tpl,
chanceToRun,20,
targetType,Enemy,
triggerType,AttackEnemy,

chanceToRun,8,
targetType,Self,
triggerType,AttackEnemy,

chanceToRun,15,
targetType,Self,
triggerType,AttackEnemyCrit,

chanceToRun,25,
targetType,EnemyLocation,
triggerType,OnKill,

chanceToRun,15,
targetType,Enemy,
triggerType,OnKill,

chanceToRun,30,
targetType,Self,
triggerType,OnKill,

chanceToRun,5,
targetType,Enemy,
triggerType,HitByEnemy,

chanceToRun,25,
targetType,Self,
triggerType,HitByCrit,

chanceToRun,30,
targetType,Enemy,
triggerType,Block,

chanceToRun,33,
targetType,Self,
triggerType,Block,

chanceToRun,20,
targetType,Enemy,
triggerType,HitByProjectile,

chanceToRun,25,
targetType,Self,
triggerType,HitByProjectile,

chanceToRun,25,
targetType,Self,
triggerType,HitByMelee,

chanceToRun,100,
targetType,Self,
triggerParam,33.000000,
triggerType,LowHealth,

chanceToRun,50,
targetType,Self,
triggerType,LowHealth,

------------------------------------------------------------

table.getColumnModel().getColumn(2).setCellEditor(new DefaultCellEditor(myComboBox)); 

------------------------------------------------------------

items
attributeScalePercent,52.000000,

affixes
lootRandomizerJitter,40.000000,

To keep it simple:
1) attributes on affixes: can vary, but can't scale (scale based on item they are applied to)
2) attributes on augments, components and consumables and of course skills
   can't vary, can't scale
3) attributes on all other items can vary, some of them can scale, however
   there are certain attributes that have fixed values.

The formula is rather simple:
Code:

function _calcMinMaxValue(base, scale, jitter) {
	return [
		base * (1 - (jitter / 100)) * (1 + (scale / 100)),
		base * (1 + (jitter / 100)) * (1 + (scale / 100))
	]
}

But there are some quirks when determining what actually can vary and/or scale and how.

Affixes always have scale = 0 (they scale with their item, so this cannot be reflected in the
database entry of the affix), but they have certain jitter ("lootRandomizerJitter"), so for
base = 100 and jitter = 30, minmax range is [70, 130].

Attributes on items always have fixed jitter = 20, but they can also scale ("attributeScalePercent").
So for base = 100 and scale = 30, minmax range will be [104, 156] (= [100 * 0.8 * 1.3, 100 * 1.2 * 1.3]).
Some items have rather high "attributeScalePercent", for example it is 52 for
2h legendary rifles, bringing minmax range for base=100 to [122, 182].
But the tricky part is that not all of them scale that way, to be precise
currently only offensive attributes scale with this property, other
attributes have scale = 0. Also there are attributes that have fixed
values, e.g. +x to skill/mastery, light radius, exp gain, energy regen. 

--------------------------------------------------------------------------

C:\Users\hermannm\Documents\NetBeansProjects\GDStash\extract\1006hf1\records\creatures\npcs\merchants\factiontables

gameengine.dbr

factionPlayer,records/controllers/factions/faction_player.dbr,
factionSurvivors,records/controllers/factions/faction_survivors.dbr,
factionUser2,records/controllers/factions/faction_homestead.dbr,
factionUser3,records/controllers/factions/faction_saltmine.dbr,
factionUser4,records/controllers/factions/faction_exile.dbr,
factionUser5,records/controllers/factions/faction_necromancers.dbr,
factionUser6,records/controllers/factions/faction_undead.dbr,
factionUser7,records/controllers/factions/faction_blacklegion.dbr,
factionUser8,records/controllers/factions/faction_kymonzealots.dbr,

records\controllers\factions

templateName,database/templates/factionpack.tpl,
myFaction,User7,
myFaction,Player,
myFaction,Survivors,
etc.

--- not referenced in ARZ ----

records\creatures\npcs\merchants

merchantfaction_blacklegion_01.dbr

templateName,database/templates/npcmerchant.tpl,
marketFileName,records/creatures/npcs/merchants/factiontables/_merchanttbl_faction_blacklegion.dbr,

several merchan files can reference the same table

---- so probably best to start here ----

records\creatures\npcs\merchants\factiontables

_merchanttbl_faction_blacklegion.dbr

templateName,database/templates/factionmarket.tpl,
friendlyNormalTable,records/creatures/npcs/merchants/factiontables/blacklegion_friendly_01.dbr,
honoredNormalTable,records/creatures/npcs/merchants/factiontables/blacklegion_honored_01.dbr,
respectedNormalTable,records/creatures/npcs/merchants/factiontables/blacklegion_respected_01.dbr,
reveredNormalTable,records/creatures/npcs/merchants/factiontables/blacklegion_revered_01.dbr,

specifies the vendor tables for a faction

blacklegion_honored_01.dbr

templateName,database/templates/factiontier.tpl,
marketStaticItems,records/items/enchants/a01a_enchant.dbr;records/items/enchants/a02a_enchant.dbr;records/items/enchants/a03a_enchant.dbr;records/items/enchants/a04a_enchant.dbr;records/items/enchants/a05a_enchant.dbr;records/items/enchants/a06a_enchant.dbr;records/items/enchants/a07a_enchant.dbr;records/items/enchants/a08a_enchant.dbr;records/items/enchants/a37a_enchant.dbr;records/items/enchants/a38a_enchant.dbr;records/items/faction/accessories/medals/f004b_medal.dbr;records/items/faction/accessories/medals/f005b_medal.dbr;records/items/faction/accessories/medals/f006b_medal.dbr;records/items/faction/accessories/rings/f005b_ring.dbr;records/items/faction/accessories/rings/f006b_ring.dbr;records/items/crafting/blueprints/faction/craft_waist_blacklegion_01b.dbr;records/items/crafting/blueprints/faction/craft_weapon_blacklegion_1hsword01.dbr;records/items/faction/booster/boost_bl_a01.dbr,

Import, so enchantments and items can be tagged with the faction they are from

There does not seem to be a connection to the faction tag (for the text)

--------------------------------------------------------------------------


item	records/items/gearshoulders/c004_shoulder.dbr	regular
item	records/items/gearshoulders/c027_shoulder.dbr	empowered

skill	records/skills/itemskills/granted/item_willtolive.dbr

item:
itemSkillLevelEq,2,			<<< DBItem.itemSkillLevel

skill:

characterLifeRegen,25.000000;142.000000,
skillActiveDuration,5.000000,           <<< DBSkill.activeDuration
skillCooldownTime,45.000000;40.000000,
characterLifeRegen,25.000000;142.000000,
skillLifeBonus,150.000000;600.000000,   <<< DBCharBonus.skillHealthBonus
skillLifePercent,20.000000,             <<< DBCharBonus.skillHealthPerc
skillMaxLevel,2,
lifeMonitorPercent,35.000000,           <<< DBSkill.triggerLifePerc

Add a skillLevel field to DBCharBonus, as key, so multiple instances can be stored per skill        DBCharBonus.skillLevel
In extraction, pass iteration along with ID and value, so the value can be assigned to the
proper skill level (which is the iteration number)
DBCharBonus therefore becomes a List, not a single value in DBSkill (and ARZRecord),                done
maybe other places as well
When showing skill values for an item, retrieve the proper level

Move the following from DBSkill to DBCharBonus                                                      done
  private int               manaCost;          // skillManaCost,22.000000,
  private int               cooldownTime;      // skillCooldownTime,4.000000,
  private int               activeDuration;    // skillActiveDuration,5.000000,
  private int               triggerLifePerc;   // lifeMonitorPercent,35.000000, 
  private int               weaponDamagePerc;  // weaponDamagePct,220.000000,




Activates when Health drops below 35%	lifeMonitorPercent
45 Seconds Skill Recharge		skillCooldownTime[1]
5 Second Duration			skillActiveDuration
20% + 150 Health Restored		skillLifePercent + skillLifeBonus[1]
+25 Health Regenerated per second	characterLifeRegen[1]



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 };
  

