using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;
namespace Server.Items
{
public class SpellChannelingTarget : Target // Create our targeting class (which we derive from the base target class)
{
private SpellChannelingDeed m_Deed;
public SpellChannelingTarget( SpellChannelingDeed deed ) : base( 1, false, TargetFlags.None )
{
m_Deed = deed;
}
protected override void OnTarget( Mobile from, object target ) // Override the protected OnTarget() for our feature
{
if ( target is BaseWeapon )
{
Item item = (Item)target;
if ( ((BaseWeapon)item).Attributes.SpellChanneling == 1 )
{
from.SendMessage( "That already has spell channeling!");
}
else
{
if( item.RootParent != from ) // Make sure its in their pack or they are wearing it
{
from.SendMessage( "You cannot put spell channeling on that there!" ); // You cannot bless that object
}
else
{
((BaseWeapon)item).Attributes.SpellChanneling = 1;
from.SendMessage( "You magically add spell channeling to your weapon...." );
m_Deed.Delete(); // Delete the deed
}
}
}
else
{
from.SendMessage( "You cannot put spell channeling on that" );
}
}
}
public class SpellChannelingDeed : Item // Create the item class which is derived from the base item class
{
[Constructable]
public SpellChannelingDeed() : base( 0x14F0 )
{
Weight = 1.0;
Name = "a Spell Channeling deed";
LootType = LootType.Blessed;
Hue = 0x492;
}
public SpellChannelingDeed( 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 );
LootType = LootType.Blessed;
int version = reader.ReadInt();
}
public override bool DisplayLootType{ get{ return false; } }
public override void OnDoubleClick( Mobile from ) // Override double click of the deed to call our target
{
if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("What item would you like to add spell channeling to?" );
from.Target = new SpellChannelingTarget( this ); // Call our target
}
}
}
}
Total votes: 0
Ultima Online 1 hafta önce
Sunucular 2 hafta önce
Duyurular 3 hafta önce
Sphere Scripting 4 hafta önce
Ultima Online 1 ay önce
Sunucular 1 ay önce
Diğer Oyunlar 1 ay önce
Sunucular 1 ay önce
Ultima Online 1 ay önce
Sunucular 1 ay önce
Ultima Online 2 ay önce
Ultima Online 2 ay önce
2024-10-31 22:47
2024-10-14 17:45
2024-09-26 14:21
2024-07-08 22:50
2024-07-08 22:34
2024-06-19 22:05
2024-06-01 02:19
2024-05-31 21:17
Yorumlar (0)