ExX

Member
I am fairly new to c# and have been working on a quest for new players. I have everything working well except for the following part. I want the player to only be able to turn in the quest item one time so that they dont keep getting the reward on the same character. I can't find any examples of this working to guide me so I turn to you for assistance. Any help is appreciated. This is what I have so far.

Code:
        public override bool OnDragDrop( Mobile from, Item dropped )
        {              
                   Mobile m = from;
            PlayerMobile mobile = m as PlayerMobile;

            if ( mobile != null)
            {
                if( dropped is ZeldaNote )
                {
                    if (mobile.GetTag("ZeldaComplete") == "True")
                        {
                            SayTo( from, "You have already shown my this note and been rewarded,.." );
                        }
                    else
                    {
                    dropped.Delete();
                    mobile.AddToBackpack( new AdjustableSkillBall (25) );
                    mobile.AddToBackpack( new Daat99Tokens( 100 ) );
                    mobile.SendGump( new LinkQuestCompleteGump(m) );
                    mobile.SetTag("ZeldaComplete", "True");
                 
                    return true;
                    }
                }
             
                else
                {
                    SayTo( from, "How is this proof of the Princess's freedom? This is no time for games." );
                }
            }
            return false;
     
        }

However I am getting this error.

Code:
Errors:
+ Customs/Mobiles/Zelda Quest/Zelda Quest Mobiles/Link.cs:
    CS1061: Line 194: 'Server.Mobiles.PlayerMobile' does not contain a definitio
n for 'GetTag' and no extension method 'GetTag' accepting a first argument of ty
pe 'Server.Mobiles.PlayerMobile' could be found (are you missing a using directi
ve or an assembly reference?)
    CS1061: Line 204: 'Server.Mobiles.PlayerMobile' does not contain a definitio
n for 'SetTag' and no extension method 'SetTag' accepting a first argument of ty
pe 'Server.Mobiles.PlayerMobile' could be found (are you missing a using directi
ve 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.

I assume I am not using the mobile.gettag and mobile.settag properly. Any advice? Sorry I am new and trying hard.
 
Yea I posted here it here. This forum seems much more active. Sorry if that s frowned upon.

This is the header

Code:
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
 
Try adding using Server.Accounting; at the top - I have done account tags but not character tags :)
 
It is not frowned upon, it is just a personal initiative to ask people to crossthread their posts when they post it somewhere else too.
If someone don't do it, i'll just do it myself, that's not a problem :p
 
Yeah...I had answered over on RunUO and provided a thread..I thght you could do a per char basis. I know you can do it with XmlSpawner for quests, so I assumed it could be scripted as well. Still learning myself so not looked at actual implementation.
 
Yea I followed the example, and adding the using Server.Accounting; still gives the same error. I do however have a working copy of XML spawner installed and working on the server if there is a way to easily to it with that?
 
For XmlSpawner you need to learn to set up spawners. Check under the XmlSpawner 2 section and also I recently posted a link to compilation of XmlGuides. You can also find it in Resources.
When you set up a quest in XmlSpawner you use /repeatable/<true/false here>
It assigns a per char tag, but as someone mentioned on RunUO, per char tags are easy
to exploit. If you have 6 char's on an account you can get 6 of the item. After that,
you can delete your 5 Alternate characters and create 5 new ones, thus making it
possible to get 5 more of the same item. Repeat as wanted. ;)

I would suggest using a per account Tag and use a counter to keep track of how many
an account has. So, if you allow 6 chars per account then set the max items per account
to 6. Other than that you are just setting it up to be exploited.

As far as your prob with your script it sounds like you never create an instance of the type Account. In order to help you we need to see your script( including the Using statements).
 
...and in case you just want to put the restriction to one per account, you can use:

mobile.Account.SetTag

and

mobile.Account.GetTag
 
Thanks Lokai, as much as I would have loved to of made if Character limited and not account, I don't want to re-work the entire quest in XML Spawner, I think I will just work within the systems limit for now and make it account limited. Any future quests will be created in XML spawner. I thank you all for your time.
 
It can be done in scripts.....I just don't know how personally. You have to remember that XmlSpanwer is scripted and acts as an interface to the game. So, if it can do it in the scripts then you can too. Will prob take a bit of research to figure out how though....anyway good luck to you!
 
So I tried making it account limited as all the help and examples and I get an error. I don't get why cause I am using the proper header calls. Here is the entire script.

Code:
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Accounting;

namespace Server.Mobiles
{
	[CorpseName( "Corpse Of link" )]
	public class Link : BaseCreature
	{

		private static bool m_Talked;
		string[] LinkSay = new string[] 
		{ 
			"Please save the princess",
			"Shadow Link has captured the princess!",
			"I have failed her..."
		}; 

		public override bool ClickTitle{ get{ return false; } }	
		public override bool IsInvulnerable { get { return true; } }

		[Constructable]
		public Link() : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			
			SpeechHue = Utility.RandomDyedHue();
			Hue = 13;

            Name = "Link";
			Title = "Hero of Hyrule";
			Body = 185;
			//CantWalk = true;
			Hue = 0;
			
			HairItemID = 8252;
			HairHue = 0x41c;
			
			SetStr( 90, 110 );
			SetDex( 90, 110 );
			SetInt( 60, 80);

			SetHits( 250, 300 );

			SetDamage( 15, 22 );

			SetDamageType( ResistanceType.Physical, 100 );

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

			SetSkill( SkillName.MagicResist, 50.0, 60.0 );
			SetSkill( SkillName.Tactics, 60.0, 80.0 );
			SetSkill( SkillName.Wrestling, 60.0, 80.0 );
			SetSkill( SkillName.Swords, 60.0, 80.0 );
			
			VirtualArmor = 20;
			
			Item gloves = new LeatherGloves();
				gloves.Movable = false;
				gloves.Hue = 0x745;
			AddItem( gloves );
			Item chest = new LeatherChest();
				chest.Movable = false;
				chest.Hue = 0x48;
			AddItem( chest );
			Item legs = new LongPants();
				legs.Movable = false;
				legs.Hue = 0x47e;
			AddItem( legs );
			Item cap = new Cap();
				cap.Movable = false;
				cap.Hue = 0x48;
			AddItem( cap );
			Item boots = new Boots();
				boots.Movable = false;
				boots.Hue = 0x745;
			AddItem( boots );
			
			Item shield = new OrderShield();
				shield.Movable = false;
			AddItem( shield );
			Item sword = new VikingSword();
				sword.Movable = false;
			AddItem( sword );

			Fame = 5000;
			Karma = 8000;

		}

        		public override void OnMovement( Mobile m, Point3D oldLocation ) 
			    	{												    
       		  		if( m_Talked == false ) 
        	  		{ 
      		      			if ( m.InRange( this, 3 ) && m is PlayerMobile) 
        				{			    
					   			m_Talked = true; 
					   			SayRandom( LinkSay, this ); 
           		   			    this.Move( GetDirectionTo( m.Location ) );
			 		   			SpamTimer t = new SpamTimer(); 
           		   			t.Start(); 
							} 
        	  		} 
			}


    	  		private class SpamTimer : Timer 
			{ 
		   		public SpamTimer() : base( TimeSpan.FromMinutes( 2 ) ) 
	       	   		{ 
          				Priority = TimerPriority.OneMinute; 
       		   		} 

         	   		protected override void OnTick() 
        	   		{ 
           				m_Talked = false; 
        	   		} 
      			}
			
			private static void SayRandom( string[] say, Mobile m ) 
	        	{ 
	           		m.Say( say[Utility.Random( say.Length )] ); 
			}


		public Link( Serial serial ) : base( serial )
		{
		}
		
		public override void GetContextMenuEntries( Mobile from,  List<ContextMenuEntry> list ) 
	        { 
	                base.GetContextMenuEntries( from, list ); 
        	        list.Add( new LinkEntry( from, this ) ); 
	        } 

		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();
		}
		
		public class LinkEntry : ContextMenuEntry
		{
			private Mobile m_Mobile;
			private Mobile m_Giver;
			
			public LinkEntry( Mobile from, Mobile giver ) : base( 6146, 3 )
			{
				m_Mobile = from;
				m_Giver = giver;
			}

			public override void OnClick()
			{

                          	if( !( m_Mobile is PlayerMobile ) )
					return;
				
				PlayerMobile mobile = (PlayerMobile) m_Mobile;

				{
					if ( ! mobile.HasGump( typeof( LinkQuestStartGump ) ) )
					{
						mobile.SendGump( new LinkQuestStartGump( mobile ));
						
					} 
				}
			}
		}
		
		public override bool OnDragDrop( Mobile from, Item dropped )
		{          		
         	        Mobile m = from;
			PlayerMobile mobile = m as PlayerMobile;

			if ( mobile != null)
			{
				if( dropped is ZeldaNote )
         		{
					if (mobile.Account.GetTag("ZeldaComplete") == "True")
						{
							SayTo( from, "You have already shown my this note and been rewarded,.." );
						}
					else
					{
					dropped.Delete();
					mobile.AddToBackpack( new AdjustableSkillBall (25) );
					mobile.AddToBackpack( new Daat99Tokens( 100 ) );
					mobile.SendGump( new LinkQuestCompleteGump(m) );
					mobile.Account.SetTag("ZeldaComplete", "True");
					
					return true;
					}
         		}
				
         		else
         		{
					SayTo( from, "How is this proof of the Princess's freedom? This is no time for games." );
     			}
			}
			return false;
		
		}
	
	}
}

and here is the error

Code:
Errors:
 + Customs/Mobiles/Zelda Quest/Zelda Quest Mobiles/Link.cs:
    CS1061: Line 195: 'Server.Accounting.IAccount' does not contain a definition
 for 'GetTag' and no extension method 'GetTag' accepting a first argument of typ
e 'Server.Accounting.IAccount' could be found (are you missing a using directive
 or an assembly reference?)
    CS1061: Line 205: 'Server.Accounting.IAccount' does not contain a definition
 for 'SetTag' and no extension method 'SetTag' accepting a first argument of typ
e 'Server.Accounting.IAccount' could 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.
 
Someone helped me in the past with character creation:
Code:
Account account = ( Account ) m.Account;
if(account.GetTag( "AlreadyGotTheirGold" ) == null )
{
	PlaceItemIn( cont, 29, 34, new BankCheck( 20000 ) );
	account.SetTag("AlreadyGotTheirGold", "True");
}
I don't use XML, but the solution i offer only works once per account.

here are my headers:

using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Accounting;

using runuo 2.0 RC1 or RC2, so something might have changed since then if Server.Accounting fails.
 
Try PoOka code above if this still does not work, this code is from a quest I have and have used this in quite a few others. You will need to change the names of course to your's, item and reward

public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;

PlayerMobile pm = from as PlayerMobile;
Account acct = (Account)from.Account;
bool RedWoolSweaterRecieved = Convert.ToBoolean(acct.GetTag("MrsClauseReward"));

if ( pm != null && dropped is RedWoolSweater)
{


if (!RedWoolSweaterRecieved) //added account tag check
{
dropped.Delete(); //

pm.AddToBackpack(new MrsClauseGiftBox2013());
SendMessage( "Thank you for your help!" );
acct.SetTag("MrsClauseReward", "true");
 
I think this will work to do the tags per Char instead of account:

Code:
 public void SetAcctTag(Mobile m)
  {
    PlayerMobile from = m as PlayerMobile;
    Account acct = (Account)from.Account;
    acct.SetTag((from.Name) + ("ZeldaQuest"), "true");
  }

Just concatenate the name with the questName.
 
Last edited:
If that works for character limits I will love you forever lmao, I am however a little lost how I would incorporate your code into this.

Code:
		public override bool OnDragDrop( Mobile from, Item dropped )
		{          		
         	        Mobile m = from;
			PlayerMobile mobile = m as PlayerMobile;

			if ( mobile != null)
			{
				if( dropped is ZeldaNote )
         		{
					if (mobile.Account.GetTag("ZeldaComplete") == "True")
						{
							SayTo( from, "You have already shown my this note and been rewarded,.." );
						}
					else
					{
					dropped.Delete();
					mobile.AddToBackpack( new AdjustableSkillBall (25) );
					mobile.AddToBackpack( new Daat99Tokens( 100 ) );
					mobile.SendGump( new LinkQuestCompleteGump(m) );
					mobile.Account.SetTag("ZeldaComplete", "True");
					
					return true;
					}
         		}
				
         		else
         		{
					SayTo( from, "How is this proof of the Princess's freedom? This is no time for games." );
     			}
			}
			return false;
		
		}
 
Made a mistake in last post ...I edited it ...I've not test this but should work

Code:
public void SetAcctTag(Mobile m)
  {
  PlayerMobile from = m as PlayerMobile;
  Account acct = (Account)from.Account;
  acct.SetTag((from.Name) + ("ZeldaQuest"), "true");

  }

public bool GetAcctTag(Mobile m)
  {
  PlayerMobile from = m as PlayerMobile;
  Account acct = (Account)from.Account;
  if ( (acct.GetTag((from.Name) + ("ZeldaQuest"))) == "true" )
  {
  return true;
  }

  return false;
  }

I would suggest keeping these in a method somewhere. With a bit of work you could make these reusable for other quests by passing in (String,Value) into acct.Get/Set tags.

If you aren't already using it, I would suggest getting Visual Studio 2013 Community edition...it's free. Once you
get it set up Intellisense will make putting scripts together a lot easier and faster to learn.
 
Last edited:
Try PoOka code above if this still does not work, this code is from a quest I have and have used this in quite a few others. You will need to change the names of course to your's, item and reward

public override bool OnDragDrop( Mobile from, Item dropped )
{
Mobile m = from;

PlayerMobile pm = from as PlayerMobile;
Account acct = (Account)from.Account;
bool RedWoolSweaterRecieved = Convert.ToBoolean(acct.GetTag("MrsClauseReward"));

if ( pm != null && dropped is RedWoolSweater)
{


if (!RedWoolSweaterRecieved) //added account tag check
{
dropped.Delete(); //

pm.AddToBackpack(new MrsClauseGiftBox2013());
SendMessage( "Thank you for your help!" );
acct.SetTag("MrsClauseReward", "true");

So your code seemed the easiest route for a newbie like myself to incorporate into my already exisisting code. This is what I have...

Code:
		public override bool OnDragDrop( Mobile from, Item dropped )
		{          		
         	Mobile m = from;
			PlayerMobile pm = from as PlayerMobile;
			Account acct = (Account)from.Account;
			bool ZeldaQuestSater = Convert.ToBoolean(acct.GetTag("ZeldaQuestComplete"));

			if ( pm != null && dropped is ZeldaNote )
         		{
					if (!ZeldaQuestSater)
						{
							dropped.Delete();
							pm.AddToBackpack( new AdjustableSkillBall (25) );
							pm.AddToBackpack( new Daat99Tokens( 100 ) );
							pm.SendGump( new LinkQuestCompleteGump(m) );
							acct.SetTag("ZeldaQuestComplete", "True");
						}
					else
						{
							SayTo( from, "You have already shown my this note and been rewarded,.." );
						}
				
         		}
         	else	
				{
					SayTo( from, "How is this proof of the Princess's freedom? This is no time for games." );
     			}
		}

I have 2 issues. 1,) I get the following error and I don't know why.
Errors:
+ Customs/Mobiles/Zelda Quest/Zelda Quest Mobiles/Link.cs:
CS0161: Line 186: 'Server.Mobiles.Link.OnDragDrop(Server.Mobile, Server.Item
)': not all code paths return a value

My other question is... I'm trying to understand what the code does completely so I can learn. What does this line of code do?
bool ZeldaQuestSater = Convert.ToBoolean(acct.GetTag("ZeldaQuestComplete"))

Also it looks like it is checking to see if if (!ZeldaQuestSater) exists and if it does progressing the quest then giving them the acct.SetTag("ZeldaQuestComplete", "True"); tag. Is that the way this is working? Because in my head I don't see the system ever removing the ZeldaQuestComplete tag it just gives them an additional tag, so wouldnt that mean the player can still keep doing the quest since the tag check will also show yes?
 
Sorry was just trying to make it easy. This is the entire script. Essentially he gets a note from Zelda and rewards you for turning the note in.

Code:
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Accounting;

namespace Server.Mobiles
{
	[CorpseName( "Corpse Of link" )]
	public class Link : BaseCreature
	{

		private static bool m_Talked;
		string[] LinkSay = new string[] 
		{ 
			"Please save the princess",
			"Shadow Link has captured the princess!",
			"I have failed her..."
		}; 

		public override bool ClickTitle{ get{ return false; } }	
		public override bool IsInvulnerable { get { return true; } }

		[Constructable]
		public Link() : base( AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			
			SpeechHue = Utility.RandomDyedHue();
			Hue = 13;

            Name = "Link";
			Title = "Hero of Hyrule";
			Body = 185;
			//CantWalk = true;
			Hue = 0;
			
			HairItemID = 8252;
			HairHue = 0x41c;
			
			SetStr( 90, 110 );
			SetDex( 90, 110 );
			SetInt( 60, 80);

			SetHits( 250, 300 );

			SetDamage( 15, 22 );

			SetDamageType( ResistanceType.Physical, 100 );

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

			SetSkill( SkillName.MagicResist, 50.0, 60.0 );
			SetSkill( SkillName.Tactics, 60.0, 80.0 );
			SetSkill( SkillName.Wrestling, 60.0, 80.0 );
			SetSkill( SkillName.Swords, 60.0, 80.0 );
			
			VirtualArmor = 20;
			
			Item gloves = new LeatherGloves();
				gloves.Movable = false;
				gloves.Hue = 0x745;
			AddItem( gloves );
			Item chest = new LeatherChest();
				chest.Movable = false;
				chest.Hue = 0x48;
			AddItem( chest );
			Item legs = new LongPants();
				legs.Movable = false;
				legs.Hue = 0x47e;
			AddItem( legs );
			Item cap = new Cap();
				cap.Movable = false;
				cap.Hue = 0x48;
			AddItem( cap );
			Item boots = new Boots();
				boots.Movable = false;
				boots.Hue = 0x745;
			AddItem( boots );
			
			Item shield = new OrderShield();
				shield.Movable = false;
			AddItem( shield );
			Item sword = new VikingSword();
				sword.Movable = false;
			AddItem( sword );

			Fame = 5000;
			Karma = 8000;

		}

        		public override void OnMovement( Mobile m, Point3D oldLocation ) 
			    	{												    
       		  		if( m_Talked == false ) 
        	  		{ 
      		      			if ( m.InRange( this, 3 ) && m is PlayerMobile) 
        				{			    
					   			m_Talked = true; 
					   			SayRandom( LinkSay, this ); 
           		   			    this.Move( GetDirectionTo( m.Location ) );
			 		   			SpamTimer t = new SpamTimer(); 
           		   			t.Start(); 
							} 
        	  		} 
			}


    	  		private class SpamTimer : Timer 
			{ 
		   		public SpamTimer() : base( TimeSpan.FromMinutes( 2 ) ) 
	       	   		{ 
          				Priority = TimerPriority.OneMinute; 
       		   		} 

         	   		protected override void OnTick() 
        	   		{ 
           				m_Talked = false; 
        	   		} 
      			}
			
			private static void SayRandom( string[] say, Mobile m ) 
	        	{ 
	           		m.Say( say[Utility.Random( say.Length )] ); 
			}


		public Link( Serial serial ) : base( serial )
		{
		}
		
		public override void GetContextMenuEntries( Mobile from,  List<ContextMenuEntry> list ) 
	        { 
	                base.GetContextMenuEntries( from, list ); 
        	        list.Add( new LinkEntry( from, this ) ); 
	        } 

		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();
		}
		
		public class LinkEntry : ContextMenuEntry
		{
			private Mobile m_Mobile;
			private Mobile m_Giver;
			
			public LinkEntry( Mobile from, Mobile giver ) : base( 6146, 3 )
			{
				m_Mobile = from;
				m_Giver = giver;
			}

			public override void OnClick()
			{

                          	if( !( m_Mobile is PlayerMobile ) )
					return;
				
				PlayerMobile mobile = (PlayerMobile) m_Mobile;

				{
					if ( ! mobile.HasGump( typeof( LinkQuestStartGump ) ) )
					{
						mobile.SendGump( new LinkQuestStartGump( mobile ));
						
					} 
				}
			}
		}
		
		public override bool OnDragDrop( Mobile from, Item dropped )
		{          		
         	Mobile m = from;
			PlayerMobile pm = from as PlayerMobile;
			Account acct = (Account)from.Account;
			bool ZeldaQuestSater = Convert.ToBoolean(acct.GetTag("ZeldaQuestComplete"));

			if ( pm != null && dropped is ZeldaNote )
         		{
					if (!ZeldaQuestSater)
						{
							dropped.Delete();
							pm.AddToBackpack( new AdjustableSkillBall (25) );
							pm.AddToBackpack( new Daat99Tokens( 100 ) );
							pm.SendGump( new LinkQuestCompleteGump(m) );
							acct.SetTag("ZeldaQuestComplete", "True");
						}
					else
						{
							SayTo( from, "You have already shown my this note and been rewarded,.." );
						}
				
         		}
         	else	
				{
					SayTo( from, "How is this proof of the Princess's freedom? This is no time for games." );
     			}
		}
	
	}
}
 
I think your problem is here
    1. bool ZeldaQuestSater = Convert.ToBoolean(acct.GetTag("ZeldaQuestComplete"));

    2. if ( pm != null && dropped is ZeldaNote ) <<<<<because this is not following along with the same name as above?
    3. {
    4. if (!ZeldaQuestSater)
    5. ____________________________________________________
    6. This is how my code which I posted looks

    7. Account acct = (Account)from.Account;
      bool RedWoolSweaterRecieved = Convert.ToBoolean(acct.GetTag("MrsClauseReward"));
      if ( pm != null && dropped is RedWoolSweater)
      {
      if (!RedWoolSweaterRecieved) //added account tag check
 
Uploading this script so you can check it out, might help to compare:)
 

Attachments

  • Mrs.Clause.cs
    3.8 KB · Views: 11
You're problem is that OnDragDrop has a Return Type of Bool yet you have no returns in that method. It is expecting a Bool that tells it whether or not to allow Drag/Drop for the item. For every possible branch of the nested IF statements you need to either Return true(allow DragDrop) or Return false (deny Drag/Drop)

Code:
[LIST=1]
[*]if ( pm != null && dropped is ZeldaNote )
                {
                    if (!ZeldaQuestSater)
                        {
                            dropped.Delete();
                            pm.AddToBackpack( new AdjustableSkillBall (25) );
                            pm.AddToBackpack( new Daat99Tokens( 100 ) );
                            pm.SendGump( new LinkQuestCompleteGump(m) );
                            acct.SetTag("ZeldaQuestComplete", "True");

			 return true;
                        }
                    else
                        {
                            SayTo( from, "You have already shown my this note and been rewarded,.." );

			 return false;

                        }
               
                }
            else   
                {
                    SayTo( from, "How is this proof of the Princess's freedom? This is no time for games." );

		 return false;
                }
        }
   
    }
}
[/LIST]


If you want to learn how it all works you should really study a bit of C# to get the basics of the language.
Here is a link for some C# lessons. There are 100 of them. They are really good for learning C# and get
you going pretty fast. I learned a lot from them! As I mentioned earier in post if you get Visual Studio 2013 Community(Free Edition) it will save you a lot of time and it will catch errors before you even get to compiling your server.

http://servuo.com/threads/c-tutorials.567/
 
Example:
Code:
public bool stuff()
{
	if (10 < 120)
	{
		if (60 < 220)
		{
			sendErrorMessage
		}
		else if (220 == 220)
		{
			dostuffs
			return true
		}
		else
			sendErrorMessage
 	}
	else
		sendErrorMessage

	return false //if you pass in a 'else' above, it will always end here anyways.
}
You do not "need" to put a return false at each end if an If statement, you can put one at the end of the method, as when it leaves all the Ifs, it reach the final return.
The other way works too, it's just a matter of preference.
 
Aye Pooka is right...Could have let the falses fall through but doing it the way way I did it stops unnecessary processing. Still new to programming myself but learning a lot!
 
Hey hey, it finally compiles! Now to do get to testing it all later tonight. I just wanted to take a minute and thank you all for helping me with what prolly seems to your all as something so simple. and thanks Sorthious for that link to those tutorials, I'm going to be studying a lot of that this weekend.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back