mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
Update entity.cpp
This commit is contained in:
parent
42f959329d
commit
ef0b29dc8e
@ -3294,6 +3294,36 @@ void EntityList::ClearAggro(Mob* targ)
|
||||
}
|
||||
}
|
||||
|
||||
//removes "targ" from all hate lists of mobs that are water only.
|
||||
//water only mobs that are fleed from to another region are healed as per live
|
||||
void EntityList::ClearWaterAggro(Mob* targ)
|
||||
{
|
||||
Client *c = nullptr;
|
||||
if (targ->IsClient())
|
||||
c = targ->CastToClient();
|
||||
auto it = npc_list.begin();
|
||||
while (it != npc_list.end()) {
|
||||
if (it->second->IsUnderwaterOnly()) {
|
||||
if (it->second->CheckAggro(targ)) {
|
||||
if (c)
|
||||
c->RemoveXTarget(it->second, false);
|
||||
it->second->RemoveFromHateList(targ);
|
||||
}
|
||||
if (c && it->second->IsOnFeignMemory(c)) {
|
||||
it->second->RemoveFromFeignMemory(c); //just in case we feigned
|
||||
c->RemoveXTarget(it->second, false);
|
||||
}
|
||||
if (!it->second->GetHateTop()) {
|
||||
// target fled the water and no other targets.
|
||||
// Heal NPC as on live
|
||||
it->second->Heal();
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EntityList::ClearFeignAggro(Mob *targ)
|
||||
{
|
||||
auto it = npc_list.begin();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user