Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-18-2011, 03:16 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default IsPureNukeSpell issue?

I have been looking into this function while working on bots. Is this intended to allow heal spells through? The current code is below.

Code:
bool IsPureNukeSpell(int16 spell_id)
{
        int i, effect_count = 0;

        if(!IsValidSpell(spell_id))
                return false;

        for(i = 0; i < EFFECT_COUNT; i++)
        {
                if(!IsBlankSpellEffect(spell_id, i))
                        effect_count++;
        }

        return
        (
                effect_count == 1 && IsEffectInSpell(spell_id, SE_CurrentHP) && 
                spells[spell_id].buffduration == 0
        );
}
This will return true for any single effect heal, as it does not check for negative values (damage spells). To do some testing, I have added && IsDamageSpell(spellid) in the return after checking the buffduration, which has a lot of redundant code, but you can't really just do a quick && spells[spell_id].base[0] < 0, since I guess you can't be guaranteed that even though it has only 1 effect, that it is in slot 0. Instead of rewriting what's already there in IsDamageSpell, I would just use it..

Or is this working as intended?

I can use IsDamageSpell in what I'm working on for bots in conjunction with this, or it could be added here, if there isn't a reason for needing heals to be run through this. (This is called from IsPartialCapableSpell)
Reply With Quote
 


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 08:43 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