mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-08 14:12:27 +00:00
Merge pull request #640 from noudess/master
Repair fear pathing issues with Z and FEar resists now apply cha adjustments as they should.
This commit is contained in:
commit
dfdd775519
@ -152,28 +152,12 @@ 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 loop = 0;
|
int ran = 250;
|
||||||
float ranx, rany, ranz;
|
float ranx = GetX() + zone->random.Int(0, ran - 1) - zone->random.Int(0, ran - 1);
|
||||||
currently_fleeing = false;
|
float rany = GetY() + zone->random.Int(0, ran - 1)-zone->random.Int(0, ran - 1);
|
||||||
while (loop < 100) //Max 100 tries
|
|
||||||
{
|
m_FearWalkTarget = glm::vec3(ranx, rany, GetZ());
|
||||||
int ran = 250 - (loop*2);
|
|
||||||
loop++;
|
currently_fleeing = true;
|
||||||
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);
|
|
||||||
else //Break fear
|
|
||||||
BuffFadeByEffect(SE_Fear);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3640,7 +3640,7 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
|
|||||||
|
|
||||||
case SE_Fear: {
|
case SE_Fear: {
|
||||||
if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) {
|
if (zone->random.Roll(RuleI(Spells, FearBreakCheckChance))) {
|
||||||
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster);
|
float resist_check = ResistSpell(spells[buff.spellid].resisttype, buff.spellid, caster,0,0,true);
|
||||||
|
|
||||||
if (resist_check == 100)
|
if (resist_check == 100)
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user