NPC'S can loot body's and equated items

WhiteWolf

Citizen
Jun 24, 2016
28
3
3
40
Hello All
I am trying to custom my NPC'S to loot body's and then Equated if its batter then what they have on.
I got it to loot but its not looting all items at ones

public override bool CanRummageCorpses{ get{ return true; } }

But cant get the Auto Equated right

base.OnThink();
EquipItem(new WarAxe());

All that do is Spawn the item in there hand.

Any ideas
Thanks for looking
 

GoldDraco13

Squire
Aug 1, 2014
415
262
63
48
Canada
mycy4.com
Donate
Donate money to this user
You''ll need to do a check on items in backpack and compare them then give the item that you want to equip, cast to a reference and use that reference to be called in the EquipItem(CastedItem);

To get all items into a list so you can evaluate, you use something like this
List<Item> searcheditems = mobile.Backpack.Items;

then check each item against your item, if better cast it and equip it!