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 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);
            }
        }
Esempio n. 4
0
        public CannonControl(Dictionary <string, string> args)
            : base(args)
        {
            QBCLog.BehaviorLoggingContext = this;
            try
            {
                // QuestRequirement* attributes are explained here...
                //    http://www.thebuddyforum.com/mediawiki/index.php?title=Honorbuddy_Programming_Cookbook:_QuestId_for_Custom_Behaviors
                // ...and also used for IsDone processing.
                // Primary attributes...
                MobIds = GetNumberedAttributesAsArray <int>("MobId", 0, ConstrainAs.MobId, new[] { "NpcId" });
                if (MobIds != null && !MobIds.Any())
                {
                    MobIds = GetAttributeAsArray <int>("MobIds", false, ConstrainAs.MobId, new[] { "NpcIds" }, null);
                }
                Buttons               = GetAttributeAsArray <int>("Buttons", true, new ConstrainTo.Domain <int>(1, 12), null, null);
                ExitButton            = GetAttributeAsNullable <int>("ExitButton", false, ConstrainAs.HotbarButton, null) ?? 0;
                MaxAngle              = GetAttributeAsNullable <double>("MaxAngle", false, new ConstrainTo.Domain <double>(-1.5, 1.5), null) ?? 1.5;
                MinAngle              = GetAttributeAsNullable <double>("MinAngle", false, new ConstrainTo.Domain <double>(-1.5, 1.5), null) ?? -1.5;
                Velocity              = GetAttributeAsNullable <double>("Velocity", false, new ConstrainTo.Domain <double>(2.0, 1000), null) ?? 70;
                Gravity               = GetAttributeAsNullable <double>("Gravity", false, new ConstrainTo.Domain <double>(0.01, 80), null) ?? 30;
                VehicleId             = GetAttributeAsNullable <int>("VehicleId", false, ConstrainAs.VehicleId, null) ?? 0;
                VehicleSearchLocation = GetAttributeAsNullable <Vector3>("", false, ConstrainAs.Vector3NonEmpty, null) ?? Me.Location;
                WeaponArticulation    = new WeaponArticulation(MinAngle, MaxAngle);
                Weapons               = Buttons.Select(b => new VehicleWeapon(b, WeaponArticulation, Velocity, Gravity)).ToArray();
            }

            catch (Exception except)
            {
                // Maintenance problems occur for a number of reasons.  The primary two are...
                // * Changes were made to the behavior, and boundary conditions weren't properly tested.
                // * The Honorbuddy core was changed, and the behavior wasn't adjusted for the new changes.
                // In any case, we pinpoint the source of the problem area here, and hopefully it
                // can be quickly resolved.
                QBCLog.Exception(except);
                IsAttributeProblem = true;
            }
        }
Esempio n. 5
0
        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
                };
            })
                                                )));
        }