View Single Post
Old 02-16-2008, 12:04 PM   #37 (permalink)
jayjay100
Lurker
 
Join Date: Feb 2008
Posts: 4
Default

here is the script for "KPcommand" only for daemons...
Quote:
//Script Transformed By: Cherokee/Mule II aka. HotShot

using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Network;
using Server.Targeting;


namespace Server.Commands
{
public class KPSystem
{

public static void Initialize()
{
CommandSystem.Register( "KP", AccessLevel.Player, new CommandEventHandler( KP_OnCommand ) );
}

public static void KP_OnCommand( CommandEventArgs e )
{
PlayerMobile from = e.Mobile as PlayerMobile;

if( from != null )
{
from.Target = new InternalTarget( from );
}
}

private class InternalTarget : Target
{
public InternalTarget( Mobile from ) : base( 8, false, TargetFlags.None )
{
from.SendMessage ( "Target an animal that you own to get their kill point amount." );
}

protected override void OnTarget( Mobile from, object obj )
{
if ( !from.Alive )
{
from.SendMessage( "You may not do that while dead." );

}
else if ( obj is EvolutionDaemon && obj is BaseCreature )
{
BaseCreature bc = (BaseCreature)obj;
EvolutionDaemon eh = (EvolutionDaemon)obj;

if ( eh.Controlled == true && eh.ControlMaster == from )
{
eh.PublicOverheadMessage( MessageType.Regular, eh.SpeechHue, true, eh.Name +" has "+ eh.KP +" kill points.", false );
}
else
{
from.SendMessage( "You do not control this Daemon!" );
}
}
}
}
}
}
jayjay100 is offline   Reply With Quote