capnblk
Member
hello seems i need a bit of help on this script. it all looks ok so im just missing something apparently as the server is throwing errors
CS1513: Line 79: } expected
CS1513: Line 121: } expected..
could someone please guide me because it looks ok. please tell me what im missing . thanks in advance..
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;
namespace Server.Items
{
public class ExtraSelfRepairTarget : Target
{
private ExtraSelfRepairDeed m_Deed;
public ExtraSelfRepairTarget(ExtraSelfRepairDeed deed)
: base(1, false, TargetFlags.None)
{
m_Deed = deed;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Deed.Deleted || m_Deed.RootParent != from)
{
from.SendMessage("You cannot add SelfRepair to that.");
return;
}
if (target is BaseWeapon)
{
BaseWeapon item = (BaseWeapon)target;
if (item is BaseWeapon)
{
if (((BaseWeapon)item).WeaponAttributes.SelfRepair >= 10)
{
from.SendMessage("That item has max SelfRepair increase.");
}
else
{
((BaseWeapon)item).WeaponAttributes.SelfRepair += 1;
from.SendMessage("SelfRepair increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseArmor)
{
BaseArmor item = (BaseArmor)target;
if (item is BaseArmor)
{
if (((BaseArmor)item).ArmorAttributes.SelfRepair >= 10)
{
from.SendMessage("That item has max SelfRepair increase.");
}
else
{
((BaseArmor)item).ArmorAttributes.SelfRepair += 1;
from.SendMessage("SelfRepair increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseShield)
{
BaseShield item = (BaseShield)target;
if (item is BaseShield)
{
if (((BaseShield)item).ArmorAttributes.SelfRepair >= 10)
{
from.SendMessage("That item has max SelfRepair.");
}
else
{
((BaseShield)item).ArmorAttributes.SelfRepair += 1;
from.SendMessage("SelfRepair increase successfully added to item.");
m_Deed.Delete();
}
}
}
public class ExtraSelfRepairDeed : Item
{
[Constructable]
public ExtraSelfRepairDeed()
: base(0x14F0)
{
LootType = LootType.Regular;
Name = "SelfRepair increase +1";
Hue = 1957;
Weight = 1.0;
}
public ExtraSelfRepairDeed(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("The item needs to be in your pack");
}
else
{
from.SendMessage("Which item would you like to add SelfRepair increase to?");
from.Target = new ExtraSelfRepairTarget(this);
}
}
}
}
CS1513: Line 79: } expected
CS1513: Line 121: } expected..
could someone please guide me because it looks ok. please tell me what im missing . thanks in advance..
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;
namespace Server.Items
{
public class ExtraSelfRepairTarget : Target
{
private ExtraSelfRepairDeed m_Deed;
public ExtraSelfRepairTarget(ExtraSelfRepairDeed deed)
: base(1, false, TargetFlags.None)
{
m_Deed = deed;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Deed.Deleted || m_Deed.RootParent != from)
{
from.SendMessage("You cannot add SelfRepair to that.");
return;
}
if (target is BaseWeapon)
{
BaseWeapon item = (BaseWeapon)target;
if (item is BaseWeapon)
{
if (((BaseWeapon)item).WeaponAttributes.SelfRepair >= 10)
{
from.SendMessage("That item has max SelfRepair increase.");
}
else
{
((BaseWeapon)item).WeaponAttributes.SelfRepair += 1;
from.SendMessage("SelfRepair increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseArmor)
{
BaseArmor item = (BaseArmor)target;
if (item is BaseArmor)
{
if (((BaseArmor)item).ArmorAttributes.SelfRepair >= 10)
{
from.SendMessage("That item has max SelfRepair increase.");
}
else
{
((BaseArmor)item).ArmorAttributes.SelfRepair += 1;
from.SendMessage("SelfRepair increase successfully added to item.");
m_Deed.Delete();
}
}
}
else if (target is BaseShield)
{
BaseShield item = (BaseShield)target;
if (item is BaseShield)
{
if (((BaseShield)item).ArmorAttributes.SelfRepair >= 10)
{
from.SendMessage("That item has max SelfRepair.");
}
else
{
((BaseShield)item).ArmorAttributes.SelfRepair += 1;
from.SendMessage("SelfRepair increase successfully added to item.");
m_Deed.Delete();
}
}
}
public class ExtraSelfRepairDeed : Item
{
[Constructable]
public ExtraSelfRepairDeed()
: base(0x14F0)
{
LootType = LootType.Regular;
Name = "SelfRepair increase +1";
Hue = 1957;
Weight = 1.0;
}
public ExtraSelfRepairDeed(Serial serial)
: base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("The item needs to be in your pack");
}
else
{
from.SendMessage("Which item would you like to add SelfRepair increase to?");
from.Target = new ExtraSelfRepairTarget(this);
}
}
}
}