bryant
Member
- ServUO Version
- Publish Unknown
- Ultima Expansion
- Age Of Shadows
I'm getting this error when trying to add a new weapon ability.
can you tell me what I'm missing here
- Error: Scripts\Lightning_Arrow.cs: CS1501: (line 76, column 6) No overload for method 'OnHit' takes '3' arguments
can you tell me what I'm missing here
- Error: Scripts\Lightning_Arrow.cs: CS1501: (line 76, column 6) No overload for method 'OnHit' takes '3' arguments
lightning arrow error:
using System;
using System.Collections;
using Server;
using Server.Spells;
namespace Server.Items
{
public class Lightning_Arrow : WeaponAbility
{
public Lightning_Arrow()
{
}
public override int BaseMana{ get{ return 20; } }
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
if ( !Validate( attacker ) )
return;
ClearCurrentAbility( attacker );
Map map = attacker.Map;
if ( map == null )
return;
BaseWeapon weapon = attacker.Weapon as BaseWeapon;
if ( weapon == null )
return;
if ( !CheckMana( attacker, true ) )
return;
ArrayList list = new ArrayList();
defender.PlaySound(1471);
defender.BoltEffect(0);
attacker.SendMessage( "The Lighting Arrow strikes a target" );
foreach ( Mobile m in defender.GetMobilesInRange( 1 ) )
list.Add( m );
ArrayList targets = new ArrayList();
for ( int i = 0; i < list.Count; ++i )
{
Mobile m = (Mobile)list[i];
if ( m != defender && m != attacker && SpellHelper.ValidIndirectTarget( attacker, m ) )
{
if ( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) )
continue;
if ( !attacker.InRange( m, weapon.MaxRange ) )
continue;
if ( attacker.InLOS( m ) )
targets.Add( m );
}
}
if ( targets.Count > 0 )
{
double damageBonus = 1.0 + Math.Pow( 1, 2 ) / 100;
for ( int i = 0; i < targets.Count; ++i )
{
Mobile m = (Mobile)targets[i];
attacker.SendMessage( "The Lighting Arrow strikes around a target" );
m.PlaySound(1471);
m.BoltEffect(0);
weapon.OnHit( attacker, m, damageBonus );
}
}
}
}
}