#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
61
Scripts/Skills/ItemIdentification.cs
Normal file
61
Scripts/Skills/ItemIdentification.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class ItemIdentification
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
SkillInfo.Table[(int)SkillName.ItemID].Callback = new SkillUseCallback( OnUse );
|
||||
}
|
||||
|
||||
public static TimeSpan OnUse( Mobile from )
|
||||
{
|
||||
from.SendLocalizedMessage( 500343 ); // What do you wish to appraise and identify?
|
||||
from.Target = new InternalTarget();
|
||||
|
||||
return TimeSpan.FromSeconds( 1.0 );
|
||||
}
|
||||
|
||||
[PlayerVendorTarget]
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
public InternalTarget() : base ( 8, false, TargetFlags.None )
|
||||
{
|
||||
AllowNonlocal = true;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object o )
|
||||
{
|
||||
if ( o is Item )
|
||||
{
|
||||
if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
|
||||
{
|
||||
if ( o is BaseWeapon )
|
||||
((BaseWeapon)o).Identified = true;
|
||||
else if ( o is BaseArmor )
|
||||
((BaseArmor)o).Identified = true;
|
||||
|
||||
if ( !Core.AOS )
|
||||
((Item)o).OnSingleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500353 ); // You are not certain...
|
||||
}
|
||||
}
|
||||
else if ( o is Mobile )
|
||||
{
|
||||
((Mobile)o).OnSingleClick( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 500353 ); // You are not certain...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue