What the hell?
What version of "DeltaCMS" did you edit? - DeltaCMS v1 and v1.2 has the .se /me.php? & v1.3 is a completely different style?
Why not just download UberCMS if you're going to use this?
//db queries
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
canHit = dbClient.getInt("SELECT violence FROM rooms WHERE id = '" + _roomID + "'");
health_db = dbClient.getString("SELECT health FROM users WHERE name = '" + User._Username + "'");
str_db = dbClient.getString("SELECT str FROM users WHERE name = '" + _Username + "'");
}
if (canHit == 1)
{
return false;
}
//db queries
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
health_db_ko = dbClient.getInt("SELECT health FROM users WHERE name = '" + User._Username + "'");
int getHit = health_db_ko - 1;
if (getHit > health_db_ko)
{
sendData("BK" + "Sorry, but you can not knock yourself out.");
return false;
}
else
{
dbClient.runQuery("UPDATE users SET health = health - '1' WHERE name = '" + User._Username + "'");
}
}
Room.sendShout(roomUser, "*Sticks with lighting " + args[1] + ", causing 30 damage*");
int health_int = health_db_ko;
ThreadStart punchCdStarter = new ThreadStart(punchCoolDown);
punchCdLooper = new Thread(punchCdStarter);
punchCdLooper.Priority = ThreadPriority.Lowest;
punchCdLooper.Start();
//if the user has 0 or less helth left
if (health_int < 1)
{
User.sendData("D^" + "H" + Encoding.encodeVL64(153));
User.sendData("BK" + "You have been knocked out by another user and sent to the hospital.");
Room.sendShout(roomUser, "*Knocks out " + args[1] + ", sending them to the hospital*");
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
dbClient.runQuery("UPDATE users SET health = '100' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET kills = kills + 1 WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET deaths = deaths + 1 WHERE name = '" + User._Username + "'");
}
ThreadStart koStarter = new ThreadStart(knockOut);
deadLooper = new Thread(koStarter);
deadLooper.Priority = ThreadPriority.Lowest;
User.deadLooper.Start();
User.roomUser.walkLock = true;
}
}
else
{
if (User._roomID == _roomID && (roomUser.Y + 1 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X))
{
Room.sendShout(roomUser, "*Swings at " + args[1] + ", but misses*");
}
//else
//{
// Room.sendSaying(roomUser, "*Swings at " + args[1] + ", but misses*");
//}
}
int _userID = userManager.getUserID(args[1]);
virtualUser Target = userManager.getUser(_userID);
Target.roomUser.walkLock = true; // Freeze the user
Room.sendSaying(roomUser, "*I SUMMON LIGHTING ON " + Target._Username + "*");
#endregion
#region unch <user>
case "punch":
case "hit":
{
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
virtualUser User = userManager.getUser(args[1]);
if (User._roomID != _roomID)
break;
if (roomUser.walkLock == true)
{
sendData("BK" + "Nice try, but you are either stunned or cuffed.");
break;
}
if (punchCdLooper != null)
{
Room.sendWhisper(roomUser, _Username, "*attempts to swing at " + User._Username + ", but is too exhausted*");
break;
}
int isArrested = dbClient.getInt("SELECT arrested FROM users WHERE name = '" + _Username + "'");
int canHit = dbClient.getInt("SELECT violence FROM rooms WHERE id = '" + _roomID + "'");
int isAfk = dbClient.getInt("SELECT afk FROM users WHERE name = '" + User._Username + "'");
if (isAfk == 1)
{
sendData("BK" + "Sorry, but this user is AFK.");
break;
}
if (isArrested < 1)
{
if (canHit == 1)
{
sendData("BK" + "Sorry, but this room has been declared a no fighting zone.");
break;
}
if (User._roomID == _roomID && (roomUser.Y == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y + 1 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y - 1 == User.roomUser.Y && roomUser.X == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X + 1 == User.roomUser.X) || (roomUser.Y == User.roomUser.Y && roomUser.X - 1 == User.roomUser.X))
{
//db queries
int myHealth = dbClient.getInt("SELECT health FROM users WHERE name = '" + User._Username + "'");
int str_mod = dbClient.getInt("SELECT str FROM users WHERE name = '" + _Username + "'");
//generates a random number
Random randNum = new Random();
int hit_dif_0 = randNum.Next(1, 3);
int hit_dif_1 = randNum.Next(1, 13);
//what a user hits
int hit = str_mod * hit_dif_0 + hit_dif_1;
int getHit = myHealth - hit;
if (getHit < 1 && _Username == User._Username)
{
sendData("BK" + "Sorry, but you can not knock yourself out.");
}
else
{
dbClient.runQuery("UPDATE users SET health = health - '" + hit + "' WHERE name = '" + User._Username + "'");
dbClient.runQuery("UPDATE users SET hits = hits + 1 WHERE name = '" + _Username + "'");
int health_db_ko = dbClient.getInt("SELECT health FROM users WHERE name = '" + User._Username + "'");
Room.sendShout(roomUser, "*Swings at " + args[1] + ", causing " + hit + " damage*");
ThreadStart punchCdStarter = new ThreadStart(punchCoolDown);
punchCdLooper = new Thread(punchCdStarter);
punchCdLooper.Priority = ThreadPriority.Lowest;
punchCdLooper.Start();
//if the user has 0 or less helth left
if (health_db_ko < 1)
{
if (User._Mission == "[Game] Brawl")
{
Room.sendShout(roomUser, "*Knocks out " + args[1] + ", sending them to the lobby*");
if (User._Mission == "[Game] Brawl")
{
if (_Mission == "[Game] Brawl")
{
dbClient.runQuery("UPDATE users SET game_brawl = game_brawl + '10' WHERE name = '" + _Username + "'");
}
User.sendData("D^" + "H" + Encoding.encodeVL64(10));
User.sendData("BK" + "Thank you for playing brawl.");
}
User.refreshAppearance(true, true, true);
dbClient.runQuery("UPDATE users SET health = '100' WHERE name = '" + User._Username + "'");
}
else
{
User.sendData("D^" + "H" + Encoding.encodeVL64(2));
User.sendData("BK" + "You have been knocked out by another user and sent to the hospital.");
Room.sendShout(roomUser, "*Knocks out " + args[1] + ", sending them to the hospital*");
dbClient.runQuery("UPDATE users SET kills = kills + 1 WHERE name = '" + _Username + "'");
dbClient.runQuery("UPDATE users SET deaths = deaths + 1, time_dead = '10' WHERE name = '" + User._Username + "'");
User._Mission = "Dead";
User._DeathTimer = 10;
refreshAppearance(true, true, true);
ThreadStart koStarter = new ThreadStart(User.knockOut);
User.deadLooper = new Thread(koStarter);
User.deadLooper.Priority = ThreadPriority.Lowest;
User.deadLooper.Start();