Pretty sure I know why this is happening. Decided since PEQ was down for 2 days I might as well dab with the code a little. In the following section of code from zone/attack.cpp
Inside Mob:CommonDamage method
Code:
if(damage > 0) {
//if there is some damage being done and theres an attacker involved
if(attacker) {
if(spell_id == SPELL_HARM_TOUCH2 && attacker->IsClient() && attacker->CastToClient()->CheckAAEffect(aaEffectLeechTouch)){
int healed = damage;
healed = attacker->GetActSpellHealing(spell_id, healed);
attacker->HealDamage(healed);
entity_list.MessageClose(this, true, 300, MT_Emote, "%s beams a smile at %s", attacker->GetCleanName(), this->GetCleanName() );
attacker->CastToClient()->DisableAAEffect(aaEffectLeechTouch);
}
// if spell is lifetap add hp to the caster
if (spell_id != SPELL_UNKNOWN && IsLifetapSpell( spell_id )) {
int healed = damage;
healed = attacker->GetActSpellHealing(spell_id, healed);
mlog(COMBAT__DAMAGE, "Applying lifetap heal of %d to %s", healed, attacker->GetName());
attacker->HealDamage(healed);
//we used to do a message to the client, but its gone now.
// emote goes with every one ... even npcs
entity_list.MessageClose(this, true, 300, MT_Emote, "%s beams a smile at %s", attacker->GetCleanName(), this->GetCleanName() );
}
// if we got a pet, thats not already fighting something send it into battle
Mob *pet = GetPet();
if (pet && !pet->IsFamiliar() && !pet->SpecAttacks[IMMUNE_AGGRO] && !pet->IsEngaged() && attacker != this)
{
mlog(PETS__AGGRO, "Sending pet %s into battle due to attack.", pet->GetName());
pet->AddToHateList(attacker, 1);
pet->SetTarget(attacker);
Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
}
You will notice that the last part dealing with pet aggro is nested inside this if (damage > 0) if statement. Now the weird thing is even though this is suppose to be when a mob takes damage the client method makes a call to this. Essentially this method is being used for both when a player is hit and a mob is hit.
Moving the pet code outside above this if statement should solve the issue as I am pretty sure this method gets called regardless if its a miss or hit. If it doesn't fully fix it it will at least make the pet respond to more things then you actually taking a hit and we just have to trace farther backwards. I haven't had a chance to fully trace the code, frankly some of the commenting on these methods are weird or missing.
I havn't actually set up a server yet to test it so perhaps one of you can.