How To: Generating Stealable Items

Discussion in 'XmlSpawner Development' started by Chris, Jun 17, 2014.

  1. Chris

    Chris Renaissance Staff
    Renaissance Staff

    Joined:
    May 14, 2012
    Messages:
    3,385
    Likes Received:
    6,195
    Making an existing item stealable:
    to make something stealable, you dont actually have to make any modifications to the item's script (although you can if you want).

    You can do it manually by issuing the [stealable command

    [stealable true

    and target an object. This sets the stealable flag on it. To check to see whether something is stealable just issue the command without an argument

    [stealable

    Spawning items as stealable:
    to spawn something as stealable you would use the STEALABLE keyword, like this

    bridle/STEALABLE/true

    You can do this with anything. In your case, the bridle already has movable set to false in its script, but if you hadnt you could have spawned it as both immovable and stealable with

    bridle/movable/false/STEALABLE/true

    Scripting stealables:
    You can also set the stealable flag in the script. Here is an example

    Code:
      [FlipableAttribute( 0x1024, 0x1025 )] 
      public class StrangeShafts : Item
      { 
         [Constructable] 
         public StrangeShafts() : base( 0x1024 )
         { 
            Movable = false;
            ItemFlags.SetStealable(this,true);
         } 
    
         public StrangeShafts( 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 ); 
    
            int version = reader.ReadInt(); 
         } 
    } 
    
    and this you can just spawn directly

    Creating stealables with just an itemid:
    note, you can actually create stealable rares without having to write any scripts at all. Just take the itemid you want (e.g. 3103 is a broken clock) and spawn it like

    static,3103/movable/false/STEALABLE/true/weight/5/name/a rare broken clock

    and now you have just created and spawned a rare stealable broken clock.

    This can be an easy way to make a lot of unique stealables without having to script them all.

    Original Document by ArteGordon - Modified for use on UO:Renaissance
    Original Article - http://xmlspawner.fr.yuku.com/topic/17#.U6Brk5TiKy4
  2. It'sallALark

    It'sallALark Well-Known Member

    Joined:
    Nov 24, 2015
    Messages:
    783
    Likes Received:
    548
    I think we need more practice with this code!!

Share This Page