Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 01-11-2006, 06:32 AM   #26 (permalink)
Forum Expert
 
orpheus's Avatar
 
Join Date: Jan 2004
Age: 29
Posts: 353
Send a message via AIM to orpheus Send a message via MSN to orpheus
Default

would be cool to have rare clothes that keep you from freezing.
__________________


They only give you two choices; be a rebel or a slave (So what you do?) So I rebel Like a ulser in the belly of the beast stayin true to it -- the coup/dead prez
orpheus is offline  
Old 01-11-2006, 11:07 AM   #27 (permalink)
Account Terminated
 
Join Date: Dec 2005
Posts: 116
Default

Quote:
Originally Posted by Greystar
Oh i was definitly a player. Im not using my staff account at all this is totally a player account was created as the second account and the only character on the account is greystar. Got not damage when i was struck by lightning but like i said it was probably programatic error caused by me doing a halfassed install attempt with the script. Ill check out the 1.0 version later i like the frostbite option, now all I need to do is mod GD13s effect system for use with desert and arctic regions and im all set. with the lightning caused by storms and the frostbite caused by snow, even though the effect is low its still there, hence making the game that much more interesting. I already added in the swamp mod generously provided by Alari to make walking over swamps poisonous, with different poison levels based on what type of swamp it is.

Ah ic now, your using the first weather.cs I posted, that one doesn't have damage, that was an addition to the 1.0
Chinook is offline  
Old 01-11-2006, 11:11 AM   #28 (permalink)
Account Terminated
 
Join Date: Dec 2005
Posts: 116
Default

Quote:
Originally Posted by orpheus
would be cool to have rare clothes that keep you from freezing.

You can easyly make items that protect against the weather effects by adding a onadd/remove method where you use the "if ( temperature > 10 ) or if ( temperature < -10 )" that the new temp for player is above the temp registered to not allow weather effect on player. When I get home from work tonight I'll post the code for this to make items.
Chinook is offline  
Old 01-24-2006, 10:22 AM   #29 (permalink)
Forum Expert
 
Join Date: Dec 2002
Location: Oregon, U.S.A.
Age: 27
Posts: 1,062
Send a message via ICQ to Vhaldir Send a message via AIM to Vhaldir Send a message via MSN to Vhaldir Send a message via Yahoo to Vhaldir
Default

Perhaps instead of having it do a bolt effect on the playermobile, give it a Point 3D value referenced from the playermobile's position.. ie; bolt effect at point3d ( playermobile's location ) + or - utility.random x and/or y...

(not sure if bolt effect even works this way as I haven't even looked at it, but it's a thought..)

Effects.SendLocationEffect( new Point3D( mobile.X + 1, mobile.Y + 1, mobile.Z ), mobile.Map, 0x4E20, 0 ); //doesn't seem to work with gumps though..

Last edited by Vhaldir; 01-25-2006 at 06:11 PM.
Vhaldir is offline  
Old 01-28-2006, 07:54 AM   #30 (permalink)
Forum Expert
 
Liacs's Avatar
 
Join Date: Mar 2004
Location: Belgium / Germany
Age: 31
Posts: 1,036
Send a message via MSN to Liacs
Default

would it be possible to add something so that you cant be hit by lightning when you are inside a house? that would be even better...
And i tried to find the line where you say that it is 1 to 500 that i am struck. I was struck about 8 times in 10 minutes. that is kind of too much i think
*grins*

thanks for your help.

Lia

Last edited by Liacs; 01-28-2006 at 07:58 AM.
Liacs is offline  
Old 02-10-2006, 02:56 AM   #31 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

btw I found out what my No Damage issue was... it wasn't no damage it was just so small that I healed it right away. I'm thinking about upping the damage and finding a way to make it use the players resistance to that type of damage to reduce overall damage, so that way it doesnt ignore the benefits of armor.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline  
Old 02-10-2006, 01:29 PM   #32 (permalink)
Forum Expert
 
orpheus's Avatar
 
Join Date: Jan 2004
Age: 29
Posts: 353
Send a message via AIM to orpheus Send a message via MSN to orpheus
Default

Quote:
Originally Posted by Greystar
btw I found out what my No Damage issue was... it wasn't no damage it was just so small that I healed it right away. I'm thinking about upping the damage and finding a way to make it use the players resistance to that type of damage to reduce overall damage, so that way it doesnt ignore the benefits of armor.
maybe it should also rely on what kind of armor/weapon material you have, for instance copper is a conductor of electricity, so if you're wearing full copper and have a copper sword it could do some serious damage to you.

and maybe do what the power generators do to you when you make the wrong move.

just some ideas
__________________


They only give you two choices; be a rebel or a slave (So what you do?) So I rebel Like a ulser in the belly of the beast stayin true to it -- the coup/dead prez
orpheus is offline  
Old 02-10-2006, 06:44 PM   #33 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Here is a possible solution to prevent damage from lightning and cold while inside a house, first at the top of your weather.cs file you need to add

Code:
using Server.Multis;
Then further down inside of the following function
Code:
		public virtual void OnTick()
		{
add

Code:
                    bool IsInside = false;
                    BaseHouse house = null;
                    if ( mob != null )
                    {
                        house = BaseHouse.FindHouseAt( mob.Location, mob.Map, 20 );
                        if ( house != null )
                            IsInside = true;
                    }
then make the whole damage section look like the following (keep in mind I changed how often you get struck by lightning.

Code:
                    if ( !IsInside )
                    {
                        if ( temperature > 10 )
                        {
                            switch ( Utility.Random( 1000 ) )
                            {
                                //////////////////////////////////////////////////////////////////////////////////////////////////
                                //Sickness System mod/////////////////////////////////////////////////////////////////////////////
                                //case 0: ((PlayerMobile)mob).Sickness = SickFlag.Headache; break; //uncomment these three lines//
                                //case 1: ((PlayerMobile)mob).Sickness = SickFlag.Cold; break; //comment out case 0,1,2 below/////
                                //case 2: ((PlayerMobile)mob).Sickness = SickFlag.Flu; break; ////////////////////////////////////
                                //////////////////////////////////////////////////////////////////////////////////////////////////
                                case 0:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 2 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a weak lightning bolt!" );
                                        break;
                                    }
                                case 1:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 2 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a weak lightning bolt!" );
                                        break;
                                    }
                                case 2:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 2 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a weak lightning bolt!" );
                                        break;
                                    }
                                case 3:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 5 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a small lightning bolt!" );
                                        break;
                                    }
                                case 4:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 10 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a small lightning bolt!" );
                                        break;
                                    }
                                case 5:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 15 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a small lightning bolt!" );
                                        break;
                                    }
                                case 6:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 20 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a medium lightning bolt!" );
                                        break;
                                    }
                                case 7:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 25 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a medium lightning bolt!" );
                                        break;
                                    }
                                case 8:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 30 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a medium lightning bolt!" );
                                        break;
                                    }
                                case 9:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 35 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a large lightning bolt!" );
                                        break;
                                    }
                                case 10:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 40 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a large lightning bolt!" );
                                        break;
                                    }
                                case 11:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 45 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a large lightning bolt!" );
                                        break;
                                    }
                                case 12:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 50 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a huge lightning bolt!" );
                                        break;
                                    }
                                case 13:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 55 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a huge lightning bolt!" );
                                        break;
                                    }
                                case 14:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 60 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a huge lightning bolt!" );
                                        break;
                                    }
                                case 15:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 65 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a massive lightning bolt!" );
                                        break;
                                    }
                                case 16:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 70 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a massive lightning bolt!" );
                                        break;
                                    }
                                case 17:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 75 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a massive lightning bolt!" );
                                        break;
                                    }
                                case 18:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 5 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 80 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a gigantic lightning bolt!" );
                                        break;
                                    }
                                case 19:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 85 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a gigantic lightning bolt!" );
                                        break;
                                    }
                                case 20:
                                    {
                                        ( (PlayerMobile)mob ).BoltEffect( 0 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 90 ) );
                                        ( (PlayerMobile)mob ).SendMessage( "You were just hit by a gigantic lightning bolt!" );
                                        break;
                                    }
                                default: break;
                            }
                            continue;
                        }
                        if ( temperature < -10 )
                        {
                            switch ( Utility.Random( 100 ) )
                            {
                                ////////////////////////////////////////////////////////////////////////////////////////////////
                                //Sickness System mod///////////////////////////////////////////////////////////////////////////
                                //case 0: ((PlayerMobile)mob).Sickness = SickFlag.Flu; break; //uncomment these two lines///////
                                //case 1: ((PlayerMobile)mob).Sickness = SickFlag.Cold; break; //and comment out case 0,1 below/
                                ////////////////////////////////////////////////////////////////////////////////////////////////
                                case 0:
                                    {
                                        ( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
                                        ( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 2 ) );
                                        ( (PlayerMobile)mob ).PlaySound( 20 );
                                        ( (PlayerMobile)mob ).SendMessage( "You barely feel your skin freezing!!!" );
                                        break;
                                    }
                                case 1:
                                    {
                                        ( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
                                        ( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 3 ) );
                                        ( (PlayerMobile)mob ).PlaySound( 20 );
                                        ( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing!!!" );
                                        break;
                                    }
                                case 2:
                                    {
                                        ( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
                                        ( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 1, 5 ) );
                                        ( (PlayerMobile)mob ).PlaySound( 20 );
                                        ( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing a bit!!!" );
                                        break;
                                    }
                                case 3:
                                    {
                                        ( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
                                        ( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 10 ) );
                                        ( (PlayerMobile)mob ).PlaySound( 20 );
                                        ( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing a little!!!" );
                                        break;
                                    }
                                case 4:
                                    {
                                        ( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
                                        ( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 15 ) );
                                        ( (PlayerMobile)mob ).PlaySound( 20 );
                                        ( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing a lot!!!" );
                                        break;
                                    }
                                case 5:
                                    {
                                        ( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
                                        ( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
                                        ( (PlayerMobile)mob ).Damage( Utility.Random( 5, 20 ) );
                                        ( (PlayerMobile)mob ).PlaySound( 20 );
                                        ( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing very badly!!!" );
                                        break;
                                    }
                                default: break;
                            }
                            continue;
                        }
                    }
that should make it so that while inside a house you won't get damaged. Doing something for buildings in town would be difficult without using a tool like custom regions in a box or putting each building in its own region. Cause then you could make it a region based detection and make it not damage a player if they where inside the building region. I was going to do that with housing but when you do the WHERE command inside of a house it doesnt have a region name so that check won't work. This could probably be edited so that you have to be an Owner of the house for it to protect you, but I figured that didn't make sense, so I left it so as long as a house was found you'd be safe.

also i changed all the ( (PlayerMobile)mob ).Damage( Utility.Random( #, # ) ); to be
For Lightning
Code:
SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( #, # ), 0, 0, 0, 0, 100 );
For Cold
Code:
SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( #, # ), 0, 0, 100, 0, 0 );
and at the top add
Code:
using Server.Spells;
EDIT: Well since I was the last one to post I didn't want to bump it, but I just tried using my 3d client... is their anyway to get the lightning to show on the 3d client?
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."

Last edited by Greystar; 02-21-2006 at 05:22 AM.
Greystar is offline  
Old 02-22-2006, 01:31 PM   #34 (permalink)
Forum Expert
 
Join Date: Jul 2005
Age: 31
Posts: 410
Default I get 3 errors did i do something wrong?

heres the errors i get and the Weather.cs following im not sure if its me that did something wrong or what but could you please help me get this fixed?....thankx in advance....."edit forgot the rest of message lol".....


errors i am getting:

- Error: Scripts\Misc\Weather.cs: CS0103: (line 265, column 9) The name 'mob' does not exist in the class or namespace 'Server.Misc.Weather'
- Error: Scripts\Misc\Weather.cs: CS0246: (line 267, column 36) The type or namespace name 'mob' could not be found (are you missing a using directive or an assembly reference?)
- Error: Scripts\Misc\Weather.cs: CS0246: (line 267, column 50) The type or namespace name 'mob' could not be found (are you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.



Weather.cs:

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Multis;
using Server.Spells;

namespace Server.Misc
{
	public class Weather
	{
		private static Map[] m_Facets;
		private static Hashtable m_WeatherByFacet = new Hashtable();
		
		public static void Initialize()
		{
			m_Facets = new Map[]{ Map.Felucca, Map.Trammel };
			
			/* Static weather:
			 *
			 * Format:
			 *   AddWeather( temperature, chanceOfPercipitation, chanceOfExtremeTemperature, <area ...> );
			 */
			
			// ice island
			AddWeather( -15, 100, 5, new Rectangle2D( 3850, 160, 390, 320 ), new Rectangle2D( 3900, 480, 380, 180 ), new Rectangle2D( 4160, 660, 150, 110 ) );
			
			// covetous entrance, around vesper and minoc
			AddWeather( +15,  50, 5, new Rectangle2D( 2425, 725, 250, 250 ) );
			
			// despise entrance, north of britain
			AddWeather( +15,  50, 5, new Rectangle2D( 1245, 1045, 250, 250 ) );
			
			
			/* Dynamic weather:
			 *
			 * Format:
			 *   AddDynamicWeather( temperature, chanceOfPercipitation, chanceOfExtremeTemperature, moveSpeed, width, height, bounds );
			 */
			
			for ( int i = 0; i < 15; ++i )
				AddDynamicWeather( +15, 100, 5, 8, 400, 400, new Rectangle2D( 0, 0, 5120, 4096 ) );
		}
		
		public static ArrayList GetWeatherList( Map facet )
		{
			if ( facet == null )
				return null;
			
			ArrayList list = (ArrayList)m_WeatherByFacet[facet];
			
			if ( list == null )
				m_WeatherByFacet[facet] = list = new ArrayList();
			
			return list;
		}
		
		public static void AddDynamicWeather( int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, int moveSpeed, int width, int height, Rectangle2D bounds )
		{
			for ( int i = 0; i < m_Facets.Length; ++i )
			{
				Rectangle2D area = new Rectangle2D();
				bool isValid = false;
				
				for ( int j = 0; j < 10; ++j )
				{
					area = new Rectangle2D( bounds.X + Utility.Random( bounds.Width - width ), bounds.Y + Utility.Random( bounds.Height - height ), width, height );
					
					if ( !CheckWeatherConflict( m_Facets[i], null, area ) )
						isValid = true;
					
					if ( isValid )
						break;
				}
				
				if ( !isValid )
					continue;
				
				Weather w = new Weather( m_Facets[i], new Rectangle2D[]{ area }, temperature, chanceOfPercipitation, chanceOfExtremeTemperature, TimeSpan.FromSeconds( 30.0 ) );
				
				w.m_Bounds = bounds;
				w.m_MoveSpeed = moveSpeed;
			}
		}
		
		public static void AddWeather( int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, params Rectangle2D[] area )
		{
			for ( int i = 0; i < m_Facets.Length; ++i )
				new Weather( m_Facets[i], area, temperature, chanceOfPercipitation, chanceOfExtremeTemperature, TimeSpan.FromSeconds( 30.0 ) );
		}
		
		public static bool CheckWeatherConflict( Map facet, Weather exclude, Rectangle2D area )
		{
			ArrayList list = GetWeatherList( facet );
			
			if ( list == null )
				return false;
			
			for ( int i = 0; i < list.Count; ++i )
			{
				Weather w = (Weather)list[i];
				
				if ( w != exclude && w.IntersectsWith( area ) )
					return true;
			}
			
			return false;
		}
		
		private Map m_Facet;
		private Rectangle2D[] m_Area;
		private int m_Temperature;
		private int m_ChanceOfPercipitation;
		private int m_ChanceOfExtremeTemperature;
		
		public Map Facet{ get{ return m_Facet; } }
		public Rectangle2D[] Area{ get{ return m_Area; } set{ m_Area = value; } }
		public int Temperature{ get{ return m_Temperature; } set{ m_Temperature = value; } }
		public int ChanceOfPercipitation{ get{ return m_ChanceOfPercipitation; } set{ m_ChanceOfPercipitation = value; } }
		public int ChanceOfExtremeTemperature{ get{ return m_ChanceOfExtremeTemperature; } set{ m_ChanceOfExtremeTemperature = value; } }
		
		// For dynamic weather:
		private Rectangle2D m_Bounds;
		private int m_MoveSpeed;
		private int m_MoveAngleX, m_MoveAngleY;
		
		public Rectangle2D Bounds{ get{ return m_Bounds; } set{ m_Bounds = value; } }
		public int MoveSpeed{ get{ return m_MoveSpeed; } set{ m_MoveSpeed = value; } }
		public int MoveAngleX{ get{ return m_MoveAngleX; } set{ m_MoveAngleX = value; } }
		public int MoveAngleY{ get{ return m_MoveAngleY; } set{ m_MoveAngleY = value; } }
		
		public static bool CheckIntersection( Rectangle2D r1, Rectangle2D r2 )
		{
			if ( r1.X >= (r2.X + r2.Width) )
				return false;
			
			if ( r2.X >= (r1.X + r1.Width) )
				return false;
			
			if ( r1.Y >= (r2.Y + r2.Height) )
				return false;
			
			if ( r2.Y >= (r1.Y + r1.Height) )
				return false;
			
			return true;
		}
		
		public static bool CheckContains( Rectangle2D big, Rectangle2D small )
		{
			if ( small.X < big.X )
				return false;
			
			if ( small.Y < big.Y )
				return false;
			
			if ( (small.X + small.Width) > (big.X + big.Width) )
				return false;
			
			if ( (small.Y + small.Height) > (big.Y + big.Height) )
				return false;
			
			return true;
		}
		
		public virtual bool IntersectsWith( Rectangle2D area )
		{
			for ( int i = 0; i < m_Area.Length; ++i )
			{
				if ( CheckIntersection( area, m_Area[i] ) )
					return true;
			}
			
			return false;
		}
		
		public Weather( Map facet, Rectangle2D[] area, int temperature, int chanceOfPercipitation, int chanceOfExtremeTemperature, TimeSpan interval )
		{
			m_Facet = facet;
			m_Area = area;
			m_Temperature = temperature;
			m_ChanceOfPercipitation = chanceOfPercipitation;
			m_ChanceOfExtremeTemperature = chanceOfExtremeTemperature;
			
			ArrayList list = GetWeatherList( facet );
			
			if ( list != null )
				list.Add( this );
			
			Timer.DelayCall( TimeSpan.FromSeconds( (0.2+(Utility.RandomDouble()*0.8)) * interval.TotalSeconds ), interval, new TimerCallback( OnTick ) );
		}
		
		public virtual void Reposition()
		{
			if ( m_Area.Length == 0 )
				return;
			
			int width = m_Area[0].Width;
			int height = m_Area[0].Height;
			
			Rectangle2D area = new Rectangle2D();
			bool isValid = false;
			
			for ( int j = 0; j < 10; ++j )
			{
				area = new Rectangle2D( m_Bounds.X + Utility.Random( m_Bounds.Width - width ), m_Bounds.Y + Utility.Random( m_Bounds.Height - height ), width, height );
				
				if ( !CheckWeatherConflict( m_Facet, this, area ) )
					isValid = true;
				
				if ( isValid )
					break;
			}
			
			if ( !isValid )
				return;
			
			m_Area[0] = area;
		}
		
		public virtual void RecalculateMovementAngle()
		{
			double angle = Utility.RandomDouble() * Math.PI * 2.0;
			
			double cos = Math.Cos( angle );
			double sin = Math.Sin( angle );
			
			m_MoveAngleX = (int)(100 * cos);
			m_MoveAngleY = (int)(100 * sin);
		}
		
		public virtual void MoveForward()
		{
			if ( m_Area.Length == 0 )
				return;
			
			for ( int i = 0; i < 5; ++i ) // try 5 times to find a valid spot
			{
				int xOffset = (m_MoveSpeed * m_MoveAngleX) / 100;
				int yOffset = (m_MoveSpeed * m_MoveAngleY) / 100;
				
				Rectangle2D oldArea = m_Area[0];
				Rectangle2D newArea = new Rectangle2D( oldArea.X + xOffset, oldArea.Y + yOffset, oldArea.Width, oldArea.Height );
				
				if ( !CheckWeatherConflict( m_Facet, this, newArea ) && CheckContains( m_Bounds, newArea ) )
				{
					m_Area[0] = newArea;
					break;
				}
				
				RecalculateMovementAngle();
			}
		}
		
		private int m_Stage;
		private bool m_Active;
		private bool m_ExtremeTemperature;
		
		public virtual void OnTick()
		{
			bool IsInside = false;
			BaseHouse house = null;
			if ( mob != null )
			{
				house = BaseHouse.FindHouseAt( mob.Location, mob.Map, 20 );
				if ( house != null )
					IsInside = true;
			}
			if ( m_Stage == 0 )
			{
				m_Active = ( m_ChanceOfPercipitation > Utility.Random( 100 ) );
				m_ExtremeTemperature = ( m_ChanceOfExtremeTemperature > Utility.Random( 100 ) );
				
				if ( m_MoveSpeed > 0 )
				{
					Reposition();
					RecalculateMovementAngle();
				}
			}
			
			if ( m_Active )
			{
				if ( m_Stage > 0 && m_MoveSpeed > 0 )
					MoveForward();
				
				int type, density, temperature;
				
				temperature = m_Temperature;
				
				if ( m_ExtremeTemperature )
					temperature *= -1;
				
				if ( m_Stage < 15 )
				{
					density = m_Stage * 5;
				}
				else
				{
					density = 150 - (m_Stage * 5);
					
					if ( density < 10 )
						density = 10;
					else if ( density > 70 )
						density = 70;
				}
				
				if ( density == 0 )
					type = 0xFE;
				else if ( temperature > 0 )
					type = 0;
				else
					type = 2;
				
				ArrayList states = NetState.Instances;
				
				Packet weatherPacket = null;
				
				for ( int i = 0; i < states.Count; ++i )
				{
					NetState ns = (NetState)states[i];
					Mobile mob = ns.Mobile;
					
					if ( mob == null || mob.Map != m_Facet )
						continue;
					
					bool contains = ( m_Area.Length == 0 );
					
					for ( int j = 0; !contains && j < m_Area.Length; ++j )
						contains = m_Area[j].Contains( mob.Location );
					
					if ( !contains )
						continue;
					
					if ( weatherPacket == null )
						weatherPacket = new Server.Network.Weather( type, density, temperature );
					
					ns.Send( weatherPacket );
					
					if ( !IsInside )
					{
						if ( temperature > 10 )
						{
							switch ( Utility.Random( 1000 ) )
							{
									//////////////////////////////////////////////////////////////////////////////////////////////////
									//Sickness System mod/////////////////////////////////////////////////////////////////////////////
									//case 0: ((PlayerMobile)mob).Sickness = SickFlag.Headache; break; //uncomment these three lines//
									//case 1: ((PlayerMobile)mob).Sickness = SickFlag.Cold; break; //comment out case 0,1,2 below/////
									//case 2: ((PlayerMobile)mob).Sickness = SickFlag.Flu; break; ////////////////////////////////////
									//////////////////////////////////////////////////////////////////////////////////////////////////
								case 0:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 2 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a weak lightning bolt!" );
										break;
									}
								case 1:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 2 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a weak lightning bolt!" );
										break;
									}
								case 2:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 2 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a weak lightning bolt!" );
										break;
									}
								case 3:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 5 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a small lightning bolt!" );
										break;
									}
								case 4:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 10 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a small lightning bolt!" );
										break;
									}
								case 5:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 15 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a small lightning bolt!" );
										break;
									}
								case 6:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 20 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a medium lightning bolt!" );
										break;
									}
								case 7:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 25 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a medium lightning bolt!" );
										break;
									}
								case 8:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 30 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a medium lightning bolt!" );
										break;
									}
								case 9:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 35 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a large lightning bolt!" );
										break;
									}
								case 10:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 3, 40 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a large lightning bolt!" );
										break;
									}
								case 11:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 45 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a large lightning bolt!" );
										break;
									}
								case 12:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 50 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a huge lightning bolt!" );
										break;
									}
								case 13:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 55 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a huge lightning bolt!" );
										break;
									}
								case 14:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 60 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a huge lightning bolt!" );
										break;
									}
								case 15:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 65 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a massive lightning bolt!" );
										break;
									}
								case 16:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 70 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a massive lightning bolt!" );
										break;
									}
								case 17:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 75 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a massive lightning bolt!" );
										break;
									}
								case 18:
									{
										( (PlayerMobile)mob ).BoltEffect( 5 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 80 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a gigantic lightning bolt!" );
										break;
									}
								case 19:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 85 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a gigantic lightning bolt!" );
										break;
									}
								case 20:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 90 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were just hit by a gigantic lightning bolt!" );
										break;
									}
									default: break;
							}
							continue;
						}
						if ( temperature < -10 )
						{
							switch ( Utility.Random( 100 ) )
							{
									////////////////////////////////////////////////////////////////////////////////////////////////
									//Sickness System mod///////////////////////////////////////////////////////////////////////////
									//case 0: ((PlayerMobile)mob).Sickness = SickFlag.Flu; break; //uncomment these two lines///////
									//case 1: ((PlayerMobile)mob).Sickness = SickFlag.Cold; break; //and comment out case 0,1 below/
									////////////////////////////////////////////////////////////////////////////////////////////////
								case 0:
									{
										( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
										( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 2 ), 0, 0, 100, 0, 0 );
										( (PlayerMobile)mob ).PlaySound( 20 );
										( (PlayerMobile)mob ).SendMessage( "You barely feel your skin freezing!!!" );
										break;
									}
								case 1:
									{
										( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
										( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 3 ), 0, 0, 100, 0, 0 );
										( (PlayerMobile)mob ).PlaySound( 20 );
										( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing!!!" );
										break;
									}
								case 2:
									{
										( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
										( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 1, 5 ), 0, 0, 100, 0, 0 );
										( (PlayerMobile)mob ).PlaySound( 20 );
										( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing a bit!!!" );
										break;
									}
								case 3:
									{
										( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
										( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 10 ), 0, 0, 100, 0, 0 );
										( (PlayerMobile)mob ).PlaySound( 20 );
										( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing a little!!!" );
										break;
									}
								case 4:
									{
										( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
										( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 15 ), 0, 0, 100, 0, 0 );
										( (PlayerMobile)mob ).PlaySound( 20 );
										( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing a lot!!!" );
										break;
									}
								case 5:
									{
										( (PlayerMobile)mob ).FixedParticles( 0x37CC, 1, 40, 97, 3, 9917, EffectLayer.Waist );
										( (PlayerMobile)mob ).FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( 5, 20 ), 0, 0, 100, 0, 0 );
										( (PlayerMobile)mob ).PlaySound( 20 );
										( (PlayerMobile)mob ).SendMessage( "You feel as if your skin is freezing very badly!!!" );
										break;
									}
									default: break;
							}
							continue;
						}
					}
					
					m_Stage++;
					m_Stage %= 30;
				}
			}
		}
		
		public class WeatherMap : MapItem
		{
			[Constructable]
			public WeatherMap()
			{
				Name = "weather map";
				SetDisplay( 0, 0, 5119, 4095, 400, 400 );
			}
			
			public override void OnDoubleClick( Mobile from )
			{
				Map facet = from.Map;
				
				if ( facet == null )
					return;
				
				ArrayList list = Weather.GetWeatherList( facet );
				
				ClearPins();
				
				for ( int i = 0; i < list.Count; ++i )
				{
					Weather w = (Weather)list[i];
					
					for ( int j = 0; j < w.Area.Length; ++j )
						AddWorldPin( w.Area[j].X + (w.Area[j].Width/2), w.Area[j].Y + (w.Area[j].Height/2) );
				}
				
				base.OnDoubleClick( from );
			}
			
			public WeatherMap( Serial serial ) : base( serial )
			{
			}
			
			public override void Serialize( GenericWriter writer )
			{
				base.Serialize( writer );
				
				writer.Write( (int) 0 );
			}
			
			public override void Deserialize( GenericReader reader )
			{
				base.Deserialize( reader );
				
				int version = reader.ReadInt();
			}
		}
	}
}

the lines in red are the lines its showing errors

Last edited by wulf monat; 02-22-2006 at 01:36 PM.
wulf monat is offline  
Old 02-22-2006, 02:27 PM   #35 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

That's cause you put the line in red in the wrong spot. Look where mob is defined it's right above the code for the weather to actually do damage.

Code:
			for ( int i = 0; i < states.Count; ++i )
				{
					NetState ns = (NetState)states[i];
					Mobile mob = ns.Mobile;
it should be after that and I don't what what line numbers but as long as its after that and before the spot where IsInside is used you should be alright.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."

Last edited by Greystar; 02-22-2006 at 02:29 PM.
Greystar is offline  
Old 02-22-2006, 04:16 PM   #36 (permalink)
Forum Expert
 
Join Date: Jul 2005
Age: 31
Posts: 410
Default ok got rid of those first errors now i have a whole bunch more for each damage

errors are saying damage takes 2 args.........
i have no idea how to do this args could you show me where to fill in?
errors im getting:


Code:
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 358, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 365, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 372, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 379, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 386, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 393, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 400, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 407, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 414, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 421, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 428, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 435, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 442, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 449, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 456, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 463, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 470, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 477, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 484, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 491, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 498, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 519, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 528, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 537, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 546, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 555, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 564, column 11) No overload for
 method 'Damage' takes '2' arguments
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


i was also wondering since my shard will be pretty uber in everything, if i wanted the damage higher for each effect could i do this?>>>.

Code:
case 0:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob ).Damage( Utility.Random( 1, 2 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were zapped by a weak lightning bolt!" );
										break;
									}
Code:
case 0:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob ).Damage( Utility.Random( 10, 20 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were zapped by a weak lightning bolt!" );
										break;
									}
<<<<<<just added a 0 behind each in the part in red>>>>>>>.will this work to mkae it alot stronger, by changing each one all the way down to whatever damage i want it to do?




Edit instead to avoid bumping this thread:



oh did not notice that
ty you for pointing that out i been looking and looking at it for last few hours trying to see what was wrong, now i see it was wanting 2 args because i had it calling the damage twice on each one, it happened because i copied n pasted from one side of the code and the other in order to keep the original damge numbers (1,2) in there i just went from the wrong spot to paste, ty for the help
it compiled now 0 errors time to go check this out hope i get struck soon....


Another idea i thought would be nice to have with this is say for example:
when a player gets struck by lightning each level of lightning damage would also make the players stats: like strength, mana, dexterity, then have their fame go up alot, making them lord or lady, then karma: if they are -karma make the karma go down, if they have +karma make it go up....



about posting here i wasnt sure where i should have asked you for help at so i tried here since the plan was to combine your idea to his system, ty you both for the mod and the help.

Last edited by wulf monat; 02-22-2006 at 05:53 PM.
wulf monat is offline  
Old 02-22-2006, 05:17 PM   #37 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by wulf monat
errors are saying damage takes 2 args.........
i have no idea how to do this args could you show me where to fill in?
errors im getting:


Code:
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 358, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 365, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 372, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 379, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 386, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 393, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 400, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 407, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 414, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 421, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 428, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 435, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 442, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 449, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 456, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 463, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 470, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 477, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 484, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 491, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 498, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 519, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 528, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 537, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 546, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 555, column 11) No overload for
 method 'Damage' takes '2' arguments
 - Error: Scripts\Misc\Weather.cs: CS1501: (line 564, column 11) No overload for
 method 'Damage' takes '2' arguments
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


i was also wondering since my shard will be pretty uber in everything, if i wanted the damage higher for each effect could i do this?>>>.

Code:
case 0:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob ).Damage( Utility.Random( 1, 2 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were zapped by a weak lightning bolt!" );
										break;
									}
Code:
case 0:
									{
										( (PlayerMobile)mob ).BoltEffect( 0 );
										SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob ).Damage( Utility.Random( 10, 20 ), 0, 0, 0, 0, 100 );
										( (PlayerMobile)mob ).SendMessage( "You were zapped by a weak lightning bolt!" );
										break;
									}
<<<<<<just added a 0 behind each in the part in red>>>>>>>.will this work to mkae it alot stronger, by changing each one all the way down to whatever damage i want it to do?

As far as your error messages I don't know what you changed but to answer your question yes the numbers you changed will increase the amount of damage. Suggestion thoug in the future is always download scripts from the first thread. Suggestions offered by others may not be supported by the original author (that includes suggestions made by me which appears you are trying to use). I know the code works the way I intend it but it may not be the way that the original scripter inteded it to work.

Now I see where your errors lie

look closely at the code you posted
Code:
SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob ).Damage( Utility.Random( 10, 20 ), 0, 0, 0, 0, 100 );
and the code I posted as an example
Code:
SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( #, # ), 0, 0, 0, 0, 100 );
Look where the Utility.Random is in my code and in the one you posted. Your error is, I think cause you are incorrectly using the Damage function inside of ANOTHER Damage function, either or NOT both.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."

Last edited by Greystar; 02-22-2006 at 05:22 PM.
Greystar is offline  
Old 02-22-2006, 10:25 PM   #38 (permalink)
Account Terminated
 
Join Date: Dec 2005
Posts: 116
Default

Quote:
Originally Posted by wulf monat
Another idea i thought would be nice to have with this is say for example:
when a player gets struck by lightning each level of lightning damage would also make the players stats: like strength, mana, dexterity, then have their fame go up alot, making them lord or lady, then karma: if they are -karma make the karma go down, if they have +karma make it go up....
You can add code for the above easy enuff, just remember to think about having them temp changes, or you'll have umber players.


Quote:
Originally Posted by Greystar
Suggestions offered by others may not be supported by the original author (that includes suggestions made by me which appe