mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 10:31:29 +00:00
Went back to older fearpath, only kept change where pathing issues can't
cause the fear spell to be dropped.
This commit is contained in:
parent
aa8a2ea41b
commit
e84799e15b
@ -152,12 +152,26 @@ void Mob::CalculateNewFearpoint()
|
|||||||
Log(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection.");
|
Log(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection.");
|
||||||
}
|
}
|
||||||
|
|
||||||
int ran = 250;
|
int loop = 0;
|
||||||
float ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1);
|
float ranx, rany, ranz;
|
||||||
float rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1);
|
currently_fleeing = false;
|
||||||
|
while (loop < 100) //Max 100 tries
|
||||||
m_FearWalkTarget = glm::vec3(ranx, rany, GetZ());
|
{
|
||||||
|
int ran = 250 - (loop*2);
|
||||||
currently_fleeing = true;
|
loop++;
|
||||||
|
ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1);
|
||||||
|
rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1);
|
||||||
|
ranz = FindGroundZ(ranx,rany);
|
||||||
|
if (ranz == -999999)
|
||||||
|
continue;
|
||||||
|
float fdist = ranz - GetZ();
|
||||||
|
if (fdist >= -12 && fdist <= 12 && CheckCoordLosNoZLeaps(GetX(),GetY(),GetZ(),ranx,rany,ranz))
|
||||||
|
{
|
||||||
|
currently_fleeing = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (currently_fleeing)
|
||||||
|
m_FearWalkTarget = glm::vec3(ranx, rany, ranz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user