public override void Execute() { if (BattlegroundEngine.BattlegroundProfile.BattlegroundType == BattlegroundType.CaptureTheFlag) { IEnumerable <WowGameobject> flags = BattlegroundEngine.GetBattlegroundFlags(false); if (flags.Count() > 0) { if (!((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).IsMeFlagCarrier) { WowGameobject flagObject = flags.First(); if (flagObject != null && flagObject.Position.GetDistance(WowInterface.ObjectManager.Player.Position) < 8) { WowInterface.HookManager.WowObjectOnRightClick(flagObject); } else { WowInterface.MovementEngine.SetState(MovementEngineState.Moving, flagObject.Position); WowInterface.MovementEngine.Execute(); } } else { BattlegroundEngine.SetState(BattlegroundState.MoveToOwnBase); } } else { BattlegroundEngine.SetState(BattlegroundState.DefendMyself); } } }
public override void Execute() { if (BattlegroundEngine.BattlegroundProfile.BattlegroundType == BattlegroundType.CaptureTheFlag) { if (BattlegroundEngine.BattlegroundProfile.HanldeInterruptStates()) { return; } if (BattlegroundEngine.AttackNearEnemies()) { BattlegroundEngine.ForceCombat = true; return; } if (WowInterface.ObjectManager.Player.Position.GetDistance(OwnBasePosition) > 5) { WowInterface.MovementEngine.SetState(MovementEngineState.Moving, OwnBasePosition); WowInterface.MovementEngine.Execute(); return; } else { BattlegroundEngine.SetState(BattlegroundState.DefendMyself); return; } } }
public override void Execute() { // TODO: recognize wether the BG is running or not // Horde door id 6391 if (true) { BattlegroundEngine.SetState(BattlegroundState.DefendMyself); } }
private void DoCtfLogic(int enemyCount, int friendCount) { bool isMeFlagCarrier = ((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).IsMeFlagCarrier; // CTF flag priority if (BattlegroundEngine.BattlegroundProfile.BattlegroundType == BattlegroundType.CaptureTheFlag) { if (BattlegroundEngine.BattlegroundProfile.HanldeInterruptStates()) { return; } if (enemyCount > friendCount + 2 || isMeFlagCarrier) { // flee to base BattlegroundEngine.SetState(BattlegroundState.MoveToOwnBase); } else if (enemyCount == 0) { WowPlayer enemyFlagCarrier = ((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).EnemyFlagCarrierPlayer; WowPlayer ownFlagCarrier = ((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).OwnFlagCarrierPlayer; if (enemyFlagCarrier != null && ownFlagCarrier != null) { // move to enemy flag carrier BattlegroundEngine.SetState(BattlegroundState.MoveToEnemyFlagCarrier); } else if (enemyFlagCarrier != null && ownFlagCarrier == null) { // get the enemies flag BattlegroundEngine.SetState(BattlegroundState.MoveToEnemyBase); } else { if (ownFlagCarrier != null) { // help our flag carrier to get the flag to the base BattlegroundEngine.SetState(BattlegroundState.AssistOwnFlagCarrier); } else { // try to get the enemies flag BattlegroundEngine.SetState(BattlegroundState.MoveToEnemyBase); } return; } } } }
public override void Execute() { if (BattlegroundEngine.BattlegroundProfile.BattlegroundType == BattlegroundType.CaptureTheFlag) { if (BattlegroundEngine.BattlegroundProfile.HanldeInterruptStates()) { return; } if (((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).OwnFlagCarrierPlayer != null) { ulong ownFlagCarrierGuid = ((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).OwnFlagCarrierPlayer.Guid; WowPlayer ownFlagCarrier = WowInterface.ObjectManager.GetWowObjectByGuid <WowPlayer>(ownFlagCarrierGuid); IEnumerable <WowPlayer> nearEnemies = WowInterface.ObjectManager.GetNearEnemies <WowPlayer>(ownFlagCarrier.Position, 25); if (WowInterface.ObjectManager.Player.Position.GetDistance(ownFlagCarrier.Position) > 10) { WowInterface.MovementEngine.SetState(MovementEngineState.Moving, ownFlagCarrier.Position); WowInterface.MovementEngine.Execute(); } else { WowPlayer target = nearEnemies.FirstOrDefault(); if (target != null) { WowInterface.HookManager.TargetGuid(target.Guid); WowInterface.HookManager.StartAutoAttack(); WowInterface.HookManager.FacePosition(WowInterface.ObjectManager.Player, target.Position); BattlegroundEngine.ForceCombat = true; } } } else { // there is no friendly flag carrier BattlegroundEngine.SetState(BattlegroundState.DefendMyself); return; } } }
public override void Execute() { if (BattlegroundEngine.BattlegroundProfile.BattlegroundType == BattlegroundType.CaptureTheFlag) { if (BattlegroundEngine.BattlegroundProfile.HanldeInterruptStates()) { return; } if (((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).EnemyFlagCarrierPlayer != null) { ulong enemyFlagCarrierGuid = ((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).EnemyFlagCarrierPlayer.Guid; WowPlayer enemyFlagCarrier = WowInterface.ObjectManager.GetWowObjectByGuid <WowPlayer>(enemyFlagCarrierGuid); if (WowInterface.ObjectManager.Player.Position.GetDistance(enemyFlagCarrier.Position) > 10) { WowInterface.MovementEngine.SetState(MovementEngineState.Moving, enemyFlagCarrier.Position); WowInterface.MovementEngine.Execute(); } else { if (enemyFlagCarrier != null) { WowInterface.HookManager.TargetGuid(enemyFlagCarrier.Guid); WowInterface.HookManager.StartAutoAttack(); WowInterface.HookManager.FacePosition(WowInterface.ObjectManager.Player, enemyFlagCarrier.Position); BattlegroundEngine.ForceCombat = true; } } } else { // there is no enemy flag carrier BattlegroundEngine.SetState(BattlegroundState.DefendMyself); return; } } }
public bool HanldeInterruptStates() { IEnumerable <WowGameobject> enemyflags = BattlegroundEngine.GetBattlegroundFlags(); if (enemyflags.Count() > 0 && !((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).IsMeFlagCarrier) { BattlegroundEngine.SetState(BattlegroundState.PickupEnemyFlag); return(true); } IEnumerable <WowGameobject> ownFlags = BattlegroundEngine.GetBattlegroundFlags(false); if (ownFlags.Count() > 0 && !((ICtfBattlegroundProfile)BattlegroundEngine.BattlegroundProfile).IsMeFlagCarrier && ownFlags.FirstOrDefault()?.Position.GetDistance(WsgDataset.OwnFlagPosition) > 4) { BattlegroundEngine.SetState(BattlegroundState.PickupOwnFlag); return(true); } return(false); }