Jump to content
  • Hunter pets don’t have the correct attack speed values


    cabfever
    • Status: Awaiting Feedback
      Main Category: Core / Mangos Daemon
      Sub-Category: Pet
      Version: 22.1 Milestone: 22 Priority: Normal
      Implemented Version: Unset

    Hunter pets don’t have the correct attack speed values

    For example cats should have higher attack speed but every beast has 2.0 once they’re tamed. I noticed this when I tamed Broken Tooth (which is a rare spawn) who should have 1.00 attack speed.


    User Feedback

    Recommended Comments

    Implementation. Note - The speeds have to be adjusted in Database to match the Pet attack speeds:

    http://www.wow-petopia.com/classic/attackspeed.php

    diff --git a/src/game/Object/Pet.cpp b/src/game/Object/Pet.cpp
    index 7ec1822..37ac5d9 100644
    --- a/src/game/Object/Pet.cpp
    +++ b/src/game/Object/Pet.cpp
    @@ -1092,9 +1092,30 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
     
         SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(petlevel * 50));
     
    -    SetAttackTime(BASE_ATTACK, cinfo->MeleeBaseAttackTime);
    -    SetAttackTime(OFF_ATTACK, cinfo->MeleeBaseAttackTime);
    -    SetAttackTime(RANGED_ATTACK, cinfo->RangedBaseAttackTime);
    +	CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(creature_ID);
    +	if (creatureInfo)
    +	{
    +		if (creatureInfo->MeleeBaseAttackTime > 0)
    +			SetAttackTime(BASE_ATTACK, creatureInfo->MeleeBaseAttackTime);
    +		else
    +			SetAttackTime(BASE_ATTACK, BASE_ATTACK_TIME);
    +
    +		if (creatureInfo->MeleeBaseAttackTime > 0)
    +			SetAttackTime(OFF_ATTACK, creatureInfo->MeleeBaseAttackTime);
    +		else
    +			SetAttackTime(OFF_ATTACK, BASE_ATTACK_TIME);
    +
    +		if (creatureInfo->RangedBaseAttackTime > 0)
    +			SetAttackTime(RANGED_ATTACK, creatureInfo->RangedBaseAttackTime);
    +		else
    +			SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
    +	}
    +	else
    +	{
    +		SetAttackTime(BASE_ATTACK, BASE_ATTACK_TIME);
    +		SetAttackTime(OFF_ATTACK, BASE_ATTACK_TIME);
    +		SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME);
    +	}
     
         SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0);
     
    

     

    Edited by Langerz82
    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • 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