mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
[Bug Fix] NPC Faction War prevention. (#3595)
* [Bug] NPC Faction War prevention. This should assist with prevention of NPC Faction waring. I have been using this code on my server for over 5 years with no coredumps or any noted bugs. This was brought up as users have reported a few events where they can trigger NPC's to fight each other. * Correct a few entries to line up with updated code. * Re-add missing RestTimer functionality
This commit is contained in:
+10
-3
@@ -3885,11 +3885,12 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
|
||||
|
||||
if (IsDetrimentalSpell(buff.spellid)) {
|
||||
if (caster->IsClient()) {
|
||||
if (!caster->CastToClient()->GetFeigned())
|
||||
if (!caster->CastToClient()->GetFeigned()) {
|
||||
AddToHateList(caster, -effect_value);
|
||||
} else if (!IsClient()) // Allow NPC's to generate hate if casted on other
|
||||
// NPC's.
|
||||
}
|
||||
} else if (!IsClient()) { // Allow NPC's to generate hate if casted on other NPC's
|
||||
AddToHateList(caster, -effect_value);
|
||||
}
|
||||
}
|
||||
|
||||
effect_value = caster->GetActDoTDamage(buff.spellid, effect_value, this);
|
||||
@@ -3990,6 +3991,12 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
|
||||
case SE_Charm: {
|
||||
if (!caster || !PassCharismaCheck(caster, buff.spellid)) {
|
||||
BuffFadeByEffect(SE_Charm);
|
||||
|
||||
// Remove from hate list of any NPC's hate list and remove all NPCs this hate list
|
||||
if (IsNPC()) {
|
||||
entity_list.RemoveFromHateLists(this);
|
||||
WipeHateList(true);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user