Ejemplo n.º 1
0
 private void LoadNpcs()
 {
     Database.MySqlCommand command = new PhoenixProject.Database.MySqlCommand(PhoenixProject.Database.MySqlCommandType.SELECT);
     command.Select("npcs").Where("mapid", ID);
     PhoenixProject.Database.MySqlReader reader = new PhoenixProject.Database.MySqlReader(command);
     while (reader.Read())
     {
         INpc npc = new Network.GamePackets.NpcSpawn();
         npc.UID = reader.ReadUInt32("id");
         npc.Mesh = reader.ReadUInt16("lookface");
         npc.Type = (Enums.NpcType)reader.ReadByte("type");
         npc.X = reader.ReadUInt16("cellx"); ;
         npc.Y = reader.ReadUInt16("celly");
         npc.MapID = ID;
         //Network.GamePackets.PokerTable npc2 = new Network.GamePackets.PokerTable();
         AddNpc(npc);
     }
     reader.Close();
     reader.Dispose();
     command = new PhoenixProject.Database.MySqlCommand(PhoenixProject.Database.MySqlCommandType.SELECT);
     command.Select("sobnpcs").Where("mapid", ID);
     reader = new PhoenixProject.Database.MySqlReader(command);
     while (reader.Read())
     {
         Network.GamePackets.SobNpcSpawn npc = new Network.GamePackets.SobNpcSpawn();
         npc.UID = reader.ReadUInt32("id");
         npc.Mesh = reader.ReadUInt16("lookface");
         if (ID == 1039)
             npc.Mesh = (ushort)(npc.Mesh - npc.Mesh % 10 + 7);
         npc.Type = (Enums.NpcType)reader.ReadByte("type");
         npc.X = reader.ReadUInt16("cellx"); ;
         npc.Y = reader.ReadUInt16("celly");
         npc.MapID = reader.ReadUInt16("mapid");
         npc.Sort = reader.ReadUInt16("sort");
         npc.ShowName = true;
         npc.Name = reader.ReadString("name");
         npc.Hitpoints = reader.ReadUInt32("life");
         npc.MaxHitpoints = reader.ReadUInt32("maxlife");
         AddNpc(npc);
     }
     reader.Close();
     reader.Dispose();
 }
Ejemplo n.º 2
0
 private void LoadFlag(uint UID, string Name, ushort x, ushort y)
 {
     Network.GamePackets.SobNpcSpawn npc = new Network.GamePackets.SobNpcSpawn();
         npc.UID = UID;
         npc.Mesh = 8910;
         npc.Type = Enums.NpcType.Stake;
         npc.X = x ;
         npc.Y = y;
         npc.MapID = 2060;
         npc.Sort = 17;
         npc.ShowName = true;
         npc.Name = Name;
         npc.Hitpoints = 50000;
         npc.MaxHitpoints = 50000;
         AddNpc(npc);
 }