Skip to content

Commit

Permalink
Implement Tamed pet passives usage
Browse files Browse the repository at this point in the history
Fixes Orc racial Command
  • Loading branch information
killerwife authored and cyberium committed Jan 10, 2017
1 parent 83649d9 commit f52e8a5
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/game/Pet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry /*= 0*/, uint32 petnumber
LearnPetPassives();
CastPetAuras(current);
CastOwnerTalentAuras();
InitTamedPetPassives(owner);

// failsafe check
savedhealth = savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth;
Expand Down Expand Up @@ -2287,3 +2288,53 @@ void Pet::SetModeFlags(PetModeFlags mode)
data << uint32(m_petModeFlags);
((Player*)owner)->GetSession()->SendPacket(data);
}

//Todo: Hack alert, remove this for a better solution when its possible
void Pet::InitTamedPetPassives(Unit* player)
{
switch (player->getClass())
{
case CLASS_HUNTER:
{
// case 13481: Tame Beast
player->CastSpell(this, 8875, TRIGGERED_OLD_TRIGGERED);
break;
}
case CLASS_WARLOCK:
{
switch (GetUInt32Value(UNIT_CREATED_BY_SPELL))
{
case 688: // imp
player->CastSpell(this, 18728, TRIGGERED_OLD_TRIGGERED);
break;
case 691: // felhunter
player->CastSpell(this, 18730, TRIGGERED_OLD_TRIGGERED);
break;
case 697: // voidwalker
player->CastSpell(this, 18727, TRIGGERED_OLD_TRIGGERED);
break;
case 712: // succubus
player->CastSpell(this, 18729, TRIGGERED_OLD_TRIGGERED);
break;
case 30146: // felguard
player->CastSpell(this, 30147, TRIGGERED_OLD_TRIGGERED);
break;
default:
break;
}
break;
}
case CLASS_SHAMAN:
{
player->CastSpell(this, 65221, TRIGGERED_OLD_TRIGGERED);
break;
}
case CLASS_DEATH_KNIGHT:
{
player->CastSpell(this, 65223, TRIGGERED_OLD_TRIGGERED);
break;
}
default:
break;
}
}
2 changes: 2 additions & 0 deletions src/game/Pet.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ class MANGOS_DLL_SPEC Pet : public Creature
virtual CreatureAI* AI() override { if (hasUnitState(UNIT_STAT_CONTROLLED) && m_charmInfo->GetAI()) return m_charmInfo->GetAI(); else return m_ai.get(); }
virtual CombatData* GetCombatData() override { return m_combatData; }

void InitTamedPetPassives(Unit* player);

protected:
uint32 m_happinessTimer;
PetType m_petType;
Expand Down
4 changes: 4 additions & 0 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6705,6 +6705,9 @@ void Spell::EffectTameCreature(SpellEffectIndex /*eff_idx*/)
// this enables pet details window (Shift+P)
pet->InitPetCreateSpells();

// this add special Tamed Pet aura
pet->InitTamedPetPassives(m_caster);

// caster have pet now
plr->SetPet(pet);

Expand Down Expand Up @@ -6778,6 +6781,7 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx)
NewSummon->InitPetCreateSpells();
NewSummon->InitLevelupSpellsForLevel();
NewSummon->InitTalentForLevel();
NewSummon->InitTamedPetPassives(m_caster);

map->Add((Creature*)NewSummon);
NewSummon->AIM_Initialize();
Expand Down

0 comments on commit f52e8a5

Please sign in to comment.