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

Is it possible to add multiple specific resource types to mobs?

Discussion in 'Script Support' started by Darklady73, Nov 7, 2018.

  1. Darklady73
    Offline

    Darklady73 New Member

    Joined:
    Feb 5, 2016
    Messages:
    7
    Likes Received:
    0
    I am running a ServUO shard

    Is it possible to do this? Lines in question are
    " public override int Hides { get { return 10; } }
    public override HideType HideType { get { return HideType.Frosted; } } "

    I would like to add Scaled Hides with the Frosted Hides and is it possible to set a random amount between the two types? Like set 10 but make it random for the two types? ( 4 Scaled, 6 Frosted )
    I would love to do this with my dragon scales too.
    Any help on the coding would be greatly appreciated
     
  2. Djeryv
    Offline

    Djeryv Member

    Joined:
    Oct 2, 2014
    Messages:
    60
    Likes Received:
    7
    One way I do this is this...

    public override HideType HideType{ get{ if ( Utility.RandomBool() ){ return HideType.Frozen; } else { return HideType.Goliath; } } }

    ...but you only get one or the other per creature killed and skinned, but at least it is randomized whenever I kill this creature and skin it.
     
    • Two Thumbs Up Two Thumbs Up x 1
  3. Darklady73
    Offline

    Darklady73 New Member

    Joined:
    Feb 5, 2016
    Messages:
    7
    Likes Received:
    0
    Thank you.
     
  4. Greystar
    Offline

    Greystar Member

    Joined:
    Feb 20, 2014
    Messages:
    55
    Likes Received:
    0
    I think you could do something like this too
    public override HideType HideType{ get{ return Utility.RandomBool() ? HideType.Frozen : Utility.RandomBool() ? HideType.Goliath : HideType.RegularLeath } }

    Haven't tried the above but i do intend to one of these days.
     
  5. PigPen
    Online

    PigPen New Member

    Joined:
    Jan 19, 2017
    Messages:
    26
    Likes Received:
    1
    This may be too easy (or me missing something bigger) but could you not remove the public override HideType HideType and instead use something like this:
    Code (C#):
    1.  
    2.             switch ( Utility.Random( 3 ))
    3.             {
    4.                 case 0: PackItem( new HideType.Frozen ( ) ) PackItem( new HideType.Spined ( ) );  break;
    5.                 case 1: PackItem( new HideType.Goliath ( ) ) PackItem( new HideType.Deamon ( ) );  break;
    6.                 case 2: PackItem( new HideType.Spined ( ) ) PackItem( new HideType.Goliath ( ) );   break;
    7.             }
    8.  
     
  6. Taryn
    Offline

    Platinum Donator

    Joined:
    Nov 30, 2016
    Messages:
    3
    Likes Received:
    1
    Another option is to override onCarve on the creature.


    Code (Javascript):
    1.         public override void OnCarve(Mobile from, Corpse corpse, Item with)
    2.         {
    3.             base.OnCarve(from, corpse, with);
    4.  
    5.             //bool CanUse = from.CheckSkill(SkillName.Anatomy, 30, 70);//If you want to put in a skill check you can do something like this
    6.  
    7.             corpse.DropItem(new BarbedHides(Utility.RandomMinMax(1, 3)));
    8.             corpse.DropItem(new HornedHides(Utility.RandomMinMax(5, 20)));
    9.  
    10.         }
     
  7. Djeryv
    Offline

    Djeryv Member

    Joined:
    Oct 2, 2014
    Messages:
    60
    Likes Received:
    7
    This would be better if you want multiple types to appear when you carve. My solution is more designed for a 50/50 chance to get one or the other as I want to reduce the times you get the special hides.

     
Similar Threads: possible add
Forum Title Date
Archived Bug Reports Still possible to get bank checks even with TOL account gold turned on Oct 29, 2018
General Discussion Is it possible to Change the Hue of Oct 13, 2018
Archived Bug Reports Dungeon Despise, it is possible to take the pets out Aug 3, 2018
Archived Bug Reports Possible issue with Fishing Quests Jul 13, 2018
Bug Reports Possible bug - Ninjitsu on Tokuno pet should get Hiding automatically Jul 11, 2018
Archived Bug Reports Possible bug about Dimetrosaur Jun 10, 2018
Script Support Faction ONLY Teleport-er! Possible? May 10, 2018