/// <inheritdoc />
 public TransportationInfo(PackedGuid transportGuid, Vector4 <float> transportOffset, int transportTime, byte transportSeatId)
 {
     TransportGuid   = transportGuid;
     TransportOffset = transportOffset;
     TransportTime   = transportTime;
     TransportSeatId = transportSeatId;
 }
Exemplo n.º 2
0
 /// <inheritdoc />
 public SMSG_NAME_QUERY_RESPONSE_Payload(PackedGuid requestedGuid, NameQueryResult result)
     : this()
 {
     RequestedGuid = requestedGuid;
     ResponseCode  = NameQueryResponseCode.Success;
     Result        = result;
 }
Exemplo n.º 3
0
        private UpdateFieldValueCollection ToWotlkUpdateValues(PackedGuid objectGuid, UpdateFieldValueCollection updateCollection)
        {
            if (objectGuid.isType(EntityGuidMask.Player))
            {
                return(BuildWotlkPlayerUpdateFieldCollection(updateCollection));
            }
            else if (objectGuid.isType(EntityGuidMask.Unit))
            {
                return(BuildWotlkUnitUpdateFieldCollection(updateCollection));
            }
            else if (objectGuid.isType(EntityGuidMask.Container))
            {
                if (updateCollection.UpdateMask.Length > 63)
                {
                    return(BuildWotlkContainerUpdateFieldCollection(updateCollection));
                }
                else
                {
                    return(BuildWotlkItemUpdateFieldCollection(updateCollection));
                }
            }
            else if (objectGuid.isType(EntityGuidMask.GameObject))
            {
                return(BuildWotlkGameObjectUpdateFieldCollection(updateCollection));
            }
            else
            if (Logger.IsWarnEnabled)
            {
                Logger.Warn($"Failed to handle update values for Entity: {objectGuid.RawGuidValue}");
            }

            return(null);
        }
Exemplo n.º 4
0
 /// <inheritdoc />
 public ObjectCreationData(PackedGuid creationGuid, ObjectType creationObjectType, MovementBlockData movementData, UpdateFieldValueCollection objectValuesCollection)
 {
     CreationGuid           = creationGuid;
     CreationObjectType     = creationObjectType;
     MovementData           = movementData;
     ObjectValuesCollection = objectValuesCollection;
 }
 /// <inheritdoc />
 public SMSG_POWER_UPDATE_Payload(PackedGuid unitGuid, Powers powerType, int newValue)
     : this()
 {
     UnitGuid  = unitGuid;
     PowerType = powerType;
     NewValue  = newValue;
 }
Exemplo n.º 6
0
 //TODO: Additonal ctors
 //TODO: Validate parameters.
 /// <inheritdoc />
 public SMSG_MONSTER_MOVE_Payload_Vanilla(PackedGuid monsterGuid, Vector3 <float> initialMovePoint, int splineId, MonsterMoveInfo moveInfo, MonsterSplineInfo_Vanilla optionalSplineInformation)
 {
     MonsterGuid               = monsterGuid;
     InitialMovePoint          = initialMovePoint;
     SplineId                  = splineId;
     MoveInfo                  = moveInfo;
     OptionalSplineInformation = optionalSplineInformation;
 }
 /// <inheritdoc />
 public CorpseInfo(PackedGuid transportGuid, Vector3 <float> goLocation, Vector3 <float> transportOffset, float orientation, float corpseOrientation)
 {
     TransportGuid     = transportGuid;
     GoLocation        = goLocation;
     TransportOffset   = transportOffset;
     Orientation       = orientation;
     CorpseOrientation = corpseOrientation;
 }
Exemplo n.º 8
0
 internal AuraApplicationStateUpdate(byte casterLevel, byte counterAmount, PackedGuid casterGuid, int maximumAuraDuration, int currentAuraDuration)
 {
     CasterLevel         = casterLevel;
     CounterAmount       = counterAmount;
     CasterGuid          = casterGuid;
     MaximumAuraDuration = maximumAuraDuration;
     CurrentAuraDuration = currentAuraDuration;
 }
 //TODO: Additional ctors
 //TODO: Validate parameters.
 /// <inheritdoc />
 public SMSG_MONSTER_MOVE_Payload(PackedGuid monsterGuid, byte unk1, Vector3 <float> initialMovePoint, int splineId, MonsterMoveInfo moveInfo, MonsterSplineInfo optionalSplineInformation)
 {
     MonsterGuid               = monsterGuid;
     Unk1                      = unk1;
     InitialMovePoint          = initialMovePoint;
     SplineId                  = splineId;
     MoveInfo                  = moveInfo;
     OptionalSplineInformation = optionalSplineInformation;
 }
 //TODO: Ctor overloads/builder.
 //TODO: Validate parameters
 /// <inheritdoc />
 public SpellTargetInfo_Vanilla(short spellCastBackingFlag, PackedGuid optionalObjectTarget, PackedGuid optionalItemTarget, Vector3 <float> optionalTransportSourcePosition, Vector3 <float> optionalTransportDestinationPosition, string optionalTargetString)
 {
     SpellCastBackingFlag                 = spellCastBackingFlag;
     OptionalObjectTarget                 = optionalObjectTarget;
     OptionalItemTarget                   = optionalItemTarget;
     OptionalTransportSourcePosition      = optionalTransportSourcePosition;
     OptionalTransportDestinationPosition = optionalTransportDestinationPosition;
     OptionalTargetString                 = optionalTargetString;
 }
Exemplo n.º 11
0
 //TODO: Ctor overloads/builders
 //TODO: Validate parameters
 /// <inheritdoc />
 public SMSG_SPELL_GO_Payload_Vanilla(PackedGuid spellSource, PackedGuid spellTarget, int spellId, SpellCastFlags_Vanilla castFlags, ObjectGuid[] hitTargets, SpellTargetInfo_Vanilla targetInfo, AmmoInfo amunitionInformation)
 {
     SpellSource          = spellSource;
     SpellTarget          = spellTarget;
     SpellId              = spellId;
     CastFlags            = castFlags;
     HitTargets           = hitTargets;
     TargetInfo           = targetInfo;
     AmunitionInformation = amunitionInformation;
 }
 //TODO: Ctor overloads/builder.
 //TODO: Validate parameters
 public SpellTargetInfo(SpellCastTargetFlag targetFlags, PackedGuid optionalObjectTarget, PackedGuid optionalItemTarget, PackedGuid optionalTransportSourceLocation, Vector3 <float> optionalTransportSourcePosition, PackedGuid optionalTransportDestination, Vector3 <float> optionalTransportDestinationPosition, string optionalTargetString)
 {
     TargetFlags                          = targetFlags;
     OptionalObjectTarget                 = optionalObjectTarget;
     OptionalItemTarget                   = optionalItemTarget;
     OptionalTransportSourceLocation      = optionalTransportSourceLocation;
     OptionalTransportSourcePosition      = optionalTransportSourcePosition;
     OptionalTransportDestination         = optionalTransportDestination;
     OptionalTransportDestinationPosition = optionalTransportDestinationPosition;
     OptionalTargetString                 = optionalTargetString;
 }
 public SpellFailureData([NotNull] PackedGuid caster, byte spellCastCount, int spellId, byte result)
 {
     if (spellId <= 0)
     {
         throw new ArgumentOutOfRangeException(nameof(spellId));
     }
     Caster         = caster ?? throw new ArgumentNullException(nameof(caster));
     SpellCastCount = spellCastCount;
     SpellId        = spellId;
     Result         = result;
 }
Exemplo n.º 14
0
 //TODO: Validate
 /// <inheritdoc />
 public MovementBlockData_Vanilla(ObjectUpdateFlags_Vanilla updateFlags, MovementInfo_Vanilla moveInfo, float[] movementSpeeds, SplineInfo_Vanilla splineInformation, CorpseInfo_Vanilla deadMovementInformation, uint highGuid, uint unk1, PackedGuid fullGuid, uint transportTime)
 {
     UpdateFlags             = updateFlags;
     MoveInfo                = moveInfo;
     MovementSpeeds          = movementSpeeds;
     SplineInformation       = splineInformation;
     DeadMovementInformation = deadMovementInformation;
     HighGuid                = highGuid;
     Unk1          = unk1;
     FullGuid      = fullGuid;
     TransportTime = transportTime;
 }
Exemplo n.º 15
0
        private UpdateFieldValueCollection ToWotlkUpdateValues(PackedGuid objectGuid, UpdateFieldValueCollection updateCollection)
        {
            if (objectGuid.isType(EntityGuidMask.Player))
            {
                return(BuildWotlkPlayerUpdateFieldCollection(updateCollection));
            }
            else if (objectGuid.isType(EntityGuidMask.Unit))
            {
                return(BuildWotlkUnitUpdateFieldCollection(updateCollection));
            }

            return(null);
        }
        /// <inheritdoc />
        public ObjectUpdateMovementBlock Convert(ObjectUpdateMovementBlock_Vanilla fromObject)
        {
            if (fromObject == null)
            {
                return(null);
            }

            //The wotlk version wants this guid packed
            PackedGuid packedMovementGuid = new PackedGuid(fromObject.MovementGuid.RawGuidValue);

            ObjectUpdateMovementBlock wotlkBlock = new ObjectUpdateMovementBlock(packedMovementGuid, MovementBlockDataConverter.Convert(fromObject.MovementData));

            return(wotlkBlock);
        }
        } = 0;                                                               //TC always uses 0

        public SpellCastData(PackedGuid spellSource, PackedGuid spellTarget, byte spellCastCount, int spellId, SpellCastFlag castFlags, uint timeDiff, ObjectGuid[] hitTargets, SpellMissInfo[] spellMisses, SpellTargetInfo targetInfo, int powerValue, AdjustableSpellMissleInfo optionalAdjustableMissle, AmmoInfo amunitionInformation, ulong optionalVisualChainData)
        {
            SpellSource              = spellSource;
            SpellTarget              = spellTarget;
            SpellCastCount           = spellCastCount;
            SpellId                  = spellId;
            CastFlags                = castFlags;
            TimeDiff                 = timeDiff;
            HitTargets               = hitTargets;
            SpellMisses              = spellMisses;
            TargetInfo               = targetInfo;
            PowerValue               = powerValue;
            OptionalAdjustableMissle = optionalAdjustableMissle;
            AmunitionInformation     = amunitionInformation;
            OptionalVisualChainData  = optionalVisualChainData;
        }
 //TODO: Validate
 /// <inheritdoc />
 public MovementBlockData(ObjectUpdateFlags updateFlags, MovementInfo moveInfo,
                          float[] movementSpeeds, SplineInfo splineInformation, CorpseInfo deadMovementInformation,
                          StationaryMovementInfo stationaryObjectMovementInformation, int unk1,
                          uint lowGuid, PackedGuid target, uint unknownTransportTimer, VehicleMovementInfo vehicleMovementInformation, long packedRotationQuat)
 {
     UpdateFlags                         = updateFlags;
     MoveInfo                            = moveInfo;
     MovementSpeeds                      = movementSpeeds;
     SplineInformation                   = splineInformation;
     DeadMovementInformation             = deadMovementInformation;
     StationaryObjectMovementInformation = stationaryObjectMovementInformation;
     Unk1    = unk1;
     LowGuid = lowGuid;
     Target  = target;
     UnknownTransportTimer      = unknownTransportTimer;
     VehicleMovementInformation = vehicleMovementInformation;
     UpdatePackedQuaternion     = packedRotationQuat;
 }
Exemplo n.º 19
0
        public AuraApplicationStateUpdate(AuraFlags flags, byte casterLevel, byte counterAmount, PackedGuid casterGuid, int maximumAuraDuration, int currentAuraDuration)
            : this(casterLevel, counterAmount, casterGuid, maximumAuraDuration, currentAuraDuration)
        {
            Flags = flags;

            if (!HasCasterGuid)
            {
                throw new InvalidOperationException($"Cannot create: {nameof(AuraApplicationStateUpdate)} with Caster Guid without Flags: {AuraFlags.CASTER}.");
            }

            if (!HasDuration)
            {
                throw new InvalidOperationException($"Cannot create: {nameof(AuraApplicationStateUpdate)} with Duration without Flags: {AuraFlags.DURATION}.");
            }
        }
Exemplo n.º 20
0
        public AuraApplicationStateUpdate(AuraFlags flags, byte casterLevel, byte counterAmount, PackedGuid casterGuid)
            : this(casterLevel, counterAmount, casterGuid, 0, 0)
        {
            Flags = flags;

            if (!HasCasterGuid)
            {
                throw new InvalidOperationException($"Cannot create: {nameof(AuraApplicationStateUpdate)} with Caster Guid without Flags: {AuraFlags.CASTER}.");
            }
        }
Exemplo n.º 21
0
 /// <inheritdoc />
 public SMSG_NAME_QUERY_RESPONSE_Payload(PackedGuid requestedGuid)
     : this()
 {
     RequestedGuid = requestedGuid;
     ResponseCode  = NameQueryResponseCode.Failure;
 }
Exemplo n.º 22
0
 /// <inheritdoc />
 public SMSG_NAME_QUERY_RESPONSE_Payload(PackedGuid requestedGuid, NameQueryResponseCode responseCode)
 {
     RequestedGuid = requestedGuid;
     ResponseCode  = responseCode;
 }
Exemplo n.º 23
0
 /// <inheritdoc />
 public ObjectUpdateValuesObjectBlock(PackedGuid objectToUpdate, UpdateFieldValueCollection updateValuesCollection)
 {
     ObjectToUpdate         = objectToUpdate;
     UpdateValuesCollection = updateValuesCollection;
 }
Exemplo n.º 24
0
 public SMSG_AURA_UPDATE_Payload([NotNull] PackedGuid targetGuid, [NotNull] AuraUpdateData data)
     : this()
 {
     TargetGuid = targetGuid ?? throw new ArgumentNullException(nameof(targetGuid));
     Data       = data ?? throw new ArgumentNullException(nameof(data));
 }
 public StartSpellCastData(PackedGuid spellSource, PackedGuid spellTarget, byte spellCastCount, int spellId, SpellCastFlag castFlags, uint timeDiff, ObjectGuid[] hitTargets, SpellMissInfo[] spellMisses, SpellTargetInfo targetInfo, int powerValue, AdjustableSpellMissleInfo optionalAdjustableMissle, AmmoInfo amunitionInformation, ulong optionalVisualChainData)
     : base(spellSource, spellTarget, spellCastCount, spellId, castFlags, timeDiff, hitTargets, spellMisses, targetInfo, powerValue, optionalAdjustableMissle, amunitionInformation, optionalVisualChainData)
 {
 }
 /// <inheritdoc />
 public CustomMovePacketProxy(NetworkOperationCode opCode, [NotNull] PackedGuid moveGuid, [NotNull] MovementInfo moveInfo)
 {
     MoveGuid = moveGuid ?? throw new ArgumentNullException(nameof(moveGuid));
     OpCode   = opCode;
     MoveInfo = moveInfo ?? throw new ArgumentNullException(nameof(moveInfo));
 }
 /// <inheritdoc />
 public SMSG_CLIENT_CONTROL_UPDATE_Payload([NotNull] PackedGuid controlledObject, bool isEnabled)
     : this()
 {
     ControlledObject = controlledObject ?? throw new ArgumentNullException(nameof(controlledObject));
     IsEnabled        = isEnabled;
 }
Exemplo n.º 28
0
 /// <inheritdoc />
 public ObjectUpdateMovementBlock(PackedGuid movementGuid, MovementBlockData movementData)
 {
     MovementGuid = movementGuid;
     MovementData = movementData;
 }
Exemplo n.º 29
0
 /// <inheritdoc />
 public ObjectUpdateValuesObjectBlock_Vanilla(PackedGuid objectToUpdate, UpdateFieldValueCollection updateValuesCollection)
     : base()
 {
     ObjectToUpdate         = objectToUpdate;
     UpdateValuesCollection = updateValuesCollection;
 }