Go Back   RunUO - Ultima Online Emulation > RunUO > Utility Support > LearnUO Team

LearnUO Team Irro\'s Team of LearnUO and their Documentation for RunUO

Reply
 
Thread Tools Display Modes
Old 07-22-2005, 08:56 AM   #1 (permalink)
Forum Expert
 
Sunshine's Avatar
 
Join Date: Mar 2005
Location: Hopefully not near you
Posts: 2,233
Default 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
Sunshine is offline   Reply With Quote
Old 07-23-2005, 08:38 PM   #2 (permalink)
 
Join Date: Jul 2005
Age: 17
Posts: 14
Send a message via AIM to *VeX* Send a message via MSN to *VeX*
Default

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...?
*VeX* is offline   Reply With Quote
Old 07-24-2005, 11:12 PM   #3 (permalink)
 
Join Date: Mar 2005
Age: 19
Posts: 64
Default 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
Liquid-Fusion 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5