RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

a stupid syntax question

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?
 

KillerBeeZ

Knight
ok I found a way to get it to compile, now there is another problem.... it doesnt work.

I tryed it out and it doesnt make the players light level 25

can you see what I'm doing wrong?

[code:1]namespace Server.Items
{
public class Infravision : Item
{
[Constructable]
public Infravision() : base( 0xF21 )
{
LootType = LootType.Blessed;
Movable = false;
Visible = false;
Name = "Infravision";
}

public Infravision( Mobile from )
{
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]
 
Top