mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 00:01:28 +00:00
[Pets] Fix errors in sync with client of sit/stand (#4245)
* [Pets] Fix errors in sync with client of sit/stand * Forgot bot.h
This commit is contained in:
parent
d6b5a9d343
commit
41c5369c18
@ -4058,7 +4058,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
|||||||
Mob *owner = GetOwner();
|
Mob *owner = GetOwner();
|
||||||
if (owner && owner->IsClient()) {
|
if (owner && owner->IsClient()) {
|
||||||
if (GetPetOrder() == SPO_Sit) {
|
if (GetPetOrder() == SPO_Sit) {
|
||||||
SetPetOrder(SPO_Follow);
|
SetPetOrder(GetPreviousPetOrder());
|
||||||
}
|
}
|
||||||
// fix GUI sit button to be unpressed and stop sitting regen
|
// fix GUI sit button to be unpressed and stop sitting regen
|
||||||
owner->CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0);
|
owner->CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
@ -4088,11 +4088,11 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
|||||||
!pet->IsHeld()
|
!pet->IsHeld()
|
||||||
) {
|
) {
|
||||||
LogAggro("Sending pet [{}] into battle due to attack", pet->GetName());
|
LogAggro("Sending pet [{}] into battle due to attack", pet->GetName());
|
||||||
if (IsClient()) {
|
if (IsClient() && !pet->IsPetStop()) {
|
||||||
// if pet was sitting his new mode is follow
|
// if pet was sitting his new mode is previous setting of
|
||||||
// following after the battle (live verified)
|
// follow or guard after the battle (live verified)
|
||||||
if (pet->GetPetOrder() == SPO_Sit) {
|
if (pet->GetPetOrder() == SPO_Sit) {
|
||||||
pet->SetPetOrder(SPO_Follow);
|
pet->SetPetOrder(pet->GetPreviousPetOrder());
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix GUI sit button to be unpressed and stop sitting regen
|
// fix GUI sit button to be unpressed and stop sitting regen
|
||||||
|
|||||||
@ -893,7 +893,6 @@ private:
|
|||||||
bool m_pulling_flag;
|
bool m_pulling_flag;
|
||||||
bool m_returning_flag;
|
bool m_returning_flag;
|
||||||
bool is_using_item_click;
|
bool is_using_item_click;
|
||||||
eStandingPetOrder m_previous_pet_order;
|
|
||||||
uint32 m_bot_caster_range;
|
uint32 m_bot_caster_range;
|
||||||
BotCastingRoles m_CastingRoles;
|
BotCastingRoles m_CastingRoles;
|
||||||
|
|
||||||
|
|||||||
@ -11034,7 +11034,10 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// fix GUI sit button to be unpressed and stop sitting regen
|
// fix GUI sit button to be unpressed and stop sitting regen
|
||||||
SetPetCommandState(PET_BUTTON_SIT, 0);
|
SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
mypet->SetAppearance(eaStanding);
|
if (mypet->GetPetOrder() == SPO_Sit || mypet->GetPetOrder() == SPO_FeignDeath) {
|
||||||
|
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
|
||||||
|
mypet->SetAppearance(eaStanding);
|
||||||
|
}
|
||||||
|
|
||||||
zone->AddAggroMob();
|
zone->AddAggroMob();
|
||||||
// classic acts like qattack
|
// classic acts like qattack
|
||||||
@ -11081,7 +11084,10 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// fix GUI sit button to be unpressed and stop sitting regen
|
// fix GUI sit button to be unpressed and stop sitting regen
|
||||||
SetPetCommandState(PET_BUTTON_SIT, 0);
|
SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
mypet->SetAppearance(eaStanding);
|
if (mypet->GetPetOrder() == SPO_Sit || mypet->GetPetOrder() == SPO_FeignDeath) {
|
||||||
|
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
|
||||||
|
mypet->SetAppearance(eaStanding);
|
||||||
|
}
|
||||||
|
|
||||||
zone->AddAggroMob();
|
zone->AddAggroMob();
|
||||||
mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true);
|
mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true);
|
||||||
@ -11147,7 +11153,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
// Set Sit button to unpressed - send stand anim/end hpregen
|
// Set Sit button to unpressed - send stand anim/end hpregen
|
||||||
mypet->SetFeigned(false);
|
mypet->SetFeigned(false);
|
||||||
SetPetCommandState(PET_BUTTON_SIT, 0);
|
SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
|
mypet->SetAppearance(eaStanding);
|
||||||
|
|
||||||
mypet->SayString(this, Chat::PetResponse, PET_GUARDINGLIFE);
|
mypet->SayString(this, Chat::PetResponse, PET_GUARDINGLIFE);
|
||||||
mypet->SetPetOrder(SPO_Guard);
|
mypet->SetPetOrder(SPO_Guard);
|
||||||
@ -11172,7 +11178,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// fix GUI sit button to be unpressed - send stand anim/end hpregen
|
// fix GUI sit button to be unpressed - send stand anim/end hpregen
|
||||||
SetPetCommandState(PET_BUTTON_SIT, 0);
|
SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
|
mypet->SetAppearance(eaStanding);
|
||||||
|
|
||||||
if (mypet->IsPetStop()) {
|
if (mypet->IsPetStop()) {
|
||||||
mypet->SetPetStop(false);
|
mypet->SetPetStop(false);
|
||||||
@ -11220,7 +11226,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
// Set Sit button to unpressed - send stand anim/end hpregen
|
// Set Sit button to unpressed - send stand anim/end hpregen
|
||||||
SetPetCommandState(PET_BUTTON_SIT, 0);
|
SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
|
mypet->SetAppearance(eaStanding);
|
||||||
|
|
||||||
if (mypet->IsPetStop()) {
|
if (mypet->IsPetStop()) {
|
||||||
mypet->SetPetStop(false);
|
mypet->SetPetStop(false);
|
||||||
@ -11237,8 +11243,8 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
{
|
{
|
||||||
mypet->SetFeigned(false);
|
mypet->SetFeigned(false);
|
||||||
mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING);
|
mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING);
|
||||||
mypet->SetPetOrder(SPO_Follow);
|
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
|
mypet->SetAppearance(eaStanding);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -11248,7 +11254,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
mypet->SetRunAnimSpeed(0);
|
mypet->SetRunAnimSpeed(0);
|
||||||
if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet
|
if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet
|
||||||
mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting
|
mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Sitting);
|
mypet->SetAppearance(eaSitting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -11260,8 +11266,8 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
mypet->SetFeigned(false);
|
mypet->SetFeigned(false);
|
||||||
mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING);
|
mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING);
|
||||||
SetPetCommandState(PET_BUTTON_SIT, 0);
|
SetPetCommandState(PET_BUTTON_SIT, 0);
|
||||||
mypet->SetPetOrder(SPO_Follow);
|
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
|
mypet->SetAppearance(eaStanding);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -11276,7 +11282,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
mypet->SetRunAnimSpeed(0);
|
mypet->SetRunAnimSpeed(0);
|
||||||
if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet
|
if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet
|
||||||
mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting
|
mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Sitting);
|
mypet->SetAppearance(eaSitting);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -11481,7 +11487,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
|||||||
mypet->SetPetOrder(SPO_FeignDeath);
|
mypet->SetPetOrder(SPO_FeignDeath);
|
||||||
mypet->SetRunAnimSpeed(0);
|
mypet->SetRunAnimSpeed(0);
|
||||||
mypet->StopNavigation();
|
mypet->StopNavigation();
|
||||||
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Lying);
|
mypet->SetAppearance(eaDead);
|
||||||
mypet->SetFeigned(true);
|
mypet->SetFeigned(true);
|
||||||
mypet->SetTarget(nullptr);
|
mypet->SetTarget(nullptr);
|
||||||
if (!mypet->UseBardSpellLogic()) {
|
if (!mypet->UseBardSpellLogic()) {
|
||||||
|
|||||||
11
zone/mob.cpp
11
zone/mob.cpp
@ -442,6 +442,7 @@ Mob::Mob(
|
|||||||
weaponstance.aabonus_buff_spell_id = 0;
|
weaponstance.aabonus_buff_spell_id = 0;
|
||||||
|
|
||||||
pStandingPetOrder = SPO_Follow;
|
pStandingPetOrder = SPO_Follow;
|
||||||
|
m_previous_pet_order = SPO_Follow;
|
||||||
pseudo_rooted = false;
|
pseudo_rooted = false;
|
||||||
|
|
||||||
nobuff_invisible = 0;
|
nobuff_invisible = 0;
|
||||||
@ -635,6 +636,16 @@ void Mob::CalcInvisibleLevel()
|
|||||||
BreakCharmPetIfConditionsMet();
|
BreakCharmPetIfConditionsMet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mob::SetPetOrder(eStandingPetOrder i) {
|
||||||
|
if (i == SPO_Sit || i == SPO_FeignDeath) {
|
||||||
|
if (pStandingPetOrder == SPO_Follow || pStandingPetOrder == SPO_Guard) {
|
||||||
|
m_previous_pet_order = pStandingPetOrder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pStandingPetOrder = i;
|
||||||
|
}
|
||||||
|
|
||||||
void Mob::SetInvisible(uint8 state, bool set_on_bonus_calc) {
|
void Mob::SetInvisible(uint8 state, bool set_on_bonus_calc) {
|
||||||
if (state == Invisibility::Visible) {
|
if (state == Invisibility::Visible) {
|
||||||
SendAppearancePacket(AppearanceType::Invisibility, Invisibility::Visible);
|
SendAppearancePacket(AppearanceType::Invisibility, Invisibility::Visible);
|
||||||
|
|||||||
@ -589,6 +589,7 @@ public:
|
|||||||
inline const char* GetName() const { return name; }
|
inline const char* GetName() const { return name; }
|
||||||
inline const char* GetOrigName() const { return orig_name; }
|
inline const char* GetOrigName() const { return orig_name; }
|
||||||
inline const char* GetLastName() const { return lastname; }
|
inline const char* GetLastName() const { return lastname; }
|
||||||
|
inline const eStandingPetOrder GetPreviousPetOrder() const { return m_previous_pet_order; }
|
||||||
const char *GetCleanName();
|
const char *GetCleanName();
|
||||||
virtual void SetName(const char *new_name = nullptr) { new_name ? strn0cpy(name, new_name, 64) :
|
virtual void SetName(const char *new_name = nullptr) { new_name ? strn0cpy(name, new_name, 64) :
|
||||||
strn0cpy(name, GetName(), 64); return; };
|
strn0cpy(name, GetName(), 64); return; };
|
||||||
@ -1179,7 +1180,7 @@ public:
|
|||||||
inline const float GetAssistRange() const { return (spellbonuses.AssistRange == -1) ? pAssistRange : spellbonuses.AssistRange; }
|
inline const float GetAssistRange() const { return (spellbonuses.AssistRange == -1) ? pAssistRange : spellbonuses.AssistRange; }
|
||||||
|
|
||||||
|
|
||||||
inline void SetPetOrder(eStandingPetOrder i) { pStandingPetOrder = i; }
|
void SetPetOrder(eStandingPetOrder i);
|
||||||
inline const eStandingPetOrder GetPetOrder() const { return pStandingPetOrder; }
|
inline const eStandingPetOrder GetPetOrder() const { return pStandingPetOrder; }
|
||||||
inline void SetHeld(bool nState) { held = nState; }
|
inline void SetHeld(bool nState) { held = nState; }
|
||||||
inline const bool IsHeld() const { return held; }
|
inline const bool IsHeld() const { return held; }
|
||||||
@ -1773,6 +1774,7 @@ protected:
|
|||||||
|
|
||||||
// MobAI stuff
|
// MobAI stuff
|
||||||
eStandingPetOrder pStandingPetOrder;
|
eStandingPetOrder pStandingPetOrder;
|
||||||
|
eStandingPetOrder m_previous_pet_order;
|
||||||
uint32 minLastFightingDelayMoving;
|
uint32 minLastFightingDelayMoving;
|
||||||
uint32 maxLastFightingDelayMoving;
|
uint32 maxLastFightingDelayMoving;
|
||||||
float pAggroRange = 0;
|
float pAggroRange = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user