KillerBeeZ
Knight
a stupid syntax question
I'm working on a way to work with Infravision without editing a playermobile (or using the DovPlayermobile)
Its a simple solution, but I'm not sure how to do this.
1) I don't want players to have to click, doubleclick or do anything for this to work (its even invisible)
2) I want it to work when they log out then back in (light level is reset on logout)
The problem I'm running into is that there is nothing to place a "Mobile from" into.
I'm sure its a simple newbie question that deals with syntax (which is why I'm posting it here)
the script... (or a partial script as this is part of a larger script)
[code:1]
namespace Server.Items
{
public class Infravision : Item
{
[Constructable]
public Infravision() : base( 0xF21 )
{
LootType = LootType.Blessed;
Movable = false;
Visible = false;
Name = "Infravision";
if ( !IsChildOf( from.Backpack ) )
{
from.LightLevel = 25;
}
else
{
}
}
public Infravision( 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();
}
}
}
[/code:1]
and of course as you can see there is no "from" defined... where would I put it?
I'm working on a way to work with Infravision without editing a playermobile (or using the DovPlayermobile)
Its a simple solution, but I'm not sure how to do this.
1) I don't want players to have to click, doubleclick or do anything for this to work (its even invisible)
2) I want it to work when they log out then back in (light level is reset on logout)
The problem I'm running into is that there is nothing to place a "Mobile from" into.
I'm sure its a simple newbie question that deals with syntax (which is why I'm posting it here)
the script... (or a partial script as this is part of a larger script)
[code:1]
namespace Server.Items
{
public class Infravision : Item
{
[Constructable]
public Infravision() : base( 0xF21 )
{
LootType = LootType.Blessed;
Movable = false;
Visible = false;
Name = "Infravision";
if ( !IsChildOf( from.Backpack ) )
{
from.LightLevel = 25;
}
else
{
}
}
public Infravision( 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();
}
}
}
[/code:1]
and of course as you can see there is no "from" defined... where would I put it?