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

Problem with Item drop

Discussion in 'Script Support' started by RedBeard, Feb 25, 2014.

  1. RedBeard
    Offline

    RedBeard Active Member

    Joined:
    May 19, 2013
    Messages:
    373
    Likes Received:
    73
    Publish Number:
    54
    The scroll transcendence drops fine but other items don't.

    Code (C#):
    1.  
    2.   // distribute a reward to the puzzle solver
    3.   private void GiveReward(Mobile m)
    4.   {
    5.   if (null == m)
    6.   return;
    7.   Item item = null;
    8.   switch (Utility.Random(1))
    9.   {
    10.   case 0:
    11.   item = ScrollofTranscendence.CreateRandom(10, 10);
    12.   break;
    13.   case 1:
    14.   item = (new BoneContainerLich());
    15.   break;
    16.   case 2:
    17.   item = (new ExecutionerPlatformAddonDeed());
    18.   break;
    19.   case 3:
    20.   item = (new GruesomeStandardLich());
    21.   break;
    22.   case 4:
    23.   item = (new SkullTotem());
    24.   break;
    25.   case 5:
    26.   item = (new BagOfGems());
    27.   break;
    28.   case 6:
    29.   // random piece of spawn decoration
    30.   break;
    31.   }
    32.   // drop the item in backpack or bankbox
    33.   if (null != item)
    34.   {
    35.   Container pack = m.Backpack;
    36.   if (null == pack || !pack.TryDropItem(m, item, false))
    37.   m.BankBox.DropItem(item);
    38.   }
    39.   }
    40.  
     
  2. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    That line needs to be;
    Code (C#):
    1. switch (Utility.Random(7))
    :)
     
  3. RedBeard
    Offline

    RedBeard Active Member

    Joined:
    May 19, 2013
    Messages:
    373
    Likes Received:
    73
    lol thanks
     
    • Two Thumbs Up Two Thumbs Up x 1
  4. Ce Jayce
    Offline

    Ce Jayce Member

    Joined:
    Jan 24, 2014
    Messages:
    140
    Likes Received:
    14
    Worst part of this was i read it through about 5 times before going 'oh'...
     
Similar Threads: Problem Item
Forum Title Date
Script Support Item props problem. Oct 25, 2016
Script Support Problems giving item per race Dec 13, 2013
Archived Bug Reports Talisman Slayer problem? Feb 13, 2018
Script Support Our skill growth problem Jan 31, 2018
ServUO Discussion Grizzly Bedlam problems Jan 22, 2018
Archived Bug Reports Container Z Range Problem Jan 1, 2018
Archived Bug Reports Pets reveal hidden master - problem still exist in dungeons Dec 22, 2017