This seemed to be functioning incorrectly, it didnt have a message associated with it and it seemed to restrict players from being stunned by a bash if they are over level 55(which doesnt happen on live, otherwise there would be no point in stun resist on gear on any expansion in last 10 years). Also it now works for the AA stun resist.
attack
Code:
Index: attack.cpp
===================================================================
--- attack.cpp (revision 1620)
+++ attack.cpp (working copy)
@@ -3249,8 +3287,10 @@
}
//check stun chances if bashing
- if (damage > 0 && ((skill_used == BASH || skill_used == KICK && (attacker && attacker->GetLevel() >= 55)) && GetLevel() < 56)) {
+ if (damage > 0 && ((skill_used == BASH || skill_used == KICK && (attacker && attacker->GetLevel() >= 55)))) {
int stun_resist = itembonuses.StunResist+spellbonuses.StunResist;
+ if(IsClient())
+ stun_resist += aabonuses.StunResist;
if(this->GetBaseRace() == OGRE && this->IsClient() && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) {
mlog(COMBAT__HITS, "Stun Resisted. Ogres are immune to frontal melee stuns.");
} else {
@@ -3258,6 +3298,8 @@
mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.");
Stun(0);
} else {
+ if(IsClient())
+ this->Message(0,"You shake off the stun effect!");
mlog(COMBAT__HITS, "Stun Resisted. We had %dpercent resist chance.");
}
}
bonuses
Code:
Index: bonuses.cpp
===================================================================
--- bonuses.cpp (revision 1620)
+++ bonuses.cpp (working copy)
@@ -659,6 +659,9 @@
case SE_TotalHP:
newbon->HP += base1;
break;
+ case SE_StunResist:
+ newbon->StunResist += base1;
+ break;
}
}
spell effects
Code:
Index: spell_effects.cpp
===================================================================
--- spell_effects.cpp (revision 1620)
+++ spell_effects.cpp (working copy)
@@ -652,7 +652,19 @@
}
else
{
- Stun(effect_value);
+ int stun_resist = itembonuses.StunResist+spellbonuses.StunResist;
+ if(IsClient())
+ stun_resist += aabonuses.StunResist;
+ if(stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) {
+ mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.");
+ Stun(effect_value);
+ }
+ else {
+ if(IsClient())
+ this->Message(0,"You shake off the stun effect!");
+ mlog(COMBAT__HITS, "Stun Resisted. We had %dpercent resist chance.");
+ }
+
}
break;
}