|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
This is a spawn that is in the serer when you get it and I am not sure what it is for. Is he a joke or does he do somithing I could swaer I saw it picking up items on the gound... lol maybe re name him Trashman......... this is the script
using System; using Server; namespace Server.Mobiles { public class Wanderer : Mobile { private Timer m_Timer; [Constructable] public Wanderer() { this.Name = "Me"; this.Body = 0x1; this.AccessLevel = AccessLevel.GameMaster; m_Timer = new InternalTimer( this ); m_Timer.Start(); } public Wanderer( Serial serial ) : base( serial ) { m_Timer = new InternalTimer( this ); m_Timer.Start(); } public override void OnDelete() { m_Timer.Stop(); base.OnDelete(); } 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(); } private class InternalTimer : Timer { private Wanderer m_Owner; private int m_Count = 0; public InternalTimer( Wanderer owner ) : base( TimeSpan.FromSeconds( 0.1 ), TimeSpan.FromSeconds( 0.1 ) ) { m_Owner = owner; } protected override void OnTick() { if ( (m_Count++ & 0x3) == 0 ) { m_Owner.Direction = (Direction)(Utility.Random( 8 ) | 0x80); } m_Owner.Move( m_Owner.Direction ); } } } } |
|
|
|
|
|
#4 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
ok thanks,,,, is there a way to make him pick up the trash(items that people leave on the ground) lol
You funny peace Phantom Posted: Sun Aug 24, 2003 7:44 am Post subject: -------------------------------------------------------------------------------- I don't get it... I got Phantom stumped..lol |
|
|
|
|
|
#10 (permalink) |
|
Forum Administrator
|
Looking at the horde minion script, you get this.
[code:1] private DateTime m_NextPickup; public override void OnThink() { base.OnThink(); if ( DateTime.Now < m_NextPickup ) return; m_NextPickup = DateTime.Now + TimeSpan.FromSeconds( 2.5 + (2.5 * Utility.RandomDouble()) ); Map map = this.Map; if ( map == null ) return; Container pack = this.Backpack; if ( pack == null ) return; ArrayList list = new ArrayList(); IPooledEnumerable eable = map.GetItemsInRange( Location, 2 ); foreach ( Item item in eable ) { if ( item.Movable && item.Stackable ) list.Add( item ); } eable.Free(); for ( int i = 0; i < list.Count; ++i ) { Item item = (Item)list[i]; if ( !pack.CheckHold( this, item, false, true ) ) return; bool rejected; LRReason reject; NextActionTime = DateTime.Now; Lift( item, item.Amount, out rejected, out reject ); if ( rejected ) continue; Drop( this, Point3D.Zero ); } } [/code:1] This code will only pick up stackable items. If you want him to pick up all items, remove the check for item.Stackable.
__________________
Alkiser UO Gamers - Public Relations alkiser@uogamers.com Please do not pm me for support. If you are having game issues please page for a staff member in game. Thanks for your continued support of UO Gamers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|