Server.Mobiles.BaseCreature.SpillAcid C# (CSharp) Method

SpillAcid() public method

public SpillAcid ( Mobile target, int Amount ) : void
target Mobile
Amount int
return void
        public void SpillAcid( Mobile target, int Amount )
        {
            if ( (target != null && target.Map == null) || this.Map == null )
                return;

            for ( int i = 0; i < Amount; ++i )
            {
                Point3D loc = this.Location;
                Map map = this.Map;
                Item acid = NewHarmfulItem();

                if ( target != null && target.Map != null && Amount == 1 )
                {
                    loc = target.Location;
                    map = target.Map;
                }
                else
                {
                    bool validLocation = false;
                    for ( int j = 0; !validLocation && j < 10; ++j )
                    {
                        loc = new Point3D(
                            loc.X+(Utility.Random(0,3)-2),
                            loc.Y+(Utility.Random(0,3)-2),
                            loc.Z );
                        loc.Z = map.GetAverageZ( loc.X, loc.Y );
                        validLocation = map.CanFit( loc, 16, false, false ) ;
                    }
                }
                acid.MoveToWorld( loc, map );
            }
        }

Same methods

BaseCreature::SpillAcid ( int Amount ) : void
BaseCreature