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!

First example ^_^

Tom Bombadil

Wanderer
First example ^_^

there is some tutorial ??
i want to target an object and if it's a tree mi player do something ... mmm how could i do this ??
SendLocalizedMessage( 502434 ); --> where is the string ?

[code:1]
public override void OnDoubleClick( Mobile from )
{
from.SendLocalizedMessage( 502434 );

from.Target = new InternalTarget( this );
}

private class InternalTarget : Target
{
private Dagger m_Item;

public InternalTarget( Dagger item ) : base( 1, false, TargetFlags.None )
{
m_Item = item;
}

protected override void OnTarget( Mobile from, object targeted )
{
//here the control of my target ....
}

}
[/code:1]

:?
 
A

Allmight

Guest
Answer

The string is located in the Clients cliloc files. There is a tool you can download from the download page that shows all cliloc messages and it's corresponding number.
 
R

Robert

Guest
I would guess something like the following (you may need to modify to your needs

[code:1]StaticTarget obj = (StaticTarget)targeted;

bool isTree = false;

for ( int i = 0; i < m_TreeIDs.Length && !isTree; ++i )
{
if ( obj.ItemID == m_TreeIDs )
isTree = true;
}

if ( isTree )
{
[/code:1]

-MaGnEtIc
 
Top