public AnimatedItemEffectView(AnimatedItemEffect effect)
     : base(effect)
 {
     m_Animated = true;
     IResourceProvider provider = ServiceRegistry.GetService<IResourceProvider>();
     m_AnimData = provider.GetResource<EffectData>(Effect.ItemID);
 }
Exemplo n.º 2
0
 public AnimatedItemEffectView(AnimatedItemEffect effect)
     : base(effect)
 {
     m_Animated = true;
     m_AnimData = Provider.GetResource<EffectData>(Effect.ItemID);
 }
 public AnimatedItemEffectView(AnimatedItemEffect effect)
     : base(effect)
 {
     m_Animated = true;
     m_AnimData = AnimData.GetAnimData(Effect.ItemID & 0x3fff);
 }
Exemplo n.º 4
0
        public void Add(GraphicEffectPacket packet)
        {
            bool hasHueData = (packet as GraphicEffectHuedPacket != null);
            bool hasParticles = (packet as GraphicEffectExtendedPacket != null); // we don't yet handle these.
            if (hasParticles)
            {
                Tracer.Warn("Unhandled particles in an effects packet.");
            }

            AEffect effect = null;
            int hue = hasHueData ? ((GraphicEffectHuedPacket)packet).Hue : 0;
            int blend = hasHueData ? (int)((GraphicEffectHuedPacket)packet).BlendMode : 0;

            switch (packet.EffectType)
            {
                case GraphicEffectType.Moving:
                    if (packet.ItemID <= 0)
                        return;
                    effect = new MovingEffect(m_Model.Map, packet.SourceSerial, packet.TargetSerial,
                        packet.SourceX, packet.SourceY, packet.SourceZ,
                        packet.TargetX, packet.TargetY, packet.TargetZ, 
                        packet.ItemID, hue);
                    effect.BlendMode = blend;
                    if (packet.DoesExplode)
                    {
                        effect.Children.Add(new AnimatedItemEffect(m_Model.Map, packet.TargetSerial, 
                            packet.TargetX, packet.TargetY, packet.TargetZ,
                            0x36cb, hue, 9));
                    }
                    break;
                case GraphicEffectType.Lightning:
                    effect = new LightningEffect(m_Model.Map, packet.SourceSerial, 
                        packet.SourceX, packet.SourceY, packet.SourceZ, hue);
                    break;
                case GraphicEffectType.FixedXYZ:
                    if (packet.ItemID <= 0)
                        return;
                    effect = new AnimatedItemEffect(m_Model.Map, 
                        packet.SourceX, packet.SourceY, packet.SourceZ,
                        packet.ItemID, hue, packet.Duration);
                    effect.BlendMode = blend;
                    break;
                case GraphicEffectType.FixedFrom:
                    if (packet.ItemID <= 0)
                        return;
                    effect = new AnimatedItemEffect(m_Model.Map, packet.SourceSerial, 
                        packet.SourceX, packet.SourceY, packet.SourceZ,
                        packet.ItemID, hue, packet.Duration);
                    effect.BlendMode = blend;
                    break;
                case GraphicEffectType.ScreenFade:
                    Tracer.Warn("Unhandled screen fade effect.");
                    break;
                default:
                    Tracer.Warn("Unhandled effect.");
                    return;
            }

            if (effect != null)
                Add(effect);
        }