Ovale Spell Priority

263 - Function to return upgrade state or ilvl of a trinket

What version of Ovale are you using?
5.3.6

Please provide any additional information below.
This would allow me to account for all possible ilvls of a trinket (where as now I can only differentiate between ones with different item IDs and have to make assumptions about the upgrade level).

User When Change
jlam Oct 14, 2013 at 05:41 UTC Changed status from Replied to Fixed
ShmooDude Sep 02, 2013 at 20:54 UTC
jlam Aug 30, 2013 at 21:40 UTC
jlam Aug 16, 2013 at 06:39 UTC
jlam Jul 15, 2013 at 06:58 UTC
jlam Jul 15, 2013 at 06:58 UTC Changed assigned to from Sidoine to jlam
ShmooDude Jul 14, 2013 at 22:20 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

  • 4 comments
  • Avatar of jlam jlam Oct 14, 2013 at 05:41 UTC - 0 likes

    This feature is in the next release of Ovale.

  • Avatar of ShmooDude ShmooDude Sep 29, 2013 at 08:38 UTC - 0 likes

    Haven't seen anything on this in a while and not sure where/how you did your backend (I can't find it, might not be in the public version of ovale yet I guess) but I was browsing around and found a library that might be of use

  • Avatar of ShmooDude ShmooDude Sep 02, 2013 at 20:53 UTC - 0 likes

    I can think of a several ways (I would think HasTrinket would be an alias for HasEquippedItem in all these cases) it could be done.

    1st:

    if HasEquippedItem(ror_trinket ilvl=522)
    {
        DoStuff()
    }
    

    Which would be true only if the ilvl 522 version of the trinket is equipped.

    2nd:

    if HasEquippedItem(ror_trinket upgrade=0)
    {
        DoStuff()
    }
    

    Would return true if any of the unupgraaded trinkets are equipped (upgrade could be 0, 1 or 2). The function would internally compare the ilvl to the base item's ilvl + 0, 4 or 8 depending on the upgrade level and rarity. This method would really work best explicitly calling each trinket instead of the whole item list of trinkets (as you'd need another test to know which version of the trinket it is anyhow...).

    3rd (which is most similar to how my script code looks):

    if ItemLevel(ror_trinket) == 522
    {
        DoStuff()
    }
    

    ItemLevel would return the ilvl value of the equipped item or 0 if the item isn't equipped.

    4th (:

    if {HasEquippedItem(ror_trinket slot=Trinket0Slot)
        and ItemLevel(Trinket0Slot) == 522}
    or {HasEquippedItem(ror_trinket slot=Trinket1Slot)
        and ItemLevel(Trinket1Slot) == 522}
    {
        DoStuff()
    }
    

    Which is pretty much yours only I check both trinket slots and actually check for a specific ItemLevel which I assume is what you meant.

    1st and 3rd are pretty much the same thing just one does the comparison internally and one externally. The 3rd is about what I was expecting but any of them will work.

    The thing with all my suggestions (barring 4th which again is pretty much what you have) is they have to search through all slots. I'm assuming this is probably a bad idea for efficiency. Any of the first 3 could probably additionally take a slot=XX parameter as well to solve that problem (and could be optional so if you don't give it a slot, it'll do the full search).

    For reference, this is what I use currently (with assumed 2/2 upgrades)

    AddFunction SoulCharmAttackPower 
    { 
        if HasTrinket(96741) 3430 # Heroic TF 2/2 upgrade
        if HasTrinket(96369) 3244 # Heroic 2/2 upgrade
        if HasTrinket(95997) 3038 # Normal TF 2/2 upgrade
        if HasTrinket(94512) 2874 # Normal 2/2 upgrade
        if HasTrinket(95625) 2384 # LFR 2/2 upgrade
    }
    AddFunction BadJujuAttackPower 
    { 
        if HasTrinket(96781) 18864 # Heroic TF 2/2 upgrade
        if HasTrinket(96409) 17840 # Heroic 2/2 upgrade
        if HasTrinket(96037) 16712 # Normal TF 2/2 upgrade
        if HasTrinket(94523) 15806 # Normal 2/2 upgrade
        if HasTrinket(95665) 13118 # LFR 2/2 upgrade
    }
    

    EDIT: If slot is going to be an optional prameter, have both the specific slot (trinket0slot and trinket1slot), as well as just "trinket", "finger" ("ring" as an alias) and "weapon" that checks both of the appropriate slots for those 3.

    Last edited Sep 03, 2013 by ShmooDude
  • Avatar of jlam jlam Aug 23, 2013 at 22:03 UTC - 0 likes

    I have the backend code working at this time, but I'm not sure on the right way to expose it as a script condition. Currently, I'm leaning toward:

    if HasEquippedItem(ror_trinket slot=Trinket0Slot)
        and ItemLevel(Trinket0Slot)
    {
        DoStuff()
    }
    

    It seems somewhat clunky though. I'm trying to figure out an elegant way to express it so that scripts are simpler to write.

  • 4 comments

Facts

Last updated
Oct 14, 2013
Reported
Jul 14, 2013
Status
Fixed - Developer made requested changes. QA should verify.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees