mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 00:01:28 +00:00
Fix to check if weapon actually has a valid proc before trying to proc it.
This commit is contained in:
parent
69d02b7e72
commit
2cf2ef4fac
@ -3650,6 +3650,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
|
|||||||
(frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) &&
|
(frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) &&
|
||||||
!attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
|
!attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
|
||||||
Log.Out(Logs::Detail, Logs::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist);
|
Log.Out(Logs::Detail, Logs::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Normal stun resist check.
|
// Normal stun resist check.
|
||||||
if (stun_resist && zone->random.Roll(stun_resist)) {
|
if (stun_resist && zone->random.Roll(stun_resist)) {
|
||||||
@ -3994,7 +3995,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
|
|||||||
// We can proc once here, either weapon or one aug
|
// We can proc once here, either weapon or one aug
|
||||||
bool proced = false; // silly bool to prevent augs from going if weapon does
|
bool proced = false; // silly bool to prevent augs from going if weapon does
|
||||||
skillinuse = GetSkillByItemType(weapon->ItemType);
|
skillinuse = GetSkillByItemType(weapon->ItemType);
|
||||||
if (weapon->Proc.Type == ET_CombatProc) {
|
if (weapon->Proc.Type == ET_CombatProc && IsValidSpell(weapon->Proc.Effect)) {
|
||||||
float WPC = ProcChance * (100.0f + // Proc chance for this weapon
|
float WPC = ProcChance * (100.0f + // Proc chance for this weapon
|
||||||
static_cast<float>(weapon->ProcRate)) / 100.0f;
|
static_cast<float>(weapon->ProcRate)) / 100.0f;
|
||||||
if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
|
if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really.
|
||||||
@ -4032,7 +4033,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on
|
|||||||
if (!aug)
|
if (!aug)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (aug->Proc.Type == ET_CombatProc) {
|
if (aug->Proc.Type == ET_CombatProc && IsValidSpell(aug->Proc.Effect)) {
|
||||||
float APC = ProcChance * (100.0f + // Proc chance for this aug
|
float APC = ProcChance * (100.0f + // Proc chance for this aug
|
||||||
static_cast<float>(aug->ProcRate)) / 100.0f;
|
static_cast<float>(aug->ProcRate)) / 100.0f;
|
||||||
if (zone->random.Roll(APC)) {
|
if (zone->random.Roll(APC)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user