EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Server Code Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=669)
-   -   Check For SpellEffect Fix (https://www.eqemulator.org/forums/showthread.php?t=26551)

seveianrex 10-18-2008 10:01 AM

Check For SpellEffect Fix
 
I ran into this issue primarily with Levitate. If anyone can think of another effect that this might be useful for it should be a reasonably simple implementation.

Basically, lets say you cast Flight of Eagles and then a Bard uses Selo's Song of Travel (Invis/Levi/Movement song). As soon as EITHER buff fades, you lose levi, even though you still have the other buff supposedly giving you levi.

This is my fix.

{mob.h}
insert anywhere
Code:

bool    AffectedExcludingSlot(int slot, int effect);
{spell_effects.cpp}
append
Code:

bool Mob::AffectedExcludingSlot(int slot, int effect)
{
        for (int i = 0; i <= EFFECT_COUNT; i++)
        {
                if (i == slot)
                        continue;

                if (IsEffectInSpell(buffs[i].spellid, effect))
                        return true;
        }
        return false;
}

in void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses)
find
Code:

case SE_Levitate:
                        {
                                SendAppearancePacket(AT_Levitate, 0);
                                break;
                        }

replace with
Code:

case SE_Levitate:
                        {
                                if (!AffectedExcludingSlot(slot, SE_Levitate))
                                        SendAppearancePacket(AT_Levitate, 0);
                                break;
                        }


cavedude 10-18-2008 02:03 PM

This works perfectly for the caster, but any group member that also recieved the buffs will still fall when one of the spells wears off.

cavedude 10-18-2008 02:16 PM

Hmmm, nevermind on that. It's working for both caster and group members now without me changing a thing. I've even recreated the situation where it didn't work and seems to be fine. It might have been lag, my test machine is under heavy load, atm.


All times are GMT -4. The time now is 06:44 AM.

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