diff --git a/zone/client.h b/zone/client.h index b26987eec..319fbd34a 100644 --- a/zone/client.h +++ b/zone/client.h @@ -868,10 +868,12 @@ public: void SetKnockBackExemption(bool v); void SetPortExemption(bool v); void SetSenseExemption(bool v) { m_SenseExemption = v; } + void SetAssistExemption(bool v) { m_AssistExemption = v; } const bool IsShadowStepExempted() const { return m_ShadowStepExemption; } const bool IsKnockBackExempted() const { return m_KnockBackExemption; } const bool IsPortExempted() const { return m_PortExemption; } const bool IsSenseExempted() const { return m_SenseExemption; } + const bool IsAssistExempted() const { return m_AssistExemption; } const bool GetGMSpeed() const { return (gmspeed > 0); } void CheatDetected(CheatTypes CheatType, float x, float y, float z); const bool IsMQExemptedArea(uint32 zoneID, float x, float y, float z) const; @@ -1449,6 +1451,7 @@ private: bool m_KnockBackExemption; bool m_PortExemption; bool m_SenseExemption; + bool m_AssistExemption; bool alternate_currency_loaded; std::map alternate_currency; std::queue> alternate_currency_queued_operations; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 6d8715c0c..9f5c1d06b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1554,6 +1554,12 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) SetSenseExemption(false); return; } + else if(IsAssistExempted()) + { + GetTarget()->IsTargeted(1); + SetAssistExemption(false); + return; + } else if(GetBindSightTarget()) { if(GetBindSightTarget()->DistNoRoot(*GetTarget()) > (zone->newzone_data.maxclip*zone->newzone_data.maxclip)) @@ -2747,21 +2753,15 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) EQApplicationPacket* outapp = app->Copy(); eid = (EntityId_Struct*)outapp->pBuffer; - if (RuleB(Combat, AssistNoTargetSelf)) eid->entity_id = GetID(); - if(entity && entity->IsMob()) - { + if (RuleB(Combat, AssistNoTargetSelf)) + eid->entity_id = GetID(); + if (entity && entity->IsMob()) { Mob *assistee = entity->CastToMob(); - if(!assistee->IsInvisible(this) && assistee->GetTarget()) - { + if (assistee->GetTarget()) { Mob *new_target = assistee->GetTarget(); - if - ( - new_target && - !new_target->IsInvisible(this) && - (GetGM() || (Dist(*assistee) <= TARGETING_RANGE && - Dist(*new_target) <= TARGETING_RANGE)) - ) - { + if (new_target && (GetGM() || + Dist(*assistee) <= TARGETING_RANGE)) { + SetAssistExemption(true); eid->entity_id = new_target->GetID(); } }