This is what I got, I've also started working on the other pet related things regarding this, but, without this code block working as it should it's pretty useless working on the other aspects. Neo2003, the petspells etc all seem to reside in spelleffects.cpp, thus I'll keep this here for now. I'm still learning the pet side of things, and as I pick things up, I can make it better. But, I really need help here.
The problem I have is with this bit://tried Dead check(not working): unitTarget->GetHealth() == 0, !unitTarget->isAlive, unitTarget->isDead. I even did deathstate checks. Could anyone enlighten me, please?
/*&& unitTarget->getLevel() <= MaNGOS::XP::GetGrayLevel(m_caster->getLevel())*/ --will be checked as soon as I figured out the corpse check.
case SPELLFAMILY_DEATHKNIGHT:
{
switch (m_spellInfo->Id)
// Summon Ghoul
case 46584:
{
//tried Dead check(not working): unitTarget->GetHealth() == 0, !unitTarget->isAlive, unitTarget->isDead
// See if player is targeting a dead, humanoid, =plevel-3 target
if(unitTarget && (unitTarget->GetCreatureType() == CREATURE_TYPE_HUMANOID || unitTarget->GetTypeId() == TYPEID_PLAYER)//works in Dalaran only- have to recheck?!?
/*&& unitTarget->getLevel() <= MaNGOS::XP::GetGrayLevel(m_caster->getLevel())*/)
{
sLog.outError("SUMMON GHOUL: Target is valid.");
if((m_caster)->HasSpell(52143) )// Look for Master of Ghouls talent dummy spell (52143)
{
sLog.outError("SUMMON GHOUL: Master of Ghouls.");
(m_caster)->CastSpell(unitTarget, 52150, false);// Player has talent; cast pet ghoul spell
}
else
{
sLog.outError("SUMMON GHOUL: No Master of Ghouls.");
(m_caster)->CastSpell(unitTarget, 46585, false);
}
return;
}
else if( ((Player*)m_caster)->HasItemCount(37201,1))
{
sLog.outError("SUMMON GHOUL: Corpse dust present.");
((Player*)m_caster)->DestroyItemCount(37201,1,true);
if((m_caster)->HasSpell(52143) )// Look for Master of Ghouls talent dummy spell (52143)
{
sLog.outError("SUMMON GHOUL: Master of Ghouls - Corpse dust used.");
(m_caster)->CastSpell(m_caster, 52150, false);// Player has talent; cast pet ghoul spell
}
else
{
sLog.outError("SUMMON GHOUL: No Master of Ghouls - Corpse dust used..");
(m_caster)->CastSpell(m_caster, 46585, false);
}
return;
}
else
{
(m_caster)->CastStop();
sLog.outError("SUMMON GHOUL: Criteria not met!!.");
return;
}
}
}