Exemple #1
0
 internal static void g__CHAT_MSG_PET_INFO()
 {
     if (FNVFlightMasterSettings.CurrentSettings.updateTaxi && !Main._updateNodes)
     {
         Main._updateNodes = true;
         foreach (FlightMasterDB flightMasterDB in Main.fillDB())
         {
             if (flightMasterDB.continent.Equals(Main.checkContinent()))
             {
                 int num = Lua.LuaDoString <int>("for i=0,48 do if string.find(TaxiNodeName(i),\'" + to.name.Replace("'", "\\'") + "\') then return i end end return -1", "");
                 if (num == -1 && flightMasterDB.alreadyDiscovered)
                 {
                     Logging.Write("[tbcFlightMaster]: Taxi node " + flightMasterDB.name + " has not been discovered so far");
                     flightMasterDB.alreadyDiscovered = false;
                     FNVFlightMasterSettings.flightMasterSaveChanges(flightMasterDB, false);
                 }
                 else if (num != -1 && !flightMasterDB.alreadyDiscovered)
                 {
                     Logging.Write("[tbcFlightMaster]: Taxi node " + flightMasterDB.name + " has already been discovered");
                     flightMasterDB.alreadyDiscovered = true;
                     FNVFlightMasterSettings.flightMasterSaveChanges(flightMasterDB, true);
                 }
             }
         }
         Main._updateNodes = false;
         Thread.Sleep(Usefuls.Latency * 5 + 5000);
     }
 }
    private static void discoverTaxi(FlightMasterDB flightMasterToDiscover)
    {
        FNVFlightMasterSettings.Load();
        List <FlightMasterDB> FMLdt = fillDB();

        if (wManager.Wow.Bot.Tasks.GoToTask.ToPosition(flightMasterToDiscover.position, 3.5f, false, context => Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore))
        {
            wManager.Wow.Bot.Tasks.GoToTask.ToPosition(flightMasterToDiscover.position, 3.5f, false, context => Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore);

            if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(flightMasterToDiscover.position, flightMasterToDiscover.NPCId, -1, false, context => Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore, false))
            {
                wManager.wManagerSetting.ClearBlacklistOfCurrentProductSession();
                wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(flightMasterToDiscover.position, flightMasterToDiscover.NPCId, -1, false, context => Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !Conditions.IsAttackedAndCannotIgnore, false);

                if (ObjectManager.Me.IsMounted)
                {
                    wManager.Wow.Bot.Tasks.MountTask.DismountMount(false, false, 100);
                }

                Usefuls.SelectGossipOption(GossipOptionsType.taxi);
                Thread.Sleep(Usefuls.Latency + 1500);

                while (_updateNodes)
                {
                    Logging.Write("[VanillaFLightMaster]: Taxi node update in progress...");
                    Thread.Sleep(10000);
                }

                Logging.Write("[VanillaFlightMaster]: Flight Master " + flightMasterToDiscover.name + " discovered");
                flightMasterToDiscover.alreadyDiscovered = true;
                FNVFlightMasterSettings.flightMasterSaveChanges(flightMasterToDiscover, true);

                Thread.Sleep(Usefuls.Latency * 5);

                timer = 0;
                //_timer = true;
                discoverTaxiNode     = (FlightMasterDB)null;
                _taxiToDiscover      = false;
                _discoverInProessing = false;
                _discoverTaxiTimer   = true;
                Reenable();
                return;
            }
        }
        _discoverInProessing = false;
        return;
    }
    public static bool Load()
    {
        try
        {
            if (File.Exists(AdviserFilePathAndName("VanillaFlightMaster_DB", ObjectManager.Me.Name + "." + Usefuls.RealmName)))
            {
                FNVFlightMasterSettings.CurrentSettings = Load <FNVFlightMasterSettings>(AdviserFilePathAndName("VanillaFlightMaster_DB", ObjectManager.Me.Name + "." + Usefuls.RealmName));
                return(true);
            }

            FNVFlightMasterSettings.CurrentSettings = new FNVFlightMasterSettings();
        }
        catch (Exception e)
        {
            Logging.WriteDebug("VanillaFlightMaster_DB => Load(): " + e);
        }
        return(false);
    }
 // Token: 0x0600002A RID: 42 RVA: 0x000042F8 File Offset: 0x000024F8
 public static bool Load()
 {
     try
     {
         bool flag = File.Exists(Settings.AdviserFilePathAndName("tbcFlightMaster_DB", ObjectManager.Me.Name + "." + Usefuls.RealmName));
         if (flag)
         {
             FNVFlightMasterSettings.CurrentSettings = Settings.Load <FNVFlightMasterSettings>(Settings.AdviserFilePathAndName("tbcFlightMaster_DB", ObjectManager.Me.Name + "." + Usefuls.RealmName));
             return(true);
         }
         FNVFlightMasterSettings.CurrentSettings = new FNVFlightMasterSettings();
     }
     catch (Exception arg)
     {
         Logging.WriteDebug("tbcFlightMaster_DB => Load(): " + arg);
     }
     return(false);
 }
Exemple #5
0
 // Token: 0x06000003 RID: 3
 public void Initialize()
 {
     Logging.Write("[tbcFlightMaster]: Flight Master initialized - " + this.version);
     Main._isLaunched           = true;
     Main.inProcessing          = false;
     Main._copySettings         = true;
     Main._runScan              = true;
     Main._updateNodes          = false;
     Main.cancelCheckPathThread = false;
     Main.ingameSettings();
     this.watchForEvents();
     FNVFlightMasterSettings.Load();
     Main.applyDefaultNodes();
     MovementEvents.OnMovementPulse += Main.MovementEventsOnOnMovementPulse;
     MovementEvents.OnSeemStuck     += Main.MovementEventsOnOnSeemStuck;
     this.scanNearbyTaxi.Start();
     this.flightMasterLoop();
 }
    public void Initialize()
    {
        Logging.Write("[VanillaFlightMaster]: Flight Master initialized - " + version);
        _isLaunched           = true;
        inProcessing          = false;
        _copySettings         = true;
        _runScan              = true;
        _updateNodes          = false;
        cancelCheckPathThread = false;

        ingameSettings();
        watchForEvents();
        FNVFlightMasterSettings.Load();
        applyDefaultNodes();
        MovementEvents.OnMovementPulse += MovementEventsOnOnMovementPulse;
        MovementEvents.OnSeemStuck     += MovementEventsOnOnSeemStuck;

        scanNearbyTaxi.Start();
        flightMasterLoop();
    }
    private void watchForEvents()
    {
        EventsLuaWithArgs.OnEventsLuaWithArgs += (LuaEventsId id, List <string> args) =>
        {
            if (id == wManager.Wow.Enums.LuaEventsId.TAXIMAP_OPENED && FNVFlightMasterSettings.CurrentSettings.updateTaxi)
            {
                if (!_updateNodes)
                {
                    _updateNodes = true;
                    List <FlightMasterDB> dbUpdate = fillDB();
                    int node = -1;

                    foreach (var temp in dbUpdate)
                    {
                        if (temp.continent.Equals(checkContinent()))
                        {
                            node = -1;
                            node = wManager.Wow.Helpers.Lua.LuaDoString <int>("for i=0,30 do if string.find(TaxiNodeName(i),'" + temp.name + "') then return i end end return -1");

                            if (node == -1 && temp.alreadyDiscovered)
                            {
                                Logging.Write("[VanillaFlightMaster]: Taxi node " + temp.name + " has not been discovered so far");
                                temp.alreadyDiscovered = false;
                                FNVFlightMasterSettings.flightMasterSaveChanges(temp, false);
                            }
                            else if (node != -1 && !temp.alreadyDiscovered)
                            {
                                Logging.Write("[VanillaFlightMaster]: Taxi node " + temp.name + " has already been discovered");
                                temp.alreadyDiscovered = true;
                                FNVFlightMasterSettings.flightMasterSaveChanges(temp, true);
                            }
                        }
                    }
                    _updateNodes = false;
                    Thread.Sleep(Usefuls.Latency * 5 + 5000);
                }
            }
        };
    }
 public void Settings()
 {
     FNVFlightMasterSettings.Load();
     FNVFlightMasterSettings.CurrentSettings.ToForm();
     FNVFlightMasterSettings.CurrentSettings.Save();
 }