Nemo

66 - Expose additional API functionality

The following functions (or changes to existing functions) would help a lot in finishing the Simcraft parser. I'd prefer parse output to not refer to anything in Nemo.D directly. I apologize in advance if I missed any existing functions that already fit.

New(?) functions:

  • GetPlayerGCD() Done
  • GetPlayerPowerRegen() Done
  • GetPlayerTimeToMaxPower() Done
  • GetSpellAppliedDuration(spell,unit) Done
  • GetSpellAppliedHastePercent(spell,unit) Done
  • GetSpellAppliedCritDamagePercent(spell,unit) Too complex to be generic for all classes. Decided to leave logic in rotation actions to include gear bonus calculations.
  • GetSpellCurrentCritDamagePercent(spell) Too complex to be generic for all classes. Decided to leave logic in rotation actions to include gear bonus calculations.

The following behavioral changes to existing functions would be very helpful:

  • GetSpell[Applied/Current]BonusDPS could factor in critical damage bonus (probably as per the above new function)
  • GetSpell[Applied/Current]Bonus[Damage/DPS] could work for melee/ranged spells too. This would be amazing. I understand there are already functions to get at current/applied AP, but it would be great to get at the entire DPS calculation that magical spells get (taking into account melee/ranged haste etc.), as well as being able to treat all spells the same as an end user.
  • It would be nice to confirm that the above DPS functions reflect changes from Mastery bonuses.
User When Change
soulwhip Mar 08, 2014 at 15:38 UTC Changed status from Started to Fixed
soulwhip Mar 08, 2014 at 15:37 UTC Changed description:
  * GetSpellAppliedHastePercent(spell,unit) Done

- * GetSpellAppliedCritDamagePercent(spell,unit)
+ * GetSpellAppliedCritDamagePercent(spell,unit) Too complex to be generic for all classes. Decided to leave logic in rotation actions to include gear bonus calculations.

- * GetSpellCurrentCritDamagePercent(spell)
+ * GetSpellCurrentCritDamagePercent(spell) Too complex to be generic for all classes. Decided to leave logic in rotation actions to include gear bonus calculations.
soulwhip Mar 08, 2014 at 14:25 UTC Changed description:
  New(?) functions:

- * GetPlayerGCD()
+ * GetPlayerGCD()  Done
- * GetPlayerPowerRegen()
+ * GetPlayerPowerRegen() Done
- * GetPlayerTimeToMaxPower()
+ * GetPlayerTimeToMaxPower() Done
- * GetSpellAppliedDuration(spell,unit)
+ * GetSpellAppliedDuration(spell,unit) Done
- * GetSpellAppliedHastePercent(spell,unit)
+ * GetSpellAppliedHastePercent(spell,unit) Done
  * GetSpellAppliedCritDamagePercent(spell,unit)
soulwhip Nov 10, 2013 at 18:09 UTC Changed priority from Medium to High
soulwhip Nov 09, 2013 at 03:44 UTC Changed status from New to Started
nefigah Nov 07, 2013 at 20:32 UTC Create

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

  • Avatar of soulwhip soulwhip Mar 08, 2014 at 15:38 UTC - 0 likes

    GetPlayerGCD() Done GetPlayerPowerRegen() Done GetPlayerTimeToMaxPower() Done GetSpellAppliedDuration(spell,unit) Done GetSpellAppliedHastePercent(spell,unit) Done GetSpellAppliedCritDamagePercent(spell,unit) Too complex to be generic for all classes. Decided to leave logic in rotation actions to include gear bonus calculations. GetSpellCurrentCritDamagePercent(spell) Too complex to be generic for all classes. Decided to leave logic in rotation actions to include gear bonus calculations.

    Closing ticket until we decide a good way to tackle the damage bonuses for all classes including gear.

  • Avatar of nefigah nefigah Nov 12, 2013 at 17:31 UTC - 0 likes

    @soulwhip: Go

    Alright, that's fine; you can scrap it then and we'll implement crit dmg in rotations if needed

  • Avatar of soulwhip soulwhip Nov 11, 2013 at 14:08 UTC - 0 likes

    @nefigah: Go

    So the function name can be GetSpellAppliedCritDamage?
    Seems to make more sense and the matching simcraft property is crit_dmg, correct?


    This function may belong in the rotations. It calculates using so many variables like the amplified buff and each spell may be different based upon the number of stacks of a buff or I see some that depend on the number of ticks remaining, tier sets are checked. I don't see a good way to make a generic GetSpellAppliedCritDamage. Correct me if I am wrong.

      else if ( name_str == "crit_dmg" )
      {
    ...
              double damage = dot() -> state -> result_amount;
              if ( dot() -> state -> result == RESULT_HIT )
                damage *= 1.0 + action -> total_crit_bonus();
              return damage;
    ...
      }
    crit_bonus_multiplier *= 1.0 + priest.sets -> set( SET_T16_2PC_CASTER ) -> effectN( 1 ).percent();
    
    double action_t::total_crit_bonus()
    {
    crit_multiplier                = 1.0;
      double crit_multiplier_buffed = crit_multiplier * composite_player_critical_multiplier();
      double base_crit_bonus = crit_bonus;
      if ( ! player -> is_pet() && ! player -> is_enemy() )
        base_crit_bonus += player -> buffs.amplified -> value(); //http://www.wowhead.com/spell=146051
      double bonus = ( ( 1.0 + base_crit_bonus ) * crit_multiplier_buffed - 1.0 ) * crit_bonus_multiplier;
    
      if ( sim -> debug )
      {
        sim -> out_debug.printf( "%s crit_bonus for %s: cb=%.3f b_cb=%.2f b_cm=%.2f b_cbm=%.2f",
                       player -> name(), name(), bonus, base_crit_bonus, crit_multiplier_buffed, crit_bonus_multiplier );
      }
    
      return bonus;
    }
    
    Last edited Nov 11, 2013 by soulwhip
  • Avatar of nefigah nefigah Nov 11, 2013 at 05:31 UTC - 0 likes

    @soulwhip: Go

    I thought "GetSpellCritChance" and "GetSpellAppliedCritPercent" return your percentage chance of critically hitting? I was talking about Crit damage/healing effect bonus, such as you get from a meta gem or certain classes have for certain spells (like Lightning Bolt for ele shaman)

    That's why I was thinking it would have a spell param, because not all spells in a school might get the bonus

  • Avatar of soulwhip soulwhip Nov 11, 2013 at 04:12 UTC - 0 likes
    1. Is there a difference I am missing here Nef? I think we already have GetSpellAppliedCritDamagePercent.
      Nemo.GetSpellAppliedCritPercent=function(spell, spellTreeID, unit)
      
    2. Another question on GetSpellCurrentCritDamagePercent. Why would it take a spell parameter?
      GetSpellCritChance takes spell school as parm.
    Nemo.D.P.TS[SpellID..':'..DestID].smcc[tostring(spellTreeID)] = GetSpellCritChance(spellTreeID)
    
    Last edited Nov 11, 2013 by soulwhip
  • Avatar of nefigah nefigah Nov 10, 2013 at 00:38 UTC - 0 likes

    @soulwhip: Go

    Yes, I certainly wouldn't recommend making something like Nemo.GetWhetherOrNotToRefreshRip() :)

    I included that as an example of some implementation details of Nemo.GetSpellAppliedBonusDPS() when the latter is handed a melee dot instead of a magic one (as opposed to just returning 0 like it does now)

  • Avatar of nefigah nefigah Nov 09, 2013 at 22:00 UTC - 0 likes

    Ah, I put that on there because it's one of the supported properties, as per the simcraft docs:

    Quote:

    Dots
    The dots and hots applied by the character on the target can be used through the following syntax: dot.<dot_name>.<dot_property>. As usual, for the dot name, use underscores instead of white spaces and ignore non-alphanumeric characters.
    The available properties are:
    duration is the initial duration, in seconds (not the remaining duration).
    ...

    It's implemented as

    select(6, UnitDebuff("target", "spell")) 
    

    so I put it on the list to make it look more "Nemo-like." But if it's not actually used don't worry about it

  • Avatar of soulwhip soulwhip Nov 09, 2013 at 19:36 UTC - 0 likes

    Hey Nef,

    I have a few questions on GetSpellAppliedDuration

    1. Duration is the applied time so you want to start tracking the time since applied not timeleft correct?
    2. Does aura refresh reset the duration?
    3. Does the function need to accept both buff and debuffs for the spell?
    4. I don't see a simcraft property that needs this, do you have an example?
    Last edited Nov 09, 2013 by soulwhip
  • Avatar of soulwhip soulwhip Nov 09, 2013 at 19:20 UTC - 0 likes

    @nefigah: Go

    I don't want to code specialized functions like this Druid DoT calculator into the Nemo criteria. Let me explain why.

    It is too specialized, it even includes a Dream of Cenarius check. This kind of function can change on a weekly basis due to patches or spell buffs or nerfs. I usually throw these dynamic and over specialized functions in the rotation itself. I create a _Data action at the top of the rotation with _nemo_enable_lua and add it to the Nemo table to allow global access. I remember creating _nemo_run_once to aid in this function declaration.

    You can look at the Unholy DK rotation has a class specific function like this embedded into the rotation called Nemo.SoulReaperWillExecute=function(healthpercent).

    In general, if you are using spellIDs when creating nemo criteria functions, then the function probably belongs in the rotation instead of hard coded into the nemo framework. The goal is for the Nemo framework to survive an expansion, I'm trying to make rotations last a month :P

    Last edited Nov 09, 2013 by soulwhip
  • Avatar of soulwhip soulwhip Nov 09, 2013 at 17:18 UTC - 0 likes

    GetPlayerGCD()
    GetPlayerPowerRegen()
    GetPlayerTimeToMaxPower()
    Pushed to master, I'll continue on the rest later today.

    Last edited Nov 09, 2013 by soulwhip

Facts

Last updated
Mar 08, 2014
Reported
Nov 07, 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
High - Strongly want to resolve in the specified milestone.
Votes
0

Reported by

Possible assignees