EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Rune spells preventing stun (https://www.eqemulator.org/forums/showthread.php?t=29408)

drakelord 08-31-2009 03:02 PM

Rune spells preventing stun
 
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
Code:

                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

Code:

                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.


All times are GMT -4. The time now is 09:32 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.