This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SHOWOFF] Infinite Happyness for hunter pets.  (Read 1815 times)

Kian

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 18
    • View Profile
[SHOWOFF] Infinite Happyness for hunter pets.
« on: June 22, 2010, 03:45:23 pm »
Hi guys, I found the Happiness State check when I checked the Arcemu code.

Search for this :

HappinessState Pet::GetHappinessState()
{
   //gets happiness state from happiness points
   uint32 pts = GetUInt32Value( UNIT_FIELD_POWER5 );
   if( pts < PET_HAPPINESS_UPDATE_VALUE )
      return UNHAPPY;
   else if( pts >= PET_HAPPINESS_UPDATE_VALUE << 1 )
      return HAPPY;
   else
      return CONTENT;

and change it to:

HappinessState Pet::GetHappinessState()
{
   //gets happiness state from happiness points
   uint32 pts = GetUInt32Value( UNIT_FIELD_POWER5 );
   if( pts < PET_HAPPINESS_UPDATE_VALUE )
      return HAPPY;
   else if( pts >= PET_HAPPINESS_UPDATE_VALUE << 1 )
      return HAPPY;
   else
      return HAPPY

Then your Hunter pet will be content forever.

Mfg Kian
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [SHOWOFF] Infinite Happyness for hunter pets.
« Reply #1 on: June 25, 2010, 12:40:29 am »
Or do it even nicer and do:

HappinessState Pet::GetHappinessState()
{
- //gets happiness state from happiness points
- uint32 pts = GetUInt32Value( UNIT_FIELD_POWER5 );
- if( pts < PET_HAPPINESS_UPDATE_VALUE )
- return UNHAPPY;
- else if( pts >= PET_HAPPINESS_UPDATE_VALUE << 1 )
- return HAPPY;
- else
- return CONTENT;

+ return HAPPY;
}
« Last Edit: January 01, 1970, 01:00:00 am by Admin »