Sorry for the stupid question, how to make treasuremaps spawn more creatures around? currently only 5 appear... wich are not too much.

thanksssssss
 
TreasureMap.cs line ~1340
Code:
                   switch (m_TreasureMap.Level)
                    {
                        case 0:
                            spawns = 3;
                            break;
                        case 1:
                            spawns = 0;
                            break;
                        default:
                            spawns = 4;
                            break;
                    }

                    for (int i = 0; i < spawns; ++i)
                    {
                        BaseCreature bc = Spawn(m_TreasureMap.Level, m_Chest.Location, m_Chest.Map, null, true);

                        if (bc != null)
                        {
                            m_Chest.Guardians.Add(bc);
                        }
                    }
 
Ahhh! im blind! Thank you

i edited this:
Code:
m_DeleteTime = DateTime.Now + TimeSpan.FromMinutes( 30.0 );

Why chest doesnt get removed after 30 min?
 
I think you need to change DateTime.Now to DateTime.UtcNow in case

But only in case that in TreasureMapChest.cs it uses the Utc version too like this
Code:
private class DeleteTimer : Timer
{
	private readonly Item m_Item;
	public DeleteTimer(Item item, DateTime time)
		: base(time - DateTime.UtcNow)
 
It doesnt uses Utc version :), it was default 3 hours , so i changed to 30 minutes, not sure why doesnt work


Code:
private class DeleteTimer : Timer
        {
            private readonly Item m_Item;

            public DeleteTimer( Item item, DateTime time ) : base( time - DateTime.Now )
            {
                m_Item = item;
                Priority = TimerPriority.OneMinute;
            }

            protected override void OnTick()
            {
                m_Item.Delete();
            }

Code:
public TreasureMapChest( Mobile owner, int level, bool temporary ) : base( 0xE40 )
        {
            m_Owner = owner;
            m_Level = level;
            m_DeleteTime = DateTime.Now + TimeSpan.FromMinutes( 30.0 );

            m_Temporary = temporary;
            m_Guardians = new List<Mobile>();

            m_Timer = new DeleteTimer( this, m_DeleteTime );
            m_Timer.Start();

            Fill( this, level );
        }
 
Hmm did you try to see how long it takes for it to actually delete? And did you make sure you saved your change? ;)
 
I did yes, i changed to 3 min and it didnt got removed, i really dont feel like waiting 3hours :D.

Im 99% sure i saved the changes hahaha :)

Thank you
 
I did yes, i changed to 3 min and it didnt got removed, i really dont feel like waiting 3hours :D.

Im 99% sure i saved the changes hahaha :)

Thank you

You need to change DeleteTimer class if you really wish to change the time.
[doublepost=1476834211][/doublepost]Timers, sometimes, get first period and check next time with a gap.
In this case, we'll use Delete timer just once.
So, actually I didn't check this script, but it must be including how long it will take a gap for work.
[doublepost=1476836169][/doublepost]Now, I checked the script.

private class DeleteTimer : Timer
{
private readonly Item m_Item;
public DeleteTimer(Item item, DateTime time)
: base(time - DateTime.UtcNow)
{
this.m_Item = item;
this.Priority = TimerPriority.OneMinute;
}

protected override void OnTick()
{
this.m_Item.Delete();
}
}

on here, second value is DateTime.
Try to change like this

private class DeleteTimer : Timer
{
private readonly Item m_Item;
private readonly DateTime m_DateTime;
public DeleteTimer(Item item, TimeSpan time)
: base(time)
{
this.m_Item = item;
this.Priority = TimerPriority.OneSecond;
m_DateTime = DateTime.Now + time;
}

protected override void OnTick()
{
if ( m_DateTime > DateTime.Now ) {
this.m_Item.Delete();
}
}
}

and change L64
private TimeSpan m_DeleteTime;

Change L82
this.m_DeleteTime = TimeSpan.FromMinutes(3.0);
 
Last edited:
Hehe, just click the cross [+] then , code and paste there the code :)

Hmmmm after chest gets deleted guardians stay there, i wish they get removed too...

if you want to, you need to make a list for link chest and basecreatures.
you can find some codes in CannedEvil system
 
Well i can create a copy of each creature that spawns in treasurechest and add them a timer, but im kinda lazy
 
Back