Bash/Kick stun will respect UNSTUNABLE now

This commit is contained in:
Michael Cook (mackal) 2014-01-28 22:14:31 -05:00
parent bd0c325762
commit 4a54e262f6

View File

@ -3563,6 +3563,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
// Calculate the chance to stun // Calculate the chance to stun
int stun_chance = 0; int stun_chance = 0;
if (!GetSpecialAbility(UNSTUNABLE)) {
if (attacker->IsNPC()) { if (attacker->IsNPC()) {
stun_chance = RuleI(Combat, NPCBashKickStunChance); stun_chance = RuleI(Combat, NPCBashKickStunChance);
} else if (attacker->IsClient()) { } else if (attacker->IsClient()) {
@ -3575,13 +3576,16 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons
stun_chance = 100; // only if you're over level 55 and using kick stun_chance = 100; // only if you're over level 55 and using kick
} else { // higher than base immunity or Client vs. Client } else { // higher than base immunity or Client vs. Client
// not sure on this number, use same as NPC for now // not sure on this number, use same as NPC for now
if (skill_used == SkillKick && attacker->GetLevel() < RuleI(Combat, ClientStunLevel))
stun_chance = RuleI(Combat, NPCBashKickStunChance); stun_chance = RuleI(Combat, NPCBashKickStunChance);
if (skill_used == SkillBash) else if (skill_used == SkillBash)
stun_chance += attacker->spellbonuses.StunBashChance + stun_chance = RuleI(Combat, NPCBashKickStunChance) +
attacker->spellbonuses.StunBashChance +
attacker->itembonuses.StunBashChance + attacker->itembonuses.StunBashChance +
attacker->aabonuses.StunBashChance; attacker->aabonuses.StunBashChance;
} }
} }
}
if (stun_chance && MakeRandomInt(0, 99) < stun_chance) { if (stun_chance && MakeRandomInt(0, 99) < stun_chance) {
// Passed stun, try to resist now // Passed stun, try to resist now