public bool Execute(WoWUnit target, bool force) { bool success = CombatUtil.CastSpell(this, target, force); if (success) { Logging.WriteFight("Fightclass successfully casted: " + this.FullName()); } return(success); }
public LastTargetLoot(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, CombatUtil combatUtil) { this.logger = logger; this.input = input; this.wait = wait; this.playerReader = addonReader.PlayerReader; this.stopMoving = stopMoving; this.bagReader = addonReader.BagReader; this.combatUtil = combatUtil; }
public static bool HasDebuffType(this WoWUnit unit, string type) { string luaString = @"hasDebuff = false; for i=1,40 do local _, _ debuffType = UnitDebuff(""{1}"", i); if debuffType == ""{0}"" then hasDebuff = true break; end end"; return Lua.LuaDoString<bool>(FormatLua(luaString, type, CombatUtil.GetLuaId(unit)), "hasDebuff"); }
public LootGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameTargeting npcNameTargeting, CombatUtil combatUtil) { this.logger = logger; this.input = input; this.wait = wait; this.playerReader = addonReader.PlayerReader; this.areaDb = addonReader.AreaDb; this.stopMoving = stopMoving; this.bagReader = addonReader.BagReader; this.classConfiguration = classConfiguration; this.npcNameTargeting = npcNameTargeting; this.combatUtil = combatUtil; }
public void Dispose() { _isLaunched = false; if (Hook.AllowFrameLock && Memory.WowMemory.FrameIsLocked) { Memory.WowMemory.UnlockFrame(true); } CombatUtil.Stop(); FiniteStateMachineEvents.OnAfterRunState -= SpellUpdateHandler; Logging.Write("Unloaded Vanilla Fightclass"); }
private void UseBuffs() { if (ObjectManager.Me.IsMounted || ObjectManager.Me.InCombat || Fight.InFight) { return; } Buffs.ForEach(CombatUtil.CastBuff); if (ObjectManager.Me.HaveBuff("Preparation")) { ObjectManager.GetObjectWoWPlayer().ForEach(o => { PartyBuffs.ForEach(b => CombatUtil.CastBuff(b, o)); }); } CombatUtil.CastBuff(Armor, Me); }
private void Rotation() { while (_isLaunched) { try { if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && !ObjectManager.Me.IsDead) { UseBuffs(); if ((VanillaFightclassSetting.CurrentSetting.FrameLock || CombatUtil.GetGlobalCooldown() == 0) && (Fight.InFight || Conditions.IsAttackedAndCannotIgnore) && ObjectManager.Target.IsAttackable) { var watch = System.Diagnostics.Stopwatch.StartNew(); if (VanillaFightclassSetting.CurrentSetting.FrameLock && Hook.AllowFrameLock && !Memory.WowMemory.FrameIsLocked) { Memory.WowMemory.LockFrame(); } foreach (var step in RotationActions) { if (step.ExecuteStep()) { break; } } if (Hook.AllowFrameLock && Memory.WowMemory.FrameIsLocked) { Memory.WowMemory.UnlockFrame(true); } watch.Stop(); if (watch.ElapsedMilliseconds > 100) { Logging.WriteFight("Iteration took " + watch.ElapsedMilliseconds + "ms"); } } } }catch (Exception e) { Logging.WriteError("VanillaFightClass ERROR:" + e); } Thread.Sleep(VanillaFightclassSetting.CurrentSetting.FrameLock ? 100 : (int)(CombatUtil.GetGlobalCooldown() * 1000)); } }
public SkinningGoal(ILogger logger, ConfigurableInput input, AddonReader addonReader, Wait wait, StopMoving stopMoving, NpcNameTargeting npcNameTargeting, CombatUtil combatUtil) { this.logger = logger; this.input = input; this.playerReader = addonReader.PlayerReader; this.wait = wait; this.stopMoving = stopMoving; this.bagReader = addonReader.BagReader; this.equipmentReader = addonReader.EquipmentReader; this.npcNameTargeting = npcNameTargeting; this.combatUtil = combatUtil; AddPrecondition(GoapKey.incombat, false); AddPrecondition(GoapKey.shouldskin, true); AddEffect(GoapKey.shouldskin, false); }
public override void PeriodicUpdate() { //戦闘距離外なら追いかけに移行 var combatDistance = GetAntCommonData <SoldierAntCommonData>().CombatDistance; if (Vector3.Distance(_enemyAnt.transform.position, Controller.Ant.transform.position) > combatDistance) { Controller.ChangeStrategy(new SoldierChaseStrategy(_enemyAnt)); return; } //倒した if (!_enemyAnt.Data.IsAlive) { Controller.ChangeStrategy(new SoldierStandbyStrategy()); } CombatUtil.AttackToAnt(Controller.Ant, _enemyAnt); }
public void Initialize() { wManagerSetting.CurrentSetting.UseLuaToMove = true; wManagerSetting.CurrentSetting.RestingMana = true; _isLaunched = true; VanillaFightclassSetting.Load(); CombatUtil.Start(); RotationActions.Sort((a, b) => a.Priority.CompareTo(b.Priority)); UpdateRanks(); FiniteStateMachineEvents.OnAfterRunState += SpellUpdateHandler; EventsLuaWithArgs.OnEventsLuaWithArgs += CastingEventHandler; Logging.Write("Loaded VanillaFightClass"); Rotation(); }
public static bool IsPlayer(this WoWUnit unit) { string luaString = @"isPlayer = (UnitIsPlayer(""{0}"") == 1)"; return(Lua.LuaDoString <bool>(FormatLua(luaString, CombatUtil.GetLuaId(unit)), "isPlayer")); }
public static bool IsCreatureType(this WoWUnit unit, string type) { string luaString = @"isCreatureType = (UnitCreatureType(""{1}"") == ""{0}"" or false);"; return(Lua.LuaDoString <bool>(FormatLua(luaString, type, CombatUtil.GetLuaId(unit)), "isCreatureType")); }
public static bool HasMana(this WoWUnit unit) { string luaString = @"return (UnitPowerType(""{0}"") == 0 and UnitMana(""{0}"") > 1)"; return(Lua.LuaDoString <bool>(FormatLua(luaString, CombatUtil.GetLuaId(unit)))); }
public PostKillLootGoal(ILogger logger, ConfigurableInput input, Wait wait, AddonReader addonReader, StopMoving stopMoving, ClassConfiguration classConfiguration, NpcNameTargeting npcNameTargeting, CombatUtil combatUtil) : base(logger, input, wait, addonReader, stopMoving, classConfiguration, npcNameTargeting, combatUtil) { }