public static void SetVictimData(Ped ped, string injury, string cause, float survivability)
 {
     if (PluginCheck.IsLspdfrPluginRunning("BetterEMS", new Version("2.0.6056.26204")) == true)
     {
         VictimData(ped, injury, cause, survivability);
     }
 }
 public void GivePedsCourtCase(List <Ped> pedList, string charge)
 {
     if (PluginCheck.IsLSPDFRPlusRunning())
     {
         LSPDFRPlusAPI.AddCourtCase(pedList, charge);
     }
 }
 public static void RequestEms(Vector3 loc, Queue <Vector3> queue)
 {
     if (PluginCheck.IsLspdfrPluginRunning("BetterEMS", new Version("3.0.6232.42981")) == true)
     {
         EmsRespond(loc, queue);
     }
 }
Ejemplo n.º 4
0
        static void Functions_OnOnDutyStateChanged(bool onDuty)
        {
            if (onDuty)
            {
                GameFiber.StartNew(delegate
                {
                    RegisterCallouts();
                    Game.Console.Print();
                    Game.Console.Print("=============================================== UnitedCallouts by sEbi3 ================================================");
                    Game.Console.Print();
                    Game.Console.Print("[LOG]: Callouts and settings were loaded successfully.");
                    Game.Console.Print("[LOG]: The config file was loaded successfully.");
                    Game.Console.Print("[VERSION]: Detected Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString());
                    Game.Console.Print("[LOG]: Checking for a new UnitedCallouts version.");
                    Game.Console.Print();
                    Game.Console.Print("=============================================== UnitedCallouts by sEbi3 ================================================");
                    Game.Console.Print();

                    // You can find all textures/images in OpenIV
                    Game.DisplayNotification("web_lossantospolicedept", "web_lossantospolicedept", "UnitedCallouts", "~y~v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + " ~o~by sEbi3", "~b~successfully loaded!");
                    PluginCheck.isUpdateAvailable();

                    GameFiber.Wait(300);
                    if (Settings.HelpMessages)
                    {
                        Game.DisplayHelp("You can change all ~y~keys~w~ in the ~g~UnitedCallouts.ini~w~. Press ~b~" + Settings.EndCall + "~w~ to end a callout.", 5000);
                    }
                });
            }
        }
Ejemplo n.º 5
0
        static void Functions_OnOnDutyStateChanged(bool onDuty)
        {
            if (onDuty)
            {
                GameFiber.StartNew(delegate
                {
                    RegisterCallouts();
                    Game.Console.Print();
                    Game.Console.Print("=============================================== UnitedCallouts by sEbi3 ================================================");
                    Game.Console.Print();
                    Game.Console.Print("[LOG]: Callouts and settings loaded succesfully.");
                    Game.Console.Print("[LOG]: The config file loaded succesfully.");
                    Game.Console.Print("[VERSION]: Detected Version:  " + Assembly.GetExecutingAssembly().GetName().Version.ToString());
                    Game.Console.Print("[LOG]: You are playing on the newest version.");
                    Game.Console.Print();
                    Game.Console.Print("=============================================== UnitedCallouts by sEbi3 ================================================");
                    Game.Console.Print();

                    Game.DisplayNotification(
                        "web_lossantospolicedept",                  // You can find all logos/images in OpenIV
                        "web_lossantospolicedept",                  // You can find all logos/images in OpenIV
                        "UnitedCallouts",                           // Title
                        "~y~v" + Assembly.GetExecutingAssembly().GetName().Version.ToString() +
                        " ~o~by sEbi3", "~b~successfully loaded!"); // Subtitle
                    PluginCheck.isUpdateAvailable();
                });
            }
        }
        public void GiveCourtCase(List <Ped> pedList, string crimes)
        {
            if (!PluginCheck.IsLSPDFRPlusRunning())
            {
                return;
            }

            LSPDFRPlusAPI.AddCourtCase(pedList, crimes);
        }
 public void GivePedsCourtCase(List <Ped> pedList1, List <Ped> pedList2, string charge)
 {
     if (!PluginCheck.IsLSPDFRPlusRunning())
     {
         return;
     }
     LSPDFRPlusAPI.AddCourtCase(pedList1, charge);
     LSPDFRPlusAPI.AddCourtCase(pedList2, charge);
 }
 public static bool?WasPedRevived(Ped ped)
 {
     if (PluginCheck.IsLspdfrPluginRunning("BetterEMS", new Version("2.0.6056.26204")) == true)
     {
         return(EmsRevivePed(ped));
     }
     else
     {
         return(null);
     }
 }
        public override bool OnBeforeCalloutDisplayed()
        {
            $"Starting callout".AddLog();
            SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around2D(250f, 350f));

            this.ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 150f);

            this.CalloutPosition = SpawnPoint;

            Functions.PlayScannerAudio(StartScannerAudio);

            if (PluginCheck.IsComputerPlusRunning())
            {
                $"Computer+ found".AddLog();
                _computerPlus = true;
                _callId       = ComputerPlusAPI.CreateCallout(CalloutName, SpawnPoint,
                                                              (int)ComputerPlus_ResponseType, ComputerPlus_CallMsg);
                ComputerPlusAPI.UpdateCalloutStatus(_callId, 2);
            }

            _sw.Start();

            return(base.OnBeforeCalloutDisplayed());
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Called when user Enable the plugin.
        /// </summary>
        public void OnEnabled()
        {
            try
            {
                Logger.Log("OnEnable start");
                DateTime dateOnEnabledStart = DateTime.UtcNow;

                BotMain.OnStart += TrinityBotStart;
                BotMain.OnStop  += TrinityBotStop;

                SetWindowTitle();

                if (!Directory.Exists(FileManager.PluginPath))
                {
                    Logger.Log(TrinityLogLevel.Info, LogCategory.UserInformation, "Fatal Error - cannot enable plugin. Invalid path: {0}", FileManager.PluginPath);
                    Logger.Log(TrinityLogLevel.Info, LogCategory.UserInformation, "Please check you have installed the plugin to the correct location, and then restart DemonBuddy and re-enable the plugin.");
                    Logger.Log(TrinityLogLevel.Info, LogCategory.UserInformation, @"Plugin should be installed to \<DemonBuddyFolder>\Plugins\Trinity\");
                }
                else
                {
                    PluginCheck.Start();

                    HasMappedPlayerAbilities = false;
                    _isPluginEnabled         = true;

                    // Settings are available after this...
                    LoadConfiguration();

                    Navigator.PlayerMover = new PlayerMover();
                    BotManager.SetUnstuckProvider();
                    GameEvents.OnPlayerDied   += TrinityOnDeath;
                    GameEvents.OnGameJoined   += TrinityOnJoinGame;
                    GameEvents.OnGameLeft     += TrinityOnLeaveGame;
                    GameEvents.OnItemSold     += ItemEvents.TrinityOnItemSold;
                    GameEvents.OnItemSalvaged += ItemEvents.TrinityOnItemSalvaged;
                    GameEvents.OnItemStashed  += ItemEvents.TrinityOnItemStashed;
                    GameEvents.OnItemIdentificationRequest += ItemEvents.TrinityOnOnItemIdentificationRequest;
                    GameEvents.OnGameChanged  += GameEvents_OnGameChanged;
                    GameEvents.OnWorldChanged += GameEvents_OnWorldChanged;

                    CombatTargeting.Instance.Provider   = new BlankCombatProvider();
                    LootTargeting.Instance.Provider     = new BlankLootProvider();
                    ObstacleTargeting.Instance.Provider = new BlankObstacleProvider();

                    if (Settings.Loot.ItemFilterMode != Config.Loot.ItemFilterMode.DemonBuddy)
                    {
                        ItemManager.Current = new TrinityItemManager();
                    }

                    // Safety check incase DB "OnStart" event didn't fire properly
                    if (BotMain.IsRunning)
                    {
                        TrinityBotStart(null);
                        if (ZetaDia.IsInGame)
                        {
                            TrinityOnJoinGame(null, null);
                        }
                    }

                    BeginInvoke(BotManager.SetBotTicksPerSecond);

                    UI.UILoader.PreLoadWindowContent();

                    Logger.Log(TrinityLogLevel.Info, LogCategory.UserInformation, "ENABLED: {0} now in action!", Description);
                }

                if (StashRule != null)
                {
                    // reseting stash rules
                    BeginInvoke(() => StashRule.reset());
                }

                Logger.LogDebug("OnEnable took {0}ms", DateTime.UtcNow.Subtract(dateOnEnabledStart).TotalMilliseconds);
            }
            catch (Exception ex)
            {
                Logger.LogError("Error in OnEnable: " + ex);
            }
        }
Ejemplo n.º 11
0
        //public static bool IsMoveRequested { get; set; }

        public Trinity()
        {
            _instance = this;
            PluginCheck.CheckAndInstallTrinityRoutine();
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Called when DemonBuddy initialize the plugin.
 /// </summary>
 public void OnInitialize()
 {
     PluginCheck.CheckAndInstallTrinityRoutine();
     Logger.Log("Initialized v{0}", Version);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Called when DemonBuddy shut down.
 /// </summary>
 public void OnShutdown()
 {
     GenericCache.Shutdown();
     GenericBlacklist.Shutdown();
     PluginCheck.Shutdown();
 }