Jump to content

sysexpection

Members
  • Posts

    18
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by sysexpection

  1. How can be handled spell like 45477 Icy Touch (Rank 1) "Very high threat when in Frost Presence.", x7 damage according wowwiki?

    This in fact already works, it's handled by spell aura 61261.

    I already tested it after Vladimir pointed me to that...

    I have tested this too, and you're right. Unfortunetly, this applies for Unholy and Blood Presence too, but I couldn't figure out why...

    unbenanntqcc.png

    As you can see, the iterator returns the SpellModifier for ID 61261 (Frost Presence) but I've just switched to Bloodpresence a few seconds ago. Also I cannot see the SpellModifier, which the iterator returns, in the player object? Any ideas or explainations? Maybe I just don't get it... :o

  2. And i think we need a third column for attack power bonus, because non-damaging spells like sunder armor scale with AP.

    How can be handled spell like 45477 Icy Touch (Rank 1) "Very high threat when in Frost Presence.", x7 damage according wowwiki?

    Well, thats a very good question. Maybe a switch/case would help. Are there many spells handled like this?

    Easiest way would be a dirty "hack" fix like this:

    float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* /*pHatingUnit*/, float pThreat, bool crit, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell)
    {
       // all flat mods applied early
       if(!pThreat)
           return 0.0f;
    
       if (pThreatSpell)
       {
           SpellThreatEntry const* threatEntry = sSpellMgr.GetSpellThreatEntry(pThreatSpell->Id);
    
           if (Player* modOwner = pHatedUnit->GetSpellModOwner())
           {
               switch (pThreatSpell->Id)
               {
                   case 45477:
                       if(modOwner->HasAura(48266))
                           pThreat *= 7.0f;
                   break;
               }
    
               modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, pThreat);
    
               if(threatEntry && threatEntry->ap_multiplier)
                   pThreat += modOwner->CalculateDamage(BASE_ATTACK, false) * threatEntry->ap_multiplier;
           }
    
           if (crit)
               pThreat *= pHatedUnit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CRITICAL_THREAT,schoolMask);
    
           if (threatEntry)
               pThreat *= threatEntry->multiplier;
       }
    
       float threat = pHatedUnit->ApplyTotalThreatModifier(pThreat, schoolMask);
       return threat;
    }
    

    Maybe we could think about a conditional multiplier (condition may be also stored in database...)?

    if(player->HasAura(....)) { pThreat *= x.xf); }

    I moved threat multiplication to ThreatCalcHelper::calcThreat(), seemed more logical to me unless we really need different cases for damage and healing.

    I'm not sure but with you patch healing and damage do the same threat while, for what I know, healing usually should generate half amount

    Well, healing threat should be multiplied with 0.5. In fact every groupmember sould gain (threat*0.5)/amount_of_groupmembers threat. This is allready implement for most (maybe not all) cases.

    As you can see here in the callstack, healing spells are processed by ThreatCalcHelper::calcThreat(), too.

    unbenanntsxf.png

    In part realated to this, time ago I was working on threat from float to uint32

    it's based on an old revision and I had no time to test it but maybe it can be usefull, the main idea was to move threat math to uint since that's how it must be send to client and because, IMHO, a unit's threat can be negative that's why now some spell or scripts bork the threat meter.

    Yeah, I know, in the bug report thread. Well would like to hear some more voices on that topic. Another point is that integer calculations are faster then floating point math. It's worth to take a look on that.

  3. I have implemented an AP based multiplier for now:

    https://gist.github.com/763765

    This is based on Lynx3d's patch (thanks a lot for the well commented sourcecode, helped me a lot)

    I added an extra column, named `AP_Muliplier`. Now: If AP_Multiplier != 0.0 it will call Unit::calculateDamage(..) (base attack, normalised = false) and multiply the return value with the given AP multiplier from the database.

    Here an example. Values based on this: http://www.tankspot.com/showthread.php?39775-wow-3-0-threat-values

    Let's take Sunder Armor:

    mysql> select * from spell_threat where entry = 7386;
    ------- -------- ------------ --------------- 
    | entry | Threat | Multiplier | AP_Multiplier |
    ------- -------- ------------ --------------- 
    |  7386 |    345 |          1 |          0,05 |
    ------- -------- ------------ --------------- 
    1 row in set

    My Testwarrior has 708 to 972 AP. I'm in Defense Stance.

    Let's start with the basic threat of 375.

    CalculateDamage returns 954 * AP_Multiplier 0.05 = 47.7

    Threat is now 392.7.

    Multiplied with our databased threat multiplier (default value 1.0) it's still 392.7.

    After applying total threat modifier (1.45, defense stance) we have 569.415.

    Sounds much more better than the 100.0 * 1.45 from actual YTDB.

    Well, I'm not sure if ThreatCalcHelper::calcThreat is the best place to put this code. Also I'm not sure, if there is any spell, generating AP based threat, that can crit, or if stance has to be applied in every case.

    Well thanks for any comments, ideas for improvement, etc.

    And thanks to Lynx3d again :)

    Updated gist: Changed something and added the queries (sorry)

  4. - I moved threat multiplication to ThreatCalcHelper::calcThreat(), seemed more logical to me unless we really need different cases for damage and healing.

    There is nothing to discuss. You're right of course. Sometimes I'm just too blind or too lazy, whatever.

    And i think we need a third column for attack power bonus, because non-damaging spells like sunder armor scale with AP.

    https://gist.github.com/762020

    I've totally forgotten about cases like that. Well thanks for gist and your ideas. Now I have something to workout. That may take some time, since I'm not the best C++ programmer here. Mostly I work on process XML data, or general data to import it into databases and then push it into the ERP system. But it's time to grow up :D

  5. Updated again. I've extended the existing functions for additional threat in order to load multipliers.

    Speeding up the whole problem should be possible by setting an invalid (perhaps -1.0f - might also be 0 possible) as default for the table, and only push spells with not -1 values to the map.

    Well, very good idea. The new column `Threat_multiplier` has default value -1 and the older `Threat` column has now default value '0'.

    So if `Threat` == 0 we won't push to SpellThreatMap and if `Threat_multiplier` == -1 we won't push to SpellThreatMultiplierMap (cause there might be some cases we could use the 0 multiplier to remove threat generation).

    Kind regards

  6. Well, first of all, happy new year :D

    So here we go again. I've updated the patch and made a diff for rev. 10944. You might wanna use it know.

    darkstalker and Ambal thanks for you comments again. I've added an extra column to spell_threat, but the maps, load functions, reload function, etc. are still seperated. If you think it's better to combine, I can extend the existing functions for additional spell threat. In my opinion the code is a litte bit easier to read this way and the performance loss is very small in this case.

    regards

  7. For the DK treath, for example, DnD should give 1.9*damage as threat but actualy it can't be done since table SPELL_THREAT only allows a fixed valued per spell and, I'm not sure, only as immediate effect.

    I think it wouldn't be a big problem to add something like a multiplicator to database and calculation. I'm not sure, but I guess this is not only a problem when handeling Death and Decay . So it might be useful...

    When treath is sent to client with Unit::SendThreathUpdate the value is converted with uint32((*itr)->getThreat()) and the decimal fraction is lost due to truncate while, IMHO, it should be sent as uint32((*itr)->getThreat()*100) so 2 decimal fraction is preserved and thus it will explain the 2 orders of magnitude.

    I agree with Tonian67. I haven't taken a look on calculation yet, but I think that isn't the point.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use