QUOTE (Corbomite) |
Wanted to spawn a treasure map that points to a specific tmap location. Getting the map to spawn using treasuremap,4,trammel works fine. But the location seems to be a random draw. Is there a way to spawn the same tmap each time using an xmlspawner? |
CODE |
[CommandProperty( AccessLevel.GameMaster )] public Point2D ChestLocation{ get{ return m_Location; } set{ m_Location = value; } } |
CODE |
[CommandProperty( AccessLevel.GameMaster )] public Point2D ChestLocation{ get{ return m_Location; } set { m_Location = value; int width = 600; int height = 600; int x1 = m_Location.X - Utility.RandomMinMax(width / 4, (width / 4) * 3); int y1 = m_Location.Y - Utility.RandomMinMax(height / 4, (height / 4) * 3); if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0; int x2 = x1 + width; int y2 = y1 + height; if (x2 >= 5120) x2 = 5119; if (y2 >= 4096) y2 = 4095; x1 = x2 - width; y1 = y2 - height; Bounds = new Rectangle2D(x1, y1, width, height); ClearPins(); AddWorldPin(m_Location.X, m_Location.Y); } } |
CODE |
[Constructable] public TreasureMap( int level, Map map ) { m_Level = level; m_Map = map; if ( level == 0 ) m_Location = GetRandomHavenLocation(); else m_Location = GetRandomLocation(); Width = 300; Height = 300; int width = 600; int height = 600; int x1 = m_Location.X - Utility.RandomMinMax( width / 4, (width / 4) * 3 ); int y1 = m_Location.Y - Utility.RandomMinMax( height / 4, (height / 4) * 3 ); if ( x1 < 0 ) x1 = 0; if ( y1 < 0 ) y1 = 0; int x2 = x1 + width; int y2 = y1 + height; if ( x2 >= 5120 ) x2 = 5119; if ( y2 >= 4096 ) y2 = 4095; x1 = x2 - width; y1 = y2 - height; Bounds = new Rectangle2D( x1, y1, width, height ); Protected = true; AddWorldPin( m_Location.X, m_Location.Y ); } |
CODE |
[Constructable] public TreasureMap( int level, Map map ) { m_Level = level; m_Map = map; if ( level == 0 ) ChestLocation = GetRandomHavenLocation(); else ChestLocation = GetRandomLocation(); Width = 300; Height = 300; Protected = true; } |