Esempio n. 1
0
            public SetObjectEffects(Object.Mobile mobile)
                : base(0x34)
            {
                //  SetObjectEffects = 0x34; // 0x34 4id 1light 1trans 4byffs 1staticmagic
                Write(mobile.objId);
                Write((byte)mobile.LightRadius);
                Write((byte)mobile.Transparency);
                if (mobile is Object.Living)
                {
                    Write((mobile as Object.Living).BuffArray, 0, 4);

                    if ((mobile as Object.Living).Buffs.Values.Where(xe => xe.Buff.Name == "MENTAL SWORD").FirstOrDefault() != null)
                    {
                        Write((byte)0x63); //move with char
                    }
                    else
                    {
                        Write((byte)0); //move with char
                    }
                }
                else
                {
                    Fill(5);
                }

                Write((byte)mobile.FrameType); //sprite frame type
                Write((byte)0);                // speed
                Write((byte)1);
            }
Esempio n. 2
0
            public CreateMineral(Object.Mobile mobile)
                : base(0x3D)
            {
                Write((int)mobile.objId);
                Write((short)1);
                Write((short)mobile.Position.X);
                Write((short)mobile.Position.Y);

                Write(mobile.Appearance, 0, 11);

                if (mobile is Object.Craft)
                {
                    var craft = mobile as Object.Craft;
                    Write((byte)craft.Speed);      //speed
                    Write((byte)0);
                    Write((byte)craft.Frames);     //frames
                    Write((byte)craft.StartFrame); //start frame
                }
                else
                {
                    Fill(4);
                }

                Fill(20);
                Write((short)mobile.Name.Length);
                WriteAsciiNull(mobile.Name);
            }
Esempio n. 3
0
 public ChangeObjectSprite(Object.Mobile mobile)
     : base(0x26)
 {
     Write((int)mobile.objId);
     Write(mobile.Appearance, 0, 11);
     Write((byte)mobile.Color);
 }
Esempio n. 4
0
 public void OnCurvMagic(Object.Mobile obj, int x, int y, Object.SpellSequence seq)
 {
     if (_CurveMagic != null)
     {
         _CurveMagic(obj, x, y, seq);
     }
 }
Esempio n. 5
0
 public void OnMagcEffect(Object.Mobile obj, int effect)
 {
     if (_MagicEffect != null)
     {
         _MagicEffect(obj, effect);
     }
 }
Esempio n. 6
0
 public void OnFace(Object.Mobile obj)
 {
     if (_face != null)
     {
         _face(obj);
     }
 }
Esempio n. 7
0
 public void OnEnter(Object.Mobile obj)
 {
     if (_FenterMap != null)
     {
         _FenterMap(obj);
     }
 }
Esempio n. 8
0
 public void OnSwing(Object.Mobile obj, int face)
 {
     if (_swing != null)
     {
         _swing(obj, face);
     }
 }
Esempio n. 9
0
 public void OnTele(Object.Mobile obj)
 {
     if (_tele != null)
     {
         _tele(obj);
     }
 }
Esempio n. 10
0
            public CreateMobile(Object.Mobile mobile)
                : base(0x1D)
            {
                Write((int)mobile.objId);
                Write((short)mobile.Position.Face);
                Write((short)mobile.Position.X);
                Write((short)mobile.Position.Y);

                Write(mobile.Appearance, 0, 11);

                Write((byte)mobile.Color);        // color
                Write((byte)0x18);                //thickness
                Write((byte)0);                   //uk
                Write((byte)mobile.Transparency); //1byte transp

                if (mobile is Object.Living)
                {
                    Write((mobile as Object.Living).BuffArray, 0, 4);
                }
                else
                {
                    Fill(4);      //buffs
                }
                Write((byte)0x0); //uk
                Write((byte)0x0); //uk
                Write((byte)0x0); //uk
                Write((byte)0x0); //uk

                Write((byte)0x01);
                WriteAsciiNull(mobile.Name);
            }
Esempio n. 11
0
 public void OnChgObjSprit(Object.Mobile obj)
 {
     if (_chgObjSprite != null)
     {
         _chgObjSprite(obj);
     }
 }
Esempio n. 12
0
        public void OnWalk(Object.Mobile obj)
        {
            if (obj == this)
            {
                return;
            }

            gameLink.Send(new GameOutMessage.MoveSpriteWalk(obj.objId, obj.Position.Face, obj.Position.X, obj.Position.Y).Compile());
        }
Esempio n. 13
0
 public void OnWalk(Object.Mobile obj)
 {
     //  if (parentMap.sizeX < obj.Position.X || parentMap.sizeY < obj.Position.Y)
     //      return;
     if (_walk != null)
     {
         _walk(obj);
     }
 }
Esempio n. 14
0
        public void OnFace(Object.Mobile obj)
        {
            if (obj == this)
            {
                return;
            }

            int face = 0;

            face = (obj as Object.Mobile).Position.Face;

            gameLink.Send(new GameOutMessage.ChangeFace(obj.objId, face).Compile());
        }
Esempio n. 15
0
        public void OnSwing(Object.Mobile obj, int face)
        {
            if (obj == this)
            {
                if (State.autohit)
                {
                }
                else
                {
                    return;
                }
            }

            gameLink.Send(new GameOutMessage.SwingAnimation(obj.objId, face).Compile());
        }
Esempio n. 16
0
        public static void CastView(Player.LeafSpell spell, Player.Player caster, Object.Mobile target)
        {
            if (target == null)
            {
                return;
            }

            if (target is Craft)
            {
                var           cstd = target as Craft;
                StringBuilder sb   = new StringBuilder();
                sb.Append(string.Format("The contents: ", cstd.Name));
                foreach (var ob in cstd.Contents)
                {
                    sb.Append(string.Format("{0} ", ob.Value.Name));
                }
                caster.WriteWarn(sb.ToString());
            }
        }
Esempio n. 17
0
        internal void Cast(LeafSpell spell, Object.Mobile tar)
        {
            if (tar is Object.Npc)
            {
                return;
            }
            if (tar is Object.Item)
            {
                return;
            }

            if (playerLink.Position.DistanceTo(tar.Position.X, tar.Position.Y) > spell.Spell.Range)
            {
                return;
            }

            if (!DelayCost(spell))
            {
                return;
            }

            playerLink.Position.CurMap.Events.OnCurvMagic(playerLink, tar.Position.X, tar.Position.Y, spell.Spell.SpellSeq);
            spell.Spell.Cast(spell, playerLink, tar, null);
        }
Esempio n. 18
0
 public SetMagicEffect(Object.Mobile mobile, int magicid)
     : base(0x25)
 {
     Write(mobile.objId);
     Write((byte)magicid);
 }
Esempio n. 19
0
 public void OnTele(Object.Mobile obj)
 {
     gameLink.Send(new GameOutMessage.MoveSpriteTele(obj.objId, obj.Position.Face, obj.Position.X, obj.Position.Y).Compile());
 }
Esempio n. 20
0
 public void OnChangeObjSprite(Object.Mobile obj)
 {
     gameLink.Send(new GameOutMessage.ChangeObjectSprite(obj).Compile());
     gameLink.Send(new GameOutMessage.SetObjectEffects(obj).Compile());
 }
Esempio n. 21
0
 public void OnCurveMagic(Object.Mobile obj, int x, int y, Object.SpellSequence seq)
 {
     gameLink.Send(new GameOutMessage.CurveMagic(obj.objId, x, y, seq).Compile());
 }
Esempio n. 22
0
 public void OnMagicEffect(Object.Mobile obj, int effect)
 {
     gameLink.Send(new GameOutMessage.SetMagicEffect(obj, effect).Compile());
 }
Esempio n. 23
0
 public void OnMobileSpeak(Object.Mobile npc, string msg)
 {
     gameLink.Send(new GameOutMessage.BubbleChat(npc.objId, PrefixedChatMessage(npc.Name, msg)).Compile());
 }
Esempio n. 24
0
        public static void CastSingleTarget(Player.LeafSpell spell, Player.Player caster, Object.Mobile target, E_Race race = 0)
        {
            if (!(target is Object.Living))
            {
                return;
            }

            if (race != 0)
            {
                if (((target as Object.Living).Race & race) == 0)
                {
                    return;
                }
            }
            (target as Object.Living).TakeDamage(caster, spell);
        }
Esempio n. 25
0
 public MagicMotion(Object.Mobile mobile, int dir)
     : base(0x27)
 {
     Write(mobile.objId);
     Write((byte)dir);
 }