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

Looking for help with a script~

Discussion in 'Script Support' started by Altma, Mar 13, 2018.

  1. Altma
    Offline

    Altma New Member

    Joined:
    Feb 22, 2018
    Messages:
    2
    Likes Received:
    0
    (Rewrote thread)

    I'm a complete novice to ServUO & C# and I'm trying to write a basic script to give +.1 skill on consuming an item.

    Code (C#):
    1.  
    2. using System;
    3. using Server;
    4. using Server.Items;
    5. using Server.Gumps;
    6. using Server.Mobiles;
    7. using Server.Network;
    8.  
    9.  
    10. namespace Server.Items
    11. {
    12.     public class TamingBiscuit : Item
    13.     {
    14.         [Constructable]
    15.         public TamingBiscuit() : base( 0x09D2 )
    16.         {
    17.             LootType = LootType.Blessed;
    18.             Movable = true;
    19.             Weight = 0.0;
    20.             Name = "Taming Biscuit";
    21.         }
    22.    
    23.    
    24.         public override void OnDoubleClick( Mobile from )
    25.         {
    26.             PlayerMobile m;
    27.            
    28.                 if ( !IsChildOf( from.Backpack ) )
    29.                 {
    30.                     from.SendMessage ("That must be in your backpack for you to use it."); // That must be in your backpack for you to use it.
    31.                 }
    32.                 else if ( from.Taming >= 125)
    33.                 {
    34.                     from.SendMessage ("You have already reached 125.0 skill.");
    35.                 }
    36.                 else
    37.                 {
    38.                     from.Taming += .1;
    39.                     from.SendMessage ( "You have gained +.1 Animal Taming");
    40.                     Delete();
    41.                 }
    42.         }
    43.  
    44.         public TamingBiscuit ( Serial serial ) : base( serial )
    45.         {
    46.         }
    47.        
    48.         public override void Serialize( GenericWriter writer )
    49.         {
    50.             base.Serialize( writer );
    51.             writer.Write( (int) 0 ); // version
    52.         }
    53.  
    54.         public override void Deserialize( GenericReader reader )
    55.         {
    56.             base.Deserialize( reader );
    57.             int version = reader.ReadInt();
    58.         }
    59.     }
    60. }
    61.  
    I'm not sure what to place as a skill. Where can I find what skills are named?
     
    #1 Altma, Mar 13, 2018
    Last edited by a moderator: Mar 15, 2018
  2. Lokai
    Offline

    Moderator ServUO Developer

    Joined:
    Dec 4, 2014
    Messages:
    1,060
    Likes Received:
    153
    Look at Server/Skills.cs

    In that file there is an enum which lists all the skills: "public enum SkillName"

    For the Taming, you should be using this:

    Code (C#):
    1. from.Skills[SkillName.AnimalTaming].Base
    2.  
    3. or
    4.  
    5. from.Skills[SkillName.AnimalTaming].Value
    6.  
    7. not sure which one.
     
  3. Altma
    Offline

    Altma New Member

    Joined:
    Feb 22, 2018
    Messages:
    2
    Likes Received:
    0
    Thank you very much, Lokai! Worked like a charm. :) I used the first one.
     
Similar Threads: Looking help
Forum Title Date
Looking For Help looking for people to help with my server Jun 20, 2018
Looking For Help UO:Surivive! Looking for help Mar 5, 2018
General Discussion Looking for help finding a script Feb 13, 2018
ServUO Discussion Spawn issues, looking for help Sep 5, 2017
Looking For Help Looking for helpers Sep 3, 2017
Looking For Help Looking for help (bridge servuo<->xenforo) Jul 22, 2017
Looking For Help Looking For Help Jun 26, 2017