FaceMelter
Member
- ServUO Version
- Publish Unknown
- Ultima Expansion
- None
Is there a way to follow up the use of spell.Cast() with current target via script? Here's an example of what I've tried so far:
When I first added this, I didn't have the internal targeting. This functioned. The spell was cast and the player is displayed a targeting cursor.
I'd like the spell target to automatically cast on the defender (a mobile that's previously defined).
After adding the InternalTarget line above, I get a namespace error (missing an assembly reference?). Normally this means that I forgot to include the right System or Server reference. Here's what I have:
Is there some other reference besides Server.Targeting? I've never messed with InternalTarget or Targeting in general before, so perhaps I'm missing something or using the incorrect Targeting here. I've looked at how this is used in other scripts, but I've misunderstood something here. (This is located in the OnHit section of BaseWeapon.)
Thanks for any advice that can point me in the right direction!
int m_SpellID = this.SpellSelect;
Spell spell = SpellRegistry.NewSpell( m_SpellID, attacker, this );
if ( spell != null )
{
spell.Cast();
attacker.Target = new InternalTarget( defender );
}
else
{
attacker.SendLocalizedMessage( 502345 ); // This spell has been temporarily disabled.
}
When I first added this, I didn't have the internal targeting. This functioned. The spell was cast and the player is displayed a targeting cursor.
I'd like the spell target to automatically cast on the defender (a mobile that's previously defined).
After adding the InternalTarget line above, I get a namespace error (missing an assembly reference?). Normally this means that I forgot to include the right System or Server reference. Here's what I have:
using System;
using System.Text;
using System.Collections;
using Server.Network;
using Server.Targeting;
using Server.Mobiles;
using Server.Spells;
using Server.Engines.Craft;
using System.Collections.Generic;
using Server.Misc;
Is there some other reference besides Server.Targeting? I've never messed with InternalTarget or Targeting in general before, so perhaps I'm missing something or using the incorrect Targeting here. I've looked at how this is used in other scripts, but I've misunderstood something here. (This is located in the OnHit section of BaseWeapon.)
Thanks for any advice that can point me in the right direction!