Welcome to AC Web.
Results 1 to 11 of 11
  1. #1

    Attack Speed bug [Oregon Core]


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    For some reason, at an attack speed below 0.30, any type of chance on hit procs (+ poison, windfury and etc.) doesn't activate. I reported the problem at OregonCore's GitHub, but they did not pay special attention because it's blizzlike core and you can't get 0,30 attack speed. I believe the problem is somewhere in Player.cpp, but I don't know where exactly. Can you help me, please?

    PS: The problem affects only the off-hand weapons.

  2. #2
    FusionGEN | Serenity-WoW

    Join Date
    Nov 2011
    Location
    MMO-Society
    Posts
    2,690
    For starters, could you provide us with Player.cpp?

    This would further allow us to immediately start looking for the issue.

    - Take note that I have no idea where this is defined and I'm just basing it off of your suggestion to it being in Player.cpp

  3. #3
    Quote Originally Posted by OMGhixD View Post
    For starters, could you provide us with Player.cpp?

    This would further allow us to immediately start looking for the issue.

    - Take note that I have no idea where this is defined and I'm just basing it off of your suggestion to it being in Player.cpp
    https://pastebin.ubuntu.com/p/nNVFY5qGJD/ - Here you are.

  4. #4
    Code:
                if (spellData.SpellPPMRate)
                {
                    uint32 WeaponSpeed = GetAttackTime(attType);
                    chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate);
                }
                else if (chance > 100.0f)
                {
                    chance = GetWeaponProcChance();
                }
    need definitions of these 2 functions

  5. #5
    Quote Originally Posted by Ckabot View Post
    Code:
                if (spellData.SpellPPMRate)
                {
                    uint32 WeaponSpeed = GetAttackTime(attType);
                    chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate);
                }
                else if (chance > 100.0f)
                {
                    chance = GetWeaponProcChance();
                }
    need definitions of these 2 functions
    PHP Code:
    float Unit::GetWeaponProcChance() const
    {
        
    // normalized proc chance for weapon attack speed
        // (odd formula...)
        
    if (isAttackReady(BASE_ATTACK))
            return (
    GetAttackTime(BASE_ATTACK) * 1.8f 1000.0f);
        else if (
    haveOffhandWeapon() && isAttackReady(OFF_ATTACK))
            return (
    GetAttackTime(OFF_ATTACK) * 1.6f 1000.0f);
        return 
    0;
    }

    float Unit::GetPPMProcChance(uint32 WeaponSpeedfloat PPM) const
    {
        
    // proc per minute chance calculation
        
    if (PPM <= 0) return 0.0f;
        
    uint32 result uint32((WeaponSpeed PPM) / 600.0f);   // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
        
    return result;


  6. #6
    Fast calculator: http://cpp.sh/4xjso -> run input weapon speed, and execute.

    (Weapon speed is stored as uint32, so 1000 = 1.00, and 100 = .10 and 300 = .30)

    Formulas look fine.

    Need whole Unit.cpp, have you tried breakpointing to see what GetWeaponProcChance returns?

    Maybe isAttackReady(OFF_ATTACK) is returning false

  7. #7
    Quote Originally Posted by Ckabot View Post
    Need whole Unit.cpp
    https://pastebin.ubuntu.com/p/xgQDQZznzJ/

  8. #8
    Player.cpp

    try to remove

    Code:
                        // prevent base and off attack in same time, delay attack at 0.2 sec
                        if (haveOffhandWeapon())
                        {
                            uint32 off_att = getAttackTimer(OFF_ATTACK);
                            if (off_att < ATTACK_DISPLAY_DELAY)
                                setAttackTimer(OFF_ATTACK,ATTACK_DISPLAY_DELAY);
                        }
    and
    Code:
                        // prevent base and off attack in same time, delay attack at 0.2 sec
                        uint32 base_att = getAttackTimer(BASE_ATTACK);
                        if (base_att < ATTACK_DISPLAY_DELAY)
                            setAttackTimer(BASE_ATTACK,ATTACK_DISPLAY_DELAY);
    You should breakpoint Player::CastItemCombatSpell with condition attType == OFF_ATTACK and see where it fails

  9. #9
    I compared files with CMaNGOS and TrinityCore 3.3.5 & 2.4.3, all the formulas and codes for off-hand are the same as mine. Do I have to add any custom weapon in DBC? I know it is necessary on 3.3.5, but dunno for 2.4.3.

    PS: I found something new. When I attack off-hand only, the animation is like attacking without any weapons. The main hand and the off hand have the same statistics, attack speed and damage, but when I attack with main-hand only, the damage is like 3,000 normal and 6,000-8,000 on critical, with off hand only the damage is 1,500 normal and 3,000 critical. That's exactly how much I'm hitting without any weapons (hands only). Looks like off-hand doesn't exist at all.
    Last edited by Kepo; 05-02-2019 at 04:24 PM.

  10. #10

  11. #11

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    bump
    Last edited by Kepo; 05-26-2019 at 11:45 AM.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •