Jump to content

Adding to TaxiDB


Matenia

Recommended Posts

Ignoring the pseudo datasource, is this how flightmasters are added programmatically?

private static void addForFilter(CreatureFilter filter)
{
  List<creature> flightmasters = DbCreature.Get(filter);
  foreach (var creature in flightmasters)
  {
    TaxiNode node = new TaxiNode
    {
      Active = true,
      ContinentId = creature.map,
      Name = creature.Name,
      Position = creature.Position,
    };

    //PluginLog.Log("Adding " + node.Name + " to taxi db");
    Taxi.TaxiList.AddOrEditForCurrentPlayer(node);
  }
  Taxi.TaxiList.Save();
}
Link to comment
Share on other sites

  • 2 weeks later...

I still don't completely understand this. On one character, I have a couple flight paths. However, when checking with the following method, the list is empty (no IsCharacterAvailable for all nodes).

private static bool HasTaxiConnection()
{
  var taxiList = Taxi.TaxiList.GetTaxiNodesOfCurrentPlayer();
  return wManagerSetting.CurrentSetting.FlightMasterTaxiUse
    && taxiList.Exists(n => n.Name == "Ironforge, Dun Morogh" || n.Name == "Gryth Thurden")
    && taxiList.Exists(n => n.Name == "Stormwind, Elwynn" || n.Name == "Dungar Longdrink");
}

This is after I use the code in the original post. The entries in the original post also don't show up, when opening TaxiDB in development tools.
Can you maybe explain this a little? Should I ever add TaxiNodes to wRobot or should I always let wRobot do the adding himself?

My goal was to teach wRobot that there are taxis nearby and then let it walk up to the flightmaster before finding out can/can't use it.
How do I best achieve that - should I just fill a large TaxiDB manually and share the XML file with others?

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
×
×
  • Create New...