mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
[Bots/Mercs] Add 100% Hit chance if sitting while attacked. (#2839)
* [BOT] Add 100% Hit chance if sitting while attacked. * [BOT] Add 100% Hit chance if sitting while attacked. * Add Mercs correctly * Missed usage of IsSitting() in Mob::RollD20
This commit is contained in:
+4
-2
@@ -317,8 +317,9 @@ bool Mob::CheckHitChance(Mob* other, DamageHitInfo &hit)
|
||||
Mob *defender = this;
|
||||
Log(Logs::Detail, Logs::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName());
|
||||
|
||||
if (defender->IsClient() && defender->CastToClient()->IsSitting())
|
||||
if ((defender->IsClient() || defender->IsBot() || defender->IsMerc()) && defender->IsSitting()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto avoidance = defender->GetTotalDefense();
|
||||
if (avoidance == -1) // some sort of auto avoid disc
|
||||
@@ -1001,8 +1002,9 @@ double Mob::RollD20(int offense, int mitigation)
|
||||
1.6, 1.7, 1.8, 1.9, 2.0
|
||||
};
|
||||
|
||||
if (IsClient() && CastToClient()->IsSitting())
|
||||
if ((IsClient() || IsBot() || IsMerc()) && IsSitting()) {
|
||||
return mods[19];
|
||||
}
|
||||
|
||||
auto atk_roll = zone->random.Roll0(offense + 5);
|
||||
auto def_roll = zone->random.Roll0(mitigation + 5);
|
||||
|
||||
Reference in New Issue
Block a user