Okay so if you ever downloaded PickyBeetle.cs and/or the ShardCleaner.cs then you all are familiar with the OnThink method below.
What I need are two lists or arraylists that function within the code below that specify what items to pick up off the ground and what items to ignore; so one list will be items to grab and the other list will be items that if listed will be ignored by the mobile.
A crude example of what I'm talking about would kind of look like this; yes I know the code is wrong and that is why I am asking for help on here
-----------------------------------------------------------------
Mobile Object Pickup List
-----------------------------------------------------------------
if ( )
item is object || item is object || item is object.....
pickup item;
return true;
-or- Just brainstorming
-----------------------------------------------------------------
Mobile Object Ignore List
-----------------------------------------------------------------
if ( )
item is object || item is object || item is object.....
pickup item;
return false;
-or- Just brainstorming
-----------------------------------------------------------------
The final thing I need is a way to prevent the mobile from picking up an item after it dies. This is a bug in both the ShardCleaner.cs and the PickyBeetle.cs.
What I am doing is remaking my militia scripts. One of the functions of each mercenary is that they will pick up items that have been dropped to the ground and loot specific items off corpses (another method and list I'll need help with in the future.:
swords, armor, arrows, bows...
Thank you so much ahead of time and credit will be given appropriately.
Code:
public override void OnThink()
{
base.OnThink();
if (DateTime.UtcNow < m_NextPickup)
return;
m_NextPickup = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 10));
Container pack = this.Backpack;
if (pack == null)
return;
ArrayList list = new ArrayList();
foreach (Item item in this.GetItemsInRange(2))
{
if (item.Movable && item.Stackable)
list.Add(item);
}
int pickedUp = 0;
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 = Core.TickCount;
Lift(item, item.Amount, out rejected, out reject);
if (rejected)
continue;
Drop(this, Point3D.Zero);
if (++pickedUp == 3)
break;
}
}
What I need are two lists or arraylists that function within the code below that specify what items to pick up off the ground and what items to ignore; so one list will be items to grab and the other list will be items that if listed will be ignored by the mobile.
A crude example of what I'm talking about would kind of look like this; yes I know the code is wrong and that is why I am asking for help on here
-----------------------------------------------------------------
Mobile Object Pickup List
-----------------------------------------------------------------
if ( )
item is object || item is object || item is object.....
pickup item;
return true;
-or- Just brainstorming
Code:
private static Type[] m_Pickup = new Type[]
{
typeof( Gold ), typeof( Broadsword ), typeof( Dagger ), typeof (Bandage)
};
-----------------------------------------------------------------
Mobile Object Ignore List
-----------------------------------------------------------------
if ( )
item is object || item is object || item is object.....
pickup item;
return false;
-or- Just brainstorming
Code:
private static Type[] m_Ignore = new Type[]
{
typeof( SoulSeeker ), typeof( TalonBite ), typeof( TotemOfVoid )
};
The final thing I need is a way to prevent the mobile from picking up an item after it dies. This is a bug in both the ShardCleaner.cs and the PickyBeetle.cs.
What I am doing is remaking my militia scripts. One of the functions of each mercenary is that they will pick up items that have been dropped to the ground and loot specific items off corpses (another method and list I'll need help with in the future.:
swords, armor, arrows, bows...
Thank you so much ahead of time and credit will be given appropriately.
Last edited: