mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
Merge commit 'origin/master' into 310
This commit is contained in:
commit
c9f5062955
28 changed files with 327 additions and 153 deletions
|
|
@ -181,10 +181,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||
return true;
|
||||
}
|
||||
|
||||
if (getPetType() == HUNTER_PET || (getPetType() == SUMMON_PET && cinfo->type == CREATURE_TYPE_DEMON && owner->getClass() == CLASS_WARLOCK))
|
||||
m_charmInfo->SetPetNumber(pet_number, true);
|
||||
else
|
||||
m_charmInfo->SetPetNumber(pet_number, false);
|
||||
m_charmInfo->SetPetNumber(pet_number, IsPermanentPetFor(owner));
|
||||
|
||||
SetOwnerGUID(owner->GetGUID());
|
||||
SetDisplayId(fields[3].GetUInt32());
|
||||
|
|
@ -1744,6 +1741,27 @@ void Pet::ToggleAutocast(uint32 spellid, bool apply)
|
|||
}
|
||||
}
|
||||
|
||||
bool Pet::IsPermanentPetFor(Player* owner)
|
||||
{
|
||||
switch(getPetType())
|
||||
{
|
||||
case SUMMON_PET:
|
||||
switch(owner->getClass())
|
||||
{
|
||||
case CLASS_WARLOCK:
|
||||
return GetCreatureInfo()->type == CREATURE_TYPE_DEMON;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
case HUNTER_PET:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
|
||||
{
|
||||
SetMapId(map->GetId());
|
||||
|
|
@ -1794,10 +1812,10 @@ void Pet::LearnPetPassives()
|
|||
void Pet::CastPetAuras(bool current)
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if(!owner)
|
||||
if(!owner || owner->GetTypeId()!=TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if(getPetType() != HUNTER_PET && (getPetType() != SUMMON_PET || owner->getClass() != CLASS_WARLOCK))
|
||||
if(!IsPermanentPetFor((Player*)owner))
|
||||
return;
|
||||
|
||||
for(PetAuraSet::const_iterator itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end();)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue