Ejemplo n.º 1
0
    Vector3 GetDirection(EffectDirectionType type, GameObject go)
    {
        Vector3 vec = Vector3.zero;

        switch (type)
        {
        case EffectDirectionType.EffectDirectionType_RoleForward:
            vec = go.transform.forward;
            break;

        case EffectDirectionType.EffectDirectionType_RoleBack:
            vec = go.transform.forward * -1.0f;
            break;

        case EffectDirectionType.EffectDirectionType_RoleLeft:
            vec = go.transform.right * -1.0f;
            break;

        case EffectDirectionType.EffectDirectionType_RoleRight:
            vec = go.transform.right;
            break;

        case EffectDirectionType.EffectDirectionType_RoleUp:
            vec = go.transform.up;
            break;

        default:
            break;
        }

        return(vec);
    }
Ejemplo n.º 2
0
        public void PlayGraphicalEffect(EffectDirectionType directionType, ObjectId characterId, ModelId type,
                                        Location3D location, byte animationSpeed, byte duration, bool adjustDirection, bool explodeOnImpact)
        {
            GraphicalEffectPacket packet = new GraphicalEffectPacket(characterId, 0, type, location, location,
                                                                     animationSpeed, directionType, duration, adjustDirection, explodeOnImpact);

            Send(packet.RawPacket);
        }
 internal GraphicalEffectStartedEvent(EffectDirectionType directionType, ObjectId characterId,
                                      ObjectId targetId, ModelId type, Location3D location, Location3D targetLocation)
 {
     DirectionType  = directionType;
     CharacterId    = characterId;
     TargetId       = targetId;
     Type           = type;
     Location       = location;
     TargetLocation = targetLocation;
 }
Ejemplo n.º 4
0
        public GraphicalEffectPacket(ObjectId characterId, ObjectId targetId, ModelId type, Location3D location,
                                     Location3D targetLocation, byte animationSpeed, EffectDirectionType directionType, byte duration, bool adjustDirection, bool explodeOnImpact)
        {
            DirectionType   = directionType;
            CharacterId     = characterId;
            TargetId        = targetId;
            Type            = type;
            Location        = location;
            TargetLocation  = targetLocation;
            AnimationSpeed  = animationSpeed;
            AdjustDirection = adjustDirection;
            ExplodeOnImpact = explodeOnImpact;

            var payload = new byte[28];
            var writer  = new ArrayPacketWriter(payload);

            writer.WriteByte((byte)PacketDefinitions.GraphicalEffect.Id);
            writer.WriteByte((byte)DirectionType);
            writer.WriteId(characterId);
            writer.WriteId(targetId);
            writer.WriteModelId(type);

            writer.WriteUShort((ushort)location.X);
            writer.WriteUShort((ushort)location.Y);
            writer.WriteByte((byte)location.Z);

            writer.WriteUShort((ushort)targetLocation.X);
            writer.WriteUShort((ushort)targetLocation.Y);
            writer.WriteByte((byte)targetLocation.Z);

            writer.WriteByte(animationSpeed);
            writer.WriteByte(duration);
            writer.WriteUShort(0); // unknwon
            writer.WriteByte((byte)(adjustDirection ? 1 : 0));
            writer.WriteByte((byte)(explodeOnImpact ? 1 : 0));

            rawPacket = new Packet(PacketDefinitions.GraphicalEffect.Id, payload);
        }