Jump to content

Recommended Posts

Posted

Hello Ladies.I want to share php script maded by me.it's for users. thay can change charaters name color with donate item.

 

Preview:

 

81425473.png

 

So Let's Start

 

First create Config.php and write there

 

<?php
$L2JBS_config["mysql_host"]="localhost";
$L2JBS_config["mysql_port"]="3306";
$L2JBS_config["mysql_db"]="l2jdb";
$L2JBS_config["mysql_login"]="root";
$L2JBS_config["mysql_password"]="master";
$price="250";
$item_id="6673";
$pricename="Festival Adena";

?>

 

Save and Close.

 

Now Create ColorChange.php and write there

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Character Name Color Change By Leki</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
body {
background-color: #000000;
}
-->
</style>
</head>
<body>
<center>
<?php
require("Config.php");
?>
<?php
$submit = isset($HTTP_POST_VARS['submit'])?$HTTP_POST_VARS['submit']:false;
if ($submit)
{
$link = mysql_connect($L2JBS_config['mysql_host'].":".$L2JBS_config['mysql_port'], $L2JBS_config['mysql_login'], $L2JBS_config['mysql_password']);
  if (!$link)
    die("Couldn't connect to MySQL");
  @mysql_select_db($L2JBS_config['mysql_db'], $link)
    or die ('Error '.mysql_errno().': '.mysql_error());
$nick = $HTTP_POST_VARS['nick'];
$color = $HTTP_POST_VARS['color'];
$acc_name = $HTTP_POST_VARS['acc_name'];
$pass = $HTTP_POST_VARS['pass'];
$sql = "SELECT * FROM `accounts` WHERE `login` = '$acc_name'";
$res = mysql_query($sql);
$account = mysql_fetch_array($res);
if ($account['password'] != base64_encode(pack('H*',sha1(utf8_encode($pass))))) {die('Invalid password<br><br><a href="ColorChange.php">Back</a>');}


$res = mysql_query("SELECT `char_name` FROM `characters` WHERE `char_name` = '$nick'");
if (!@mysql_num_rows($res)) {die('You do not have such character<br><br><a href="ColorChange.php">Back</a>');}


$sql = "SELECT `account_name`,`obj_Id`,`online` FROM `characters` WHERE `char_name` = '$nick'";
$res = mysql_query($sql);
$nick = mysql_fetch_array($res);
if ($account['login'] != $nick['account_name']) {die('This character does not belong to you.<br><br><a href="ColorChange.php">Back</a>');}



$sql = "SELECT `owner_id`,`object_id`,`item_id`,`count` FROM `items` WHERE `item_id` = '$item_id' AND `owner_id` = ${nick['obj_Id']}";
$res = mysql_query($sql);
$money = mysql_fetch_array($res);
if ($money['count'] < $price) {die('Not enough money to change color <br><br><a href="ColorChange.php">Back</a>');}


if ($nick['online']) {die('Character must be offline mode!<br><br><a href="ColorChange.php">Back</a>');}
$tmp = $money['count'] - $price;
mysql_query("UPDATE `items` SET `count` = $tmp WHERE `item_id` = '$item_id' AND `owner_id` = ${nick['obj_Id']}");
mysql_query("UPDATE `characters` SET `name_color` = '$color' WHERE `obj_Id` = ${nick['obj_Id']}");
?>Name color changed<br><br><br><a href="ColorChange.php">Back</a> <?php
}
else
{
?>
<script language=javascript>
function isAlphaNumeric(value)
{
  if (value.match(/^[a-zA-Z0-9]+$/))
    return true;
  else
    return false;
}
function checkform(frm)
{
  if (frm.acc_name.value=="")
  {
    alert("Enter Account");
    return false;
  }
  if (!isAlphaNumeric(frm.acc_name.value))
  {
    alert("Invalid Account!");
    return false;
  }
  if (frm.nick.value=="")
  {
    alert("Enter Character Name");
    return false;
  }
  if (!isAlphaNumeric(frm.nick.value))
  {
    alert("Invalid Character Name");
    return false;
  }
  if (frm.pass.value=="")
  {
    alert("Enter Password");
    return false;
  }
  if (!isAlphaNumeric(frm.pass.value))
  {
    alert("Invalid Password");
    return false;
  }
  return true;
}
</script><br><br>

Here you can change your character's name color.<br><br> Price: <? echo $price; ?> <? echo $pricename; ?>.<br><br> 


<form action=ColorChange.php method=post onsubmit="return checkform(this)">
<table cellpadding=2 cellspacing=2>
<tr><td>Account:<td><input name=acc_name>
<tr><td>Password:<td><input name=pass type=password>
<tr><td>Character:<td><input name=nick>
<tr><td>Color:<td>  

Yellow<INPUT type=radio value="FFFF00" name=color maxlength="15">
Green  <INPUT type=radio value="00FF00" name=color maxlength="15">
Orange<INPUT type=radio value="FF8040" name=color maxlength="15">

<tr><td colspan=2><input type=submit name=submit value="Change Color">
</table></form>
<?php
}
?>
</center>
</body>
</html>

 

Credits to Me!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Migrating a legacy Interlude server to PostgreSQL while adding real observability is basically forcing 2006 MMO engineering to attend a 2026 infrastructure conference at gunpoint. PS: which revision of aCis? PS: 🧻what was broken during this whatever you call it.    AAC Guard beign asked to adapt to this be like: - Creating bugs since early 2018
    • OH MY LORDDDDDDDDDDDDDDDDDDDDD   FINALLY
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
    • I came out of my cave as I do once every 5 years. By now, I know nobody really cares about L2, but I still find it fun to experiment. Everything you see here will be free and open source. I have no interest in selling anything.   Long story short, I like to revisit Interlude and apply what I've learned to see how far I can push it. Here's Outerlude, a public fork of aCis for the modern age.   Video demo:   Work that has been done:   Redone the netcode from scratch to be async The NPC AI was completely redone based on Finite State Machines Moved to PostgreSQL and using some of its cool features Lots of config that should be hot reloadable has moved to the database OpenTelemetry instrumentation, where it makes sense, and a Grafana dashboard A built-in REST API for server management A built-in MCP Server for LLMs Nidrah AI, an AI Agent to make managing the server easier Real-time server map view Chat auditing and live snooping A new Fake Players Engine with a Node logic system and a new LLM planner for any behavior Just watch the video   If there is interest in this and I'm happy with it, or I get bored (which I always do), I will open-source it. Let me know what you think and if there is some feature you'd like me to implement.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..