wow many thx lokai !!!
anyway to solve the questmarker delete problem?
 

Attachments

  • PlayerMobile.cs
    113 KB · Views: 1
Let me know if this works. I commented where I made the small change.
 

Attachments

  • PlayerMobile.cs
    113.2 KB · Views: 4
Try this as the Deser method for the Questmarker:

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

            int version = reader.ReadInt();
			
			bool found = false;
            foreach (Mobile m in this.GetObjectsInRange(1)) // Looking for someone close by
            {
                if (m is Beo)
                {
					found = true;
                }
            }
			if (!found) this.Delete();
        }
 
i get an error in playermobile , the name from is not given in the actual context

EDIT

I replaced "from" with "this", it seems to work! further testing is required though
if i delete questgiver questmarker still stays there also if questgiver respawns

also i can add more quest just by adding
BaseQuest bq = new QUESTNAME(); to playermobile and the questmarker.cs?

even if this worked how would I add another questgiver ?
if(m is Beo)
what if i have other questgivers?
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();

bool found = false;
foreach (Mobile m in this.GetObjectsInRange(1)) // Looking for someone close by
{
if (m is Beo)
{
found = true;
}
}
if (!found) this.Delete();

EDIT 2

ok after adding this:

bg = new ProblemeüberProbleme(); // another quest
it compiles but dosent work anymore, and right now i'm not sure if worked before
it disappeared after the quest for a short time but it seems to be visible again
 
Last edited:
Try this. Not sure about the method name "OnBeforeDelete()" so check that in case I have it wrong. Should work though.
 

Attachments

  • Beowulf.cs
    2.6 KB · Views: 3
OK. I just had time to look it up. It should be "OnDelete()" instead.

Also, at the end of the method, before the last closing brace, add "base.OnDelete();"
 
yes sir, this one worked! thank you so much lokai
anyway
this is not the right way to add another quests or?
it compiles but it seems not to work
BaseQuest bq = new HeldenbrauchtdasLand();
bq = new ProblemeüberProbleme();
bq = new andsoon();
 
The Questmarker is directly tied to Beo. If you want to do another, you should just copy it, give it a different name, and replace the references to Beo and HeldenbrauchtdasLand with the appropriate changes in the new scripts.
 
no idea guys how to do it, anyway i'm glad i can now give questgivers questmarkers over the their head, kudos to you for all your help especially Lokai and po0ka
 
This is an example of a private class and where to put it.


Code:
namespace Server.Items
{
	public class TrashBag : Container
	{
		[Constructable]
		public TrashBag() : base( 0xE76 )
		{
			...	
		}

		...

		private Timer m_Timer;
		private class EmptyTimer : Timer
		{
			private TrashBag m_Bag;
			public EmptyTimer( TrashBag bag ) : base( TimeSpan.FromMinutes( 5.0 ) )
			{
				m_Bag = bag;
				Priority = TimerPriority.FiveSeconds;
			}
			protected override void OnTick()
			{
				m_Bag.Empty( 501479 ); // Emptying the trashcan!
			}
		}
	}
}
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back