Exemplo n.º 1
0
        private static void Combo()
        {
            var target = TargetSelector.GetTarget(Qe.Range, DamageType.Physical);

            if (target == null)
            {
                return;
            }
            var prede = Q.GetPrediction(target);
            var pred  = Qe.GetPrediction(target);

            if (pred.CollisionObjects.Count >= 1)
            {
                return;
            }

            qpred.From  = Qe.GetPrediction(target).CastPosition;
            qpred1.From = Q.GetPrediction(target).CastPosition;

            if (Q.IsReady() && E.IsReady() && getCheckBoxItem(MenuConfig.combo, "useqcr") &&
                Player.Mana >
                Player.Spellbook.GetSpell(SpellSlot.E).SData.Mana + Player.Spellbook.GetSpell(SpellSlot.Q).SData.Mana)
            {
                Qe.Cast(qpred.From);
            }

            if ((Q.IsReady() && !E.IsReady()) || (Q.IsReady() && E.IsReady() && Player.Mana <
                                                  Player.Spellbook.GetSpell(SpellSlot.E).SData.Mana + Player.Spellbook.GetSpell(SpellSlot.Q).SData.Mana))
            {
                if (Player.LSDistance(target) < Q.Range && getCheckBoxItem(MenuConfig.combo, "useqcr"))
                {
                    Q.Cast(qpred1.From);
                }
            }
        }
Exemplo n.º 2
0
        public static void UseQe2(Obj_AI_Base target, Vector3 pos)
        {
            if (target == null || !(ObjectManager.Player.Distance(pos, true) <= Math.Pow(E.Range, 2)))
            {
                return;
            }

            var sp = pos + Vector3.Normalize(ObjectManager.Player.ServerPosition - pos) * 100f;
            var ep = pos + Vector3.Normalize(pos - ObjectManager.Player.ServerPosition) * 592;

            Qe.Delay = Q.Delay + E.Delay + ObjectManager.Player.ServerPosition.Distance(pos) / E.Speed;
            Qe.UpdateSourcePosition(pos);
            var pPo = Qe.GetPrediction(target).UnitPosition.To2D().ProjectOn(sp.To2D(), ep.To2D());

            if (!pPo.IsOnSegment ||
                !(pPo.SegmentPoint.Distance(target, true) <= Math.Pow(Qe.Width + target.BoundingRadius, 2)))
            {
                return;
            }

            var delay = 280 - (int)(ObjectManager.Player.Distance(pos) / 2.5) + Config.Item("q.e.delay").GetValue <Slider>().Value;

            Utility.DelayAction.Add(Math.Max(0, delay), () => E.Cast(pos));
            Qe.LastCastAttemptT = Environment.TickCount;
            Q.Cast(pos);
            UseE(target);
        }
Exemplo n.º 3
0
        private static void Harass()
        {
            var target = TargetSelector.GetTarget(Qe.Range, DamageType.Physical);

            if (target == null)
            {
                return;
            }
            qpred.From  = Qe.GetPrediction(target).CastPosition;
            qpred1.From = Q.GetPrediction(target).CastPosition;
            if (!Ismelee())
            {
                if (Q.IsReady() && E.IsReady() && Player.Mana >
                    Player.Spellbook.GetSpell(SpellSlot.E).SData.Mana + Player.Spellbook.GetSpell(SpellSlot.Q).SData.Mana &&
                    getCheckBoxItem(MenuConfig.harass, "useqhr"))
                {
                    Qe.Cast(qpred.From);
                }

                if (Q.IsReady() && target.LSIsValidTarget(Q.Range) && (!E.IsReady() || Player.Mana <
                                                                       Player.Spellbook.GetSpell(SpellSlot.E).SData.Mana +
                                                                       Player.Spellbook.GetSpell(SpellSlot.Q).SData.Mana) &&
                    getCheckBoxItem(MenuConfig.harass, "useqhr"))
                {
                    Q.Cast(qpred1.From);
                }
            }
            else
            {
                if (Q.IsReady() && getCheckBoxItem(MenuConfig.harass, "useqhm"))
                {
                    Q.Cast(target);
                }
            }
        }
Exemplo n.º 4
0
        public static void UseQe(Obj_AI_Base target)
        {
            if (!Q.IsReady() || !E.IsReady() || target == null)
            {
                return;
            }
            var sPos = Prediction.GetPrediction(target, Q.Delay + E.Delay).UnitPosition;

            if (ObjectManager.Player.Distance(sPos, true) > Math.Pow(E.Range, 2))
            {
                var orb = ObjectManager.Player.ServerPosition + Vector3.Normalize(sPos - ObjectManager.Player.ServerPosition) * E.Range;
                Qe.Delay = Q.Delay + E.Delay + ObjectManager.Player.Distance(orb) / E.Speed;
                var pos = Qe.GetPrediction(target);
                if (pos.Hitchance >= HitChance.High)
                {
                    UseQe2(target, orb);
                }
            }
            else
            {
                Q.Width = 40f;
                var pos = Q.GetPrediction(target, true);
                Q.Width = 125f;
                if (pos.Hitchance >= HitChance.VeryHigh)
                {
                    UseQe2(target, pos.UnitPosition);
                }
            }
        }
Exemplo n.º 5
0
        private static void Combo()
        {
            var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }
            var prede = Q.GetPrediction(target);
            var pred  = Qe.GetPrediction(target);

            if (pred.CollisionObjects.Count > 1)
            {
                return;
            }
            if (Q.IsReady() && E.IsReady() && GetBool("useqcr", typeof(bool)) &&
                Player.Mana >
                Player.Spellbook.GetSpell(SpellSlot.E).ManaCost + Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost)
            {
                Q.Cast(pred.CastPosition);
            }

            if (Q.IsReady() && !E.IsReady())
            {
                if (Player.Distance(target) < 1050 && GetBool("useqcr", typeof(bool)))
                {
                    Q.Cast(prede.CastPosition);
                }
            }
        }
        public static Entity GetBusinessProcessFlowInstanceRelatedToApplicant(IOrganizationService service, string bpfEntityName, Guid applicantId, Guid processId)
        {
            var columns    = new [] { "bpf_eppei_applicantid", "processid", "traversedpath", "activestageid" };
            var conditions = new[] {
                new ConditionExpression("bpf_eppei_applicantid", ConditionOperator.Equal, applicantId),
                new ConditionExpression("processid", ConditionOperator.Equal, processId)
            };
            var bpfInstanceRecord = Qe.QueryRecord(service, bpfEntityName, columns, conditions);

            return(bpfInstanceRecord);
        }
Exemplo n.º 7
0
        private void GenerateQe()
        {
            var j = 0;

            foreach (var triangle in _triangles)
            {
                var f = new double[3];
                for (var i = 0; i < 3; i++)
                {
                    var vertex = triangle.GetVertex(i);
                    f[i] = _func(vertex.X, vertex.Y);
                }
                var vector = Vector.Build.DenseOfArray(f);
                var result = Me[j++].Multiply(vector);
                Qe.Add(result);
            }
        }
        public static Entity GetBpfApplicantRecordRelatedToApplicant(IOrganizationService service, Entity applicant)
        {
            /*Applicant's Attributes Validation*/
            if (!applicant.Attributes.Contains("eppei_iseskom") || !applicant.Attributes.Contains("eppei_academicdegreeid"))
            {
                return(null);
            }
            /*Query Qualification*/
            var qualificationEr = (EntityReference)applicant.Attributes["eppei_academicdegreeid"];
            var isEskom         = (bool)applicant.Attributes["eppei_iseskom"];
            /*Query BPF Applicant Record*/
            var columns    = new [] { "eppei_businessprocessflowid", "eppei_bbfapplicantid", "eppei_bpfentityname", "eppei_iseskom", "eppei_qualificationid" };
            var conditions = new[] { new ConditionExpression("eppei_iseskom", ConditionOperator.Equal, isEskom),
                                     new ConditionExpression("eppei_qualificationid", ConditionOperator.Equal, qualificationEr.Id) };
            var bpfApplicantRecord = Qe.QueryRecord(service, "eppei_bbfapplicant", columns, conditions);

            return(bpfApplicantRecord);
        }
Exemplo n.º 9
0
 public static void UseE(Obj_AI_Base target)
 {
     if (target == null)
     {
         return;
     }
     foreach (var orb in OrbManager.GetOrbs(true).Where(orb => orb.To2D().IsValid() && ObjectManager.Player.Distance(orb, true) < Math.Pow(E.Range, 2)))
     {
         var sp = orb.To2D() + Vector2.Normalize(ObjectManager.Player.ServerPosition.To2D() - orb.To2D()) * 100f;
         var ep = orb.To2D() + Vector2.Normalize(orb.To2D() - ObjectManager.Player.ServerPosition.To2D()) * 592;
         Qe.Delay = E.Delay + ObjectManager.Player.Distance(orb) / E.Speed;
         Qe.UpdateSourcePosition(orb);
         var pPo = Qe.GetPrediction(target).UnitPosition.To2D();
         if (pPo.Distance(sp, ep, true, true) <= Math.Pow(Qe.Width + target.BoundingRadius, 2))
         {
             E.Cast(orb);
         }
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// Prepare query with string parameters
        /// </summary>
        /// <param name="drd"></param>
        /// <param name="sql"></param>
        /// <param name="stringParameterCount"></param>

        public void PrepareMultipleParameterReader(
            DbCommandMx drd,
            string sql,
            int stringParameterCount)
        {
            if (BuildSqlOnly)
            {
                Qe.AddSqlToSqlStatementList(this, sql);
            }

            else
            {
                DateTime t0 = DateTime.Now;
                drd.Prepare(sql, OracleDbType.Varchar2, stringParameterCount);
                double dt = TimeOfDay.Delta(t0);
                ExecuteReaderTime += dt;
                //ExecuteReaderCount++;
            }
            return;
        }
Exemplo n.º 11
0
        /// <summary>
        /// Simple prepare query with no parameters
        /// </summary>
        /// <param name="sql"></param>

        public void PrepareReader(
            DbCommandMx drd,
            string sql)
        {
            if (BuildSqlOnly)
            {
                Qe.AddSqlToSqlStatementList(this, sql);
            }

            else
            {
                DateTime t0 = DateTime.Now;
                drd.Prepare(sql, DbType.String, 0);
                double dt = TimeOfDay.Delta(t0);
                ExecuteReaderTime += dt;
                //ExecuteReaderCount++;
            }

            return;
        }
Exemplo n.º 12
0
        /// <summary>
        /// Open a list reader
        /// </summary>
        /// <param name="list"></param>

        public void ExecuteListReader(
            DbCommandMx drd,
            List <string> list)
        {
            if (BuildSqlOnly)
            {
                string sql = drd.ListSql;                 // sql with list item place holder
                Qe.AddSqlToSqlStatementList(this, sql);
            }

            else
            {
                DateTime t0 = DateTime.Now;
                drd.ExecuteListReader(list);
                double dt = TimeOfDay.Delta(t0);
                ExecuteReaderTime += dt;
                ExecuteReaderCount++;
            }

            return;
        }
Exemplo n.º 13
0
        private static void Harass()
        {
            var target = TargetSelector.GetTarget(Qe.Range, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }
            qpred.From  = Qe.GetPrediction(target).CastPosition;
            qpred1.From = Q.GetPrediction(target).CastPosition;
            if (!Ismelee())
            {
                if (Q.IsReady() && E.IsReady() && Player.Mana >
                    Player.Spellbook.GetSpell(SpellSlot.E).ManaCost + Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost &&
                    GetBool("useqhr", typeof(bool)))
                {
                    Qe.Cast(qpred.From);
                }

                if (Q.IsReady() && target.IsValidTarget(Q.Range) && (!E.IsReady() || Player.Mana <
                                                                     Player.Spellbook.GetSpell(SpellSlot.E).ManaCost +
                                                                     Player.Spellbook.GetSpell(SpellSlot.Q).ManaCost) &&
                    GetBool("useqhr", typeof(bool)))
                {
                    Q.Cast(qpred1.From);
                }
            }
            else
            {
                if (Q.IsReady() && GetBool("useqhm", typeof(bool)))
                {
                    Q.Cast(target);
                }
                if (W.IsReady() && GetBool("usewhm", typeof(bool)) && target.Distance(Player) < W.Range)
                {
                    W.Cast();
                }
            }
        }
Exemplo n.º 14
0
        private static void Harass()
        {
            if (ObjectManager.Player.ManaPercent < Config.Item("harass.mana").GetValue <Slider>().Value)
            {
                return;
            }

            if (Config.Item("disable.harass.under.turret").GetValue <bool>())
            {
                if (ObjectManager.Get <Obj_AI_Turret>().Any(x => ObjectManager.Player.Distance(x) < x.AttackRange && x.Team != ObjectManager.Player.Team))
                {
                    return;
                }
            }

            if (Q.IsReady() && Config.Item("q.harass").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Q.Range) && Q.GetPrediction(x).Hitchance >= HikiChance("q.hit.chance")))
                {
                    Q.Cast(enemy);
                }
            }
            if (W.IsReady() && Config.Item("w.harass").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(W.Range + W.Width) && W.GetPrediction(x).Hitchance >= HikiChance("w.hit.chance")))
                {
                    Helper.UseW(enemy, enemy);
                }
            }
            if (Q.IsReady() && E.IsReady() && Config.Item("qe.harass").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Qe.Range) && Qe.GetPrediction(x).Hitchance >= HikiChance("qe.hit.chance")))
                {
                    Helper.UseQe(enemy);
                }
            }
        }
Exemplo n.º 15
0
        private static void Combo()
        {
            if (Q.IsReady() && Config.Item("q.combo").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Q.Range) && Q.GetPrediction(x).Hitchance >= HikiChance("q.hit.chance")))
                {
                    Q.Cast(enemy);
                }
            }
            if (W.IsReady() && Config.Item("w.combo").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(W.Range + W.Width) && W.GetPrediction(x).Hitchance >= HikiChance("w.hit.chance")))
                {
                    Helper.UseW(enemy, enemy);
                }
            }
            if (Q.IsReady() && E.IsReady() && Config.Item("qe.combo").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Qe.Range) && Qe.GetPrediction(x).Hitchance >= HikiChance("qe.hit.chance")))
                {
                    Helper.UseQe(enemy);
                }
            }

            if (R.IsReady() && Config.Item("r.combo").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(R.Range) && !Helper.BuffCheck(x) &&
                                                                Config.Item("r.combo." + x.ChampionName).GetValue <bool>()))
                {
                    if (enemy.Health < R.GetDamage(enemy))
                    {
                        R.CastOnUnit(enemy);
                        R.LastCastAttemptT = Environment.TickCount;
                    }
                }
            }

            if (IgniteSlot != SpellSlot.Unknown && Player.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready && Config.Item("use.ignite").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(Player.Spellbook.GetSpell(IgniteSlot).SData.CastRange) &&
                                                                x.Health < Q.GetDamage(x) + W.GetDamage(x)))
                {
                    Player.Spellbook.CastSpell(IgniteSlot, enemy);
                }
            }
        }
Exemplo n.º 16
0
        public static Entity GetApplicant(IOrganizationService service, Guid applicantId, string[] columns)
        {
            var applicant = Qe.QueryRecord(service, "eppei_applicant", applicantId, columns);

            return(applicant);
        }
Exemplo n.º 17
0
        public void Execute(IServiceProvider serviceProvider)
        {
            var trace   = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
            var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            var factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            var service = factory.CreateOrganizationService(context.UserId);
            var payment = ((Entity)context.InputParameters["Target"]);

            if (!payment.Attributes.Contains("blu_orderid"))
            {
                return;
            }

            var orderEr = (EntityReference)payment.Attributes["blu_orderid"];

            var columns    = new[] { "opportunityid" };
            var conditions = new[] { new ConditionExpression("salesorderid", ConditionOperator.Equal, orderEr.Id) };
            var order      = Qe.QueryRecord(service, "salesorder", columns, conditions);

            if (order == null || order.Attributes == null || !order.Attributes.Contains("opportunityid"))
            {
                return;
            }
            var opportunityEr = (EntityReference)order.Attributes["opportunityid"];

            columns    = new[] { "blu_regardingpropertyid" };
            conditions = new[] { new ConditionExpression("opportunityid", ConditionOperator.Equal, opportunityEr.Id) };
            var opportunity = Qe.QueryRecord(service, "opportunity", columns, conditions);

            if (opportunity == null || opportunity.Attributes == null || !opportunity.Attributes.Contains("blu_regardingpropertyid"))
            {
                return;
            }
            var propertyEr = (EntityReference)opportunity.Attributes["blu_regardingpropertyid"];

            columns    = new[] { "productid" };
            conditions = new[] { new ConditionExpression("opportunityid", ConditionOperator.Equal, opportunityEr.Id) };

            var opportunityProducts = Qe.QueryMultipleRecords(service, "opportunityproduct", columns, conditions);

            if (opportunityProducts == null || opportunityProducts.Count == 0)
            {
                return;
            }
            var opportunityProduct = opportunityProducts[0];

            var productEr = (EntityReference)opportunityProduct.Attributes["productid"];

            columns    = new[] { "scheduledstart", "scheduledend", "ownerid" };
            conditions = new[] { new ConditionExpression("regardingobjectid", ConditionOperator.Equal, order.Id) };
            var appointments = Qe.QueryMultipleRecords(service, "appointment", columns, conditions);

            foreach (var appointment in appointments)
            {
                var inspectionDetail = new InspectionDetail()
                {
                    Name          = "InspectionDetail | " + productEr.Name + " | " + propertyEr.Name,
                    InspectionId  = propertyEr.Id,
                    AppointmentId = appointment.Id,
                    OrderId       = order.Id,
                    OwnerId       = ((EntityReference)appointment["ownerid"]).Id,
                    ProductId     = productEr.Id
                };

                CreateInspectionDetail(service, inspectionDetail);
            }
        }
Exemplo n.º 18
0
        public static Entity GetApplicantWithAllAttributes(IOrganizationService service, Guid applicantId)
        {
            var applicant = Qe.QueryRecord(service, "eppei_applicant", applicantId, true);

            return(applicant);
        }