ExX
Member
I am smacking myself with figuring this out. I am using this code in my script. Triggers when an npc is killed, @ his on death.
Had it working on an older distro of ServUO and it's the SAME code used in the playermobile but for some reason it gives this error.
Errors:
+ Custom/Mobiles/PK Gang/HKMobile.cs:
CS0103: Line 155: The name 'VirtueHelper' does not exist in the current context
CS0103: Line 155: The name 'VirtueName' does not exist in the current context
Any thoughts why?
C#:
public override void OnDeath( Container c )
{
base.OnDeath( c );
Mobile m = FindMostRecentDamager( false );
if ( m != null && m.Player )
{
bool gainedPath = false;
//int theirTotal = PlayerMobile.SkillsTotal( m );
//int ourTotal = PlayerMobile.SkillsTotal( this );
int theirTotal = (int)(m.SkillsTotal);
int ourTotal = (int)(this.SkillsTotal);
int pointsToGain = (int)(1 + ((theirTotal - ourTotal) / 50));
if ( pointsToGain < 1 )
pointsToGain = 1;
else if ( pointsToGain > 4 )
pointsToGain = 4;
if ( VirtueHelper.Award( m, VirtueName.Justice, pointsToGain, ref gainedPath ) )
{
if ( gainedPath )
m.SendLocalizedMessage( 1049367 ); // You have gained a path in Justice!
else
m.SendLocalizedMessage( 1049363 ); // You have gained in Justice.
m.FixedParticles( 0x375A, 9, 20, 5027, EffectLayer.Waist );
m.PlaySound( 0x1F7 );
}
}
}
Had it working on an older distro of ServUO and it's the SAME code used in the playermobile but for some reason it gives this error.
Errors:
+ Custom/Mobiles/PK Gang/HKMobile.cs:
CS0103: Line 155: The name 'VirtueHelper' does not exist in the current context
CS0103: Line 155: The name 'VirtueName' does not exist in the current context
Any thoughts why?