Implemented spells_new field 198 = no_detrimental_spell_aggro

Spells with this flag will not generate any aggro
Note: DOT portions of spells wilth this flag STILL generate aggro.
Example Harminous Arrow (Ranger AA) 16127
This commit is contained in:
KayenEQ
2015-10-08 16:05:14 -04:00
parent c35eacbc99
commit 20bdbdd52d
7 changed files with 31 additions and 14 deletions
+8 -5
View File
@@ -2410,7 +2410,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack
return true;
}
void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/)
void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, bool iYellForHelp /*= true*/, bool bFrenzy /*= false*/, bool iBuffTic /*= false*/, uint16 spell_id)
{
if(!other)
return;
@@ -2466,6 +2466,9 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
if(IsFamiliar() || GetSpecialAbility(IMMUNE_AGGRO))
return;
if (spell_id != SPELL_UNKNOWN && NoDetrimentalSpellAggro(spell_id))
return;
if (other == myowner)
return;
@@ -3139,15 +3142,15 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
if(!RuleB(Combat, EXPFromDmgShield)) {
// Damage shield damage shouldn't count towards who gets EXP
if(!attacker->CastToClient()->GetFeigned() && !FromDamageShield)
AddToHateList(attacker, 0, damage, true, false, iBuffTic);
AddToHateList(attacker, 0, damage, true, false, iBuffTic, spell_id);
}
else {
if(!attacker->CastToClient()->GetFeigned())
AddToHateList(attacker, 0, damage, true, false, iBuffTic);
AddToHateList(attacker, 0, damage, true, false, iBuffTic, spell_id);
}
}
else
AddToHateList(attacker, 0, damage, true, false, iBuffTic);
AddToHateList(attacker, 0, damage, true, false, iBuffTic, spell_id);
}
if(damage > 0) {
@@ -3172,7 +3175,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
{
if (!pet->IsHeld()) {
Log.Out(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName());
pet->AddToHateList(attacker, 1);
pet->AddToHateList(attacker, 1,0, true, false, false, spell_id);
pet->SetTarget(attacker);
Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName());
}