Beispiel #1
0
void CAIGeneral::SetCurrentSpell(uint16 SpellID)
{
	if (m_ActionType != ACTION_MAGIC_START   &&
		m_ActionType != ACTION_MAGIC_CASTING &&
		m_ActionType != ACTION_MAGIC_FINISH  &&
		m_ActionType != ACTION_MAGIC_INTERRUPT)
	{
        CSpell* spell = spell::GetSpell(SpellID);
        if (spell)
        {
            if (spell->getSpellGroup() == SPELLGROUP_BLUE)
            {
                m_PSpell = std::make_unique<CBlueSpell>(*static_cast<CBlueSpell*>(spell));
            }
            else
            {
                m_PSpell = std::make_unique<CSpell>(*spell);
            }
        }
        else
        {
            m_PSpell = nullptr;
        }
	}
}