|
||
|
|||||||
| LearnUO Team Irro\'s Team of LearnUO and their Documentation for RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Mar 2005
Location: Hopefully not near you
Posts: 2,233
|
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 |
|
|
|
|
|
#3 (permalink) |
|
Join Date: Mar 2005
Age: 19
Posts: 64
|
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 ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|