Programming For Idiots (Tutorial) - In C#

10/19/2008 01:46 ssjdennis#121
Nice, I have use AutoIT, but Now I will use C#.
THx
10/28/2008 23:23 NovaCygni#122
Quote:
Originally Posted by ssjdennis View Post
Nice, I have use AutoIT, but Now I will use C#.
THx
bumped useful thread
10/30/2008 18:06 hiei3#123
thanks =)
11/01/2008 18:17 bob_pimper#124
sorry to inform you, only a noob would use Visual C# Compiler

if you think i'm a retard who can't script worth shit and just want to flame, here is something i made 2 years ago for a custom server, without Visual C# Compiler, i used NOTEPAD ONLY!


Code:
using System;
using System.Collections;
using Server;
using Server.Misc;
using Server.Items;
using Server.Spells;

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

		private bool m_TrueForm;


		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 2 ) )
			{
				default:
				case 0: return WeaponAbility.DoubleStrike;
				case 1: return WeaponAbility.WhirlwindAttack;
			}
		}


		[Constructable]
		public FHBE() : base( AIType.AI_Mage, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			Name = "The Flaming Haired, Blazing Eyed, Flame Haze";
			Body = 770;

			SetStr( 171, 200 );
			SetDex( 126, 145 );
			SetInt( 476, 505 );

			SetDamage( 325, 340 );

			SetDamageType( ResistanceType.Physical, 0 );
			SetDamageType( ResistanceType.Cold, 100 );
			SetDamageType( ResistanceType.Energy, 100 );

			SetResistance( ResistanceType.Physical, 95 );
			SetResistance( ResistanceType.Fire, 95 );
			SetResistance( ResistanceType.Cold, 99 );
			SetResistance( ResistanceType.Poison, 100 );
			SetResistance( ResistanceType.Energy, 95 );

			SetSkill( SkillName.EvalInt, 390.0 );
			SetSkill( SkillName.Magery, 370.1, 480.0 );
			SetSkill( SkillName.Meditation, 185.1, 195.0 );
			SetSkill( SkillName.MagicResist, 180.1, 300.0 );
			SetSkill( SkillName.Tactics, 120.1, 160.0 );
			SetSkill( SkillName.Wrestling, 160.1, 180.0 );

			Fame = 800000;
			Karma = 800000;

			if( Utility.RandomDouble() < 0.03 )
				PackItem( new RaistlinsGlasses() );

			if( Utility.RandomDouble() < 0.03 )
				PackItem( new AuronsNickleWeightBoots() );

			if( Utility.RandomDouble() < 0.03 )
				PackItem( new LilkasBracelet() );

			if( Utility.RandomDouble() < 0.03 )
				PackItem( new KennysIronSkin() );

			if( Utility.RandomDouble() < 0.03 )
				PackItem( new TimespellsSpellbook() );

			if( Utility.RandomDouble() < 0.01 )
				PackItem( new NietonoNoShana() );

			VirtualArmor = 0;
			m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 1, 2 ) );
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich, 5 );
		}

		public override bool AutoDispel{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override bool CanRummageCorpses{ get{ return true; } }
		public override bool BardImmune{ get{ return true; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override int TreasureMapLevel{ get{ return 5; } }

		public override bool InitialInnocent{ get{ return true; } }

		private static readonly double[] m_Offsets = new double[]
			{
				Math.Cos( 000.0 / 180.0 * Math.PI ), Math.Sin( 000.0 / 180.0 * Math.PI ),
				Math.Cos( 040.0 / 180.0 * Math.PI ), Math.Sin( 040.0 / 180.0 * Math.PI ),
				Math.Cos( 080.0 / 180.0 * Math.PI ), Math.Sin( 080.0 / 180.0 * Math.PI ),
				Math.Cos( 120.0 / 180.0 * Math.PI ), Math.Sin( 120.0 / 180.0 * Math.PI ),
				Math.Cos( 160.0 / 180.0 * Math.PI ), Math.Sin( 160.0 / 180.0 * Math.PI ),
				Math.Cos( 200.0 / 180.0 * Math.PI ), Math.Sin( 200.0 / 180.0 * Math.PI ),
				Math.Cos( 240.0 / 180.0 * Math.PI ), Math.Sin( 240.0 / 180.0 * Math.PI ),
				Math.Cos( 280.0 / 180.0 * Math.PI ), Math.Sin( 280.0 / 180.0 * Math.PI ),
				Math.Cos( 320.0 / 180.0 * Math.PI ), Math.Sin( 320.0 / 180.0 * Math.PI ),
			};


		public override void AlterMeleeDamageFrom( Mobile from, ref int damage )
		{
			if ( from is BaseCreature )
				damage = 300;

			if ( from is Mobile )
				damage = 800;
		}

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( defender is BaseCreature )
				defender.Damage( Utility.Random( 520, 610 ), this );
		}

		public override void AlterDamageScalarFrom( Mobile caster, ref double scalar )
		{
			scalar = 0.0;
		}



		public override void OnGotMeleeAttack( Mobile attacker )
		{
			base.OnGotMeleeAttack( attacker );

			attacker.Damage( Utility.Random( 220, 310 ), this );
			attacker.Stam -= Utility.Random( 900, 910 );
			attacker.Mana -= Utility.Random( 320, 410 );
		}


		public override void CheckReflect( Mobile caster, ref bool reflect )
		{
			reflect = true; // reflects all spell attacks, added since silence was bitching
		}


		private DateTime m_NextAbilityTime;

		public override void OnThink()
		{
			if ( DateTime.Now >= m_NextAbilityTime )
			{
				Mobile combatant = this.Combatant;

				if ( combatant != null && combatant.Map == this.Map && combatant.InRange( this, 12 ) && IsEnemy( combatant ) && !UnderEffect( combatant ) )
				{
					m_NextAbilityTime = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 7 ) );

					this.Say( true, "I call upon the elementals of the world, heed my command." );

					m_Table[combatant] = Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( DoEffect ), new object[]{ combatant, 0 } );
				}
			}

			base.OnThink();
		}


		private static Hashtable m_Table = new Hashtable();

		public static bool UnderEffect( Mobile m )
		{
			return m_Table.Contains( m );
		}

		public static void StopEffect( Mobile m, bool message )
		{
			Timer t = (Timer)m_Table[m];

			if ( t != null )
			{
				if ( message )
					m.PublicOverheadMessage( Network.MessageType.Emote, m.SpeechHue, true, "* The Elementals Clash And Stops The Curse *" );

				t.Stop();
				m_Table.Remove( m );
			}
		}

		public void DoEffect( object state )
		{
			object[] states = (object[])state;

			Mobile m = (Mobile)states[0];
			int count = (int)states[1];

			if ( !m.Alive )
			{
				StopEffect( m, false );
			}

			else
			
			if ( m is BaseCreature )
			{
				m.LocalOverheadMessage( Network.MessageType.Emote, m.SpeechHue, true, "* This Curse Only Effects Humans *" );
				StopEffect( m, true );
			}

			{
				Torch torch = m.FindItemOnLayer( Layer.TwoHanded ) as Torch;

				if ( torch != null && torch.Burning )
				{
					StopEffect( m, true );
				}
				else
				{
					if ( (count % 4) == 0 )
					{
						m.NonlocalOverheadMessage( Network.MessageType.Emote, m.SpeechHue, true, String.Format( "* Is Blasted By The Secret Unknown Technique Of This Holy Creature *", m.Name ) );
					}

					m.FixedParticles( 0x3709, 10, 180, 9539, 1174, 1, EffectLayer.LeftFoot );

					AOS.Damage( m, this, Utility.RandomMinMax( 1000, 1100 ) - (Core.AOS ? 0 : 10), 0, 100, 100, 100, 100 );

					states[1] = count + 1;

					if ( !m.Alive )
						StopEffect( m, false );
				}
			}
		}


		public void Morph()
		{
			if ( m_TrueForm )
				return;

			m_TrueForm = true;

			Name = "Angered Flaming Haired Blazing Eyed Flame Haze";
			BodyValue = 123;
			Hue = 1260;

			Hits = HitsMax;
			Stam = StamMax;
			Mana = ManaMax;

			ProcessDelta();

			Map map = this.Map;

			if ( map != null )
			{
				for ( int i = 0; i < m_Offsets.Length; i += 2 )
				{
					double rx = m_Offsets[i];
					double ry = m_Offsets[i + 1];

					int dist = 0;
					bool ok = false;
					int x = 0, y = 0, z = 0;

					while ( !ok && dist < 10 )
					{
						int rdist = 10 + dist;

						x = this.X + (int)(rx * rdist);
						y = this.Y + (int)(ry * rdist);
						z = map.GetAverageZ( x, y );

						if ( !(ok = map.CanFit( x, y, this.Z, 16, false, false ) ) )
							ok = map.CanFit( x, y, z, 16, false, false );

						if ( dist >= 0 )
							dist = -(dist + 1);
						else
							dist = -(dist - 1);
					}

				}
			}
		}

		[CommandProperty( AccessLevel.GameMaster )]
		public override int HitsMax{ get{ return m_TrueForm ? 185000 : 100000; } }

		[CommandProperty( AccessLevel.GameMaster )]
		public override int ManaMax{ get{ return 5000; } }

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

		public override void OnAfterDelete()
		{
			base.OnAfterDelete();
		}


		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version

			writer.Write( m_TrueForm );
		}

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_TrueForm = reader.ReadBool();
					break;
				}
			}
		}

		public override bool OnBeforeDeath()
		{
			if ( m_TrueForm )
			{
				return base.OnBeforeDeath();
			}
			else
			{
				Morph();
				return false;
			}
		}
	}
}

and here's a simple weapon


Code:
using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Misc;

namespace Server.Items
{
	[FlipableAttribute( 0x27A2, 0x27ED )]
	public class NietonoNoShana : BaseAxe
	{

		public SkillMod m_SkillMod;

		public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.ArmorIgnore; } }
		public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ConcussionBlow; } }

		public override int AosStrengthReq{ get{ return 1250; } }
		public override int AosMinDamage{ get{ return 255; } }
		public override int AosMaxDamage{ get{ return 290; } }
		public override int AosSpeed{ get{ return 50; } }

		public override int OldStrengthReq{ get{ return 15; } }
		public override int OldMinDamage{ get{ return 16; } }
		public override int OldMaxDamage{ get{ return 17; } }
		public override int OldSpeed{ get{ return 45; } }

		public override SkillName DefSkill{ get{ return SkillName.Bashing; } }
		public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.Slash1H; } }


		[Constructable]
		public NietonoNoShana() : base( 0x27A2 )
		{
			Name = "<Body text=aqua><center>Nietono No Shana ";
			Weight = 95.0;
			Layer = Layer.TwoHanded;
			Hue = 2447;

			Attributes.AttackChance = Utility.Random ( 55, 100 );
			WeaponAttributes.HitFireArea = Utility.Random ( 55, 100 );
			WeaponAttributes.HitPhysicalArea = Utility.Random ( 55, 100 );

			WeaponAttributes.HitLowerDefend = Utility.Random ( 55, 100 );
			WeaponAttributes.HitLeechHits = Utility.Random ( 55, 100 );
			WeaponAttributes.HitPoisonArea = Utility.Random ( 55, 100 );

			WeaponAttributes.HitLeechMana = Utility.Random ( 55, 100 );
			WeaponAttributes.HitLeechHits = Utility.Random ( 55, 100 );
			WeaponAttributes.HitLeechStam = Utility.Random ( 55, 100 );

			Attributes.SpellDamage = Utility.Random ( 455, 900 );
			Attributes.SpellChanneling = 1;
			WeaponAttributes.HitEnergyArea = Utility.Random ( 55, 100 );

			Attributes.Luck = Utility.Random ( 1455, 3700 );
			Attributes.BonusStr = Utility.Random ( 125, 550 );
			Attributes.BonusInt = Utility.Random ( 125, 550 );

			Attributes.BonusHits = Utility.Random ( 125, 500 );
			Attributes.BonusDex = Utility.Random ( 125, 500 );
			WeaponAttributes.HitColdArea = Utility.Random ( 55, 100 );

			Attributes.RegenHits = 100;
			Attributes.DefendChance = Utility.Random ( 55, 100 );
			WeaponAttributes.HitLowerAttack = Utility.Random ( 55, 100 );

			
		}

public override void GetDamageTypes( Mobile weilder, out int phys, out int fire, out int cold, out int pois, out int nrgy )
		{
			phys = 0;
			fire = 150;
			pois = 100;
			cold = 100;
			nrgy = 100;
		}


		public override bool OnEquip( Mobile m )
		{
			base.OnEquip( m );
			m_SkillMod = new DefaultSkillMod( SkillName.Macing, true, 20 );
			m.AddSkillMod(m_SkillMod );
			m.PlaySound( 579 );
			m.PlaySound( 580 );

			return true;
		}

		public override void OnRemoved( object parent )
		{
			base.OnRemoved( parent );

			if ( m_SkillMod != null )
			m_SkillMod.Remove();

		}

		public NietonoNoShana( 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();
		}
	}
}
entire custom spell command list.

Code:
using System;
using Server;
using Server.Items;
using System.Text;
using Server.Mobiles;
using Server.Network;
using Server.Spells;
using Server.Spells.Custom;


namespace Server.Commands
{
	public class CastTimespellsSpells
	{
		public static void Initialize()
		{
			CommandSystem.Prefix = "[";

			CommandSystem.Register( "Holy", AccessLevel.GameMaster, new CommandEventHandler( Holy_OnCommand ) );

			CommandSystem.Register( "Ultima", AccessLevel.GameMaster, new CommandEventHandler( Ultima_OnCommand ) );

			CommandSystem.Register( "ThunderBlast", AccessLevel.Player, new CommandEventHandler( ThunderBlast_OnCommand ) );

			CommandSystem.Register( "GaiaOverflow", AccessLevel.Player, new CommandEventHandler( GaiaOverflow_OnCommand ) );

			CommandSystem.Register( "DarkSummoning", AccessLevel.GameMaster, new CommandEventHandler( DarkSummoning_OnCommand ) );

			CommandSystem.Register( "ArcticBlast", AccessLevel.Player, new CommandEventHandler( ArcticBlast_OnCommand ) );

			CommandSystem.Register( "soulcall", AccessLevel.Player, new CommandEventHandler( soulcall_OnCommand ) );

			CommandSystem.Register( "FlameBlast", AccessLevel.Player, new CommandEventHandler( FlameBlast_OnCommand ) );

			CommandSystem.Register( "GodBless", AccessLevel.Player, new CommandEventHandler( GodBless_OnCommand ) );

			CommandSystem.Register( "EtherealGuardian", AccessLevel.Player, new CommandEventHandler( EtherealGuardian_OnCommand ) );

			CommandSystem.Register( "MegaHeal", AccessLevel.Player, new CommandEventHandler( MegaHeal_OnCommand ) );

			CommandSystem.Register( "Nekoform", AccessLevel.GameMaster, new CommandEventHandler( Nekoform_OnCommand ) );
		}

		public static void Register( string command, AccessLevel access, CommandEventHandler handler )
		{
			Server.Commands.CommandSystem.Register( command, access, handler );
		}

		public static bool HasSpell( Mobile from, int spellID )
		{
			Spellbook book = Spellbook.Find( from, spellID );

			return ( book != null && book.HasSpell( spellID ) );
		}

		[Usage( "Holy" )]
		[Description( "Casts Holy spell." )]
		public static void Holy_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new HolySpell( e.Mobile, null ).Cast(); 
					}			
		}
		[Usage( "Ultima" )]
		[Description( "Casts Ultima spell." )]
		public static void Ultima_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;
			
         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new UltimaSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "ThunderBlast" )]
		[Description( "Casts Thunder Blast spell." )]
		public static void ThunderBlast_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new ThunderBlastSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "GaiaOverflow" )]
		[Description( "Casts Gaia Overflow spell." )]
		public static void GaiaOverflow_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new GaiaOverflowSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "DarkSummoning" )]
		[Description( "Casts Dark Summoning spell." )]
		public static void DarkSummoning_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new DarkSummoningSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "ArcticBlast" )]
		[Description( "Casts Arctic Blast spell." )]
		public static void ArcticBlast_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new  ArcticBlastSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "soulcall" )]
		[Description( "Casts soulcall spell." )]
		public static void soulcall_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new soulcallSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "FlameBlast" )]
		[Description( "Casts Flame Blast spell." )]
		public static void FlameBlast_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new FlameBlastSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "GodBless" )]
		[Description( "Casts God Bless spell." )]
		public static void GodBless_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing

				//if ( HasSpell( from, 459 ) )
					{
					new GodBlessSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "EtherealGuardian" )]
		[Description( "Casts Ethereal Guardian spell." )]
		public static void EtherealGuardian_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new EtherealGuardianSpell( e.Mobile, null ).Cast(); 
					}
		}

		[Usage( "MegaHeal" )]
		[Description( "Casts Mega Heal spell." )]
		public static void MegaHeal_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new MegaHealSpell( e.Mobile, null ).Cast(); 
					}			
		}

		[Usage( "Nekoform" )]
		[Description( "Casts Neko Form spell." )]
		public static void Nekoform_OnCommand( CommandEventArgs e )
		{
				Mobile from = e.Mobile;

         			if ( !Multis.DesignContext.Check( e.Mobile ) )
            				return; // They are customizing
					{
					new NekoformSpell( e.Mobile, null ).Cast(); 
					}			
		}
	}
}
Custom spellbook Gump. *gump's are not the same type of scripting format for everyone following this childs guide.* with water mark.

Code:
/* 
****** Mastery Spells, Designed, Created, and Released for custom shard Death Awaits You.

****** You Better Use These!

Credits
Scripting, Raistlin
Spell Names, Auron, Raistlin.
Spell Ideas, Auron, Raistlin.
*/

using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Spells;
using Server.Items;


namespace Server.Spells.Custom
{
	public class TimespellsGump : Gump
	{
		private static string[] m_Spells = new string[]
		{
			"Holy",
			"Ultima",
			"Thunder Blast",
			"Gaia Overflow",
			"Dark Summoning",
			"Arctic Blast",
			"Soul call",
			"Flame Blast",
			"Gods Blessing",
			"Ethereal Guardian",
			"Mega Heal",
			"Neko Form"
		};

		public TimespellsGump(Mobile owner) : base( 50, 10 )
		{
			int gumpX = 0; int gumpY = 0;

			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = true;

			gumpX = 7; gumpY = 7;
			AddImageTiled( gumpX, gumpY, 341, 281, 0xA8E );

			gumpX = 0; gumpY = 0;
			AddImage( gumpX, gumpY, 0x23F0 );

			gumpX = 7; gumpY = 0;
			AddImageTiled( gumpX, gumpY, 341, 7, 0x23F1 );

			gumpX = 0; gumpY = 7;
			AddImageTiled( gumpX, gumpY, 7, 281, 0x23F3 );

			gumpX = 348; gumpY = 7;
			AddImageTiled( gumpX, gumpY, 7, 281, 0x23F5 );

			gumpX = 348; gumpY = 288;
			AddImage( gumpX, gumpY, 0x23F8 );

			gumpX = 348; gumpY = 0;
			AddImage( gumpX, gumpY, 0x23F2 );

			gumpX = 0; gumpY = 288;
			AddImage( gumpX, gumpY, 0x23F6 );

			gumpX = 7; gumpY = 288;
			AddImageTiled( gumpX, gumpY, 341, 7, 0x23F7 );

			gumpX = 7; gumpY = 7;
			AddAlphaRegion( gumpX, gumpY, 341, 281 );

			gumpX = 0; gumpY = 7;
			AddHtml( gumpX, gumpY, 355, 20, "<basefont color=#FFFFFF><center>Epic spells Scripted And Designed For <b><I><U>D.a.y.</b></I></U></center></font>", false, false );

			int offset = 0;
			int id = 1;

			for( int i = 0; i < 12; ++i )
			{
				gumpX = 10; gumpY = 45 + offset;
				AddButton( gumpX, gumpY, 0x1523, 0x1523, 12 + id, GumpButtonType.Page, id );

				gumpX = 30; gumpY = 48 + offset;
				AddButton( gumpX, gumpY, 0x837, 0x838, id, GumpButtonType.Reply, 0 );

				gumpX = 45; gumpY = 43 + offset;
				AddLabel( gumpX, gumpY, 1152, m_Spells[i] );

				offset += 20;
				++id;
			}

			gumpX = 180; gumpY = 260;
			AddButton( gumpX, gumpY, 0xFB1, 0xFB3, 25, GumpButtonType.Reply, 0 );

			gumpX = 215; gumpY = 260;
			AddLabel( gumpX, gumpY, 1152, "Close this menu." );

			AddSpell( 1, 50000000, 85.0, 20494, "Holy", "Passed Down By The Ancients, No One Alive Knows What This Spell Consists Of." );
			AddSpell( 2, 55000000, 85.0, 2278, "Ultima", "Said To Be One Of The Deadlist Mastery In This World, Casters Use At Own Risk." );
			AddSpell( 3, 500, 75.0, 0x8DD, "Thunder Blast", "Calls Forth The Bolts Of Heaven, To Strike And Destroy The Evils Around The Caster." );
			AddSpell( 4, 1, 75.0, 0x5103, "Gaia Overflow", "Calls Upon The Earth's Life Force, To Heal And Revive Fallen Allies." );
			AddSpell( 5, 15000000, 85.0, 2251, "Dark Summoning", "Summons Evil Creatures To Protect The Caster." );
			AddSpell( 6, 600, 75.0, 0x5108, "Arctic Blast", "Sends A Ball Of Ice Cold Energy At Casters Target, Freezing Them In Place While Doing Massive Damage." );
			AddSpell( 7, 1150, 75.0, 0x8FA, "Soul call", "The Casters Target Is Rapidly Healed, For A Random Amount Of Time." );
			AddSpell( 8, 200, 75.0, 2282, "Flame Blast", "The Flames Of Hell Connot Compair With These Ancient Flames, The Sun It Self Does Not Burn This Hot." );
			AddSpell( 9, 600, 1.0, 2283, "Gods Blessing", "A Mantra So Beautiful That The Gods Themselves Cry And Bless The Casters Target." );
			AddSpell( 10, 600, 75.0, 2254, "Ethereal Guardian", "One Of The Strangest Spells, Caster Is Protected By An Unknown Force Of Massive Damage." );
			AddSpell( 11, 100000, 60.0, 2268, "Mega Heal", "The Casters Target Is Healed For A Single Massive Amount" );
			AddSpell( 12, 500000000, 85.0, 20495, "Neko Form", "The Caster Is Transformed Into A Cute Cat Demon. Effects Are Unknown, But The Casters Are Never The Same Again." );
		}

		private void AddSpell( int page, int tithing, double skill, int icon, string name, string text )
		{
			int gumpX, gumpY;

			AddPage( page );
			gumpX = 165; gumpY = 45;
			AddImage( gumpX, gumpY, icon );

			gumpX = 215; gumpY = 43;
			AddLabel( gumpX, gumpY, 1152, name );

			gumpX = 215; gumpY = 56;
			AddLabel( gumpX, gumpY, 1152, String.Format( "Tithing Points: {0}", tithing ) );

			gumpX = 215; gumpY = 69;
			AddLabel( gumpX, gumpY, 1152, String.Format( "Required Skill: {0}", skill.ToString("F1") ) );

			gumpX = 165; gumpY = 95;
			AddHtml( gumpX, gumpY, 170, 150, String.Format( "<basefont color=#FFFFFF>Description - {0}</font>", text ), false, false );
		}

		public override void OnResponse( NetState state, RelayInfo info )
		{
			Mobile from = state.Mobile;

			switch( info.ButtonID )
			{
				case 1: new HolySpell( from, null ).Cast(); break;
				case 2: new UltimaSpell( from, null ).Cast(); break;
				case 3: new ThunderBlastSpell( from, null ).Cast(); break;
				case 4: new GaiaOverflowSpell( from, null ).Cast(); break;
				case 5: new DarkSummoningSpell( from, null ).Cast(); break;
				case 6: new ArcticBlastSpell( from, null ).Cast(); break;
				case 7: new soulcallSpell( from, null ).Cast(); break;
				case 8: new FlameBlastSpell( from, null ).Cast(); break;
				case 9: new GodBlessSpell( from, null ).Cast(); break;
				case 10: new EtherealGuardianSpell( from, null ).Cast(); break;
				case 11: new MegaHealSpell( from, null ).Cast(); break;
				case 12: new NekoformSpell( from, null ).Cast(); break;
				case 25: return;
			}

			if ( info.ButtonID >= 1 && info.ButtonID <= 12 )
				from.SendGump( new TimespellsGump( from ) );
		}
	}
}
so say what you want about me, if you try and follow this guide, you'll never be as good as you could be.

using a program to POINT OUT! your mistakes for you is pointless, use a dull program and build them from start to finish without any help from a program.

i've never used Visual C# Compiler, never will, never have too, and it is a waste of space on a computer if you are a REAL! game scripter.

this is advice from a game programmer, not just a random person, who doesn't know anything.

and yes i do have more advanced scripts, however, they are about 5x longer then the ones listed above.

if you want a real TuT, go to [Only registered and activated users can see links. Click Here To Register...] and go to their forums, there are TuT's made by me and their staff, professional TuT's.

the proof is above you.
11/02/2008 17:10 Incariuz#125
This was a great segments of tutorials. Helps to understand what certain lines mean, instead of following the majority of tutorials out there that leave you wondering "I typed it, but what does it do... o.o" lol. Hope to see more advanced stuff in the future.

Edit: Yes I know this is a super bump, but regardless, good thread, more people should have the chance to see it.
11/02/2008 18:02 tao4229#126
bob_pimper:
The only way to compile C# programs is to use Microsoft's compiler, because .NET was MADE by Microsoft. csc.exe(The C# compiler of just the cmd line) points out the same errors when you try to build as Visual C#.

Edit:: Since I'm assuming you're at least knowledgeable at C#, you'd have to know you have to have SOME compiler to compile your program... otherwise it's just a bunch of text.
11/03/2008 06:20 Incariuz#127
Edit: I think I misread the post before I posted, lol, so ignore this.
11/05/2008 06:59 kinshi88#128
Would someone be kind enough to upload the Lesson Nine Videos somewhere else?
I haven't checked here forever and saw that those were new =O
11/10/2008 20:49 Incariuz#129
Not that I wish to double post, but I need to do so thread gets bumped showing I added the downloads. I'll try and delete my other post once this is on to avoid wasted space.

Lesson 9.1 - Server and Client
[Only registered and activated users can see links. Click Here To Register...]
Lesson 9.2 - Socket Programming Intro
[Only registered and activated users can see links. Click Here To Register...]

I made the MediaFire account as requested in hopes it will work. However, if there are issues, send me a PM and I'll find another method.
11/12/2008 12:12 Brownleaf#130
Just what I've been searching for. Thanks a lot.
11/13/2008 04:34 xprincex#131
@Request Packets
Lol Some sort of Tutorial on packets and inter grading packets with the client and server would be nice.

I say this one would be most helpful to me.
12/13/2008 11:05 XMasterrrr#132
Thanke u i was search for them Xd
12/13/2008 23:45 thedude411#133
thanks for the post hybrid did wonders for me, and from the videos i can tell if me and you met at a party wed deff be smoking a couple blunts together
12/14/2008 03:16 redskull010101#134
lol their is no video?, its only voice
12/14/2008 17:59 elragal_30#135
thanks for this
i dl them now when i finish i hope i can make my
i was search for some thing like this
i hope u put link fr thread at ur sig as all noobs learn how to code
Quote:
Lesson Nine - Socket Programming
This lesson will be broken down into sub-lessons which will covert several aspects of socket programming (i.e. client, server, packets, etc.)


Quote:
Introduction: [Only registered and activated users can see links. Click Here To Register...]
Description: Here I just introduce socket programming and show what namespaces will be needed and I introduce the class we'll be working with and wrapping.
this link when i press give :
Quote:
The file you are trying to access is temporarily unavailable
i hope u can fix it