示例#1
0
        public static NPC ReadFromDB(object[] row)
        {
            // 0: static_npc_id   int(10) unsigned
            // 1: game_id smallint(5) unsigned
            // 2: location_x  int(10) unsigned
            // 3: location_y  int(10) unsigned
            // 4: hp  int(10) unsigned
            // 5: direction   int(10) unsigned
            // 6: map_id  smallint(5) unsigned

            NPC npc = new NPC();
            npc._id = (uint)row[0];
            npc._gameID = (ushort)row[1];
            uint x = (uint)row[2];
            uint y = (uint)row[3];
            npc._hp = (uint)row[4];
            npc._direction = ((uint)row[5]);
            npc._mapID = (ushort)row[6];
            npc._cellIndex = Utils.EncodeCellIndex(npc._mapID, x, y);

            return npc;
        }
示例#2
0
 public void AddNPC(NPC npc)
 {
     _maps[npc.MapID].AddNPC(npc);
 }
示例#3
0
 public NPCMovePacket(DecoServer2.NPC npc)
 {
     _npc = npc;
 }
示例#4
0
 public NPCInfoPacket(DecoServer2.NPC npc)
 {
     _npc = npc;
 }
示例#5
0
 public void AddNPC(NPC npc)
 {
     _npcs[npc.ID] = npc;
 }
示例#6
0
 public void UpdateNPCPosition(NPC npc)
 {
     NPCMovePacket pkt = new NPCMovePacket(npc);
     foreach (Connection c in _players.Values)
     {
         c.SendPacket(pkt);
     }
 }
示例#7
0
 public NPCMovePacket(DecoServer2.NPC npc)
 {
     _npc = npc;
 }
示例#8
0
 public NPCInfoPacket(DecoServer2.NPC npc)
 {
     _npc = npc;
 }