private int a(fz A_0) { if (!this.d) { return(1); } switch (A_0) { case fz.a: return(er.i("IdleCraftCount_HealthKits")); case fz.b: return(er.i("IdleCraftCount_HealthFood")); case fz.c: return(er.i("IdleCraftCount_StamKits")); case fz.d: return(er.i("IdleCraftCount_StamFood")); case fz.e: return(er.i("IdleCraftCount_ManaKits")); case fz.f: return(er.i("IdleCraftCount_ManaFood")); } return(0); }
public bool b(eRechargeVital_Single A_0) { fz b = fz.b; switch (A_0) { case eRechargeVital_Single.Stamina: b = fz.d; break; case eRechargeVital_Single.Mana: b = fz.f; break; } cv cv = null; int num = -2147483648; foreach (KeyValuePair <string, fz> pair in PluginCore.cq.l.h) { if (((fz)pair.Value) == b) { foreach (cv cv2 in PluginCore.cq.p.a(pair.Key)) { if (!cx.b(cv2)) { int num2 = 1; if (num2 > num) { cv = cv2; num = num2; } } } } } if (cv == null) { return(false); } if (!cx.a(cv) || !PluginCore.cq.ap.d()) { PluginCore.cq.ax.get_Actions().UseItem(cv.k, 0); } return(true); }
public void InitializeDefaultLogicRules() { ISettingDelegate[] reqs = new ISettingDelegate[] { new SettingDelegate_Bool("NavPriorityBoost", true) }; ISettingDelegate[] delegateArray2 = new ISettingDelegate[] { new SettingDelegate_Bool("LootPriorityBoost", true) }; ISettingDelegate[] delegateArray3 = new ISettingDelegate[] { new SettingDelegate_Bool("EnableCombat", true) }; ISettingDelegate[] delegateArray4 = new ISettingDelegate[] { new SettingDelegate_Bool("ManaChargesWhenOff", true) }; ISettingDelegate[] delegateArray5 = new ISettingDelegate[0]; int num = 0; this.ClearLogicRules_MacroDisabled(); this.AddLogicRule_MacroDisabled(new LogicRuleSentinel("START", num++)); this.AddLogicRule_MacroDisabled(new LogicRulePreChain(num++, new em(0), delegateArray4)); this.AddLogicRule_MacroDisabled(new LogicRuleSentinel("END", num++)); int num2 = 0; this.n.Clear(); this.n.Add(new e7(num2++)); int num3 = 0; this.ClearLogicRules(); this.AddLogicRule(new LogicRuleSentinel("START", num3++)); this.AddLogicRule(new am(num3++, "SpellCompMin-Critical")); fz[] fzArray = new fz[6]; fzArray[1] = fz.b; fzArray[2] = fz.c; fzArray[3] = fz.d; fzArray[4] = fz.e; fzArray[5] = fz.f; this.AddLogicRule(new ee(num3++, fzArray, false)); this.AddLogicRule(new az(num3++, "Recharge-Norm-HitP", "Recharge-Norm-Stam", "Recharge-Norm-Mana")); this.AddLogicRule(new em(num3++)); this.AddLogicRule(new bg(num3++, "RebuffTimeRemainingSeconds", true)); this.AddLogicRule(new am(num3++, "SpellCompMin-Normal")); this.AddLogicRule(new LogicRuleSentinel("POSTBUFF", num3++)); this.AddLogicRule(new eb(num3++)); this.AddLogicRule(new fy(num3++)); this.AddLogicRule(new d4(num3++, "Recharge-Helper-HitP")); this.AddLogicRule(new bu(num3++, "Recharge-Helper-HitP", "Recharge-Helper-Stam", "Recharge-Helper-Mana")); this.AddLogicRule(new ck(num3++)); this.AddLogicRule(new ee(num3++)); this.AddLogicRule(new bn(num3++, "PetRefillCount-Normal")); this.AddLogicRule(new LogicRuleSentinel("POSTHELPER", num3++)); this.AddLogicRule(new dc(num3++)); this.AddLogicRule(new LogicRuleSentinel("POSTAUTOFELLOW", num3++)); this.AddLogicRule(new al(num3++)); this.AddLogicRule(new LogicRuleSentinel("PREPRIORITYLOOTACTIONS", num3++)); this.AddLogicRule(new LogicRulePreChain(num3++, new bb(0), delegateArray2)); this.AddLogicRule(new LogicRulePreChain(num3++, new c1(0), delegateArray2)); this.AddLogicRule(new LogicRulePreChain(num3++, new fp(0), delegateArray2)); this.AddLogicRule(new LogicRuleSentinel("POSTPRIORITYLOOTACTIONS", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREPRIORITYLOOT", num3++)); this.AddLogicRule(new LogicRulePreChain(num3++, new aw(0, "CorpseApproachRange-Min", "CorpseApproachRange-Max", new a6("CorpseApproachRange-Max")), new ISettingDelegate[] { new SettingDelegate_Bool("EnableLooting", true), new SettingDelegate_Bool("LootPriorityBoost", true) })); this.AddLogicRule(new LogicRulePreChain(num3++, new co(0, 0.020833333333333332), delegateArray2)); this.AddLogicRule(new LogicRulePreChain(num3++, new fu(0), delegateArray2)); this.AddLogicRule(new LogicRulePreChain(num3++, new de(0), delegateArray2)); this.AddLogicRule(new LogicRuleSentinel("POSTPRIORITYLOOT", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREPRIORITYNAV", num3++)); aw mr = new aw(0, "NavCloseStopRange", "NavFarStopRange", new bs(PluginCore.cq)); this.AddLogicRule(new LogicRulePreChain(num3++, mr, reqs)); this.AddLogicRule(new LogicRuleSentinel("POSTPRIORITYNAV", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREATTACK", num3++)); this.AddLogicRule(new cq(num3++)); this.AddLogicRule(new LogicRuleSentinel("POSTATTACK", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREIDLESTATUS", num3++)); this.AddLogicRule(new am(num3++, "SpellCompMin-Idle")); fz[] fzArray2 = new fz[6]; fzArray2[1] = fz.b; fzArray2[2] = fz.c; fzArray2[3] = fz.d; fzArray2[4] = fz.e; fzArray2[5] = fz.f; this.AddLogicRule(new ee(num3++, fzArray2, true)); this.AddLogicRule(new bn(num3++, "PetRefillCount-Idle")); this.AddLogicRule(new LogicRuleSentinel("PREIDLELOOTACTIONS", num3++)); this.AddLogicRule(new LogicRulePreChain(num3++, new bb(0), delegateArray5, new ILogicRule[] { new ez(0) })); this.AddLogicRule(new LogicRulePreChain(num3++, new c1(0), delegateArray5, new ILogicRule[] { new ez(0) })); this.AddLogicRule(new LogicRulePreChain(num3++, new fp(0), delegateArray5, new ILogicRule[] { new ez(0) })); this.AddLogicRule(new LogicRuleSentinel("POSTIDLELOOTACTIONS", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREIDLELOOT", num3++)); aw aw2 = new aw(0, "CorpseApproachRange-Min", "CorpseApproachRange-Max", new a6("CorpseApproachRange-Max")); this.AddLogicRule(new LogicRulePreChain(num3++, aw2, new ISettingDelegate[] { new SettingDelegate_Bool("EnableLooting", true) }, new ILogicRule[] { new LogicRulePreChain(0, new ez(0), new ISettingDelegate[] { new SettingDelegate_Custom(new SettingDelegate_Custom.dBoolDelegate(aw2.a().l)) }) })); this.AddLogicRule(new LogicRulePreChain(num3++, new co(0, 0.020833333333333332), delegateArray5, new ILogicRule[] { new ez(0) })); this.AddLogicRule(new fu(num3++)); this.AddLogicRule(new de(num3++)); this.AddLogicRule(new LogicRuleSentinel("POSTIDLELOOT", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREIDLEBUFF", num3++)); this.AddLogicRule(new LogicRulePreChain(num3++, new bg(0, "IdleBuffTopoffTimeSeconds", false), new ISettingDelegate[] { new SettingDelegate_Bool("IdleBuffTopoff", true) })); this.AddLogicRule(new LogicRuleSentinel("POSTIDLEBUFF", num3++)); this.AddLogicRule(new LogicRuleSentinel("PRETARGETAPPROACH", num3++)); aw aw3 = new aw(0, "AttackDistance", "ApproachDistance", new b("ApproachDistance")); this.AddLogicRule(new LogicRulePreChain(num3++, aw3, delegateArray3, new ILogicRule[] { new LogicRulePreChain(0, new ez(0), new ISettingDelegate[] { new SettingDelegate_Custom(new SettingDelegate_Custom.dBoolDelegate(aw3.a().l)) }) })); this.AddLogicRule(new LogicRuleSentinel("POSTTARGETAPPROACH", num3++)); this.AddLogicRule(new LogicRuleSentinel("PREIDLERECHARGE", num3++)); this.AddLogicRule(new az(num3++, "Recharge-NoTarg-HitP", "Recharge-NoTarg-Stam", "Recharge-NoTarg-Mana")); this.AddLogicRule(new LogicRuleSentinel("POSTIDLERECHARGE", num3++)); this.AddLogicRule(new LogicRuleSentinel("PRENAVROUTE", num3++)); aw aw4 = new aw(0, "NavCloseStopRange", "NavFarStopRange", new bs(PluginCore.cq)); this.AddLogicRule(new LogicRulePreChain(num3++, aw4, delegateArray5, new ILogicRule[] { new LogicRulePreChain(0, new ez(0), new ISettingDelegate[] { new SettingDelegate_Custom(new SettingDelegate_Custom.dBoolDelegate(aw4.a().k)) }) })); this.AddLogicRule(new LogicRuleSentinel("POSTNAVROUTE", num3++)); this.AddLogicRule(new dd(num3++)); this.AddLogicRule(new LogicRuleSentinel("END", num3++)); this.AddLogicRule(new ez(num3++)); }
public bool b(eRechargeVital_Single A_0) { if ((PluginCore.cq.ax.get_Actions().get_CombatMode() == 8) && !er.j("UseKitsInMagicMode")) { return(false); } if ((A_0 != eRechargeVital_Single.Stamina) && (PluginCore.cq.ax.get_Actions().get_Vital().get_Item(4) < 15)) { return(false); } TrainingType type = PluginCore.cq.aw.get_CharacterFilter().get_Skills().get_Item(0x15).get_Training(); if ((type != 3) && (type != 2)) { return(false); } fz a = fz.a; switch (A_0) { case eRechargeVital_Single.Stamina: a = fz.c; break; case eRechargeVital_Single.Mana: a = fz.e; break; } double num = ((double)er.i("MinimumHealKitSuccessChance")) / 100.0; int k = 0; int num3 = 0x7fffffff; double num4 = -2147483648.0; foreach (KeyValuePair <string, fz> pair in PluginCore.cq.l.h) { if (((fz)pair.Value) == a) { dp dp = PluginCore.cq.x.a(pair.Key); if (dp != null) { double b = 1.0; b = dp.b; if (dh.a(dp.c, A_0) >= num) { foreach (cv cv in PluginCore.cq.p.a(pair.Key)) { int num7 = cv.a(dt.aa, 0); if ((b > num4) || ((b == num4) && (num7 < num3))) { k = cv.k; num3 = num7; num4 = b; } } } } } } if (k == 0) { return(false); } if (er.j("GoToPeaceModeToUseKits") && (PluginCore.cq.ax.get_Actions().get_CombatMode() != 1)) { dh.a(1); return(true); } PluginCore.cq.ax.get_Actions().ApplyItem(k, PluginCore.cg); return(true); }