• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] Warlock Pet Spells

Status
Not open for further replies.

Portals

Banned
I am working on something and well I gave lower level warlocks to summon the other pets like succubus, fel hunter, and fel guard. But being the lower level the pets dont have any abilities. Is there a way to fix it so the pets get spells at lower levels?
 

Recycle

Enthusiast
I'm a bit busy atm but, I'm guessing it's a dbc thing.

Just to document quickly:
Felhunter Summon Id: 691
Felhunter Creature Id: 417
Felhunter has no spells set to it in the DB, but it learns them whilst leveling.
It learns Devour Magic at level 30, which is also the spell's level value. See here:
Bq3nRGH.png


I'm taking a wild guess, but that's when it's learned. It could honestly be a core thing as well.

You may find this to be helpful, too: http://modcraft.superparanoid.de/viewtopic.php?p=46343&sid=2826484b3c8fcd1068a074edfc4ad5a2#p46343

Sorry I can't test it to lenghts, but I'm guessing if you set the spells in the DBC, and set appropriate levels in spell.dbc it could work that way. Best of luck, though! I'll update this in-case I find a way, as I'm also looking to add new spells and at lower levels to pets in my project(once I get that far, too much quests to be added for whole content <_<)
 

Visa

Sexy Member
I'm a bit busy atm but, I'm guessing it's a dbc thing.

Just to document quickly:
Felhunter Summon Id: 691
Felhunter Creature Id: 417
Felhunter has no spells set to it in the DB, but it learns them whilst leveling.
It learns Devour Magic at level 30, which is also the spell's level value. See here:
Bq3nRGH.png

This would also be my guess. Try setting the Spell and Base Level to whatever lower level your Warlock character is.
 

Crow

Enthusiast
This would also be my guess. Try setting the Spell and Base Level to whatever lower level your Warlock character is.

This would be correct, as illustrated here.
Code:
void Pet::InitLevelupSpellsForLevel()
{
    uint8 level = getLevel();

    if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL)
    {
        // PetLevelupSpellSet ordered by levels, process in reversed order
        for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
        {
            // will called first if level down
            if (itr->first > level)
                unlearnSpell(itr->second, true);                 // will learn prev rank if any
            // will called if level up
            else
                learnSpell(itr->second);                        // will unlearn prev rank if any
        }
    }

    int32 petSpellsId = GetCreatureTemplate()->PetSpellDataId ? -(int32)GetCreatureTemplate()->PetSpellDataId : GetEntry();

    // default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
    if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
    {
        for (uint8 i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
        {
            SpellInfo const* spellInfo = sSpellMgr->[COLOR="#FF0000"][B]GetSpellInfo[/B][/COLOR](defSpells->spellid[i]);
            if (!spellInfo)
                continue;

           [B][COLOR="#FF0000"] // will called first if level down
            if (spellInfo->SpellLevel > level)
                unlearnSpell(spellInfo->Id, true);
            // will called if level up
            else
                learnSpell(spellInfo->Id);[/COLOR][/B]
        }
    }
}
 
Status
Not open for further replies.
Top