make an npc cast a spell on me, on command
I want a NPC bless me when I tell him.
how can i do that?
the only useful code that i've found out is this:
new BlessSpell( m_caster, null ).Cast();
but how do i set the victim?
edit: i tried this
Target targ = m_caster.Target;
Spell spell = new BlessSpell( m_caster, null );
spell.Cast();
targ.Invoke( m_caster, (object)m_from );
but the server crashes because "Object reference not set to an instance of an object."
(m_from and m_caster are set, he's lying.)
I want a NPC bless me when I tell him.
how can i do that?
the only useful code that i've found out is this:
new BlessSpell( m_caster, null ).Cast();
but how do i set the victim?
edit: i tried this
Target targ = m_caster.Target;
Spell spell = new BlessSpell( m_caster, null );
spell.Cast();
targ.Invoke( m_caster, (object)m_from );
but the server crashes because "Object reference not set to an instance of an object."
(m_from and m_caster are set, he's lying.)