Open Non-hunter classes learn to tame beasts

may28js

Member
may28js Rep
0
0
0
Rep
0
may28js Vouches
0
0
0
Vouches
0
Posts
13
Likes
0
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 80 XP
For the past few days, I have been trying to figure out why non-hunter occupations cannot tame beasts after learning the "Taming Beast" spell, but unfortunately I can't find the reason.
So, I would like to ask you great masters, what needs to be done to allow non-hunter classes to tame wild beasts, and core modifications are required? Or just modify the spell, or something else? Looking forward to your reply. Thanks in advance!
 

may28js

Member
may28js Rep
0
0
0
Rep
0
may28js Vouches
0
0
0
Vouches
0
Posts
13
Likes
0
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 80 XP
Maybe my question is too broad, so I'll add:
I use acore (3.3.5) + ARAC module;
Currently ARAC is running normally;

I really want to figure this out, please help me!
 

Tommy

Staff
Staff
Tommy Rep
1
0
0
Rep
1
Tommy Vouches
0
0
0
Vouches
0
Posts
185
Likes
101
2 YEARS
2 YEARS OF SERVICE
LEVEL 6 310 XP
It's been years, but within the core you'll have to look for CLASS_HUNTER checks and allow more classes to have a pet. There's different types: Summon or Pet. The files you should look into are Pet.cpp and Player.cpp.

Pet.cpp -> InitStatsForLevel (this is a very important method)
1680495082820.png

Player.cpp
1680495101485.png

There might be more than that. As I mentioned just search for CLASS_HUNTER checks and set other classes to allow pets, resummon, init, etc.
 
Liked By 1 member :

may28js

Member
may28js Rep
0
0
0
Rep
0
may28js Vouches
0
0
0
Vouches
0
Posts
13
Likes
0
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 80 XP
It's been years, but within the core you'll have to look for CLASS_HUNTER checks and allow more classes to have a pet. There's different types: Summon or Pet. The files you should look into are Pet.cpp and Player.cpp.

Pet.cpp -> InitStatsForLevel (this is a very important method)
View attachment 914

Player.cpp
View attachment 915

There might be more than that. As I mentioned just search for CLASS_HUNTER checks and set other classes to allow pets, resummon, init, etc.
Thank you so much! I will test it right away.
 

may28js

Member
may28js Rep
0
0
0
Rep
0
may28js Vouches
0
0
0
Vouches
0
Posts
13
Likes
0
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 80 XP
In addition, I would like to add a question: After non-hunters learn shooting spells, such as Arcane Shot and Auto Shot, characters can cast spells, but the animation of the spells is wrong. What needs to be modified?
 

may28js

Member
may28js Rep
0
0
0
Rep
0
may28js Vouches
0
0
0
Vouches
0
Posts
13
Likes
0
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 80 XP
Code:
void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/)
{
    if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
        return;


    if (m_caster->GetPetGUID())
        return;


    if (!unitTarget)
        return;


    if (unitTarget->GetTypeId() != TYPEID_UNIT)
        return;


    Creature* creatureTarget = unitTarget->ToCreature();


    if (creatureTarget->IsPet())
        return;


    if (m_caster->getClass() != CLASS_HUNTER)
        return;


    // cast finish successfully
    //SendChannelUpdate(0);
    finish();


    Pet* pet = m_caster->CreateTamedPetFrom(creatureTarget, m_spellInfo->Id);
    if (!pet)                                               // in very specific state like near world end/etc.
        return;


    // "kill" original creature
    creatureTarget->DespawnOrUnsummon();


    uint8 level = (creatureTarget->GetLevel() < (m_caster->GetLevel() - 5)) ? (m_caster->GetLevel() - 5) : creatureTarget->GetLevel();


    // prepare visual effect for levelup
    pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);


    // add to world
    pet->GetMap()->AddToMap(pet->ToCreature(), true);


    // visual effect for levelup
    pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);


    // caster have pet now
    m_caster->SetMinion(pet, true);


    pet->InitTalentForLevel();


    if (m_caster->GetTypeId() == TYPEID_PLAYER)
    {
        pet->SavePetToDB(PET_SAVE_AS_CURRENT);
        m_caster->ToPlayer()->PetSpellInitialize();
    }
}

SpellEffects.cpp < This file also seems to need modification
 

Tommy

Staff
Staff
Tommy Rep
1
0
0
Rep
1
Tommy Vouches
0
0
0
Vouches
0
Posts
185
Likes
101
2 YEARS
2 YEARS OF SERVICE
LEVEL 6 310 XP
In addition, I would like to add a question: After non-hunters learn shooting spells, such as Arcane Shot and Auto Shot, characters can cast spells, but the animation of the spells is wrong. What needs to be modified?
That, I'm not sure about. It could be a client thing, honestly. Since 3.3.5 was before the big race hunter update Blizzard did, but races do have their animations of shooting so that's a bit weird. All I can think of is it's the spells itself client-side?

Code:
void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/)
{
    if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
        return;


    if (m_caster->GetPetGUID())
        return;


    if (!unitTarget)
        return;


    if (unitTarget->GetTypeId() != TYPEID_UNIT)
        return;


    Creature* creatureTarget = unitTarget->ToCreature();


    if (creatureTarget->IsPet())
        return;


    if (m_caster->getClass() != CLASS_HUNTER)
        return;


    // cast finish successfully
    //SendChannelUpdate(0);
    finish();


    Pet* pet = m_caster->CreateTamedPetFrom(creatureTarget, m_spellInfo->Id);
    if (!pet)                                               // in very specific state like near world end/etc.
        return;


    // "kill" original creature
    creatureTarget->DespawnOrUnsummon();


    uint8 level = (creatureTarget->GetLevel() < (m_caster->GetLevel() - 5)) ? (m_caster->GetLevel() - 5) : creatureTarget->GetLevel();


    // prepare visual effect for levelup
    pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);


    // add to world
    pet->GetMap()->AddToMap(pet->ToCreature(), true);


    // visual effect for levelup
    pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);


    // caster have pet now
    m_caster->SetMinion(pet, true);


    pet->InitTalentForLevel();


    if (m_caster->GetTypeId() == TYPEID_PLAYER)
    {
        pet->SavePetToDB(PET_SAVE_AS_CURRENT);
        m_caster->ToPlayer()->PetSpellInitialize();
    }
}

SpellEffects.cpp < This file also seems to need modification
Yup, that's one too! Easy peasy.
 
Liked By 1 member :

may28js

Member
may28js Rep
0
0
0
Rep
0
may28js Vouches
0
0
0
Vouches
0
Posts
13
Likes
0
Bits
2 YEARS
2 YEARS OF SERVICE
LEVEL 1 80 XP
That, I'm not sure about. It could be a client thing, honestly. Since 3.3.5 was before the big race hunter update Blizzard did, but races do have their animations of shooting so that's a bit weird. All I can think of is it's the spells itself client-side?
I'm using the ARAC module, select the human hunter and its shooting animation is normal.
 

3,392

1,271

9,555

428

Top