ArisBB
Sorceror
Hi all !
I'm creating a stone in location of character creation, that on double click, move this player to another location and make it invulnerable for 10 seconds, but i dont know work with timers.
After any trys, nothing... =(
anyone can help me with this??? thanks for all
Here is the code that i tryed any times.
I'm creating a stone in location of character creation, that on double click, move this player to another location and make it invulnerable for 10 seconds, but i dont know work with timers.
After any trys, nothing... =(
anyone can help me with this??? thanks for all
Here is the code that i tryed any times.
Code:
using System;
using Server.Items;
namespace Server.Items
{
public class InitStone : Item
{
[Constructable]
public InitStone() : base( 3804 )
{
Movable = false;
Hue = 2909;
Name = "The World Stone";
}
private DateTime m_NextMove;
public override void OnDoubleClick( Mobile from )
{
bool first = true;
int count = 0;
if (count == 0)
{
from.SendMessage( "You Have 10 seconds with invulnerability to get out this location!!!!!" );
from.Map = Map.Trammel;
from.Location = new Point3D(6832, 155,0);
from.MoveToWorld(from.Location, from.Map);
from.Blessed = true;
if ( DateTime.Now < m_NextMove )
return;
m_NextMove = DateTime.Now + TimeSpan.FromSeconds( 1.0 );
count += 1;
if (count == 10)
{
from.Blessed = false;
from.FixedParticles(14170, 9, 32, 0x13AF, EffectLayer.Waist);
}
//Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( StopT ) );
//{
//from.Blessed = true;
//from.FixedParticles(14170, 9, 32, 0x13AF, EffectLayer.Waist);
//}
//private static TimeSpan ResurrectDelay = TimeSpan.FromSeconds( 2.0 );
}
else
from.SendMessage( "finish!!!!!!!!!!!!" );
}
/*private void StopT( Mobile from )
{
from.Blessed = false;
from.FixedParticles(14170, 9, 32, 0x13AF, EffectLayer.Waist);
}*/
public InitStone( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}