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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2016, 02:13 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default Spells that have an endurance cost do not get scribed with quest::scribespells

I have thoroughly tested this. If a spell has a value set for Endurance Cost, it will not be scribed via the quest::scribespells function.

Seems like an unintentional bug to me, would be nice to have a fix for this.
Reply With Quote
  #2  
Old 02-16-2016, 02:17 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Well, endurance-based spell costs are categorized as disciplines due to the IsDiscipline logic.
Code:
bool IsDiscipline(uint16 spell_id)
{
    if (!IsValidSpell(spell_id))
        return false;

    if (spells[spell_id].mana == 0 &&
            (spells[spell_id].EndurCost || spells[spell_id].EndurUpkeep))
        return true;

    return false;
}
The reason I bring this up is because quest::scribespells checks if the spell is a discipline and using that check causes all endurance-based spells to be categorized as disciplines:
Code:
uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
    QuestManagerCurrentQuestVars();
    uint16 book_slot, count;
    uint16 curspell;

    uint32 Char_ID = initiator->CharacterID();
    bool SpellGlobalRule = RuleB(Spells, EnableSpellGlobals);
    bool SpellGlobalCheckResult = 0;


    for(curspell = 0, book_slot = initiator->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = initiator->GetNextAvailableSpellBookSlot(book_slot))
    {
        if
        (
            spells[curspell].classes[WARRIOR] != 0 &&       //check if spell exists
            spells[curspell].classes[initiator->GetPP().class_-1] <= max_level &&   //maximum level
            spells[curspell].classes[initiator->GetPP().class_-1] >= min_level &&   //minimum level
            spells[curspell].skill != 52 &&
            spells[curspell].effectid[EFFECT_COUNT - 1] != 10
        )
        {
            if (book_slot == -1) //no more book slots
                break;
            if(!IsDiscipline(curspell) && !initiator->HasSpellScribed(curspell)) { //isn't a discipline & we don't already have it scribed
                if (SpellGlobalRule) {
                    // Bool to see if the character has the required QGlobal to scribe it if one exists in the Spell_Globals table
                    SpellGlobalCheckResult = initiator->SpellGlobalCheck(curspell, Char_ID);
                    if (SpellGlobalCheckResult) {
                        initiator->ScribeSpell(curspell, book_slot);
                        count++;
                    }
                }
                else {
                    initiator->ScribeSpell(curspell, book_slot);
                    count++;
                }
            }
        }
    }
    return count; //how many spells were scribed successfully
}
Reply With Quote
  #3  
Old 02-16-2016, 02:41 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

Thank you so much, Kingly. Turns out it wasn't a bug at all like I thought. I've got it changed in my source now to work like I want it to
Reply With Quote
Reply


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 03:09 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3