Jump to content

Vendoring issues


Recommended Posts

It will repeatedly choose an Alliance vendor when I'm Horde, it made 17 trips to an Alliance base, obviously dying.

I manually disabled it in the DB and it still will go to that vendor which is farther than the nearest Horde one.

 

Any plans for fixes or at least an API call so I can rewrite functionality?

Link to comment
Share on other sites

For  what I have heard it is recommend to split wrobot into two folders. One folder for each faction. That should fix all of these problems. 

 

Greetings

Link to comment
Share on other sites

private static Predicate<Npc> _dbFilter = n => n.CurrentProfileNpc && (n.Type == Npc.NpcType.Vendor || n.Type == Npc.NpcType.Repair);

public static void Start()
{
  FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += VendorHandler;
}



private static void VendorHandler(Engine engine, State state, CancelEventArgs cancelable)
{
  if(state != null && state.GetType() == typeof(ToTown) && new ToTown().NeedToRun)
  {
    NpcDB.AcceptOnlyProfileNpc = true;
    NpcDB.ListNpc.RemoveAll(_dbFilter);
    Npc vendor = FindVendor(); //this is your own function that returns an object of type NPC
    if (vendor != null)
    {
      NpcDB.AddNpc(vendor, false, true);
    }
  }
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...