mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[6948] Fixed unattackable NPC summoned pets.
Not set player's pet only UNIT_FLAG_PVP_ATTACKABLE flag for creature's pets. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
3488c1fee3
commit
82c94b4101
4 changed files with 9 additions and 4 deletions
|
|
@ -764,7 +764,6 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
||||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
||||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(creature->getLevel()))/4));
|
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32((MaNGOS::XP::xp_to_level(creature->getLevel()))/4));
|
||||||
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
|
||||||
SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
||||||
|
|
||||||
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family);
|
CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(creature->GetCreatureInfo()->family);
|
||||||
|
|
|
||||||
|
|
@ -4184,6 +4184,7 @@ void Spell::EffectSummonPet(uint32 i)
|
||||||
// this enables pet details window (Shift+P)
|
// this enables pet details window (Shift+P)
|
||||||
|
|
||||||
// this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
|
// this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
|
||||||
|
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
|
NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
|
|
||||||
NewSummon->InitStatsForLevel(petlevel);
|
NewSummon->InitStatsForLevel(petlevel);
|
||||||
|
|
@ -5411,6 +5412,8 @@ void Spell::EffectSummonTotem(uint32 i)
|
||||||
}
|
}
|
||||||
|
|
||||||
pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id);
|
pTotem->SetUInt32Value(UNIT_CREATED_BY_SPELL,m_spellInfo->Id);
|
||||||
|
|
||||||
|
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
|
pTotem->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
|
|
||||||
pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_MOD_FEAR,true);
|
pTotem->ApplySpellImmune(m_spellInfo->Id,IMMUNITY_STATE,SPELL_AURA_MOD_FEAR,true);
|
||||||
|
|
|
||||||
|
|
@ -10838,6 +10838,9 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
|
||||||
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
|
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
|
||||||
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
|
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
|
||||||
|
|
||||||
|
if(GetTypeId()==TYPEID_PLAYER)
|
||||||
|
pet->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
|
|
||||||
uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
|
uint32 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
|
||||||
pet->SetFreeTalentPoints(pet->GetMaxTalentPointsForLevel(level));
|
pet->SetFreeTalentPoints(pet->GetMaxTalentPointsForLevel(level));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6947"
|
#define REVISION_NR "6948"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue