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
+3
View File
@@ -960,6 +960,9 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) {
//offensive spell aggro
int32 Mob::CheckAggroAmount(uint16 spell_id, Mob *target, bool isproc)
{
if (NoDetrimentalSpellAggro(spell_id))
return 0;
int32 AggroAmount = 0;
int32 nonModifiedAggro = 0;
uint16 slevel = GetLevel();
+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());
}
+1 -1
View File
@@ -489,7 +489,7 @@ public:
inline uint32 GetLevelCon(uint8 iOtherLevel) const {
return this ? GetLevelCon(GetLevel(), iOtherLevel) : CON_GREEN; }
virtual void AddToHateList(Mob* other, uint32 hate = 0, int32 damage = 0, bool iYellForHelp = true,
bool bFrenzy = false, bool iBuffTic = false);
bool bFrenzy = false, bool iBuffTic = false, uint16 spell_id = SPELL_UNKNOWN);
bool RemoveFromHateList(Mob* mob);
void SetHateAmountOnEnt(Mob* other, int32 hate = 0, int32 damage = 0) { hate_list.SetHateAmountOnEnt(other,hate,damage);}
void HalveAggro(Mob *other) { uint32 in_hate = GetHateAmount(other); SetHateAmountOnEnt(other, (in_hate > 1 ? in_hate / 2 : 1)); }
+6 -6
View File
@@ -4067,7 +4067,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4094,7 +4094,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4110,7 +4110,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
} else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false))
@@ -4127,7 +4127,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if (aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4150,7 +4150,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}
@@ -4190,7 +4190,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
if(aggro > 0) {
AddToHateList(caster, aggro);
} else {
AddToHateList(caster, 1);
AddToHateList(caster, 1,0,true,false,false,spell_id);
}
return true;
}