aRTy42 / POE-ItemInfo

Item Info Script for Path of Exile
166 stars 224 forks source link

Affix parsing failing for Shavronnes Wrappings (maybe more uniques) #13

Closed Eruyome closed 8 years ago

Eruyome commented 8 years ago

I'm currently trying to resolve this myself, but wanted to report it here anyway since I'm not sure that I will resolve it and some discussion could help.

While working on PoE-TradeMacro I noticed that the variable ItemData.Affixes holds the implicit mod of Shavronnes Wrappings instead of the actual affixes we want. I compared it with Infernal Mantle where it works.

Manually incrementing (line 6420): ItemDataIndexAffixes := ItemData.IndexLast - GetNegativeAffixOffset(Item) by 1 solves it for Shavs, but breaks it for the other uniques.

Looking at both uniques item data I can't see any difference that could cause this though:

Rarity: Unique
Shavronne's Wrappings
Occultist's Vestment
--------
Quality: +20% (augmented)
Energy Shield: 447 (augmented)
--------
Requirements:
Level: 62
Int: 180
--------
Sockets: B-B-B-B-B G 
--------
Item Level: 67
--------
8% increased Spell Damage
--------
199% increased Energy Shield
10% faster start of Energy Shield Recharge
+34% to Lightning Resistance
Reflects 1 to 250 Lightning Damage to Melee Attackers
Chaos Damage does not bypass Energy Shield
--------
Shavronne's apparel became ever more extravagant
as her body and soul became ever more corrupted.
Rarity: Unique
Infernal Mantle
Occultist's Vestment
--------
Quality: +20% (augmented)
Energy Shield: 454 (augmented)
--------
Requirements:
Level: 62
Int: 180
--------
Sockets: B 
--------
Item Level: 62
--------
4% increased Spell Damage
--------
+1 to Level of Socketed Fire Gems
31% increased Fire Damage
100% increased Global Critical Strike Chance
204% increased Energy Shield
15% of Fire Damage Converted to Chaos Damage
100% increased Spell Damage taken when on Low Mana
--------
Despair hums, softly, deadly, in the bones of my enemies. 
Eyes will burn, and souls wither, as they bask in my radiance.
Eruyome commented 8 years ago

GetNegativeAffixOffset() returns 2 instead of 1.

If (Item.IsFlask or Item.IsUnique or Item.IsTalisman) should only trigger this condition, but also triggers If (Item.IsCorrupted) because the flavor text contains "corrupted"

aRTy42 commented 8 years ago

You beat me to it by a few minutes. I found the wrong negativeOffset and was looking which part caused it.

Eruyome commented 8 years ago

I can fix that, just needs something better than

 IfInString, ItemDataText, Corrupted
    {
        Item.IsCorrupted := True
    }
aRTy42 commented 8 years ago

The check for mirrored and effects are both horribly insecure aswell:

ItemIsMirrored(ItemDataText)
{
    Loop, Parse, ItemDataText, `n, `r
    {
        If (A_LoopField == "Mirrored")
        {
            return True
        }
    }
    return False
}
Item.HasEffect := (InStr(ItemData.PartsLast, "Has"))

Do you want to look into it or should I look for better solutions?

Eruyome commented 8 years ago

I believe I fixed all checks, just trying to find a mirrored item to test that

Eruyome commented 8 years ago

https://github.com/aRTy42/POE-ItemInfo/pull/14

Fixed and closed.

aRTy42 commented 8 years ago

I also noted that the ItemSubType is not reliable for uniques. The info script does not care, because the unique data displayed is based on the name, but for your script it might have consequences. For example the body armour "The Rat Cage" gets classified as a helmet because the name with "Cage" comes before the base type line "Sharkskin Tunic". If that is a problem, the solution is likely to narrow down the ItemDataNamePlate lines even more for uniques or items in general, before the whole regex match section starts.

Eruyome commented 8 years ago

Ok, I will look into that. But for now we only care about the item name if it's a unique, since the name is, well, unique and we don't want other results. But also adding the subtype can't hurt.