Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-13-2016, 06:50 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

spdat.cpp I think was the name of the file, under common.

Code:
bool IsBeneficialSpell(uint16 spell_id)
{
    if (!IsValidSpell(spell_id))
        return false;

    // You'd think just checking goodEffect flag would be enough?
    if (spells[spell_id].goodEffect == 1) {
        // If the target type is ST_Self or ST_Pet and is a SE_CancleMagic spell
        // it is not Beneficial
        SpellTargetType tt = spells[spell_id].targettype;
        if (tt != ST_Self && tt != ST_Pet &&
                IsEffectInSpell(spell_id, SE_CancelMagic))
            return false;

        // When our targettype is ST_Target, ST_AETarget, ST_Aniaml, ST_Undead, or ST_Pet
        // We need to check more things!
        if (tt == ST_Target || tt == ST_AETarget || tt == ST_Animal ||
                tt == ST_Undead || tt == ST_Pet) {
            uint16 sai = spells[spell_id].SpellAffectIndex;

            // If the resisttype is magic and SpellAffectIndex is Calm/memblur/dispell sight
            // it's not beneficial.
            if (spells[spell_id].resisttype == RESIST_MAGIC) {
                if (sai == SAI_Calm || sai == SAI_Dispell_Sight ||
                        sai == SAI_Memory_Blur || sai == SAI_Calm_Song)
                    return false;
            } else {
                // If the resisttype is not magic and spell is Bind Sight or Cast Sight or Harmony
                // It's not beneficial
                if ((sai == SAI_Calm && IsEffectInSpell(spell_id, SE_Harmony))
                    || (sai == SAI_Calm_Song && IsEffectInSpell(spell_id, SE_BindSight))
                    || (sai == SAI_Dispell_Sight && spells[spell_id].skill == 18 &&
                        !IsEffectInSpell(spell_id, SE_VoiceGraft)))
                    return false;
            }
        }
    }

    // And finally, if goodEffect is not 0 or if it's a group spell it's beneficial
    return spells[spell_id].goodEffect != 0 || IsGroupSpell(spell_id);
}
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:54 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3