Zak
Posting Freak
- Mar 12, 2011
- 848
- 453
Code:
#region Pet Packet
case "B@":
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
#region Querys
StringBuilder PetStatsContent = new StringBuilder();
mID = dbClient.getInt("SELECT id FROM pets");
DataRow PetQuerys = dbClient.getRow("SELECT * FROM pets WHERE ID = '" + mID + "'");
string PetStatsOptions = "Options";
#endregion //ZAK
#region Main Stats
if ((int)PetQuerys["hungry"] != 0 || (int)PetQuerys["age"] != 0 || (int)PetQuerys["thirst"] != 0 || (int)PetQuerys["happiness"] != 0 || (int)PetQuerys["energy"] != 0 || (int)PetQuerys["friendship"] != 0)
{
PetStatsContent.Append(mID); // Pet ID
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["id"])));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["age"])));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["hungry"])));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["thirst"])));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["happiness"])));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["energy"])));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["friendship"])));
sendData("CR".ToString()); // CR
}
#endregion
#region Switch Case PetOptions
switch (PetStatsOptions)
{
case "Dog":
if ((int)PetQuerys["type"] != 0)
PetStatsContent.Append(Convert.ToString("Dog"));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["type"])));
break;
case "Cat":
if ((int)PetQuerys["type"] != 1)
PetStatsContent.Append(Convert.ToString("Cat"));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["type"])));
break;
case "Crocodile":
if ((int)PetQuerys["type"] != 2)
PetStatsContent.Append(Convert.ToString("Crocodile"));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["type"])));
break;
case "Unknown":
if ((int)PetQuerys["type"] != 3)
PetStatsContent.Append(Convert.ToString("Unknown Pet"));
PetStatsContent.Append(Holo.Encoding.encodeVL64(Convert.ToInt32(PetQuerys["type"])));
break;
case "LowHunger":
if ((int)PetQuerys["hungry"] < 20)
PetStatsContent.Append(Convert.ToString("Hungry"));
break;
case "MidHunger":
if ((int)PetQuerys["hungry"] > 20 && (int)PetQuerys["hungry"] < 40)
PetStatsContent.Append(Convert.ToString("Alright"));
break;
case "FullHunger":
if ((int)PetQuerys["hungry"] > 40 && (int)PetQuerys["hungry"] < 100)
PetStatsContent.Append(Convert.ToString("Full"));
break;
case "LowThirst":
if ((int)PetQuerys["thirst"] < 10)
PetStatsContent.Append(Convert.ToString("Thirsty"));
break;
case "MidThirst":
if ((int)PetQuerys["thirst"] > 10 && (int)PetQuerys["thirst"] < 20)
PetStatsContent.Append(Convert.ToString("Alright"));
break;
case "FullThirst":
if ((int)PetQuerys["thirst"] > 40 && (int)PetQuerys["thirst"] < 100)
PetStatsContent.Append(Convert.ToString("Full"));
break;
case "LowEnergy":
if ((int)PetQuerys["energy"] < 20)
PetStatsContent.Append(Convert.ToString("Lazy"));
break;
case "MidEnergy":
if ((int)PetQuerys["energy"] > 20 && (int)PetQuerys["energy"] < 40)
PetStatsContent.Append(Convert.ToString("Alright"));
break;
case "FullEnergy":
if ((int)PetQuerys["energy"] > 40 && (int)PetQuerys["energy"] < 100)
PetStatsContent.Append(Convert.ToString("Hyper!"));
break;
case "LowFriendShip":
if ((int)PetQuerys["friendship"] < 20)
PetStatsContent.Append(Convert.ToString("Loner"));
break;
case "MidFriendShip":
if ((int)PetQuerys["friendship"] > 20 && (int)PetQuerys["friendship"] < 40)
PetStatsContent.Append(Convert.ToString("Alright"));
break;
case "FullFriendShip":
if ((int)PetQuerys["friendship"] > 40 && (int)PetQuerys["friendship"] < 100)
PetStatsContent.Append(Convert.ToString("Married Couple")); // LMAO / <3 ;D
break;
}
#endregion
}
break;
}
#endregion