Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 11-16-2009, 12:55 AM   #1 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Question NPC script help please !

Can anyone find why my npc kills me when I attack it, It dies instantly and kills me when it dies. I have searched for a reason but i'm new to scripting








Code:
using System;using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server;

namespace Server.Mobiles
{
[CorpseName("Corpse of illidanstormrage")]
public class illidanstorms:ChaosDaemon
{

[Constructable]
public illidanstorms() : base()
{

Name = "illidanstormrage";
SetStr (2000) ;
SetDex (2000) ;
SetInt (2000) ;

SetDamage (200) ;

SetDamageType( ResistanceType.Physical,300) ;
SetDamageType( ResistanceType.Cold,20) ;
SetDamageType( ResistanceType.Fire,100) ;
SetDamageType( ResistanceType.Energy,200) ;
SetDamageType( ResistanceType.Poison,200) ;


SetResistance( ResistanceType.Physical,300) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,100) ;
SetResistance( ResistanceType.Energy,300) ;
SetResistance( ResistanceType.Poison,300) ;







}



		public illidanstorms( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	        public override bool OnBeforeDeath()	
	        {	
	            	
		
	            if (!NoKillAwards)	
	            {	
		
	                Map map = this.Map;	
		
	                if (map != null)	
	                {	
	                    for (int x = -12; x <= 12; ++x)	
	                    {	
	                        for (int y = -12; y <= 12; ++y)	
	                        {	
	                            double dist = Math.Sqrt(x * x + y * y);	
		
	                            if (dist <= 12)	
	                                new GoodiesTimer(map, X + x, Y + y).Start();	
	                        }	
	                    }	
	                }	
	            }	
		
	            return base.OnBeforeDeath();	
	        }	
		
		
	        public override void OnDeath(Container c)	
	        {	
	            if (Map == Map.Felucca)	
	            {	
	                //TODO: Confirm SE change or AoS one too?	
	                List<DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);	
	                List<Mobile> toGive = new List<Mobile>();	
		
	                for (int i = rights.Count - 1; i >= 0; --i)	
	                {	
	                    DamageStore ds = rights[i];	
		
	                    if (ds.m_HasRight)	
	                        toGive.Add(ds.m_Mobile);	
	                }	
		
	            }	
		
	            base.OnDeath(c);	
	        }	
		
		
	        private class GoodiesTimer : Timer	
	        {	
	            private Map m_Map;	
	            private int m_X, m_Y;	
		
	            public GoodiesTimer(Map map, int x, int y)	
	                : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))	
	            {	
	                m_Map = map;	
	                m_X = x;	
	                m_Y = y;	
	            }	
		
	            protected override void OnTick()	
	            {	
	                int z = m_Map.GetAverageZ(m_X, m_Y);	
	                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);	
		
	                for (int i = -3; !canFit && i <= 3; ++i)	
	                {	
	                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);	
		
	                    if (canFit)	
	                        z += i;	
	                }	
		
	                if (!canFit)	
	                    return;	
		
	                Gold g = new Gold(10, 50);	
		
	                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);	
		
	                if (0.5 >= Utility.RandomDouble())	
	                {	
	                    switch (Utility.Random(3))	
	                    {	
	                        case 0: // Fire column	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);	
	                                Effects.PlaySound(g, g.Map, 0x208);	
		
	                                break;	
	                            }	
	                        case 1: // Explosion	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);	
	                                Effects.PlaySound(g, g.Map, 0x307);	
		
	                                break;	
	                            }	
	                        case 2: // Ball of fire	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);	
		
	                                break;	
	                            }	
	                    }	
	                }	
	            }	
	        }	
	}
}
firepants11 is offline   Reply With Quote
Old 11-16-2009, 02:30 AM   #2 (permalink)
Newbie
 
Join Date: Oct 2009
Posts: 77
Default

not sure what you are going for here, but this Line:

public class illidanstorms:ChaosDaemon

Makes him a Chaos Daemon, he will attack you because he is a base Monster, and with the stats you gave him a instant kill seems about right. You called him an NPC, so I'm not sure what you want him to do. What kind of NPC is it supposed to be?
4leaf is offline   Reply With Quote
Old 11-16-2009, 02:38 AM   #3 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Well lets call him a Champion not an NPC lol, even with the stats that high and my characters health at nearly 9.0 million hp he one shots me when i hit him with my sword and im trying to figure out why
firepants11 is offline   Reply With Quote
Old 11-16-2009, 02:50 AM   #4 (permalink)
Newbie
 
Join Date: Oct 2009
Posts: 77
Default

Well, from what I can tell, His Damage has been set to 200, and his strength is 2000, his base damage must be beyond what a normal character is designed for. What is your characters exact HP? If it's not over at least 2200, you will die. Also, his resistances that go over 100 arent necessary. As it stands, only Cold will hurt him as its set to 20. Again, Resists and Damages you have set only need to go to 100, 300% might be multipying the damage, I'd bring those down personally.
4leaf is offline   Reply With Quote
Old 11-16-2009, 03:15 AM   #5 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Ahh ok ok I see I tested it again and he seems to be hitting somewhere around 12million DMG as you said by the multiplying of stats but I still cant find out why he his hitting me when he dies he will only hit me when I kill him
firepants11 is offline   Reply With Quote
Old 11-16-2009, 05:54 AM   #6 (permalink)
Forum Expert
 
Hammerhand's Avatar
 
Join Date: Jan 2006
Location: Look behind you....
Age: 45
Posts: 1,842
Default

HHhhmmm.. lets see here..
Code:
SetStr (2000) ;
SetDex (2000) ;
SetInt (2000) ;

SetDamage (200) ;

SetDamageType( ResistanceType.Physical,300) ;
300 DamageType Physical x 200 Damage x 2000 Strength = 120,000,000 Total possible damage
May or may not be completely accurate, but I think you get the idea. And I think the Dex can actually be adding to it as well in a way, since at 2k Dex, theres no way the monsters gonna miss anyone. As for the "last gasp" attack, I believe thats normal.
__________________
May you have the strength of eagles' wings,
the faith and courage to fly to new heights,
and the wisdom of the universe to carry you there.
Hammerhand is offline   Reply With Quote
Old 11-16-2009, 10:44 PM   #7 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

I am reducing all the stats and I will begin testing him again, Does anyone know any of the lines the actual Illidan Stormrage (World of Warcraft boss) says. so I can make him say these lines would be nice

Edit: And does anyone know what code I put in to make his hp a certain amount cause he is only at 95 hp...

Last edited by firepants11; 11-16-2009 at 10:50 PM.
firepants11 is offline   Reply With Quote
Old 11-16-2009, 11:15 PM   #8 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Ok here is a new problem I get the error on line 8 heres the error:

RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Custom/Illidan.cs:
CS0116: Line 8: A namespace does not directly contain members such as fields
or methods
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.



Code:
//Made by Firepants11
using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server

namespace Server.Mobiles
{
[CorpseName("Corpse of Illidan")]
public class Illidan:GargoyleDestroyer
{

      private static bool m_Talked;
          string[]IllidanSay = new string[]
          {
"You are not Prepared!",
"Foolish mortals you think you can defeat me!",
"MUAHAHAHA! You will all die!!",
"I will paint my face with your blood!!",
};

[Constructable]
public Illidan() : base()
{

Name = "Illidan";
SetStr (20) ;
SetDex (20) ;
SetInt (2000) ;

SetDamage (150) ;

SetDamageType( ResistanceType.Physical,10) ;
SetDamageType( ResistanceType.Cold,20) ;
SetDamageType( ResistanceType.Fire,20) ;
SetDamageType( ResistanceType.Energy,20) ;
SetDamageType( ResistanceType.Poison,20) ;


SetResistance( ResistanceType.Physical,10) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,20) ;
SetResistance( ResistanceType.Energy,1) ;
SetResistance( ResistanceType.Poison,10) ;



VirtualArmor = 100;

ControlSlots = 5;



}

          public override bool AlwaysMurderer{ get{ return true; } }
          public override bool Uncalmable{ get{ return true; } }


		public Illidan( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
            public override void OnMovement( Mobile m, Point3D oldLocation )
            {

                 if( m_Talked == false )
                 {
                      if ( m.InRange( this, 3 ) && m is PlayerMobile)
                       {

                             m_Talked = true;
                             SayRandom(IllidanSay, this );
                             this.Move( GetDirectionTo( m.Location ) );
                             SpamTimer t = new SpamTimer();
                             t.Start();
                        }
                   }
              }

              private class SpamTimer : Timer
              {
                   public SpamTimer() : base( TimeSpan.FromSeconds( 12 ) )
                   {
                        Priority = TimerPriority.OneSecond;
                   }

                   protected override void OnTick()
                   {
                           m_Talked = false;
                   }
               }

               private static void SayRandom( string[] say, Mobile m )
               {
                    m.Say( say[Utility.Random( say.Length )] );
               }
	        public override bool OnBeforeDeath()	
	        {	
	            	
		
	            if (!NoKillAwards)	
	            {	
		
	                Map map = this.Map;	
		
	                if (map != null)	
	                {	
	                    for (int x = -12; x <= 12; ++x)	
	                    {	
	                        for (int y = -12; y <= 12; ++y)	
	                        {	
	                            double dist = Math.Sqrt(x * x + y * y);	
		
	                            if (dist <= 12)	
	                                new GoodiesTimer(map, X + x, Y + y).Start();	
	                        }	
	                    }	
	                }	
	            }	
		
	            return base.OnBeforeDeath();	
	        }	
		
		
	        public override void OnDeath(Container c)	
	        {	
	            if (Map == Map.Felucca)	
	            {	
	                //TODO: Confirm SE change or AoS one too?	
	                List<DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);	
	                List<Mobile> toGive = new List<Mobile>();	
		
	                for (int i = rights.Count - 1; i >= 0; --i)	
	                {	
	                    DamageStore ds = rights[i];	
		
	                    if (ds.m_HasRight)	
	                        toGive.Add(ds.m_Mobile);	
	                }	
		
	            }	
		
	            base.OnDeath(c);	
	        }	
		
		
	        private class GoodiesTimer : Timer	
	        {	
	            private Map m_Map;	
	            private int m_X, m_Y;	
		
	            public GoodiesTimer(Map map, int x, int y)	
	                : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))	
	            {	
	                m_Map = map;	
	                m_X = x;	
	                m_Y = y;	
	            }	
		
	            protected override void OnTick()	
	            {	
	                int z = m_Map.GetAverageZ(m_X, m_Y);	
	                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);	
		
	                for (int i = -3; !canFit && i <= 3; ++i)	
	                {	
	                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);	
		
	                    if (canFit)	
	                        z += i;	
	                }	
		
	                if (!canFit)	
	                    return;	
		
	                Gold g = new Gold(1000, 2000);	
		
	                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);	
		
	                if (0.5 >= Utility.RandomDouble())	
	                {	
	                    switch (Utility.Random(3))	
	                    {	
	                        case 0: // Fire column	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);	
	                                Effects.PlaySound(g, g.Map, 0x208);	
		
	                                break;	
	                            }	
	                        case 1: // Explosion	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);	
	                                Effects.PlaySound(g, g.Map, 0x307);	
		
	                                break;	
	                            }	
	                        case 2: // Ball of fire	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);	
		
	                                break;	
	                            }	
	                    }	
	                }	
	            }	
	        }	
	}
}
firepants11 is offline   Reply With Quote
Old 11-16-2009, 11:58 PM   #9 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Lincoln, IL
Age: 37
Posts: 552
Send a message via MSN to Mad Clown
Default

your error is in this line


public class illidanstorms:ChaosDaemon



should read

public class Illidan : BaseCreature
Mad Clown is offline   Reply With Quote
Old 11-17-2009, 12:10 AM   #10 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Ok i Changed it but now it says the error is in line 7...
firepants11 is offline   Reply With Quote
Old 11-17-2009, 12:12 AM   #11 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Lincoln, IL
Age: 37
Posts: 552
Send a message via MSN to Mad Clown
Default

well whats the error bro if you dont post the error its hard to say what the problem is
Mad Clown is offline   Reply With Quote
Old 11-17-2009, 12:13 AM   #12 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Error:

RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Custom/Illidan.cs:
CS0116: Line 7: A namespace does not directly contain members such as fields
or methods
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.



Edited code:

Code:
//Made by Firepants11
using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server

namespace Server.Mobiles
{
[CorpseName("Corpse of Illidan")]
public class Illidan : BaseCreature
{

      private static bool m_Talked;
          string[]IllidanSay = new string[]
          {
"You are not Prepared!",
"Foolish mortals you think you can defeat me!",
"MUAHAHAHA! You will all die!!",
"I will paint my face with your blood!!",
};

[Constructable]
public Illidan() : base()
{

Name = "Illidan";
SetStr (20) ;
SetDex (20) ;
SetInt (2000) ;

SetDamage (150) ;

SetDamageType( ResistanceType.Physical,10) ;
SetDamageType( ResistanceType.Cold,20) ;
SetDamageType( ResistanceType.Fire,20) ;
SetDamageType( ResistanceType.Energy,20) ;
SetDamageType( ResistanceType.Poison,20) ;


SetResistance( ResistanceType.Physical,10) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,20) ;
SetResistance( ResistanceType.Energy,1) ;
SetResistance( ResistanceType.Poison,10) ;



VirtualArmor = 100;

ControlSlots = 5;



}

          public override bool AlwaysMurderer{ get{ return true; } }
          public override bool Uncalmable{ get{ return true; } }


		public Illidan( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
            public override void OnMovement( Mobile m, Point3D oldLocation )
            {

                 if( m_Talked == false )
                 {
                      if ( m.InRange( this, 3 ) && m is PlayerMobile)
                       {

                             m_Talked = true;
                             SayRandom(IllidanSay, this );
                             this.Move( GetDirectionTo( m.Location ) );
                             SpamTimer t = new SpamTimer();
                             t.Start();
                        }
                   }
              }

              private class SpamTimer : Timer
              {
                   public SpamTimer() : base( TimeSpan.FromSeconds( 12 ) )
                   {
                        Priority = TimerPriority.OneSecond;
                   }

                   protected override void OnTick()
                   {
                           m_Talked = false;
                   }
               }

               private static void SayRandom( string[] say, Mobile m )
               {
                    m.Say( say[Utility.Random( say.Length )] );
               }
	        public override bool OnBeforeDeath()	
	        {	
	            	
		
	            if (!NoKillAwards)	
	            {	
		
	                Map map = this.Map;	
		
	                if (map != null)	
	                {	
	                    for (int x = -12; x <= 12; ++x)	
	                    {	
	                        for (int y = -12; y <= 12; ++y)	
	                        {	
	                            double dist = Math.Sqrt(x * x + y * y);	
		
	                            if (dist <= 12)	
	                                new GoodiesTimer(map, X + x, Y + y).Start();	
	                        }	
	                    }	
	                }	
	            }	
		
	            return base.OnBeforeDeath();	
	        }	
		
		
	        public override void OnDeath(Container c)	
	        {	
	            if (Map == Map.Felucca)	
	            {	
	                //TODO: Confirm SE change or AoS one too?	
	                List<DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);	
	                List<Mobile> toGive = new List<Mobile>();	
		
	                for (int i = rights.Count - 1; i >= 0; --i)	
	                {	
	                    DamageStore ds = rights[i];	
		
	                    if (ds.m_HasRight)	
	                        toGive.Add(ds.m_Mobile);	
	                }	
		
	            }	
		
	            base.OnDeath(c);	
	        }	
		
		
	        private class GoodiesTimer : Timer	
	        {	
	            private Map m_Map;	
	            private int m_X, m_Y;	
		
	            public GoodiesTimer(Map map, int x, int y)	
	                : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))	
	            {	
	                m_Map = map;	
	                m_X = x;	
	                m_Y = y;	
	            }	
		
	            protected override void OnTick()	
	            {	
	                int z = m_Map.GetAverageZ(m_X, m_Y);	
	                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);	
		
	                for (int i = -3; !canFit && i <= 3; ++i)	
	                {	
	                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);	
		
	                    if (canFit)	
	                        z += i;	
	                }	
		
	                if (!canFit)	
	                    return;	
		
	                Gold g = new Gold(1000, 2000);	
		
	                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);	
		
	                if (0.5 >= Utility.RandomDouble())	
	                {	
	                    switch (Utility.Random(3))	
	                    {	
	                        case 0: // Fire column	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);	
	                                Effects.PlaySound(g, g.Map, 0x208);	
		
	                                break;	
	                            }	
	                        case 1: // Explosion	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);	
	                                Effects.PlaySound(g, g.Map, 0x307);	
		
	                                break;	
	                            }	
	                        case 2: // Ball of fire	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);	
		
	                                break;	
	                            }	
	                    }	
	                }	
	            }	
	        }	
	}
}
firepants11 is offline   Reply With Quote
Old 11-17-2009, 12:20 AM   #13 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Lincoln, IL
Age: 37
Posts: 552
Send a message via MSN to Mad Clown
Default

its telling you your not telling it ANYTHING about what it is its speed its AI what it looks like its all empty

[Constructable]
public Illidan() : base() //you have to have info in here man
{

Name = "Illidan";
SetStr (20) ;
SetDex (20) ;



look at this

[Constructable] // this tells it its a mage AI it attacks closest target range is 10 and its speeds
public Diablo () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Diablo";
Body = 102; // this is what it looks like you need to get the ID of the mob you want
BaseSoundID = 357; // this is the mobs sound it makes
Hue = 1157; // this is its color with out this it will be default color


all this info has to be present for the script to know what it is how it acts what it does ALSO you have no skills on this monster under this section

SetResistance( ResistanceType.Physical,10) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,20) ;
SetResistance( ResistanceType.Energy,1) ;
SetResistance( ResistanceType.Poison,10) ;


you need to add something like this

SetSkill( SkillName.Anatomy, 100.0, 120.0 );
SetSkill( SkillName.EvalInt, 90.1, 110.0 );
SetSkill( SkillName.Magery, 95.5, 110.0 );
SetSkill( SkillName.Meditation, 65.1, 90.0 );
SetSkill( SkillName.MagicResist, 100.5, 150.0 );
SetSkill( SkillName.Tactics, 100.0, 120.0 );
SetSkill( SkillName.Wrestling, 100.0, 120.0 );


also your resist are low but if thats ment to be thats fine but you can also do something like this.... this will make the resist more random per say phy will be 10-50 could be 36 or what not but thats up to you just a suggestion

SetResistance( ResistanceType.Physical,10,50) ;
SetResistance( ResistanceType.Cold,20,50) ;
SetResistance( ResistanceType.Fire,20,50) ;
SetResistance( ResistanceType.Energy,1,10) ;
SetResistance( ResistanceType.Poison,10,50) ;


this should take care of ya i think
Mad Clown is offline   Reply With Quote
Old 11-17-2009, 12:31 AM   #14 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Sorry I'm not really script smart as you can tell, I guess i'll take what you gave me and work with it the best I can.
firepants11 is offline   Reply With Quote
Old 11-17-2009, 12:37 AM   #15 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Lincoln, IL
Age: 37
Posts: 552
Send a message via MSN to Mad Clown
Default

thats ok i started out just like you if you never ask you will never know let me know if it compiles and works
Mad Clown is offline   Reply With Quote
Old 11-17-2009, 12:43 AM   #16 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Mmmm It gave me the same error as last time I think im just adding the code wrong or messing it up to much


Code:
//Made by Firepants11
using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server

namespace Server.Mobiles
{
[CorpseName("Corpse of Illidan")]
public class Illidan : BaseCreature
{

      private static bool m_Talked;
          string[]IllidanSay = new string[]
          {
"You are not Prepared!",
"Foolish mortals you think you can defeat me!",
"MUAHAHAHA! You will all die!!",
"I will paint my face with your blood!!",
};

[Constructable]
public Illidan () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Illidan";
Body = 755; 
BaseSoundID = 357; 

SetStr (20) ;
SetDex (20) ;
SetInt (2000) ;

SetDamage (150) ;

SetDamageType( ResistanceType.Physical,10) ;
SetDamageType( ResistanceType.Cold,20) ;
SetDamageType( ResistanceType.Fire,20) ;
SetDamageType( ResistanceType.Energy,20) ;
SetDamageType( ResistanceType.Poison,20) ;


SetResistance( ResistanceType.Physical,10) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,20) ;
SetResistance( ResistanceType.Energy,1) ;
SetResistance( ResistanceType.Poison,10) ;



VirtualArmor = 100;

ControlSlots = 5;



}

          public override bool AlwaysMurderer{ get{ return true; } }
          public override bool Uncalmable{ get{ return true; } }


		public Illidan( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
            public override void OnMovement( Mobile m, Point3D oldLocation )
            {

                 if( m_Talked == false )
                 {
                      if ( m.InRange( this, 3 ) && m is PlayerMobile)
                       {

                             m_Talked = true;
                             SayRandom(IllidanSay, this );
                             this.Move( GetDirectionTo( m.Location ) );
                             SpamTimer t = new SpamTimer();
                             t.Start();
                        }
                   }
              }

              private class SpamTimer : Timer
              {
                   public SpamTimer() : base( TimeSpan.FromSeconds( 12 ) )
                   {
                        Priority = TimerPriority.OneSecond;
                   }

                   protected override void OnTick()
                   {
                           m_Talked = false;
                   }
               }

               private static void SayRandom( string[] say, Mobile m )
               {
                    m.Say( say[Utility.Random( say.Length )] );
               }
	        public override bool OnBeforeDeath()	
	        {	
	            	
		
	            if (!NoKillAwards)	
	            {	
		
	                Map map = this.Map;	
		
	                if (map != null)	
	                {	
	                    for (int x = -12; x <= 12; ++x)	
	                    {	
	                        for (int y = -12; y <= 12; ++y)	
	                        {	
	                            double dist = Math.Sqrt(x * x + y * y);	
		
	                            if (dist <= 12)	
	                                new GoodiesTimer(map, X + x, Y + y).Start();	
	                        }	
	                    }	
	                }	
	            }	
		
	            return base.OnBeforeDeath();	
	        }	
		
		
	        public override void OnDeath(Container c)	
	        {	
	            if (Map == Map.Felucca)	
	            {	
	                //TODO: Confirm SE change or AoS one too?	
	                List<DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);	
	                List<Mobile> toGive = new List<Mobile>();	
		
	                for (int i = rights.Count - 1; i >= 0; --i)	
	                {	
	                    DamageStore ds = rights[i];	
		
	                    if (ds.m_HasRight)	
	                        toGive.Add(ds.m_Mobile);	
	                }	
		
	            }	
		
	            base.OnDeath(c);	
	        }	
		
		
	        private class GoodiesTimer : Timer	
	        {	
	            private Map m_Map;	
	            private int m_X, m_Y;	
		
	            public GoodiesTimer(Map map, int x, int y)	
	                : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))	
	            {	
	                m_Map = map;	
	                m_X = x;	
	                m_Y = y;	
	            }	
		
	            protected override void OnTick()	
	            {	
	                int z = m_Map.GetAverageZ(m_X, m_Y);	
	                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);	
		
	                for (int i = -3; !canFit && i <= 3; ++i)	
	                {	
	                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);	
		
	                    if (canFit)	
	                        z += i;	
	                }	
		
	                if (!canFit)	
	                    return;	
		
	                Gold g = new Gold(1000, 2000);	
		
	                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);	
		
	                if (0.5 >= Utility.RandomDouble())	
	                {	
	                    switch (Utility.Random(3))	
	                    {	
	                        case 0: // Fire column	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);	
	                                Effects.PlaySound(g, g.Map, 0x208);	
		
	                                break;	
	                            }	
	                        case 1: // Explosion	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);	
	                                Effects.PlaySound(g, g.Map, 0x307);	
		
	                                break;	
	                            }	
	                        case 2: // Ball of fire	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);	
		
	                                break;	
	                            }	
	                    }	
	                }	
	            }	
	        }	
	}
}
firepants11 is offline   Reply With Quote
Old 11-17-2009, 01:09 AM   #17 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Lincoln, IL
Age: 37
Posts: 552
Send a message via MSN to Mad Clown
Default

hmmm man i dont know i would try to remove your speech bool you can add something like this instead

HTML Code:
	{
		public static TimeSpan TalkDelay = TimeSpan.FromSeconds( 5.0 ); //the delay between talks is 10 seconds
		public DateTime m_NextTalk;


		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( DateTime.Now >= m_NextTalk && InRange( m, 4 ) && InLOS( m ) ) // check if it's time to talk & mobile in range & in los.
			{
				m_NextTalk = DateTime.Now + TalkDelay; // set next talk time 
                if (m.Hidden == false)
                switch ( Utility.Random( 1 ))
				{
                    case 0: Say("Hey" + m.Name + "You are not Prepared!"); //make it say ... 
					
						break;
			
			
    case 0: Say("Foolish mortals you think you can defeat me!"); //make it say ... 
					
						break;

  
  case 1: Say("MUAHAHAHA! You will all die!!"); //make it say ... 
					
						break;


    case 2: Say("Hey" + m.Name + "You are not Prepared!"); //make it say ... 
					
						break;

  case 2: Say("Ha" + m.Name + "I will paint my face with your blood!!"); //make it say ... 
					
						break;

	};
		
			}
		}
your final code should look like this


HTML Code:
//Made by Firepants11
using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server

namespace Server.Mobiles
{
[CorpseName("Corpse of Illidan")]
public class Illidan : BaseCreature
	{
		public static TimeSpan TalkDelay = TimeSpan.FromSeconds( 5.0 ); //the delay between talks is 5 seconds
		public DateTime m_NextTalk;

		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( DateTime.Now >= m_NextTalk && InRange( m, 4 ) && InLOS( m ) ) // check if it's time to talk & mobile in range & in los.
			{
				m_NextTalk = DateTime.Now + TalkDelay; // set next talk time 
                if (m.Hidden == false)
                switch ( Utility.Random( 4 ))
				{
    case 0: Say("Hey" + m.Name + "You are not Prepared!"); //make it say ... 
					
						break;
				
    case 1: Say("Foolish mortals you think you can defeat me!"); //make it say ... 
					
						break;

   case 2: Say("MUAHAHAHA! You will all die!!"); //make it say ... 
					
						break;


   case 3: Say("Ha" + m.Name + "I will paint my face with your blood!!"); //make it say ... 
					
						break;

	  };
		
       }
 }

[Constructable]
public Illidan () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Illidan";
Body = 755; 
BaseSoundID = 357; 

SetStr (20) ;
SetDex (20) ;
SetInt (2000) ;

SetDamage (150) ;

SetDamageType( ResistanceType.Physical,10) ;
SetDamageType( ResistanceType.Cold,20) ;
SetDamageType( ResistanceType.Fire,20) ;
SetDamageType( ResistanceType.Energy,20) ;
SetDamageType( ResistanceType.Poison,20) ;


SetResistance( ResistanceType.Physical,10) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,20) ;
SetResistance( ResistanceType.Energy,1) ;
SetResistance( ResistanceType.Poison,10) ;



VirtualArmor = 100;

ControlSlots = 5;



}

          public override bool AlwaysMurderer{ get{ return true; } }
          public override bool Uncalmable{ get{ return true; } }


		public Illidan( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}

	        public override bool OnBeforeDeath()	
	        {	
	            	
		
	            if (!NoKillAwards)	
	            {	
		
	                Map map = this.Map;	
		
	                if (map != null)	
	                {	
	                    for (int x = -12; x <= 12; ++x)	
	                    {	
	                        for (int y = -12; y <= 12; ++y)	
	                        {	
	                            double dist = Math.Sqrt(x * x + y * y);	
		
	                            if (dist <= 12)	
	                                new GoodiesTimer(map, X + x, Y + y).Start();	
	                        }	
	                    }	
	                }	
	            }	
		
	            return base.OnBeforeDeath();	
	        }	
		
		
	        public override void OnDeath(Container c)	
	        {	
	            if (Map == Map.Felucca)	
	            {	
	                //TODO: Confirm SE change or AoS one too?	
	                List<DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);	
	                List<Mobile> toGive = new List<Mobile>();	
		
	                for (int i = rights.Count - 1; i >= 0; --i)	
	                {	
	                    DamageStore ds = rights[i];	
		
	                    if (ds.m_HasRight)	
	                        toGive.Add(ds.m_Mobile);	
	                }	
		
	            }	
		
	            base.OnDeath(c);	
	        }	
		
		
	        private class GoodiesTimer : Timer	
	        {	
	            private Map m_Map;	
	            private int m_X, m_Y;	
		
	            public GoodiesTimer(Map map, int x, int y)	
	                : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))	
	            {	
	                m_Map = map;	
	                m_X = x;	
	                m_Y = y;	
	            }	
		
	            protected override void OnTick()	
	            {	
	                int z = m_Map.GetAverageZ(m_X, m_Y);	
	                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);	
		
	                for (int i = -3; !canFit && i <= 3; ++i)	
	                {	
	                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);	
		
	                    if (canFit)	
	                        z += i;	
	                }	
		
	                if (!canFit)	
	                    return;	
		
	                Gold g = new Gold(1000, 2000);	
		
	                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);	
		
	                if (0.5 >= Utility.RandomDouble())	
	                {	
	                    switch (Utility.Random(3))	
	                    {	
	                        case 0: // Fire column	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);	
	                                Effects.PlaySound(g, g.Map, 0x208);	
		
	                                break;	
	                            }	
	                        case 1: // Explosion	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);	
	                                Effects.PlaySound(g, g.Map, 0x307);	
		
	                                break;	
	                            }	
	                        case 2: // Ball of fire	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);	
		
	                                break;	
	                            }	
	                    }	
	                }	
	            }	
	        }	
	}
}
i got a moblie that uses this i know it compiles and works
Mad Clown is offline   Reply With Quote
Old 11-17-2009, 01:22 AM   #18 (permalink)
Lurker
 
Join Date: Aug 2007
Posts: 23
Default

Hmm ok thanks But for a little while I'm going to stay with scripting Items and armor, I am not that great with Mobiles hehe
firepants11 is offline   Reply With Quote
Old 11-17-2009, 02:21 AM   #19 (permalink)
Forum Novice
 
Join Date: Sep 2009
Location: endtimes.no-ip.biz ;2593
Posts: 237
Default

take a preexisting script and start small.

The Chaos Demon script......................

Code:
using System;
using System.Collections;
using Server.Items;
using Server.Targeting;

namespace Server.Mobiles
{
	[CorpseName( "a Firepants11 corpse" )]
	public class Firepants11 : BaseCreature
	{

		[Constructable]
		public Firepants11() : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "Firepants 11";
			Body = 689;
			BaseSoundID = 0x3E9;

			SetStr( 706, 830 );
			SetDex( 91, 150 );
			SetInt( 156, 180 );

			SetHits( 391, 410 );

			SetDamage( 44, 57 );

			SetDamageType( ResistanceType.Physical, 55 );
			SetDamageType( ResistanceType.Energy 15 );
			SetDamageType( ResistanceType15 );.Fire 15 );
			SetDamageType( ResistanceType15 );.Cold 15 );

			SetResistance( ResistanceType.Physical, 50, 80 );
			SetResistance( ResistanceType.Fire, 60, 80 );
			SetResistance( ResistanceType.Cold, 70, 80 );
			SetResistance( ResistanceType.Poison, 20, 30 );
			SetResistance( ResistanceType.Energy, 20, 80 );

			SetSkill( SkillName.MagicResist, 85.1, 95.0 );
			SetSkill( SkillName.Tactics, 70.1, 80.0 );
			SetSkill( SkillName.Wrestling, 95.1, 100.0 );
			SetSkill( SkillName.Magery, 95.1, 100.0 );
			SetSkill( SkillName.EvalInt, 95.1, 100.0 );
			SetSkill( SkillName.AnimalLore, 164.0, 200.0 );
			SetSkill( SkillName.AnimalTaming, 190.0, 200.0 );
			SetSkill( SkillName.Veterinary, 165.0, 188.0 );

			Fame = 17000;
			Karma = -17000;

			VirtualArmor = 65;

			Tamable = true;
			ControlSlots = 6;
			MinTameSkill = 193.9;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.Average );
			AddLoot( LootPack.Meager );
			AddLoot( LootPack.Rich );
			AddLoot( LootPack.Gems, 8 );
		}

		public override bool ReacquireOnMovement{ get{ return !Controlled; } }
		public override bool HasBreath{ get{ return true; } } // fire breath enabled
		public override bool AutoDispel{ get{ return !Controlled; } }
		public override int TreasureMapLevel{ get{ return 4; } }
		public override bool CanAngerOnTame { get { return true; } }
		public override FoodType FavoriteFood{ get{ return FoodType.SushiRolls; } }

		public Firepants11( 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();
		}
	}
}
Well anyways I started with the basic Chaos Demon script.

Ended up removing its gaining a weapoin skill move.

Added alot of things it couldn't do.

Made it tamable with conditions.

names it.

makes its favorit food.

makes it very hungry all the time.

start with little tweaks and look at alot of other scripts. Learn to combine them..
__________________
Because sometimes you have to fight the evil, and sometimes you have to be the evil

Last edited by Stygian Stalker; 11-17-2009 at 02:25 AM.
Stygian Stalker is offline   Reply With Quote
Old 11-17-2009, 02:34 AM   #20 (permalink)
Forum Novice
 
Join Date: Oct 2009
Age: 24
Posts: 133
Default

*face palm*
change
Code:
using Server.Engines.CannedEvil;;
to
Code:
using Server.Engines.CannedEvil;
you have an extra ;
that is your error

Code:
//Made by Firepants11
using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server

namespace Server.Mobiles
{
[CorpseName("Corpse of Illidan")]
public class Illidan : BaseCreature
{

      private static bool m_Talked;
          string[]IllidanSay = new string[]
          {
"You are not Prepared!",
"Foolish mortals you think you can defeat me!",
"MUAHAHAHA! You will all die!!",
"I will paint my face with your blood!!",
};

[Constructable]
public Illidan () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Illidan";
Body = 755; 
BaseSoundID = 357; 

SetStr (20) ;
SetDex (20) ;
SetInt (2000) ;

SetDamage (150) ;

SetDamageType( ResistanceType.Physical,10) ;
SetDamageType( ResistanceType.Cold,20) ;
SetDamageType( ResistanceType.Fire,20) ;
SetDamageType( ResistanceType.Energy,20) ;
SetDamageType( ResistanceType.Poison,20) ;


SetResistance( ResistanceType.Physical,10) ;
SetResistance( ResistanceType.Cold,20) ;
SetResistance( ResistanceType.Fire,20) ;
SetResistance( ResistanceType.Energy,1) ;
SetResistance( ResistanceType.Poison,10) ;



VirtualArmor = 100;

ControlSlots = 5;



}

          public override bool AlwaysMurderer{ get{ return true; } }
          public override bool Uncalmable{ get{ return true; } }


		public Illidan( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
            public override void OnMovement( Mobile m, Point3D oldLocation )
            {

                 if( m_Talked == false )
                 {
                      if ( m.InRange( this, 3 ) && m is PlayerMobile)
                       {

                             m_Talked = true;
                             SayRandom(IllidanSay, this );
                             this.Move( GetDirectionTo( m.Location ) );
                             SpamTimer t = new SpamTimer();
                             t.Start();
                        }
                   }
              }

              private class SpamTimer : Timer
              {
                   public SpamTimer() : base( TimeSpan.FromSeconds( 12 ) )
                   {
                        Priority = TimerPriority.OneSecond;
                   }

                   protected override void OnTick()
                   {
                           m_Talked = false;
                   }
               }

               private static void SayRandom( string[] say, Mobile m )
               {
                    m.Say( say[Utility.Random( say.Length )] );
               }
	        public override bool OnBeforeDeath()	
	        {	
	            	
		
	            if (!NoKillAwards)	
	            {	
		
	                Map map = this.Map;	
		
	                if (map != null)	
	                {	
	                    for (int x = -12; x <= 12; ++x)	
	                    {	
	                        for (int y = -12; y <= 12; ++y)	
	                        {	
	                            double dist = Math.Sqrt(x * x + y * y);	
		
	                            if (dist <= 12)	
	                                new GoodiesTimer(map, X + x, Y + y).Start();	
	                        }	
	                    }	
	                }	
	            }	
		
	            return base.OnBeforeDeath();	
	        }	
		
		
	        public override void OnDeath(Container c)	
	        {	
	            if (Map == Map.Felucca)	
	            {	
	                //TODO: Confirm SE change or AoS one too?	
	                List<DamageStore> rights = BaseCreature.GetLootingRights(this.DamageEntries, this.HitsMax);	
	                List<Mobile> toGive = new List<Mobile>();	
		
	                for (int i = rights.Count - 1; i >= 0; --i)	
	                {	
	                    DamageStore ds = rights[i];	
		
	                    if (ds.m_HasRight)	
	                        toGive.Add(ds.m_Mobile);	
	                }	
		
	            }	
		
	            base.OnDeath(c);	
	        }	
		
		
	        private class GoodiesTimer : Timer	
	        {	
	            private Map m_Map;	
	            private int m_X, m_Y;	
		
	            public GoodiesTimer(Map map, int x, int y)	
	                : base(TimeSpan.FromSeconds(Utility.RandomDouble() * 10.0))	
	            {	
	                m_Map = map;	
	                m_X = x;	
	                m_Y = y;	
	            }	
		
	            protected override void OnTick()	
	            {	
	                int z = m_Map.GetAverageZ(m_X, m_Y);	
	                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);	
		
	                for (int i = -3; !canFit && i <= 3; ++i)	
	                {	
	                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);	
		
	                    if (canFit)	
	                        z += i;	
	                }	
		
	                if (!canFit)	
	                    return;	
		
	                Gold g = new Gold(1000, 2000);	
		
	                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);	
		
	                if (0.5 >= Utility.RandomDouble())	
	                {	
	                    switch (Utility.Random(3))	
	                    {	
	                        case 0: // Fire column	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);	
	                                Effects.PlaySound(g, g.Map, 0x208);	
		
	                                break;	
	                            }	
	                        case 1: // Explosion	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);	
	                                Effects.PlaySound(g, g.Map, 0x307);	
		
	                                break;	
	                            }	
	                        case 2: // Ball of fire	
	                            {	
	                                Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);	
		
	                                break;	
	                            }	
	                    }	
	                }	
	            }	
	        }	
	}
}
__________________
Seriously, don't take me seriously, unless i tell you i am being serious, i am not, seriously.
starlazer is offline   Reply With Quote
Old 11-17-2009, 10:34 AM   #21 (permalink)
Forum Novice
 
Join Date: Jul 2004
Location: Lincoln, IL
Age: 37
Posts: 552
Send a message via MSN to Mad Clown
Default

HAHA how did i overlook that good find


using System;
using Server.Network;
using Server.Items;
using Server.ContextMenus;
using Server.Misc;
using Server.Engines.CannedEvil;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
using Server;


there thats them all fixed you also did not have ; behind server
Mad Clown is offline   Reply With Quote
Old 11-17-2009, 10:45 AM   #22 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,083
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

It actually doesn't matter how many of the ';' character there are, it represents a code-escape to the compiler, so having multiple ';' will still compile.

However, not having a ';' as you see, will cause it to throw errors

Here's a tip, if you want to keep your code tidy (when word wrapping is off), whitespace is pretty much completely removed at compile time, so the code below would still compile;

Code:
public class MyClass
{
        public MyClass()
        { }

        public override void ToString()
        {
                return String.Format("Type: {0} | HashCode: {1}",

                           this.GetType().FullName,
                    this.GetHashCode()
                );
        }
}
Which would end up compiling into;

Code:
public class MyClass{public MyClass(){}public override void ToString(){return String.Format("Type: {0} | HashCode: {1:X8}",this.GetType().FullName,this.GetHashCode());}}
__________________

[_] The Care Box is empty :(

Last edited by Vorspire; 11-17-2009 at 10:51 AM.
Vorspire is offline   Reply With Quote
Old 11-17-2009, 12:18 PM   #23 (permalink)
Forum Expert
 
Murzin's Avatar
 
Join Date: Nov 2004
Posts: 2,121
Send a message via AIM to Murzin
Default

yup, if you want to see "shorthand" code with a lot of the white space removed, look at my teleport book...

if you expand it all the way out its like 1500 lines, but i have it in like 300 lines

all proper indention and line seperation do is make it easier to see where your errors are and the logic flow.

once you get all those problems done, you can actually eliminate all the white space
Murzin is offline   Reply With Quote
Old 11-17-2009, 11:51 PM   #24 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,083
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Quote:
Originally Posted by Murzin View Post
once you get all those problems done, you can actually eliminate all the white space
Which is pretty pointless if you want to make future edits to your code, because the compiler does that for you anyway...
__________________

[_] The Care Box is empty :(
Vorspire is offline   Reply With Quote
Old 11-18-2009, 12:49 AM   #25 (permalink)
Forum Expert
 
Murzin's Avatar
 
Join Date: Nov 2004
Posts: 2,121
Send a message via AIM to Murzin
Default

its not pointless, it does have merit
Murzin is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5