using System;
using System.Collections;
using System.Collections.Generic;
using Server.Multis;
using Server.Mobiles;
using Server.Network;
using Server.ContextMenus;
using Server.Spells;
using Server.Targeting;
using Server.Misc;
namespace Server.Items
{
public class LizardSlayingRune : Item
{
[Constructable]
public LizardSlayingRune() : base( 0x1F14 )
{
Weight = 0.2; // ?
Name = "Lizard Slaying Rune";
Hue = 1001;
}
public override void OnDoubleClick( Mobile from )
{
double minSkill = 70.0;
PlayerMobile pm = from as PlayerMobile;
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else if ( pm == null || from.Skills[SkillName.Inscribe].Base < 70.0 )
{
from.SendMessage( "You are not skilled enough to attempt this enhancement." );
}
else if( from.InRange( this.GetWorldLocation(), 1 ) )
{
double maxSkill = minSkill + 40.0;
if ( !from.CheckSkill( SkillName.Inscribe, minSkill, maxSkill ) )
{
from.SendMessage( "The rune shatters, releasing the magic energy." );
from.PlaySound( 65 );
from.PlaySound( 0x1F8 );
Delete();
return;
}
else
{
from.SendMessage( "Select the item to enhance." );
from.Target = new InternalTarget( this );
}
}
else
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
}
private class InternalTarget : Target
{
private LizardSlayingRune m_LizardSlayingRune;
public InternalTarget( LizardSlayingRune runeaug ) : base( 1, false, TargetFlags.None )
{
m_LizardSlayingRune = runeaug;
}
protected override void OnTarget( Mobile from, object targeted )
{
int scalar;
double mageSkill = from.Skills[SkillName.Inscribe].Value;
if ( mageSkill >= 100.0 )
scalar = 3;
else if ( mageSkill >= 90.0 )
scalar = 2;
else
scalar = 1;
if ( targeted is BaseWeapon )
{
BaseWeapon Weapon = targeted as BaseWeapon;
if ( !from.InRange( ((Item)targeted).GetWorldLocation(), 1 ) )
{
from.SendLocalizedMessage( 500446 ); // That is too far away.
}
else if (( ((Item)targeted).Parent != null ) && ( ((Item)targeted).Parent is Mobile
) )
{
from.SendMessage( "You cannot enhance that in it's current location." );
}
else
{
int DestroyChance = Utility.Random( 5 );
if ( DestroyChance > 0 ) // Success
{
int augment = ( ( Utility.Random( 3 ) ) * scalar ) + 1;
int augmentper = ( ( Utility.Random( 5 ) ) * scalar ) + 5;
Weapon.WeaponAttributes.Slayer = SlayerName.Lizardslaying; +=
augmentper; from.SendMessage( "The Lizard Slaying Rune enhances your weapon." );
from.PlaySound( 0x1F5 );
m_LizardSlayingRune.Delete();
}
else // Fail
{
from.SendMessage( "You have failed to enhance the weapon!" );
from.SendMessage( "The weapon is damaged beyond repair!" );
from.PlaySound( 42 );
Weapon.Delete();
m_LizardSlayingRune.Delete();
}
}
}
//else
//{
from.SendMessage( "You cannot enhance that." );
}
}
}
public override bool DisplayLootType{ get{ return false; } } // ha ha!
public LizardSlayingRune( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void AddNameProperty( ObjectPropertyList list )
{
base.AddNameProperty(list);
list.Add( "Slayer = SlayerName.Lizardslaying" );
}
}
}
RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 6 64-bit processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Custom/Rune Crafting/Runes/LizardSlayingRune.cs:
CS1518: Line 135: Expected class, delegate, enum, interface, or struct
CS1518: Line 137: Expected class, delegate, enum, interface, or struct
CS1518: Line 141: Expected class, delegate, enum, interface, or struct
CS1518: Line 148: Expected class, delegate, enum, interface, or struct
CS1518: Line 154: Expected class, delegate, enum, interface, or struct
CS1022: Line 160: Type or namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.