Redsnow
Member
Having a problem a with 2 lines below:
Any Suggestions on how I can fix this? or write it better?
Code:
Errors:
+ Customs/2-15-14/UseBest SkillDeed.cs:
CS0103: Line 28: The name 'Attributes' does not exist in the current context
CS0103: Line 36: The name 'Attributes' does not exist in the current context
Code:
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
namespace Server.Items
{
public class UseBestSkillTarget : Target // Create our targeting class (which we derive from the base target class)
{
private UseBestSkillDeed m_Deed;
public UseBestSkillTarget(UseBestSkillDeed 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 (m_Deed.Deleted || m_Deed.RootParent != from)
return;
if (target is Item)
{
Item item = (Item)target;
if ((BaseWeapon)target == WeaponAttributes.UseBestSkill += 1)////PROBLEM
{
from.SendMessage("Use Best Weapon can not be added to that Item");
}
}
else if (target is BaseWeapon)
{
target == WeaponAttributes.UseBestSkill = 1; //////PROBLEM
from.SendMessage("you use the deed on that weapon");
m_Deed.Delete(); // Delete the deed
}
else
from.SendMessage("Use Best Weapon can not be added to that Item");
}
}
public class UseBestSkillDeed : Item
{
public override string DefaultName
{
get { return "an use best skill deed"; }
}
[Constructable]
public UseBestSkillDeed()
: base(0x14F0)
{
Weight = 1.0;
LootType = LootType.Blessed;
}
public UseBestSkillDeed(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("Which item do you wish to put Best Skill on?");
from.Target = new UseBestSkillTarget(this); // Call our target
}
}
}
}
Any Suggestions on how I can fix this? or write it better?