#W# More spawner work. Added 'MyLevel' to basecreature and GetLevel Command.
This commit is contained in:
parent
5df9b41822
commit
dae9b56279
7 changed files with 144 additions and 3 deletions
54
Scripts/Commands/GetLevel.cs
Normal file
54
Scripts/Commands/GetLevel.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using Server;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Commands;
|
||||
using Server.Commands.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Accounting;
|
||||
using Server.Regions;
|
||||
using System.IO;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Scripts.Commands
|
||||
{
|
||||
public class GetLevel
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("GetLevel", AccessLevel.Counselor, new CommandEventHandler( GetLevels ));
|
||||
}
|
||||
|
||||
[Usage("GetLevel")]
|
||||
[Description("Gets the level of the creature.")]
|
||||
public static void GetLevels( CommandEventArgs e )
|
||||
{
|
||||
e.Mobile.SendMessage( "What target do you want to inspect?" );
|
||||
e.Mobile.Target = new InternalTarget();
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
public InternalTarget() : base ( 8, false, TargetFlags.None )
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is Mobile )
|
||||
{
|
||||
Mobile m = (Mobile)targeted;
|
||||
|
||||
from.SendMessage( "" + BaseCreature.MyLevel( m ) + "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage( "Not a valid creature!" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue