private Composite SubBehaviorPS_InitializeVehicleAbilities() { return (new Decorator(context => (Weapon_DevourHuman == null) || (Weapon_FrozenDeathbolt == null), // Give the WoWclient a few seconds to produce the vehicle action bar... // NB: If we try to use the weapon too quickly after entering vehicle, // then it will cause the WoWclient to d/c. new WaitContinue(TimeSpan.FromSeconds(10), context => Query.IsVehicleActionBarShowing(), new Action(context => { var weaponArticulation = new WeaponArticulation(WeaponAzimuthMin, WeaponAzimuthMax); // (slot 1): http://www.wowhead.com/spell=53114 Weapon_FrozenDeathbolt = new VehicleWeapon(ActionBarIndex_Attack, weaponArticulation, WeaponMuzzleVelocity) { LogAbilityUse = true, LogWeaponFiringDetails = false }; // (slot 3): http://www.wowhead.com/spell=53110 Weapon_DevourHuman = new VehicleAbility(ActionBarIndex_Heal) { LogAbilityUse = true }; WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend, TimeSpan.FromMilliseconds(1500)); }) ))); }
public Composite CreateBehavior_ShootPirates() { var cannon = new VehicleWeapon(3, _weaponArticulation, CannonballMuzzleVelocity, CannonballGravity); const int readyAuraId = 81513; const int aimAuraId = 81514; WoWUnit charmedUnit = null; WoWUnit selectedTarget = null; return(new PrioritySelector( ctx => selectedTarget = BestTarget, new Decorator( r => selectedTarget != null, new PrioritySelector( ctx => charmedUnit = Me.CharmedUnit, new Decorator( ctx => !charmedUnit.HasAura(readyAuraId), new Action(ctx => Lua.DoString("CastPetAction({0})", 1))), // aim weapon and fire. new Decorator( ctx => cannon.WeaponAim(selectedTarget), new Sequence( new Action(ctx => Lua.DoString("CastPetAction({0})", 2)), new WaitContinue(2, ctx => charmedUnit.HasAura(aimAuraId), new ActionAlwaysSucceed()), new Action(ctx => cannon.WeaponFire()))))))); }
public KeepThemofftheFront(Dictionary <string, string> args) : base(args) { QBCLog.BehaviorLoggingContext = this; QuestId = 26755; var weaponArticulation = new WeaponArticulation(WeaponAzimuthMin, WeaponAzimuthMax); _catapult = new VehicleWeapon(1, weaponArticulation, WeaponMuzzleVelocity, WeaponProjectileGravity); }
public override void OnStart() { OnStart_HandleAttributeProblem(); if (!IsDone) { TreeHooks.Instance.InsertHook("Combat_Main", 0, CreateBehavior_CombatMain()); var weaponArticulation = new WeaponArticulation(WeaponAzimuthMin, WeaponAzimuthMax); WeaponFireCannon = new VehicleWeapon(1, weaponArticulation, WeaponMuzzleVelocity); this.UpdateGoalText(QuestId); } }
private async Task SubCoroutine_InitializeVehicleAbilities() { if ((WeaponLifeRocket == null) || (WeaponPirateDestroyingBomb == null) || (WeaponEmergencyRocketPack == null)) { // Give the WoWclient a few seconds to produce the vehicle action bar... // NB: If we try to use the weapon too quickly after entering vehicle, // then it will cause the WoWclient to d/c. if (await Coroutine.Wait(10000, Query.IsVehicleActionBarShowing)) { var weaponArticulation = new WeaponArticulation(WeaponAzimuthMin, WeaponAzimuthMax); // (slot 1): http://wowhead.com/spell=75560 WeaponLifeRocket = new VehicleWeapon(1, weaponArticulation, WeaponLifeRocket_MuzzleVelocity) { LogAbilityUse = true, LogWeaponFiringDetails = false }; // (slot 2): http://wowhead.com/spell=73257 WeaponPirateDestroyingBomb = new VehicleWeapon(2, weaponArticulation, WeaponPirateDestroyingBomb_MuzzleVelocity) { LogAbilityUse = true, LogWeaponFiringDetails = false }; // (slot 6): http://wowhead.com/spell=40603 WeaponEmergencyRocketPack = new VehicleAbility(6) { LogAbilityUse = true }; } } }
private Composite SubBehaviorPS_InitializeVehicleAbilities() { return (new Decorator(context => (WeaponFireCannon == null), // Give the WoWclient a few seconds to produce the vehicle action bar... // NB: If we try to use the weapon too quickly after entering vehicle, // then it will cause the WoWclient to d/c. new WaitContinue(TimeSpan.FromSeconds(10), context => Query.IsVehicleActionBarShowing(), new Action(context => { var weaponArticulation = new WeaponArticulation(WeaponAzimuthMin, WeaponAzimuthMax); // (slot 1): http://wowhead.com/spell= WeaponFireCannon = new VehicleWeapon(1, weaponArticulation, WeaponMuzzleVelocity) { LogAbilityUse = true, LogWeaponFiringDetails = false }; }) ))); }
public Composite CreateBehavior_Shoot() { var cannon = new VehicleWeapon(3, _weaponArticulation, CannonballMuzzleVelocity, CannonballGravity); const int readyAuraId = 81513; const int aimAuraId = 81514; WoWUnit charmedUnit = null; const uint boatId = 43561; WoWUnit boat = null; return(new PrioritySelector( ctx => boat = ObjectManager.GetObjectsOfTypeFast <WoWUnit>().FirstOrDefault(u => u.Entry == boatId), new Decorator( r => boat != null, new PrioritySelector( ctx => charmedUnit = Me.CharmedUnit, new Decorator(ctx => !charmedUnit.HasAura(readyAuraId), new Action(ctx => Lua.DoString("CastPetAction({0})", 1))), new Decorator( ctx => cannon.WeaponAim(boat), new Sequence( new Action(ctx => Lua.DoString("CastPetAction({0})", 2)), new WaitContinue(2, ctx => charmedUnit.HasAura(aimAuraId), new ActionAlwaysSucceed()), new Action(ctx => cannon.WeaponFire()))))))); }
private Composite StateBehaviorPS_MountingVehicle() { return(new PrioritySelector( new Decorator(context => Me.IsQuestComplete(QuestId), new Action(context => { BehaviorDone(); })), // If we're in the vehicle, wait for the ride out to hunting grounds to complete... new Decorator(context => IsInTank(), new PrioritySelector( SubBehaviorPS_InitializeVehicleAbilities(), new Action(context => { BehaviorState = BehaviorStateType.RidingOutToHuntingGrounds; }) )), // If vehicle is in "enter vehicle" animation, wait for the animation to complete... new Decorator(context => FindVehicle_OwnedByMe(MobId_SchnottzSiegeTankInstanced) != null, new PrioritySelector( new CompositeThrottle(Throttle.UserUpdate, new Action(context => { TreeRoot.StatusText = string.Format("Waiting for {0} to become ready.", Utility.GetObjectNameFromId(MobId_SchnottzSiegeTankInstanced)); })), new ActionAlwaysSucceed() )), // Locate a vehicle to mount... new Decorator(context => !Query.IsViable(Vehicle), new PrioritySelector( new Action(context => { Vehicle = Query.FindMobsAndFactions(Utility.ToEnumerable(MobId_SchnottzSiegeTank)) .FirstOrDefault() as WoWUnit; if (Query.IsViable(Vehicle)) { Utility.Target(Vehicle); return RunStatus.Success; } return RunStatus.Failure; // fall through }), // No vehicle found, move to staging area... new Decorator(ctx => !Navigator.AtLocation(Location_VehicleStagingArea), new ActionRunCoroutine( interactUnitContext => UtilityCoroutine.MoveTo( Location_VehicleStagingArea, "Vehicle Staging Area", MovementBy))), // Wait for vehicle to respawn... new CompositeThrottle(Throttle.UserUpdate, new Action(context => { TreeRoot.StatusText = string.Format("Waiting for {0} to respawn.", Utility.GetObjectNameFromId(MobId_SchnottzSiegeTank)); })) )), // Move to vehicle and enter... new CompositeThrottle(Throttle.UserUpdate, new Action(context => { TreeRoot.StatusText = string.Format("Moving to {0}", Vehicle.SafeName); })), new Decorator(context => !Vehicle.WithinInteractRange, new ActionRunCoroutine( interactUnitContext => UtilityCoroutine.MoveTo( Vehicle.Location, Vehicle.SafeName, MovementBy))), new Decorator(context => Me.IsMoving, new Action(context => { Navigator.PlayerMover.MoveStop(); })), new Decorator(context => Me.Mounted, new ActionRunCoroutine(context => UtilityCoroutine.ExecuteMountStrategy(MountStrategyType.DismountOrCancelShapeshift))), new ActionFail(context => { // If we got booted out of a vehicle for some reason, reset the weapons... WeaponFireCannon = null; Utility.Target(Vehicle); Vehicle.Interact(); }), new Wait(TimeSpan.FromMilliseconds(10000), context => IsInTank(), new ActionAlwaysSucceed()), new ActionAlwaysSucceed() )); }
private async Task <bool> StateCoroutine_MountingVehicle() { if (Me.IsQuestComplete(QuestId)) { BehaviorDone(); return(true); } if (IsInBalloon()) { await SubCoroutine_InitializeVehicleAbilities(); BehaviorState = BehaviorStateType.RidingOutToHuntingGrounds; return(true); } // Locate a vehicle to mount... if (!Query.IsViable(Vehicle)) { Vehicle = Query.FindMobsAndFactions(Utility.ToEnumerable(MobId_SteamwheedleRescueBalloon)) .FirstOrDefault() as WoWUnit; if (Query.IsViable(Vehicle)) { Utility.Target(Vehicle); return(true); } // No vehicle found, move to staging area... if (!Navigator.AtLocation(VehicleStagingArea)) { return(await UtilityCoroutine.MoveTo(VehicleStagingArea, "Vehicle Staging Area", MovementBy)); } await(_updateUser_MountingVehicle_waitingForSpawn ?? (_updateUser_MountingVehicle_waitingForSpawn = new ThrottleCoroutineTask( Throttle.UserUpdate, async() => TreeRoot.StatusText = string.Format("Waiting for {0} to respawn.", Utility.GetObjectNameFromId(MobId_SteamwheedleRescueBalloon))))); // Wait for vehicle to respawn... return(true); } // Wait for vehicle to respawn... await(_updateUser_MountingVehicle_movingToVehicle ?? (_updateUser_MountingVehicle_movingToVehicle = new ThrottleCoroutineTask( Throttle.UserUpdate, async() => TreeRoot.StatusText = string.Format("Moving to {0}", Vehicle.SafeName)))); if (!Vehicle.WithinInteractRange) { return(await UtilityCoroutine.MoveTo(Vehicle.Location, Vehicle.SafeName, MovementBy)); } if (Me.IsMoving) { await CommonCoroutines.StopMoving(); } if (Me.Mounted && await UtilityCoroutine.ExecuteMountStrategy( MountStrategyType.DismountOrCancelShapeshift)) { return(true); } // If we got booted out of a vehicle for some reason, reset the weapons... WeaponLifeRocket = null; WeaponPirateDestroyingBomb = null; WeaponEmergencyRocketPack = null; Utility.Target(Vehicle); await Coroutine.Sleep((int)Delay.AfterInteraction.TotalMilliseconds); Vehicle.Interact(); await Coroutine.Wait(10000, IsInBalloon); return(true); }