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; }
public void AddNPC(NPC npc) { _maps[npc.MapID].AddNPC(npc); }
public NPCMovePacket(DecoServer2.NPC npc) { _npc = npc; }
public NPCInfoPacket(DecoServer2.NPC npc) { _npc = npc; }
public void AddNPC(NPC npc) { _npcs[npc.ID] = npc; }
public void UpdateNPCPosition(NPC npc) { NPCMovePacket pkt = new NPCMovePacket(npc); foreach (Connection c in _players.Values) { c.SendPacket(pkt); } }
public NPCMovePacket(DecoServer2.NPC npc) { _npc = npc; }
public NPCInfoPacket(DecoServer2.NPC npc) { _npc = npc; }