private MonsterMoveInfo GetMovementInfo(MonsterMoveStatus type) { Monster.Direction = (short)GetRotation(Monster.Destination); MonsterMoveInfo i = new MonsterMoveInfo { CurrentPosition = Monster.Position, Destination = Monster.Destination, Rotation = Monster.Direction, Status = type }; return i; }
public MonsterMoveInfoEventArgs(MonsterMoveInfo i) { this.info = i; }
void c_ClientMonsterSpawnRequestInfo(object sender, ClientMonsterSpawnRequestEventArgs e) { Client c = (Client)sender; MonsterSpawnRequestInfo i = e.Info; if (c.MyCharacter != null && c.MyCharacter.Online) { MapEngine mapEngine = GetMapEngine(i.MapId); Monster m = mapEngine.GetMonsterByID(i.MonsterId, i.MapId); if (m != null) { c.Send(PacketManager.SendSpawnMonster(m)); if (m.IsMoving) { MonsterMoveInfo info = new MonsterMoveInfo { CurrentPosition = m.Position, Destination = m.Destination, Rotation = m.Direction, Status = MonsterMoveStatus.StartMoving }; c.Send(PacketManager.SendMonsterStartMoving(m, info)); } } } }
public static byte[] SendMonsterStopMoving(BaseEntity ent, MonsterMoveInfo mi) { Monster m = null; Packet p = new Packet(200); if (ent is Monster) { m = ent as Monster; p.WriteHexString("00"); p.WriteInt(m.MonsterID); p.WriteByte((byte)m.Type); p.WriteShort(mi.CurrentPosition.X); p.WriteShort(mi.CurrentPosition.Y); p.WriteHexString("00 14"); p.WriteByte(m.MovementSpeed); } return p.GetWrittenBuffer(PacketIds.SendMonsterStopMoving); }