コード例 #1
0
ファイル: MonsterAI.cs プロジェクト: zarut/xiah-gcf-emulator
        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;
        }
コード例 #2
0
 public MonsterMoveInfoEventArgs(MonsterMoveInfo i)
 {
     this.info = i;
 }
コード例 #3
0
        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));
                    }
                }
            }
        }
コード例 #4
0
        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);
        }