All pastes #400037 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-18 13:04 UTC
rendered paste body
bool lb_Creature_DoCast(Creature* m_creature, Unit* Victim, uint32 spellId)
{
	SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);

    if (!spellInfo)
    {
        sLog.outError("WORLD: unknown spell id %i\n", spellId);
        return false;
    }
    
    //No triggered spells for now
    Spell *spell = new Spell(m_creature, spellInfo, false, 0);
    WPAssert(spell);

    SpellCastTargets targets;
    targets.setUnitTarget(Victim);
    spell->m_CastItem = NULL;
	uint8 castresult = spell->CanCast();
    spell->prepare(&targets);
    m_creature->m_canMove = false;

	return (castresult == 0);
}