1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

help with script error

Discussion in 'Script Support' started by capnblk, May 15, 2018.

  1. capnblk
    Offline

    capnblk New Member

    Joined:
    Aug 5, 2014
    Messages:
    6
    Likes Received:
    0
    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);
    }
    }
    }
    }
     
  2. Hammerhand
    Offline

    Hammerhand Active Member

    Joined:
    Mar 26, 2013
    Messages:
    858
    Likes Received:
    82
    Have you tried adding the brackets in where it says they are missing?
     
  3. Lagatha
    Offline

    Lagatha Member

    Joined:
    Aug 28, 2016
    Messages:
    42
    Likes Received:
    4
    I just added the 2 brackets to your script and its fine.
     
  4. capnblk
    Offline

    capnblk New Member

    Joined:
    Aug 5, 2014
    Messages:
    6
    Likes Received:
    0
    hi thanks for the replies,@Hammerhand, i did try that not sure why it didnt work, I will try again,@Lagatha, hmm ill try adding them again, not sure why it is not working for me but thanks for letting me know im close.
     
  5. Lagatha
    Offline

    Lagatha Member

    Joined:
    Aug 28, 2016
    Messages:
    42
    Likes Received:
    4
    Here is your script with the change made it works great
     

    Attached Files:

Similar Threads: help script
Forum Title Date
Script Support Help with script [deed not Deleting after use] May 16, 2018
Script Support Looking for help with a script~ Mar 13, 2018
General Discussion Looking for help finding a script Feb 13, 2018
Script Support Need help about an old script... Jan 16, 2018
Script Support Created new server need help with scripts Oct 26, 2017
Script Support Help with a "chest and key" script Oct 22, 2017
Script Support Help with summoner script Oct 6, 2017