EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Slay Undead Fix (https://www.eqemulator.org/forums/showthread.php?t=26548)

seveianrex 10-18-2008 02:13 AM

Slay Undead Fix
 
{attack.cpp}

~2631, right after the definition of Mob::TryCriticalHit, add:

Code:

        bool slayUndeadCrit = false;
A few lines down, find the following:

Code:

        if(defender && defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire){
                switch(GetAA(aaSlayUndead)){
                        case 1:
                                critMod += 33;
                                break;
                        case 2:
                                critMod += 66;
                                break;
                        case 3:
                                critMod += 100;
                                break;
                }
        }

And add the following immediately after the switch close bracket:

Code:

                slayUndeadCrit = true;
Then, a few more lines down find the following:

Code:

        if(critChance > 0){
                if(MakeRandomFloat(0, 1) <= critChance)
                {

And add immediately below:

Code:

                        if (slayUndeadCrit)
                        {
                                damage = (damage * (critMod * 1.65)) / 100;
                                entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s cleanses %s target!(%d)", GetCleanName(), this->GetGender() == 0 ? "his" : "her", damage);
                                return;
                        }


cavedude 10-18-2008 02:18 PM

Just to clarify, by "And add the following immediately after the switch close bracket:" I assume you mean in between the two brackets you have in the snippet? The first closing bracket is the switch bracket, the second belongs to the if statement above it.

seveianrex 10-18-2008 03:11 PM

For clarity's sake, the end result should look like this:

Code:

        if(defender && defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire){
                switch(GetAA(aaSlayUndead)){
                        case 1:
                                critMod += 33;
                                break;
                        case 2:
                                critMod += 66;
                                break;
                        case 3:
                                critMod += 100;
                                break;
                }
                slayUndeadCrit = true;
        }


cavedude 10-18-2008 03:34 PM

Good, we're on the same page :)


All times are GMT -4. The time now is 10:59 PM.

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