|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
|
I wish to edit the [SignGen command to only spawn signs for felucca, britain here is my current signgen script:
[code:1] using System; using System.Collections; using System.IO; using Server; using Server.Items; namespace Server.Scripts.Commands { public class SignParser { private class SignEntry { public string m_Text; public Point3D m_Location; public int m_ItemID; public int m_Map; public SignEntry( string text, Point3D pt, int itemID, int mapLoc ) { m_Text = text; m_Location = pt; m_ItemID = itemID; m_Map = mapLoc; } } public static void Initialize() { Server.Commands.Register( "SignGen", AccessLevel.Administrator, new CommandEventHandler( SignGen_OnCommand ) ); } [Usage( "SignGen" )] [Description( "Generates signs from an input file (signs.cfg)" )] public static void SignGen_OnCommand( CommandEventArgs c ) { Parse( c.Mobile ); } public static void Parse( Mobile from ) { string cfg = Path.Combine( Core.BaseDirectory, "Data/signs.cfg" ); if ( File.Exists( cfg ) ) { ArrayList list = new ArrayList(); from.SendMessage( "Generating signs, please wait." ); using ( StreamReader ip = new StreamReader( cfg ) ) { string line; while ( (line = ip.ReadLine()) != null ) { string[] split = line.Split( ' ' ); SignEntry e = new SignEntry( line.Substring( split[0].Length + 1 + split[1].Length + 1 + split[2].Length + 1 + split[3].Length + 1 + split[4].Length + 1 ), new Point3D( Utility.ToInt32( split[2] ), Utility.ToInt32( split[3] ), Utility.ToInt32( split[4] ) ), Utility.ToInt32( split[1] ), Utility.ToInt32( split[0] ) ); list.Add( e ); } } Map[] fel = new Map[]{ Map.Felucca }; for ( int i = 0; i < list.Count; ++i ) { SignEntry e = (SignEntry)list[i]; Map[] maps = null; switch ( e.m_Map ) { case 1: maps = fel; break; // Felucca } for ( int j = 0; maps != null && j < maps.Length; ++j ) Add_Static( e.m_ItemID, e.m_Location, maps[j], e.m_Text ); } from.SendMessage( "Sign generating complete." ); } else { from.SendMessage( "{0} not found!", cfg ); } } private static Queue m_ToDelete = new Queue(); public static void Add_Static( int itemID, Point3D location, Map map, string name ) { IPooledEnumerable eable = map.GetItemsInRange( location, 0 ); foreach ( Item item in eable ) { if ( item is Sign && item.Z == location.Z && item.ItemID == itemID ) m_ToDelete.Enqueue( item ); } eable.Free(); while ( m_ToDelete.Count > 0 ) ((Item)m_ToDelete.Dequeue()).Delete(); Item sign; if ( name.StartsWith( "#" ) ) { sign = new LocalizedSign( itemID, Utility.ToInt32( name.Substring( 1 ) ) ); } else { sign = new Sign( itemID ); sign.Name = name; } sign.MoveToWorld( location, map ); } } } [/code:1] Currently it only spawns felucca but how can I make it do britain only? |
|
|
|
|
|
#4 (permalink) | |
|
Account Terminated
|
Quote:
0 3032 373 904 -1 #1016093 Map ID X Y Z Localized Message Just get rid of all the signs that are not on felucca, and not near the britain region. |
|
|
|
|
|
|
#7 (permalink) | |
|
Account Terminated
|
Quote:
Your going to have to figure that out yourself, sorry for taking so long to reply went to bed after I went out last night. To be honest without going to the locations and spending 20 minutes myself to figure out I can't tell you what order the map id's go. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|