mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[9077] Fixes for pet work in case mounted owner.
* No unsummon temporary pet at non-fly mounting. * Implement client side disable pet's action bar for mountted owner time Signed-off-by: VladimirMangos <vladimir@getmangos.com> * implement server side action disabled case (action bar modify, aggro reaction and autocast) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
7d0a830bd4
commit
9c98bd92e2
10 changed files with 112 additions and 19 deletions
|
|
@ -8382,6 +8382,9 @@ void Unit::SetPet(Pet* pet)
|
|||
{
|
||||
SetPetGUID(pet ? pet->GetGUID() : 0);
|
||||
|
||||
if(pet && GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->SendPetGUIDs();
|
||||
|
||||
// FIXME: hack, speed must be set only at follow
|
||||
if(pet && GetTypeId()==TYPEID_PLAYER)
|
||||
for(int i = 0; i < MAX_MOVE_TYPE; ++i)
|
||||
|
|
@ -9866,9 +9869,9 @@ float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM) const
|
|||
return WeaponSpeed * PPM / 600.0f; // result is chance in percents (probability = Speed_in_sec * (PPM / 60))
|
||||
}
|
||||
|
||||
void Unit::Mount(uint32 mount)
|
||||
void Unit::Mount(uint32 mount, uint32 spellId)
|
||||
{
|
||||
if(!mount)
|
||||
if (!mount)
|
||||
return;
|
||||
|
||||
RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MOUNTING);
|
||||
|
|
@ -9877,9 +9880,27 @@ void Unit::Mount(uint32 mount)
|
|||
|
||||
SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT );
|
||||
|
||||
// unsummon pet
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->UnsummonPetTemporaryIfAny();
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
// Called by Taxi system / GM command
|
||||
if (!spellId)
|
||||
((Player*)this)->UnsummonPetTemporaryIfAny();
|
||||
// Called by mount aura
|
||||
else if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId))
|
||||
{
|
||||
// Flying case (Unsummon any pet)
|
||||
if (IsSpellHaveAura(spellInfo, SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED))
|
||||
((Player*)this)->UnsummonPetTemporaryIfAny();
|
||||
// Normal case (Unsummon only permanent pet)
|
||||
else if (Pet* pet = GetPet())
|
||||
{
|
||||
if (pet->IsPermanentPetFor((Player*)this))
|
||||
((Player*)this)->UnsummonPetTemporaryIfAny();
|
||||
else
|
||||
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::Unmount()
|
||||
|
|
@ -9896,7 +9917,12 @@ void Unit::Unmount()
|
|||
// this prevents adding a pet to a not created map which would otherwise cause a crash
|
||||
// (it could probably happen when logging in after a previous crash)
|
||||
if(GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
|
||||
{
|
||||
if(Pet* pet = GetPet())
|
||||
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS,false);
|
||||
else
|
||||
((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::SetInCombatWith(Unit* enemy)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue