Jump to content
  • Sign in to follow this  

    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 (Next) Priority: Normal
      Related to:
      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.

    Sign in to follow this  


    User Feedback

    Recommended Comments

    Changed Version to 22.1

    Changed Implemented Version to Unset

    Changed Milestone to 22

    Changed Category to Pet

    Share this comment


    Link to comment
    Share on other sites

    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

    Share this comment


    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

Contact Us

To contact us click here
You can also email us at [email protected]

Privacy Policy | Terms & Conditions

Repositories

The Link to the master list
of MaNGOS repositories:
Copyright © getMaNGOS. All rights Reserved.

This website is in no way associated with or endorsed by Blizzard Entertainment®
×