mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Bug Fix] Fix Bot Weapons with No Races (#4110)
# Notes - Bot weapons that have no races were not causing damage and saying the target was invulnerable because we were not checking the `Bots:AllowBotEquipAnyRaceGear` rule.
This commit is contained in:
parent
8314f2348c
commit
873c128f46
@ -1164,14 +1164,27 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, in
|
|||||||
|
|
||||||
// check for items being illegally attained
|
// check for items being illegally attained
|
||||||
if (weapon_item) {
|
if (weapon_item) {
|
||||||
if (!weapon_item->GetItem())
|
if (!weapon_item->GetItem()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (weapon_item->GetItemRequiredLevel(true) > GetLevel())
|
if (weapon_item->GetItemRequiredLevel(true) > GetLevel()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!weapon_item->IsEquipable(GetBaseRace(), GetClass()))
|
if (!weapon_item->IsClassEquipable(GetClass())) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!weapon_item->IsRaceEquipable(GetBaseRace()) &&
|
||||||
|
(
|
||||||
|
!IsBot() ||
|
||||||
|
(IsBot() && !RuleB(Bots, AllowBotEquipAnyRaceGear))
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) {
|
if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) {
|
||||||
@ -4074,7 +4087,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
|||||||
if (IsClient()) {
|
if (IsClient()) {
|
||||||
CommonBreakInvisible();
|
CommonBreakInvisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
damage = ReduceDamage(damage);
|
damage = ReduceDamage(damage);
|
||||||
LogCombat("Melee Damage reduced to [{}]", damage);
|
LogCombat("Melee Damage reduced to [{}]", damage);
|
||||||
damage = ReduceAllDamage(damage);
|
damage = ReduceAllDamage(damage);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user