|
||
|
|||||||
| Custom Script Release Archive This is a pre-script database archive of what our users had released. |
|
|
Thread Tools | Display Modes |
|
|
#27 (permalink) | |
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
Quote:
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 |
|
|
|
|
|
#28 (permalink) | |
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
Quote:
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. |
|
|
|
|
|
#29 (permalink) |
|
Forum Expert
|
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. |
|
|
|
|
#30 (permalink) |
|
Forum Expert
|
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. |
|
|
|
|
#31 (permalink) | |
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
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:
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." |
|
|
|
|
|
#32 (permalink) | |
|
Forum Expert
|
Quote:
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 |
|
|
|
|
|
#33 (permalink) | |
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
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; Code:
public virtual void OnTick()
{
Code:
bool IsInside = false;
BaseHouse house = null;
if ( mob != null )
{
house = BaseHouse.FindHouseAt( mob.Location, mob.Map, 20 );
if ( house != null )
IsInside = true;
}
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;
}
}
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 ); Code:
SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( #, # ), 0, 0, 100, 0, 0 ); Code:
using Server.Spells;
__________________
Quote:
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. |
|
|
|
|
|
#34 (permalink) |
|
Forum Expert
Join Date: Jul 2005
Age: 31
Posts: 410
|
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. |
|
|
|
|
#35 (permalink) | |
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
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;
__________________
Quote:
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. |
|
|
|
|
|
#36 (permalink) |
|
Forum Expert
Join Date: Jul 2005
Age: 31
Posts: 410
|
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;
}
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. |
|
|
|
|
#37 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
Quote:
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 ); Code:
SpellHelper.Damage( TimeSpan.Zero, (PlayerMobile)mob, Utility.Random( #, # ), 0, 0, 0, 0, 100 );
__________________
Quote:
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. |
||
|
|
|
|
#38 (permalink) | ||
|
Account Terminated
Join Date: Dec 2005
Posts: 116
|
Quote:
Quote:
|