bryant

Member
ServUO Version
Publish Unknown
Ultima Expansion
None
Im trying to ADD more then one item to drop at .025 chance
here is what I have but wont compile

add more then one item to drop:
private void FinishEffect( Point3D p )
        {
            Item fish = GiveFish( m_Player.Skills.Fishing.Base / 100 );
            
            if ( fish != null )
            {               
                m_Player.SendMessage( "You empty your catch from the trap." );
                fish.MoveToWorld( m_Player.Location, m_Player.Map );
                    
                Movable = true;
                
                if ( !m_Player.PlaceInBackpack( this ) )
                    MoveToWorld( m_Player.Location, m_Player.Map );
            }
            else if (Utility.RandomDouble() < 0.75)         
            {
                Movable = true;
                
                if ( !m_Player.PlaceInBackpack( this ) )
                    MoveToWorld( m_Player.Location, m_Player.Map );
                    
                    m_Player.SendLocalizedMessage( 1074487 ); // The creatures are too quick for you!
            }   
            else
            {
                this.Delete();
                m_Player.SendMessage( "Your trap is destroyed while trying to pull it from the water." );   
            }
        }   
        
        public Item GiveFish( double skill )
        {
            if ( 0.038 * skill > Utility.RandomDouble() ) return new RockLobster();
            if ( 0.040 * skill > Utility.RandomDouble() ) return new RedRockCrab();
            if ( 0.046 * skill > Utility.RandomDouble() ) return new SpineyLobster();
            if ( 0.052 * skill > Utility.RandomDouble() ) return new SnowCrab();
            if ( 0.058 * skill > Utility.RandomDouble() ) return new Lobster();
            if ( 0.062 * skill > Utility.RandomDouble() ) return new BlueCrab();
            if ( 0.064 * skill > Utility.RandomDouble() ) return new Crab2();
            if ( 0.076 * skill > Utility.RandomDouble() ) return new Prawn();//need to add to seafood cooking maybe with stat boost
            if ( 0.025 * skill > Utility.RandomDouble() ) return new DragonStatueSouth(); || return new DragonStatueEast(); ||    return new dogdragonstatueeast();     
                
            return null;
        }
 
You can't use || in that way, you need to give some random also in that specific case. It should be something on these lines:


C:
public Item GiveFish( double skill )
        {
            if ( 0.038 * skill > Utility.RandomDouble() ) return new RockLobster();
            if ( 0.040 * skill > Utility.RandomDouble() ) return new RedRockCrab();
            if ( 0.046 * skill > Utility.RandomDouble() ) return new SpineyLobster();
            if ( 0.052 * skill > Utility.RandomDouble() ) return new SnowCrab();
            if ( 0.058 * skill > Utility.RandomDouble() ) return new Lobster();
            if ( 0.062 * skill > Utility.RandomDouble() ) return new BlueCrab();
            if ( 0.064 * skill > Utility.RandomDouble() ) return new Crab2();
            if ( 0.076 * skill > Utility.RandomDouble() ) return new Prawn();//need to add to seafood cooking maybe with stat boost
            if (0.025 * skill > Utility.RandomDouble())
            {
                switch (Utility.RandomMinMax(1, 3))
                {
                    case 1: return new DragonStatueSouth();
                    case 2: return new DragonStatueEast();
                    case 3: return new dogdragonstatueeast();
                }
            }
            return null;
        }
 

Active Shards

  • UO Eventine
    Time Of Legends
    • Players
    • 85 Online
    • 137 Peak
  • The Crossroads
    Mondain's Legacy
    • Players
    • 64 Online
    • 138 Peak
  • Insane UO
    Endless Journey
    • Players
    • 62 Online
    • 101 Peak
  • UO: Felucca
    Renaissance
    • Players
    • 57 Online
    • 87 Peak
  • CALYPSO
    Custom (Modern)
    • Players
    • 28 Online
    • 30 Peak
  • Unchained
    Custom (Classic)
    • Players
    • 26 Online
    • 257 Peak
  • Arth
    Custom (Modern)
    • Players
    • 24 Online
    • 34 Peak
  • UO Phoenix
    Custom (Classic)
    • Players
    • 21 Online
    • 35 Peak
  • UOItalia Reborn
    Custom
    • Players
    • 20 Online
    • 37 Peak
  • UO Enigma
    Custom (Modern)
    • Players
    • 19 Online
    • 172 Peak

Donations

Total amount
$0.00
Goal
$500.00
Back