Esempio n. 1
0
        public override void Apply()
        {
            Character casterObject = this.Cast.CasterObject as Character;

            if (casterObject == null)
            {
                return;
            }
            int buttonIndex = this.Effect.MiscValue + 132;
            int miscValueB  = this.Effect.MiscValueB;

            while (miscValueB != 0)
            {
                if (casterObject.GetTypeFromActionButton(buttonIndex) == (byte)0)
                {
                    Spell spell = SpellHandler.Get(casterObject.GetActionFromActionButton(buttonIndex));
                    if (spell != null)
                    {
                        SpellCast spellCast = casterObject.SpellCast;
                        if (spellCast != null)
                        {
                            spellCast.Trigger(spell, new WorldObject[0]);
                        }
                    }
                }

                --miscValueB;
                ++buttonIndex;
            }
        }
Esempio n. 2
0
            protected override void Remove(bool cancelled)
            {
                if (!cancelled)
                {
                    var triggerSpell = m_spellEffect.TriggerSpell;

                    var caster = m_aura.CasterUnit;
                    if (caster != null)
                    {
                        var loc = m_aura.Auras.Owner.Position;
                        SpellCast.Trigger(caster, triggerSpell, ref loc);
                    }
                }

                base.Remove(cancelled);
            }
Esempio n. 3
0
        /// <summary>Remove Passenger</summary>
        public void ClearSeat()
        {
            if (this._passenger == null)
            {
                return;
            }
            if (this.IsDriverSeat)
            {
                this.Vehicle.Charmer    = (Unit)null;
                this._passenger.Charm   = (Unit)null;
                this.Vehicle.UnitFlags &= UnitFlags.CanPerformAction_Mask1 | UnitFlags.Flag_0_0x1 |
                                          UnitFlags.SelectableNotAttackable | UnitFlags.Influenced |
                                          UnitFlags.PlayerControlled | UnitFlags.Flag_0x10 | UnitFlags.Preparation |
                                          UnitFlags.PlusMob | UnitFlags.SelectableNotAttackable_2 |
                                          UnitFlags.NotAttackable | UnitFlags.Passive | UnitFlags.Looting |
                                          UnitFlags.PetInCombat | UnitFlags.Flag_12_0x1000 | UnitFlags.Silenced |
                                          UnitFlags.Flag_14_0x4000 | UnitFlags.Flag_15_0x8000 |
                                          UnitFlags.SelectableNotAttackable_3 | UnitFlags.Combat |
                                          UnitFlags.TaxiFlight | UnitFlags.Disarmed | UnitFlags.Confused |
                                          UnitFlags.Feared | UnitFlags.NotSelectable | UnitFlags.Skinnable |
                                          UnitFlags.Mounted | UnitFlags.Flag_28_0x10000000 |
                                          UnitFlags.Flag_29_0x20000000 | UnitFlags.Flag_30_0x40000000 |
                                          UnitFlags.Flag_31_0x80000000;
            }

            --this.Vehicle._passengerCount;
            if (this._passenger.MovementFlags.HasFlag((Enum)MovementFlags.Flying))
            {
                SpellCast spellCast = this.Vehicle.SpellCast;
                if (spellCast != null)
                {
                    spellCast.Trigger(SpellId.EffectParachute);
                }
            }

            this._passenger.MovementFlags &= MovementFlags.MaskMoving | MovementFlags.PitchUp |
                                             MovementFlags.PitchDown | MovementFlags.WalkMode |
                                             MovementFlags.DisableGravity | MovementFlags.Root |
                                             MovementFlags.PendingStop | MovementFlags.PendingStrafeStop |
                                             MovementFlags.PendingForward | MovementFlags.PendingBackward |
                                             MovementFlags.PendingStrafeLeft | MovementFlags.PendingStrafeRight |
                                             MovementFlags.PendingRoot | MovementFlags.Swimming | MovementFlags.CanFly |
                                             MovementFlags.Flying | MovementFlags.SplineElevation |
                                             MovementFlags.SplineEnabled | MovementFlags.Waterwalking |
                                             MovementFlags.CanSafeFall | MovementFlags.Hover | MovementFlags.LocalDirty;
            this._passenger.Auras.RemoveFirstVisibleAura((Predicate <Aura>)(aura => aura.Spell.IsVehicle));
            if (this._passenger is Character)
            {
                Character passenger = (Character)this._passenger;
                VehicleHandler.Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(passenger);
                MovementHandler.SendMoved(passenger);
                MiscHandler.SendCancelAutoRepeat((IPacketReceiver)passenger, (IEntity)this.Vehicle);
                PetHandler.SendEmptySpells((IPacketReceiver)passenger);
                passenger.ResetMover();
                passenger.FarSight = EntityId.Zero;
            }

            this._passenger.m_vehicleSeat = (VehicleSeat)null;
            MovementHandler.SendHeartbeat(this._passenger, this._passenger.Position, this._passenger.Orientation);
            this._passenger.DecMechanicCount(SpellMechanic.Rooted, true);
            this._passenger.HasPermissionToMove = true;
            this._passenger.MovementFlags      &= MovementFlags.MaskMoving | MovementFlags.PitchUp |
                                                  MovementFlags.PitchDown | MovementFlags.WalkMode |
                                                  MovementFlags.OnTransport | MovementFlags.DisableGravity |
                                                  MovementFlags.PendingStop | MovementFlags.PendingStrafeStop |
                                                  MovementFlags.PendingForward | MovementFlags.PendingBackward |
                                                  MovementFlags.PendingStrafeLeft | MovementFlags.PendingStrafeRight |
                                                  MovementFlags.PendingRoot | MovementFlags.Swimming | MovementFlags.CanFly |
                                                  MovementFlags.Flying | MovementFlags.SplineElevation |
                                                  MovementFlags.SplineEnabled | MovementFlags.Waterwalking |
                                                  MovementFlags.CanSafeFall | MovementFlags.Hover | MovementFlags.LocalDirty;
            this._passenger = (Unit)null;
        }