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

Help with script [deed not Deleting after use]

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

  1. capnblk
    Offline

    capnblk New Member

    Joined:
    Aug 5, 2014
    Messages:
    7
    Likes Received:
    0
    hello sorry to bother you geniuses but can someone take a look and tell me why this deed will not delete after use please.. im still learning and just can not figure this one out.. thanks in advance..i am assuming its not giving the command to delete but I have no clue where to begin.

    using System;
    using Server.Network;
    using Server.Prompts;
    using Server.Items;
    using Server.Targeting;
    using Server;
    namespace Server.Items
    {
    public class RegenHitsTarget : Target
    {
    private RegenHitsDeed m_Deed;
    public RegenHitsTarget( RegenHitsDeed deed ) : base( 1, false, TargetFlags.None )
    {
    m_Deed = deed;
    }
    protected override void OnTarget( Mobile from, object target )
    {
    if ( target is BaseWeapon || target is BaseShield || target is BaseJewel || target is BaseArmor )
    {
    Item item = (Item)target;
    if (item is BaseWeapon)
    {
    if ( ((BaseWeapon)item).Attributes.RegenHits == 1 ) from.SendMessage( "That already has regen hits!");
    else
    {
    if( item.RootParent != from ) from.SendMessage( "You can not put regen hits on that there!" );
    else
    {
    ((BaseWeapon)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );
    }
    }
    }
    if (item is BaseShield)
    {
    if ( ((BaseShield)item).Attributes.RegenHits == 1 ) from.SendMessage( "That already has regen hits!");
    else
    {
    if( item.RootParent != from ) from.SendMessage( "You cannot put regen hits on that there!" );
    else
    {
    ((BaseShield)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );
    }
    }
    }
    if (item is BaseArmor)
    {
    if ( ((BaseArmor)item).Attributes.RegenHits == 1 ) from.SendMessage( "That already has regen hits!");
    else
    {
    if( item.RootParent != from ) from.SendMessage( "You cannot put regen hits on that there!" );
    else
    {
    ((BaseArmor)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );
    }
    }
    }
    if (item is BaseJewel)
    {
    if ( ((BaseJewel)item).Attributes.RegenHits == 1 ) from.SendMessage( "That already has regen hits!");
    else
    {
    if( item.RootParent != from ) from.SendMessage( "You cannot put regen hits on that there!" );
    else
    {
    ((BaseJewel)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );
    }
    }
    }
    }
    else from.SendMessage( "You can not put regen hits on that" );
    }
    }
    public class RegenHitsDeed : Item
    {
    [Constructable]
    public RegenHitsDeed() : base( 0x14F0 )
    {
    Name = "Regen Hits deed";
    Hue = 1957;
    }
    public RegenHitsDeed(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 bool DisplayLootType{ get{ return false; } }
    public override void OnDoubleClick( Mobile from )
    {
    if ( !IsChildOf( from.Backpack ) ) from.SendLocalizedMessage( 1042001 );
    else
    {
    from.SendMessage("What item would you like to add regen hits to?" );
    from.Target = new RegenHitsTarget( this );
    }
    }
    }
    }
     
  2. Juzzver
    Offline

    Juzzver Member

    Joined:
    Sep 17, 2013
    Messages:
    176
    Likes Received:
    17
    add removing scroll in those places where the triggered condition to the imposition of bonus body's regeneration
    m_Deed.Delete();
     
  3. capnblk
    Offline

    capnblk New Member

    Joined:
    Aug 5, 2014
    Messages:
    7
    Likes Received:
    0
    thanks for the reply, unfortunately im still learning and have no idea where to begin added those lines.. ill give it a try.. but thank you
     
  4. Juzzver
    Offline

    Juzzver Member

    Joined:
    Sep 17, 2013
    Messages:
    176
    Likes Received:
    17
    after this:
    ((BaseWeapon)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );
    this:
    ((BaseArmor)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );
    and this:
    ((BaseJewel)item).Attributes.RegenHits = 1;
    from.SendMessage( "You magically add regen hits to your item...." );

    add:
    m_Deed.Delete();
     
Similar Threads: Help script
Forum Title Date
Script Support Need help on this script error Jul 14, 2018
Script Support help with script error May 15, 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