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); }
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); }
public ChangeObjectSprite(Object.Mobile mobile) : base(0x26) { Write((int)mobile.objId); Write(mobile.Appearance, 0, 11); Write((byte)mobile.Color); }
public void OnCurvMagic(Object.Mobile obj, int x, int y, Object.SpellSequence seq) { if (_CurveMagic != null) { _CurveMagic(obj, x, y, seq); } }
public void OnMagcEffect(Object.Mobile obj, int effect) { if (_MagicEffect != null) { _MagicEffect(obj, effect); } }
public void OnFace(Object.Mobile obj) { if (_face != null) { _face(obj); } }
public void OnEnter(Object.Mobile obj) { if (_FenterMap != null) { _FenterMap(obj); } }
public void OnSwing(Object.Mobile obj, int face) { if (_swing != null) { _swing(obj, face); } }
public void OnTele(Object.Mobile obj) { if (_tele != null) { _tele(obj); } }
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); }
public void OnChgObjSprit(Object.Mobile obj) { if (_chgObjSprite != null) { _chgObjSprite(obj); } }
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()); }
public void OnWalk(Object.Mobile obj) { // if (parentMap.sizeX < obj.Position.X || parentMap.sizeY < obj.Position.Y) // return; if (_walk != null) { _walk(obj); } }
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()); }
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()); }
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()); } }
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); }
public SetMagicEffect(Object.Mobile mobile, int magicid) : base(0x25) { Write(mobile.objId); Write((byte)magicid); }
public void OnTele(Object.Mobile obj) { gameLink.Send(new GameOutMessage.MoveSpriteTele(obj.objId, obj.Position.Face, obj.Position.X, obj.Position.Y).Compile()); }
public void OnChangeObjSprite(Object.Mobile obj) { gameLink.Send(new GameOutMessage.ChangeObjectSprite(obj).Compile()); gameLink.Send(new GameOutMessage.SetObjectEffects(obj).Compile()); }
public void OnCurveMagic(Object.Mobile obj, int x, int y, Object.SpellSequence seq) { gameLink.Send(new GameOutMessage.CurveMagic(obj.objId, x, y, seq).Compile()); }
public void OnMagicEffect(Object.Mobile obj, int effect) { gameLink.Send(new GameOutMessage.SetMagicEffect(obj, effect).Compile()); }
public void OnMobileSpeak(Object.Mobile npc, string msg) { gameLink.Send(new GameOutMessage.BubbleChat(npc.objId, PrefixedChatMessage(npc.Name, msg)).Compile()); }
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); }
public MagicMotion(Object.Mobile mobile, int dir) : base(0x27) { Write(mobile.objId); Write((byte)dir); }