RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Limiting quest completion

Sunshine

Wanderer
Limiting quest completion

I have been trying to look at another sript to figure out how to make it where a quest can be completed only once, then maybe a different item is given (say gold), if completed again by the same account

If you have an example or can offer some help I would appreciate it


I have been told this much so far
SetTag();
GetTag();

But not sure what that means or where to place them
 

*VeX*

Wanderer
So for example you want lets say an item to be given the first time its completed, and then gold the next time and time after that ect...?
 
Here is an example

Hello, here is an example script.

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

			if ( mobile != null)
			{
				if( dropped is Baby)
         		{
         			if(dropped.Amount!=1)
         			{
					this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "This in not my baby boy! Are you really that foolish to mess with a good father?", mobile.NetState );
         				return false;
         			}
         			
         			if ( !BabyRecieved ) //added account tag check
							{ 
         				mobile.SendMessage("I honor your bravery, here are some things my wife promised you.");
         			 	mobile.AddToBackpack( new BabySash02() );
         			 	mobile.AddToBackpack( new Gold( 2500 ) );
        			 	acct.SetTag( "BabyRecieved", "true" );

         			 	dropped.Delete();
         			}
         			
         			else //what to do if account has already been tagged
         			{
         				mobile.SendMessage("You are so kind to have taken the time to find the other missing children of Debbie Doo town, here is some gold for your troubles.");
         				mobile.AddToBackpack( new Gold( 1500 ) );
         				dropped.Delete();
         			}
		}


So basically, make a account tag like on the top for your quest. Can be any name. When you first do the quest, it adds the account tag to the mobile. When he does the quest again, it sees that he did it again so it gave a different reward.


Hope this helps :)
 
Top