mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Use PetCommands SPA instead of GetAA
This commit is contained in:
+28
-30
@@ -9978,9 +9978,6 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
if (mypet->GetPetType() == petTargetLock && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST))
|
||||
return;
|
||||
|
||||
if (mypet->GetPetType() == petAnimation && (pet->command != PET_HEALTHREPORT && pet->command != PET_GETLOST) && !GetAA(aaAnimationEmpathy))
|
||||
return;
|
||||
|
||||
// just let the command "/pet get lost" work for familiars
|
||||
if (mypet->GetPetType() == petFamiliar && pet->command != PET_GETLOST)
|
||||
return;
|
||||
@@ -10014,7 +10011,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 2) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
if (target != this && DistanceSquaredNoZ(mypet->GetPosition(), target->GetPosition()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) {
|
||||
zone->AddAggroMob();
|
||||
// classic acts like qattack
|
||||
@@ -10047,7 +10044,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 2) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
if (GetTarget() != this && DistanceSquaredNoZ(mypet->GetPosition(), GetTarget()->GetPosition()) <= (RuleR(Pets, AttackCommandRange)*RuleR(Pets, AttackCommandRange))) {
|
||||
zone->AddAggroMob();
|
||||
mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true);
|
||||
@@ -10059,7 +10056,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_BACKOFF: {
|
||||
if (mypet->IsFeared()) break; //keeps pet running while feared
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_CALMING);
|
||||
mypet->WipeHateList();
|
||||
mypet->SetTarget(nullptr);
|
||||
@@ -10067,9 +10064,10 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_HEALTHREPORT: {
|
||||
Message_StringID(MT_PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1));
|
||||
mypet->ShowBuffList(this);
|
||||
//Message(10,"%s tells you, 'I have %d percent of my hit points left.'",mypet->GetName(),(uint8)mypet->GetHPRatio());
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
Message_StringID(MT_PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1));
|
||||
mypet->ShowBuffList(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PET_GETLOST: {
|
||||
@@ -10102,7 +10100,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_GUARDHERE: {
|
||||
if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 1) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
if (mypet->IsNPC()) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_GUARDINGLIFE);
|
||||
mypet->SetPetOrder(SPO_Guard);
|
||||
@@ -10114,7 +10112,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_FOLLOWME: {
|
||||
if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 1) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_FOLLOWING);
|
||||
mypet->SetPetOrder(SPO_Follow);
|
||||
mypet->SendAppearancePacket(AT_Anim, ANIM_STAND);
|
||||
@@ -10122,7 +10120,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_TAUNT: {
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
if (mypet->CastToNPC()->IsTaunting())
|
||||
{
|
||||
Message_StringID(MT_PetResponse, PET_NO_TAUNT);
|
||||
@@ -10137,14 +10135,14 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_TAUNT_ON: {
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
Message_StringID(MT_PetResponse, PET_DO_TAUNT);
|
||||
mypet->CastToNPC()->SetTaunting(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PET_TAUNT_OFF: {
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
Message_StringID(MT_PetResponse, PET_NO_TAUNT);
|
||||
mypet->CastToNPC()->SetTaunting(false);
|
||||
}
|
||||
@@ -10153,7 +10151,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_GUARDME: {
|
||||
if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 1) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_GUARDME_STRING);
|
||||
mypet->SetPetOrder(SPO_Follow);
|
||||
mypet->SendAppearancePacket(AT_Anim, ANIM_STAND);
|
||||
@@ -10163,7 +10161,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_SIT: {
|
||||
if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
if (mypet->GetPetOrder() == SPO_Sit)
|
||||
{
|
||||
mypet->Say_StringID(MT_PetResponse, PET_SIT_STRING);
|
||||
@@ -10185,7 +10183,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_STANDUP: {
|
||||
if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_SIT_STRING);
|
||||
mypet->SetPetOrder(SPO_Follow);
|
||||
mypet->SendAppearancePacket(AT_Anim, ANIM_STAND);
|
||||
@@ -10195,7 +10193,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_SITDOWN: {
|
||||
if (mypet->IsFeared()) break; //could be exploited like PET_BACKOFF
|
||||
|
||||
if ((mypet->GetPetType() == petAnimation && GetAA(aaAnimationEmpathy) >= 3) || mypet->GetPetType() != petAnimation) {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_SIT_STRING);
|
||||
mypet->SetPetOrder(SPO_Sit);
|
||||
mypet->SetRunAnimSpeed(0);
|
||||
@@ -10206,7 +10204,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_HOLD: {
|
||||
if (GetAA(aaPetDiscipline) && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsHeld())
|
||||
{
|
||||
mypet->SetHeld(false);
|
||||
@@ -10222,7 +10220,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_HOLD_ON: {
|
||||
if (GetAA(aaPetDiscipline) && mypet->IsNPC() && !mypet->IsHeld()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && !mypet->IsHeld()) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_ON_HOLD);
|
||||
mypet->SetHeld(true);
|
||||
mypet->SetGHeld(false);
|
||||
@@ -10231,12 +10229,12 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_HOLD_OFF: {
|
||||
if (GetAA(aaPetDiscipline) && mypet->IsNPC() && mypet->IsHeld())
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsHeld())
|
||||
mypet->SetHeld(false);
|
||||
break;
|
||||
}
|
||||
case PET_GHOLD: {
|
||||
if (GetAA(aaPetDiscipline) && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsGHeld())
|
||||
{
|
||||
mypet->SetGHeld(false);
|
||||
@@ -10252,7 +10250,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_GHOLD_ON: {
|
||||
if (GetAA(aaPetDiscipline) && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
mypet->Say_StringID(MT_PetResponse, PET_ON_HOLD);
|
||||
mypet->SetGHeld(true);
|
||||
mypet->SetHeld(false);
|
||||
@@ -10261,12 +10259,12 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_GHOLD_OFF: {
|
||||
if (GetAA(aaPetDiscipline) && mypet->IsNPC() && mypet->IsGHeld())
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC() && mypet->IsGHeld())
|
||||
mypet->SetGHeld(false);
|
||||
break;
|
||||
}
|
||||
case PET_SPELLHOLD: {
|
||||
if (GetAA(aaAdvancedPetDiscipline) == 2 && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsFeared())
|
||||
break;
|
||||
if (mypet->IsNoCast()) {
|
||||
@@ -10281,7 +10279,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_SPELLHOLD_ON: {
|
||||
if (GetAA(aaAdvancedPetDiscipline) == 2 && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsFeared())
|
||||
break;
|
||||
if (!mypet->IsNoCast()) {
|
||||
@@ -10292,7 +10290,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_SPELLHOLD_OFF: {
|
||||
if (GetAA(aaAdvancedPetDiscipline) == 2 && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsFeared())
|
||||
break;
|
||||
if (mypet->IsNoCast()) {
|
||||
@@ -10303,7 +10301,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_FOCUS: {
|
||||
if (GetAA(aaAdvancedPetDiscipline) >= 1 && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsFeared())
|
||||
break;
|
||||
if (mypet->IsFocused()) {
|
||||
@@ -10318,7 +10316,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_FOCUS_ON: {
|
||||
if (GetAA(aaAdvancedPetDiscipline) >= 1 && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsFeared())
|
||||
break;
|
||||
if (!mypet->IsFocused()) {
|
||||
@@ -10329,7 +10327,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
break;
|
||||
}
|
||||
case PET_FOCUS_OFF: {
|
||||
if (GetAA(aaAdvancedPetDiscipline) >= 1 && mypet->IsNPC()) {
|
||||
if (aabonuses.PetCommands[PetCommand] && mypet->IsNPC()) {
|
||||
if (mypet->IsFeared())
|
||||
break;
|
||||
if (mypet->IsFocused()) {
|
||||
|
||||
Reference in New Issue
Block a user