PDA

View Full Version : Rune spells preventing stun


drakelord
08-31-2009, 03:02 PM
From what I remember on EQ Live, if a caster had a Rune spell casted on them to absorb damage, and an enemy that was attacking them used a melee based stun skill such as Bash, it would not stun the caster unless the damage exceeded the rune amount.

This is currently not the case on the emulator.

Replace in attack.cpp, under the common damage functions
if ((skill_used == BASH || skill_used == KICK && (attacker && attacker->GetLevel() >= 55)) && GetLevel() < 56) {
int stun_resist = itembonuses.StunResist+spellbonuses.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 {
if(stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) {
mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.");
Stun(0);
} else {
mlog(COMBAT__HITS, "Stun Resisted. We had %dpercent resist chance.");
}
}
}

With


if (damage > 0 && ((skill_used == BASH || skill_used == KICK && (attacker && attacker->GetLevel() >= 55)) && GetLevel() < 56)) {
int stun_resist = itembonuses.StunResist+spellbonuses.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 {
if(stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) {
mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.");
Stun(0);
} else {
mlog(COMBAT__HITS, "Stun Resisted. We had %dpercent resist chance.");
}
}
}


This code takes advantage of the fact that the rune effects are taken into account to reduce the damage before this is called under the common damage functions.

cavedude
09-27-2009, 12:39 PM
Added to revision 995.