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

Donations

Total amount
$0.00
Goal
$1,000.00
Back